Skip to content

Commit

Permalink
📦 add parameter for max entries to Basalt Graph and Plotter ChartLine
Browse files Browse the repository at this point in the history
  • Loading branch information
cyberbit committed Jun 2, 2024
1 parent 70ab0e6 commit 1e0e9df
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/telem/lib/output/basalt/GraphOutputAdapter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,16 @@ local function graphtrackrange (self)
return min,max
end

function GraphOutputAdapter:constructor (frame, filter, bg, fg)
function GraphOutputAdapter:constructor (frame, filter, bg, fg, maxEntries)
self:super('constructor')

self.bBaseFrame = assert(frame, 'Frame is required')
self.filter = assert(filter, 'Filter is required')

self.graphdata = {}

self.MAX_ENTRIES = maxEntries or self.MAX_ENTRIES

self:register(bg, fg)
end

Expand Down
3 changes: 2 additions & 1 deletion src/telem/lib/output/plotter/ChartLineOutputAdapter.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ ChartLineOutputAdapter.type = 'ChartLineOutputAdapter'
ChartLineOutputAdapter.MAX_ENTRIES = 50
ChartLineOutputAdapter.X_TICK = 10

function ChartLineOutputAdapter:constructor (win, filter, bg, fg)
function ChartLineOutputAdapter:constructor (win, filter, bg, fg, maxEntries)
self:super('constructor')

self.win = assert(win, 'Window is required')
Expand All @@ -26,6 +26,7 @@ function ChartLineOutputAdapter:constructor (win, filter, bg, fg)

self.bg = bg or win.getBackgroundColor() or colors.black
self.fg = fg or win.getTextColor() or colors.white
self.MAX_ENTRIES = maxEntries or self.MAX_ENTRIES

self:register()
end
Expand Down

0 comments on commit 1e0e9df

Please sign in to comment.