Skip to content

Commit a2e95a6

Browse files
committed
FilterGraphEditor: added more detailed information to tooltips on block outputs
1 parent b823b6f commit a2e95a6

1 file changed

Lines changed: 32 additions & 1 deletion

File tree

src/ngscopeclient/FilterGraphEditor.cpp

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#include "FilterPropertiesDialog.h"
4545
#include "EmbeddedTriggerPropertiesDialog.h"
4646
#include "MeasurementsDialog.h"
47+
#include "../scopehal/DensityFunctionWaveform.h"
4748

4849
using namespace std;
4950

@@ -1049,7 +1050,10 @@ void FilterGraphEditor::ClearOldPropertiesDialogs()
10491050
void FilterGraphEditor::OutputPortTooltip(StreamDescriptor stream)
10501051
{
10511052
ImGui::BeginTooltip();
1052-
switch(stream.GetType())
1053+
1054+
//Channel type
1055+
auto stype = stream.GetType();
1056+
switch(stype)
10531057
{
10541058
case Stream::STREAM_TYPE_ANALOG:
10551059
ImGui::TextUnformatted("Analog channel");
@@ -1095,6 +1099,33 @@ void FilterGraphEditor::OutputPortTooltip(StreamDescriptor stream)
10951099
ImGui::TextUnformatted("Unknown channel type");
10961100
break;
10971101
}
1102+
1103+
//Get the data type and print (unless it's a scalar)
1104+
if(stype != Stream::STREAM_TYPE_ANALOG_SCALAR)
1105+
{
1106+
auto data = stream.GetData();
1107+
if(!data)
1108+
ImGui::Text("No waveform data");
1109+
else
1110+
{
1111+
auto srate = stream.GetXAxisUnits().PrettyPrint(data->m_timescale);
1112+
if(dynamic_cast<DensityFunctionWaveform*>(data))
1113+
ImGui::Text("2D density plot");
1114+
else if(dynamic_cast<UniformAnalogWaveform*>(data))
1115+
ImGui::Text("Uniformly sampled analog data, %zu samples at %s intervals", data->size(), srate.c_str());
1116+
else if(dynamic_cast<UniformDigitalWaveform*>(data))
1117+
ImGui::Text("Uniformly sampled digital data, %zu samples at %s intervals", data->size(), srate.c_str());
1118+
else if(dynamic_cast<SparseAnalogWaveform*>(data))
1119+
ImGui::Text("Sparsely sampled analog data, %zu samples at %s resolution", data->size(), srate.c_str());
1120+
else if(dynamic_cast<SparseDigitalWaveform*>(data))
1121+
ImGui::Text("Sparsely sampled digital data, %zu samples at %s resolution", data->size(), srate.c_str());
1122+
else if(dynamic_cast<UniformWaveformBase*>(data))
1123+
ImGui::Text("Uniformly sampled data, %zu samples at %s intervals", data->size(), srate.c_str());
1124+
else if(dynamic_cast<SparseWaveformBase*>(data))
1125+
ImGui::Text("Sparsely sampled data, %zu samples at %s resolution", data->size(), srate.c_str());
1126+
}
1127+
}
1128+
10981129
ImGui::EndTooltip();
10991130

11001131
m_parent->AddStatusHelp("mouse_lmb_drag", "Create connection to new or existing node");

0 commit comments

Comments
 (0)