From 38b6931ab6eaff93c93188b81464bd1b73d1b1b4 Mon Sep 17 00:00:00 2001 From: Hellss Date: Wed, 27 Jan 2021 23:48:08 +0300 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=20=D0=A1=D0=943,=20=D1=81=D1=80=D0=B0=D0=B1=D0=B0=D1=82?= =?UTF-8?q?=D1=8B=D0=B2=D0=B0=D1=8E=D1=89=D0=B8=D0=B9=20=D0=BF=D1=80=D0=B8?= =?UTF-8?q?=20=D0=B4=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B8=202.0-2.2?= =?UTF-8?q?=20=D0=B0=D1=82=D0=BC=20=D0=A2=D0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/metrostroi/systems/sys_81_722_electric.lua | 4 ++-- lua/metrostroi/systems/sys_81_722_pneumatic.lua | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) 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)