Skip to content

Commit 088660b

Browse files
committed
Fixed bug where measurements without scalar outputs vanish in the filter graph editor. Fixes #807.
1 parent 6493b0d commit 088660b

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

src/ngscopeclient/FilterGraphEditor.cpp

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -473,10 +473,30 @@ bool FilterGraphEditor::DoRender()
473473
if(ftype->IsDelivery())
474474
{
475475
//Make the filter but don't spawn a properties dialog for it
476-
//If measurement, don't add trends by default
476+
//If measurement, don't add trends by default... but always add something
477477
StreamDescriptor emptyStream;
478478
auto f = m_parent->CreateFilter(fname, nullptr, emptyStream, false, (cat != Filter::CAT_MEASUREMENT) );
479479

480+
//If it's a measurement that has no scalar outputs (only one as of this writing is burst width),
481+
//we *do* want to spawn a waveform area for it
482+
if(cat == Filter::CAT_MEASUREMENT)
483+
{
484+
//See what outputs it has
485+
bool hasScalar = false;
486+
for(size_t nstream=0; nstream < f->GetStreamCount(); nstream ++)
487+
{
488+
if(f->GetType(nstream) == Stream::STREAM_TYPE_ANALOG_SCALAR)
489+
{
490+
hasScalar = true;
491+
break;
492+
}
493+
}
494+
495+
//No scalar outputs? Add a view for the first output
496+
if(!hasScalar)
497+
m_parent->FindAreaForStream(nullptr, StreamDescriptor(f, 0));
498+
}
499+
480500
nodeAdded = true;
481501
newNode = GetID(f);
482502
}

0 commit comments

Comments
 (0)