rename temp global variable
This commit is contained in:
parent
8275b64a2a
commit
71d90d542e
|
@ -2,22 +2,22 @@ local Widget = require 'Widget'
|
||||||
local FillRect = require 'FillRect'
|
local FillRect = require 'FillRect'
|
||||||
|
|
||||||
local left = Widget.Panel{
|
local left = Widget.Panel{
|
||||||
x = CONSTRUCTION_GLOBAL.LEFT_X - CONSTRUCTION_GLOBAL.PANEL_MARGIN_X,
|
x = G_DIMENSIONS_.LEFT_X - G_DIMENSIONS_.PANEL_MARGIN_X,
|
||||||
y = CONSTRUCTION_GLOBAL.TOP_Y - CONSTRUCTION_GLOBAL.PANEL_MARGIN_Y,
|
y = G_DIMENSIONS_.TOP_Y - G_DIMENSIONS_.PANEL_MARGIN_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH + CONSTRUCTION_GLOBAL.PANEL_MARGIN_X * 2,
|
width = G_DIMENSIONS_.SECTION_WIDTH + G_DIMENSIONS_.PANEL_MARGIN_X * 2,
|
||||||
height = CONSTRUCTION_GLOBAL.SIDE_HEIGHT + CONSTRUCTION_GLOBAL.PANEL_MARGIN_Y * 2,
|
height = G_DIMENSIONS_.SIDE_HEIGHT + G_DIMENSIONS_.PANEL_MARGIN_Y * 2,
|
||||||
}
|
}
|
||||||
local center = Widget.Panel{
|
local center = Widget.Panel{
|
||||||
x = CONSTRUCTION_GLOBAL.CENTER_LEFT_X - CONSTRUCTION_GLOBAL.PANEL_MARGIN_X,
|
x = G_DIMENSIONS_.CENTER_LEFT_X - G_DIMENSIONS_.PANEL_MARGIN_X,
|
||||||
y = CONSTRUCTION_GLOBAL.TOP_Y - CONSTRUCTION_GLOBAL.PANEL_MARGIN_Y,
|
y = G_DIMENSIONS_.TOP_Y - G_DIMENSIONS_.PANEL_MARGIN_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.CENTER_WIDTH + CONSTRUCTION_GLOBAL.PANEL_MARGIN_Y * 2 + CONSTRUCTION_GLOBAL.CENTER_PAD,
|
width = G_DIMENSIONS_.CENTER_WIDTH + G_DIMENSIONS_.PANEL_MARGIN_Y * 2 + G_DIMENSIONS_.CENTER_PAD,
|
||||||
height = CONSTRUCTION_GLOBAL.CENTER_HEIGHT + CONSTRUCTION_GLOBAL.PANEL_MARGIN_Y * 2,
|
height = G_DIMENSIONS_.CENTER_HEIGHT + G_DIMENSIONS_.PANEL_MARGIN_Y * 2,
|
||||||
}
|
}
|
||||||
local right = Widget.Panel{
|
local right = Widget.Panel{
|
||||||
x = CONSTRUCTION_GLOBAL.RIGHT_X - CONSTRUCTION_GLOBAL.PANEL_MARGIN_X,
|
x = G_DIMENSIONS_.RIGHT_X - G_DIMENSIONS_.PANEL_MARGIN_X,
|
||||||
y = CONSTRUCTION_GLOBAL.TOP_Y - CONSTRUCTION_GLOBAL.PANEL_MARGIN_Y,
|
y = G_DIMENSIONS_.TOP_Y - G_DIMENSIONS_.PANEL_MARGIN_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH + CONSTRUCTION_GLOBAL.PANEL_MARGIN_X * 2,
|
width = G_DIMENSIONS_.SECTION_WIDTH + G_DIMENSIONS_.PANEL_MARGIN_X * 2,
|
||||||
height = CONSTRUCTION_GLOBAL.SIDE_HEIGHT + CONSTRUCTION_GLOBAL.PANEL_MARGIN_Y * 2,
|
height = G_DIMENSIONS_.SIDE_HEIGHT + G_DIMENSIONS_.PANEL_MARGIN_Y * 2,
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget = nil
|
Widget = nil
|
||||||
|
|
14
main.lua
14
main.lua
|
@ -74,7 +74,7 @@ package.path = ABS_PATH..'/?.lua;'..
|
||||||
|
|
||||||
local UPDATE_FREQUENCY = 1 --Hz
|
local UPDATE_FREQUENCY = 1 --Hz
|
||||||
|
|
||||||
CONSTRUCTION_GLOBAL = {
|
G_DIMENSIONS_ = {
|
||||||
UPDATE_INTERVAL = 1 / UPDATE_FREQUENCY,
|
UPDATE_INTERVAL = 1 / UPDATE_FREQUENCY,
|
||||||
|
|
||||||
LEFT_X = 32,
|
LEFT_X = 32,
|
||||||
|
@ -91,14 +91,14 @@ CONSTRUCTION_GLOBAL = {
|
||||||
ABS_PATH = ABS_PATH
|
ABS_PATH = ABS_PATH
|
||||||
}
|
}
|
||||||
|
|
||||||
CONSTRUCTION_GLOBAL.CENTER_LEFT_X = CONSTRUCTION_GLOBAL.LEFT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH + CONSTRUCTION_GLOBAL.PANEL_MARGIN_X * 2 + CONSTRUCTION_GLOBAL.PANEL_HORZ_SPACING
|
G_DIMENSIONS_.CENTER_LEFT_X = G_DIMENSIONS_.LEFT_X + G_DIMENSIONS_.SECTION_WIDTH + G_DIMENSIONS_.PANEL_MARGIN_X * 2 + G_DIMENSIONS_.PANEL_HORZ_SPACING
|
||||||
CONSTRUCTION_GLOBAL.CENTER_RIGHT_X = CONSTRUCTION_GLOBAL.CENTER_LEFT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH + CONSTRUCTION_GLOBAL.CENTER_PAD
|
G_DIMENSIONS_.CENTER_RIGHT_X = G_DIMENSIONS_.CENTER_LEFT_X + G_DIMENSIONS_.SECTION_WIDTH + G_DIMENSIONS_.CENTER_PAD
|
||||||
CONSTRUCTION_GLOBAL.CENTER_WIDTH = CONSTRUCTION_GLOBAL.SECTION_WIDTH * 2 + CONSTRUCTION_GLOBAL.CENTER_PAD
|
G_DIMENSIONS_.CENTER_WIDTH = G_DIMENSIONS_.SECTION_WIDTH * 2 + G_DIMENSIONS_.CENTER_PAD
|
||||||
CONSTRUCTION_GLOBAL.RIGHT_X = CONSTRUCTION_GLOBAL.CENTER_LEFT_X + CONSTRUCTION_GLOBAL.CENTER_WIDTH + CONSTRUCTION_GLOBAL.PANEL_MARGIN_X * 2 + CONSTRUCTION_GLOBAL.PANEL_HORZ_SPACING
|
G_DIMENSIONS_.RIGHT_X = G_DIMENSIONS_.CENTER_LEFT_X + G_DIMENSIONS_.CENTER_WIDTH + G_DIMENSIONS_.PANEL_MARGIN_X * 2 + G_DIMENSIONS_.PANEL_HORZ_SPACING
|
||||||
|
|
||||||
ABS_PATH = nil
|
ABS_PATH = nil
|
||||||
|
|
||||||
conky_set_update_interval(CONSTRUCTION_GLOBAL.UPDATE_INTERVAL)
|
conky_set_update_interval(G_DIMENSIONS_.UPDATE_INTERVAL)
|
||||||
|
|
||||||
require 'imlib2'
|
require 'imlib2'
|
||||||
require 'cairo'
|
require 'cairo'
|
||||||
|
@ -129,7 +129,7 @@ unrequire('Gradient')
|
||||||
|
|
||||||
unrequire = nil
|
unrequire = nil
|
||||||
|
|
||||||
CONSTRUCTION_GLOBAL = nil
|
G_DIMENSIONS_ = nil
|
||||||
|
|
||||||
local _CAIRO_XLIB_SURFACE_CREATE = cairo_xlib_surface_create
|
local _CAIRO_XLIB_SURFACE_CREATE = cairo_xlib_surface_create
|
||||||
local _CAIRO_CREATE = cairo_create
|
local _CAIRO_CREATE = cairo_create
|
||||||
|
|
|
@ -22,16 +22,16 @@ local SPACING = 20
|
||||||
local BAR_PAD = 100
|
local BAR_PAD = 100
|
||||||
|
|
||||||
local header = Widget.Header{
|
local header = Widget.Header{
|
||||||
x = CONSTRUCTION_GLOBAL.RIGHT_X,
|
x = G_DIMENSIONS_.RIGHT_X,
|
||||||
y = MODULE_Y,
|
y = MODULE_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
header = 'FILE SYSTEMS'
|
header = 'FILE SYSTEMS'
|
||||||
}
|
}
|
||||||
|
|
||||||
local HEADER_BOTTOM_Y = header.bottom_y
|
local HEADER_BOTTOM_Y = header.bottom_y
|
||||||
|
|
||||||
local labels = Widget.TextColumn{
|
local labels = Widget.TextColumn{
|
||||||
x = CONSTRUCTION_GLOBAL.RIGHT_X,
|
x = G_DIMENSIONS_.RIGHT_X,
|
||||||
y = HEADER_BOTTOM_Y,
|
y = HEADER_BOTTOM_Y,
|
||||||
spacing = SPACING,
|
spacing = SPACING,
|
||||||
'root',
|
'root',
|
||||||
|
@ -46,7 +46,7 @@ local labels = Widget.TextColumn{
|
||||||
|
|
||||||
--~ for i = 1, FS_NUM do
|
--~ for i = 1, FS_NUM do
|
||||||
--~ totals[i] = Widget.CriticalText{
|
--~ totals[i] = Widget.CriticalText{
|
||||||
--~ x = CONSTRUCTION_GLOBAL.RIGHT_X + TEXT_WIDTH,
|
--~ x = G_DIMENSIONS_.RIGHT_X + TEXT_WIDTH,
|
||||||
--~ y = HEADER_BOTTOM_Y + (i - 1) * SPACING,
|
--~ y = HEADER_BOTTOM_Y + (i - 1) * SPACING,
|
||||||
--~ x_align = 'right',
|
--~ x_align = 'right',
|
||||||
--~ text_color = schema.blue,
|
--~ text_color = schema.blue,
|
||||||
|
@ -66,11 +66,11 @@ for i, v in _PAIRS(FS_PATHS) do
|
||||||
end
|
end
|
||||||
|
|
||||||
local bars = Widget.CompoundBar{
|
local bars = Widget.CompoundBar{
|
||||||
--~ x = CONSTRUCTION_GLOBAL.RIGHT_X + TEXT_WIDTH + BAR_PAD,
|
--~ x = G_DIMENSIONS_.RIGHT_X + TEXT_WIDTH + BAR_PAD,
|
||||||
x = CONSTRUCTION_GLOBAL.RIGHT_X + BAR_PAD,
|
x = G_DIMENSIONS_.RIGHT_X + BAR_PAD,
|
||||||
y = HEADER_BOTTOM_Y,
|
y = HEADER_BOTTOM_Y,
|
||||||
--~ length = CONSTRUCTION_GLOBAL.SECTION_WIDTH - (TEXT_WIDTH + BAR_PAD),
|
--~ length = G_DIMENSIONS_.SECTION_WIDTH - (TEXT_WIDTH + BAR_PAD),
|
||||||
length = CONSTRUCTION_GLOBAL.SECTION_WIDTH - BAR_PAD,
|
length = G_DIMENSIONS_.SECTION_WIDTH - BAR_PAD,
|
||||||
spacing = SPACING,
|
spacing = SPACING,
|
||||||
num_bars = FS_NUM,
|
num_bars = FS_NUM,
|
||||||
critical_limit = '>0.8'
|
critical_limit = '>0.8'
|
||||||
|
|
|
@ -17,17 +17,17 @@ local PLOT_SEC_BREAK = 20
|
||||||
local PLOT_HEIGHT = 56
|
local PLOT_HEIGHT = 56
|
||||||
|
|
||||||
local header = Widget.Header{
|
local header = Widget.Header{
|
||||||
x = CONSTRUCTION_GLOBAL.LEFT_X,
|
x = G_DIMENSIONS_.LEFT_X,
|
||||||
y = MODULE_Y,
|
y = MODULE_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
header = 'NVIDIA GRAPHICS'
|
header = 'NVIDIA GRAPHICS'
|
||||||
}
|
}
|
||||||
|
|
||||||
local RIGHT_X = CONSTRUCTION_GLOBAL.LEFT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH
|
local RIGHT_X = G_DIMENSIONS_.LEFT_X + G_DIMENSIONS_.SECTION_WIDTH
|
||||||
|
|
||||||
local status = {
|
local status = {
|
||||||
label = Widget.Text{
|
label = Widget.Text{
|
||||||
x = CONSTRUCTION_GLOBAL.LEFT_X,
|
x = G_DIMENSIONS_.LEFT_X,
|
||||||
y = header.bottom_y,
|
y = header.bottom_y,
|
||||||
text = 'Status'
|
text = 'Status'
|
||||||
},
|
},
|
||||||
|
@ -43,7 +43,7 @@ local status = {
|
||||||
local SEP_Y_1 = header.bottom_y + SEPARATOR_SPACING
|
local SEP_Y_1 = header.bottom_y + SEPARATOR_SPACING
|
||||||
|
|
||||||
local separator1 = Widget.Line{
|
local separator1 = Widget.Line{
|
||||||
p1 = {x = CONSTRUCTION_GLOBAL.LEFT_X, y = SEP_Y_1},
|
p1 = {x = G_DIMENSIONS_.LEFT_X, y = SEP_Y_1},
|
||||||
p2 = {x = RIGHT_X, y = SEP_Y_1}
|
p2 = {x = RIGHT_X, y = SEP_Y_1}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ local INTERNAL_TEMP_Y = SEP_Y_1 + SEPARATOR_SPACING
|
||||||
|
|
||||||
local internal_temp = {
|
local internal_temp = {
|
||||||
label = Widget.Text{
|
label = Widget.Text{
|
||||||
x = CONSTRUCTION_GLOBAL.LEFT_X,
|
x = G_DIMENSIONS_.LEFT_X,
|
||||||
y = INTERNAL_TEMP_Y,
|
y = INTERNAL_TEMP_Y,
|
||||||
text = 'Internal Temperature'
|
text = 'Internal Temperature'
|
||||||
},
|
},
|
||||||
|
@ -68,7 +68,7 @@ local PCI_UTIL_Y = INTERNAL_TEMP_Y + TEXT_SPACING
|
||||||
|
|
||||||
local pci_util = {
|
local pci_util = {
|
||||||
label = Widget.Text{
|
label = Widget.Text{
|
||||||
x = CONSTRUCTION_GLOBAL.LEFT_X,
|
x = G_DIMENSIONS_.LEFT_X,
|
||||||
y = PCI_UTIL_Y,
|
y = PCI_UTIL_Y,
|
||||||
text = 'PCI Utilization'
|
text = 'PCI Utilization'
|
||||||
},
|
},
|
||||||
|
@ -84,7 +84,7 @@ local pci_util = {
|
||||||
local SEP_Y_2 = PCI_UTIL_Y + SEPARATOR_SPACING
|
local SEP_Y_2 = PCI_UTIL_Y + SEPARATOR_SPACING
|
||||||
|
|
||||||
local separator2 = Widget.Line{
|
local separator2 = Widget.Line{
|
||||||
p1 = {x = CONSTRUCTION_GLOBAL.LEFT_X, y = SEP_Y_2},
|
p1 = {x = G_DIMENSIONS_.LEFT_X, y = SEP_Y_2},
|
||||||
p2 = {x = RIGHT_X, y = SEP_Y_2}
|
p2 = {x = RIGHT_X, y = SEP_Y_2}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,14 +92,14 @@ local CLOCK_SPEED_Y = SEP_Y_2 + SEPARATOR_SPACING
|
||||||
|
|
||||||
local clock_speed = {
|
local clock_speed = {
|
||||||
labels = Widget.TextColumn{
|
labels = Widget.TextColumn{
|
||||||
x = CONSTRUCTION_GLOBAL.LEFT_X,
|
x = G_DIMENSIONS_.LEFT_X,
|
||||||
y = CLOCK_SPEED_Y,
|
y = CLOCK_SPEED_Y,
|
||||||
spacing = TEXT_SPACING,
|
spacing = TEXT_SPACING,
|
||||||
'GPU Clock Speed',
|
'GPU Clock Speed',
|
||||||
'Memory Clock Speed'
|
'Memory Clock Speed'
|
||||||
},
|
},
|
||||||
values = Widget.TextColumn{
|
values = Widget.TextColumn{
|
||||||
x = CONSTRUCTION_GLOBAL.LEFT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
x = G_DIMENSIONS_.LEFT_X + G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
y = CLOCK_SPEED_Y,
|
y = CLOCK_SPEED_Y,
|
||||||
spacing = TEXT_SPACING,
|
spacing = TEXT_SPACING,
|
||||||
x_align = 'right',
|
x_align = 'right',
|
||||||
|
@ -111,7 +111,7 @@ local clock_speed = {
|
||||||
local SEP_Y_3 = CLOCK_SPEED_Y + TEXT_SPACING * 2
|
local SEP_Y_3 = CLOCK_SPEED_Y + TEXT_SPACING * 2
|
||||||
|
|
||||||
local separator3 = Widget.Line{
|
local separator3 = Widget.Line{
|
||||||
p1 = {x = CONSTRUCTION_GLOBAL.LEFT_X, y = SEP_Y_3},
|
p1 = {x = G_DIMENSIONS_.LEFT_X, y = SEP_Y_3},
|
||||||
p2 = {x = RIGHT_X, y = SEP_Y_3}
|
p2 = {x = RIGHT_X, y = SEP_Y_3}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ local GPU_UTIL_PLOT_Y = GPU_UTIL_Y + PLOT_SEC_BREAK
|
||||||
|
|
||||||
local gpu_util = {
|
local gpu_util = {
|
||||||
label = Widget.Text{
|
label = Widget.Text{
|
||||||
x = CONSTRUCTION_GLOBAL.LEFT_X,
|
x = G_DIMENSIONS_.LEFT_X,
|
||||||
y = GPU_UTIL_Y,
|
y = GPU_UTIL_Y,
|
||||||
text = 'GPU Utilization'
|
text = 'GPU Utilization'
|
||||||
},
|
},
|
||||||
|
@ -132,9 +132,9 @@ local gpu_util = {
|
||||||
text = '<gpu_util>'
|
text = '<gpu_util>'
|
||||||
},
|
},
|
||||||
plot = Widget.LabelPlot{
|
plot = Widget.LabelPlot{
|
||||||
x = CONSTRUCTION_GLOBAL.LEFT_X,
|
x = G_DIMENSIONS_.LEFT_X,
|
||||||
y = GPU_UTIL_PLOT_Y,
|
y = GPU_UTIL_PLOT_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
height = PLOT_HEIGHT
|
height = PLOT_HEIGHT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -144,7 +144,7 @@ local MEM_UTIL_PLOT_Y = MEM_UTIL_Y + PLOT_SEC_BREAK
|
||||||
|
|
||||||
local mem_util = {
|
local mem_util = {
|
||||||
label = Widget.Text{
|
label = Widget.Text{
|
||||||
x = CONSTRUCTION_GLOBAL.LEFT_X,
|
x = G_DIMENSIONS_.LEFT_X,
|
||||||
y = MEM_UTIL_Y,
|
y = MEM_UTIL_Y,
|
||||||
text = 'Memory Utilization'
|
text = 'Memory Utilization'
|
||||||
},
|
},
|
||||||
|
@ -156,9 +156,9 @@ local mem_util = {
|
||||||
text = '<mem_util>'
|
text = '<mem_util>'
|
||||||
},
|
},
|
||||||
plot = Widget.LabelPlot{
|
plot = Widget.LabelPlot{
|
||||||
x = CONSTRUCTION_GLOBAL.LEFT_X,
|
x = G_DIMENSIONS_.LEFT_X,
|
||||||
y = MEM_UTIL_PLOT_Y,
|
y = MEM_UTIL_PLOT_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
height = PLOT_HEIGHT
|
height = PLOT_HEIGHT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -168,7 +168,7 @@ local VID_UTIL_PLOT_Y = VID_UTIL_Y + PLOT_SEC_BREAK
|
||||||
|
|
||||||
local vid_util = {
|
local vid_util = {
|
||||||
label = Widget.Text{
|
label = Widget.Text{
|
||||||
x = CONSTRUCTION_GLOBAL.LEFT_X,
|
x = G_DIMENSIONS_.LEFT_X,
|
||||||
y = VID_UTIL_Y,
|
y = VID_UTIL_Y,
|
||||||
text = 'Video Utilization'
|
text = 'Video Utilization'
|
||||||
},
|
},
|
||||||
|
@ -180,9 +180,9 @@ local vid_util = {
|
||||||
text = '<vid_util>'
|
text = '<vid_util>'
|
||||||
},
|
},
|
||||||
plot = Widget.LabelPlot{
|
plot = Widget.LabelPlot{
|
||||||
x = CONSTRUCTION_GLOBAL.LEFT_X,
|
x = G_DIMENSIONS_.LEFT_X,
|
||||||
y = VID_UTIL_PLOT_Y,
|
y = VID_UTIL_PLOT_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
height = PLOT_HEIGHT
|
height = PLOT_HEIGHT
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,16 +42,16 @@ local TABLE_SECTION_BREAK = 20
|
||||||
local TABLE_HEIGHT = 114
|
local TABLE_HEIGHT = 114
|
||||||
|
|
||||||
local header = Widget.Header{
|
local header = Widget.Header{
|
||||||
x = CONSTRUCTION_GLOBAL.RIGHT_X,
|
x = G_DIMENSIONS_.RIGHT_X,
|
||||||
y = MODULE_Y,
|
y = MODULE_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
header = "MEMORY"
|
header = "MEMORY"
|
||||||
}
|
}
|
||||||
|
|
||||||
local HEADER_BOTTOM_Y = header.bottom_y
|
local HEADER_BOTTOM_Y = header.bottom_y
|
||||||
|
|
||||||
--don't nil these
|
--don't nil these
|
||||||
local DIAL_X = CONSTRUCTION_GLOBAL.RIGHT_X + DIAL_RADIUS + DIAL_THICKNESS * 0.5
|
local DIAL_X = G_DIMENSIONS_.RIGHT_X + DIAL_RADIUS + DIAL_THICKNESS * 0.5
|
||||||
local DIAL_Y = HEADER_BOTTOM_Y + DIAL_RADIUS + DIAL_THICKNESS * 0.5
|
local DIAL_Y = HEADER_BOTTOM_Y + DIAL_RADIUS + DIAL_THICKNESS * 0.5
|
||||||
|
|
||||||
local dial = Widget.Dial{
|
local dial = Widget.Dial{
|
||||||
|
@ -85,8 +85,8 @@ local inner_ring = Widget.Arc{
|
||||||
}
|
}
|
||||||
|
|
||||||
local LINE_1_Y = HEADER_BOTTOM_Y + TEXT_Y_OFFSET
|
local LINE_1_Y = HEADER_BOTTOM_Y + TEXT_Y_OFFSET
|
||||||
local TEXT_LEFT_X = CONSTRUCTION_GLOBAL.RIGHT_X + DIAL_RADIUS * 2 + TEXT_LEFT_X_OFFSET
|
local TEXT_LEFT_X = G_DIMENSIONS_.RIGHT_X + DIAL_RADIUS * 2 + TEXT_LEFT_X_OFFSET
|
||||||
local RIGHT_X = CONSTRUCTION_GLOBAL.RIGHT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH
|
local RIGHT_X = G_DIMENSIONS_.RIGHT_X + G_DIMENSIONS_.SECTION_WIDTH
|
||||||
|
|
||||||
local swap= {
|
local swap= {
|
||||||
label = Widget.Text{
|
label = Widget.Text{
|
||||||
|
@ -127,18 +127,18 @@ local cache = {
|
||||||
local PLOT_Y = PLOT_SECTION_BREAK + HEADER_BOTTOM_Y + DIAL_RADIUS * 2
|
local PLOT_Y = PLOT_SECTION_BREAK + HEADER_BOTTOM_Y + DIAL_RADIUS * 2
|
||||||
|
|
||||||
local plot = Widget.LabelPlot{
|
local plot = Widget.LabelPlot{
|
||||||
x = CONSTRUCTION_GLOBAL.RIGHT_X,
|
x = G_DIMENSIONS_.RIGHT_X,
|
||||||
y = PLOT_Y,
|
y = PLOT_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
height = PLOT_HEIGHT
|
height = PLOT_HEIGHT
|
||||||
}
|
}
|
||||||
|
|
||||||
local TABLE_Y = PLOT_Y + PLOT_HEIGHT + TABLE_SECTION_BREAK
|
local TABLE_Y = PLOT_Y + PLOT_HEIGHT + TABLE_SECTION_BREAK
|
||||||
|
|
||||||
local tbl = Widget.Table{
|
local tbl = Widget.Table{
|
||||||
x = CONSTRUCTION_GLOBAL.RIGHT_X,
|
x = G_DIMENSIONS_.RIGHT_X,
|
||||||
y = TABLE_Y,
|
y = TABLE_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
height = TABLE_HEIGHT,
|
height = TABLE_HEIGHT,
|
||||||
'Name',
|
'Name',
|
||||||
'PID',
|
'PID',
|
||||||
|
|
|
@ -27,18 +27,18 @@ local __network_label_function = function(bytes)
|
||||||
end
|
end
|
||||||
|
|
||||||
local header = Widget.Header{
|
local header = Widget.Header{
|
||||||
x = CONSTRUCTION_GLOBAL.CENTER_RIGHT_X,
|
x = G_DIMENSIONS_.CENTER_RIGHT_X,
|
||||||
y = CONSTRUCTION_GLOBAL.TOP_Y,
|
y = G_DIMENSIONS_.TOP_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
header = "NETWORK"
|
header = "NETWORK"
|
||||||
}
|
}
|
||||||
|
|
||||||
local RIGHT_X = CONSTRUCTION_GLOBAL.CENTER_RIGHT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH
|
local RIGHT_X = G_DIMENSIONS_.CENTER_RIGHT_X + G_DIMENSIONS_.SECTION_WIDTH
|
||||||
local DOWNLOAD_PLOT_Y = header.bottom_y + PLOT_SEC_BREAK
|
local DOWNLOAD_PLOT_Y = header.bottom_y + PLOT_SEC_BREAK
|
||||||
|
|
||||||
local dnload = {
|
local dnload = {
|
||||||
label = Widget.Text{
|
label = Widget.Text{
|
||||||
x = CONSTRUCTION_GLOBAL.CENTER_RIGHT_X,
|
x = G_DIMENSIONS_.CENTER_RIGHT_X,
|
||||||
y = header.bottom_y,
|
y = header.bottom_y,
|
||||||
text = 'Download',
|
text = 'Download',
|
||||||
},
|
},
|
||||||
|
@ -49,9 +49,9 @@ local dnload = {
|
||||||
text_color = schema.blue
|
text_color = schema.blue
|
||||||
},
|
},
|
||||||
plot = Widget.ScalePlot{
|
plot = Widget.ScalePlot{
|
||||||
x = CONSTRUCTION_GLOBAL.CENTER_RIGHT_X,
|
x = G_DIMENSIONS_.CENTER_RIGHT_X,
|
||||||
y = DOWNLOAD_PLOT_Y,
|
y = DOWNLOAD_PLOT_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
height = PLOT_HEIGHT,
|
height = PLOT_HEIGHT,
|
||||||
y_label_func = __network_label_function
|
y_label_func = __network_label_function
|
||||||
}
|
}
|
||||||
|
@ -62,7 +62,7 @@ local UPLOAD_PLOT_Y = UPLOAD_Y + PLOT_SEC_BREAK
|
||||||
|
|
||||||
local upload = {
|
local upload = {
|
||||||
label = Widget.Text{
|
label = Widget.Text{
|
||||||
x = CONSTRUCTION_GLOBAL.CENTER_RIGHT_X,
|
x = G_DIMENSIONS_.CENTER_RIGHT_X,
|
||||||
y = UPLOAD_Y,
|
y = UPLOAD_Y,
|
||||||
text = 'Upload',
|
text = 'Upload',
|
||||||
},
|
},
|
||||||
|
@ -73,9 +73,9 @@ local upload = {
|
||||||
text_color = schema.blue
|
text_color = schema.blue
|
||||||
},
|
},
|
||||||
plot = Widget.ScalePlot{
|
plot = Widget.ScalePlot{
|
||||||
x = CONSTRUCTION_GLOBAL.CENTER_RIGHT_X,
|
x = G_DIMENSIONS_.CENTER_RIGHT_X,
|
||||||
y = UPLOAD_PLOT_Y,
|
y = UPLOAD_PLOT_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
height = PLOT_HEIGHT,
|
height = PLOT_HEIGHT,
|
||||||
y_label_func = __network_label_function
|
y_label_func = __network_label_function
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,14 +10,14 @@ local schema = require 'default_patterns'
|
||||||
local TEXT_SPACING = 20
|
local TEXT_SPACING = 20
|
||||||
|
|
||||||
local header = Widget.Header{
|
local header = Widget.Header{
|
||||||
x = CONSTRUCTION_GLOBAL.RIGHT_X,
|
x = G_DIMENSIONS_.RIGHT_X,
|
||||||
y = CONSTRUCTION_GLOBAL.TOP_Y,
|
y = G_DIMENSIONS_.TOP_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
header = "PACMAN"
|
header = "PACMAN"
|
||||||
}
|
}
|
||||||
|
|
||||||
local labels = Widget.TextColumn{
|
local labels = Widget.TextColumn{
|
||||||
x = CONSTRUCTION_GLOBAL.RIGHT_X,
|
x = G_DIMENSIONS_.RIGHT_X,
|
||||||
y = header.bottom_y,
|
y = header.bottom_y,
|
||||||
spacing = TEXT_SPACING,
|
spacing = TEXT_SPACING,
|
||||||
'Total',
|
'Total',
|
||||||
|
@ -27,7 +27,7 @@ local labels = Widget.TextColumn{
|
||||||
'Local'
|
'Local'
|
||||||
}
|
}
|
||||||
local info = Widget.TextColumn{
|
local info = Widget.TextColumn{
|
||||||
x = CONSTRUCTION_GLOBAL.RIGHT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
x = G_DIMENSIONS_.RIGHT_X + G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
y = header.bottom_y,
|
y = header.bottom_y,
|
||||||
spacing = TEXT_SPACING,
|
spacing = TEXT_SPACING,
|
||||||
x_align = 'right',
|
x_align = 'right',
|
||||||
|
|
|
@ -25,17 +25,17 @@ local __calculate_power = function(cr, prev_cnt, cnt, update_frequency)
|
||||||
end
|
end
|
||||||
|
|
||||||
local header = Widget.Header{
|
local header = Widget.Header{
|
||||||
x = CONSTRUCTION_GLOBAL.RIGHT_X,
|
x = G_DIMENSIONS_.RIGHT_X,
|
||||||
y = MODULE_Y,
|
y = MODULE_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
header = 'POWER'
|
header = 'POWER'
|
||||||
}
|
}
|
||||||
|
|
||||||
local RIGHT_X = CONSTRUCTION_GLOBAL.RIGHT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH
|
local RIGHT_X = G_DIMENSIONS_.RIGHT_X + G_DIMENSIONS_.SECTION_WIDTH
|
||||||
|
|
||||||
local pp01 = {
|
local pp01 = {
|
||||||
labels = Widget.TextColumn{
|
labels = Widget.TextColumn{
|
||||||
x = CONSTRUCTION_GLOBAL.RIGHT_X,
|
x = G_DIMENSIONS_.RIGHT_X,
|
||||||
y = header.bottom_y,
|
y = header.bottom_y,
|
||||||
spacing = TEXT_SPACING,
|
spacing = TEXT_SPACING,
|
||||||
'Core',
|
'Core',
|
||||||
|
@ -55,7 +55,7 @@ local pp01 = {
|
||||||
local SEP_Y = header.bottom_y + TEXT_SPACING + SEPARATOR_SPACING
|
local SEP_Y = header.bottom_y + TEXT_SPACING + SEPARATOR_SPACING
|
||||||
|
|
||||||
local separator = Widget.Line{
|
local separator = Widget.Line{
|
||||||
p1 = {x = CONSTRUCTION_GLOBAL.RIGHT_X, y = SEP_Y},
|
p1 = {x = G_DIMENSIONS_.RIGHT_X, y = SEP_Y},
|
||||||
p2 = {x = RIGHT_X, y = SEP_Y}
|
p2 = {x = RIGHT_X, y = SEP_Y}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,7 +63,7 @@ local PKG0_Y = SEP_Y + SEPARATOR_SPACING
|
||||||
|
|
||||||
local pkg0 = {
|
local pkg0 = {
|
||||||
label = Widget.Text{
|
label = Widget.Text{
|
||||||
x = CONSTRUCTION_GLOBAL.RIGHT_X,
|
x = G_DIMENSIONS_.RIGHT_X,
|
||||||
y = PKG0_Y,
|
y = PKG0_Y,
|
||||||
text = 'PKG 0'
|
text = 'PKG 0'
|
||||||
},
|
},
|
||||||
|
@ -76,9 +76,9 @@ local pkg0 = {
|
||||||
append_end = ' W'
|
append_end = ' W'
|
||||||
},
|
},
|
||||||
plot = Widget.ScalePlot{
|
plot = Widget.ScalePlot{
|
||||||
x = CONSTRUCTION_GLOBAL.RIGHT_X,
|
x = G_DIMENSIONS_.RIGHT_X,
|
||||||
y = PKG0_Y + PLOT_SEC_BREAK,
|
y = PKG0_Y + PLOT_SEC_BREAK,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
height = PLOT_HEIGHT,
|
height = PLOT_HEIGHT,
|
||||||
y_label_func = __power_label_function,
|
y_label_func = __power_label_function,
|
||||||
}
|
}
|
||||||
|
@ -88,7 +88,7 @@ local DRAM_Y = PKG0_Y + PLOT_SEC_BREAK * 2 + PLOT_HEIGHT
|
||||||
|
|
||||||
local dram = {
|
local dram = {
|
||||||
label = Widget.Text{
|
label = Widget.Text{
|
||||||
x = CONSTRUCTION_GLOBAL.RIGHT_X,
|
x = G_DIMENSIONS_.RIGHT_X,
|
||||||
y = DRAM_Y,
|
y = DRAM_Y,
|
||||||
text = 'DRAM'
|
text = 'DRAM'
|
||||||
},
|
},
|
||||||
|
@ -101,9 +101,9 @@ local dram = {
|
||||||
append_end = ' W'
|
append_end = ' W'
|
||||||
},
|
},
|
||||||
plot = Widget.ScalePlot{
|
plot = Widget.ScalePlot{
|
||||||
x = CONSTRUCTION_GLOBAL.RIGHT_X,
|
x = G_DIMENSIONS_.RIGHT_X,
|
||||||
y = DRAM_Y + PLOT_SEC_BREAK,
|
y = DRAM_Y + PLOT_SEC_BREAK,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
height = PLOT_HEIGHT,
|
height = PLOT_HEIGHT,
|
||||||
y_label_func = __power_label_function,
|
y_label_func = __power_label_function,
|
||||||
}
|
}
|
||||||
|
@ -113,7 +113,7 @@ local BATTERY_DRAW_Y = DRAM_Y + PLOT_SEC_BREAK * 2 + PLOT_HEIGHT
|
||||||
|
|
||||||
local battery_draw = {
|
local battery_draw = {
|
||||||
label = Widget.Text{
|
label = Widget.Text{
|
||||||
x = CONSTRUCTION_GLOBAL.RIGHT_X,
|
x = G_DIMENSIONS_.RIGHT_X,
|
||||||
y = BATTERY_DRAW_Y,
|
y = BATTERY_DRAW_Y,
|
||||||
spacing = TEXT_SPACING,
|
spacing = TEXT_SPACING,
|
||||||
text = 'Battery Draw'
|
text = 'Battery Draw'
|
||||||
|
@ -124,9 +124,9 @@ local battery_draw = {
|
||||||
x_align = 'right',
|
x_align = 'right',
|
||||||
},
|
},
|
||||||
plot = Widget.ScalePlot{
|
plot = Widget.ScalePlot{
|
||||||
x = CONSTRUCTION_GLOBAL.RIGHT_X,
|
x = G_DIMENSIONS_.RIGHT_X,
|
||||||
y = BATTERY_DRAW_Y + PLOT_SEC_BREAK,
|
y = BATTERY_DRAW_Y + PLOT_SEC_BREAK,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
height = PLOT_HEIGHT,
|
height = PLOT_HEIGHT,
|
||||||
y_label_func = __power_label_function,
|
y_label_func = __power_label_function,
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,9 +82,9 @@ local CREATE_CORE = function(cores, id, x, y)
|
||||||
end
|
end
|
||||||
|
|
||||||
local header = Widget.Header{
|
local header = Widget.Header{
|
||||||
x = CONSTRUCTION_GLOBAL.LEFT_X,
|
x = G_DIMENSIONS_.LEFT_X,
|
||||||
y = MODULE_Y,
|
y = MODULE_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
header = "PROCESSOR"
|
header = "PROCESSOR"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,17 +94,17 @@ local HEADER_BOTTOM_Y = header.bottom_y
|
||||||
local cores = {}
|
local cores = {}
|
||||||
|
|
||||||
for c = 0, NUM_PHYSICAL_CORES - 1 do
|
for c = 0, NUM_PHYSICAL_CORES - 1 do
|
||||||
local dial_x = CONSTRUCTION_GLOBAL.LEFT_X + DIAL_OUTER_RADIUS + (CONSTRUCTION_GLOBAL.SECTION_WIDTH - 2 * DIAL_OUTER_RADIUS) * c / 3
|
local dial_x = G_DIMENSIONS_.LEFT_X + DIAL_OUTER_RADIUS + (G_DIMENSIONS_.SECTION_WIDTH - 2 * DIAL_OUTER_RADIUS) * c / 3
|
||||||
CREATE_CORE(cores, c, dial_x, HEADER_BOTTOM_Y + DIAL_OUTER_RADIUS)
|
CREATE_CORE(cores, c, dial_x, HEADER_BOTTOM_Y + DIAL_OUTER_RADIUS)
|
||||||
end
|
end
|
||||||
|
|
||||||
local RIGHT_X = CONSTRUCTION_GLOBAL.LEFT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH
|
local RIGHT_X = G_DIMENSIONS_.LEFT_X + G_DIMENSIONS_.SECTION_WIDTH
|
||||||
|
|
||||||
local PROCESS_Y = HEADER_BOTTOM_Y + DIAL_OUTER_RADIUS * 2 + PLOT_SECTION_BREAK
|
local PROCESS_Y = HEADER_BOTTOM_Y + DIAL_OUTER_RADIUS * 2 + PLOT_SECTION_BREAK
|
||||||
|
|
||||||
local process = {
|
local process = {
|
||||||
labels = Widget.Text{
|
labels = Widget.Text{
|
||||||
x = CONSTRUCTION_GLOBAL.LEFT_X,
|
x = G_DIMENSIONS_.LEFT_X,
|
||||||
y = PROCESS_Y,
|
y = PROCESS_Y,
|
||||||
text = 'R | S | D | T | Z'
|
text = 'R | S | D | T | Z'
|
||||||
},
|
},
|
||||||
|
@ -120,7 +120,7 @@ local process = {
|
||||||
local SEP_Y = PROCESS_Y + SEPARATOR_SPACING
|
local SEP_Y = PROCESS_Y + SEPARATOR_SPACING
|
||||||
|
|
||||||
local separator = Widget.Line{
|
local separator = Widget.Line{
|
||||||
p1 = {x = CONSTRUCTION_GLOBAL.LEFT_X, y = SEP_Y},
|
p1 = {x = G_DIMENSIONS_.LEFT_X, y = SEP_Y},
|
||||||
p2 = {x = RIGHT_X, y = SEP_Y}
|
p2 = {x = RIGHT_X, y = SEP_Y}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,7 +128,7 @@ local LOAD_Y = SEP_Y + SEPARATOR_SPACING
|
||||||
|
|
||||||
local total_load = {
|
local total_load = {
|
||||||
label = Widget.Text{
|
label = Widget.Text{
|
||||||
x = CONSTRUCTION_GLOBAL.LEFT_X,
|
x = G_DIMENSIONS_.LEFT_X,
|
||||||
y = LOAD_Y,
|
y = LOAD_Y,
|
||||||
text = 'Total Load'
|
text = 'Total Load'
|
||||||
},
|
},
|
||||||
|
@ -144,18 +144,18 @@ local total_load = {
|
||||||
local PLOT_Y = LOAD_Y + PLOT_SECTION_BREAK
|
local PLOT_Y = LOAD_Y + PLOT_SECTION_BREAK
|
||||||
|
|
||||||
local plot = Widget.LabelPlot{
|
local plot = Widget.LabelPlot{
|
||||||
x = CONSTRUCTION_GLOBAL.LEFT_X,
|
x = G_DIMENSIONS_.LEFT_X,
|
||||||
y = PLOT_Y,
|
y = PLOT_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
height = PLOT_HEIGHT
|
height = PLOT_HEIGHT
|
||||||
}
|
}
|
||||||
|
|
||||||
local TABLE_Y = PLOT_Y + PLOT_HEIGHT + TABLE_SECTION_BREAK
|
local TABLE_Y = PLOT_Y + PLOT_HEIGHT + TABLE_SECTION_BREAK
|
||||||
|
|
||||||
local tbl = Widget.Table{
|
local tbl = Widget.Table{
|
||||||
x = CONSTRUCTION_GLOBAL.LEFT_X,
|
x = G_DIMENSIONS_.LEFT_X,
|
||||||
y = TABLE_Y,
|
y = TABLE_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
height = TABLE_HEIGHT,
|
height = TABLE_HEIGHT,
|
||||||
num_rows = NUM_ROWS,
|
num_rows = NUM_ROWS,
|
||||||
'Name',
|
'Name',
|
||||||
|
|
|
@ -45,19 +45,19 @@ local __io_label_function = function(bytes)
|
||||||
end
|
end
|
||||||
|
|
||||||
local header = Widget.Header{
|
local header = Widget.Header{
|
||||||
x = CONSTRUCTION_GLOBAL.CENTER_LEFT_X,
|
x = G_DIMENSIONS_.CENTER_LEFT_X,
|
||||||
y = CONSTRUCTION_GLOBAL.TOP_Y,
|
y = G_DIMENSIONS_.TOP_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
header = "INPUT / OUTPUT"
|
header = "INPUT / OUTPUT"
|
||||||
}
|
}
|
||||||
|
|
||||||
local HEADER_BOTTOM_Y = header.bottom_y
|
local HEADER_BOTTOM_Y = header.bottom_y
|
||||||
local RIGHT_X = CONSTRUCTION_GLOBAL.CENTER_LEFT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH
|
local RIGHT_X = G_DIMENSIONS_.CENTER_LEFT_X + G_DIMENSIONS_.SECTION_WIDTH
|
||||||
local READS_PLOT_Y = header.bottom_y + PLOT_SEC_BREAK
|
local READS_PLOT_Y = header.bottom_y + PLOT_SEC_BREAK
|
||||||
|
|
||||||
local reads = {
|
local reads = {
|
||||||
label = Widget.Text{
|
label = Widget.Text{
|
||||||
x = CONSTRUCTION_GLOBAL.CENTER_LEFT_X,
|
x = G_DIMENSIONS_.CENTER_LEFT_X,
|
||||||
y = HEADER_BOTTOM_Y,
|
y = HEADER_BOTTOM_Y,
|
||||||
text = 'Reads',
|
text = 'Reads',
|
||||||
},
|
},
|
||||||
|
@ -69,9 +69,9 @@ local reads = {
|
||||||
text_color = schema.blue
|
text_color = schema.blue
|
||||||
},
|
},
|
||||||
plot = Widget.ScalePlot{
|
plot = Widget.ScalePlot{
|
||||||
x = CONSTRUCTION_GLOBAL.CENTER_LEFT_X,
|
x = G_DIMENSIONS_.CENTER_LEFT_X,
|
||||||
y = READS_PLOT_Y,
|
y = READS_PLOT_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
height = PLOT_HEIGHT,
|
height = PLOT_HEIGHT,
|
||||||
y_label_func = __io_label_function,
|
y_label_func = __io_label_function,
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ local WRITES_PLOT_Y = WRITE_Y + PLOT_SEC_BREAK
|
||||||
|
|
||||||
local writes = {
|
local writes = {
|
||||||
label = Widget.Text{
|
label = Widget.Text{
|
||||||
x = CONSTRUCTION_GLOBAL.CENTER_LEFT_X,
|
x = G_DIMENSIONS_.CENTER_LEFT_X,
|
||||||
y = WRITE_Y,
|
y = WRITE_Y,
|
||||||
text = 'Writes',
|
text = 'Writes',
|
||||||
},
|
},
|
||||||
|
@ -94,9 +94,9 @@ local writes = {
|
||||||
text_color = schema.blue
|
text_color = schema.blue
|
||||||
},
|
},
|
||||||
plot = Widget.ScalePlot{
|
plot = Widget.ScalePlot{
|
||||||
x = CONSTRUCTION_GLOBAL.CENTER_LEFT_X,
|
x = G_DIMENSIONS_.CENTER_LEFT_X,
|
||||||
y = WRITES_PLOT_Y,
|
y = WRITES_PLOT_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
height = PLOT_HEIGHT,
|
height = PLOT_HEIGHT,
|
||||||
y_label_func = __io_label_function,
|
y_label_func = __io_label_function,
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,14 +17,14 @@ local SYNC_CMD = "sed -n '/ synchronizing package lists/p' /var/log/pacman.log |
|
||||||
local TEXT_SPACING = 20
|
local TEXT_SPACING = 20
|
||||||
|
|
||||||
local header = Widget.Header{
|
local header = Widget.Header{
|
||||||
x = CONSTRUCTION_GLOBAL.LEFT_X,
|
x = G_DIMENSIONS_.LEFT_X,
|
||||||
y = CONSTRUCTION_GLOBAL.TOP_Y,
|
y = G_DIMENSIONS_.TOP_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
header = "SYSTEM"
|
header = "SYSTEM"
|
||||||
}
|
}
|
||||||
|
|
||||||
local labels = Widget.TextColumn{
|
local labels = Widget.TextColumn{
|
||||||
x = CONSTRUCTION_GLOBAL.LEFT_X,
|
x = G_DIMENSIONS_.LEFT_X,
|
||||||
y = header.bottom_y,
|
y = header.bottom_y,
|
||||||
spacing = TEXT_SPACING,
|
spacing = TEXT_SPACING,
|
||||||
'Kernel',
|
'Kernel',
|
||||||
|
@ -33,7 +33,7 @@ local labels = Widget.TextColumn{
|
||||||
'Last Sync'
|
'Last Sync'
|
||||||
}
|
}
|
||||||
local info = Widget.TextColumn{
|
local info = Widget.TextColumn{
|
||||||
x = CONSTRUCTION_GLOBAL.LEFT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
x = G_DIMENSIONS_.LEFT_X + G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
y = header.bottom_y,
|
y = header.bottom_y,
|
||||||
spacing = TEXT_SPACING,
|
spacing = TEXT_SPACING,
|
||||||
x_align = 'right',
|
x_align = 'right',
|
||||||
|
|
|
@ -20,7 +20,7 @@ local SECTIONS = 8
|
||||||
local WEATHER_UPDATE_INTERVAL = 900
|
local WEATHER_UPDATE_INTERVAL = 900
|
||||||
|
|
||||||
local WEATHER_PATH = '/tmp/weather.json'
|
local WEATHER_PATH = '/tmp/weather.json'
|
||||||
local ICON_PATH = CONSTRUCTION_GLOBAL.ABS_PATH .. '/images/weather/'
|
local ICON_PATH = G_DIMENSIONS_.ABS_PATH .. '/images/weather/'
|
||||||
local RECENTLY_UPDATED_PATH = '/tmp/weather_recently_updated'
|
local RECENTLY_UPDATED_PATH = '/tmp/weather_recently_updated'
|
||||||
local NA = 'N/A'
|
local NA = 'N/A'
|
||||||
local NA_IMAGE_PATH = ICON_PATH .. 'na.png'
|
local NA_IMAGE_PATH = ICON_PATH .. 'na.png'
|
||||||
|
@ -46,7 +46,7 @@ local __create_side_section = function(x_offset, y_offset, section_table)
|
||||||
}
|
}
|
||||||
|
|
||||||
current_widget.period = Widget.Text{
|
current_widget.period = Widget.Text{
|
||||||
x = x_offset + CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
x = x_offset + G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
y = current_y,
|
y = current_y,
|
||||||
x_align = 'right',
|
x_align = 'right',
|
||||||
text_color = schema.blue
|
text_color = schema.blue
|
||||||
|
@ -84,7 +84,7 @@ local __create_side_section = function(x_offset, y_offset, section_table)
|
||||||
}
|
}
|
||||||
|
|
||||||
current_widget.info_column = Widget.TextColumn{
|
current_widget.info_column = Widget.TextColumn{
|
||||||
x = x_offset + CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
x = x_offset + G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
y = current_y + HEADER_PAD + 10,
|
y = current_y + HEADER_PAD + 10,
|
||||||
spacing = SPACING,
|
spacing = SPACING,
|
||||||
x_align = 'right',
|
x_align = 'right',
|
||||||
|
@ -99,7 +99,7 @@ local __create_side_section = function(x_offset, y_offset, section_table)
|
||||||
y = current_y + SECTION_HEIGHT - 18
|
y = current_y + SECTION_HEIGHT - 18
|
||||||
},
|
},
|
||||||
p2 = {
|
p2 = {
|
||||||
x = x_offset + CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
x = x_offset + G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
y = current_y + SECTION_HEIGHT - 18
|
y = current_y + SECTION_HEIGHT - 18
|
||||||
},
|
},
|
||||||
line_pattern = schema.mid_grey
|
line_pattern = schema.mid_grey
|
||||||
|
@ -111,34 +111,34 @@ end
|
||||||
--LEFT
|
--LEFT
|
||||||
local left = {
|
local left = {
|
||||||
header = Widget.Header{
|
header = Widget.Header{
|
||||||
x = CONSTRUCTION_GLOBAL.LEFT_X,
|
x = G_DIMENSIONS_.LEFT_X,
|
||||||
y = CONSTRUCTION_GLOBAL.TOP_Y,
|
y = G_DIMENSIONS_.TOP_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
header = 'HOURLY FORECAST'
|
header = 'HOURLY FORECAST'
|
||||||
},
|
},
|
||||||
hours = {}
|
hours = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
__create_side_section(CONSTRUCTION_GLOBAL.LEFT_X, left.header.bottom_y, left.hours)
|
__create_side_section(G_DIMENSIONS_.LEFT_X, left.header.bottom_y, left.hours)
|
||||||
|
|
||||||
--CENTER
|
--CENTER
|
||||||
local center = {}
|
local center = {}
|
||||||
|
|
||||||
center.header = Widget.Header{
|
center.header = Widget.Header{
|
||||||
x = CONSTRUCTION_GLOBAL.CENTER_LEFT_X,
|
x = G_DIMENSIONS_.CENTER_LEFT_X,
|
||||||
y = CONSTRUCTION_GLOBAL.TOP_Y,
|
y = G_DIMENSIONS_.TOP_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.CENTER_WIDTH,
|
width = G_DIMENSIONS_.CENTER_WIDTH,
|
||||||
header = 'CURRENT CONDITIONS'
|
header = 'CURRENT CONDITIONS'
|
||||||
}
|
}
|
||||||
|
|
||||||
center.current_desc = Widget.Text{
|
center.current_desc = Widget.Text{
|
||||||
x = CONSTRUCTION_GLOBAL.CENTER_LEFT_X,
|
x = G_DIMENSIONS_.CENTER_LEFT_X,
|
||||||
y = center.header.bottom_y + 8,
|
y = center.header.bottom_y + 8,
|
||||||
text_color = schema.blue,
|
text_color = schema.blue,
|
||||||
font_size = 24
|
font_size = 24
|
||||||
}
|
}
|
||||||
|
|
||||||
local CENTER_X_1 = CONSTRUCTION_GLOBAL.CENTER_LEFT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH * 0.25
|
local CENTER_X_1 = G_DIMENSIONS_.CENTER_LEFT_X + G_DIMENSIONS_.SECTION_WIDTH * 0.25
|
||||||
local CENTER_ICON_WIDTH = 120
|
local CENTER_ICON_WIDTH = 120
|
||||||
local CENTER_ICON_Y = center.header.bottom_y + 105 - CENTER_ICON_WIDTH / 2
|
local CENTER_ICON_Y = center.header.bottom_y + 105 - CENTER_ICON_WIDTH / 2
|
||||||
|
|
||||||
|
@ -149,7 +149,7 @@ center.icon = Widget.ScaledImage{
|
||||||
height = CENTER_ICON_WIDTH
|
height = CENTER_ICON_WIDTH
|
||||||
}
|
}
|
||||||
|
|
||||||
local CENTER_X_2 = CONSTRUCTION_GLOBAL.CENTER_LEFT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH * 0.70
|
local CENTER_X_2 = G_DIMENSIONS_.CENTER_LEFT_X + G_DIMENSIONS_.SECTION_WIDTH * 0.70
|
||||||
local INFO_Y = center.header.bottom_y + 70
|
local INFO_Y = center.header.bottom_y + 70
|
||||||
|
|
||||||
center.current_temp = Widget.Text{
|
center.current_temp = Widget.Text{
|
||||||
|
@ -178,7 +178,7 @@ local COLUMN_PADDING = 15
|
||||||
local CENTER_SPACING = SPACING + 7
|
local CENTER_SPACING = SPACING + 7
|
||||||
|
|
||||||
center.label_column_1 = Widget.TextColumn{
|
center.label_column_1 = Widget.TextColumn{
|
||||||
x = CONSTRUCTION_GLOBAL.CENTER_RIGHT_X,
|
x = G_DIMENSIONS_.CENTER_RIGHT_X,
|
||||||
y = center.header.bottom_y,
|
y = center.header.bottom_y,
|
||||||
spacing = CENTER_SPACING,
|
spacing = CENTER_SPACING,
|
||||||
font_size = 14,
|
font_size = 14,
|
||||||
|
@ -192,7 +192,7 @@ center.label_column_1 = Widget.TextColumn{
|
||||||
}
|
}
|
||||||
|
|
||||||
center.info_column_1 = Widget.TextColumn{
|
center.info_column_1 = Widget.TextColumn{
|
||||||
x = CONSTRUCTION_GLOBAL.CENTER_RIGHT_X + (CONSTRUCTION_GLOBAL.SECTION_WIDTH - COLUMN_PADDING) / 2,
|
x = G_DIMENSIONS_.CENTER_RIGHT_X + (G_DIMENSIONS_.SECTION_WIDTH - COLUMN_PADDING) / 2,
|
||||||
y = center.header.bottom_y,
|
y = center.header.bottom_y,
|
||||||
x_align = 'right',
|
x_align = 'right',
|
||||||
text_color = schema.blue,
|
text_color = schema.blue,
|
||||||
|
@ -202,7 +202,7 @@ center.info_column_1 = Widget.TextColumn{
|
||||||
}
|
}
|
||||||
|
|
||||||
center.label_column_2 = Widget.TextColumn{
|
center.label_column_2 = Widget.TextColumn{
|
||||||
x = CONSTRUCTION_GLOBAL.CENTER_RIGHT_X + (CONSTRUCTION_GLOBAL.SECTION_WIDTH + COLUMN_PADDING) / 2,
|
x = G_DIMENSIONS_.CENTER_RIGHT_X + (G_DIMENSIONS_.SECTION_WIDTH + COLUMN_PADDING) / 2,
|
||||||
y = center.header.bottom_y,
|
y = center.header.bottom_y,
|
||||||
spacing = CENTER_SPACING,
|
spacing = CENTER_SPACING,
|
||||||
font_size = 14,
|
font_size = 14,
|
||||||
|
@ -216,7 +216,7 @@ center.label_column_2 = Widget.TextColumn{
|
||||||
}
|
}
|
||||||
|
|
||||||
center.info_column_2 = Widget.TextColumn{
|
center.info_column_2 = Widget.TextColumn{
|
||||||
x = CONSTRUCTION_GLOBAL.CENTER_RIGHT_X + CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
x = G_DIMENSIONS_.CENTER_RIGHT_X + G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
y = center.header.bottom_y,
|
y = center.header.bottom_y,
|
||||||
x_align = 'right',
|
x_align = 'right',
|
||||||
text_color = schema.blue,
|
text_color = schema.blue,
|
||||||
|
@ -229,15 +229,15 @@ center.info_column_2 = Widget.TextColumn{
|
||||||
|
|
||||||
local right = {
|
local right = {
|
||||||
header = Widget.Header{
|
header = Widget.Header{
|
||||||
x = CONSTRUCTION_GLOBAL.RIGHT_X,
|
x = G_DIMENSIONS_.RIGHT_X,
|
||||||
y = CONSTRUCTION_GLOBAL.TOP_Y,
|
y = G_DIMENSIONS_.TOP_Y,
|
||||||
width = CONSTRUCTION_GLOBAL.SECTION_WIDTH,
|
width = G_DIMENSIONS_.SECTION_WIDTH,
|
||||||
header = '8 DAY FORECAST'
|
header = '8 DAY FORECAST'
|
||||||
},
|
},
|
||||||
days = {}
|
days = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
__create_side_section(CONSTRUCTION_GLOBAL.RIGHT_X, right.header.bottom_y, right.days)
|
__create_side_section(G_DIMENSIONS_.RIGHT_X, right.header.bottom_y, right.days)
|
||||||
|
|
||||||
Widget = nil
|
Widget = nil
|
||||||
schema = nil
|
schema = nil
|
||||||
|
|
Loading…
Reference in New Issue