#232 continued work on flow monitor, added SPS display
This commit is contained in:
@@ -16,9 +16,25 @@ local TextBox = require("graphics.elements.textbox")
|
||||
|
||||
local DataIndicator = require("graphics.elements.indicators.data")
|
||||
|
||||
local Div = require("graphics.elements.div")
|
||||
local PipeNetwork = require("graphics.elements.pipenet")
|
||||
local TextBox = require("graphics.elements.textbox")
|
||||
|
||||
local Rectangle = require("graphics.elements.rectangle")
|
||||
|
||||
local DataIndicator = require("graphics.elements.indicators.data")
|
||||
local HorizontalBar = require("graphics.elements.indicators.hbar")
|
||||
local StateIndicator = require("graphics.elements.indicators.state")
|
||||
|
||||
local IndicatorLight = require("graphics.elements.indicators.light")
|
||||
local TriIndicatorLight = require("graphics.elements.indicators.trilight")
|
||||
local VerticalBar = require("graphics.elements.indicators.vbar")
|
||||
|
||||
local TEXT_ALIGN = core.TEXT_ALIGN
|
||||
|
||||
local cpair = core.cpair
|
||||
local border = core.border
|
||||
local pipe = core.pipe
|
||||
|
||||
-- create new flow view
|
||||
---@param main graphics_element main displaybox
|
||||
@@ -33,9 +49,27 @@ local function init(main)
|
||||
|
||||
datetime.register(facility.ps, "date_time", datetime.set_value)
|
||||
|
||||
for i = 1, 4 do
|
||||
flow_overview(main, 25, 5 + ((i - 1) * 20), units[i])
|
||||
local po_pipes = {}
|
||||
|
||||
for i = 1, facility.num_units do
|
||||
local y_offset = ((i - 1) * 20)
|
||||
flow_overview(main, 25, 5 + y_offset, units[i])
|
||||
table.insert(po_pipes, pipe(0, 6 + y_offset, 8, 0, colors.cyan, true, true))
|
||||
end
|
||||
|
||||
local text_fg_bg = cpair(colors.black, colors.white)
|
||||
local lu_col = cpair(colors.gray, colors.gray)
|
||||
|
||||
PipeNetwork{parent=main,x=139,y=12,pipes=po_pipes,bg=colors.lightGray}
|
||||
|
||||
local sps = Div{parent=main,x=142,y=5,height=8}
|
||||
|
||||
TextBox{parent=sps,x=1,y=1,text="SPS",alignment=TEXT_ALIGN.CENTER,width=21,height=1,fg_bg=cpair(colors.white,colors.gray)}
|
||||
local sps_box = Rectangle{parent=sps,x=1,y=2,border=border(1, colors.gray, true),width=21,height=7,thin=true,fg_bg=cpair(colors.black,colors.white)}
|
||||
local sps_conn = IndicatorLight{parent=sps_box,label="CONNECTED",colors=cpair(colors.green,colors.gray)}
|
||||
local sps_act = IndicatorLight{parent=sps_box,label="ACTIVE",colors=cpair(colors.green,colors.gray)}
|
||||
local sps_in = DataIndicator{parent=sps_box,y=4,lu_colors=lu_col,label="IN ",unit="mB/t",format="%9.2f",value=123.456,width=19,fg_bg=text_fg_bg}
|
||||
local sps_rate = DataIndicator{parent=sps_box,lu_colors=lu_col,label="RATE",unit="\xb5B/t",format="%9.2f",value=123456.78,width=19,fg_bg=text_fg_bg}
|
||||
end
|
||||
|
||||
return init
|
||||
|
||||
Reference in New Issue
Block a user