Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Komponenten --
- event.ignoreAll()
- gpu1 = computer.getGPUs(1)[1]
- gpu2 = computer.getGPUs(1)[2]
- FCScreen = component.proxy("A4F4F5B84ABECA3C00DC4B911D08A25C")
- PowerScreen = component.proxy("9884839E45D712B4E80C1EA10678D423")
- PowerPole = component.proxy("93C9C4D14EBE274BCB5F90BE120604DD")
- FCTank1 = component.proxy("8FBB53534CD146B2C164BAA2B239FDFA")
- FCTank2 = component.proxy("4A5240694B7F6B7B6A0167A502D56F17")
- FCTank3 = component.proxy("23B113894643C8A082F0AD8298719AAE")
- FCTank4 = component.proxy("F09587554E2831D602495CB71F83882D")
- PowerStat = PowerPole:getPowerConnectors()[1]
- PowerDet = PowerStat:getCircuit()
- gpu1:bindScreen(FCScreen)
- gpu2:bindScreen(PowerScreen)
- FC1w, FC1h = gpu1:getSize()
- FC2w, FC2h = gpu2:getSize()
- gpu1:setsize(FC1w,FC1h)
- gpu2:setsize(35,10)
- gpu1:setForeground(1,1,1,1)
- gpu1:setBackground(0,0,0,0)
- gpu2:setForeground(1,1,1,1)
- gpu2:setBackground(0,0,0,0)
- --event.listen(gpu1)
- --event.listen(gpu2)
- -- Bezeichnungen --
- line="--------------------------"
- -- OPTION --
- -- Tank1:flush()
- -- Tank2:flush()
- -- DATEN --
- z = 3 -- Zeilen --
- fcx = 1 -- Spalte links Abstand --
- function getdata()
- V1 = FCTank1.fluidcontent
- F1 = FCTank1.flowfill - FCTank1.flowdrain
- V1 = math.floor(V1) -- runden --
- F1 = math.floor(F1) -- runden --
- V2 = FCTank2.fluidcontent
- F2 = FCTank2.flowfill - FCTank2.flowdrain
- V2 = math.floor(V2) -- runden --
- F2 = math.floor(F2) -- runden --
- V3 = FCTank3.fluidcontent
- F3 = FCTank3.flowfill - FCTank3.flowdrain
- V3 = math.floor(V3) -- runden --
- F3 = math.floor(F3) -- runden --
- V4 = FCTank4.fluidcontent
- F4 = FCTank4.flowfill - FCTank4.flowdrain
- V4 = math.floor(V4) -- runden --
- F4 = math.floor(F4) -- runden --
- Capa = PowerDet.capacity
- Verbr = PowerDet.consumption
- Free = Capa - Verbr
- Ausl = (100/Capa)*Verbr
- Capa = math.floor(Capa)
- Verbr = math.floor(Verbr)
- Free = math.floor(Free)
- Ausl = math.floor(Ausl)
- AuslProz = math.floor(Ausl*10)/10
- AuslProz = math.floor(AuslProz)
- n = AuslProz / 10
- -- Auslastung --
- Ausl = math.floor(Ausl)
- end
- -- AUSGABE Bildschirm 1--
- function stream1()
- gpu1:fill(0,0,FC1w,FC1h," ")
- gpu1:setText(fcx,1,"FUEL CITY")
- gpu1:setText(fcx,z,"Tank 1: "..V1.."L") -- Tank1
- gpu1:setText(15,z,"|".."\tNET: "..F1)
- gpu1:setText(fcx,z+1,line) -- Trennlinie
- gpu1:setText(fcx,z+2,"Tank 2: "..V2.."L") -- Tank2
- gpu1:setText(15,z+2,"|".."\tNET: "..F2)
- gpu1:setText(fcx,z+3,line) -- Trennlinie
- gpu1:setText(fcx,z+4,"Tank 3: "..V3.."L") -- Tank3
- gpu1:setText(15,z+4,"|".."\tNET: "..F3)
- gpu1:setText(fcx,z+5,line) -- Trennlinie
- gpu1:setText(fcx,z+6,"Tank 4: "..V4.."L") -- Tank4
- gpu1:setText(15,z+6,"|".."\tNET: "..F4)
- gpu1:setText(fcx,z+7,line) -- Trennlinie
- gpu1:flush()
- end
- -- AUSGABE Bildschirm 2--
- function stream2()
- xn = 14 -- Startabstand (xn) für Balken
- gpu2:fill(0,0,FC2w,FC2h," ")
- gpu2:setText(fcx,1,"POWER GRID")
- gpu2:setText(fcx,z,"CAP: "..Capa.." MWh")
- gpu2:setText(fcx,z+2,"USE: "..Verbr.." MWh")
- gpu2:setText(fcx,z+4,"AUSL: "..Ausl.." %")
- gpu2:setText(fcx+12,z+4,"[")
- gpu2:setText(fcx+23,z+4,"]")
- for i = 1,n,1 do
- gpu2:setText(xn,z+4,"#")
- xn = xn+1
- end
- gpu2:flush()
- end
- -- RUN --
- while true do
- event.pull(1)
- getdata()
- stream1()
- stream2()
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement