2022-06-16 15:24:35 +00:00
|
|
|
local core = require("graphics.core")
|
|
|
|
|
|
|
|
local style = require("coordinator.ui.style")
|
|
|
|
|
2022-06-25 20:21:57 +00:00
|
|
|
local reactor_view = require("coordinator.ui.components.reactor")
|
|
|
|
local boiler_view = require("coordinator.ui.components.boiler")
|
|
|
|
|
2022-06-16 15:24:35 +00:00
|
|
|
local Div = require("graphics.elements.div")
|
2022-06-29 21:40:46 +00:00
|
|
|
local Rectangle = require("graphics.elements.rectangle")
|
|
|
|
local TextBox = require("graphics.elements.textbox")
|
|
|
|
|
2022-06-16 15:24:35 +00:00
|
|
|
local HorizontalBar = require("graphics.elements.indicators.hbar")
|
|
|
|
local DataIndicator = require("graphics.elements.indicators.data")
|
2022-06-29 21:40:46 +00:00
|
|
|
local PipeNetwork = require("graphics.elements.indicators.pipenet")
|
2022-06-16 15:24:35 +00:00
|
|
|
local StateIndicator = require("graphics.elements.indicators.state")
|
|
|
|
|
|
|
|
local TEXT_ALIGN = core.graphics.TEXT_ALIGN
|
|
|
|
|
|
|
|
local cpair = core.graphics.cpair
|
|
|
|
local border = core.graphics.border
|
2022-06-29 21:40:46 +00:00
|
|
|
local pipe = core.graphics.pipe
|
2022-06-16 15:24:35 +00:00
|
|
|
|
|
|
|
---@param parent graphics_element
|
|
|
|
local function make(parent, x, y, unit_id)
|
|
|
|
-- bounding box div
|
|
|
|
local root = Div{parent=parent,x=x,y=y,width=75,height=50}
|
|
|
|
|
|
|
|
-- unit header message
|
|
|
|
TextBox{parent=root,text="Unit #" .. unit_id,alignment=TEXT_ALIGN.CENTER,height=1,fg_bg=style.header}
|
|
|
|
|
2022-06-25 20:21:57 +00:00
|
|
|
-------------
|
|
|
|
-- REACTOR --
|
|
|
|
-------------
|
2022-06-16 15:24:35 +00:00
|
|
|
|
2022-06-25 20:21:57 +00:00
|
|
|
reactor_view(root, 1, 3)
|
2022-06-16 15:24:35 +00:00
|
|
|
|
2022-06-29 21:40:46 +00:00
|
|
|
local pipes = {
|
|
|
|
pipe(0, 0, 13, 12, colors.lightBlue),
|
|
|
|
pipe(0, 0, 13, 3, colors.lightBlue),
|
|
|
|
pipe(2, 0, 11, 2, colors.orange),
|
|
|
|
pipe(2, 0, 11, 11, colors.orange)
|
|
|
|
}
|
|
|
|
|
|
|
|
PipeNetwork{parent=root,x=12,y=10,pipes=pipes,bg=colors.lightGray}
|
|
|
|
|
2022-06-25 20:21:57 +00:00
|
|
|
-------------
|
|
|
|
-- BOILERS --
|
|
|
|
-------------
|
2022-06-16 15:24:35 +00:00
|
|
|
|
2022-06-25 20:21:57 +00:00
|
|
|
boiler_view(root, 23, 11)
|
|
|
|
boiler_view(root, 23, 20)
|
2022-06-16 15:24:35 +00:00
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
return make
|