1
0
mirror of https://github.com/metrostroi-repo/MetrostroiAddon.git synced 2026-05-04 00:52:33 +00:00

Добавлены предохранители, исправления схем

Добавлены
- Предохранители

Обновление схем:
- КРУ перенесено на 14-й провод
- Контроль тормоза на 21-й провод
- Запитка ВЗ-1 от АРС на 29-й провод
- Небольшой фикс сопротивления резисторов

Все схемы приведены к московской версии Еж3 от середины 80-ых до наших дней.
This commit is contained in:
Anton Shukin
2024-02-11 05:08:15 +03:00
parent d17cb74904
commit 2c850a9bbc
69 changed files with 1776 additions and 194 deletions

View File

@@ -15,6 +15,11 @@ ENT.SyncTable = {
"FrontBrakeLineIsolation","FrontTrainLineIsolation",
"EmergencyBrakeValve",
"GV",
"Ring",
"PR1","PR2","PR5","PR11","PR4","PR9","PR6","PR8","PR12",--9
"PRL13","PRL31","PRL17","PRL25","PRL18","PRL24","PRL19","PRL6A","PRL4A","PRL16","PRL28","PRL2A","PRL34",
"PRL23","PRL15","PRL22","PRL20","PRL21","PRL32","PRL30","PRL1A","PRL14","PRL26","PRL12","PRL29","PRL33",
"FBoxCover"
}
function ENT:Initialize()
@@ -176,8 +181,7 @@ function ENT:Initialize()
-- Cross connections in train wires
self.TrainWireInverts = {
--[18] = true,
[34] = true,
[21] = true,
}
self.TrainWireCrossConnections = {
[5] = 4, -- Reverser F<->B
@@ -192,7 +196,9 @@ function ENT:Initialize()
self.RearDoor = false
self.FrontDoor = false
self.CabinDoor = false
self.PassengerDoor = false
self.PassengerDoor = false
self.FuseboxCover = false
self:TrainSpawnerUpdate()
end
@@ -209,17 +215,19 @@ function ENT:Think()
self:SetPackedBool("Headlights1",Panel.Headlights1 > 0)
self:SetPackedBool("Headlights2",Panel.Headlights2 > 0)
local lightsActive2 = math.min(1,Panel.MainLights2)
local lightsActive1 = math.min(1,Panel.MainLights1)^2
self:SetPackedBool("RedLights1",Panel.RedLight1 > 0)
self:SetPackedBool("RedLights2",Panel.RedLight2 > 0)
local lightsActive2 = math.min(1,self.Panel.MainLights2)^2
local lightsActive1 = math.min(1,self.Panel.MainLights1)^2
local LightPower = math.min(1,self.Panel.LightPower)^2
local emerActive1 = Panel.EmergencyLights1
local emerActive2 = Panel.EmergencyLights2
self:SetPackedBool("Lamps_emer1",emerActive1 > 0 and lightsActive1 == 0)
self:SetPackedBool("Lamps_cab",emerActive1 > 0)
self:SetPackedBool("Lamps_emer2",emerActive2 > 0)
self:SetPackedBool("Lamps_half1",lightsActive1 > 0)
self:SetPackedBool("Lamps_half2",lightsActive2 > 0)
self:SetPackedRatio("LampsStrength",lightsActive1)
self:SetPackedRatio("LampsStrength",LightPower)
-- Switch and button states
--self:SetPackedBool(0,self:IsWrenchPresent())
@@ -251,7 +259,8 @@ function ENT:Think()
if self.TrueBrakeAngle > 0.999 and self.ManualBrake > self.TrueBrakeAngle then self.TrueBrakeAngle = self.ManualBrake end
self.TrueBrakeAngle = self.TrueBrakeAngle + (self.ManualBrake - self.TrueBrakeAngle)*2.0*(self.DeltaTime or 0)
self:SetPackedRatio("ManualBrake",self.TrueBrakeAngle)
self:SetPackedBool("RingEnabled",Panel.Ring > 0.5)
self:SetPackedRatio("LampsCount",math.Clamp(1-self.Electric.Cosume,0.3,1))
self:SetNW2Int("WrenchMode",self.KVWrenchMode)
self:SetPackedBool("Compressor",Pneumatic.Compressor == 1.0)
@@ -262,7 +271,6 @@ function ENT:Think()
self:SetPackedBool("CabinDoor",self.CabinDoor)
self:SetPackedBool("AnnPlay",Panel.AnnouncerPlaying > 0)
self:SetPackedRatio("CranePosition", Pneumatic.DriverValvePosition/7)
self:SetPackedRatio("ControllerPosition", (self.KV.ControllerPosition+3)/7)
self:SetPackedRatio("ReverserPosition", 1-(self.KV.ReverserPosition+1)/2)
@@ -272,7 +280,7 @@ function ENT:Think()
self:SetPackedRatio("BCPressure", math.min(2.7,Pneumatic.BrakeCylinderPressure)/6.0)
self:SetPackedRatio("EnginesVoltage", self.Engines.E24/2000.0)
self:SetPackedRatio("EnginesCurrent", 0.5 + 0.5*(self.Electric.I24/500.0))
self:SetPackedRatio("BatteryVoltage",Panel["V1"]*self.Battery.Voltage/150.0)
self:SetPackedRatio("BatteryVoltage",self.Panel["V1"]*self.Battery.Voltage/150)
self:SetPackedRatio("Speed", self.Speed/100)
@@ -308,6 +316,29 @@ function ENT:Think()
end
self:GenerateJerks()
--Fuses
self:SetPackedBool("PR1FState",self.PR1.Value)
self:SetPackedBool("PR2FState",self.PR2.Value)
self:SetPackedBool("PR5FState",self.PR5.Value)
self:SetPackedBool("PR11FState",self.PR11.Value)
self:SetPackedBool("PR4FState",self.PR4.Value)
self:SetPackedBool("PR9FState",self.PR9.Value)
self:SetPackedBool("PR6FState",self.PR6.Value)
self:SetPackedBool("PR8FState",self.PR8.Value)
self:SetPackedBool("PR12FState",self.PR12.Value)
self:SetPackedBool("PR1Cover", self.PR1Cap.Value)
self:SetPackedBool("PR2Cover", self.PR2Cap.Value)
self:SetPackedBool("PR5Cover", self.PR5Cap.Value)
self:SetPackedBool("PR11Cover", self.PR11Cap.Value)
self:SetPackedBool("PR4Cover", self.PR4Cap.Value)
self:SetPackedBool("PR9Cover", self.PR9Cap.Value)
self:SetPackedBool("PR6Cover", self.PR6Cap.Value)
self:SetPackedBool("PR8Cover", self.PR8Cap.Value)
self:SetPackedBool("PR12Cover", self.PR12Cap.Value)
self:SetPackedBool("FuseboxCover", self.FuseboxCover)
return RetVal
end
@@ -317,7 +348,7 @@ function ENT:OnButtonPress(button,ply)
if string.find(button,"PneumaticBrakeSet") then
self.Pneumatic:TriggerInput("BrakeSet",tonumber(button:sub(-1,-1)))
return
end
end
-- Parking brake
if button == "ParkingBrakeLeft" then self.ManualBrake = math.max(0.0,(self.ManualBrake or 0) - 0.05) end
if button == "ParkingBrakeRight" then self.ManualBrake = math.min(1.0,(self.ManualBrake or 0) + 0.05) end
@@ -325,6 +356,7 @@ function ENT:OnButtonPress(button,ply)
self.Pneumatic:TriggerInput("BrakeSet",tonumber(button:sub(-1,-1)))
return
end
if button == "FBoxCover" then self.FuseboxCover = not self.FuseboxCover end
if button == "FrontDoor" then self.FrontDoor = not self.FrontDoor end
if button == "RearDoor" then self.RearDoor = not self.RearDoor end
if button == "PassengerDoor" then self.PassengerDoor = not self.PassengerDoor end