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

Merge pull request #97 from metrostroi-repo/95

Fixed battery charging, position of voltmeter
This commit is contained in:
glebqip
2021-01-11 17:32:18 +03:00
committed by GitHub
4 changed files with 7 additions and 5 deletions

View File

@@ -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"} 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 = "!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 = "!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}, {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"] = { ENT.ClientProps["volt1"] = {
model = "models/metrostroi_train/81-710/ezh3_voltages.mdl", 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), ang = Angle(-62,0,0),
hideseat = 0.2, hideseat = 0.2,
} }
@@ -1700,7 +1700,7 @@ function ENT:Think()
self:Animate("brake_cylinder",self:GetPackedRatio("BCPressure"), 0.052, 0.794,nil,2)--,,0.03) 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("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.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) self:Animate("speed1",self:GetPackedRatio("Speed"),0.645, 0.363, nil, nil, 90,200,20)

View File

@@ -333,8 +333,8 @@ function ENT:Think()
self:SetPackedRatio("TLPressure", Pneumatic.TrainLinePressure/16.0) self:SetPackedRatio("TLPressure", Pneumatic.TrainLinePressure/16.0)
self:SetPackedRatio("BCPressure", math.min(2.7,Pneumatic.BrakeCylinderPressure)/6.0) self:SetPackedRatio("BCPressure", math.min(2.7,Pneumatic.BrakeCylinderPressure)/6.0)
self:SetPackedRatio("EnginesVoltage", self.Electric.Main750V/1000.0) self:SetPackedRatio("EnginesVoltage", self.Electric.Main750V/1000.0)
self:SetPackedRatio("BatteryVoltage",self.Panel["V1"]*self.Battery.Voltage/100)
self:SetPackedRatio("EnginesCurrent", 0.5 + 0.5*(self.Electric.I24/500.0)) self:SetPackedRatio("EnginesCurrent", 0.5 + 0.5*(self.Electric.I24/500.0))
self:SetPackedRatio("BatteryVoltage",self.Panel["V1"]*self.Battery.Voltage)
self:SetPackedBool("RT300",self.Electric.ThyristorControllerPower*self.Electric.ThyristorControllerWork>0) self:SetPackedBool("RT300",self.Electric.ThyristorControllerPower*self.Electric.ThyristorControllerWork>0)

View File

@@ -209,6 +209,7 @@ function TRAIN_SYSTEM:SolveAllInternalCircuits(Train,dT,firstIter)
)/750*(0.5+0.5*B*Train.VB.Value*Train.KZ1.Value) )/750*(0.5+0.5*B*Train.VB.Value*Train.KZ1.Value)
)) ))
Panel.MainLights2 = Panel.MainLights1*Train.KO.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.KK:TriggerInput("Set",T[22]+T[23])
Train.KO:TriggerInput("Close",T[27]) Train.KO:TriggerInput("Close",T[27])
Train.KO:TriggerInput("Open",T[28]) Train.KO:TriggerInput("Open",T[28])

View File

@@ -251,6 +251,7 @@ function TRAIN_SYSTEM:SolveAllInternalCircuits(Train,dT,firstIter)
)/750*(0.5+0.5*B*Train.VB.Value*Train.KZ1.Value) )/750*(0.5+0.5*B*Train.VB.Value*Train.KZ1.Value)
)) ))
Panel.MainLights2 = Panel.MainLights1*Train.KO.Value Panel.MainLights2 = Panel.MainLights1*Train.KO.Value
Train.Battery:TriggerInput("Charge", Train.VB.Value*Panel.MainLights1)
Panel.VPR = BO*Train.RST.Value Panel.VPR = BO*Train.RST.Value