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: 9a27306e76be
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: 75f102bc8628
Choose a head ref
  • 3 commits
  • 5 files changed
  • 1 contributor

Commits on May 12, 2019

  1. Copy the full SHA
    7d063fb View commit details
  2. Copy the full SHA
    18f1786 View commit details
  3. Copy the full SHA
    75f102b View commit details
20 changes: 10 additions & 10 deletions glscopeclient/OscilloscopeWindow.cpp
Original file line number Diff line number Diff line change
@@ -212,6 +212,10 @@ void OscilloscopeWindow::CreateWidgets()
m_btnHistory.set_tooltip_text("History");
m_btnHistory.set_icon_name("search");
m_toolbar.append(*Gtk::manage(new Gtk::SeparatorToolItem));
m_toolbar.append(m_btnRefresh, sigc::mem_fun(*this, &OscilloscopeWindow::OnRefreshConfig));
m_btnRefresh.set_tooltip_text("Reload configuration from scope");
m_btnRefresh.set_icon_name("reload");
m_toolbar.append(*Gtk::manage(new Gtk::SeparatorToolItem));
m_toolbox.pack_start(m_alphalabel, Gtk::PACK_SHRINK);
m_alphalabel.set_label("Opacity ");
m_toolbox.pack_start(m_alphaslider, Gtk::PACK_SHRINK);
@@ -510,6 +514,12 @@ void OscilloscopeWindow::GarbageCollectGroups()
}
}

void OscilloscopeWindow::OnRefreshConfig()
{
for(auto scope : m_scopes)
scope->FlushConfigCache();
}

void OscilloscopeWindow::OnAutofitHorizontal()
{
LogDebug("autofit horz\n");
@@ -614,16 +624,6 @@ void OscilloscopeWindow::OnRemoveChannel(WaveformArea* w)

void OscilloscopeWindow::PollScopes()
{
//Flush the config cache every 10 seconds
//TODO: make a button to do this, don't do it automatically
/*
if( (GetTime() - m_tLastFlush) > 10)
{
for(auto scope : m_scopes)
scope->FlushConfigCache();
}
*/

static double tstamp = 0;
static bool first = true;
if(first)
2 changes: 2 additions & 0 deletions glscopeclient/OscilloscopeWindow.h
Original file line number Diff line number Diff line change
@@ -120,6 +120,7 @@ class OscilloscopeWindow : public Gtk::Window
void OnQuit();
void OnHistory();
void OnAlphaChanged();
void OnRefreshConfig();

void UpdateStatusBar();

@@ -152,6 +153,7 @@ class OscilloscopeWindow : public Gtk::Window
Gtk::ToolButton m_btnStartSingle;
Gtk::ToolButton m_btnStop;
Gtk::ToggleToolButton m_btnHistory;
Gtk::ToolButton m_btnRefresh;
Gtk::Label m_alphalabel;
Gtk::HScale m_alphaslider;

4 changes: 4 additions & 0 deletions glscopeclient/ProtocolDecoderDialog.cpp
Original file line number Diff line number Diff line change
@@ -59,6 +59,10 @@ ProtocolDecoderDialog::ProtocolDecoderDialog(
//Label is just the channel name
row->m_label.set_label(decoder->GetInputName(i));

//always allow not connecting an input
row->m_chans.append("NULL");
row->m_chanptrs["NULL"] = NULL;

//Fill the channel list with all channels that are legal to use here
for(size_t j=0; j<parent->GetScopeCount(); j++)
{
4 changes: 2 additions & 2 deletions glscopeclient/Timeline.cpp
Original file line number Diff line number Diff line change
@@ -236,8 +236,8 @@ void Timeline::RenderAsTime(const Cairo::RefPtr<Cairo::Context>& cr)
// width_ps, unit_divisor, round_divisor);

//Figure out about how much time per graduation to use
const int min_label_grad_width = 100; //Minimum distance between text labels, in pixels
int64_t grad_ps_nominal = min_label_grad_width / m_group->m_pixelsPerPicosecond;
const double min_label_grad_width = 100; //Minimum distance between text labels, in pixels
double grad_ps_nominal = min_label_grad_width / m_group->m_pixelsPerPicosecond;

//Round so the division sizes are sane
double units_per_grad = grad_ps_nominal * 1.0 / round_divisor;
12 changes: 11 additions & 1 deletion glscopeclient/WaveformArea_rendering.cpp
Original file line number Diff line number Diff line change
@@ -834,6 +834,7 @@ void WaveformArea::RenderDecodeOverlays(Cairo::RefPtr< Cairo::Context > cr)
Gdk::Color color(o->m_displaycolor);
cr->set_source_rgb(color.get_red_p(), color.get_green_p(), color.get_blue_p());
bool first = true;
double last_end = -100;
if(dr != NULL)
{
auto ddat = dynamic_cast<DigitalCapture*>(data);
@@ -845,13 +846,22 @@ void WaveformArea::RenderDecodeOverlays(Cairo::RefPtr< Cairo::Context > cr)
double xs = PicosecondsToXPosition(start);
double xe = PicosecondsToXPosition(end);

if( (xe < textright) || (xe > m_plotRight) )
if( (xe < 0) || (xs > m_plotRight) )
continue;

//Clamp
if(xe > m_plotRight)
xe = m_plotRight;

double y = ybot;
if((*ddat)[i])
y = ytop;

//Handle gaps between samples
if( (xs - last_end) > 2)
first = true;
last_end = xe;

//start of sample
if(first)
{