ENH remove cr dep in set/update

This commit is contained in:
Nathan Dwarshuis 2021-07-23 00:16:18 -04:00
parent 6d4cfd33d8
commit 1fb0ebe60b
4 changed files with 16 additions and 16 deletions

2
core

@ -1 +1 @@
Subproject commit d062e16c73238f43d8849add97f38b9c125b456e Subproject commit d10599afc4b851673cdb788a7184361816822656

View File

@ -198,7 +198,7 @@ M.percent_plot_set = function(pp, cr, value)
t = math.floor(value) t = math.floor(value)
p = value * 0.01 p = value * 0.01
end end
Text.set(pp.value, cr, t) Text.set(pp.value, t)
Timeseries.update(pp.plot, p) Timeseries.update(pp.plot, p)
end end
@ -278,8 +278,8 @@ M.annotated_scale_plot_draw_dynamic = function(asp, cr)
end end
M.annotated_scale_plot_set = function(asp, cr, value) M.annotated_scale_plot_set = function(asp, cr, value)
Text.set(asp.value, cr, value) Text.set(asp.value, value)
ScaledTimeseries.update(asp.plot, cr, value) ScaledTimeseries.update(asp.plot, value)
end end
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -323,8 +323,8 @@ end
M.update_rate_timeseries = function(obj, cr, value) M.update_rate_timeseries = function(obj, cr, value)
local rate = obj.derive(obj.prev_value, value) local rate = obj.derive(obj.prev_value, value)
Text.set(obj.value, cr, rate) Text.set(obj.value, rate)
ScaledTimeseries.update(obj.plot, cr, rate) ScaledTimeseries.update(obj.plot, rate)
obj.prev_value = value obj.prev_value = value
end end
@ -381,7 +381,7 @@ M.text_ring_draw_dynamic = function(tr, cr)
end end
M.text_ring_set = function(tr, cr, value) M.text_ring_set = function(tr, cr, value)
ThresholdText.set(tr.value, cr, value) ThresholdText.set(tr.value, value)
end end
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -511,7 +511,7 @@ M.text_row_draw_dynamic = function(row, cr)
end end
M.text_row_set = function(row, cr, value) M.text_row_set = function(row, cr, value)
Text.set(row.value, cr, value) Text.set(row.value, value)
end end
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -542,7 +542,7 @@ M.text_row_crit_draw_dynamic = function(row, cr)
end end
M.text_row_crit_set = function(row, cr, value) M.text_row_crit_set = function(row, cr, value)
ThresholdText.set(row.value, cr, value) ThresholdText.set(row.value, value)
end end
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -613,7 +613,7 @@ M.text_rows_draw_dynamic = function(rows, cr)
end end
M.text_rows_set = function(rows, cr, i, value) M.text_rows_set = function(rows, cr, i, value)
TextColumn.set(rows.values, cr, i, value) TextColumn.set(rows.values, i, value)
end end
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------

View File

@ -162,9 +162,9 @@ return function(update_freq)
Timeseries.update(plot, used_percent) Timeseries.update(plot, used_percent)
for r = 1, NUM_ROWS do for r = 1, NUM_ROWS do
Table.set(tbl, cr, 1, r, conky(TABLE_CONKY[r].comm, '(%S+)')) Table.set(tbl, 1, r, conky(TABLE_CONKY[r].comm, '(%S+)'))
Table.set(tbl, cr, 2, r, conky(TABLE_CONKY[r].pid)) Table.set(tbl, 2, r, conky(TABLE_CONKY[r].pid))
Table.set(tbl, cr, 3, r, conky(TABLE_CONKY[r].mem)) Table.set(tbl, 3, r, conky(TABLE_CONKY[r].mem))
end end
end end

View File

@ -165,9 +165,9 @@ return function(update_freq)
for r = 1, NUM_ROWS do for r = 1, NUM_ROWS do
local pid = conky(TABLE_CONKY[r].pid, '(%d+)') -- may have leading spaces local pid = conky(TABLE_CONKY[r].pid, '(%d+)') -- may have leading spaces
if pid ~= '' then if pid ~= '' then
Table.set(tbl, cr, 1, r, Util.read_file('/proc/'..pid..'/comm', '(%C+)')) Table.set(tbl, 1, r, Util.read_file('/proc/'..pid..'/comm', '(%C+)'))
Table.set(tbl, cr, 2, r, pid) Table.set(tbl, 2, r, pid)
Table.set(tbl, cr, 3, r, conky(TABLE_CONKY[r].cpu)) Table.set(tbl, 3, r, conky(TABLE_CONKY[r].cpu))
end end
end end
end end