现场测试提交

master
lxw 6 months ago
parent 53e43d4f6f
commit cd2d247738

@ -6,11 +6,12 @@ public class InfoEnum
{ {
public enum SwapInfo : ushort public enum SwapInfo : ushort
{ {
[Info("欢迎光临长治换电站!(正在营业)","欢迎光临长治换电站!,本站正在营业中")]WelcomeInfo=1, [Info("欢迎光临换电站!(正在营业)","欢迎光临换电站!,本站正在营业中")]WelcomeInfo=1,
[Info("Rfid读写失败", "Rfid读写失败")] ErrorReadRfid , [Info("标签读写失败", "标签读写失败")] ErrorReadRfid ,
[Info("Tbox连接失败", "Tbox连接失败,请联系站务人员")] ErrorTBoxConn , [Info("车辆连接失败", "车辆连接失败,请联系站务人员")] ErrorTBoxConn ,
[Info("云端校验失败", "云端校验失败,请联系站务人员")] ErrorCloudCheck , [Info("云端校验失败", "云端校验失败,请联系站务人员")] ErrorCloudCheck ,
[Info("车辆已到位", "车辆已到位")] InfoCarInPosition , [Info("车辆已到位", "车辆已到位")] InfoCarInPosition ,
[Info("车辆到位超时", "车辆到位超时")] ErrorCarInPositionTimeout, [Info("车辆到位超时", "车辆到位超时")] ErrorCarInPositionTimeout,
@ -19,11 +20,9 @@ public class InfoEnum
[Info("解锁车辆失败", "解锁车辆失败")] ErrUnLockCar , [Info("解锁车辆失败", "解锁车辆失败")] ErrUnLockCar ,
[Info("选包失败,请驶离", "选包失败,请驶离")] ErrorSelectPack , [Info("选包失败,请驶离", "选包失败,请驶离")] ErrorSelectPack ,
[Info("通道拍照定位失败,请重新调整车辆位置", "通道拍照定位失败,请重新调整车辆位置")]ErrChannelStatus,
[Info("通道拍照定位失败,请重新调整车辆位置", "通道拍照定位失败,请重新调整车辆位置")]
ErrChannelStatus ,
[Info("电池拆卸中,请稍后", "电池拆卸中,请稍后")] InfoUnPack , [Info("电池拆卸中,请稍后", "电池拆卸中,请稍后")] InfoUnPack ,
[Info("电池安装中,请稍后", "电池安装中,请稍后")] InfoPack , [Info("电池安装中,请稍后", "电池安装中,请稍后")] InfoPack ,
@ -32,13 +31,16 @@ public class InfoEnum
[Info("换电已完成,请驶离", "换电已完成,请驶离")] InfoCarLeave , [Info("换电已完成,请驶离", "换电已完成,请驶离")] InfoCarLeave ,
[Info("换电失败,请驶离", "换电失败,请驶离")] ErrInfoCarLeave , [Info("换电失败,请驶离", "换电失败,请驶离")] ErrInfoCarLeave ,
[Info("旧电池搬运中,请稍后", "旧电池搬运中,请稍后")] InfoOldBatteryCarryIn , [Info("旧电池搬运中,请稍后", "旧电池搬运中,请稍后")] InfoOldBatteryCarryIn ,
[Info("旧电池搬运中,请稍后", "旧电池搬运中,请稍后")] InfoNewBatteryCarryOut , [Info("新电池搬运中,请稍后", "新电池搬运中,请稍后")] InfoNewBatteryCarryOut ,
[Info("车辆上锁失败", "车辆上锁失败")] ErrLockCar , [Info("车辆上锁失败", "车辆上锁失败")] ErrLockCar ,
[Info("通道的电池仓无可用换电电池","通道的电池仓无可用换电电池")] NoBatteryErr, [Info("通道的电池仓无可用换电电池","通道的电池仓无可用换电电池")] NoBatteryErr,
[Info("结束充电电池数量不足","通道的电池仓无可用换电电池")] LessOfFinishChargingErr, [Info("结束充电电池数量不足","通道的电池仓无可用换电电池")] LessOfFinishChargingErr,
[Info("空仓数量不足","通道的电池仓无可用换电电池")] LessOfEmptyBinErr, [Info("空仓数量不足","通道的电池仓无可用换电电池")] LessOfEmptyBinErr,
[Info("符合soc限制数量不足","通道的电池仓无可用换电电池")] LessOfSocErr, [Info("符合soc限制数量不足","通道的电池仓无可用换电电池")] LessOfSocErr,
[Info("结束充电大于3分钟的数量不足","通道的电池仓无可用换电电池")] LessOf3MinuteErr, [Info("结束充电大于3分钟的数量不足","通道的电池仓无可用换电电池")] LessOf3MinuteErr,
[Info("换电站处于手动模式,不能自动换电","换电站处于手动模式,不能自动换电")]InfoStationModel,
[Info("换电站处于本地模式,不能远程换电","换电站处于本地模式,不能远程换电")]InfoStationModelRemoteErr,
} }
public enum SelectBinStatusInfo : byte public enum SelectBinStatusInfo : byte

@ -360,6 +360,7 @@ public class CloudClient : IMqttClientConnectedHandler, IMqttApplicationMessageR
public VehicleCertificationResp? SendVehicleCertification(VehicleCertification vehicleCertification, public VehicleCertificationResp? SendVehicleCertification(VehicleCertification vehicleCertification,
TimeSpan timeSpan) TimeSpan timeSpan)
{ {
Log.Info(vehicleCertification);
this.CarAuth.Req = vehicleCertification; this.CarAuth.Req = vehicleCertification;
this.Publish(vehicleCertification); this.Publish(vehicleCertification);
return CarAuth.GetResp(timeSpan); return CarAuth.GetResp(timeSpan);

@ -13,7 +13,6 @@ public class CloudClientMgr
public static void Init() public static void Init()
{ {
SysConfigService sysConfigService = AppInfo.Container.Resolve<SysConfigService>();
CloudClient = AppInfo.Container.Resolve<CloudClient>(); CloudClient = AppInfo.Container.Resolve<CloudClient>();
CloudClient.ServerIp = StaticStationInfo.CloudServerIp; CloudClient.ServerIp = StaticStationInfo.CloudServerIp;
@ -29,6 +28,6 @@ public class CloudClientMgr
CloudClient.InitHandler(); CloudClient.InitHandler();
// BusinessTask.Run(() => CloudClient.Connect()); Task.Run(() => CloudClient.Connect());
} }
} }

@ -36,6 +36,10 @@ public class PlcApi
return PlcMgr.IsRemote(); return PlcMgr.IsRemote();
} }
public static bool IsAuto()
{
return PlcMgr.IsAuto();
}
/// <summary> /// <summary>
/// 入口雷达检测 /// 入口雷达检测
/// </summary> /// </summary>

@ -93,12 +93,16 @@ public class StationReadyState : IState
//LED显示-欢迎光临_换电站点_正在营业 //LED显示-欢迎光临_换电站点_正在营业
string welcomeContent = "欢迎光临" + StaticStationInfo.StationName + "正在营业"; string welcomeContent = "欢迎光临" + StaticStationInfo.StationName + "正在营业";
SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.WelcomeInfo); SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.WelcomeInfo);
// machine.LedTool?.WriteContent(welcomeContent); // machine.LedTool?.WriteContent(welcomeContent);
isRemote = true; isRemote = true;
} }
} }
}, },
() => { }, true); () =>
{
SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.InfoStationModelRemoteErr)
;
}, true);
} }
public InvokeStatus EntranceRadar(SwappingStateMachine machine) public InvokeStatus EntranceRadar(SwappingStateMachine machine)
@ -138,7 +142,7 @@ public class StationReadyState : IState
} }
}, () => }, () =>
{ {
// machine.LedTool.WriteProgramContent(InfoEnum.SwapInfo.ErrorReadRfid.GetLed()); // machine.LedTool.WriteProgramContent(InfoEnum.SwapInfo.ErrorReadRfid.GetLed());
SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.ErrorReadRfid); SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.ErrorReadRfid);
}, false, () => { machine.ExceptionReason = ExceptionReason.ReadRfidError; } }, false, () => { machine.ExceptionReason = ExceptionReason.ReadRfidError; }
, 1, InvokeStatus.TimeOut); , 1, InvokeStatus.TimeOut);
@ -181,9 +185,8 @@ public class StationReadyState : IState
//TODO::开始读rfid RfidService.BeginRead(); //TODO::开始读rfid RfidService.BeginRead();
Task<RfidReadModel?> rfidReadModel = RfidApi.ReadRifd(); Task<RfidReadModel?> rfidReadModel = RfidApi.ReadRifd();
rfidReadModel.Wait(); rfidReadModel.Wait();
if (/*rfidReadModel.IsCompletedSuccessfully &&*/ rfidReadModel.Result != null) if ( /*rfidReadModel.IsCompletedSuccessfully &&*/ rfidReadModel.Result != null)
{ {
machine.RfidReadModel = rfidReadModel.Result; machine.RfidReadModel = rfidReadModel.Result;
_log.Info($"read rfid={JsonConvert.SerializeObject(machine.RfidReadModel)}"); _log.Info($"read rfid={JsonConvert.SerializeObject(machine.RfidReadModel)}");
@ -207,7 +210,7 @@ public class StationReadyState : IState
} }
}, () => }, () =>
{ {
// machine.LedTool!.WriteProgramContent(InfoEnum.SwapInfo.ErrorReadRfid.GetLed()); // machine.LedTool!.WriteProgramContent(InfoEnum.SwapInfo.ErrorReadRfid.GetLed());
SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.ErrorReadRfid); SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.ErrorReadRfid);
}, true, () => { machine.ExceptionReason = ExceptionReason.ReadRfidError; }, 10, }, true, () => { machine.ExceptionReason = ExceptionReason.ReadRfidError; }, 10,
InvokeStatus.Exception); InvokeStatus.Exception);
@ -227,6 +230,4 @@ public class StationReadyState : IState
return swapOrder; return swapOrder;
} }
} }

@ -61,9 +61,20 @@ public class PlcMgr
{ {
if ((DateTime.Now - DataValidityTime).Seconds <= DataTimeSeconds) if ((DateTime.Now - DataValidityTime).Seconds <= DataTimeSeconds)
{ {
return (PlcToHostData.ModeControl.Value == 1010 && PlcToHostData.RemoteLocalControlState.Value == 1010) return PlcToHostData.RemoteLocalControlState.Value == 1010;
? true
: false; }
else
{
return false;
}
}
public static bool IsAuto()
{
if ((DateTime.Now - DataValidityTime).Seconds <= DataTimeSeconds)
{
return PlcToHostData.ModeControl.Value == 1010;
} }
else else
{ {

Loading…
Cancel
Save