From 238740173a6425ab494bf338745c2bcfec384472 Mon Sep 17 00:00:00 2001 From: toxin1pilot Date: Wed, 6 Jan 2021 17:51:21 +0300 Subject: [PATCH 1/3] Fixed battery charging, position of voltmeter --- lua/entities/gmod_subway_ezh3/cl_init.lua | 7 ++++--- lua/entities/gmod_subway_ezh3/init.lua | 2 +- lua/metrostroi/systems/sys_81_508t_electric.lua | 1 + lua/metrostroi/systems/sys_81_710_electric.lua | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lua/entities/gmod_subway_ezh3/cl_init.lua b/lua/entities/gmod_subway_ezh3/cl_init.lua index 7681ddf..8781293 100644 --- a/lua/entities/gmod_subway_ezh3/cl_init.lua +++ b/lua/entities/gmod_subway_ezh3/cl_init.lua @@ -350,7 +350,7 @@ ENT.ButtonMap["Panel"] = { sprite = {bright=0.20,size=0.25,scale=0.05,vscale=0.04,color=Color(136, 159, 211),y=0,z=-3,lamp="light_SD",hidden="ezh3_lsd"} }}, - {ID = "!BatteryVoltage", x=120-80,y=25,tooltip="",w=60, h=50,tooltipFunc = function(ent) return Format(Metrostroi.GetPhrase("Train.Buttons.BatteryVoltage"),ent:GetPackedRatio("BatteryVoltage")) end}, + {ID = "!BatteryVoltage", x=120-80,y=25,tooltip="",w=60, h=50,tooltipFunc = function(ent) return Format(Metrostroi.GetPhrase("Train.Buttons.BatteryVoltage"),ent:GetPackedRatio("BatteryVoltage")*100) end}, {ID = "!EnginesCurrent", x=120-8,y=25,tooltip="",w=60, h=50,tooltipFunc = function(ent) return Format(Metrostroi.GetPhrase("Train.Buttons.EnginesCurrent"),ent:GetPackedRatio("EnginesCurrent")*1000-500) end}, {ID = "!HighVoltage", x=120+80-18,y=25,tooltip="",w=60, h=50,tooltipFunc = function(ent) return Format(Metrostroi.GetPhrase("Train.Buttons.HighVoltage"),ent:GetPackedRatio("EnginesVoltage")*1000) end}, {ID = "!Speedometer", x=352,y=25,tooltip="",w=85, h=70,tooltipFunc = function(ent) return Format(Metrostroi.GetPhrase("Train.Buttons.Speed"),ent:GetPackedRatio("Speed")*100) end}, @@ -1147,7 +1147,7 @@ ENT.ClientProps["ampermeter"] = { ENT.ClientProps["volt1"] = { model = "models/metrostroi_train/81-710/ezh3_voltages.mdl", - pos = Vector(448.20+10.21,-20.43,-6.69), + pos = Vector(448.20+10.35,-20.57,-6.69), ang = Angle(-62,0,0), hideseat = 0.2, } @@ -1700,7 +1700,8 @@ function ENT:Think() self:Animate("brake_cylinder",self:GetPackedRatio("BCPressure"), 0.052, 0.794,nil,2)--,,0.03) self:Animate("voltmeter",self:GetPackedRatio("EnginesVoltage"), 0.632,0.36,92,2) self:Animate("ampermeter",self:GetPackedRatio("EnginesCurrent"), 0.632,0.36, nil, nil, 92,20,3) - self:Animate("volt1",self:GetPackedRatio("BatteryVoltage"),0.6,0.5,45,2) + --self:Animate("volt1",self:GetPackedRatio("BatteryVoltage"),0.6,0.5,45,2) + self:Animate("volt1",self:GetPackedRatio("BatteryVoltage"),0.613,0.455,72,2) self:Animate("speed1",self:GetPackedRatio("Speed"),0.645, 0.363, nil, nil, 90,200,20) diff --git a/lua/entities/gmod_subway_ezh3/init.lua b/lua/entities/gmod_subway_ezh3/init.lua index 6cbeb4f..aedef0e 100644 --- a/lua/entities/gmod_subway_ezh3/init.lua +++ b/lua/entities/gmod_subway_ezh3/init.lua @@ -334,7 +334,7 @@ function ENT:Think() self:SetPackedRatio("BCPressure", math.min(2.7,Pneumatic.BrakeCylinderPressure)/6.0) self:SetPackedRatio("EnginesVoltage", self.Electric.Main750V/1000.0) self:SetPackedRatio("EnginesCurrent", 0.5 + 0.5*(self.Electric.I24/500.0)) - self:SetPackedRatio("BatteryVoltage",self.Panel["V1"]*self.Battery.Voltage) + self:SetPackedRatio("BatteryVoltage",self.Panel["V1"]*self.Battery.Voltage/100) self:SetPackedBool("RT300",self.Electric.ThyristorControllerPower*self.Electric.ThyristorControllerWork>0) diff --git a/lua/metrostroi/systems/sys_81_508t_electric.lua b/lua/metrostroi/systems/sys_81_508t_electric.lua index b54f57e..f32d5cd 100644 --- a/lua/metrostroi/systems/sys_81_508t_electric.lua +++ b/lua/metrostroi/systems/sys_81_508t_electric.lua @@ -209,6 +209,7 @@ function TRAIN_SYSTEM:SolveAllInternalCircuits(Train,dT,firstIter) )/750*(0.5+0.5*B*Train.VB.Value*Train.KZ1.Value) )) Panel.MainLights2 = Panel.MainLights1*Train.KO.Value + Train.Battery:TriggerInput("Charge", Train.VB.Value*Panel.MainLights1) Train.KK:TriggerInput("Set",T[22]+T[23]) Train.KO:TriggerInput("Close",T[27]) Train.KO:TriggerInput("Open",T[28]) diff --git a/lua/metrostroi/systems/sys_81_710_electric.lua b/lua/metrostroi/systems/sys_81_710_electric.lua index 0b34d28..052a323 100644 --- a/lua/metrostroi/systems/sys_81_710_electric.lua +++ b/lua/metrostroi/systems/sys_81_710_electric.lua @@ -251,6 +251,7 @@ function TRAIN_SYSTEM:SolveAllInternalCircuits(Train,dT,firstIter) )/750*(0.5+0.5*B*Train.VB.Value*Train.KZ1.Value) )) Panel.MainLights2 = Panel.MainLights1*Train.KO.Value + Train.Battery:TriggerInput("Charge", Train.VB.Value*Panel.MainLights1) Panel.VPR = BO*Train.RST.Value From 929db12e4d950b559f8f31ab4f9715e68c60311d Mon Sep 17 00:00:00 2001 From: toxin1pilot Date: Mon, 11 Jan 2021 17:11:14 +0300 Subject: [PATCH 2/3] 95 --- lua/entities/gmod_subway_ezh3/cl_init.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lua/entities/gmod_subway_ezh3/cl_init.lua b/lua/entities/gmod_subway_ezh3/cl_init.lua index 8781293..96fcca6 100644 --- a/lua/entities/gmod_subway_ezh3/cl_init.lua +++ b/lua/entities/gmod_subway_ezh3/cl_init.lua @@ -1700,8 +1700,7 @@ function ENT:Think() self:Animate("brake_cylinder",self:GetPackedRatio("BCPressure"), 0.052, 0.794,nil,2)--,,0.03) self:Animate("voltmeter",self:GetPackedRatio("EnginesVoltage"), 0.632,0.36,92,2) self:Animate("ampermeter",self:GetPackedRatio("EnginesCurrent"), 0.632,0.36, nil, nil, 92,20,3) - --self:Animate("volt1",self:GetPackedRatio("BatteryVoltage"),0.6,0.5,45,2) - self:Animate("volt1",self:GetPackedRatio("BatteryVoltage"),0.613,0.455,72,2) + self:Animate("volt1",self:GetPackedRatio("BatteryVoltage"),0.613,0.455,72,2) self:Animate("speed1",self:GetPackedRatio("Speed"),0.645, 0.363, nil, nil, 90,200,20) From 661f7ccaa5123f906365c54a841c0ef61645f602 Mon Sep 17 00:00:00 2001 From: toxin1pilot Date: Mon, 11 Jan 2021 17:28:55 +0300 Subject: [PATCH 3/3] Fixed tab --- lua/entities/gmod_subway_ezh3/cl_init.lua | 2 +- lua/entities/gmod_subway_ezh3/init.lua | 2 +- lua/metrostroi/systems/sys_81_508t_electric.lua | 2 +- lua/metrostroi/systems/sys_81_710_electric.lua | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lua/entities/gmod_subway_ezh3/cl_init.lua b/lua/entities/gmod_subway_ezh3/cl_init.lua index 96fcca6..9de1cee 100644 --- a/lua/entities/gmod_subway_ezh3/cl_init.lua +++ b/lua/entities/gmod_subway_ezh3/cl_init.lua @@ -1699,7 +1699,7 @@ function ENT:Think() self:Animate("train_line",self:GetPackedRatio("TLPressure"), 0.044, 0.778, 256,2)--,,0.01) self:Animate("brake_cylinder",self:GetPackedRatio("BCPressure"), 0.052, 0.794,nil,2)--,,0.03) self:Animate("voltmeter",self:GetPackedRatio("EnginesVoltage"), 0.632,0.36,92,2) - self:Animate("ampermeter",self:GetPackedRatio("EnginesCurrent"), 0.632,0.36, nil, nil, 92,20,3) + self:Animate("ampermeter",self:GetPackedRatio("EnginesCurrent"), 0.632,0.36,nil, nil,92,20,3) self:Animate("volt1",self:GetPackedRatio("BatteryVoltage"),0.613,0.455,72,2) self:Animate("speed1",self:GetPackedRatio("Speed"),0.645, 0.363, nil, nil, 90,200,20) diff --git a/lua/entities/gmod_subway_ezh3/init.lua b/lua/entities/gmod_subway_ezh3/init.lua index aedef0e..72d1f3a 100644 --- a/lua/entities/gmod_subway_ezh3/init.lua +++ b/lua/entities/gmod_subway_ezh3/init.lua @@ -333,8 +333,8 @@ function ENT:Think() self:SetPackedRatio("TLPressure", Pneumatic.TrainLinePressure/16.0) self:SetPackedRatio("BCPressure", math.min(2.7,Pneumatic.BrakeCylinderPressure)/6.0) self:SetPackedRatio("EnginesVoltage", self.Electric.Main750V/1000.0) - self:SetPackedRatio("EnginesCurrent", 0.5 + 0.5*(self.Electric.I24/500.0)) self:SetPackedRatio("BatteryVoltage",self.Panel["V1"]*self.Battery.Voltage/100) + self:SetPackedRatio("EnginesCurrent", 0.5 + 0.5*(self.Electric.I24/500.0)) self:SetPackedBool("RT300",self.Electric.ThyristorControllerPower*self.Electric.ThyristorControllerWork>0) diff --git a/lua/metrostroi/systems/sys_81_508t_electric.lua b/lua/metrostroi/systems/sys_81_508t_electric.lua index f32d5cd..b132db9 100644 --- a/lua/metrostroi/systems/sys_81_508t_electric.lua +++ b/lua/metrostroi/systems/sys_81_508t_electric.lua @@ -209,7 +209,7 @@ function TRAIN_SYSTEM:SolveAllInternalCircuits(Train,dT,firstIter) )/750*(0.5+0.5*B*Train.VB.Value*Train.KZ1.Value) )) Panel.MainLights2 = Panel.MainLights1*Train.KO.Value - Train.Battery:TriggerInput("Charge", Train.VB.Value*Panel.MainLights1) + Train.Battery:TriggerInput("Charge", Train.VB.Value*Panel.MainLights1) Train.KK:TriggerInput("Set",T[22]+T[23]) Train.KO:TriggerInput("Close",T[27]) Train.KO:TriggerInput("Open",T[28]) diff --git a/lua/metrostroi/systems/sys_81_710_electric.lua b/lua/metrostroi/systems/sys_81_710_electric.lua index 052a323..8507937 100644 --- a/lua/metrostroi/systems/sys_81_710_electric.lua +++ b/lua/metrostroi/systems/sys_81_710_electric.lua @@ -251,7 +251,7 @@ function TRAIN_SYSTEM:SolveAllInternalCircuits(Train,dT,firstIter) )/750*(0.5+0.5*B*Train.VB.Value*Train.KZ1.Value) )) Panel.MainLights2 = Panel.MainLights1*Train.KO.Value - Train.Battery:TriggerInput("Charge", Train.VB.Value*Panel.MainLights1) + Train.Battery:TriggerInput("Charge", Train.VB.Value*Panel.MainLights1) Panel.VPR = BO*Train.RST.Value