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
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f790a73e598d
Choose a base ref
...
head repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d82f14a74b14
Choose a head ref
  • 3 commits
  • 4 files changed
  • 2 contributors

Commits on Jun 3, 2020

  1. Copy the full SHA
    375c8d0 View commit details
  2. Change @author.

    tomverbeure committed Jun 3, 2020
    Copy the full SHA
    7e8737d View commit details
  3. Merge pull request #135 from tomverbeure/lxi_init

    Move lxi_init() to where it belongs
    azonenberg authored Jun 3, 2020
    Copy the full SHA
    d82f14a View commit details
Showing with 17 additions and 8 deletions.
  1. +14 −1 scopehal/SCPILxiTransport.cpp
  2. +3 −1 scopehal/SCPILxiTransport.h
  3. +0 −2 scopehal/scopehal.cpp
  4. +0 −4 scopehal/scopehal.h
15 changes: 14 additions & 1 deletion scopehal/SCPILxiTransport.cpp
Original file line number Diff line number Diff line change
@@ -29,19 +29,32 @@

/**
@file
@author Andrew D. Zonenberg
@author Tom Verbeure
@brief Implementation of SCPILxiTransport
*/

extern "C"
{
#include <lxi.h>
}

#include "scopehal.h"

using namespace std;

////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Construction / destruction

bool SCPILxiTransport::m_lxi_initialized = false;

SCPILxiTransport::SCPILxiTransport(string args)
{
if (!m_lxi_initialized)
{
lxi_init();
m_lxi_initialized = true;
}

char hostname[128];
unsigned int port = 0;
if (2 != sscanf(args.c_str(), "%127[^:]:%u", hostname, &port))
4 changes: 3 additions & 1 deletion scopehal/SCPILxiTransport.h
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@

/**
@file
@author Andrew D. Zonenberg
@author Tom Verbeure
@brief Declaration of SCPILxiTransport
*/

@@ -62,6 +62,8 @@ class SCPILxiTransport : public SCPITransport
{ return m_hostname; }

protected:
static bool m_lxi_initialized;

std::string m_hostname;
unsigned short m_port;

2 changes: 0 additions & 2 deletions scopehal/scopehal.cpp
Original file line number Diff line number Diff line change
@@ -51,8 +51,6 @@ using namespace std;
*/
void TransportStaticInit()
{
lxi_init();

AddTransportClass(SCPISocketTransport);
AddTransportClass(SCPILxiTransport);
AddTransportClass(SCPITMCTransport);
4 changes: 0 additions & 4 deletions scopehal/scopehal.h
Original file line number Diff line number Diff line change
@@ -46,10 +46,6 @@

#include <yaml-cpp/yaml.h>

extern "C"
{
#include <lxi.h>
}

#include "../log/log.h"
#include "../graphwidget/Graph.h"