| 1840 | } |
| 1841 | |
| 1842 | bool AppFrame::actionOnMenuRig(wxCommandEvent &event) { |
| 1843 | |
| 1844 | bool bManaged = false; |
| 1845 | |
| 1846 | #ifdef USE_HAMLIB |
| 1847 | |
| 1848 | bool resetRig = false; |
| 1849 | if (event.GetId() >= wxID_RIG_MODEL_BASE && event.GetId() < wxID_RIG_MODEL_BASE + numRigs) { |
| 1850 | |
| 1851 | int rigIdx = event.GetId() - wxID_RIG_MODEL_BASE; |
| 1852 | |
| 1853 | RigList &rl = RigThread::enumerate(); |
| 1854 | rigModel = rl[rigIdx]->rig_model; |
| 1855 | |
| 1856 | if (devInfo != nullptr) { |
| 1857 | std::string deviceId = devInfo->getDeviceId(); |
| 1858 | DeviceConfig *devConfig = wxGetApp().getConfig()->getDevice(deviceId); |
| 1859 | |
| 1860 | rigSDRIF = devConfig->getRigIF(rigModel); |
| 1861 | if (rigSDRIF) { |
| 1862 | wxGetApp().lockFrequency(rigSDRIF); |
| 1863 | } else { |
| 1864 | wxGetApp().unlockFrequency(); |
| 1865 | } |
| 1866 | } else { |
| 1867 | wxGetApp().unlockFrequency(); |
| 1868 | } |
| 1869 | |
| 1870 | resetRig = true; |
| 1871 | bManaged = true; |
| 1872 | |
| 1873 | for (auto ri : rigModelMenuItems) { |
| 1874 | if (ri.second->IsChecked()) { |
| 1875 | ri.second->Check(false); |
| 1876 | } |
| 1877 | } |
| 1878 | |
| 1879 | rigModelMenuItems[rigModel]->Check(true); |
| 1880 | } |
| 1881 | |
| 1882 | int rigSerialIdMax = wxID_RIG_SERIAL_BASE + rigSerialRates.size(); |
| 1883 | |
| 1884 | if (event.GetId() >= wxID_RIG_SERIAL_BASE && event.GetId() < rigSerialIdMax) { |
| 1885 | int serialIdx = event.GetId() - wxID_RIG_SERIAL_BASE; |
| 1886 | rigSerialRate = rigSerialRates[serialIdx]; |
| 1887 | resetRig = true; |
| 1888 | bManaged = true; |
| 1889 | } |
| 1890 | |
| 1891 | if (event.GetId() == wxID_RIG_PORT) { |
| 1892 | if (rigPortDialog == nullptr) { |
| 1893 | rigPortDialog = new PortSelectorDialog(this, wxID_ANY, rigPort); |
| 1894 | rigPortDialog->ShowModal(); |
| 1895 | } |
| 1896 | } |
| 1897 | |
| 1898 | if (event.GetId() == wxID_RIG_TOGGLE) { |
| 1899 | resetRig = false; |
nothing calls this directly
no test coverage detected