diff --git a/rigcommander.cpp b/rigcommander.cpp index 9d51cb7..cf113cb 100644 --- a/rigcommander.cpp +++ b/rigcommander.cpp @@ -959,6 +959,7 @@ void rigCommander::setCIVAddr(unsigned char civAddr) { // Note: This is the radio's CIV address // the computer's CIV address is defined in the header file. + // TODO: this function *could* be written to re-write the CIV preamble. this->civAddr = civAddr; } diff --git a/wfmain.cpp b/wfmain.cpp index 0d615b3..e1e79a7 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -786,7 +786,7 @@ void wfmain::receiveCommReady() { // tell rigCommander to broadcast a request for all rig IDs. // qInfo(logSystem()) << "Beginning search from wfview for rigCIV (auto-detection broadcast)"; - ui->statusBar->showMessage(QString("Searching CIV bus for connected radios."), 1000); + ui->statusBar->showMessage(QString("Searching CI-V bus for connected radios."), 1000); emit getRigCIV(); cmdOutQue.append(cmdGetRigCIV); delayedCommand->start(); @@ -794,10 +794,10 @@ void wfmain::receiveCommReady() // don't bother, they told us the CIV they want, stick with it. // We still query the rigID to find the model, but at least we know the CIV. qInfo(logSystem()) << "Skipping automatic CIV, using user-supplied value of " << prefs.radioCIVAddr; + showStatusBarText(QString("Using user-supplied radio CI-V address of 0x%1").arg(prefs.radioCIVAddr, 2, 16)); emit getRigID(); getInitialRigState(); } - } @@ -2144,6 +2144,9 @@ void wfmain::receiveRigID(rigCapabilities rigCaps) { return; } else { + + showStatusBarText(QString("Found radio at address 0x%1 of name %2 and model ID %3.").arg(rigCaps.civ,2,16).arg(rigCaps.modelName).arg(rigCaps.modelID)); + qDebug(logSystem()) << "Rig name: " << rigCaps.modelName; qDebug(logSystem()) << "Has LAN capabilities: " << rigCaps.hasLan; qDebug(logSystem()) << "Rig ID received into wfmain: spectLenMax: " << rigCaps.spectLenMax; @@ -4207,6 +4210,37 @@ void wfmain::setBandButtons() } } +void wfmain::on_rigCIVManualAddrChk_clicked(bool checked) +{ + if(checked) + { + ui->rigCIVaddrHexLine->setEnabled(true); + ui->rigCIVaddrHexLine->setText(QString("%1").arg(prefs.radioCIVAddr, 2, 16)); + } else { + ui->rigCIVaddrHexLine->setText("auto"); + ui->rigCIVaddrHexLine->setEnabled(false); + prefs.radioCIVAddr = 0; // auto + showStatusBarText("Setting radio CI-V address to: 'auto'. Make sure CI-V Transceive is enabled on the radio."); + } +} + +void wfmain::on_rigCIVaddrHexLine_editingFinished() +{ + bool okconvert=false; + + unsigned char propCIVAddr = (unsigned char) ui->rigCIVaddrHexLine->text().toUInt(&okconvert, 16); + + if(okconvert && (propCIVAddr < 0x7F) && (propCIVAddr != 0)) + { + prefs.radioCIVAddr = propCIVAddr; + showStatusBarText(QString("Setting radio CI-V address to: 0x%1. Press Save Settings to retain.").arg(propCIVAddr, 2, 16)); + } else { + showStatusBarText(QString("Could not use provided CI-V address.")); + } + +} + + // --- DEBUG FUNCTION --- void wfmain::on_debugBtn_clicked() { diff --git a/wfmain.h b/wfmain.h index aa89b55..ddcf223 100644 --- a/wfmain.h +++ b/wfmain.h @@ -436,6 +436,10 @@ private slots: void on_bandWFMbtn_clicked(); + void on_rigCIVManualAddrChk_clicked(bool checked); + + void on_rigCIVaddrHexLine_editingFinished(); + private: Ui::wfmain *ui; void closeEvent(QCloseEvent *event); diff --git a/wfmain.ui b/wfmain.ui index 1f0cbe5..96f2cec 100644 --- a/wfmain.ui +++ b/wfmain.ui @@ -18,7 +18,7 @@ - 0 + 3 @@ -2026,6 +2026,9 @@ + + <html><head/><body><p>Click here to adjust the frequency reference on the IC-9700.</p></body></html> + Adjust Reference @@ -2144,8 +2147,11 @@ + + <html><head/><body><p>Select this option if the rig is pluged into the computer using a USB cable or a serial connection. </p></body></html> + - Enable USB (serial) + Connect over USB (serial) radioConnectionSerialNetworkGrp @@ -2169,6 +2175,57 @@ + + + + <html><head/><body><p>Press here to set up the built-in rig server. The built-in server is intended to allow access over the network to a serial or USB-connected radio. </p></body></html> + + + Server Setup + + + + + + + <html><head/><body><p>If you are using an older (year 2010) radio, you may need to enable this option to manually specify the CI-V address. This option is also useful for radios that do not have CI-V Transceive enabled and thus will not answer our broadcast query for connected rigs on the CI-V bus.</p><p>If you have a modern radio with CI-V Transceive enabled, you should not need to check this box. </p></body></html> + + + Manual Radio CI-V Address: + + + + + + + false + + + + 50 + 0 + + + + + 50 + 16777215 + + + + <html><head/><body><p>Enter the address in as hexidecimal, without any prefix, just as the radio presents the address in the menu. </p><p>Here are some common examples:</p> +IC-706: 58 +<br/>IC-756: 6E +<br/>IC-7000: 70 +<br/>IC-7100: 88 +<br/>IC-7200: 76 +<p>This setting is typically needed for older radios and for radios that do not have CI-V Transceive enabled. </p></body></html> + + + auto + + + @@ -2188,8 +2245,11 @@ + + <html><head/><body><p>Connection to the radio is via network. </p><p>This means you are connecting to a radio with native ethernet or wifi, such as the IC-705, IC-7610, IC-7850, IC-R8600, or IC-9700</p><p>You should also select this option if you are connecting to another instance of wfview over a network. </p></body></html> + - Enable LAN + Connect over LAN radioConnectionSerialNetworkGrp @@ -2198,18 +2258,14 @@ + + Press here to initiate the network connection to the rig. + Connect - - - - Server Setup - - - @@ -2232,6 +2288,9 @@ + + <html><head/><body><p>Use this to define a virtual serial port. </p><p><br/></p><p>On Windows, the virtual serial port can be used to connect to a serial port loopback device, through which other programs can connect to the radio. </p><p><br/></p><p>On Linux and macOS, the port defined here is a pseudo-terminal device, which may be connected to directly by any program designed for a serial connection. </p></body></html> + Virtual Serial Port Selector @@ -2463,6 +2522,9 @@ + + <html><head/><body><p>This button runs debug functions, and is provided as a convenience for programmers. The functions executed are under:</p><p><span style=" color:#ffff55;">void</span><span style=" color:#55ff55;">wfmain</span><span style=" color:#aaaaaa;">::</span><span style=" font-weight:600;">on_debugBtn_clicked</span><span style=" color:#aaaaaa;">()</span></p><p>in wfmain.cpp.</p></body></html> + Debug