#72 work on main layout, reactor and boiler views exist now
This commit is contained in:
@@ -2,6 +2,9 @@ local core = require("graphics.core")
|
||||
|
||||
local style = require("coordinator.ui.style")
|
||||
|
||||
local reactor_view = require("coordinator.ui.components.reactor")
|
||||
local boiler_view = require("coordinator.ui.components.boiler")
|
||||
|
||||
local Div = require("graphics.elements.div")
|
||||
local HorizontalBar = require("graphics.elements.indicators.hbar")
|
||||
local DataIndicator = require("graphics.elements.indicators.data")
|
||||
@@ -22,22 +25,19 @@ local function make(parent, x, y, unit_id)
|
||||
-- unit header message
|
||||
TextBox{parent=root,text="Unit #" .. unit_id,alignment=TEXT_ALIGN.CENTER,height=1,fg_bg=style.header}
|
||||
|
||||
-- reactor
|
||||
local reactor = Rectangle{parent=root,border=border(1, colors.gray),width=30,height=10,x=1,y=3}
|
||||
-------------
|
||||
-- REACTOR --
|
||||
-------------
|
||||
|
||||
local text_fg_bg = cpair(colors.black, colors.lightGray)
|
||||
local lu_col = cpair(colors.gray, colors.gray)
|
||||
reactor_view(root, 1, 3)
|
||||
|
||||
local status = StateIndicator{parent=reactor,x=9,y=2,states=style.reactor.states,value=1,min_width=14}
|
||||
local core_temp = DataIndicator{parent=reactor,x=3,y=4,lu_colors=lu_col,label="Core: ",unit="K",format="%7.0f",value=295,width=26,fg_bg=text_fg_bg}
|
||||
local heating_r = DataIndicator{parent=reactor,x=3,y=5,lu_colors=lu_col,label="Heating:",unit="mB/t",format="%7.0f",value=359999,width=26,fg_bg=text_fg_bg}
|
||||
local burn_r = DataIndicator{parent=reactor,x=3,y=6,lu_colors=lu_col,label="Burn: ",unit="mB/t",format="%7.1f",value=40.1,width=26,fg_bg=text_fg_bg}
|
||||
-------------
|
||||
-- BOILERS --
|
||||
-------------
|
||||
|
||||
local fuel = HorizontalBar{parent=root,x=34,y=4,show_percent=true,bar_fg_bg=cpair(colors.brown,colors.white),height=1,width=14}
|
||||
local coolant = HorizontalBar{parent=root,x=34,y=5,show_percent=true,bar_fg_bg=cpair(colors.lightBlue,colors.white),height=1,width=14}
|
||||
boiler_view(root, 23, 11)
|
||||
boiler_view(root, 23, 20)
|
||||
|
||||
fuel.update(0.85)
|
||||
coolant.update(0.75)
|
||||
end
|
||||
|
||||
return make
|
||||
|
||||
Reference in New Issue
Block a user