Skip to content

Commit

Permalink
Process data even when dashboard is not displayed to update history
Browse files Browse the repository at this point in the history
  • Loading branch information
nohal committed Nov 30, 2023
1 parent 36c6b5c commit a9f77e0
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 1 deletion.
4 changes: 4 additions & 0 deletions include/dashboardsk.h
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,10 @@ class DashboardSK {
/// Check if the dashboard is visible
/// @return true if visible
bool IsVisible();

/// Process data without drawing anything
/// Serves primarily to update instruments with history
void ProcessData();
};

PLUGIN_END_NAMESPACE
Expand Down
7 changes: 7 additions & 0 deletions src/dashboardsk.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ DashboardSK::DashboardSK(const wxString& data_path)
m_sk_data["vessels"].AddComment("Root of the vessel tree");
}

void DashboardSK::ProcessData()
{
for (auto dashboard : m_dashboards) {
dashboard->ProcessData();
}
}

void DashboardSK::Draw(dskDC* dc, PlugIn_ViewPort* vp, int canvasIndex)
{
if (m_displayed_pages.find(canvasIndex) == m_displayed_pages.end()) {
Expand Down
9 changes: 8 additions & 1 deletion src/dashboardsk_pi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,14 @@ bool dashboardsk_pi::RenderGLOverlayMultiCanvas(
// return false;
}

if (!vp || !m_shown) {
if (!vp) {
return false;
}

if (!m_shown) {
if (m_dsk) {
m_dsk->ProcessData();
}
return false;
}

Expand Down

0 comments on commit a9f77e0

Please sign in to comment.