diff --git a/lua/metrostroi/systems/sys_81_722_electric.lua b/lua/metrostroi/systems/sys_81_722_electric.lua index 7976900..943d893 100644 --- a/lua/metrostroi/systems/sys_81_722_electric.lua +++ b/lua/metrostroi/systems/sys_81_722_electric.lua @@ -130,7 +130,7 @@ function TRAIN_SYSTEM:Think(dT) Train:WriteTrainWire(13,S["RVnE"]*C(Train.KRO.Value==0)) Train:WriteTrainWire(36,BO*Train.SF3.Value*C(Train.VRU.Value >0)*self.CabActive) Train:WriteTrainWire(34,S["RU"]) - Train:WriteTrainWire(19,S["RU"]*Train.EmergencyDrive.Value) + Train:WriteTrainWire(19,S["RU"]*(1-Train.Pneumatic.SD3)*Train.EmergencyDrive.Value) Train:WriteTrainWire(27,BO*S["RU"]) Train:WriteTrainWire(29,self.BTB*S["RU"]*(C(Panel.Controller<=-2)+Train.EmergencyBrakeTPlus.Value)) @@ -200,7 +200,7 @@ function TRAIN_SYSTEM:Think(dT) Train:WriteTrainWire(8,W[-8]*S["DoorsP"]*Train.S1.Value) Panel.DoorsW = S["DoorsP"]*(1-Train.S1.Value) - Panel.BrW = BO*Train.SF36.Value*Train.Pneumatic.SD3 + Panel.BrW = BO*Train.SF36.Value*Train.Pneumatic.SD4 Panel.AnnouncerPlaying = W[15] S["WagP"] = Train.Battery.Value*Train.SF33.Value if self.HaveAsyncInverter > 0 then diff --git a/lua/metrostroi/systems/sys_81_722_pneumatic.lua b/lua/metrostroi/systems/sys_81_722_pneumatic.lua index 6ef560c..97fd110 100644 --- a/lua/metrostroi/systems/sys_81_722_pneumatic.lua +++ b/lua/metrostroi/systems/sys_81_722_pneumatic.lua @@ -47,6 +47,7 @@ function TRAIN_SYSTEM:Initialize() self.K2 = false self.SD2 = 0 self.SD3 = 0 + self.SD4 = 0 -- Isolation valves self.Train:LoadSystem("FrontBrakeLineIsolation","Relay","Switch", { normally_closed = true, bass = true}) self.Train:LoadSystem("RearBrakeLineIsolation","Relay","Switch", { normally_closed = true, bass = true}) @@ -113,7 +114,7 @@ end function TRAIN_SYSTEM:Outputs() return { "BrakeLinePressure", "BrakeCylinderPressure", "DriverValvePosition", - "ReservoirPressure", "TrainLinePressure", "DoorLinePressure", "WeightLoadRatio", "SD2","SD3" } + "ReservoirPressure", "TrainLinePressure", "DoorLinePressure", "WeightLoadRatio", "SD2","SD3","SD4" } end function TRAIN_SYSTEM:TriggerInput(name,value) @@ -472,7 +473,9 @@ function TRAIN_SYSTEM:Think(dT) if self.BrakeLinePressure <= 2.6 and self.SD2~=1 then self.SD2 = 1 end if self.BrakeLinePressure >= 2.8 and self.SD2~=0 then self.SD2 = 0 end - self.SD3 = (IsValid(Train.FrontBogey) and Train.FrontBogey.BrakeCylinderPressure+(not Train.FrontBogey.DisableParking and Train.FrontBogey.ParkingBrakePressure or 0) or self.BrakeCylinderPressure)>0.1 and 1 or 0 + if self.BrakeLinePressure <= 2.0 and self.SD3~=1 then self.SD3 = 1 end + if self.BrakeLinePressure >= 2.2 and self.SD3~=0 then self.SD3 = 0 end + self.SD4 = (IsValid(Train.FrontBogey) and Train.FrontBogey.BrakeCylinderPressure+(not Train.FrontBogey.DisableParking and Train.FrontBogey.ParkingBrakePressure or 0) or self.BrakeCylinderPressure)>0.1 and 1 or 0 ---------------------------------------------------------------------------- -- FIXME Train:SetNW2Bool("FbI",Train.FrontBrakeLineIsolation.Value ~= 0)