MCPcopy Create free account
hub / github.com/cjcliffe/CubicSDR / PortSelectorDialog

Method PortSelectorDialog

src/forms/Dialog/PortSelectorDialog.cpp:6–29  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include "CubicSDR.h"
5
6PortSelectorDialog::PortSelectorDialog( wxWindow* parent, wxWindowID id, const std::string& defaultPort ) : PortSelectorDialogBase(parent, id) {
7 comEnumerate();
8
9 int nPorts = comGetNoPorts();
10
11 if (!defaultPort.empty()) {
12 m_portList->Append(defaultPort);
13 }
14
15 for (int i = 0; i < nPorts; i++) {
16#ifdef WIN32
17 string portName(comGetPortName(i));
18#else
19 string portName(comGetInternalName(i));
20#endif
21 if (portName != defaultPort) {
22 m_portList->Append(portName);
23 }
24 }
25
26 comTerminate();
27
28 m_portSelection->SetValue(defaultPort);
29}
30
31void PortSelectorDialog::onListSelect( wxCommandEvent& /* event */ ) {
32 int pSelect = m_portList->GetSelection();

Callers

nothing calls this directly

Calls 7

comEnumerateFunction · 0.50
comGetNoPortsFunction · 0.50
comGetPortNameFunction · 0.50
comGetInternalNameFunction · 0.50
comTerminateFunction · 0.50
emptyMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected