日志整理

zw
lxw 6 months ago
parent 0d0228b855
commit b5ff5a4a75

@ -68,6 +68,7 @@ public class PlcApi
/// <returns></returns> /// <returns></returns>
public static bool WriteEntranceLamp(ushort data) public static bool WriteEntranceLamp(ushort data)
{ {
Log.Info($"PlcApi writeEntranceLamp start data={data}");
var writeEntranceLamp = PlcMgr.WriteEntranceLamp(data); var writeEntranceLamp = PlcMgr.WriteEntranceLamp(data);
Log.Info($"PlcApi writeEntranceLamp resp={writeEntranceLamp}"); Log.Info($"PlcApi writeEntranceLamp resp={writeEntranceLamp}");
return writeEntranceLamp; return writeEntranceLamp;
@ -82,6 +83,7 @@ public class PlcApi
/// <returns></returns> /// <returns></returns>
public static bool WriteExistLamp(ushort data) public static bool WriteExistLamp(ushort data)
{ {
Log.Info($"PlcApi WriteExistLamp start data={data}");
var writeExistLamp = PlcMgr.WriteExistLamp(data); var writeExistLamp = PlcMgr.WriteExistLamp(data);
Log.Info($"PlcApi WriteExistLamp resp={writeExistLamp}"); Log.Info($"PlcApi WriteExistLamp resp={writeExistLamp}");
return writeExistLamp; return writeExistLamp;
@ -95,6 +97,7 @@ public class PlcApi
/// <returns></returns> /// <returns></returns>
public static bool DistributeSelectPack(string inBinNo, string outBinNo) public static bool DistributeSelectPack(string inBinNo, string outBinNo)
{ {
Log.Info($"PlcApi DistributeSelectPack start inBinNo={inBinNo} outBinNo={outBinNo}");
return PlcMgr.DistributeBinNo(inBinNo, outBinNo); return PlcMgr.DistributeBinNo(inBinNo, outBinNo);
} }
@ -132,6 +135,7 @@ public class PlcApi
/// <returns></returns> /// <returns></returns>
public static bool HoldOn() public static bool HoldOn()
{ {
Log.Info($"PlcApi start HoldOn ");
var holdOn = PlcMgr.HoldOn(); var holdOn = PlcMgr.HoldOn();
Log.Info($"PlcApi HoldOn resp={holdOn}"); Log.Info($"PlcApi HoldOn resp={holdOn}");
return holdOn; return holdOn;
@ -144,6 +148,7 @@ public class PlcApi
/// <returns></returns> /// <returns></returns>
public static ushort ChannelStatus() public static ushort ChannelStatus()
{ {
Log.Info($"PlcApi start ChannelStatus ");
PlcMgr.ResetPlc(); PlcMgr.ResetPlc();
var channelStatus = PlcMgr.ChannelStatus(); var channelStatus = PlcMgr.ChannelStatus();
Log.Info($"PlcApi ChannelStatus resp= {channelStatus}"); Log.Info($"PlcApi ChannelStatus resp= {channelStatus}");
@ -157,6 +162,7 @@ public class PlcApi
/// <returns>6未连接</returns> /// <returns>6未连接</returns>
public static int ReadPlcTaskStatus() public static int ReadPlcTaskStatus()
{ {
Log.Info($"PlcApi start ReadPlcTaskStatus ");
var readPlcTaskStatus = PlcMgr.ReadPlcTaskStatus(); var readPlcTaskStatus = PlcMgr.ReadPlcTaskStatus();
Log.Info($"PlcApi ReadPlcTaskStatus resp= {readPlcTaskStatus}"); Log.Info($"PlcApi ReadPlcTaskStatus resp= {readPlcTaskStatus}");
return readPlcTaskStatus; return readPlcTaskStatus;

@ -7,7 +7,7 @@ namespace Service.Execute.Api;
public class TBoxApi public class TBoxApi
{ {
private static readonly ILog Log = LogManager.GetLogger("TBoxApi"); private static readonly ILog Log = LogManager.GetLogger("TboxApi");
private static readonly string BASE_URL = "http://localhost:5036"; private static readonly string BASE_URL = "http://localhost:5036";
@ -21,7 +21,7 @@ public class TBoxApi
public static async Task<TboxCarInfoModel> GetCarInfo(string carNo) public static async Task<TboxCarInfoModel> GetCarInfo(string carNo)
{ {
Log.Info(" TBoxApi GetCarInfo"); Log.Info($" TBoxApi GetCarInfo carNo={carNo}");
string url = BASE_URL + "/getCarInfo/" + carNo; string url = BASE_URL + "/getCarInfo/" + carNo;
try try
{ {
@ -62,7 +62,7 @@ public class TBoxApi
public static async Task<bool> IsConnected(string carNo) public static async Task<bool> IsConnected(string carNo)
{ {
Log.Info("IsConnected"); Log.Info($"IsConnected carNo={carNo}");
string url = BASE_URL + "/getCarInfo/"+carNo; string url = BASE_URL + "/getCarInfo/"+carNo;
try try
{ {
@ -71,6 +71,7 @@ public class TBoxApi
if (!String.IsNullOrWhiteSpace(s)) if (!String.IsNullOrWhiteSpace(s))
{ {
tboxCarInfoModel = JsonConvert.DeserializeObject<TboxCarInfoModel>(s); tboxCarInfoModel = JsonConvert.DeserializeObject<TboxCarInfoModel>(s);
Log.Info($"IsConnected resp={tboxCarInfoModel}");
} }
Log.Info($"GetCarInfo resp = {tboxCarInfoModel}"); Log.Info($"GetCarInfo resp = {tboxCarInfoModel}");
@ -146,7 +147,7 @@ public class TBoxApi
public static async Task<List<TboxCarInfoModel>> GetCarInfoList() public static async Task<List<TboxCarInfoModel>> GetCarInfoList()
{ {
Log.Info(" TBoxApi GetCarInfoList start"); Log.Info(" TBoxApi GetCarInfoList start ");
string url = BASE_URL + "/getCarInfoList" ; string url = BASE_URL + "/getCarInfoList" ;
try try
{ {

Loading…
Cancel
Save