From 873365ae98c44aa55601103809fa36a89ad9fb01 Mon Sep 17 00:00:00 2001 From: Moon Horse Date: Tue, 21 Dec 2021 03:16:49 +0300 Subject: [PATCH 01/17] =?UTF-8?q?=D0=AD=D1=82=D0=BE=20=D0=B4=D0=BB=D1=8F?= =?UTF-8?q?=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B=20=D0=9A=D0=A0=D0=A3=20?= =?UTF-8?q?=D0=B2=203=20=D1=80=D1=83=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/metrostroi/systems/sys_81_714_electric.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/metrostroi/systems/sys_81_714_electric.lua b/lua/metrostroi/systems/sys_81_714_electric.lua index 6723fc7..b597ac3 100644 --- a/lua/metrostroi/systems/sys_81_714_electric.lua +++ b/lua/metrostroi/systems/sys_81_714_electric.lua @@ -78,6 +78,7 @@ function TRAIN_SYSTEM:SolveAllInternalCircuits(Train,dT,firstIter) if isMVM then Train:WriteTrainWire(71,S["33D"]*Train.OtklBV.Value) end + Train.RPvozvrat.VozRpPressed = T[17]~=0 --Вагонная часть S["10A"] = BO*Train.A30.Value S["ZR"] = (1-Train.RRP.Value)+(B*Train.A39.Value*(1-Train.RPvozvrat.Value)*Train.RRP.Value)*-1 From c3bfc11d52925ba6a4b2eeb1adcbc86d9272b204 Mon Sep 17 00:00:00 2001 From: Moon Horse Date: Tue, 21 Dec 2021 03:18:17 +0300 Subject: [PATCH 02/17] =?UTF-8?q?=D0=AD=D1=82=D0=BE=20=D0=B4=D0=BB=D1=8F?= =?UTF-8?q?=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82=D1=8B=20=D0=9A=D0=A0=D0=A3=20?= =?UTF-8?q?=D0=B2=203=20=D1=80=D1=83=D0=BA=D0=B8=20=D0=B8=20=D0=B4=D0=BB?= =?UTF-8?q?=D1=8F=20=D1=81=D1=80=D0=B0=D0=B1=D0=B0=D1=82=D1=8B=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=9054=20=D0=BF=D1=80=D0=B8=20=D0=BF?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D0=B0=D0=BD=D0=BE=D0=B2=D0=BA=D0=B5=20=D1=80?= =?UTF-8?q?=D0=B5=D0=B2=D0=B5=D1=80=D1=81=D0=B0=20=D0=B2=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D0=B5=D0=B4=20=D0=B2=20=D0=BE=D0=B1=D0=B5=D0=B8=D1=85=20=D0=BA?= =?UTF-8?q?=D0=B0=D0=B1=D0=B8=D0=BD=D0=B0=D1=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/metrostroi/systems/sys_81_717_electric.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lua/metrostroi/systems/sys_81_717_electric.lua b/lua/metrostroi/systems/sys_81_717_electric.lua index 7f0eafb..83b4202 100644 --- a/lua/metrostroi/systems/sys_81_717_electric.lua +++ b/lua/metrostroi/systems/sys_81_717_electric.lua @@ -88,7 +88,11 @@ function TRAIN_SYSTEM:SolveAllInternalCircuits(Train,dT,firstIter) S["F7"] = S["F"]*KV["F-F7"]+S["14b"]*KRU["11/3-FR1"] Train:WriteTrainWire(5,S["10AK"]*KV["10AK-5"] + KRU["5/3-ZM31"]*-10) - Train:WriteTrainWire(4,S["10AK"]*KV["10AK-4"] + --[[max(0,min(1,T[4])*KV["4-0"]*-10)]]KV["4-0"]*-10) + Train:WriteTrainWire(4,S["10AK"]*KV["10AK-4"]) --[[max(0,min(1,T[4])*KV["4-0"]*-10)KV["4-0"]*-10]] + if T[4]*KV["4-0"] ~= 0 then + Train.A54:TriggerInput("Set",0) + Train:WriteTrainWire(5,0) + end --Train:WriteTrainWire(4,S["10AK"]*KV["10AK-4"]*(1-T[4]*KV["4-0"]*-10)) Panel.LST = T[6]*Train.A40.Value @@ -451,6 +455,7 @@ function TRAIN_SYSTEM:SolveAllInternalCircuits(Train,dT,firstIter) Panel.L1 = T[57] end Panel.M8 = S["V2"]*Train.PVK.Value + Train.RPvozvrat.VozRpPressed = T[17]~=0 local ASNP_VV = Train.ASNP_VV ASNP_VV.Power = BO*Train.AS1.Value*Train.R_ASNPOn.Value From 5dc2b84a038605bc6f3c6179c9395d06d6c6fb27 Mon Sep 17 00:00:00 2001 From: Moon Horse Date: Tue, 21 Dec 2021 03:30:27 +0300 Subject: [PATCH 03/17] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B0=20=D1=81=D0=B8=D0=BC=D1=83=D0=BB=D1=8F=D1=86?= =?UTF-8?q?=D0=B8=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=87=D0=B5=D0=B9=20?= =?UTF-8?q?=D0=BA=D0=B0=D0=BC=D0=B5=D1=80=D1=8B=20=D0=92=D0=A0=20337.004?= =?UTF-8?q?=20=D0=B8=20=D0=9A=D0=9B=D0=A1=D0=97.=20=D0=A0=D0=B0=D0=BD?= =?UTF-8?q?=D0=B4=D0=BE=D0=BC=D0=B8=D0=B7=D0=B8=D1=80=D0=BE=D0=B2=D0=B0?= =?UTF-8?q?=D0=BD=D0=BE=20=D1=80=D0=B5=D0=B3=D1=83=D0=BB=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=BE=D1=87=D0=BD=D0=BE=D0=B5=20=D0=B4=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=9A=D0=9C=20=D0=B2=D0=BE=202=20?= =?UTF-8?q?=D0=BF=D0=BE=D0=BB=D0=BE=D0=B6=D0=B5=D0=BD=D0=B8=D0=B8=20=D0=B2?= =?UTF-8?q?=20=D0=BF=D1=80=D0=B5=D0=B4=D0=B5=D0=BB=D0=B0=D1=85=20=D0=BD?= =?UTF-8?q?=D0=BE=D1=80=D0=BC=20=D0=B4=D0=BE=D0=BF=D1=83=D1=81=D0=BA=D0=BE?= =?UTF-8?q?=D0=B2.=20=D0=A2=D0=BE=20=D0=B6=D0=B5=20=D0=B4=D0=BB=D1=8F=20?= =?UTF-8?q?=D0=BD=D0=BE=D1=80=D0=BC=D1=8B=20=D0=B4=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=B2=20=D0=A2=D0=A6=20=D0=BE=D1=82=20?= =?UTF-8?q?=D0=9F=D0=A1=D0=A2=20=D0=BD=D0=B0=20=D0=B3=D0=BE=D0=BB=D0=BE?= =?UTF-8?q?=D0=B2=D0=BD=D1=8B=D1=85=20=D0=B8=20=D0=BF=D1=80=D0=BE=D0=BC?= =?UTF-8?q?=D0=B5=D0=B6=D1=83=D1=82=D0=BE=D1=87=D0=BD=D1=8B=D1=85=20=D0=B2?= =?UTF-8?q?=D0=B0=D0=B3=D0=BE=D0=BD=D0=B0=D1=85,=20=D0=BE=D1=82=20=D0=BF?= =?UTF-8?q?=D0=B5=D1=80=D0=B2=D1=8B=D1=85=20=D0=B8=20=D0=B2=D1=82=D0=BE?= =?UTF-8?q?=D1=80=D1=8B=D1=85=20=D0=B2=D0=B5=D0=BD=D1=82=D0=B8=D0=BB=D0=B5?= =?UTF-8?q?=D0=B9=20=D0=B7=D0=B0=D0=BC=D0=B5=D1=89=D0=B5=D0=BD=D0=B8=D1=8F?= =?UTF-8?q?.=20=D0=9E=D1=82=D1=80=D0=B5=D0=B3=D1=83=D0=BB=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=D1=8B=20=D1=82=D0=B5=D0=BC=D0=BF=D1=8B?= =?UTF-8?q?=20=D0=B7=D0=B0=D1=80=D1=8F=D0=B4=D0=BA=D0=B8=20=D0=A2=D0=9C=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20=D0=B2=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D0=B8=20=D0=BF=D0=BE=D1=81=D0=B0=D0=B4=D0=BA?= =?UTF-8?q?=D0=B8=20=D1=81=D1=80=D1=8B=D0=B2=D0=BD=D0=BE=D0=B3=D0=BE=20?= =?UTF-8?q?=D0=BA=D0=BB=D0=B0=D0=BF=D0=B0=D0=BD=D0=B0,=20=D0=B8=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D0=B1=D0=BE=D0=BB=D0=B5=D0=B5=20=D1=80=D0=B5?= =?UTF-8?q?=D0=B0=D0=BB=D0=B8=D1=81=D1=82=D0=B8=D1=87=D0=BD=D0=BE=D0=B9=20?= =?UTF-8?q?=D1=81=D0=BA=D0=BE=D1=80=D0=BE=D1=81=D1=82=D0=B8=20=D0=B7=D0=B0?= =?UTF-8?q?=D1=80=D1=8F=D0=B4=D0=BA=D0=B8-=D1=80=D0=B0=D0=B7=D1=80=D1=8F?= =?UTF-8?q?=D0=B4=D0=BA=D0=B8=20=D0=A2=D0=9C=20=D0=B8=20=D0=A2=D0=A6.=20?= =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B0=20=D0=B2?= =?UTF-8?q?=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20?= =?UTF-8?q?=D1=81=D1=80=D1=8B=D0=B2=D0=B0=D1=82=D1=8C=20=D1=81=D1=80=D1=8B?= =?UTF-8?q?=D0=B2=D0=BD=D0=BE=D0=B9=20=D0=BA=D0=BB=D0=B0=D0=BF=D0=B0=D0=BD?= =?UTF-8?q?.=20=D0=9E=D1=82=D1=80=D0=B5=D0=B3=D1=83=D0=BB=D0=B8=D1=80?= =?UTF-8?q?=D0=BE=D0=B2=D0=B0=D0=BD=20=D1=82=D0=B5=D0=BC=D0=BF=20=D1=80?= =?UTF-8?q?=D0=B0=D0=B7=D1=80=D1=8F=D0=B4=D0=BA=D0=B8=20=D0=9D=D0=9C=20?= =?UTF-8?q?=D1=87=D0=B5=D1=80=D0=B5=D0=B7=20=D0=BF=D1=80=D0=B5=D0=B4=D0=BE?= =?UTF-8?q?=D1=85=D1=80=D0=B0=D0=BD=D0=B8=D1=82=D0=B5=D0=BB=D1=8C=D0=BD?= =?UTF-8?q?=D1=8B=D0=B9=20=D0=BA=D0=BB=D0=B0=D0=BF=D0=B0=D0=BD=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D0=B1=D0=BE=D0=BB=D0=B5=D0=B5=20=D1=80=D0=B5?= =?UTF-8?q?=D0=B0=D0=BB=D0=B8=D1=81=D1=82=D0=B8=D1=87=D0=BD=D0=BE=D0=B3?= =?UTF-8?q?=D0=BE=20=D0=BF=D0=BE=D0=B2=D0=B5=D0=B4=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../systems/sys_81_717_pneumatic.lua | 125 ++++++++++++------ 1 file changed, 87 insertions(+), 38 deletions(-) diff --git a/lua/metrostroi/systems/sys_81_717_pneumatic.lua b/lua/metrostroi/systems/sys_81_717_pneumatic.lua index da7ff08..307ccd2 100644 --- a/lua/metrostroi/systems/sys_81_717_pneumatic.lua +++ b/lua/metrostroi/systems/sys_81_717_pneumatic.lua @@ -43,6 +43,14 @@ function TRAIN_SYSTEM:Initialize(parameters) self.OldBrakeLinePressure = 0.0 self.BCPressure = 0 + -- Air distrubutor part + self.WorkingChamberPressure = 0.0 + self.AirDistributorReady = false + self.OverchargeReleaseValve = false + self.WCChargeValve = true + self.PN1 = 0 + self.PN2 = 0 + --DKPT self.Train:LoadSystem("DKPT","Relay","R-52B") -- -- Valve #1 @@ -73,8 +81,11 @@ function TRAIN_SYSTEM:Initialize(parameters) self.Train:LoadSystem("EmergencyBrakeValve","Relay","Switch") -- Воздухораспределитель self.Train:LoadSystem("AirDistributorDisconnect","Relay","Switch") + --Срывной клапан + self.Train:LoadSystem("AutostopValve","Relay","Switch") --УАВА self.Train:LoadSystem("UAVA","Relay","Switch",{ bass = true}) + --self.Train:LoadSystem("UAVAContact","Relay","Switch") self.Train:LoadSystem("UAVAC","Relay","",{normally_closed=true,bass=true}) --Стояночный тормоз self.Train:LoadSystem("ParkingBrake","Relay","Switch",{bass = true}) @@ -141,7 +152,7 @@ end function TRAIN_SYSTEM:Outputs() return { "BrakeLinePressure", "BrakeCylinderPressure", "DriverValvePosition", - "ReservoirPressure", "TrainLinePressure", "DoorLinePressure", "WeightLoadRatio" } + "ReservoirPressure", "TrainLinePressure", "DoorLinePressure", "WeightLoadRatio", "WorkingChamberPressure" } end function TRAIN_SYSTEM:TriggerInput(name,value) @@ -304,9 +315,12 @@ function TRAIN_SYSTEM:Think(dT) self.ReservoirPressure_dPdT = 0.0 self.BrakeCylinderPressure_dPdT = 0.0 self.ParkingBrakePressure_dPdT = 0.0 + self.WorkingChamberPressure_dPdT = 0.0 + + self.KM013offset = self.KM013offset or math.random()*0.2 + 5.0 --регулировочное давление -- Reduce pressure for brake line - self.TrainToBrakeReducedPressure = math.min(5.1,self.TrainLinePressure) -- * 0.725) + self.TrainToBrakeReducedPressure = math.min(self.KM013offset,self.TrainLinePressure) -- * 0.725) -- Feed pressure to door line self.DoorLinePressure = self.TrainToBrakeReducedPressure * 0.90 local trainLineConsumption_dPdT = 0.0 @@ -314,6 +328,12 @@ function TRAIN_SYSTEM:Think(dT) local HaveEPK = not Train.SubwayTrain or not Train.SubwayTrain.ARS or not Train.SubwayTrain.ARS.NoEPK local BLDisconnect,pr_speed = true,1 + ---[[ работа срывного клапана + if Train.AutostopValve.Value ~= 0 then + if self.BrakeLinePressure > 1.86 then self:TriggerInput("Autostop",1) end + Train.AutostopValve.Value = 0 + end--]] + if self.ValveType == 1 then BLDisconnect = Train.DriverValveBLDisconnect.Value > 0 local TLDisconnect = Train.DriverValveTLDisconnect.Value > 0 @@ -366,42 +386,42 @@ function TRAIN_SYSTEM:Think(dT) trainLineConsumption_dPdT = trainLineConsumption_dPdT + math.max(0,self.ReservoirPressure_dPdT)*0.05 else pr_speed = 1.25*wagc --2 - if self.Leak or self.BraieLineOpen then pr_speed = pr_speed*0.7 end + if self.Leak or self.BrakeLineOpen then pr_speed = pr_speed*0.7 end BLDisconnect = self.DisconnectType and Train.DriverValveBLDisconnect.Value > 0 or Train.DriverValveDisconnect.Value > 0 local TLDisconnect = self.DisconnectType and Train.DriverValveTLDisconnect.Value > 0 or Train.DriverValveDisconnect.Value > 0 -- 013: 1 Overcharge if (self.RealDriverValvePosition == 1) and BLDisconnect and (TLDisconnect or self.BrakeLinePressure > self.TrainLinePressure) then - self:equalizePressure(dT,"BrakeLinePressure", math.min(6.0,self.TrainLinePressure), pr_speed) + self:equalizePressure(dT,"BrakeLinePressure", math.min(6.4,self.TrainLinePressure), pr_speed,pr_speed*0.35, nil, 1.0) end -- 013: 2 Normal pressure - if (self.RealDriverValvePosition == 2) and BLDisconnect and (TLDisconnect or self.BrakeLinePressure > 1.01*math.min(5.1,self.TrainToBrakeReducedPressure)) then - self:equalizePressure(dT,"BrakeLinePressure", 1.01*math.min(5.1,self.TrainToBrakeReducedPressure), pr_speed,nil, nil, 1.0)-- nil, 1.0) + 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.35, nil, 1.0)-- nil, 1.0) end -- 013: 3 4.3 Atm if (self.RealDriverValvePosition == 3) and BLDisconnect and (TLDisconnect or self.BrakeLinePressure > 1.01*math.min(4.3,self.TrainToBrakeReducedPressure)) then - self:equalizePressure(dT,"BrakeLinePressure", 1.01*math.min(4.3,self.TrainToBrakeReducedPressure), pr_speed,nil, nil, 1.0) + self:equalizePressure(dT,"BrakeLinePressure", 1.01*math.min(4.3,self.TrainToBrakeReducedPressure), pr_speed,pr_speed*0.35, nil, 1.0) end -- 013: 4 4.0 Atm if (self.RealDriverValvePosition == 4) and BLDisconnect and (TLDisconnect or self.BrakeLinePressure > 1.01*math.min(4.0,self.TrainToBrakeReducedPressure)) then - self:equalizePressure(dT,"BrakeLinePressure", 1.01*math.min(4.0,self.TrainToBrakeReducedPressure), pr_speed,nil, nil, 1.0) + self:equalizePressure(dT,"BrakeLinePressure", 1.01*math.min(4.0,self.TrainToBrakeReducedPressure), pr_speed,pr_speed*0.35, nil, 1.0) end -- 013: 5 3.7 Atm if (self.RealDriverValvePosition == 5) and BLDisconnect and (TLDisconnect or self.BrakeLinePressure > 1.01*math.min(3.7,self.TrainToBrakeReducedPressure)) then - self:equalizePressure(dT,"BrakeLinePressure", 1.01*math.min(3.7,self.TrainToBrakeReducedPressure), pr_speed,nil, nil, 1.0) + self:equalizePressure(dT,"BrakeLinePressure", 1.01*math.min(3.7,self.TrainToBrakeReducedPressure), pr_speed,pr_speed*0.35, nil, 1.0) end -- 013: 6 3.0 Atm if (self.RealDriverValvePosition == 6) and BLDisconnect and (TLDisconnect or self.BrakeLinePressure > 1.01*math.min(3.0,self.TrainToBrakeReducedPressure)) then - self:equalizePressure(dT,"BrakeLinePressure", 1.01*math.min(3.0,self.TrainToBrakeReducedPressure), pr_speed,nil, nil, 1.0) + self:equalizePressure(dT,"BrakeLinePressure", 1.01*math.min(3.0,self.TrainToBrakeReducedPressure), pr_speed,pr_speed*0.35, nil, 1.0) end -- 013: 7 0.0 Atm - if (self.RealDriverValvePosition == 7) and BLDisconnect then - self:equalizePressure(dT,"BrakeLinePressure", 0.0, pr_speed) + if (self.RealDriverValvePosition == 7) and BLDisconnect and (TLDisconnect or self.BrakeLinePressure > 0.0) then + self:equalizePressure(dT,"BrakeLinePressure", 0.0, 0.6 + pr_speed*math.exp(math.min(0,self.BrakeLinePressure - 2.8)*1.0),pr_speed*0.35, nil, 1.0) end trainLineConsumption_dPdT = trainLineConsumption_dPdT + math.max(0,self.BrakeLinePressure_dPdT) end @@ -436,22 +456,22 @@ function TRAIN_SYSTEM:Think(dT) else Train:SetPackedRatio("Crane_dPdT", self.BrakeLinePressure_dPdT/wagc*3 ) end - if self.EmergencyValveDisable and (self.BrakeLinePressure-self.OldBrakeLinePressure)>0.01 then + if self.EmergencyValveDisable then--and (self.BrakeLinePressure-self.OldBrakeLinePressure)>0.01 then self.EmergencyValveDisable=false self.EmergencyValve=false end self.OldBrakeLinePressure = self.BrakeLinePressure local leak = 0 if self.EmergencyValve then - local leakst = 1.1*(Train:GetWagonCount())*math.Clamp(self.BrakeLinePressure/4,0,1) - leak = self:equalizePressure(dT,"BrakeLinePressure", 0.0,leakst*2,false,false,0.4) - if (leak >= -0.2*(Train:GetWagonCount()) or Train.UAVA.Value > 0) then + local leakst = BLDisconnect and math.max(0.3,math.log(80*self.BrakeLinePressure - 200,3)) or 1.1*(Train:GetWagonCount())*math.Clamp(self.BrakeLinePressure/4,0,1) + leak = self:equalizePressure(dT,"BrakeLinePressure", 0.0,leakst)--,false,false,10) + if (self.BrakeLinePressure < 1.82 or Train.UAVA.Value > 0) then self.EmergencyValveDisable = true end self.Leak = true end - local UAVABlocked = (self.BrakeLinePressure>3.5 and Train.UAVA.Value==0) + local UAVABlocked = (self.BrakeLinePressure>1.8 and Train.UAVA.Value==0) if (Train.UAVA.Blocked>0) ~= UAVABlocked then Train.UAVA:TriggerInput("Block",UAVABlocked and 1 or 0) end @@ -461,48 +481,75 @@ function TRAIN_SYSTEM:Think(dT) Train.UAVAC:TriggerInput("Block",UAVACBlocked and 1 or 0) end - Train:SetPackedRatio("EmergencyValve_dPdT", -leak/wagc) + Train:SetPackedRatio("EmergencyValve_dPdT", -1.8*leak/wagc) --Регулировка свиста срывного клапана local leak = 0 if Train.EmergencyBrakeValve and Train.EmergencyBrakeValve.Value > 0.5 then --local leakst = (1.6*(Train:GetWagonCount())*(self.BrakeLinePressure-math.min(2.5,self.TrainToBrakeReducedPressure))*0.9) - leak = self:equalizePressure(dT,"BrakeLinePressure", 0.0,(1.1*wagc)*2,false,false,0.4) + leak = self:equalizePressure(dT,"BrakeLinePressure", 0.0,(1.1*wagc)*2,false,false,1) self.Leak = true end Train:SetPackedRatio("EmergencyBrakeValve_dPdT", -leak/wagc) + --[[ + ---------------debug--------------------- + self.dlreadtimer = self.dlreadtimer or CurTime() + if CurTime() - self.dlreadtimer > 1.0 then + self.dlreadtimer = CurTime() + if Train:GetWagonNumber() == 8530 then + PrintMessage(HUD_PRINTTALK, Format("Вагон %u; ТМ dPdT = %.3f; Раб. кам. = %.3f",Train:GetWagonNumber(),self.BrakeLinePressure_dPdT,self.WorkingChamberPressure)) + end + end + ---------------debug---------------------]] + + ---------------------------------------------------------------------------- -- Fill brake cylinders - if Train.AirDistributorDisconnect.Value == 0 then + if self.WCChargeValve == true then + self:equalizePressure(dT,"WorkingChamberPressure",self.BrakeLinePressure,0.187,nil,nil,1.0) --simulate 0.8mm hole btw BL and working chambers + end + self.AirDistributorReady = self.WorkingChamberPressure >= 2.2 + self.WCChargeValve = not ((self.WorkingChamberPressure - self.BrakeLinePressure) > 0.2 and (self.WorkingChamberPressure - self.BrakeLinePressure) < 2.5) + self.OverchargeReleaseValve = self.WorkingChamberPressure > 5.2 and not self.WCChargeValve + if self.OverchargeReleaseValve then + self:equalizePressure(dT,"WorkingChamberPressure",0.0,0.32) -- КЛСЗ + end + + --trainLineConsumption_dPdT = trainLineConsumption_dPdT + math.max(0,self.WorkingChamberPressure_dPdT*0.2) + local _offset2 = self.Train.AR63 and 2.5 or 2.4 + self.GN2Offset = self.GN2Offset or math.random(20,100)*0.002 + _offset2 + local _offset1 = self.Train.AR63 and 0.9 or 0.8 + self.GN1Offset = self.GN1Offset or math.random(20,100)*0.002 + _offset1 + local _vz1pressure = self.GN1Offset + self.WeightLoadRatio*0.7 + self.BcBl = self.BcBl or self.GN2Offset/(self.KM013offset - 3.24) + if Train.AirDistributorDisconnect.Value == 0 and self.AirDistributorReady then -- Valve #1 - self.BrakeCylinderRegulationError = self.BrakeCylinderRegulationError or (math.random()*0.05 - 0.025) - local error = self.BrakeCylinderRegulationError if (Train.PneumaticNo1.Value == 1.0) and (Train.PneumaticNo2.Value == 0.0) then - if self.PN1 == 0 then + if self.PN1 < _vz1pressure then --1,2 - self.PN1 = math.min(self.TrainLinePressure,(1.1 + error + self.WeightLoadRatio*0.6)) + self.PN1 = math.min(self.TrainLinePressure,_vz1pressure) end - elseif self.PN1 ~= 0 then - self.PN1 = 0 + else + self.PN1 = math.max(0,self.PN1-math.exp(3.6*(self.BrakeCylinderPressure - self.GN1Offset))*0.12) end -- Valve #2 if Train.PneumaticNo2.Value == 1.0 then - if self.PN2 == 0 then - self.PN2 = math.min(self.TrainLinePressure,(2.7 + error + self.WeightLoadRatio*1.3)) + self.PN2 = math.min(self.TrainLinePressure,(self.GN2Offset + self.WeightLoadRatio*1.3)) if self.BePN2 == false and self.BrakeCylinderPressure > 1.6 then Train:PlayOnce("PN2end","stop") end self.BePN2 = true - end - elseif self.PN2 ~= 0 then - self.PN2 = 0 + else + self.PN2 = math.max(0,self.PN2-math.exp(1.2*(self.BrakeCylinderPressure - self.GN2Offset))*0.2) end - local targetPres = math.max(0,math.min(5.2,--[[ 1.5--]] 1.35*(math.min(5.1,self.TrainToBrakeReducedPressure) - self.BrakeLinePressure))) - if self.BCPressure < targetPres then + local targetPres = math.max(0,math.min(self.GN2Offset + self.WeightLoadRatio*1.3,self.BcBl*(self.WorkingChamberPressure - (self.BrakeLinePressure < 3.6 and self.BrakeLinePressure*self.WorkingChamberPressure/6.5 or self.BrakeLinePressure*1.028))) + (self.BrakeLinePressure_dPdT < 0 and self.WeightLoadRatio*1.3 or 0)) + --local targetPres = math.max(0,math.min(self.GN2Offset + self.WeightLoadRatio*1.3,self.BcBl*(self.WorkingChamberPressure - (self.BrakeLinePressure < 3.56 and (self.BrakeLinePressure - 3)*5.56 or self.BrakeLinePressure*1.028)) + (self.BrakeLinePressure_dPdT < 0 and self.WeightLoadRatio*1.3 or 0))) + --[[if self.BCPressure < targetPres then self.BCPressure = math.min(targetPres,self.BCPressure+(0.5+math.max(0,(targetPres-self.BCPressure)-0.2)*0.6)*dT) elseif self.BCPressure > targetPres then self.BCPressure = math.max(targetPres,self.BCPressure-2*dT) - end - local targetPressure = self.PN1+self.PN2+self.BCPressure + end--]] + --local targetPressure = self.PN1+self.PN2+self.BCPressure + local targetPressure = self.PN1+self.PN2+targetPres if math.abs(self.BrakeCylinderPressure - targetPressure) > 0.150 then self.BrakeCylinderValve = 1 end @@ -510,11 +557,13 @@ function TRAIN_SYSTEM:Think(dT) self.BrakeCylinderValve = 0 end if self.BrakeCylinderValve == 1 then - self:equalizePressure(dT,"BrakeCylinderPressure", math.min(2.7 + self.WeightLoadRatio*1.3,targetPressure), 1+math.Clamp((self.BrakeCylinderPressure-0.5)/2.8,0,0.7), 3.50, nil, 0.8+math.Clamp((self.BrakeCylinderPressure-0.75)/0.6,0,1)) --0.75, 1.25) + self:equalizePressure(dT,"BrakeCylinderPressure", math.min(self.GN2Offset + self.WeightLoadRatio*1.3,targetPressure), 1, (self.BrakeLinePressure > (self.KM013offset+0.1)) and (self.PN2 == 0) and (self.PN1 == 0) and 1.0 or 3.5, nil, (self.BrakeLinePressure_dPdT > 0.1) and (0.8+math.Clamp((1 - self.BrakeCylinderPressure)*0.8,0,1.2)) or 1) + --self:equalizePressure(dT,"BrakeCylinderPressure", math.min(self.GN2Offset + self.WeightLoadRatio*1.3,targetPressure), 0.5+math.Clamp((self.BrakeCylinderPressure-0.5)/2.8,0,0.9), (self.BrakeLinePressure > (self.KM013offset+0.1)) and (self.PN2 == 0) and (self.PN1 == 0) and 0.8 or 3.5, nil, (self.BrakeLinePressure_dPdT > 0.1) and (0.8+math.Clamp((1 - self.BrakeCylinderPressure)*0.8,0,1)) or 1) end trainLineConsumption_dPdT = trainLineConsumption_dPdT + math.max(0,self.BrakeCylinderPressure_dPdT*0.5) - else + elseif Train.AirDistributorDisconnect.Value ~= 0 then self:equalizePressure(dT,"BrakeCylinderPressure", 0.0, 2.00) + self:equalizePressure(dT,"WorkingChamberPressure", 0.0, 2.00) --имитируем потягивание за тросик отпускного клапана end if (self.BrakeCylinderPressure > 0.2 and self.BrakeCylinderPressure_dPdT > 0.1 or self.BrakeCylinderPressure_dPdT > 1) and not self.BrakeEngaged then self.BrakeEngaged = true @@ -560,7 +609,7 @@ function TRAIN_SYSTEM:Think(dT) -- Overpressure if self.TrainLinePressure > 9.2 then self.TrainLineOverpressureValve = 1 end if self.TrainLineOverpressureValve == 1 then - self:equalizePressure(dT,"TrainLinePressure", 0.0, 0.2) + self:equalizePressure(dT,"TrainLinePressure", 0.0, (self.TrainLinePressure-(self.Compressor == 1 and 6.5 or 4))*0.6) --was 0.2 self.TrainLineOpen = true if self.TrainLinePressure < 5.2 then self.TrainLineOverpressureValve = 0 end end From ba46473cb714e44fb25a7a0bc344671e4ac2ed2c Mon Sep 17 00:00:00 2001 From: Moon Horse Date: Tue, 21 Dec 2021 03:31:10 +0300 Subject: [PATCH 04/17] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8=D0=BB=20?= =?UTF-8?q?=D0=BF=D1=83=D1=81=D1=82=D1=83=D1=8E=20=D1=81=D1=82=D1=80=D0=BE?= =?UTF-8?q?=D0=BA=D1=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/metrostroi/systems/sys_als_ars_bis200a.lua | 1 - 1 file changed, 1 deletion(-) diff --git a/lua/metrostroi/systems/sys_als_ars_bis200a.lua b/lua/metrostroi/systems/sys_als_ars_bis200a.lua index 92a36bb..56262b6 100644 --- a/lua/metrostroi/systems/sys_als_ars_bis200a.lua +++ b/lua/metrostroi/systems/sys_als_ars_bis200a.lua @@ -57,7 +57,6 @@ end function TRAIN_SYSTEM:Think(dT) local Train = self.Train local speed = Train.ALSCoil.Speed - --vv При торможении смещение на 2км\ч vv ----[[ if true or self.SpeedDec then From 45686155336442047702e945eb8a21ba2ddf3dca Mon Sep 17 00:00:00 2001 From: Moon Horse Date: Tue, 21 Dec 2021 12:47:23 +0300 Subject: [PATCH 05/17] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D1=8F=20=D0=B4=D0=BB=D1=8F=20=D0=9A=D0=A0=D0=A3=20?= =?UTF-8?q?=D0=B2=203=20=D1=80=D1=83=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/metrostroi/systems/sys_yar_13b.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lua/metrostroi/systems/sys_yar_13b.lua b/lua/metrostroi/systems/sys_yar_13b.lua index d209f6e..82da9b9 100644 --- a/lua/metrostroi/systems/sys_yar_13b.lua +++ b/lua/metrostroi/systems/sys_yar_13b.lua @@ -30,6 +30,7 @@ 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 @@ -93,13 +94,13 @@ function TRAIN_SYSTEM:Think() end --self.RUTTarget = 250 + 150*self.Train.Pneumatic.WeightLoadRatio -- RPvozvrat operation - Train.RPvozvrat:TriggerInput("Close", - (Train.DR1.Value == 1.0) or + Train.RPvozvrat:TriggerInput("Close", not Train.RPvozvrat.VozRpPressed and + ((Train.DR1.Value == 1.0) or (Train.DR2.Value == 1.0) or (Train.RPL.Value == 1.0) or (Train.RP1_3.Value == 1.0) or (Train.RP2_4.Value == 1.0) or (Train.RZ_1.Value == 1.0) or (Train.RZ_2.Value == 1.0) or - (Train.RZ_3.Value == 1.0)) + (Train.RZ_3.Value == 1.0))) end From c7071e9467e5f41d316df55a759922b71b234c98 Mon Sep 17 00:00:00 2001 From: Moon Horse Date: Tue, 21 Dec 2021 12:49:49 +0300 Subject: [PATCH 06/17] =?UTF-8?q?=D0=98=D0=B7-=D0=B7=D0=B0=20=D0=B8=D0=B7?= =?UTF-8?q?=D0=BC=D0=B5=D0=BD=D0=B5=D0=BD=D0=B8=D0=B9=20=D0=B2=20=D1=80?= =?UTF-8?q?=D0=B0=D0=B1=D0=BE=D1=82=D0=B5=20=D0=BF=D0=BD=D0=B5=D0=B2=D0=BC?= =?UTF-8?q?=D0=B0=D1=82=D0=B8=D0=BA=D0=B8=20=D0=BF=D1=80=D0=B8=D1=88=D0=BB?= =?UTF-8?q?=D0=BE=D1=81=D1=8C=20=D1=83=D0=B2=D0=B5=D0=BB=D0=B8=D1=87=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D0=B7=D0=B0=D0=B4=D0=B5=D1=80=D0=B6=D0=BA=D1=83?= =?UTF-8?q?=20=D0=BD=D0=B0=20=D1=80=D0=B0=D0=B7=D0=BC=D1=8B=D0=BA=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D1=80=D0=B5=D0=BB=D0=B5-=D0=BF=D0=BE?= =?UTF-8?q?=D0=B2=D1=82=D0=BE=D1=80=D0=B8=D1=82=D0=B5=D0=BB=D1=8F,=20?= =?UTF-8?q?=D1=82=D0=B0=D0=BA=20=D0=BA=D0=B0=D0=BA=20=D0=B1=D0=B5=D0=B7=20?= =?UTF-8?q?=D0=BD=D0=B5=D0=B5=20=D0=B2=20=D0=BA=D0=BE=D0=BD=D1=86=D0=B5=20?= =?UTF-8?q?=D1=8D=D0=BB=D0=B5=D0=BA=D1=82=D1=80=D0=B8=D1=87=D0=B5=D1=81?= =?UTF-8?q?=D0=BA=D0=BE=D0=B3=D0=BE=20=D1=82=D0=BE=D1=80=D0=BC=D0=BE=D0=B6?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BF=D1=80=D0=B8=D1=85=D0=BE=D0=B4?= =?UTF-8?q?=D1=8F=D1=82=20=D0=B2=D1=82=D0=BE=D1=80=D1=8B=D0=B5=20=D0=B2?= =?UTF-8?q?=D0=B5=D0=BD=D1=82=D0=B8=D0=BB=D1=8F=20(=D0=A0=D0=923=20=D0=BD?= =?UTF-8?q?=D0=B5=20=D1=83=D1=81=D0=BF=D0=B5=D0=B2=D0=B0=D0=B5=D1=82=20?= =?UTF-8?q?=D0=B2=D0=BA=D0=BB=D1=8E=D1=87=D0=B8=D1=82=D1=8C=D1=81=D1=8F)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/metrostroi/systems/sys_yar_27.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/metrostroi/systems/sys_yar_27.lua b/lua/metrostroi/systems/sys_yar_27.lua index 7cf39fe..198f659 100644 --- a/lua/metrostroi/systems/sys_yar_27.lua +++ b/lua/metrostroi/systems/sys_yar_27.lua @@ -15,7 +15,7 @@ function TRAIN_SYSTEM:Initialize(parameters) self.Train:LoadSystem("RV3","Relay","REV-813T",{ open_time = 2.3 }) -- Реле тока (РТ2) self.Train:LoadSystem("RT2","Relay","REV-830",{ trigger_level = 130 }) -- A - self.Train:LoadSystem("RT2r","Relay","REV-830",{ close_time = 0, open_time = 0.2 }) --UNREALISTIC Repeater for RT2 for MSK trains + self.Train:LoadSystem("RT2r","Relay","REV-830",{ close_time = 0, open_time = 0.6 }) --UNREALISTIC Repeater for RT2 for MSK trains -- Реле контроля тормозного тока (РКТТ) self.Train:LoadSystem("RKTT","Relay","R-52B") self.Train.RKTTsh = 1 From 7f7e4f088be78b5c1d74690b7f55fbdbb68c44a8 Mon Sep 17 00:00:00 2001 From: Moon Horse Date: Tue, 21 Dec 2021 12:52:02 +0300 Subject: [PATCH 07/17] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=BB=20=D1=81=D1=80=D1=8B=D0=B2=D0=BD=D0=BE=D0=B9=20=D0=BA?= =?UTF-8?q?=D0=BB=D0=B0=D0=BF=D0=B0=D0=BD=20=D0=B8=20=D1=83=D0=B2=D0=B5?= =?UTF-8?q?=D0=BB=D0=B8=D1=87=D0=B8=D0=BB=20=D0=B3=D1=80=D0=BE=D0=BC=D0=BA?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D1=8C=20=D1=88=D0=B8=D0=BF=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=B2=D0=BE=D0=B7=D0=B4=D1=83=D1=85=D0=B0=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=20=D0=BE=D1=82=D0=BF=D1=83=D1=81=D0=BA=D0=B5=20?= =?UTF-8?q?=D0=B2=D0=B5=D0=BD=D1=82=D0=B8=D0=BB=D0=B5=D0=B9=20=D0=B7=D0=B0?= =?UTF-8?q?=D0=BC=D0=B5=D1=89=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../gmod_subway_81-717_mvm/cl_init.lua | 22 +++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/lua/entities/gmod_subway_81-717_mvm/cl_init.lua b/lua/entities/gmod_subway_81-717_mvm/cl_init.lua index ed390f8..a8c9629 100644 --- a/lua/entities/gmod_subway_81-717_mvm/cl_init.lua +++ b/lua/entities/gmod_subway_81-717_mvm/cl_init.lua @@ -2087,6 +2087,21 @@ ENT.ButtonMap["AirDistributor"] = { } } +ENT.ButtonMap["AutostopValve"] = { + pos = Vector(365.8,-67.6,-56), + ang = Angle(0,0,90), + width = 130, + height = 40, + scale = 0.1, + hideseat=0.1, + hide=true, + screenHide = true, + + buttons = { + {ID = "AutostopValveToggle",x=0,y=0,w= 130,h = 40,tooltip="Сорвать срывной клапан"}, + } +} + for i=0,4 do ENT.ClientProps["TrainNumberL"..i] = { model = "models/metrostroi_train/common/bort_numbers.mdl", @@ -3190,8 +3205,8 @@ function ENT:Think() --self:SetSoundState("rolling_medium1",0 or rol40*rollings,rol40p) --57 self:SetSoundState("rolling_high2" ,rol70*rollings,rol70p) --70 - self.ReleasedPdT = math.Clamp(self.ReleasedPdT + 2*(-self:GetPackedRatio("BrakeCylinderPressure_dPdT",0)-self.ReleasedPdT)*dT,0,1) - local release1 = math.Clamp((self.ReleasedPdT-0.1)/0.8,0,1)^2 + self.ReleasedPdT = math.Clamp(self.ReleasedPdT + 2*(-self:GetPackedRatio("BrakeCylinderPressure_dPdT",0)-0.8*self.ReleasedPdT)*dT,0,1) + local release1 = math.Clamp((1.1*self.ReleasedPdT-0.1)/0.32,0,8)^2 self:SetSoundState("release1",release1,1) self:SetSoundState("release2",(math.Clamp(0.3-release1,0,0.3)/0.3)*(release1/0.3),1.0) local parking_brake = self:GetPackedRatio("ParkingBrakePressure_dPdT",0) @@ -3409,6 +3424,9 @@ function ENT:DrawPost() self:DrawOnPanel("AirDistributor",function() draw.DrawText(self:GetNW2Bool("AD") and "Air Distributor ON" or "Air Distributor OFF","Trebuchet24",0,0,Color(0,0,0,255)) end) + self:DrawOnPanel("AutostopValve",function() + draw.DrawText("Autostop Valve", "Trebuchet24",0,6,Color(0,0,0,255)) + end) end function ENT:OnButtonPressed(button) From 45586209143e6d7c511020ef9010e664cce3d5a6 Mon Sep 17 00:00:00 2001 From: Moon Horse Date: Tue, 21 Dec 2021 12:52:28 +0300 Subject: [PATCH 08/17] =?UTF-8?q?=D0=94=D0=BB=D1=8F=20=D1=81=D1=80=D1=8B?= =?UTF-8?q?=D0=B2=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=BA=D0=BB=D0=B0=D0=BF=D0=B0?= =?UTF-8?q?=D0=BD=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/entities/gmod_subway_81-717_mvm/init.lua | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lua/entities/gmod_subway_81-717_mvm/init.lua b/lua/entities/gmod_subway_81-717_mvm/init.lua index 09fc955..241a84b 100644 --- a/lua/entities/gmod_subway_81-717_mvm/init.lua +++ b/lua/entities/gmod_subway_81-717_mvm/init.lua @@ -200,6 +200,10 @@ function ENT:Initialize() ID = "AirDistributorDisconnectToggle", Pos = Vector(-177, -66, -50), Radius = 20, }, + { + ID = "AutostopValveToggle", + Pos = Vector(377, -66, -50), Radius = 20, + }, } local vX = Angle(0,-90-0.2,56.3):Forward() -- For ARS panel From 6071b4913b510bc77176db070ad31d10870c9e23 Mon Sep 17 00:00:00 2001 From: Moon Horse Date: Tue, 21 Dec 2021 12:53:20 +0300 Subject: [PATCH 09/17] =?UTF-8?q?=D0=9D=D0=B5=D0=BE=D0=B1=D1=85=D0=BE?= =?UTF-8?q?=D0=B4=D0=B8=D0=BC=D1=8B=D0=B5=20=D0=B8=D0=B7=D0=BC=D0=B5=D0=BD?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=B4=D0=BB=D1=8F=20=D0=B8=D0=BD?= =?UTF-8?q?=D0=B8=D1=86=D0=B8=D0=B0=D0=BB=D0=B8=D0=B7=D0=B0=D1=86=D0=B8?= =?UTF-8?q?=D0=B8=20=D0=B4=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20?= =?UTF-8?q?=D0=B2=20=D1=80=D0=B0=D0=B1=D0=BE=D1=87=D0=B5=D0=B9=20=D0=BA?= =?UTF-8?q?=D0=B0=D0=BC=D0=B5=D1=80=D0=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/entities/gmod_subway_81-717_mvm/shared.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/entities/gmod_subway_81-717_mvm/shared.lua b/lua/entities/gmod_subway_81-717_mvm/shared.lua index a9320e2..0446e8b 100644 --- a/lua/entities/gmod_subway_81-717_mvm/shared.lua +++ b/lua/entities/gmod_subway_81-717_mvm/shared.lua @@ -972,7 +972,7 @@ ENT.Spawner = { ent.ARS:TriggerInput("Set",(ent.Plombs.RC1 and val==1 and first) and 1 or 0) ent.ALS:TriggerInput("Set",val==1 and 1 or 0) ent.L_1:TriggerInput("Set",val==1 and 1 or 0) - ent.L_3:TriggerInput("Set",vall==1 and 1 or 0) + ent.L_3:TriggerInput("Set",val==1 and 1 or 0) ent.L_4:TriggerInput("Set",val==1 and 1 or 0) ent.EPK:TriggerInput("Set",(ent.Plombs.RC1 and val==1) and 1 or 0) _LastSpawner=CurTime() @@ -993,6 +993,7 @@ ENT.Spawner = { ent._SpawnerStarted = val end ent.Pneumatic.TrainLinePressure = val==3 and math.random()*4 or val==2 and 4.5+math.random()*3 or 7.6+math.random()*0.6 + ent.Pneumatic.WorkingChamberPressure = val==3 and math.random()*1.0 or val==2 and 4.0+math.random()*1.0 or 5.2 if val==4 then ent.Pneumatic.BrakeLinePressure = 5.2 end end}, --{"Lighter","Spawner.717.Lighter","Boolean"}, From 5f321175d1ef33df4e73cfe91f9ac1d40ab9cce1 Mon Sep 17 00:00:00 2001 From: Moon Horse Date: Tue, 21 Dec 2021 13:01:08 +0300 Subject: [PATCH 10/17] =?UTF-8?q?Revert=20"=D0=A3=D0=B4=D0=B0=D0=BB=D0=B8?= =?UTF-8?q?=D0=BB=20=D0=BF=D1=83=D1=81=D1=82=D1=83=D1=8E=20=D1=81=D1=82?= =?UTF-8?q?=D1=80=D0=BE=D0=BA=D1=83"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ba46473cb714e44fb25a7a0bc344671e4ac2ed2c. --- lua/metrostroi/systems/sys_als_ars_bis200a.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/metrostroi/systems/sys_als_ars_bis200a.lua b/lua/metrostroi/systems/sys_als_ars_bis200a.lua index 56262b6..92a36bb 100644 --- a/lua/metrostroi/systems/sys_als_ars_bis200a.lua +++ b/lua/metrostroi/systems/sys_als_ars_bis200a.lua @@ -57,6 +57,7 @@ end function TRAIN_SYSTEM:Think(dT) local Train = self.Train local speed = Train.ALSCoil.Speed + --vv При торможении смещение на 2км\ч vv ----[[ if true or self.SpeedDec then From 82f44627e7b44ce28d5146a79a4b9a3b1ddf01de Mon Sep 17 00:00:00 2001 From: Moon Horse Date: Tue, 21 Dec 2021 21:16:14 +0300 Subject: [PATCH 11/17] =?UTF-8?q?=D0=92=D0=BE=D0=B7=D0=BC=D0=BE=D0=B6?= =?UTF-8?q?=D0=BD=D0=BE=D1=81=D1=82=D1=8C=20=D0=B4=D0=B5=D1=80=D0=B6=D0=B0?= =?UTF-8?q?=D1=82=D1=8C=20=D0=BF=D0=BE=20=D0=9B=D0=9A=D0=9C=20=D1=81=D0=BA?= =?UTF-8?q?=D0=BE=D0=B1=D1=83=20=D1=81=D1=80=D1=8B=D0=B2=D0=BD=D0=BE=D0=B3?= =?UTF-8?q?=D0=BE=20=D0=BA=D0=BB=D0=B0=D0=BF=D0=B0=D0=BD=D0=B0=20=D0=BE?= =?UTF-8?q?=D1=82=D1=82=D1=8F=D0=BD=D1=83=D1=82=D0=BE=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/entities/gmod_subway_81-717_mvm/cl_init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/entities/gmod_subway_81-717_mvm/cl_init.lua b/lua/entities/gmod_subway_81-717_mvm/cl_init.lua index a8c9629..3a294dc 100644 --- a/lua/entities/gmod_subway_81-717_mvm/cl_init.lua +++ b/lua/entities/gmod_subway_81-717_mvm/cl_init.lua @@ -2098,7 +2098,7 @@ ENT.ButtonMap["AutostopValve"] = { screenHide = true, buttons = { - {ID = "AutostopValveToggle",x=0,y=0,w= 130,h = 40,tooltip="Сорвать срывной клапан"}, + {ID = "AutostopValveSet",x=0,y=0,w= 130,h = 40,tooltip="Сорвать срывной клапан"}, } } From abf1e34062ca9a258b6ebd19ef62cf4f74c78efb Mon Sep 17 00:00:00 2001 From: Moon Horse Date: Tue, 21 Dec 2021 21:18:36 +0300 Subject: [PATCH 12/17] =?UTF-8?q?=D0=A3=D0=B2=D0=B5=D0=BB=D0=B8=D1=87?= =?UTF-8?q?=D0=B8=D0=BB=20=D1=80=D0=B0=D0=B4=D0=B8=D1=83=D1=81=20=D1=88?= =?UTF-8?q?=D0=B8=D0=BF=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=9A=D0=9C=20(=D1=80?= =?UTF-8?q?=D0=B5=D0=B0=D0=BB=D0=B8=D0=B7=D0=BC)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/entities/gmod_subway_81-717_mvm/shared.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lua/entities/gmod_subway_81-717_mvm/shared.lua b/lua/entities/gmod_subway_81-717_mvm/shared.lua index 0446e8b..0fc81a8 100644 --- a/lua/entities/gmod_subway_81-717_mvm/shared.lua +++ b/lua/entities/gmod_subway_81-717_mvm/shared.lua @@ -441,11 +441,11 @@ function ENT:InitializeSounds() self.SoundPositions["rear_isolation"] = {300,1e9,Vector(-456, 0,-63),1} self.SoundNames["crane013_brake"] = {loop=true,"subway_trains/common/pneumatic/release_2.wav"} - self.SoundPositions["crane013_brake"] = {80,1e9,Vector(431.5,-20.3,-12),0.86} + self.SoundPositions["crane013_brake"] = {400,1e9,Vector(431.5,-20.3,-12),0.86} self.SoundNames["crane013_brake2"] = {loop=true,"subway_trains/common/pneumatic/013_brake2.wav"} - self.SoundPositions["crane013_brake2"] = {80,1e9,Vector(431.5,-20.3,-12),0.86} + self.SoundPositions["crane013_brake2"] = {400,1e9,Vector(431.5,-20.3,-12),0.86} self.SoundNames["crane013_brake_l"] = {loop=true,"subway_trains/common/pneumatic/013_brake_loud2.wav"} - self.SoundPositions["crane013_brake_l"] = {80,1e9,Vector(431.5,-20.3,-12),0.7} + self.SoundPositions["crane013_brake_l"] = {400,1e9,Vector(431.5,-20.3,-12),0.7} self.SoundNames["crane013_release"] = {loop=true,"subway_trains/common/pneumatic/013_release.wav"} self.SoundPositions["crane013_release"] = {80,1e9,Vector(431.5,-20.3,-12),0.4} self.SoundNames["crane334_brake_high"] = {loop=true,"subway_trains/common/pneumatic/334_brake.wav"} @@ -975,6 +975,7 @@ ENT.Spawner = { ent.L_3:TriggerInput("Set",val==1 and 1 or 0) ent.L_4:TriggerInput("Set",val==1 and 1 or 0) ent.EPK:TriggerInput("Set",(ent.Plombs.RC1 and val==1) and 1 or 0) + ent.DriverValveDisconnect:TriggerInput("Set",(val==4 and first) and 1 or 0) _LastSpawner=CurTime() ent.CabinDoor = val==4 and first ent.PassengerDoor = val==4 From 1e27ba923e7e757d696f477f44483ec753b432e2 Mon Sep 17 00:00:00 2001 From: Moon Horse Date: Tue, 21 Dec 2021 21:21:11 +0300 Subject: [PATCH 13/17] =?UTF-8?q?=D0=A3=D0=B4=D0=B5=D1=80=D0=B6=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D1=81=D0=BA=D0=BE=D0=B1=D1=8B=20=D1=81?= =?UTF-8?q?=D1=80=D1=8B=D0=B2=D0=BD=D0=BE=D0=B3=D0=BE=20=D0=BA=D0=BB=D0=B0?= =?UTF-8?q?=D0=BF=D0=B0=D0=BD=D0=B0=20=D0=BF=D0=BE=20=D0=9B=D0=9A=D0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../systems/sys_81_717_pneumatic.lua | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/lua/metrostroi/systems/sys_81_717_pneumatic.lua b/lua/metrostroi/systems/sys_81_717_pneumatic.lua index 307ccd2..5a7538c 100644 --- a/lua/metrostroi/systems/sys_81_717_pneumatic.lua +++ b/lua/metrostroi/systems/sys_81_717_pneumatic.lua @@ -175,8 +175,13 @@ function TRAIN_SYSTEM:TriggerInput(name,value) local HaveUAVA = not self.Train.SubwayTrain or not self.Train.SubwayTrain.ARS or not self.Train.SubwayTrain.ARS.NoUAVA if HaveUAVA and self.Train.UAVA.Value == 0 then self.EmergencyValve = true - self.Train.UAVAC:TriggerInput("Set",0) - if value > 0 then RunConsoleCommand("say","Autostop braking",self.Train:GetDriverName()) end + if value ~= 2 then + self.Train.UAVAC:TriggerInput("Set",0) + if not self.Train.autosaid then + self.Train.autosaid = true + RunConsoleCommand("say","Autostop braking",self.Train:GetDriverName()) + end + end end end end @@ -317,7 +322,9 @@ function TRAIN_SYSTEM:Think(dT) self.ParkingBrakePressure_dPdT = 0.0 self.WorkingChamberPressure_dPdT = 0.0 - self.KM013offset = self.KM013offset or math.random()*0.2 + 5.0 --регулировочное давление + local rnd = math.random(1,10) + local offs = 0.1 + self.KM013offset = self.KM013offset or math.Clamp(5.1 + (rnd >= 3 and rnd <= 7 and offs or -offs),5.0,5.2) -- Reduce pressure for brake line self.TrainToBrakeReducedPressure = math.min(self.KM013offset,self.TrainLinePressure) -- * 0.725) @@ -328,11 +335,10 @@ function TRAIN_SYSTEM:Think(dT) local HaveEPK = not Train.SubwayTrain or not Train.SubwayTrain.ARS or not Train.SubwayTrain.ARS.NoEPK local BLDisconnect,pr_speed = true,1 - ---[[ работа срывного клапана - if Train.AutostopValve.Value ~= 0 then - if self.BrakeLinePressure > 1.86 then self:TriggerInput("Autostop",1) end - Train.AutostopValve.Value = 0 - end--]] + -- работа срывного клапана + if Train.AutostopValve.Value > 0 then + self:TriggerInput("Autostop",self.BrakeLinePressure > 1.86 and 1 or 2) --value == 2 — просто открыть срывной клапан без размыкания контактов УАВА + end if self.ValveType == 1 then BLDisconnect = Train.DriverValveBLDisconnect.Value > 0 @@ -459,13 +465,14 @@ function TRAIN_SYSTEM:Think(dT) if self.EmergencyValveDisable then--and (self.BrakeLinePressure-self.OldBrakeLinePressure)>0.01 then self.EmergencyValveDisable=false self.EmergencyValve=false + Train.autosaid=false end self.OldBrakeLinePressure = self.BrakeLinePressure local leak = 0 if self.EmergencyValve then local leakst = BLDisconnect and math.max(0.3,math.log(80*self.BrakeLinePressure - 200,3)) or 1.1*(Train:GetWagonCount())*math.Clamp(self.BrakeLinePressure/4,0,1) leak = self:equalizePressure(dT,"BrakeLinePressure", 0.0,leakst)--,false,false,10) - if (self.BrakeLinePressure < 1.82 or Train.UAVA.Value > 0) then + if Train.UAVA.Value > 0 or (self.BrakeLinePressure < 1.82 and Train.AutostopValve.Value == 0) then --пока держим ЛКМ нажатой, срывной клапан открыт self.EmergencyValveDisable = true end self.Leak = true From 64784539ca7d79abad55d6b108ac1ca68579e9fe Mon Sep 17 00:00:00 2001 From: Moon Horse Date: Tue, 21 Dec 2021 21:23:24 +0300 Subject: [PATCH 14/17] =?UTF-8?q?=D0=9E=D1=82=D0=BA=D1=80=D1=8B=D1=82?= =?UTF-8?q?=D1=8B=D0=B9=20=D1=80=D0=B0=D0=B7=D0=BE=D0=B1=D1=89=D0=B8=D1=82?= =?UTF-8?q?=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=B9=20=D0=B2=20=D0=B3=D0=BE?= =?UTF-8?q?=D0=BB=D0=BE=D0=B2=D0=B5=20=D0=BF=D1=80=D0=B8=20=D1=81=D0=BF?= =?UTF-8?q?=D0=B0=D0=B2=D0=BD=D0=B5=20=D0=B2=20=D1=81=D0=BE=D1=81=D1=82?= =?UTF-8?q?=D0=BE=D1=8F=D0=BD=D0=B8=D0=B8=20"=D0=B4=D0=B5=D0=BF=D0=BE"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/entities/gmod_subway_81-717_mvm_custom.lua | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lua/entities/gmod_subway_81-717_mvm_custom.lua b/lua/entities/gmod_subway_81-717_mvm_custom.lua index 02ec7d7..dd16304 100644 --- a/lua/entities/gmod_subway_81-717_mvm_custom.lua +++ b/lua/entities/gmod_subway_81-717_mvm_custom.lua @@ -89,9 +89,10 @@ ENT.Spawner = { ent.ARS:TriggerInput("Set",(ent.Plombs.RC1 and val==1 and first) and 1 or 0) ent.ALS:TriggerInput("Set",val==1 and 1 or 0) ent.L_1:TriggerInput("Set",val==1 and 1 or 0) - ent.L_3:TriggerInput("Set",vall==1 and 1 or 0) + ent.L_3:TriggerInput("Set",val==1 and 1 or 0) ent.L_4:TriggerInput("Set",val==1 and 1 or 0) ent.EPK:TriggerInput("Set",(ent.Plombs.RC1 and val==1) and 1 or 0) + ent.DriverValveDisconnect:TriggerInput("Set",(val==4 and first) and 1 or 0) _LastSpawner=CurTime() ent.CabinDoor = val==4 and first ent.PassengerDoor = val==4 @@ -110,6 +111,7 @@ ENT.Spawner = { ent._SpawnerStarted = val end ent.Pneumatic.TrainLinePressure = val==3 and math.random()*4 or val==2 and 4.5+math.random()*3 or 7.6+math.random()*0.6 - if val==4 then ent.Pneumatic.BrakeLinePressure = 5.2 end + ent.Pneumatic.BrakeLinePressure = val == 4 and 5.2 or val == 1 and 2.3 or math.min(ent.Pneumatic.TrainLinePressure+0.25,math.random()*4) + ent.Pneumatic.WorkingChamberPressure = val==3 and math.random()*1.0 or val==2 and 4.0+math.random()*1.0 or 5.2 end}, } From 4c74dd2ce0c678b807496ef236fc83816963cff0 Mon Sep 17 00:00:00 2001 From: Moon Horse Date: Wed, 22 Dec 2021 23:46:42 +0300 Subject: [PATCH 15/17] =?UTF-8?q?=D0=A0=D0=B5=D0=B3=D1=83=D0=BB=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=BA=D0=B0=20=D0=B3=D1=80=D0=BE=D0=BC=D0=BA?= =?UTF-8?q?=D0=BE=D1=81=D1=82=D0=B8=20=D1=88=D0=B8=D0=BF=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=B2=D0=BE=D0=B7=D0=B4=D1=83=D1=85=D0=B0=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B8=20=D0=BE=D1=82=D0=BF=D1=83=D1=81=D0=BA=D0=B5=20?= =?UTF-8?q?=D0=B2=D0=B5=D0=BD=D1=82=D0=B8=D0=BB=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/entities/gmod_subway_81-717_mvm/cl_init.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/entities/gmod_subway_81-717_mvm/cl_init.lua b/lua/entities/gmod_subway_81-717_mvm/cl_init.lua index 3a294dc..3947b05 100644 --- a/lua/entities/gmod_subway_81-717_mvm/cl_init.lua +++ b/lua/entities/gmod_subway_81-717_mvm/cl_init.lua @@ -3206,7 +3206,7 @@ function ENT:Think() self:SetSoundState("rolling_high2" ,rol70*rollings,rol70p) --70 self.ReleasedPdT = math.Clamp(self.ReleasedPdT + 2*(-self:GetPackedRatio("BrakeCylinderPressure_dPdT",0)-0.8*self.ReleasedPdT)*dT,0,1) - local release1 = math.Clamp((1.1*self.ReleasedPdT-0.1)/0.32,0,8)^2 + local release1 = math.Clamp((1.1*self.ReleasedPdT-0.1)/0.48,0,8)^2 self:SetSoundState("release1",release1,1) self:SetSoundState("release2",(math.Clamp(0.3-release1,0,0.3)/0.3)*(release1/0.3),1.0) local parking_brake = self:GetPackedRatio("ParkingBrakePressure_dPdT",0) From 97c0fb8aedc656c3885422be20bdbb0ce54b24fa Mon Sep 17 00:00:00 2001 From: Moon Horse Date: Wed, 22 Dec 2021 23:48:30 +0300 Subject: [PATCH 16/17] =?UTF-8?q?=D0=A0=D0=B5=D0=B3=D1=83=D0=BB=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=BA=D0=B0=20=D1=82=D0=B5=D0=BC=D0=BF=D0=B0?= =?UTF-8?q?=20=D1=80=D0=B0=D0=B7=D1=80=D1=8F=D0=B4=D0=BA=D0=B8=20=D0=A2?= =?UTF-8?q?=D0=A6=20=D0=BF=D1=80=D0=B8=20=D0=BE=D1=82=D0=BF=D1=83=D1=81?= =?UTF-8?q?=D0=BA=D0=B5=20=D0=B2=D1=82=D0=BE=D1=80=D1=8B=D1=85=20=D0=B2?= =?UTF-8?q?=D0=B5=D0=BD=D1=82=D0=B8=D0=BB=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/metrostroi/systems/sys_81_717_pneumatic.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lua/metrostroi/systems/sys_81_717_pneumatic.lua b/lua/metrostroi/systems/sys_81_717_pneumatic.lua index 5a7538c..658fde7 100644 --- a/lua/metrostroi/systems/sys_81_717_pneumatic.lua +++ b/lua/metrostroi/systems/sys_81_717_pneumatic.lua @@ -546,7 +546,7 @@ function TRAIN_SYSTEM:Think(dT) end self.BePN2 = true else - self.PN2 = math.max(0,self.PN2-math.exp(1.2*(self.BrakeCylinderPressure - self.GN2Offset))*0.2) + self.PN2 = math.max(0,self.PN2-0.7*math.exp(3.0*(self.BrakeCylinderPressure - self.GN2Offset - self.WeightLoadRatio*1.3)+1.6)) end local targetPres = math.max(0,math.min(self.GN2Offset + self.WeightLoadRatio*1.3,self.BcBl*(self.WorkingChamberPressure - (self.BrakeLinePressure < 3.6 and self.BrakeLinePressure*self.WorkingChamberPressure/6.5 or self.BrakeLinePressure*1.028))) + (self.BrakeLinePressure_dPdT < 0 and self.WeightLoadRatio*1.3 or 0)) --local targetPres = math.max(0,math.min(self.GN2Offset + self.WeightLoadRatio*1.3,self.BcBl*(self.WorkingChamberPressure - (self.BrakeLinePressure < 3.56 and (self.BrakeLinePressure - 3)*5.56 or self.BrakeLinePressure*1.028)) + (self.BrakeLinePressure_dPdT < 0 and self.WeightLoadRatio*1.3 or 0))) @@ -565,7 +565,6 @@ function TRAIN_SYSTEM:Think(dT) end if self.BrakeCylinderValve == 1 then self:equalizePressure(dT,"BrakeCylinderPressure", math.min(self.GN2Offset + self.WeightLoadRatio*1.3,targetPressure), 1, (self.BrakeLinePressure > (self.KM013offset+0.1)) and (self.PN2 == 0) and (self.PN1 == 0) and 1.0 or 3.5, nil, (self.BrakeLinePressure_dPdT > 0.1) and (0.8+math.Clamp((1 - self.BrakeCylinderPressure)*0.8,0,1.2)) or 1) - --self:equalizePressure(dT,"BrakeCylinderPressure", math.min(self.GN2Offset + self.WeightLoadRatio*1.3,targetPressure), 0.5+math.Clamp((self.BrakeCylinderPressure-0.5)/2.8,0,0.9), (self.BrakeLinePressure > (self.KM013offset+0.1)) and (self.PN2 == 0) and (self.PN1 == 0) and 0.8 or 3.5, nil, (self.BrakeLinePressure_dPdT > 0.1) and (0.8+math.Clamp((1 - self.BrakeCylinderPressure)*0.8,0,1)) or 1) end trainLineConsumption_dPdT = trainLineConsumption_dPdT + math.max(0,self.BrakeCylinderPressure_dPdT*0.5) elseif Train.AirDistributorDisconnect.Value ~= 0 then From 116d6f735ea8d8e01b6abe65fda7a03582992f50 Mon Sep 17 00:00:00 2001 From: Moon Horse Date: Sat, 25 Dec 2021 16:35:07 +0300 Subject: [PATCH 17/17] =?UTF-8?q?=D0=A0=D0=B5=D0=B3=D1=83=D0=BB=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=BA=D0=B0=20=D1=82=D0=B5=D0=BC=D0=BF=D0=B0?= =?UTF-8?q?=20=D1=80=D0=B0=D0=B7=D1=80=D1=8F=D0=B4=D0=BA=D0=B8=20=D0=A2?= =?UTF-8?q?=D0=A6=20=D0=BF=D1=80=D0=B8=20=D0=BE=D1=82=D0=BF=D1=83=D1=81?= =?UTF-8?q?=D0=BA=D0=B5=20=D0=B2=D1=82=D0=BE=D1=80=D1=8B=D1=85=20=D0=B2?= =?UTF-8?q?=D0=B5=D0=BD=D1=82=D0=B8=D0=BB=D0=B5=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lua/metrostroi/systems/sys_81_717_pneumatic.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lua/metrostroi/systems/sys_81_717_pneumatic.lua b/lua/metrostroi/systems/sys_81_717_pneumatic.lua index 658fde7..9fec698 100644 --- a/lua/metrostroi/systems/sys_81_717_pneumatic.lua +++ b/lua/metrostroi/systems/sys_81_717_pneumatic.lua @@ -546,7 +546,8 @@ function TRAIN_SYSTEM:Think(dT) end self.BePN2 = true else - self.PN2 = math.max(0,self.PN2-0.7*math.exp(3.0*(self.BrakeCylinderPressure - self.GN2Offset - self.WeightLoadRatio*1.3)+1.6)) + --self.PN2 = math.max(0,self.PN2-0.7*math.exp(3.0*(self.BrakeCylinderPressure - self.GN2Offset - self.WeightLoadRatio*1.3)+1.6)) + self.PN2 = 0.3*math.exp(0.8*(self.BrakeCylinderPressure - dT) - 1) - 0.16 end local targetPres = math.max(0,math.min(self.GN2Offset + self.WeightLoadRatio*1.3,self.BcBl*(self.WorkingChamberPressure - (self.BrakeLinePressure < 3.6 and self.BrakeLinePressure*self.WorkingChamberPressure/6.5 or self.BrakeLinePressure*1.028))) + (self.BrakeLinePressure_dPdT < 0 and self.WeightLoadRatio*1.3 or 0)) --local targetPres = math.max(0,math.min(self.GN2Offset + self.WeightLoadRatio*1.3,self.BcBl*(self.WorkingChamberPressure - (self.BrakeLinePressure < 3.56 and (self.BrakeLinePressure - 3)*5.56 or self.BrakeLinePressure*1.028)) + (self.BrakeLinePressure_dPdT < 0 and self.WeightLoadRatio*1.3 or 0)))