状态判断bug

zw
lxw 5 months ago
parent 1c14a95116
commit 16adcd42f6

@ -114,48 +114,42 @@ public class CarPrepareState : IState
() => machine.VehiclesInPlaceFlag, () =>
{
var result = TBoxApi.GetCarInfo(machine.RfidReadModel.VelVin);
bool keyStatus = false;
bool breakStatus = false;
bool nStatus = false;
TboxCarInfoModel tboxCarInfoModel = result.Result;
if (StaticStationInfo.TboxStateFlameout ||
StaticStationInfo.TboxStateBreak ||
StaticStationInfo.TboxStateN)
int succCount = 0;
List<bool> succL = new List<bool>()
{
var status = tboxCarInfoModel?.CarStatus;
StaticStationInfo.TboxStateFlameout, StaticStationInfo.TboxStateBreak, StaticStationInfo.TboxStateN
};
var successCount = succL.Where(i => i).Count();
TboxCarInfoModel tboxCarInfoModel = result.Result;
if (StaticStationInfo.TboxStateFlameout)
{
if (status?.Keys == 0)
{
keyStatus = true;
}
}
var status = tboxCarInfoModel?.CarStatus;
if (StaticStationInfo.TboxStateBreak)
if (StaticStationInfo.TboxStateFlameout)
{
if (status?.Keys == 0)
{
if (status?.Break == 1)
{
breakStatus = true;
}
succCount++;
}
}
if (StaticStationInfo.TboxStateN)
if (StaticStationInfo.TboxStateBreak)
{
if (status?.Break == 1)
{
if (status?.Gear == 0)
{
nStatus = true;
}
succCount++;
}
}
else
if (StaticStationInfo.TboxStateN)
{
keyStatus = true;
breakStatus = true;
nStatus = true;
if (status?.Gear == 0)
{
succCount++;
}
}
if (keyStatus && breakStatus && nStatus)
if (succCount == successCount)
{
machine.VehiclesInPlaceFlag = true;
//写入口等 :红灯
@ -376,7 +370,7 @@ public class CarPrepareState : IState
SwapOrderBatteryInfo orderBatteryInfo = null;
if (swapAmtOrder != null)
{
orderBatteryInfo = _CommonMgr.SelectPackArm(swapAmtOrder,machine);
orderBatteryInfo = _CommonMgr.SelectPackArm(swapAmtOrder, machine);
}
else
{

@ -416,48 +416,40 @@ public class DoSwappingState : IState
var result = TBoxApi.GetCarInfo(machine.RfidReadModel.VelVin);
TboxCarInfoModel tboxCarInfoModel = result.Result;
bool keyStatus = false;
bool breakStatus = false;
bool nStatus = false;
if (StaticStationInfo.TboxStateFlameout ||
StaticStationInfo.TboxStateBreak ||
StaticStationInfo.TboxStateN)
int succCount = 0;
List<bool> succL = new List<bool>()
{
var status = tboxCarInfoModel?.CarStatus;
StaticStationInfo.TboxStateFlameout, StaticStationInfo.TboxStateBreak, StaticStationInfo.TboxStateN
};
var successCount = succL.Where(i => i).Count();
if (StaticStationInfo.TboxStateFlameout)
{
if (status?.Keys == 0)
{
keyStatus = true;
}
}
var status = tboxCarInfoModel?.CarStatus;
if (StaticStationInfo.TboxStateBreak)
if (StaticStationInfo.TboxStateFlameout)
{
if (status?.Keys == 0)
{
if (status?.Break == 1)
{
breakStatus = true;
}
succCount++;
}
}
if (StaticStationInfo.TboxStateN)
if (StaticStationInfo.TboxStateBreak)
{
if (status?.Break == 1)
{
if (status?.Gear == 0)
{
nStatus = true;
}
succCount++;
}
}
else
if (StaticStationInfo.TboxStateN)
{
keyStatus = true;
breakStatus = true;
nStatus = true;
if (status?.Gear == 0)
{
succCount++;
}
}
if (keyStatus && breakStatus && nStatus)
if (succCount==successCount)
{
machine.VehiclesInPlace2Flag = true;
}

Loading…
Cancel
Save