| 4 | #include "CubicSDR.h" |
| 5 | |
| 6 | PortSelectorDialog::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 | |
| 31 | void PortSelectorDialog::onListSelect( wxCommandEvent& /* event */ ) { |
| 32 | int pSelect = m_portList->GetSelection(); |
nothing calls this directly
no test coverage detected