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

Commits on Feb 14, 2020

  1. Copy the full SHA
    38eb598 View commit details
Showing with 35 additions and 2 deletions.
  1. +31 −1 glscopeclient/ProtocolAnalyzerWindow.cpp
  2. +2 −1 glscopeclient/ProtocolAnalyzerWindow.h
  3. +2 −0 glscopeclient/WaveformArea_events.cpp
32 changes: 31 additions & 1 deletion glscopeclient/ProtocolAnalyzerWindow.cpp
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
* *
* ANTIKERNEL v0.1 *
* *
* Copyright (c) 2012-2019 Andrew D. Zonenberg *
* Copyright (c) 2012-2020 Andrew D. Zonenberg *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -35,6 +35,7 @@
#include "glscopeclient.h"
#include "OscilloscopeWindow.h"
#include "ProtocolAnalyzerWindow.h"
#include "../../lib/scopeprotocols/scopeprotocols.h"

using namespace std;

@@ -54,6 +55,7 @@ ProtocolAnalyzerColumns::ProtocolAnalyzerColumns(PacketDecoder* decoder)
add(m_headers[m_headers.size()-1]);
}

add(m_image);
add(m_data);
}

@@ -86,6 +88,10 @@ ProtocolAnalyzerWindow::ProtocolAnalyzerWindow(
auto headers = decoder->GetHeaders();
for(size_t i=0; i<headers.size(); i++)
m_tree.append_column(headers[i], m_columns.m_headers[i]);

if(decoder->GetShowImageColumn())
m_tree.append_column("Image", m_columns.m_image);

if(decoder->GetShowDataColumn())
m_tree.append_column("Data", m_columns.m_data);

@@ -158,6 +164,30 @@ void ProtocolAnalyzerWindow::OnWaveformDataReady()
}
row[m_columns.m_data] = sdata;

//Add the image for video packets
auto vp = dynamic_cast<VideoScanlinePacket*>(p);
if(vp != NULL)
{
//Create the image data
vp->m_image = p->m_data;
size_t rowsize = vp->m_image.size();
size_t width = rowsize / 3;
size_t height = 24;
size_t bcount = rowsize * height;
vp->m_image.resize(bcount);
for(size_t y=1; y<height; y++)
memcpy(&vp->m_image[y*rowsize], &vp->m_image[0], rowsize);

row[m_columns.m_image] = Gdk::Pixbuf::create_from_data(
&vp->m_image[0],
Gdk::COLORSPACE_RGB,
false,
8,
width,
height,
rowsize);
}

//Select the newly added row
m_tree.get_selection()->select(row);
}
3 changes: 2 additions & 1 deletion glscopeclient/ProtocolAnalyzerWindow.h
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
* *
* ANTIKERNEL v0.1 *
* *
* Copyright (c) 2012-2019 Andrew D. Zonenberg *
* Copyright (c) 2012-2020 Andrew D. Zonenberg *
* All rights reserved. *
* *
* Redistribution and use in source and binary forms, with or without modification, are permitted provided that the *
@@ -51,6 +51,7 @@ class ProtocolAnalyzerColumns : public Gtk::TreeModel::ColumnRecord
Gtk::TreeModelColumn<int64_t> m_offset;
std::vector< Gtk::TreeModelColumn<Glib::ustring> > m_headers;
Gtk::TreeModelColumn<Glib::ustring> m_data;
Gtk::TreeModelColumn<Glib::RefPtr<Gdk::Pixbuf>> m_image;
};

/**
2 changes: 2 additions & 0 deletions glscopeclient/WaveformArea_events.cpp
Original file line number Diff line number Diff line change
@@ -443,6 +443,8 @@ void WaveformArea::OnHide()
break;
}
}

queue_draw();
}
}