Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 224573fd61de
Choose a base ref
...
head repository: ngscopeclient/scopehal-apps
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 3f69d67a7cad
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Jun 11, 2020

  1. Copy the full SHA
    d7894ae View commit details
  2. Copy the full SHA
    219e34c View commit details
  3. OscilloscopeWindow: improved handling of secondary scopes skipping tr…

    …iggers in multi-scope systems
    azonenberg committed Jun 11, 2020
    Copy the full SHA
    3f69d67 View commit details
Showing with 17 additions and 7 deletions.
  1. +10 −5 glscopeclient/OscilloscopeWindow.cpp
  2. +6 −1 glscopeclient/main.cpp
  3. +1 −1 glscopeclient/styles/glscopeclient.css
15 changes: 10 additions & 5 deletions glscopeclient/OscilloscopeWindow.cpp
Original file line number Diff line number Diff line change
@@ -1850,19 +1850,24 @@ bool OscilloscopeWindow::PollScopes()

//All instruments should trigger within 100ms (arbitrary threshold) of the primary.
//If it's been longer than that, something went wrong. Discard all pending data and re-arm the trigger.
if( (m_tPrimaryTrigger > 0) && ( (GetTime() - m_tPrimaryTrigger) > 0.1 ) )
double twait = GetTime() - m_tPrimaryTrigger;
if( (m_tPrimaryTrigger > 0) && ( twait > 0.1 ) )
{
LogWarning("Timed out waiting for one or more secondary instruments to trigger. Resetting...\n");
LogWarning("Timed out waiting for one or more secondary instruments to trigger (%.2f ms). Resetting...\n",
twait*1000);

//Cancel any pending triggers
OnStop();

//Discard all pending waveform data
for(auto scope : m_scopes)
{
while(scope->HasPendingWaveforms())
OnWaveformDataReady(scope);
scope->IDPing();
scope->ClearPendingWaveforms();
}

//Re-arm the trigger and get back to polling
ArmTrigger(false);
OnStart();
return false;
}
}
7 changes: 6 additions & 1 deletion glscopeclient/main.cpp
Original file line number Diff line number Diff line change
@@ -317,7 +317,7 @@ void ScopeThread(Oscilloscope* scope)
if(!scope->IsTriggerArmed())
{
LogTrace("Scope isn't armed, sleeping\n");
usleep(50 * 1000);
usleep(5 * 1000);
tlast = GetTime();
continue;
}
@@ -344,6 +344,11 @@ void ScopeThread(Oscilloscope* scope)

continue;
}

//Wait 1ms before polling again, so the UI thread has a chance to grab the mutex
else
usleep(1*1000);

npolls ++;
}
}
2 changes: 1 addition & 1 deletion glscopeclient/styles/glscopeclient.css
Original file line number Diff line number Diff line change
@@ -240,7 +240,7 @@ assistant box
assistant notebook
{
border-color: @glscopeclient_highlight_color;
border-bottom-width: 1;
border-bottom-width: 1px;
border-style: solid;
}