kopia lustrzana https://gitlab.com/eliggett/wfview
Added serial ports to the settings widget.
rodzic
5720cc50f8
commit
e355c7763a
|
@ -589,6 +589,25 @@ void settingswidget::updateServerRXAudioInputs(QStringList deviceList, int curre
|
|||
haveServerAudioInputs = true;
|
||||
}
|
||||
|
||||
void settingswidget::updateSerialPortList(QStringList deviceList, QVector<int> data)
|
||||
{
|
||||
if(deviceList.length() == data.length())
|
||||
{
|
||||
ui->serialDeviceListCombo->blockSignals(true);
|
||||
ui->serialDeviceListCombo->addItem("Auto", 0);
|
||||
for(int i=0; i < deviceList.length(); i++)
|
||||
{
|
||||
ui->serialDeviceListCombo->addItem(deviceList.at(i), data.at(i));
|
||||
}
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_MAC) || defined(Q_OS_UNIX)
|
||||
ui->serialDeviceListCombo->addItem("Manual...", 256);
|
||||
#endif
|
||||
ui->serialDeviceListCombo->blockSignals(false);
|
||||
} else {
|
||||
qCritical(logGui()) << "Cannot populate serial device list. Data of unequal length.";
|
||||
}
|
||||
}
|
||||
|
||||
// Utility Functions:
|
||||
void settingswidget::updateUnderlayMode()
|
||||
{
|
||||
|
|
|
@ -50,6 +50,7 @@ public slots:
|
|||
void updateServerRXAudioInputs(QStringList deviceList, int currentIndex, int chars);
|
||||
void updateServerTXAudioOutputs(QStringList deviceList, int currentIndex, int chars);
|
||||
|
||||
void updateSerialPortList(QStringList deviceList, QVector<int> data);
|
||||
|
||||
signals:
|
||||
// Not sure if we should do it this way,
|
||||
|
|
|
@ -1452,6 +1452,9 @@ void wfmain::setUIToPrefs()
|
|||
|
||||
void wfmain::setSerialDevicesUI()
|
||||
{
|
||||
QStringList deviceList;
|
||||
QVector<int> deviceData;
|
||||
|
||||
ui->serialDeviceListCombo->blockSignals(true);
|
||||
ui->serialDeviceListCombo->addItem("Auto", 0);
|
||||
int i = 0;
|
||||
|
@ -1459,9 +1462,13 @@ void wfmain::setSerialDevicesUI()
|
|||
{
|
||||
portList.append(serialPortInfo.portName());
|
||||
#if defined(Q_OS_LINUX) || defined(Q_OS_MAC)
|
||||
deviceData.append(i);
|
||||
ui->serialDeviceListCombo->addItem(QString("/dev/") + serialPortInfo.portName(), i++);
|
||||
deviceList.append(QString("/dev/") + serialPortInfo.portName());
|
||||
#else
|
||||
ui->serialDeviceListCombo->addItem(serialPortInfo.portName(), i++);
|
||||
deviceList.append(serialPortInfo.portName());
|
||||
|
||||
//qInfo(logSystem()) << "Serial Port found: " << serialPortInfo.portName() << "Manufacturer:" << serialPortInfo.manufacturer() << "Product ID" << serialPortInfo.description() << "S/N" << serialPortInfo.serialNumber();
|
||||
#endif
|
||||
}
|
||||
|
@ -1470,6 +1477,8 @@ void wfmain::setSerialDevicesUI()
|
|||
#endif
|
||||
ui->serialDeviceListCombo->blockSignals(false);
|
||||
|
||||
setupui->updateSerialPortList(deviceList, deviceData);
|
||||
|
||||
ui->vspCombo->blockSignals(true);
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
|
|
Ładowanie…
Reference in New Issue