1
0
mirror of https://github.com/metrostroi-repo/MetrostroiAddon.git synced 2026-05-02 00:42:29 +00:00

Оптимизация правок в электрике + настройка пневматики (ВЗ№2 и ЭПВ)

This commit is contained in:
Moon Horse
2022-01-13 18:07:40 +03:00
parent 701da5fe9d
commit 52f4d55fcc
5 changed files with 8 additions and 17 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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]

View File

@@ -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

View File

@@ -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