去掉led 注释云平台

zw
lxw 6 months ago
parent 08a9d4462e
commit bc18b36369

@ -26,7 +26,7 @@ public class BinInfoRepository : BaseRepository<BinInfo>
SuccessFlag = false,
};
List<BinInfo> list =
QueryListByClause(i =>
QueryListByClause(i =>i.No!="1" &&
i.Exists == 1 && i.Status == 1 && i.AmtLock == (int)InfoEnum.AmtBatLockStatus.UnLock);
if (list.Count <= 0)
{

@ -65,7 +65,7 @@ public class CarCtrlState : IState
}
}, () =>
{
machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrUnLockCar.GetLed());
// machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrUnLockCar.GetLed());
SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.ErrUnLockCar);
}, false, () => { machine.ExceptionReason = ExceptionReason.UnLockCarError; }
, 10, InvokeStatus.None);
@ -90,6 +90,10 @@ public class CarCtrlState : IState
_CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.DistributeSelectPackFlag,
machine);
}
}, () => { machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrDistributeSelectPack.GetLed()); });
}, () =>
{
// machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrDistributeSelectPack.GetLed());
});
}
}

@ -40,11 +40,11 @@ public class CarPrepareState : IState
}
//云平台车辆认证
var cloudCheckVel = CloudCheckVel(machine);
/*var cloudCheckVel = CloudCheckVel(machine);
if (cloudCheckVel != InvokeStatus.Done)
{
return SwappingStateMachine.ReturnWithInvokeErr(cloudCheckVel, ExceptionReason.None);
}
}*/
//检查tbox链接状态
InvokeStatus checkTBoxConnect = CheckTBoxConnectFlag(machine);
@ -62,11 +62,11 @@ public class CarPrepareState : IState
//云端数据上报
InvokeStatus cloudTBox = CloudTBoxFlag(machine);
if (cloudTBox != InvokeStatus.Done)
// InvokeStatus cloudTBox = CloudTBoxFlag(machine);
/*if (cloudTBox != InvokeStatus.Done)
{
return SwappingStateMachine.ReturnWithInvokeErr(cloudTBox, ExceptionReason.None);
}
}*/
machine.ExceptionReason = ExceptionReason.None;
@ -109,16 +109,16 @@ public class CarPrepareState : IState
//写入口等 :红灯
if (PlcApi.WriteEntranceLamp(1020))
{
machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.InfoCarInPosition.GetLed());
// machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.InfoCarInPosition.GetLed());
SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.InfoCarInPosition);
machine.VehiclesInPlaceFlag = true;
//告知云平台换电准备完成
machine.BusinessSwappingForCloudState =
InfoEnum.BusinessSwappingForCloudState.SwapReady;
machine.ExceptionReason = ExceptionReason.None;
CloudApi.SendStateLog(machine.SwapOrder, machine.BusinessSwappingForCloudState);
// CloudApi.SendStateLog(machine.SwapOrder, machine.BusinessSwappingForCloudState);
//清除下发的指令,等待新的指令
CloudApi.ClearCarCanStartInfo();
// CloudApi.ClearCarCanStartInfo();
_CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.CarInPositionFlag,
machine);
@ -127,7 +127,7 @@ public class CarPrepareState : IState
}, () =>
{
machine.ExceptionReason = ExceptionReason.CarInPositionError;
machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrorCarInPositionTimeout.GetLed());
// machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrorCarInPositionTimeout.GetLed());
SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.ErrorCarInPositionTimeout);
}, false, () => { }
, 20, InvokeStatus.None);
@ -151,14 +151,14 @@ public class CarPrepareState : IState
if (vehicleCheck != 0)
{
_log.Info("cloud check vehicle error");
machine.LedTool?.WriteProgramContent("换电准备中:云平台车辆验证完成");
// machine.LedTool?.WriteProgramContent("换电准备中:云平台车辆验证完成");
}
else
{
machine.ExceptionReason = ExceptionReason.None;
_log.Info("cloud check vehicle done");
machine.CloudVelCheckFlag = true;
machine.LedTool?.WriteProgramContent("换电准备中:云平台车辆验证完成");
// machine.LedTool?.WriteProgramContent("换电准备中:云平台车辆验证完成");
_CommonMgr.InsertStep(InfoEnum.BusinessSwappingStep.CloudVelCheckFlag,
machine);
@ -170,7 +170,7 @@ public class CarPrepareState : IState
}
}, () =>
{
machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrorCloudCheck.GetLed());
// machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrorCloudCheck.GetLed());
SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.ErrorCloudCheck);
}, false, () => { machine.ExceptionReason = ExceptionReason.CloudCheckError; }
, 20, InvokeStatus.None);
@ -195,7 +195,7 @@ public class CarPrepareState : IState
}, () => { machine.ExceptionReason = ExceptionReason.ConnTBoxError; }, false, () =>
{
machine.ExceptionReason = ExceptionReason.ConnTBoxError;
machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrorTBoxConn.GetLed());
// machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrorTBoxConn.GetLed());
SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.ErrorTBoxConn);
}
, 10, InvokeStatus.None);
@ -243,10 +243,14 @@ public class CarPrepareState : IState
if (tBoxCarInfoModel.Connected)
{
//将数据上报云平台
CloudApi.UploadTBoxCarInfo(machine.SwapOrder!, machine.BoxCarInfoModel);
// CloudApi.UploadTBoxCarInfo(machine.SwapOrder!, machine.BoxCarInfoModel);
}
}
}, () => { machine.LedTool?.WriteProgramContent("车机蓝牙车辆数据上报异常,请联系站务人员"); }, false, () =>
}, () =>
{
// machine.LedTool?.WriteProgramContent("车辆电池数据上报异常,请联系站务人员");
// SoundTool.PlayOneSound(InfoEnum.SwapInfo.ErrorSelectPack);
}, false, () =>
{
machine.ExceptionReason = ExceptionReason.CloudCarDataUploadError;
}
@ -286,7 +290,7 @@ public class CarPrepareState : IState
if (orderBatteryInfo.CanSwap != InfoEnum.SelectBinStatusInfo.Success)
{
machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrorSelectPack.GetLed());
// machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrorSelectPack.GetLed());
SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.ErrorSelectPack);
Thread.Sleep(1000 * 3);
_log.Info($"SelectPack error CanSwap={machine.SwapOrderBatteryInfo.CanSwap}");

@ -24,7 +24,7 @@ public class DoSwappingState : IState
machine.BusinessSwappingForCloudState = InfoEnum.BusinessSwappingForCloudState.BeginSwap;
machine.BusinessSwappingStateUpdateTime = DateTime.Now;
_log.Info($"BusinessSwappingForCloudState={machine.BusinessSwappingForCloudState}");
CloudApi.SendStateLog(machine.SwapOrder, InfoEnum.BusinessSwappingForCloudState.BeginSwap);
// CloudApi.SendStateLog(machine.SwapOrder, InfoEnum.BusinessSwappingForCloudState.BeginSwap);
//再次读锁止状态防止plc需要挪车
@ -134,7 +134,7 @@ public class DoSwappingState : IState
return Invoker.Invoke("plc UnPack", 500, 5, machine.IsCanceled,
() => machine.UnOldBatteryFlag, () =>
{
machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.InfoUnPack.GetLed());
// machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.InfoUnPack.GetLed());
SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.InfoUnPack);
machine.UnOldBatteryFlag = PlcApi.ReadPlcTaskStatus() == 1002;
@ -152,7 +152,7 @@ public class DoSwappingState : IState
return Invoker.Invoke("plc OldBatteryCarryIn", 500, 5, machine.IsCanceled,
() => machine.StorageOldBatteryFlag, () =>
{
machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.InfoOldBatteryCarryIn.GetLed());
// machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.InfoOldBatteryCarryIn.GetLed());
SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.InfoOldBatteryCarryIn);
machine.StorageOldBatteryFlag = PlcApi.ReadPlcTaskStatus() == 1003;
@ -170,7 +170,7 @@ public class DoSwappingState : IState
return Invoker.Invoke("plc NewBatteryCarryOut", 500, 5, machine.IsCanceled,
() => machine.OutNewBatteryFlag, () =>
{
machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.InfoNewBatteryCarryOut.GetLed());
// machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.InfoNewBatteryCarryOut.GetLed());
SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.InfoNewBatteryCarryOut);
machine.OutNewBatteryFlag = PlcApi.ReadPlcTaskStatus() == 1004;
@ -188,7 +188,7 @@ public class DoSwappingState : IState
return Invoker.Invoke("plc Pack ing", 500, 5, machine.IsCanceled,
() => machine.InstallNewBatteryFlag, () =>
{
machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.InfoPack.GetLed());
// machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.InfoPack.GetLed());
SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.InfoPack);
machine.InstallNewBatteryFlag = PlcApi.ReadPlcTaskStatus() == 1005;
@ -206,14 +206,14 @@ public class DoSwappingState : IState
return Invoker.Invoke("plc Pack Finish", 500, 5, machine.IsCanceled,
() => machine.FinishNewBatteryFlag, () =>
{
machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.InfoPackFinish.GetLed());
// machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.InfoPackFinish.GetLed());
SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.InfoPackFinish);
if (PlcApi.ReadPlcTaskStatus() == 1006)
{
machine.FinishNewBatteryFlag = true;
machine.BusinessSwappingForCloudState =
InfoEnum.BusinessSwappingForCloudState.SwapFinish;
CloudApi.SendStateLog(machine.SwapOrder, machine.BusinessSwappingForCloudState);
// CloudApi.SendStateLog(machine.SwapOrder, machine.BusinessSwappingForCloudState);
machine.BusinessSwappingStateUpdateTime = DateTime.Now;
//上报云平台换电完成
machine.SwapStatus = 1;
@ -251,7 +251,7 @@ public class DoSwappingState : IState
var lockCar = TBoxApi.LockCar();
if (lockCar.Result)
{
machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrChannelStatus.GetLed());
// machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrChannelStatus.GetLed());
SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.ErrChannelStatus);
//等待3分钟
Thread.Sleep(3000);
@ -301,7 +301,7 @@ public class DoSwappingState : IState
}, () =>
{
machine.ExceptionReason = ExceptionReason.CarInPositionError;
machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrorCarInPositionTimeout.GetLed());
// machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrorCarInPositionTimeout.GetLed());
SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.ErrorCarInPositionTimeout);
}, false, () => { }
, 20, InvokeStatus.None);

@ -93,7 +93,7 @@ public class StationReadyState : IState
//LED显示-欢迎光临_换电站点_正在营业
string welcomeContent = "欢迎光临" + StaticStationInfo.StationName + "正在营业";
machine.LedTool?.WriteContent(welcomeContent);
// machine.LedTool?.WriteContent(welcomeContent);
isRemote = true;
}
}
@ -138,7 +138,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);
}, false, () => { machine.ExceptionReason = ExceptionReason.ReadRfidError; }
, 1, InvokeStatus.TimeOut);
@ -215,7 +215,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);
}, true, () => { machine.ExceptionReason = ExceptionReason.ReadRfidError; }, 10,
InvokeStatus.Exception);

@ -77,12 +77,12 @@ public class SwapCanStartState : IState
_log.Info("SwapCanStart cancel");
//语音提示云平台取消换电
machine.CloudCarCanStartFlag = false;
machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.CloudSendSwapCancel.GetLed());
// machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.CloudSendSwapCancel.GetLed());
SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.CloudSendSwapError);
machine.BusinessSwappingForCloudState =
InfoEnum.BusinessSwappingForCloudState.SwapReady;
CloudApi.SendStateLog(machine.SwapOrder,
machine.BusinessSwappingForCloudState);
// CloudApi.SendStateLog(machine.SwapOrder,
// machine.BusinessSwappingForCloudState);
}
}
}
@ -96,7 +96,7 @@ public class SwapCanStartState : IState
}, () =>
{
machine.ExceptionReason = ExceptionReason.CloudSendSwapError;
machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.CloudSendSwapError.GetLed());
// machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.CloudSendSwapError.GetLed());
SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.CloudSendSwapError);
}, false, () => { }
, 10, InvokeStatus.None);

@ -37,7 +37,7 @@ public class SwapDoneState : IState
{
//上传云平台换电状态
machine.BusinessSwappingForCloudState = InfoEnum.BusinessSwappingForCloudState.SwapDoneWithVel;
CloudApi.SendStateLog(machine.SwapOrder, machine.BusinessSwappingForCloudState);
// CloudApi.SendStateLog(machine.SwapOrder, machine.BusinessSwappingForCloudState);
}
//云平台没有匹配的失败状态
@ -82,10 +82,10 @@ public class SwapDoneState : IState
//设置出口的是绿灯
if (PlcApi.WriteExistLamp(1000))
{
machine.LedTool?.WriteProgramContent(
/*machine.LedTool?.WriteProgramContent(
machine.SwapStatus == (int)InfoEnum.SwapOrderResult.Success
? InfoEnum.SwapInfo.InfoCarLeave.GetLed()
: InfoEnum.SwapInfo.ErrInfoCarLeave.GetLed());
: InfoEnum.SwapInfo.ErrInfoCarLeave.GetLed());*/
SoundTool.PlayOneSound(machine.SwapStatus == (int)InfoEnum.SwapOrderResult.Success
? (int)InfoEnum.SwapInfo.InfoCarLeave
: (int)InfoEnum.SwapInfo.ErrInfoCarLeave);
@ -99,7 +99,7 @@ public class SwapDoneState : IState
}
}, () =>
{
machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrLockCar.GetLed());
// machine.LedTool?.WriteProgramContent(InfoEnum.SwapInfo.ErrLockCar.GetLed());
SoundTool.PlayOneSound((int)InfoEnum.SwapInfo.ErrLockCar);
}, false, () => { machine.ExceptionReason = ExceptionReason.LockCarError; }
, 10, InvokeStatus.None);

@ -173,7 +173,7 @@ public class MonitorService
{
List<BinInfo> queryListByClause = BinInfoRepository.Query();
var configBinInfo =
new MapperConfiguration(cfg => cfg.CreateMap<BinInfo, BinInfo>().ReverseMap());
new MapperConfiguration(cfg => cfg.CreateMap<BinInfo, BinInfoResp>().ReverseMap());
IMapper mapperBinInfo = configBinInfo.CreateMapper();
return Result<List<BinInfoResp>>.Success(mapperBinInfo.Map<List<BinInfoResp>>(queryListByClause));

Loading…
Cancel
Save