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

Commits on Sep 1, 2020

  1. Copy the full SHA
    c89d1f2 View commit details
Showing with 44 additions and 5 deletions.
  1. +1 −1 lib
  2. +33 −1 src/glscopeclient/WaveformArea_cairo.cpp
  3. +10 −3 src/glscopeclient/WaveformArea_events.cpp
2 changes: 1 addition & 1 deletion lib
Submodule lib updated from 31a7e4 to d03496
34 changes: 33 additions & 1 deletion src/glscopeclient/WaveformArea_cairo.cpp
Original file line number Diff line number Diff line change
@@ -202,7 +202,7 @@ void WaveformArea::RenderGrid(Cairo::RefPtr< Cairo::Context > cr)
}
cr->begin_new_path();

//See if we're the active trigger
//Render arrow for trigger
if(m_channel.m_channel->IsPhysicalChannel())
{
auto scope = m_channel.m_channel->GetScope();
@@ -213,19 +213,51 @@ void WaveformArea::RenderGrid(Cairo::RefPtr< Cairo::Context > cr)

float trisize = 5;

//Dragging? Arrow follows mouse
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->set_line_width(1);
float x = m_plotRight + trisize*2;

//If the trigger is outside the displayed area, clip to the edge of the displayed area
//and display an "out of range" symbol
float tbottom = m_height - trisize;
float ttop = trisize;
if(y > tbottom)
{
y = tbottom;

cr->move_to(x, y - trisize);
cr->line_to(x, y + trisize);
cr->line_to(x - trisize*0.5, y);
cr->move_to(x, y + trisize);
cr->line_to(x + trisize*0.5, y);
cr->stroke();
}
else if(y < ttop)
{
y = ttop;

cr->move_to(x, y + trisize);
cr->line_to(x, y - trisize);
cr->line_to(x - trisize*0.5, y);
cr->move_to(x, y - trisize);
cr->line_to(x + trisize*0.5, y);
cr->stroke();
}
}

cr->move_to(m_plotRight, y);
cr->line_to(m_plotRight + trisize, y + trisize);
cr->line_to(m_plotRight + trisize, y - trisize);
13 changes: 10 additions & 3 deletions src/glscopeclient/WaveformArea_events.cpp
Original file line number Diff line number Diff line change
@@ -1028,10 +1028,17 @@ WaveformArea::ClickLocation WaveformArea::HitTest(double x, double y)
{
float vy = VoltsToYPosition(scope->GetTriggerVoltage());
float radius = 20;
if( (fabs(y - vy) < radius) &&
(x < (m_plotRight + radius) ) )
if(x < (m_plotRight + radius) )
{
return LOC_TRIGGER;
//If on top of the trigger, obviously we're a hit
if(fabs(y - vy) < radius)
return LOC_TRIGGER;

//but also check the edges of the plot if trigger is off scale
if( (vy > m_height) && (fabs(m_height - y) < radius) )
return LOC_TRIGGER;
if( (vy < 0) && (y < radius) )
return LOC_TRIGGER;
}
}