MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / addPanadapter

Method addPanadapter

src/gui/PanadapterStack.cpp:91–124  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91PanadapterApplet* PanadapterStack::addPanadapter(const QString& panId)
92{
93 m_seenPanIds.insert(panId);
94
95 if (m_pans.contains(panId))
96 return m_pans[panId];
97
98 auto* applet = new PanadapterApplet(m_splitter);
99 applet->setPanId(panId);
100 applet->spectrumWidget()->setPanIndex(m_pans.size());
101 applet->spectrumWidget()->loadSettings();
102 m_splitter->addWidget(applet);
103
104 // Equal stretch for all pans
105 const int idx = m_splitter->indexOf(applet);
106 m_splitter->setStretchFactor(idx, 1);
107
108 m_pans[panId] = applet;
109
110 // First pan becomes active
111 if (m_activePanId.isEmpty())
112 setActivePan(panId);
113
114 // Update multi-pan mode decorations on all applets
115 bool multi = m_pans.size() > 1;
116 for (auto* a : m_pans)
117 a->setMultiPanMode(multi);
118
119 // Equalize sizes whenever a pan is added
120 if (multi)
121 equalizeSizes();
122
123 return applet;
124}
125
126void PanadapterStack::removePanadapter(const QString& panId)
127{

Callers 2

buildUIMethod · 0.80
wirePanLifecycleMethod · 0.80

Calls 8

containsMethod · 0.80
setPanIndexMethod · 0.80
spectrumWidgetMethod · 0.80
setMultiPanModeMethod · 0.80
setPanIdMethod · 0.45
sizeMethod · 0.45
loadSettingsMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected