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: 7da600d8972b
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: 09fcc9065af0
Choose a head ref
  • 3 commits
  • 4 files changed
  • 1 contributor

Commits on Jul 7, 2020

  1. Copy the full SHA
    c8a2ead View commit details
  2. Copy the full SHA
    a7429b4 View commit details
  3. Copy the full SHA
    09fcc90 View commit details
Showing with 18 additions and 9 deletions.
  1. +2 −0 glscopeclient/OscilloscopeWindow.cpp
  2. +3 −2 glscopeclient/Timeline.cpp
  3. +2 −1 glscopeclient/WaveformArea_rendering.cpp
  4. +11 −6 glscopeclient/shaders/waveform-compute.glsl
2 changes: 2 additions & 0 deletions glscopeclient/OscilloscopeWindow.cpp
Original file line number Diff line number Diff line change
@@ -989,6 +989,8 @@ void OscilloscopeWindow::LoadUIConfiguration(const YAML::Node& node, IDTable& ta
table.emplace(gn["id"].as<int>(), &group->m_frame);
group->m_frame.set_label(gn["name"].as<string>());
group->m_pixelsPerXUnit = gn["pixelsPerXUnit"].as<float>();
if(group->m_pixelsPerXUnit < 1e-8) //Sanity check impractically small zoom levels
group->m_pixelsPerXUnit = 0.05;
group->m_xAxisOffset = gn["xAxisOffset"].as<long>();
m_waveformGroups.emplace(group);

5 changes: 3 additions & 2 deletions glscopeclient/Timeline.cpp
Original file line number Diff line number Diff line change
@@ -377,8 +377,9 @@ void Timeline::DrawCursor(

//Special case for time domain traces
//Also show the frequency dual
Unit hz(Unit::UNIT_HZ);
if(m_xAxisUnit.GetType() == Unit::UNIT_PS)
format += " (%.3f MHz)\n";
format += " (%s)\n";

int64_t dt = m_group->m_xCursorPos[1] - m_group->m_xCursorPos[0];

@@ -389,7 +390,7 @@ void Timeline::DrawCursor(
name,
m_xAxisUnit.PrettyPrint(ps).c_str(),
m_xAxisUnit.PrettyPrint(dt).c_str(),
1.0e6 / dt);
hz.PrettyPrint(1e12 / dt).c_str());
}
tlayout->set_text(label);
tlayout->get_pixel_size(swidth, sheight);
3 changes: 2 additions & 1 deletion glscopeclient/WaveformArea_rendering.cpp
Original file line number Diff line number Diff line change
@@ -198,11 +198,12 @@ void WaveformArea::PrepareGeometry(WaveformRenderData* wdata)
glBufferData(GL_SHADER_STORAGE_BUFFER, traceBuffer.size()*sizeof(float), &traceBuffer[0], GL_STREAM_DRAW);

//Config stuff
uint32_t config[4];
uint32_t config[5];
config[0] = m_height; //windowHeight
config[1] = m_plotRight; //windowWidth
config[2] = count; //depth
config[3] = m_parent->GetTraceAlpha() * 256; //alpha
config[4] = digdat ? 1 : 0; //digital
wdata->m_waveformConfigBuffer.Bind();
glBufferData(GL_SHADER_STORAGE_BUFFER, sizeof(config), config, GL_STREAM_DRAW);

17 changes: 11 additions & 6 deletions glscopeclient/shaders/waveform-compute.glsl
Original file line number Diff line number Diff line change
@@ -22,6 +22,7 @@ layout(std430, binding=2) buffer config
uint windowWidth;
uint memDepth;
uint alpha_scaled;
uint digital;
};

//Indexes so we know which samples go to which X pixel range
@@ -102,12 +103,16 @@ void main()
float starty = left.y;
float endy = right.y;

//Interpolate if either end is outside our column
float slope = (right.y - left.y) / (right.x - left.x);
if(left.x < gl_GlobalInvocationID.x)
starty = InterpolateY(left, right, slope, gl_GlobalInvocationID.x);
if(right.x > gl_GlobalInvocationID.x + 1)
endy = InterpolateY(left, right, slope, gl_GlobalInvocationID.x + 1);
//Interpolate analog signals if either end is outside our column
//We want digital signals to be nice and square, so don't do this!
if(digital == 0)
{
float slope = (right.y - left.y) / (right.x - left.x);
if(left.x < gl_GlobalInvocationID.x)
starty = InterpolateY(left, right, slope, gl_GlobalInvocationID.x);
if(right.x > gl_GlobalInvocationID.x + 1)
endy = InterpolateY(left, right, slope, gl_GlobalInvocationID.x + 1);
}

//Sort Y coordinates from min to max
int ymin = int(min(starty, endy));