From 52f4d55fcc23eaaee49654df7a107ddfc8c3c3da Mon Sep 17 00:00:00 2001 From: Moon Horse Date: Thu, 13 Jan 2022 18:07:40 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=BF=D1=82=D0=B8=D0=BC=D0=B8=D0=B7?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D1=8F=20=D0=BF=D1=80=D0=B0=D0=B2=D0=BE=D0=BA?= =?UTF-8?q?=20=D0=B2=20=D1=8D=D0=BB=D0=B5=D0=BA=D1=82=D1=80=D0=B8=D0=BA?= =?UTF-8?q?=D0=B5=20+=20=D0=BD=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=BF=D0=BD=D0=B5=D0=B2=D0=BC=D0=B0=D1=82=D0=B8=D0=BA?= =?UTF-8?q?=D0=B8=20(=D0=92=D0=97=E2=84=962=20=D0=B8=20=D0=AD=D0=9F=D0=92)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/entities/gmod_subway_81-717_mvm/init.lua | 6 ++---- lua/metrostroi/systems/sys_81_714_electric.lua | 1 - lua/metrostroi/systems/sys_81_717_electric.lua | 1 - lua/metrostroi/systems/sys_81_717_pneumatic.lua | 12 ++++-------- lua/metrostroi/systems/sys_yar_13b.lua | 5 ++--- 5 files changed, 8 insertions(+), 17 deletions(-) diff --git a/lua/entities/gmod_subway_81-717_mvm/init.lua b/lua/entities/gmod_subway_81-717_mvm/init.lua index 412fc78..4fff2b7 100644 --- a/lua/entities/gmod_subway_81-717_mvm/init.lua +++ b/lua/entities/gmod_subway_81-717_mvm/init.lua @@ -561,7 +561,7 @@ function ENT:Think() local power = Panel.V1 > -1.5 local brightness = math.min(1,Panel.Headlights1)*0.60 + math.min(1,Panel.Headlights2)*0.40 - local T = {} + --local T = {} self:SetPackedBool("Headlights1",Panel.Headlights1 > 0) self:SetPackedBool("Headlights2",Panel.Headlights2 > 0) @@ -590,9 +590,7 @@ function ENT:Think() end -- "" 54 - T[4] = self:ReadTrainWire(4) - T[5] = self:ReadTrainWire(5) - if T[4]*T[5] > 0 then + if self:ReadTrainWire(4)*self:ReadTrainWire(5) > 0 then self.A54:TriggerInput("Set",0) end diff --git a/lua/metrostroi/systems/sys_81_714_electric.lua b/lua/metrostroi/systems/sys_81_714_electric.lua index 696fd1e..6723fc7 100644 --- a/lua/metrostroi/systems/sys_81_714_electric.lua +++ b/lua/metrostroi/systems/sys_81_714_electric.lua @@ -78,7 +78,6 @@ function TRAIN_SYSTEM:SolveAllInternalCircuits(Train,dT,firstIter) if isMVM then Train:WriteTrainWire(71,S["33D"]*Train.OtklBV.Value) end - Train.RPvozvrat.VozRpPressed = T[17] --Вагонная часть S["10A"] = BO*Train.A30.Value S["ZR"] = (1-Train.RRP.Value)+(B*Train.A39.Value*(1-Train.RPvozvrat.Value)*Train.RRP.Value)*-1 diff --git a/lua/metrostroi/systems/sys_81_717_electric.lua b/lua/metrostroi/systems/sys_81_717_electric.lua index c3e7644..de9f1a3 100644 --- a/lua/metrostroi/systems/sys_81_717_electric.lua +++ b/lua/metrostroi/systems/sys_81_717_electric.lua @@ -450,7 +450,6 @@ function TRAIN_SYSTEM:SolveAllInternalCircuits(Train,dT,firstIter) Panel.L1 = T[57] end Panel.M8 = S["V2"]*Train.PVK.Value - Train.RPvozvrat.VozRpPressed = T[17] Train.C1:TriggerInput("Set", T[1]) Panel.IST = Train.C1.Value*Train.VKST.Value*T[64] diff --git a/lua/metrostroi/systems/sys_81_717_pneumatic.lua b/lua/metrostroi/systems/sys_81_717_pneumatic.lua index f7579c9..fba75f4 100644 --- a/lua/metrostroi/systems/sys_81_717_pneumatic.lua +++ b/lua/metrostroi/systems/sys_81_717_pneumatic.lua @@ -405,7 +405,7 @@ function TRAIN_SYSTEM:Think(dT) -- 013: 2 Normal pressure if (self.RealDriverValvePosition == 2) and BLDisconnect and (TLDisconnect or self.BrakeLinePressure > 1.01*math.min(self.KM013offset,self.TrainToBrakeReducedPressure)) then - self:equalizePressure(dT,"BrakeLinePressure", 1.01*math.min(self.KM013offset,self.TrainToBrakeReducedPressure), pr_speed,pr_speed*0.4, nil, 1.0)-- nil, 1.0) + self:equalizePressure(dT,"BrakeLinePressure", 1.01*math.min(self.KM013offset,self.TrainToBrakeReducedPressure), pr_speed,Train.EPKC.Value==0 and Train.EPK.Value > 0 and pr_speed*2 or pr_speed*0.4, nil, 1.0)-- nil, 1.0) end -- 013: 3 4.3 Atm @@ -471,9 +471,8 @@ function TRAIN_SYSTEM:Think(dT) Train.autosaid=false end self.OldBrakeLinePressure = self.BrakeLinePressure - local leak = 0 --math.log(80*self.BrakeLinePressure - 200,3) - if self.EmergencyValve then --math.log(self.BrakeLinePressure,1.25) - 2.5 - --local leakst = BLDisconnect and math.max(0.3,math.log(self.BrakeLinePressure,1.2) - 2.5) or 1.1*(Train:GetWagonCount())*math.Clamp(self.BrakeLinePressure/4,0,1) + local leak = 0 + if self.EmergencyValve then local leakst = BLDisconnect and math.max(0.3,math.log(self.BrakeLinePressure,1.2) - 2.5) or math.max(1.6,math.log(0.63*self.BrakeLinePressure,1.15)) leak = self:equalizePressure(dT,"BrakeLinePressure", 0.0,leakst*wagc/6)--,false,false,10) if Train.UAVA.Value > 0 or (self.BrakeLinePressure < 1.8 and Train.AutostopValve.Value == 0) then --пока держим ЛКМ нажатой, срывной клапан открыт @@ -550,11 +549,8 @@ function TRAIN_SYSTEM:Think(dT) end self.BePN2 = true elseif self.PN2 > 0.0 then - self.PN2 = math.max(0,self.PN2-math.exp(1.26*(self.BrakeCylinderPressure - self.GN2Offset))*2.4*dT) - --self.PN2 = 0.3*math.exp(0.6*(self.BrakeCylinderPressure - dT) - 1) - 0.11 + self.PN2 = self.BrakeCylinderPressure > 0.4 and 0.2 or self.PN2 - 0.5*dT end - --local cranPres = math.max(0,math.min(self.GN2Offset + self.WeightLoadRatio*1.3,self.BcBl*(self.WorkingChamberPressure - self.BrakeLinePressure)*(self.BrakeLinePressure < 3.6 and (6.2 - self.WorkingChamberPressure) or 1)))--- - --local cranPres = math.max(0,math.min(self.GN2Offset + self.WeightLoadRatio*1.3,self.BcBl*(self.WorkingChamberPressure - (self.BrakeLinePressure < 3.6 and (self.BrakeLinePressure - 3.0)*0.45*self.WorkingChamberPressure/(self.BrakeLinePressure - 3.0) or self.BrakeLinePressure*(self.BrakeLinePressure > 4.5 and self.BrakeLinePressure_dPdT > 0.02 and 1.06 or 1)))*(self.BrakeLinePressure > self.KM013offset and 0.6 or 1))) local WcBl = (self.BrakeLinePressure < 3.55 and 0.45*self.WorkingChamberPressure or self.BrakeLinePressure > 3.65 and self.BrakeLinePressure*(self.BrakeLinePressure > 4.5 and self.BrakeLinePressure_dPdT > 0.02 and 1.06 or 1)) self.cranPres = WcBl and math.max(0,math.min(self.GN2Offset + self.WeightLoadRatio*1.3,self.BcBl*(self.WorkingChamberPressure - WcBl)*(self.BrakeLinePressure > self.KM013offset and 0.6 or 1))) or self.cranPres local targetPressure = (self.cranPres < (self.PN1 + self.WeightLoadRatio*0.7) and (Train.PneumaticNo1.Value == 1.0) and (self.PN1 + self.WeightLoadRatio*0.7) or self.PN1) + self.PN2 + self.cranPres diff --git a/lua/metrostroi/systems/sys_yar_13b.lua b/lua/metrostroi/systems/sys_yar_13b.lua index 2a6c0fa..883e424 100644 --- a/lua/metrostroi/systems/sys_yar_13b.lua +++ b/lua/metrostroi/systems/sys_yar_13b.lua @@ -30,7 +30,6 @@ function TRAIN_SYSTEM:Initialize() latched = true, -- RPvozvrat latches into place power_open = "None", -- Power source for the open signal power_close = "Mechanical", -- Power source for the close signal - VozRpPressed = false, -- Added to override the blocking action of the energized RP relays on RPVozvrat }) -- Реле времени РВ1 @@ -94,8 +93,8 @@ function TRAIN_SYSTEM:Think() end --self.RUTTarget = 250 + 150*self.Train.Pneumatic.WeightLoadRatio -- RPvozvrat operation - local A = Train.RPvozvrat.VozRpPressed ~= 0 - Train.RPvozvrat:TriggerInput("Close", not A and + --local A = Train.RPvozvrat.VozRpPressed ~= 0 + Train.RPvozvrat:TriggerInput("Close", Train:ReadTrainWire(17) == 0 and -- condition added to override the blocking action of the energized RP relays on RPVozvrat ((Train.DR1.Value == 1.0) or (Train.DR2.Value == 1.0) or (Train.RPL.Value == 1.0) or