增加null判断,关闭rfid开启与关闭

master
赵宝玉 2 months ago
parent ab65ca4bd4
commit 9d99552d37

@ -1,5 +1,6 @@
using System.ComponentModel; using System.ComponentModel;
using System.Reflection; using System.Reflection;
using HybirdFrameworkCore.Attribute;
namespace Entity.Constant; namespace Entity.Constant;
@ -11,9 +12,9 @@ public class SwapConstant
public enum CommunicationType public enum CommunicationType
{ {
[Description("发送")] [Const("发送")]
Send=1, Send=1,
[Description("接受")] [Const("接受")]
Receive, Receive,
} }
@ -24,9 +25,9 @@ public class SwapConstant
public enum StepType public enum StepType
{ {
[Description("自动")] [Const("自动")]
AUTO=1, AUTO=1,
[Description("手动")] [Const("手动")]
MANUAL, MANUAL,
} }
@ -37,9 +38,9 @@ public class SwapConstant
public enum PlcProtocol public enum PlcProtocol
{ {
[Description("初始化")] [Const("初始化")]
Init, Init,
[Description("下发启动换电")] [Const("下发启动换电")]
StartSwap, StartSwap,
} }
@ -50,11 +51,11 @@ public class SwapConstant
public enum RadarProtocol public enum RadarProtocol
{ {
[Description("开启雷达")] [Const("开启雷达")]
Open, Open,
[Description("关闭雷达")] [Const("关闭雷达")]
Close, Close,
[Description("车辆状态")] [Const("车辆状态")]
CarStatus, CarStatus,
} }
@ -65,15 +66,15 @@ public class SwapConstant
public enum RfidProtocol public enum RfidProtocol
{ {
[Description("连接Rfid")] [Const("连接Rfid")]
Connect, Connect,
[Description("开始读")] [Const("开始读")]
BeginRead, BeginRead,
[Description("读取Rfid数据")] [Const("读取Rfid数据")]
ReadRfidData, ReadRfidData,
[Description("停止读Rfid")] [Const("停止读Rfid")]
StopRead, StopRead,
[Description("断开连接")] [Const("断开连接")]
DisConnect, DisConnect,
} }
@ -85,11 +86,11 @@ public class SwapConstant
public enum TboxProtocol public enum TboxProtocol
{ {
[Description("心跳数据")] [Const("心跳数据")]
Heart, Heart,
[Description("加锁")] [Const("加锁")]
Lock, Lock,
[Description("解锁")] [Const("解锁")]
UnLock, UnLock,

@ -206,7 +206,7 @@ public class StationReadyState : IState
StationSoftMgr.PutDeviceLog((int)StationConstant.DeviceCode.Radar,SwapConstant.RadarProtocol.CarStatus, StationSoftMgr.PutDeviceLog((int)StationConstant.DeviceCode.Radar,SwapConstant.RadarProtocol.CarStatus,
null,(int)SwapConstant.CommunicationType.Receive); PadarMgr._PadarClient?.CarState.ToString(),(int)SwapConstant.CommunicationType.Receive);
if (PadarMgr._PadarClient?.CarState == 6) if (PadarMgr._PadarClient?.CarState == 6)
{ {
@ -257,10 +257,9 @@ public class StationReadyState : IState
return Invoker.Invoke(" BeginRead read rfid", 1000, 20, machine.IsCanceled, return Invoker.Invoke(" BeginRead read rfid", 1000, 20, machine.IsCanceled,
() => machine.BeginRfidReadFlag, () => () => machine.BeginRfidReadFlag, () =>
{ {
Task<bool> open = RfidApi.Connect(); // Task<bool> open = RfidApi.Connect();
if (open.Result)
{
machine.RfidConnectFlag = true; machine.RfidConnectFlag = true;
Task<bool> beginRead = RfidApi.BeginRead(); Task<bool> beginRead = RfidApi.BeginRead();
beginRead.Wait(); beginRead.Wait();
@ -274,7 +273,7 @@ public class StationReadyState : IState
_log.Info("begin read done"); _log.Info("begin read done");
machine.BeginRfidReadFlag = true; machine.BeginRfidReadFlag = true;
} }
}
}, () => }, () =>
@ -343,9 +342,9 @@ public class StationReadyState : IState
_CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.RfidReadFlag, _CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.RfidReadFlag,
machine,param:JsonConvert.SerializeObject(machine.RfidReadModel)); machine,param:JsonConvert.SerializeObject(machine.RfidReadModel));
RfidApi.StopRead(); //RfidApi.StopRead();
_log.Info("stop read rfid"); // _log.Info("stop read rfid");
RfidApi.DisConnect(); // RfidApi.DisConnect();
machine.RfidConnectFlag = false; machine.RfidConnectFlag = false;
machine.RfidReadFlag = true; machine.RfidReadFlag = true;
} }

@ -140,12 +140,16 @@ public class MonitorService
.TotalMinutes > .TotalMinutes >
StaticStationInfo.SwapFinishChargeTime).Count(); StaticStationInfo.SwapFinishChargeTime).Count();
if (monitorScreenResp.VehicleInfo.OrderNo!=null) if (monitorScreenResp.VehicleInfo.OrderNo != null)
{ {
SwapOrderBattery queryByClauseAsync = _SwapOrderBatteryRepository.QueryByClause(u => u.SwapOrderSn == monitorScreenResp.VehicleInfo.OrderNo); SwapOrderBattery queryByClauseAsync =
monitorScreenResp.VehicleInfo.DownBatteryBinNo = queryByClauseAsync.DownBatteryBinNo; _SwapOrderBatteryRepository.QueryByClause(u => u.SwapOrderSn == monitorScreenResp.VehicleInfo.OrderNo);
monitorScreenResp.VehicleInfo.UpBatteryBinNo = queryByClauseAsync.UpBatteryBinNo; if (queryByClauseAsync != null)
} {
monitorScreenResp.VehicleInfo.DownBatteryBinNo = queryByClauseAsync.DownBatteryBinNo;
monitorScreenResp.VehicleInfo.UpBatteryBinNo = queryByClauseAsync.UpBatteryBinNo;
}
}
monitorScreenResp.DeviceLogs = StationSoftMgr.DeviceLogs; monitorScreenResp.DeviceLogs = StationSoftMgr.DeviceLogs;

@ -2,7 +2,7 @@
"ConnectionStrings": { "ConnectionStrings": {
"ConfigId": "master", "ConfigId": "master",
"DbType": "MySql", "DbType": "MySql",
"SqlConnection": "server=127.0.0.1;Port=3306;Database=eaxing_dev;Uid=root;Pwd=admin123;Charset=utf8;" "SqlConnection": "server=127.0.0.1;Port=3306;Database=eaxing_test;Uid=root;Pwd=admin123;Charset=utf8;"
}, },
"Update": { "Update": {
"AutoUpdate": "false", "AutoUpdate": "false",
@ -110,9 +110,13 @@
} }
} }
}, },
"SignalR": {
"enable": true
},
"cloud": { "cloud": {
"enable": false "enable": false
}, },
"plc": { "plc": {
"enable": true "enable": true
}, },

Loading…
Cancel
Save