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: e5c72cafb90a
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: 9a27306e76be
Choose a head ref
  • 1 commit
  • 1 file changed
  • 1 contributor

Commits on May 4, 2019

  1. Copy the full SHA
    9a27306 View commit details
Showing with 21 additions and 1 deletion.
  1. +21 −1 glscopeclient/main.cpp
22 changes: 21 additions & 1 deletion glscopeclient/main.cpp
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@
#include "../scopeprotocols/scopeprotocols.h"
#include "../scopemeasurements/scopemeasurements.h"
#include "../scopehal/LeCroyVICPOscilloscope.h"
#include "../scopehal/RigolLANOscilloscope.h"
#include <thread>

using namespace std;
@@ -205,6 +206,16 @@ int main(int argc, char* argv[])
scope->m_nickname = nick;
app->m_scopes.push_back(scope);
}
else if(sapi == "rigol_lan")
{
//default port if not specified
if(port == 0)
port = 5555;

auto scope = new RigolLANOscilloscope(host, port);
scope->m_nickname = nick;
app->m_scopes.push_back(scope);
}
else
{
LogError("Unrecognized API \"%s\", use --help\n", api);
@@ -250,7 +261,16 @@ void ScopeThread(Oscilloscope* scope)
continue;
}

if(scope->PollTrigger() == Oscilloscope::TRIGGER_MODE_TRIGGERED)
auto stat = scope->PollTrigger();

//If there's nothing to do, sleep for a bit to avoid hammering the CPU
if(stat == Oscilloscope::TRIGGER_MODE_STOP)
{
usleep(1000);
continue;
}

if(stat == Oscilloscope::TRIGGER_MODE_TRIGGERED)
scope->AcquireData(true);
}
}