@@ -195,10 +195,9 @@ void FilterGraphGroup::MoveBy(ImVec2 displacement)
195195// Construction / destruction
196196
197197FilterGraphEditor::FilterGraphEditor (Session& session, MainWindow* parent)
198- : Dialog(" Filter Graph Editor" , " Filter Graph Editor" , ImVec2(800 , 600 ))
199- , m_session(session)
200- , m_parent(parent)
198+ : Dialog(" Filter Graph Editor" , " Filter Graph Editor" , ImVec2(800 , 600 ), &session, parent)
201199 , m_nextID(1 )
200+ , m_errorWindow(&session)
202201{
203202 m_config.SaveSettings = &FilterGraphEditor::SaveSettingsCallback;
204203 m_config.LoadSettings = &FilterGraphEditor::LoadSettingsCallback;
@@ -215,7 +214,7 @@ FilterGraphEditor::FilterGraphEditor(Session& session, MainWindow* parent)
215214 // Start by reserving group IDs so they don't get reused by anything else
216215 auto groups = parent->GetGraphEditorGroups ();
217216 for (auto it : groups)
218- m_session. m_idtable .ReserveID (it.first );
217+ m_session-> m_idtable .ReserveID (it.first );
219218 for (auto it : groups)
220219 {
221220 auto group = make_shared<FilterGraphGroup>(*this );
@@ -243,6 +242,9 @@ bool FilterGraphEditor::Render()
243242 else if (bdlg)
244243 bdlg->RunFileDialog ();
245244
245+ // Render our error window
246+ m_errorWindow.Render ();
247+
246248 return Dialog::Render ();
247249}
248250
@@ -253,7 +255,7 @@ map<shared_ptr<Instrument>, vector<InstrumentChannel*> > FilterGraphEditor::GetA
253255{
254256 map<shared_ptr<Instrument>, vector<InstrumentChannel*> > ret;
255257
256- auto insts = m_session. GetInstruments ();
258+ auto insts = m_session-> GetInstruments ();
257259 for (auto inst : insts)
258260 {
259261 vector<InstrumentChannel*> chans;
@@ -343,7 +345,7 @@ vector<FlowGraphNode*> FilterGraphEditor::GetAllNodes()
343345 }
344346
345347 // Triggers
346- auto insts = m_session. GetInstruments ();
348+ auto insts = m_session-> GetInstruments ();
347349 for (auto inst : insts)
348350 {
349351 auto scope = dynamic_pointer_cast<Oscilloscope>(inst);
@@ -472,7 +474,7 @@ bool FilterGraphEditor::DoRender()
472474 if (ftype)
473475 {
474476 string fname ((char *)ftype->Data , ftype->DataSize );
475- auto cat = m_session. GetReferenceFilter (fname)->GetCategory ();
477+ auto cat = m_session-> GetReferenceFilter (fname)->GetCategory ();
476478
477479 if (ftype->IsDelivery ())
478480 {
@@ -516,7 +518,7 @@ bool FilterGraphEditor::DoRender()
516518 DoNodeForGroup (it.first );
517519
518520 // Make nodes for all instrument channels
519- bool multiInst = (m_session. GetInstrumentCount () > 1 );
521+ bool multiInst = (m_session-> GetInstrumentCount () > 1 );
520522 auto chans = GetAllVisibleChannels ();
521523 for (auto it : chans)
522524 {
@@ -529,7 +531,7 @@ bool FilterGraphEditor::DoRender()
529531 ax::NodeEditor::SetNodePosition (newNode, ImGui::GetMousePos ());
530532
531533 // Make nodes for all triggers
532- auto insts = m_session. GetInstruments ();
534+ auto insts = m_session-> GetInstruments ();
533535 for (auto inst : insts)
534536 {
535537 auto scope = dynamic_pointer_cast<Oscilloscope>(inst);
@@ -545,7 +547,7 @@ bool FilterGraphEditor::DoRender()
545547
546548 // Filters
547549 auto filters = Filter::GetAllInstances ();
548- auto filterperf = m_session. GetFilterGraphRuntime ();
550+ auto filterperf = m_session-> GetFilterGraphRuntime ();
549551 for (auto f : filters)
550552 {
551553 DoNodeForChannel (f, nullptr , false , filterperf[f]);
@@ -556,7 +558,7 @@ bool FilterGraphEditor::DoRender()
556558 ClearOldPropertiesDialogs ();
557559
558560 // All nodes
559- auto nodes = m_session. GetAllGraphNodes ();
561+ auto nodes = m_session-> GetAllGraphNodes ();
560562
561563 // Add links within groups
562564 for (auto it : m_groups)
@@ -581,7 +583,7 @@ bool FilterGraphEditor::DoRender()
581583 }
582584
583585 // Add links from each trigger input to the stream it's fed by
584- auto & scopes = m_session. GetScopes ();
586+ auto & scopes = m_session-> GetScopes ();
585587 for (auto scope : scopes)
586588 {
587589 auto trig = scope->GetTrigger ();
@@ -678,7 +680,7 @@ ax::NodeEditor::NodeId FilterGraphEditor::GetID(FlowGraphNode* node)
678680 if (trig)
679681 return GetID (trig);
680682
681- return m_session. m_idtable .emplace (node);
683+ return m_session-> m_idtable .emplace (node);
682684}
683685
684686/* *
@@ -1399,7 +1401,7 @@ ax::NodeEditor::PinId FilterGraphEditor::CanonicalizePin(ax::NodeEditor::PinId p
13991401void FilterGraphEditor::HandleLinkCreationRequests (Filter*& fReconfigure )
14001402{
14011403 // for some reason node editor wants colors as vec4 not ImU32
1402- auto & prefs = m_session. GetPreferences ();
1404+ auto & prefs = m_session-> GetPreferences ();
14031405 auto validcolor = prefs.GetColorFloat4 (" Appearance.Filter Graph.valid_link_color" );
14041406 auto invalidcolor = prefs.GetColorFloat4 (" Appearance.Filter Graph.invalid_link_color" );
14051407
@@ -1630,7 +1632,7 @@ void FilterGraphEditor::CreateChannelMenu()
16301632 {
16311633 vector<StreamDescriptor> streams;
16321634
1633- auto & scopes = m_session. GetScopes ();
1635+ auto & scopes = m_session-> GetScopes ();
16341636 for (auto scope : scopes)
16351637 {
16361638 // Channels
@@ -1910,7 +1912,7 @@ void FilterGraphEditor::DoNodeForTrigger(Trigger* trig)
19101912{
19111913 // TODO: special color for triggers?
19121914 // Or use a preference?
1913- auto & prefs = m_session. GetPreferences ();
1915+ auto & prefs = m_session-> GetPreferences ();
19141916 auto tsize = ImGui::GetFontSize ();
19151917 auto color = ColorFromString (" #808080" );
19161918 auto id = GetID (trig);
@@ -1925,7 +1927,7 @@ void FilterGraphEditor::DoNodeForTrigger(Trigger* trig)
19251927 auto pos = ax::NodeEditor::GetNodePosition (id);
19261928 auto size = ax::NodeEditor::GetNodeSize (id);
19271929 string headerText = trig->GetTriggerDisplayName ();
1928- if (m_session. IsMultiScope ())
1930+ if (m_session-> IsMultiScope ())
19291931 headerText = trig->GetScope ()->m_nickname + " : " + headerText;
19301932
19311933 // Figure out how big the header text is and reserve space for it
@@ -2011,7 +2013,7 @@ void FilterGraphEditor::DoNodeForChannel(
20112013 if (displaycolor.empty ())
20122014 displaycolor = " #808080" ;
20132015
2014- auto & prefs = m_session. GetPreferences ();
2016+ auto & prefs = m_session-> GetPreferences ();
20152017 auto errorColor = prefs.GetColor (" Appearance.Filter Graph.error_outline_color" );
20162018
20172019 // Get some configuration / style settings
@@ -2403,7 +2405,7 @@ void FilterGraphEditor::HandleDoubleClicks()
24032405 return ;
24042406
24052407 // Spawn the appropriate dialog
2406- auto node = m_session. m_idtable .Lookup <FlowGraphNode*>(static_cast <uintptr_t >(id));
2408+ auto node = m_session-> m_idtable .Lookup <FlowGraphNode*>(static_cast <uintptr_t >(id));
24072409 auto trig = dynamic_cast <Trigger*>(node);
24082410 auto ochan = dynamic_cast <OscilloscopeChannel*>(node);
24092411 auto bo = dynamic_cast <BERTOutputChannel*>(node);
@@ -2450,7 +2452,7 @@ bool FilterGraphEditor::HandleNodeProperties()
24502452
24512453 else
24522454 {
2453- auto node = m_session. m_idtable .Lookup <FlowGraphNode*>(static_cast <uintptr_t >(id));
2455+ auto node = m_session-> m_idtable .Lookup <FlowGraphNode*>(static_cast <uintptr_t >(id));
24542456 auto trig = dynamic_cast <Trigger*>(node);
24552457 auto o = dynamic_cast <OscilloscopeChannel*>(node);
24562458 auto f = dynamic_cast <Filter*>(o);
@@ -2515,7 +2517,7 @@ bool FilterGraphEditor::HandleNodeProperties()
25152517
25162518 if (oldTrigger != newTrigger)
25172519 {
2518- m_session. m_idtable .replace (oldTrigger, newTrigger);
2520+ m_session-> m_idtable .replace (oldTrigger, newTrigger);
25192521 triggerChanged = true ;
25202522 }
25212523 }
@@ -2568,7 +2570,7 @@ void FilterGraphEditor::HandleBackgroundContextMenu()
25682570void FilterGraphEditor::DoAddMenu ()
25692571{
25702572 // Get all generation filters, sorted alphabetically
2571- auto & refs = m_session. GetReferenceFilters ();
2573+ auto & refs = m_session-> GetReferenceFilters ();
25722574 vector<string> sortedNames;
25732575 for (auto it : refs)
25742576 {
@@ -2652,11 +2654,11 @@ uintptr_t FilterGraphEditor::AllocateID()
26522654{
26532655 // Get next ID, if it's in use try the next one
26542656 uintptr_t id = m_nextID;
2655- while (m_session. m_idtable .HasID (id))
2657+ while (m_session-> m_idtable .HasID (id))
26562658 id++;
26572659
26582660 // Reserve the ID in the session table so nobody else will try to use it
2659- m_session. m_idtable .ReserveID (id);
2661+ m_session-> m_idtable .ReserveID (id);
26602662
26612663 // We now have an ID that is not in the table, so continue from there
26622664 m_nextID = id + 1 ;
0 commit comments