Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rich UI support for StreamBrowserDialog on oscilloscopes #765

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
d448bbd
WIP: StreamBrowserDialog gets support for some rich UI on oscilloscopes
jwise Sep 27, 2024
444643f
refactor info link, to be used elsewhere soon
jwise Sep 27, 2024
51a63c9
refactor renderBadge, and only render a badge if there is enough spac…
jwise Sep 27, 2024
deb8bd2
oops, actually align the right side with the spacing
jwise Sep 27, 2024
be3aa87
StreamBrowserDialog: add a child box of a channel / stream for offset…
jwise Sep 27, 2024
aba9f19
cache trigger state from InstrumentThread in InstrumentConnectionStat…
jwise Sep 30, 2024
3151785
Fixed triger state update logic.
Oct 2, 2024
2805ab6
First step to download progress-bar on onscilloscope channels.
Oct 2, 2024
0963828
Moved to actual scopehal GetDownloadState() API.
fredzo Oct 6, 2024
5d6eb27
Made digital channel nodes collapsed by default.
fredzo Oct 6, 2024
eca2595
Restored digital threshold value read on digital channel properties (…
fredzo Oct 7, 2024
ed6a7bd
StreamBrowserDialog: use new GetDownloadProgress API (todo: put back …
jwise Oct 8, 2024
6f3d666
StreamBrowserDialog: prefer to show the status badge rather than prog…
jwise Oct 8, 2024
4b04dd7
StreamBrowserDialog: by default, make the dialog larger to fit more i…
jwise Oct 8, 2024
eb5e045
StreamBrowserDialog: any kind of InstrumentChannel can have download …
jwise Oct 8, 2024
ceb5be6
StreamDownloadWindow: add "download is slow" heuristic with hystersis
jwise Oct 8, 2024
a100080
Removed no longer needed code after moving to GetChannelDowloadProgre…
fredzo Oct 8, 2024
b419a0b
Prevents flickering for fast download.
Oct 8, 2024
1d6cd5b
Fixed end of download detection based on new AcquisitionStopped() hel…
fredzo Oct 9, 2024
48c5651
StreamBrowserDialog: make "active" behave like a hard drive indicator…
jwise Oct 9, 2024
ff70b36
Made download speed detection global for an instrument rather then pe…
fredzo Oct 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions src/ngscopeclient/InstrumentThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ void InstrumentThread(InstrumentThreadArgs args)
auto bertstate = args.bertstate;
auto psustate = args.psustate;

bool triggerUpToDate = false;

while(!*args.shuttingDown)
{
//Flush any pending commands
Expand All @@ -86,15 +88,26 @@ void InstrumentThread(InstrumentThreadArgs args)
{
//LogTrace("Scope isn't armed, sleeping\n");
this_thread::sleep_for(chrono::milliseconds(5));
if(!triggerUpToDate)
{ // Check for trigger state change
auto stat = scope->PollTrigger();
session->GetInstrumentConnectionState(inst)->m_lastTriggerState = stat;
if(stat == Oscilloscope::TRIGGER_MODE_STOP || stat == Oscilloscope::TRIGGER_MODE_RUN || stat == Oscilloscope::TRIGGER_MODE_TRIGGERED)
{ // Final state
triggerUpToDate = true;
}
}
}

//Grab data if it's ready
//TODO: how is this going to play with reading realtime BER from BERT+scope deviecs?
else
{
auto stat = scope->PollTrigger();
session->GetInstrumentConnectionState(inst)->m_lastTriggerState = stat;
if(stat == Oscilloscope::TRIGGER_MODE_TRIGGERED)
scope->AcquireData();
triggerUpToDate = false;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/ngscopeclient/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1277,7 +1277,7 @@ void MainWindow::DockingArea()
rightPanelID = topNode->ChildNodes[1]->ID;
}
else
ImGui::DockBuilderSplitNode(topNode->ID, ImGuiDir_Left, 0.1, &leftPanelID, &rightPanelID);
ImGui::DockBuilderSplitNode(topNode->ID, ImGuiDir_Left, 0.2, &leftPanelID, &rightPanelID);

ImGui::DockBuilderDockWindow(m_streamBrowser->GetTitleAndID().c_str(), leftPanelID);
ImGui::DockBuilderDockWindow(m_initialWorkspaceDockRequest->GetTitleAndID().c_str(), rightPanelID);
Expand Down
5 changes: 5 additions & 0 deletions src/ngscopeclient/Session.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class InstrumentConnectionState
m_shuttingDown = false;
args.shuttingDown = &m_shuttingDown;
m_thread = std::make_unique<std::thread>(InstrumentThread, args);
m_lastTriggerState = Oscilloscope::TRIGGER_MODE_WAIT;
}

~InstrumentConnectionState()
Expand All @@ -79,6 +80,9 @@ class InstrumentConnectionState

///@brief Thread for polling the instrument
std::unique_ptr<std::thread> m_thread;

///@brief Cached trigger state, to reflect in the UI
Oscilloscope::TriggerMode m_lastTriggerState;
};

/**
Expand Down Expand Up @@ -132,6 +136,7 @@ class Session

void AddInstrument(std::shared_ptr<Instrument> inst, bool createDialogs = true);
void RemoveInstrument(std::shared_ptr<Instrument> inst);
std::shared_ptr<InstrumentConnectionState> GetInstrumentConnectionState(std::shared_ptr<Instrument> inst) { return m_instrumentStates[inst]; }

bool IsMultiScope()
{ return m_multiScope; }
Expand Down
Loading
Loading