kopia lustrzana https://gitlab.com/eliggett/wfview
Merge branch 'audio-enhance' into shuttle
commit
62eef7f0f4
|
@ -1665,6 +1665,9 @@ QByteArray rigCommander::getLANAddr()
|
|||
case model7850:
|
||||
payload.setRawData("\x1A\x05\x00\x62", 4);
|
||||
break;
|
||||
case model7700:
|
||||
payload.setRawData("\x1A\x05\x01\x92", 4);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1719,6 +1722,9 @@ QByteArray rigCommander::getACCAddr(unsigned char ab)
|
|||
payload.setRawData("\x1A\x05\x00\x59", 4);
|
||||
}
|
||||
break;
|
||||
case model7700:
|
||||
payload.setRawData("\x1A\x05\x00\x30", 4);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -2900,6 +2906,31 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.bands.push_back(bandGen);
|
||||
rigCaps.bsr[bandGen] = 0x11;
|
||||
rigCaps.modes = commonModes;
|
||||
break;
|
||||
case model7700:
|
||||
rigCaps.modelName = QString("IC-7700");
|
||||
rigCaps.hasSpectrum = false;
|
||||
rigCaps.inputs.append(inputLAN);
|
||||
//rigCaps.inputs.append(inputSPDIF);
|
||||
rigCaps.inputs.append(inputACC);
|
||||
rigCaps.hasLan = true;
|
||||
rigCaps.hasEthernet = true;
|
||||
rigCaps.hasWiFi = false;
|
||||
rigCaps.hasCTCSS = true;
|
||||
rigCaps.attenuators.insert(rigCaps.attenuators.end(),
|
||||
{'\x06', '\x12', '\x18'});
|
||||
rigCaps.preamps.push_back('\x01');
|
||||
rigCaps.preamps.push_back('\x02');
|
||||
rigCaps.hasAntennaSel = true;
|
||||
rigCaps.antennas = {0x00, 0x01, 0x02, 0x03}; // not sure if 0x03 works
|
||||
rigCaps.hasATU = true;
|
||||
rigCaps.bands = standardHF;
|
||||
rigCaps.bands.push_back(bandGen);
|
||||
rigCaps.bands.push_back(band630m);
|
||||
rigCaps.bands.push_back(band2200m);
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.modes.insert(rigCaps.modes.end(), {createMode(modePSK, 0x12, "PSK"),
|
||||
createMode(modePSK_R, 0x13, "PSK-R")});
|
||||
break;
|
||||
case model706:
|
||||
rigCaps.modelName = QString("IC-706");
|
||||
|
|
|
@ -836,6 +836,7 @@ void udpAudio::sendTxAudio()
|
|||
}
|
||||
QByteArray audio;
|
||||
txaudio->getNextAudioChunk(audio);
|
||||
|
||||
if (audio.length() > 0) {
|
||||
int counter = 1;
|
||||
int len = 0;
|
||||
|
|
|
@ -195,7 +195,7 @@ private:
|
|||
QThread* txAudioThread = Q_NULLPTR;
|
||||
|
||||
QTimer* txAudioTimer=Q_NULLPTR;
|
||||
bool enableTx = 1;
|
||||
bool enableTx = true;
|
||||
|
||||
};
|
||||
|
||||
|
|
75
wfmain.cpp
75
wfmain.cpp
|
@ -481,27 +481,6 @@ void wfmain::receiveFoundRigID(rigCapabilities rigCaps)
|
|||
//now we know what the rig ID is:
|
||||
//qInfo(logSystem()) << "In wfview, we now have a reply to our request for rig identity sent to CIV BROADCAST.";
|
||||
|
||||
// baud on the serial port reflects the actual rig connection,
|
||||
// even if a client-server connection is being used.
|
||||
// Computed time for a 10 byte message, with a safety factor of 2.
|
||||
unsigned int usPerByte = 9600*1000 / prefs.serialPortBaud;
|
||||
unsigned int msMinTiming=usPerByte * 10*2/1000;
|
||||
if(msMinTiming < 35)
|
||||
msMinTiming = 35;
|
||||
|
||||
delayedCommand->setInterval( msMinTiming * 2); // 20 byte message
|
||||
periodicPollingTimer->setInterval( msMinTiming ); // slower for s-meter poll
|
||||
|
||||
qInfo(logSystem()) << "Delay command interval timing: " << msMinTiming * 2 << "ms";
|
||||
qInfo(logSystem()) << "Periodic polling timer: " << msMinTiming << "ms";
|
||||
|
||||
// Normal:
|
||||
delayedCmdIntervalLAN_ms = msMinTiming * 2;
|
||||
delayedCmdIntervalSerial_ms = msMinTiming * 2;
|
||||
|
||||
// startup initial state:
|
||||
delayedCmdStartupInterval_ms = msMinTiming * 2;
|
||||
|
||||
if(rig->usingLAN())
|
||||
{
|
||||
usingLAN = true;
|
||||
|
@ -1144,16 +1123,8 @@ void wfmain::setDefPrefs()
|
|||
udpDefPrefs.audioLANPort = 50003;
|
||||
udpDefPrefs.username = QString("");
|
||||
udpDefPrefs.password = QString("");
|
||||
//udpDefPrefs.audioOutput = 0;
|
||||
//udpDefPrefs.audioInput = 0;
|
||||
//udpDefPrefs.audioRXLatency = 150;
|
||||
//udpDefPrefs.audioTXLatency = 150;
|
||||
//udpDefPrefs.audioRXSampleRate = 48000;
|
||||
//udpDefPrefs.audioRXCodec = 4;
|
||||
//udpDefPrefs.audioTXSampleRate = 48000;
|
||||
//udpDefPrefs.audioTXCodec = 4;
|
||||
//udpDefPrefs.resampleQuality = 4;
|
||||
udpDefPrefs.clientName = QHostInfo::localHostName();
|
||||
|
||||
}
|
||||
|
||||
void wfmain::loadSettings()
|
||||
|
@ -1230,11 +1201,15 @@ void wfmain::loadSettings()
|
|||
}
|
||||
|
||||
prefs.serialPortBaud = (quint32) settings->value("SerialPortBaud", defPrefs.serialPortBaud).toInt();
|
||||
|
||||
ui->baudRateCombo->blockSignals(true);
|
||||
ui->baudRateCombo->setCurrentIndex( ui->baudRateCombo->findData(prefs.serialPortBaud) );
|
||||
ui->baudRateCombo->blockSignals(false);
|
||||
|
||||
if (prefs.serialPortBaud > 0)
|
||||
{
|
||||
serverConfig.baudRate = prefs.serialPortBaud;
|
||||
}
|
||||
|
||||
prefs.virtualSerialPort = settings->value("VirtualSerialPort", defPrefs.virtualSerialPort).toString();
|
||||
int vspIndex = ui->vspCombo->findText(prefs.virtualSerialPort);
|
||||
if (vspIndex != -1) {
|
||||
|
@ -1383,7 +1358,6 @@ void wfmain::loadSettings()
|
|||
settings->endGroup();
|
||||
|
||||
settings->beginGroup("Server");
|
||||
|
||||
serverConfig.enabled = settings->value("ServerEnabled", false).toBool();
|
||||
serverConfig.controlPort = settings->value("ServerControlPort", 50001).toInt();
|
||||
serverConfig.civPort = settings->value("ServerCivPort", 50002).toInt();
|
||||
|
@ -4444,10 +4418,46 @@ void wfmain::receiveSpectrumSpan(freqt freqspan, bool isSub)
|
|||
}
|
||||
}
|
||||
|
||||
void wfmain::calculateTimingParameters()
|
||||
{
|
||||
// Function for calculating polling parameters.
|
||||
// Requires that we know the "baud rate" of the actual
|
||||
// radio connection.
|
||||
|
||||
// baud on the serial port reflects the actual rig connection,
|
||||
// even if a client-server connection is being used.
|
||||
// Computed time for a 10 byte message, with a safety factor of 2.
|
||||
|
||||
if (prefs.serialPortBaud == 0)
|
||||
{
|
||||
prefs.serialPortBaud = 9600;
|
||||
qInfo(logSystem()) << "WARNING: baud rate received was zero. Assuming 9600 baud, performance may suffer.";
|
||||
}
|
||||
|
||||
unsigned int usPerByte = 9600*1000 / prefs.serialPortBaud;
|
||||
unsigned int msMinTiming=usPerByte * 10*2/1000;
|
||||
if(msMinTiming < 35)
|
||||
msMinTiming = 35;
|
||||
|
||||
delayedCommand->setInterval( msMinTiming * 2); // 20 byte message
|
||||
periodicPollingTimer->setInterval( msMinTiming ); // slower for s-meter poll
|
||||
|
||||
qInfo(logSystem()) << "Delay command interval timing: " << msMinTiming * 2 << "ms";
|
||||
qInfo(logSystem()) << "Periodic polling timer: " << msMinTiming << "ms";
|
||||
|
||||
// Normal:
|
||||
delayedCmdIntervalLAN_ms = msMinTiming * 2;
|
||||
delayedCmdIntervalSerial_ms = msMinTiming * 2;
|
||||
|
||||
// startup initial state:
|
||||
delayedCmdStartupInterval_ms = msMinTiming * 2;
|
||||
}
|
||||
|
||||
void wfmain::receiveBaudRate(quint32 baud)
|
||||
{
|
||||
qInfo() << "Received serial port baud rate from remote server:" << baud;
|
||||
prefs.serialPortBaud = baud;
|
||||
calculateTimingParameters();
|
||||
}
|
||||
|
||||
void wfmain::on_rigPowerOnBtn_clicked()
|
||||
|
@ -4670,6 +4680,7 @@ void wfmain::on_baudRateCombo_activated(int index)
|
|||
if(ok)
|
||||
{
|
||||
prefs.serialPortBaud = baud;
|
||||
serverConfig.baudRate = baud;
|
||||
showStatusBarText(QString("Changed baud rate to %1 bps. Press Save Settings to retain.").arg(baud));
|
||||
}
|
||||
(void)index;
|
||||
|
|
2
wfmain.h
2
wfmain.h
|
@ -683,7 +683,7 @@ private:
|
|||
|
||||
void initPeriodicCommands();
|
||||
void insertPeriodicCommand(cmds cmd, unsigned char priority);
|
||||
|
||||
void calculateTimingParameters();
|
||||
|
||||
void changeMode(mode_kind mode);
|
||||
void changeMode(mode_kind mode, bool dataOn);
|
||||
|
|
|
@ -100,10 +100,9 @@ macx:LIBS += -framework CoreAudio -framework CoreFoundation -lhidapi -lpthread
|
|||
win32:LIBS += -L../hidapi/windows/release -lhidapi
|
||||
win32:INCLUDEPATH += ../hidapi/hidapi
|
||||
|
||||
#!linux:SOURCES += ../qcustomplot/qcustomplot.cpp rtaudio/RTAudio.cpp
|
||||
#!linux:HEADERS += ../qcustomplot/qcustomplot.h rtaudio/RTAUdio.h
|
||||
|
||||
!linux:SOURCES += ../qcustomplot/qcustomplot.cpp
|
||||
#win32:SOURCES += rtaudio/RTAudio.cpp
|
||||
#win32:HEADERS += rtaudio/RTAUdio.h
|
||||
!linux:SOURCES += ../qcustomplot/qcustomplot.cpp
|
||||
!linux:HEADERS += ../qcustomplot/qcustomplot.h
|
||||
|
||||
!linux:INCLUDEPATH += ../qcustomplot
|
||||
|
|
Ładowanie…
Reference in New Issue