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

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

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

@ -206,7 +206,7 @@ public class StationReadyState : IState
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)
{
@ -257,10 +257,9 @@ public class StationReadyState : IState
return Invoker.Invoke(" BeginRead read rfid", 1000, 20, machine.IsCanceled,
() => machine.BeginRfidReadFlag, () =>
{
Task<bool> open = RfidApi.Connect();
// Task<bool> open = RfidApi.Connect();
if (open.Result)
{
machine.RfidConnectFlag = true;
Task<bool> beginRead = RfidApi.BeginRead();
beginRead.Wait();
@ -274,7 +273,7 @@ public class StationReadyState : IState
_log.Info("begin read done");
machine.BeginRfidReadFlag = true;
}
}
}, () =>
@ -343,9 +342,9 @@ public class StationReadyState : IState
_CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.RfidReadFlag,
machine,param:JsonConvert.SerializeObject(machine.RfidReadModel));
RfidApi.StopRead();
_log.Info("stop read rfid");
RfidApi.DisConnect();
//RfidApi.StopRead();
// _log.Info("stop read rfid");
// RfidApi.DisConnect();
machine.RfidConnectFlag = false;
machine.RfidReadFlag = true;
}

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

@ -2,7 +2,7 @@
"ConnectionStrings": {
"ConfigId": "master",
"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": {
"AutoUpdate": "false",
@ -110,9 +110,13 @@
}
}
},
"SignalR": {
"enable": true
},
"cloud": {
"enable": false
},
"plc": {
"enable": true
},

Loading…
Cancel
Save