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: faddf97ae5b2
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: 56a0310cbb6e
Choose a head ref
  • 1 commit
  • 3 files changed
  • 1 contributor

Commits on Mar 15, 2020

  1. Copy the full SHA
    56a0310 View commit details
Showing with 45 additions and 22 deletions.
  1. +1 −1 glscopeclient/HistoryWindow.cpp
  2. +20 −1 glscopeclient/OscilloscopeWindow.cpp
  3. +24 −20 glscopeclient/WaveformArea_cairo.cpp
2 changes: 1 addition & 1 deletion glscopeclient/HistoryWindow.cpp
Original file line number Diff line number Diff line change
@@ -357,7 +357,7 @@ void HistoryWindow::SerializeWaveforms(string dir, IDTable& table)
auto dchan = dynamic_cast<DigitalCapture*>(chan);
for(size_t i=0; i<chan->GetDepth(); i++)
{
int64_t times[2] = { chan->GetSampleStart(i), chan->GetSampleEnd(i) };
int64_t times[2] = { chan->GetSampleStart(i), chan->GetSampleLen(i) };
if(2 != fwrite(times, sizeof(int64_t), 2, fp))
LogError("file write error\n");
if(achan)
21 changes: 20 additions & 1 deletion glscopeclient/OscilloscopeWindow.cpp
Original file line number Diff line number Diff line change
@@ -492,6 +492,24 @@ void OscilloscopeWindow::DoFileOpen(string filename, bool loadLayout, bool loadW

//TODO: refresh measurements and protocol decodes

//Create protocol analyzers
for(auto area : m_waveformAreas)
{
for(size_t i=0; i<area->GetOverlayCount(); i++)
{
auto pdecode = dynamic_cast<PacketDecoder*>(area->GetOverlay(i));
if(pdecode != NULL)
{
char title[256];
snprintf(title, sizeof(title), "Protocol Analyzer: %s", pdecode->m_displayname.c_str());

auto analyzer = new ProtocolAnalyzerWindow(title, this, pdecode, area);
m_analyzers.emplace(analyzer);
analyzer->show();
}
}
}

//Start threads to poll scopes etc
g_app->StartScopeThreads();
}
@@ -728,7 +746,8 @@ void OscilloscopeWindow::LoadDecodes(const YAML::Node& node, IDTable& table)
for(auto it : node)
{
auto dnode = it.second;
static_cast<ProtocolDecoder*>(table[dnode["id"].as<int>()])->LoadConfiguration(dnode, table);
auto decode = static_cast<ProtocolDecoder*>(table[dnode["id"].as<int>()]);
decode->LoadConfiguration(dnode, table);
}
}

44 changes: 24 additions & 20 deletions glscopeclient/WaveformArea_cairo.cpp
Original file line number Diff line number Diff line change
@@ -206,30 +206,34 @@ void WaveformArea::RenderGrid(Cairo::RefPtr< Cairo::Context > cr)
cr->begin_new_path();

//See if we're the active trigger
if(m_channel->GetIndex() == m_channel->GetScope()->GetTriggerChannelIndex())
if(m_channel->IsPhysicalChannel())
{
float v = m_channel->GetScope()->GetTriggerVoltage();
float y = VoltsToYPosition(v);
auto scope = m_channel->GetScope();
if(m_channel->GetIndex() == scope->GetTriggerChannelIndex())
{
float v = m_channel->GetScope()->GetTriggerVoltage();
float y = VoltsToYPosition(v);

float trisize = 5;
float trisize = 5;

if(m_dragState == DRAG_TRIGGER)
{
cr->set_source_rgba(1, 0, 0, 1);
y = m_cursorY;
}
else
{
cr->set_source_rgba(
color.get_red_p(),
color.get_green_p(),
color.get_blue_p(),
1);
if(m_dragState == DRAG_TRIGGER)
{
cr->set_source_rgba(1, 0, 0, 1);
y = m_cursorY;
}
else
{
cr->set_source_rgba(
color.get_red_p(),
color.get_green_p(),
color.get_blue_p(),
1);
}
cr->move_to(m_plotRight, y);
cr->line_to(m_plotRight + trisize, y + trisize);
cr->line_to(m_plotRight + trisize, y - trisize);
cr->fill();
}
cr->move_to(m_plotRight, y);
cr->line_to(m_plotRight + trisize, y + trisize);
cr->line_to(m_plotRight + trisize, y - trisize);
cr->fill();
}

cr->restore();