1
0
mirror of https://github.com/metrostroi-repo/MetrostroiAddon.git synced 2026-05-02 00:42:29 +00:00
Files
MetrostroiAddon/lua/metrostroi/systems/sys_pr_109a.lua
g_brzhezinskiy 1d05caf866 init
2021-01-02 12:51:45 +03:00

43 lines
2.1 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
--------------------------------------------------------------------------------
-- Relays and switches panel (PR-109A)
--------------------------------------------------------------------------------
-- Copyright (C) 2013-2018 Metrostroi Team & FoxWorks Aerospace s.r.o.
-- Contains proprietary code. See license.txt for additional information.
--------------------------------------------------------------------------------
Metrostroi.DefineSystem("PR_109A")
function TRAIN_SYSTEM:Initialize()
-- Реле
-- self.Train:LoadSystem("PRV","Relay","REV-813T", { bass = true, open_time = 2.5,})
-- Реле педали бдительности (РПБ)
self.Train:LoadSystem("RPB","Relay","REV-813T", { bass = true, open_time = 2.5,})
-- Реле
self.Train:LoadSystem("RNVT","Relay","REV-813T", { bass = true, open_time = 2.5,})
-- Контактор включения провода 1 и 5 (Р1-Р5)
self.Train:LoadSystem("R1_5","Relay","KPD-110E",{ bass = true })
-- Реле заряда
self.Train:LoadSystem("RZ","Relay","REV-811T",{bass = true })
self.Train:LoadSystem("PRV","Relay","REV-811T",{close_time=0.6,bass = true })
-- Контактор дверей (КД)
self.Train:LoadSystem("RD","Relay","REV-811T",{ bass = true })
self.Train:LoadSystem("RV3","Relay","REV-813T",{ open_time = 2.3 })
self.Train:LoadSystem("KD","Relay","REV-811T",{ bass = true })
self.Train:LoadSystem("RKTT","Relay","R-52B")
-- Реле остановки (РО)
self.Train:LoadSystem("RO","Relay","KPD-110E",{ bass = true })
end
function TRAIN_SYSTEM:Think()
local Train = self.Train
self.RKTTCurrent = Train.Electric.IRT2
self.RKTTClose = 440 - 120*(1-self.Train.Pneumatic.WeightLoadRatio)*Train.RUTavt-230*math.max(0,1-Train.RUTreg) --125
self.RKTTOpen = 520 - 120*(1-self.Train.Pneumatic.WeightLoadRatio)*Train.RUTavt-230*math.max(0,1-Train.RUTreg) --130
if self.RKTTCurrent < self.RKTTClose then
Train.RKTT:TriggerInput("Set",false)
else
Train.RKTT:TriggerInput("Set",self.RKTTCurrent >= self.RKTTOpen)
end
end