日志整理

master
lxw 6 months ago
parent b5ff5a4a75
commit ea9fa252b5

@ -137,7 +137,7 @@ public abstract class CloudApi
$" CloudApi CarCanStart "); $" CloudApi CarCanStart ");
var cloudClientCarCanStart = CloudClientMgr.CloudClient.CarCanStart; var cloudClientCarCanStart = CloudClientMgr.CloudClient.CarCanStart;
Log.Info( Log.Info(
$" CloudApi CarCanStart resp={cloudClientCarCanStart}"); $" CloudApi CarCanStart resp= {JsonConvert.SerializeObject(cloudClientCarCanStart)}");
return cloudClientCarCanStart; return cloudClientCarCanStart;
} }

@ -96,18 +96,18 @@ public class RfidApi
} }
} }
public static async Task<RfidReadModel?> ReadRifd() public static async Task<RfidReadModel?> ReadRfid()
{ {
Log.Info("RfidApi ReadRifd"); Log.Info("RfidApi ReadRfid");
string readUrl = BASE_URL + "/Api/BeginRead"; string readUrl = BASE_URL + "/Api/BeginRead";
string url = BASE_URL + "/Api/ReadRfidData"; string url = BASE_URL + "/Api/ReadRfidData";
try try
{ {
var vBeginRead = await _httpClient.GetStringAsync(readUrl); var vBeginRead = await _httpClient.GetStringAsync(readUrl);
string s = await _httpClient.GetStringAsync(url); string s = await _httpClient.GetStringAsync(url);
Log.Info($"ReadRifd resp={s}"); Log.Info($"ReadRfid resp={s}");
if (s != String.Empty) if (s != String.Empty)
{ {
RfidReadModel? model = JsonConvert.DeserializeObject<RfidReadModel>(s); RfidReadModel? model = JsonConvert.DeserializeObject<RfidReadModel>(s);
@ -119,7 +119,7 @@ public class RfidApi
} }
catch (Exception e) catch (Exception e)
{ {
Log.Error($"RfidApi ReadRifd err e={e}"); Log.Error($"RfidApi ReadRfid err e={e}");
return null; return null;
} }

@ -32,7 +32,7 @@ public class TBoxApi
tboxCarInfoModel = JsonConvert.DeserializeObject<TboxCarInfoModel>(s); tboxCarInfoModel = JsonConvert.DeserializeObject<TboxCarInfoModel>(s);
} }
Log.Info($"TBoxApi GetCarInfo resp = {tboxCarInfoModel}"); Log.Info($"TBoxApi GetCarInfo resp = {JsonConvert.SerializeObject(tboxCarInfoModel)}");
return tboxCarInfoModel; return tboxCarInfoModel;
} }
catch (Exception e) catch (Exception e)
@ -71,10 +71,10 @@ 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($"IsConnected resp={JsonConvert.SerializeObject(tboxCarInfoModel)}");
} }
Log.Info($"GetCarInfo resp = {tboxCarInfoModel}"); Log.Info($"GetCarInfo resp = {JsonConvert.SerializeObject(tboxCarInfoModel)}");
return tboxCarInfoModel.Connected; return tboxCarInfoModel.Connected;
} }
catch (Exception e) catch (Exception e)
@ -99,7 +99,7 @@ public class TBoxApi
bools.Add(unLockCar); bools.Add(unLockCar);
} }
} }
Log.Info($" TBoxApi end UnLockCarManyTimes carNo={carNo} time={_times} resp={JsonConvert.SerializeObject(bools)}"); Log.Info($" TBoxApi end UnLockCarManyTimes carNo={carNo} times={_times} resp={JsonConvert.SerializeObject(bools)}");
return bools.Select(i => i).Count() > _successTimes; return bools.Select(i => i).Count() > _successTimes;
} }
@ -117,7 +117,7 @@ public class TBoxApi
bools.Add(unLockCar); bools.Add(unLockCar);
} }
} }
Log.Info($" TBoxApi end LockCarManyTimes carNo={carNo} time={_times} resp={JsonConvert.SerializeObject(bools)}"); Log.Info($" TBoxApi end LockCarManyTimes carNo={carNo} times={_times} resp={JsonConvert.SerializeObject(bools)}");
return bools.Select(i => i).Count() > _successTimes; return bools.Select(i => i).Count() > _successTimes;
} }
@ -158,7 +158,7 @@ public class TBoxApi
tboxCarInfoModels = JsonConvert.DeserializeObject<List<TboxCarInfoModel>>(s); tboxCarInfoModels = JsonConvert.DeserializeObject<List<TboxCarInfoModel>>(s);
} }
Log.Info($"TBoxApi GetCarInfoList resp = {tboxCarInfoModels}"); Log.Info($"TBoxApi GetCarInfoList resp = {JsonConvert.SerializeObject(tboxCarInfoModels)}");
return tboxCarInfoModels; return tboxCarInfoModels;
} }
catch (Exception e) catch (Exception e)

@ -208,7 +208,7 @@ public class StationReadyState : IState
return Invoker.Invoke("read rfid", 3000, 20, machine.IsCanceled, return Invoker.Invoke("read rfid", 3000, 20, machine.IsCanceled,
() => machine.RfidReadFlag, () => () => machine.RfidReadFlag, () =>
{ {
Task<RfidReadModel?> rfidReadModel = RfidApi.ReadRifd(); Task<RfidReadModel?> rfidReadModel = RfidApi.ReadRfid();
rfidReadModel.Wait(); rfidReadModel.Wait();
var machineRfidReadModel = rfidReadModel.Result; var machineRfidReadModel = rfidReadModel.Result;

Loading…
Cancel
Save