状态判断bug

zw
lxw 5 months ago
parent 1c14a95116
commit 16adcd42f6

@ -114,21 +114,21 @@ 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>()
{
StaticStationInfo.TboxStateFlameout, StaticStationInfo.TboxStateBreak, StaticStationInfo.TboxStateN
};
var successCount = succL.Where(i => i).Count();
TboxCarInfoModel tboxCarInfoModel = result.Result;
var status = tboxCarInfoModel?.CarStatus;
if (StaticStationInfo.TboxStateFlameout)
{
if (status?.Keys == 0)
{
keyStatus = true;
succCount++;
}
}
@ -136,7 +136,7 @@ public class CarPrepareState : IState
{
if (status?.Break == 1)
{
breakStatus = true;
succCount++;
}
}
@ -144,18 +144,12 @@ public class CarPrepareState : IState
{
if (status?.Gear == 0)
{
nStatus = true;
}
succCount++;
}
}
else
{
keyStatus = true;
breakStatus = true;
nStatus = true;
}
if (keyStatus && breakStatus && nStatus)
if (succCount == successCount)
{
machine.VehiclesInPlaceFlag = true;
//写入口等 :红灯

@ -416,20 +416,20 @@ 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>()
{
StaticStationInfo.TboxStateFlameout, StaticStationInfo.TboxStateBreak, StaticStationInfo.TboxStateN
};
var successCount = succL.Where(i => i).Count();
var status = tboxCarInfoModel?.CarStatus;
if (StaticStationInfo.TboxStateFlameout)
{
if (status?.Keys == 0)
{
keyStatus = true;
succCount++;
}
}
@ -437,7 +437,7 @@ public class DoSwappingState : IState
{
if (status?.Break == 1)
{
breakStatus = true;
succCount++;
}
}
@ -445,19 +445,11 @@ public class DoSwappingState : IState
{
if (status?.Gear == 0)
{
nStatus = true;
succCount++;
}
}
}
else
{
keyStatus = true;
breakStatus = true;
nStatus = true;
}
if (keyStatus && breakStatus && nStatus)
if (succCount==successCount)
{
machine.VehiclesInPlace2Flag = true;
}

Loading…
Cancel
Save