Merge branch 'ui-enhance' into lan-alpha

merge-requests/4/head
Phil Taylor 2021-05-18 09:35:58 +01:00
commit 6074372e37
5 zmienionych plików z 129 dodań i 14 usunięć

Wyświetl plik

@ -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;
}
@ -2753,7 +2754,7 @@ void rigCommander::determineRigCaps()
rigCaps.hasATU = true;
rigCaps.hasCTCSS = true;
rigCaps.hasDTCS = true;
rigCaps.attenuators.push_back('\x20');
rigCaps.attenuators.push_back('\x12');
rigCaps.preamps.push_back('\x01');
rigCaps.bands = standardHF;
rigCaps.bands.insert(rigCaps.bands.end(), standardVU.begin(), standardVU.end());

Wyświetl plik

@ -319,4 +319,5 @@ private:
quint16 txSampleRates = 0;
};
#endif

Wyświetl plik

@ -175,11 +175,11 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, QWidget *parent
portList.append(serialPortInfo.portName());
#if defined(Q_OS_LINUX) || defined(Q_OS_MAC)
ui->serialDeviceListCombo->addItem(QString("/dev/")+serialPortInfo.portName(), i++);
ui->serialDeviceListCombo->addItem("Manual...", 256);
#else
ui->serialDeviceListCombo->addItem(serialPortInfo.portName(), i++);
#endif
}
ui->serialDeviceListCombo->addItem("Manual...", 256);
ui->serialDeviceListCombo->blockSignals(false);
ui->vspCombo->blockSignals(true);
@ -789,7 +789,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();
@ -797,10 +797,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();
}
}
@ -933,6 +933,17 @@ void wfmain::loadSettings()
// Radio and Comms: C-IV addr, port to use
settings.beginGroup("Radio");
prefs.radioCIVAddr = (unsigned char) settings.value("RigCIVuInt", defPrefs.radioCIVAddr).toInt();
if(prefs.radioCIVAddr!=0)
{
ui->rigCIVManualAddrChk->setChecked(true);
ui->rigCIVaddrHexLine->blockSignals(true);
ui->rigCIVaddrHexLine->setText(QString("%1").arg(prefs.radioCIVAddr, 2, 16));
ui->rigCIVaddrHexLine->setEnabled(true);
ui->rigCIVaddrHexLine->blockSignals(false);
} else {
ui->rigCIVManualAddrChk->setChecked(false);
ui->rigCIVaddrHexLine->setEnabled(false);
}
prefs.serialPortRadio = settings.value("SerialPortRadio", defPrefs.serialPortRadio).toString();
int serialIndex = ui->serialDeviceListCombo->findText(prefs.serialPortRadio);
if (serialIndex != -1) {
@ -2147,6 +2158,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;
@ -4210,6 +4224,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()
{

Wyświetl plik

@ -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);
@ -710,5 +714,7 @@ Q_DECLARE_METATYPE(struct audioPacket)
Q_DECLARE_METATYPE(enum rigInput)
Q_DECLARE_METATYPE(enum meterKind)
Q_DECLARE_METATYPE(enum spectrumMode)
Q_DECLARE_METATYPE(struct audioPacket)
#endif // WFMAIN_H

Wyświetl plik

@ -18,7 +18,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>0</number>
<number>3</number>
</property>
<widget class="QWidget" name="mainTab">
<attribute name="title">
@ -2026,6 +2026,9 @@
</property>
<item>
<widget class="QPushButton" name="adjRefBtn">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Click here to adjust the frequency reference on the IC-9700.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Adjust Reference</string>
</property>
@ -2144,8 +2147,11 @@
</property>
<item>
<widget class="QRadioButton" name="serialEnableBtn">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Select this option if the rig is pluged into the computer using a USB cable or a serial connection. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Enable USB (serial)</string>
<string>Connect over USB (serial)</string>
</property>
<attribute name="buttonGroup">
<string notr="true">radioConnectionSerialNetworkGrp</string>
@ -2169,6 +2175,57 @@
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="udpServerSetupBtn">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;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. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Server Setup</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="rigCIVManualAddrChk">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;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.&lt;/p&gt;&lt;p&gt;If you have a modern radio with CI-V Transceive enabled, you should not need to check this box. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Manual Radio CI-V Address:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="rigCIVaddrHexLine">
<property name="enabled">
<bool>false</bool>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Enter the address in as hexidecimal, without any prefix, just as the radio presents the address in the menu. &lt;/p&gt;&lt;p&gt;Here are some common examples:&lt;/p&gt;
IC-706: 58
&lt;br/&gt;IC-756: 6E
&lt;br/&gt;IC-7000: 70
&lt;br/&gt;IC-7100: 88
&lt;br/&gt;IC-7200: 76
&lt;p&gt;This setting is typically needed for older radios and for radios that do not have CI-V Transceive enabled. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>auto</string>
</property>
</widget>
</item>
<item>
<spacer name="tuneSpacer">
<property name="orientation">
@ -2188,8 +2245,11 @@
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QRadioButton" name="lanEnableBtn">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Connection to the radio is via network. &lt;/p&gt;&lt;p&gt;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&lt;/p&gt;&lt;p&gt;You should also select this option if you are connecting to another instance of wfview over a network. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Enable LAN</string>
<string>Connect over LAN</string>
</property>
<attribute name="buttonGroup">
<string notr="true">radioConnectionSerialNetworkGrp</string>
@ -2198,18 +2258,14 @@
</item>
<item>
<widget class="QPushButton" name="connectBtn">
<property name="toolTip">
<string>Press here to initiate the network connection to the rig. </string>
</property>
<property name="text">
<string>Connect</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="udpServerSetupBtn">
<property name="text">
<string>Server Setup</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_10">
<property name="orientation">
@ -2232,6 +2288,9 @@
</item>
<item>
<widget class="QComboBox" name="vspCombo">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Use this to define a virtual serial port. &lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;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. &lt;/p&gt;&lt;p&gt;&lt;br/&gt;&lt;/p&gt;&lt;p&gt;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. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="accessibleName">
<string>Virtual Serial Port Selector</string>
</property>
@ -2463,6 +2522,9 @@
</property>
<item>
<widget class="QPushButton" name="debugBtn">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This button runs debug functions, and is provided as a convenience for programmers. The functions executed are under:&lt;/p&gt;&lt;p&gt;&lt;span style=&quot; color:#ffff55;&quot;&gt;void&lt;/span&gt;&lt;span style=&quot; color:#55ff55;&quot;&gt;wfmain&lt;/span&gt;&lt;span style=&quot; color:#aaaaaa;&quot;&gt;::&lt;/span&gt;&lt;span style=&quot; font-weight:600;&quot;&gt;on_debugBtn_clicked&lt;/span&gt;&lt;span style=&quot; color:#aaaaaa;&quot;&gt;()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;in wfmain.cpp.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Debug</string>
</property>