mirror of
https://github.com/davidgiven/fluxengine.git
synced 2025-10-31 11:17:01 -07:00
Add a histogram viewer to the imager. Because it's there.
This commit is contained in:
@@ -31,6 +31,7 @@ void HistogramViewer::Redraw(const Fluxmap& fluxmap, nanoseconds_t clock)
|
||||
{
|
||||
_data = fluxmap.guessClock();
|
||||
_clock = clock;
|
||||
_blank = false;
|
||||
Refresh();
|
||||
}
|
||||
|
||||
@@ -40,6 +41,9 @@ void HistogramViewer::OnPaint(wxPaintEvent&)
|
||||
dc.SetBackground(wxSystemSettings::GetColour(wxSYS_COLOUR_FRAMEBK));
|
||||
dc.Clear();
|
||||
|
||||
if (_blank)
|
||||
return;
|
||||
|
||||
uint32_t max =
|
||||
*std::max_element(std::begin(_data.buckets), std::end(_data.buckets));
|
||||
dc.SetPen(*wxGREY_PEN);
|
||||
@@ -61,6 +65,7 @@ void HistogramViewer::OnPaint(wxPaintEvent&)
|
||||
{2 * BORDER + WIDTH, BORDER + HEIGHT - y});
|
||||
}
|
||||
|
||||
if (_clock != 0.0)
|
||||
{
|
||||
int x = _clock / NS_PER_TICK;
|
||||
dc.DrawLine({BORDER + x, 2 * BORDER + HEIGHT}, {BORDER + x, 0});
|
||||
|
||||
Reference in New Issue
Block a user