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: 3626e336d366
Choose a base ref
...
head repository: ngscopeclient/scopehal
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0a2929863915
Choose a head ref
  • 3 commits
  • 3 files changed
  • 1 contributor

Commits on Jul 7, 2020

  1. Copy the full SHA
    7a9c0a8 View commit details
  2. Copy the full SHA
    9b561b4 View commit details
  3. Copy the full SHA
    0a29298 View commit details
Showing with 24 additions and 12 deletions.
  1. +10 −2 scopehal/LeCroyOscilloscope.cpp
  2. +13 −9 scopehal/Oscilloscope.cpp
  3. +1 −1 scopehal/ProtocolDecoder.cpp
12 changes: 10 additions & 2 deletions scopehal/LeCroyOscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -1173,7 +1173,7 @@ time_t LeCroyOscilloscope::ExtractTimestamp(unsigned char* wavedesc, double& bas
basetime = fseconds - seconds;
time_t tnow = time(NULL);
struct tm tstruc;

#ifdef _WIN32
localtime_s(&tstruc, &tnow);
#else
@@ -2118,6 +2118,10 @@ int64_t LeCroyOscilloscope::GetTriggerOffset()

void LeCroyOscilloscope::SetDeskewForChannel(size_t channel, int64_t skew)
{
//Cannot deskew digital/trigger channels
if(channel >= m_analogChannelCount)
return;

lock_guard<recursive_mutex> lock(m_mutex);

char tmp[128];
@@ -2134,6 +2138,10 @@ void LeCroyOscilloscope::SetDeskewForChannel(size_t channel, int64_t skew)

int64_t LeCroyOscilloscope::GetDeskewForChannel(size_t channel)
{
//Cannot deskew digital/trigger channels
if(channel >= m_analogChannelCount)
return 0;

//Early out if the value is in cache
{
lock_guard<recursive_mutex> lock(m_cacheMutex);
@@ -2157,4 +2165,4 @@ int64_t LeCroyOscilloscope::GetDeskewForChannel(size_t channel)
m_channelDeskew[channel] = skew_ps;

return skew_ps;
}
}
22 changes: 13 additions & 9 deletions scopehal/Oscilloscope.cpp
Original file line number Diff line number Diff line change
@@ -285,6 +285,7 @@ string Oscilloscope::SerializeConfiguration(IDTable& table)

//should never get synthetic coupling on a scope channel
default:
LogWarning("unsupported coupling value when saving\n");
break;
}
}
@@ -326,15 +327,18 @@ void Oscilloscope::LoadConfiguration(const YAML::Node& node, IDTable& table)
chan->SetVoltageRange(cnode["vrange"].as<float>());
chan->SetOffset(cnode["offset"].as<float>());

string coupling = cnode["coupling"].as<string>();
if(coupling == "dc_50")
chan->SetCoupling(OscilloscopeChannel::COUPLE_DC_50);
else if(coupling == "dc_1M")
chan->SetCoupling(OscilloscopeChannel::COUPLE_DC_1M);
else if(coupling == "ac_1M")
chan->SetCoupling(OscilloscopeChannel::COUPLE_AC_1M);
else if(coupling == "gnd")
chan->SetCoupling(OscilloscopeChannel::COUPLE_GND);
if(cnode["coupling"])
{
string coupling = cnode["coupling"].as<string>();
if(coupling == "dc_50")
chan->SetCoupling(OscilloscopeChannel::COUPLE_DC_50);
else if(coupling == "dc_1M")
chan->SetCoupling(OscilloscopeChannel::COUPLE_DC_1M);
else if(coupling == "ac_1M")
chan->SetCoupling(OscilloscopeChannel::COUPLE_AC_1M);
else if(coupling == "gnd")
chan->SetCoupling(OscilloscopeChannel::COUPLE_GND);
}
}
}
}
2 changes: 1 addition & 1 deletion scopehal/ProtocolDecoder.cpp
Original file line number Diff line number Diff line change
@@ -75,7 +75,7 @@ void ProtocolDecoderParameter::ParseString(string str)
scale = 1000000000.0f;
else if(suffix == 'M')
scale = 1000000.0f;
else if(suffix == 'K')
else if(suffix == 'k')
scale = 1000.0f;
else if(suffix == 'm')
scale = 0.001f;