kopia lustrzana https://gitlab.com/eliggett/wfview
Merge branch 'master' into shuttle
commit
d9e839b6f2
81
CHANGELOG
81
CHANGELOG
|
@ -1,5 +1,86 @@
|
|||
# CHANGELOG
|
||||
|
||||
- 20221129
|
||||
|
||||
bumped 1.53
|
||||
|
||||
- 20221128
|
||||
|
||||
Add missing prefs
|
||||
Merge remote-tracking branch 'origin/pollprefs' into various-fixes
|
||||
Added some tooltips that nobody will notice.
|
||||
Added polling preferences and changed UI elements to radio buttons with
|
||||
spin box.
|
||||
Added program version number to the settings file. Currently it is merely
|
||||
written to and not used.
|
||||
Moved preferences to prefs.h, which should make it easier to add new
|
||||
preferences. Moved custom types (as it seemed useful here and there) to
|
||||
wfviewtypes.h. Let's use the wfviewtypes.h file for any kind of datatype
|
||||
which more than one module can make use of.
|
||||
Update some rig definitions to work with new band struct.
|
||||
|
||||
- 20221126
|
||||
|
||||
Merge branch 'master' into various-fixes
|
||||
Add some more commands
|
||||
|
||||
- 20221124
|
||||
|
||||
Fixed color preset zero issue.
|
||||
Fixed unusual set of conditions in which manual CI-V address would fail
|
||||
to identify the connected radio. The fix is to continually poll the RigID
|
||||
until one is received. Radios that don't support RigID will need to
|
||||
check both boxes in wfview (use rig as model number) to manually ID the
|
||||
radio.
|
||||
Fixed minor typo in debug text.
|
||||
Cleaned up rigidentities
|
||||
Fixed annoying indentation issue.
|
||||
Fixed broken RTS preference. Added preliminary (and untested) support
|
||||
for the IC-703, 737, 738, and 756.
|
||||
Fixed issue causing the current color preset to not be load (previously
|
||||
preset zero was always used).
|
||||
|
||||
- 20221101
|
||||
|
||||
added libs for suse builds; it also builds on leap 15.5
|
||||
|
||||
- 20221031
|
||||
|
||||
Fix passband warnings
|
||||
Add skimmer support (setting not saved)
|
||||
Key KEYSPD
|
||||
Add AR Cluster support
|
||||
Add more commands to rigctld
|
||||
|
||||
- 20221029
|
||||
|
||||
Make bandType a struct containing frequency and default SSB mode
|
||||
Remove spot display processing timer
|
||||
Silly error in setting default cluster
|
||||
|
||||
- 20221028
|
||||
|
||||
Send bye when disconnecting from cluster
|
||||
Add passband to rigctld and allow setting
|
||||
|
||||
- 20221025
|
||||
|
||||
combobox resizing fix
|
||||
|
||||
- 20221024
|
||||
|
||||
Stop it cutting off some devices
|
||||
|
||||
- 20221023
|
||||
|
||||
Resize according to boundingrect
|
||||
Resize based on font size
|
||||
Try new universal resize code
|
||||
|
||||
- 20221022
|
||||
|
||||
added qt xml dev lib for suse
|
||||
|
||||
|
||||
- 20221025
|
||||
|
||||
|
|
|
@ -78,7 +78,7 @@ install wfview on suse 15.3 & up, sles 15.x or tumbleweed; this was done on a cl
|
|||
we need to add packages to be able to build the stuff.
|
||||
|
||||
- sudo zypper in --type pattern devel_basis
|
||||
- sudo zypper in libQt5Widgets-devel libqt5-qtbase-common-devel libqt5-qtserialport-devel libQt5SerialPort5 qcustomplot-devel libqcustomplot2 libQt5PrintSupport-devel libqt5-qtmultimedia-devel lv2-devel libopus-devel eigen3-devel libQt5Xml-devel
|
||||
- sudo zypper in libQt5Widgets-devel libqt5-qtbase-common-devel libqt5-qtserialport-devel libQt5SerialPort5 qcustomplot-devel libqcustomplot2 libQt5PrintSupport-devel libqt5-qtmultimedia-devel lv2-devel libopus-devel eigen3-devel libQt5Xml-devel portaudio-devel rtaudio-devel
|
||||
|
||||
optional (mainly for development specifics): get and install qt5:
|
||||
|
||||
|
|
17
WHATSNEW
17
WHATSNEW
|
@ -18,12 +18,19 @@ The following highlights are in this 1.51-release ince v1.50:
|
|||
Remove logging of audio device realm
|
||||
+ 1.52 added cluster spotting including color picker suport
|
||||
optional SQLITE in memory for spots (disabled)
|
||||
|
||||
+ 1.xx modified band buttons to look more alike the layut on the rigs
|
||||
+ 1.53 modified band buttons to look more alike the layout on the rigs
|
||||
audio selction combobox shows full devicenames
|
||||
|
||||
|
||||
|
||||
Fixed color preset zero issue.
|
||||
Fixed unusual set of conditions in which manual CI-V address would fail
|
||||
to identify the connected radio.
|
||||
Fixed broken RTS preference. Added preliminary (and untested) support
|
||||
for the IC-703, 737, 738, and 756.
|
||||
added libs for suse builds; it also builds on leap 15.5
|
||||
Add skimmer support (setting not saved)
|
||||
Add AR Cluster support
|
||||
+1.54 Various wfserver fixes
|
||||
logging using termbin edge case fix
|
||||
|
||||
Notes:
|
||||
|
||||
- We know about high CPU usage on RPi.
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
#include <eigen3/Eigen/Eigen>
|
||||
#endif
|
||||
|
||||
enum audioType {qtAudio,portAudio,rtAudio};
|
||||
#include "wfviewtypes.h"
|
||||
|
||||
#include "resampler/speex_resampler.h"
|
||||
|
||||
|
|
103
cluster.cpp
103
cluster.cpp
|
@ -57,7 +57,7 @@ void dxClusterClient::enableTcp(bool enable)
|
|||
tcpEnable = enable;
|
||||
if (enable)
|
||||
{
|
||||
tcpRegex = QRegularExpression("^DX de ([a-z|A-Z|0-9|/]+):\\s+([0-9|.]+)\\s+([a-z|A-Z|0-9|/]+)+\\s+(.*)\\s+(\\d{4}Z)");
|
||||
tcpRegex = QRegularExpression("^DX de ([a-z-|A-Z|0-9|#|/]+):\\s+([0-9|.]+)\\s+([a-z|A-Z|0-9|/]+)+\\s+(.*)\\s+(\\d{4}Z)");
|
||||
|
||||
if (tcpSocket == Q_NULLPTR)
|
||||
{
|
||||
|
@ -72,11 +72,13 @@ void dxClusterClient::enableTcp(bool enable)
|
|||
tcpCleanupTimer->setInterval(1000 * 10); // Run once a minute
|
||||
connect(tcpCleanupTimer, SIGNAL(timeout()), this, SLOT(tcpCleanup()));
|
||||
tcpCleanupTimer->start();
|
||||
authenticated = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (tcpSocket != Q_NULLPTR)
|
||||
{
|
||||
sendTcpData(QString("bye\n"));
|
||||
qInfo(logCluster()) << "Disconnecting tcpSocket() on:" << tcpPort;
|
||||
if (tcpCleanupTimer != Q_NULLPTR)
|
||||
{
|
||||
|
@ -87,7 +89,6 @@ void dxClusterClient::enableTcp(bool enable)
|
|||
tcpSocket->disconnect();
|
||||
delete tcpSocket;
|
||||
tcpSocket = Q_NULLPTR;
|
||||
//emit deleteOldSpots(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -169,46 +170,53 @@ void dxClusterClient::tcpDataReceived()
|
|||
QString data = QString(tcpSocket->readAll());
|
||||
|
||||
emit sendOutput(data);
|
||||
if (data.contains("login:")) {
|
||||
sendTcpData(QString("%1\n").arg(tcpUserName));
|
||||
return;
|
||||
}
|
||||
if (data.contains("password:")) {
|
||||
sendTcpData(QString("%1\n").arg(tcpPassword));
|
||||
return;
|
||||
}
|
||||
|
||||
QRegularExpressionMatchIterator i = tcpRegex.globalMatch(data);
|
||||
while (i.hasNext()) {
|
||||
QRegularExpressionMatch match = i.next();
|
||||
if (match.hasMatch()) {
|
||||
spotData* data = new spotData();
|
||||
data->spottercall = match.captured(1);
|
||||
data->frequency = match.captured(2).toDouble() / 1000.0;
|
||||
data->dxcall = match.captured(3);
|
||||
data->comment = match.captured(4).trimmed();
|
||||
data->timestamp = QDateTime::currentDateTimeUtc();
|
||||
|
||||
#ifdef USESQL
|
||||
database db = database();
|
||||
db.query(QString("DELETE from spots where dxcall='%1'").arg(data->dxcall));
|
||||
QString query = QString("INSERT INTO spots(type,spottercall,frequency,dxcall,comment,timestamp) VALUES('%1','%2',%3,'%4','%5','%6')\n")
|
||||
.arg("TCP").arg(data->spottercall).arg(data->frequency).arg(data->dxcall).arg(data->comment).arg(data->timestamp.toString("yyyy-MM-dd hh:mm:ss"));
|
||||
db.query(query);
|
||||
#else
|
||||
bool found = false;
|
||||
QMap<QString, spotData*>::iterator spot = allSpots.find(data->dxcall);
|
||||
while (spot != allSpots.end() && spot.key() == data->dxcall && spot.value()->frequency == data->frequency) {
|
||||
found = true;
|
||||
++spot;
|
||||
}
|
||||
if (found == false) {
|
||||
allSpots.insert(data->dxcall, data);
|
||||
}
|
||||
#endif
|
||||
if (!authenticated) {
|
||||
if (data.contains("login:") || data.contains("call:") || data.contains("callsign:")) {
|
||||
sendTcpData(QString("%1\n").arg(tcpUserName));
|
||||
return;
|
||||
}
|
||||
if (data.contains("password:")) {
|
||||
sendTcpData(QString("%1\n").arg(tcpPassword));
|
||||
return;
|
||||
}
|
||||
if (data.contains("Hello")) {
|
||||
authenticated = true;
|
||||
enableSkimmerSpots(skimmerSpots);
|
||||
}
|
||||
}
|
||||
updateSpots();
|
||||
else {
|
||||
QRegularExpressionMatchIterator i = tcpRegex.globalMatch(data);
|
||||
while (i.hasNext()) {
|
||||
QRegularExpressionMatch match = i.next();
|
||||
if (match.hasMatch()) {
|
||||
spotData* data = new spotData();
|
||||
data->spottercall = match.captured(1);
|
||||
data->frequency = match.captured(2).toDouble() / 1000.0;
|
||||
data->dxcall = match.captured(3);
|
||||
data->comment = match.captured(4).trimmed();
|
||||
data->timestamp = QDateTime::currentDateTimeUtc();
|
||||
|
||||
#ifdef USESQL
|
||||
database db = database();
|
||||
db.query(QString("DELETE from spots where dxcall='%1'").arg(data->dxcall));
|
||||
QString query = QString("INSERT INTO spots(type,spottercall,frequency,dxcall,comment,timestamp) VALUES('%1','%2',%3,'%4','%5','%6')\n")
|
||||
.arg("TCP").arg(data->spottercall).arg(data->frequency).arg(data->dxcall).arg(data->comment).arg(data->timestamp.toString("yyyy-MM-dd hh:mm:ss"));
|
||||
db.query(query);
|
||||
#else
|
||||
bool found = false;
|
||||
QMap<QString, spotData*>::iterator spot = allSpots.find(data->dxcall);
|
||||
while (spot != allSpots.end() && spot.key() == data->dxcall && spot.value()->frequency == data->frequency) {
|
||||
found = true;
|
||||
++spot;
|
||||
}
|
||||
if (found == false) {
|
||||
allSpots.insert(data->dxcall, data);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
updateSpots();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -289,3 +297,18 @@ void dxClusterClient::updateSpots()
|
|||
#endif
|
||||
emit sendSpots(spots);
|
||||
}
|
||||
|
||||
void dxClusterClient::enableSkimmerSpots(bool enable)
|
||||
{
|
||||
skimmerSpots = enable;
|
||||
if (authenticated) {
|
||||
if (skimmerSpots) {
|
||||
sendTcpData(QString("Set Dx Filter Skimmer\n"));
|
||||
}
|
||||
else
|
||||
{
|
||||
sendTcpData(QString("Set Dx Filter Not Skimmer\n"));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,6 +72,7 @@ public slots:
|
|||
void setTcpTimeout(int p) { tcpTimeout = p; }
|
||||
void tcpCleanup();
|
||||
void freqRange(double low, double high);
|
||||
void enableSkimmerSpots(bool enable);
|
||||
|
||||
private:
|
||||
void sendTcpData(QString data);
|
||||
|
@ -99,6 +100,7 @@ private:
|
|||
double lowFreq;
|
||||
double highFreq;
|
||||
QMap<QString,spotData*> allSpots;
|
||||
bool skimmerSpots = false;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -84,10 +84,11 @@ void loggingWindow::handleDataFromLoggingHost()
|
|||
{
|
||||
clipboard->setText(URL);
|
||||
qInfo(logLogger()) << "Sent log to URL: " << URL;
|
||||
qInfo(logLogger()) << "This address already copied to the clipboard. Please paste this URL in to your support questions.";
|
||||
URLmsgBox.setText("Your log has been posted, and the URL has been copied to the clipboard.");
|
||||
URLmsgBox.setInformativeText("<b>" + URL + "</b>");
|
||||
URLmsgBox.exec();
|
||||
// For whatever reason, showing the message box hides this window.
|
||||
// For whatever reason, showing the message box hides https://termbin.com/ypxbthis window.
|
||||
this->show();
|
||||
this->raise();
|
||||
this->activateWindow();
|
||||
|
@ -124,6 +125,7 @@ void loggingWindow::handleLoggingHostError(QAbstractSocket::SocketError error)
|
|||
|
||||
default:
|
||||
qWarning(logLogger()) << "Error connecting to logging host. Check internet connection. Error code: " << error;
|
||||
ui->sendToPasteBtn->setDisabled(false);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
6
main.cpp
6
main.cpp
|
@ -155,7 +155,7 @@ int main(int argc, char *argv[])
|
|||
signal(SIGTERM, cleanup);
|
||||
signal(SIGKILL, cleanup);
|
||||
#endif
|
||||
w = new servermain(logFilename, settingsFile);
|
||||
w = new servermain(settingsFile, logFilename);
|
||||
#else
|
||||
a.setWheelScrollLines(1); // one line per wheel click
|
||||
wfmain w(settingsFile, logFilename, debugMode);
|
||||
|
@ -203,11 +203,7 @@ void messageHandler(QtMsgType type, const QMessageLogContext& context, const QSt
|
|||
}
|
||||
// Write to the output category of the message and the message itself
|
||||
out << context.category << ": " << msg << "\n";
|
||||
#ifdef BUILD_WFSERVER
|
||||
std::cout << QDateTime::currentDateTime().toString("yyyy-MM-dd hh:mm:ss.zzz ").toLocal8Bit().toStdString() << msg.toLocal8Bit().toStdString() << "\n";
|
||||
#endif
|
||||
text = out.readAll();
|
||||
out.flush(); // Clear the buffered data
|
||||
//mainwindow.handleLogText(test);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -224,7 +224,13 @@ void paHandler::setVolume(unsigned char volume)
|
|||
void paHandler::incomingAudio(audioPacket packet)
|
||||
{
|
||||
packet.volume = volume;
|
||||
emit sendToConverter(packet);
|
||||
if (Pa_IsStreamActive(audio) == 1) {
|
||||
emit sendToConverter(packet);
|
||||
}
|
||||
else
|
||||
{
|
||||
Pa_StartStream(audio);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -266,10 +272,17 @@ void paHandler::convertedOutput(audioPacket packet) {
|
|||
if (packet.data.size() > 0) {
|
||||
|
||||
if (Pa_IsStreamActive(audio) == 1) {
|
||||
PaError err = Pa_WriteStream(audio, (char*)packet.data.data(), packet.data.size() / sizeof(float) / outFormat.channelCount());
|
||||
if (currentLatency < (setup.latency+latencyAllowance)) {
|
||||
PaError err = Pa_WriteStream(audio, (char*)packet.data.data(), packet.data.size() / sizeof(float) / outFormat.channelCount());
|
||||
|
||||
if (err != paNoError) {
|
||||
qDebug(logAudio()) << (setup.isinput ? "Input" : "Output") << "Error writing audio!";
|
||||
if (err != paNoError) {
|
||||
qDebug(logAudio()) << (setup.isinput ? "Input" : "Output") << "Error writing audio!";
|
||||
}
|
||||
}
|
||||
else {
|
||||
qDebug(logAudio()) << (setup.isinput ? "Input" : "Output") << "Disgarding audio data as current latency" << currentLatency << "exceeds setup latency" << setup.latency;
|
||||
Pa_StopStream(audio);
|
||||
latencyAllowance++;
|
||||
}
|
||||
const PaStreamInfo* info = Pa_GetStreamInfo(audio);
|
||||
currentLatency = packet.time.msecsTo(QTime::currentTime()) + (info->outputLatency * 1000);
|
||||
|
@ -298,6 +311,8 @@ void paHandler::convertedInput(audioPacket packet)
|
|||
void paHandler::changeLatency(const quint16 newSize)
|
||||
{
|
||||
qInfo(logAudio()) << (setup.isinput ? "Input" : "Output") << "Changing latency to: " << newSize << " from " << setup.latency;
|
||||
setup.latency = newSize;
|
||||
latencyAllowance = 0;
|
||||
}
|
||||
|
||||
int paHandler::getLatency()
|
||||
|
|
|
@ -91,6 +91,7 @@ private:
|
|||
QThread* converterThread = Q_NULLPTR;
|
||||
bool isUnderrun = false;
|
||||
bool isOverrun = false;
|
||||
int latencyAllowance = 0;
|
||||
};
|
||||
|
||||
#endif // PAHANDLER_H
|
||||
|
|
|
@ -0,0 +1,53 @@
|
|||
#ifndef PREFS_H
|
||||
#define PREFS_H
|
||||
|
||||
#include <QString>
|
||||
|
||||
#include "wfviewtypes.h"
|
||||
|
||||
struct preferences {
|
||||
QString version;
|
||||
bool useFullScreen;
|
||||
bool useSystemTheme;
|
||||
bool drawPeaks;
|
||||
underlay_t underlayMode = underlayNone;
|
||||
int underlayBufferSize = 64;
|
||||
bool wfAntiAlias;
|
||||
bool wfInterpolate;
|
||||
QString stylesheetPath;
|
||||
unsigned char radioCIVAddr;
|
||||
bool CIVisRadioModel;
|
||||
bool forceRTSasPTT;
|
||||
QString serialPortRadio;
|
||||
quint32 serialPortBaud;
|
||||
int polling_ms;
|
||||
bool enablePTT;
|
||||
bool niceTS;
|
||||
bool enableLAN;
|
||||
bool enableRigCtlD;
|
||||
quint16 rigCtlPort;
|
||||
int currentColorPresetNumber = 0;
|
||||
QString virtualSerialPort;
|
||||
unsigned char localAFgain;
|
||||
unsigned int wflength;
|
||||
int wftheme;
|
||||
int plotFloor;
|
||||
int plotCeiling;
|
||||
bool confirmExit;
|
||||
bool confirmPowerOff;
|
||||
meterKind meter2Type;
|
||||
quint16 tcpPort;
|
||||
quint8 waterfallFormat;
|
||||
audioType audioSystem;
|
||||
bool clusterUdpEnable;
|
||||
bool clusterTcpEnable;
|
||||
int clusterUdpPort;
|
||||
QString clusterTcpServerName;
|
||||
QString clusterTcpUserName;
|
||||
QString clusterTcpPassword;
|
||||
int clusterTimeout;
|
||||
bool clickDragTuningEnable;
|
||||
bool clusterSkimmerSpotsEnable;
|
||||
};
|
||||
|
||||
#endif // PREFS_H
|
|
@ -19,7 +19,7 @@ QLedLabel::QLedLabel(QWidget* parent) :
|
|||
|
||||
void QLedLabel::setState(State state)
|
||||
{
|
||||
qInfo() << "setState" << state;
|
||||
qDebug() << "LED: setState" << state;
|
||||
switch (state) {
|
||||
case StateOk:
|
||||
setStyleSheet(greenSS);
|
||||
|
|
418
rigcommander.cpp
418
rigcommander.cpp
|
@ -760,11 +760,11 @@ void rigCommander::setMode(mode_info m)
|
|||
{
|
||||
QByteArray payload;
|
||||
|
||||
if(rigCaps.model==model706)
|
||||
if (rigCaps.model == model706)
|
||||
{
|
||||
m.filter = '\x01';
|
||||
}
|
||||
if(m.mk == modeWFM)
|
||||
if (m.mk == modeWFM)
|
||||
{
|
||||
m.filter = '\x01';
|
||||
}
|
||||
|
@ -872,6 +872,42 @@ void rigCommander::getDuplexMode()
|
|||
prepDataAndSend(payload);
|
||||
}
|
||||
|
||||
void rigCommander::setPassband(quint16 pass)
|
||||
{
|
||||
QByteArray payload;
|
||||
payload.setRawData("\x1A\x03", 2);
|
||||
|
||||
unsigned char calc;
|
||||
/*
|
||||
Mode Data Steps
|
||||
SSB/CW/RTTY/PSK 0 to 9 50 ~ 500 Hz (50 Hz)
|
||||
SSB/CW/PSK 10 to 40 600 Hz ~ 3.6 kHz (100 Hz)
|
||||
RTTY 10 to 31 600 ~ 2.7 kHz (100 Hz)
|
||||
AM 0 to 49 200 Hz ~ 10.0 kHz (200 Hz)
|
||||
*/
|
||||
if (state.getChar(MODE) == modeAM) { // AM 0-49
|
||||
|
||||
calc = quint16((pass / 200) - 1);
|
||||
}
|
||||
else if (pass >= 600 || pass <=3600) // SSB/CW/PSK 10-40 (10-31 for RTTY)
|
||||
{
|
||||
calc = quint16((pass / 100) + 4);
|
||||
}
|
||||
else { // SSB etc 0-9
|
||||
calc = quint16((pass / 50) - 1);
|
||||
}
|
||||
|
||||
qDebug() << "Setting rig passband" << pass << "Sending" << calc;
|
||||
|
||||
char tens = (calc / 10);
|
||||
char units = (calc - (10 * tens));
|
||||
|
||||
char b1 = (units) | (tens << 4);
|
||||
|
||||
payload.append(b1);
|
||||
prepDataAndSend(payload);
|
||||
}
|
||||
|
||||
void rigCommander::getPassband()
|
||||
{
|
||||
QByteArray payload;
|
||||
|
@ -1448,13 +1484,16 @@ void rigCommander::parseLevels()
|
|||
emit haveTPBFInner(level);
|
||||
else
|
||||
emit haveIFShift(level);
|
||||
state.set(PBTIN, level, false);
|
||||
break;
|
||||
case '\x08':
|
||||
// Twin BPF Outer
|
||||
emit haveTPBFOuter(level);
|
||||
state.set(PBTOUT, level, false);
|
||||
break;
|
||||
case '\x09':
|
||||
// CW Pitch - ignore for now
|
||||
state.set(CWPITCH, level, false);
|
||||
break;
|
||||
case '\x0A':
|
||||
// TX RF level
|
||||
|
@ -1468,9 +1507,11 @@ void rigCommander::parseLevels()
|
|||
break;
|
||||
case '\x0C':
|
||||
// CW Keying Speed - ignore for now
|
||||
state.set(KEYSPD, level, false);
|
||||
break;
|
||||
case '\x0D':
|
||||
// Notch filder setting - ignore for now
|
||||
state.set(NOTCHF, level, false);
|
||||
break;
|
||||
case '\x0E':
|
||||
// compressor level
|
||||
|
@ -1479,6 +1520,7 @@ void rigCommander::parseLevels()
|
|||
break;
|
||||
case '\x12':
|
||||
// NB level - ignore for now
|
||||
state.set(NB, level, false);
|
||||
break;
|
||||
case '\x15':
|
||||
// monitor level
|
||||
|
@ -2512,19 +2554,41 @@ void rigCommander::parseRegisters1A()
|
|||
switch(payloadIn[01])
|
||||
{
|
||||
case '\x00':
|
||||
{
|
||||
// Memory contents
|
||||
break;
|
||||
}
|
||||
case '\x01':
|
||||
{
|
||||
// band stacking register
|
||||
parseBandStackReg();
|
||||
break;
|
||||
}
|
||||
case '\x03':
|
||||
emit havePassband(bcdHexToUChar((quint8)payloadIn[2]));
|
||||
{
|
||||
quint16 calc;
|
||||
quint8 pass = bcdHexToUChar((quint8)payloadIn[2]);
|
||||
if (state.getChar(MODE) == modeAM) {
|
||||
calc = 200 + (pass * 200);
|
||||
}
|
||||
else if (pass <= 10)
|
||||
{
|
||||
calc = 50 + (pass * 50);
|
||||
}
|
||||
else {
|
||||
calc = 600 + ((pass - 10) * 100);
|
||||
}
|
||||
emit havePassband(calc);
|
||||
state.set(PASSBAND, calc, false);
|
||||
break;
|
||||
}
|
||||
case '\x04':
|
||||
{
|
||||
state.set(AGC, (quint8)payloadIn[2], false);
|
||||
break;
|
||||
}
|
||||
case '\x06':
|
||||
{
|
||||
// data mode
|
||||
// emit havedataMode( (bool) payloadIn[somebit])
|
||||
// index
|
||||
|
@ -2536,13 +2600,20 @@ void rigCommander::parseRegisters1A()
|
|||
emit haveDataMode((bool)payloadIn[03]);
|
||||
state.set(DATAMODE, (quint8)payloadIn[3], false);
|
||||
break;
|
||||
}
|
||||
case '\x07':
|
||||
{
|
||||
// IP+ status
|
||||
break;
|
||||
}
|
||||
case '\x09':
|
||||
{
|
||||
state.set(MUTEFUNC, (quint8)payloadIn[2], false);
|
||||
}
|
||||
default:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3023,12 +3094,35 @@ void rigCommander::determineRigCaps()
|
|||
std::vector <bandType> standardHF;
|
||||
std::vector <bandType> standardVU;
|
||||
|
||||
// Most commonly supported "HF" bands:
|
||||
standardHF = {band6m, band10m, band10m, band12m,
|
||||
band15m, band17m, band20m, band30m,
|
||||
band40m, band60m, band80m, band160m};
|
||||
bandType bandDef6m = bandType(band6m, 50000000, 54000000, modeUSB);
|
||||
bandType bandDef10m = bandType(band10m, 28000000, 29700000, modeUSB);
|
||||
bandType bandDef12m = bandType(band12m, 24890000, 24990000, modeUSB);
|
||||
bandType bandDef15m = bandType(band15m, 21000000, 21450000, modeUSB);
|
||||
bandType bandDef17m = bandType(band17m, 18068000, 18168000, modeUSB);
|
||||
bandType bandDef20m = bandType(band20m, 14000000, 14350000, modeUSB);
|
||||
bandType bandDef30m = bandType(band30m, 10100000, 10150000, modeLSB);
|
||||
bandType bandDef40m = bandType(band40m, 7000000, 7300000, modeLSB);
|
||||
bandType bandDef60m = bandType(band60m, 5250000, 5450000, modeLSB);
|
||||
bandType bandDef80m = bandType(band80m, 3500000, 4000000, modeLSB);
|
||||
bandType bandDef160m = bandType(band160m, 1800000, 2000000, modeLSB);
|
||||
bandType bandDef630m = bandType(band630m, 493000, 595000, modeLSB);
|
||||
bandType bandDef2200m = bandType(band2200m, 135000, 138000, modeLSB);
|
||||
bandType bandDef2m = bandType(band2m, 144000000, 148000000, modeUSB);
|
||||
bandType bandDef4m = bandType(band4m, 70000000, 70500000, modeUSB);
|
||||
bandType bandDef70cm = bandType(band70cm, 420000000, 450000000, modeUSB);
|
||||
bandType bandDef23cm = bandType(band23cm, 1240000000, 1400000000, modeUSB);
|
||||
|
||||
bandType bandDefAir(bandAir, 108000000, 137000000, modeAM);
|
||||
bandType bandDefWFM(bandWFM, 88000000, 108000000, modeWFM);
|
||||
bandType bandDefGen(bandGen, 10000, 30000000, modeAM);
|
||||
|
||||
|
||||
standardHF = { bandDef6m, bandDef10m, bandDef12m, bandDef15m, bandDef17m,
|
||||
bandDef20m, bandDef30m, bandDef40m, bandDef60m, bandDef80m, bandDef80m};
|
||||
|
||||
standardVU = { bandDef2m, bandDef70cm };
|
||||
|
||||
|
||||
standardVU = {band70cm, band2m};
|
||||
|
||||
std::vector <mode_info> commonModes;
|
||||
commonModes = { createMode(modeLSB, 0x00, "LSB"), createMode(modeUSB, 0x01, "USB"),
|
||||
|
@ -3129,10 +3223,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.preamps.push_back('\x01');
|
||||
rigCaps.preamps.push_back('\x02');
|
||||
rigCaps.bands = standardHF;
|
||||
rigCaps.bands.push_back(band4m);
|
||||
rigCaps.bands.push_back(bandGen);
|
||||
rigCaps.bands.push_back(band630m);
|
||||
rigCaps.bands.push_back(band2200m);
|
||||
rigCaps.bands.insert(rigCaps.bands.end(), { bandDef4m, bandDef630m, bandDef2200m, bandDefGen });
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x71");
|
||||
|
||||
|
@ -3163,7 +3254,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.antennas = {0x00, 0x01, 0x02};
|
||||
rigCaps.bands = standardHF;
|
||||
rigCaps.bands.insert(rigCaps.bands.end(), standardVU.begin(), standardVU.end());
|
||||
rigCaps.bands.insert(rigCaps.bands.end(), {band23cm, band4m, band630m, band2200m, bandGen});
|
||||
rigCaps.bands.insert(rigCaps.bands.end(), { bandDef23cm, bandDef4m, bandDef630m, bandDef2200m, bandDefGen });
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.modes.insert(rigCaps.modes.end(), {
|
||||
createMode(modeWFM, 0x06, "WFM"), createMode(modeS_AMD, 0x11, "S-AM (D)"),
|
||||
|
@ -3195,7 +3286,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.attenuators.push_back('\x10');
|
||||
rigCaps.preamps.push_back('\x01');
|
||||
rigCaps.bands = standardVU;
|
||||
rigCaps.bands.push_back(band23cm);
|
||||
rigCaps.bands.push_back(bandDef23cm);
|
||||
rigCaps.bsr[band23cm] = 0x03;
|
||||
rigCaps.bsr[band70cm] = 0x02;
|
||||
rigCaps.bsr[band2m] = 0x01;
|
||||
|
@ -3220,7 +3311,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.attenuators.insert(rigCaps.attenuators.end(),{ '\x10' , '\x20', '\x30'});
|
||||
rigCaps.preamps.push_back('\x01');
|
||||
rigCaps.bands = standardVU;
|
||||
rigCaps.bands.push_back(band23cm);
|
||||
rigCaps.bands.push_back(bandDef23cm);
|
||||
rigCaps.bsr[band23cm] = 0x03;
|
||||
rigCaps.bsr[band70cm] = 0x02;
|
||||
rigCaps.bsr[band2m] = 0x01;
|
||||
|
@ -3246,7 +3337,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.preamps.push_back('\x02');
|
||||
rigCaps.antennas = {0x00, 0x01};
|
||||
rigCaps.bands = standardHF;
|
||||
rigCaps.bands.push_back(bandGen);
|
||||
rigCaps.bands.push_back(bandDefGen);
|
||||
rigCaps.bsr[bandGen] = 0x11;
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.modes.insert(rigCaps.modes.end(), { createMode(modePSK, 0x12, "PSK"),
|
||||
|
@ -3279,9 +3370,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.antennas = {0x00, 0x01};
|
||||
rigCaps.hasATU = true;
|
||||
rigCaps.bands = standardHF;
|
||||
rigCaps.bands.push_back(bandGen);
|
||||
rigCaps.bands.push_back(band630m);
|
||||
rigCaps.bands.push_back(band2200m);
|
||||
rigCaps.bands.insert(rigCaps.bands.end(), { bandDef630m, bandDef2200m, bandDefGen });
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.modes.insert(rigCaps.modes.end(), { createMode(modePSK, 0x12, "PSK"),
|
||||
createMode(modePSK_R, 0x13, "PSK-R") });
|
||||
|
@ -3313,9 +3402,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.hasAntennaSel = true;
|
||||
rigCaps.antennas = {0x00, 0x01, 0x02, 0x03};
|
||||
rigCaps.bands = standardHF;
|
||||
rigCaps.bands.push_back(bandGen);
|
||||
rigCaps.bands.push_back(band630m);
|
||||
rigCaps.bands.push_back(band2200m);
|
||||
rigCaps.bands.insert(rigCaps.bands.end(), { bandDef630m, bandDef2200m, bandDefGen });
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.modes.insert(rigCaps.modes.end(), {createMode(modePSK, 0x12, "PSK"),
|
||||
createMode(modePSK_R, 0x13, "PSK-R")});
|
||||
|
@ -3345,16 +3432,12 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.preamps.push_back('\x02');
|
||||
rigCaps.bands = standardHF;
|
||||
rigCaps.bands.insert(rigCaps.bands.end(), standardVU.begin(), standardVU.end());
|
||||
rigCaps.bands.push_back(bandGen);
|
||||
rigCaps.bands.push_back(bandAir);
|
||||
rigCaps.bands.push_back(bandWFM);
|
||||
rigCaps.bands.insert(rigCaps.bands.end(), { bandDefAir, bandDefGen, bandDefWFM, bandDef630m, bandDef2200m });
|
||||
rigCaps.bsr[band70cm] = 0x14;
|
||||
rigCaps.bsr[band2m] = 0x13;
|
||||
rigCaps.bsr[bandAir] = 0x12;
|
||||
rigCaps.bsr[bandWFM] = 0x11;
|
||||
rigCaps.bsr[bandGen] = 0x15;
|
||||
rigCaps.bands.push_back(band630m);
|
||||
rigCaps.bands.push_back(band2200m);
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.modes.insert(rigCaps.modes.end(), {createMode(modeWFM, 0x06, "WFM"),
|
||||
createMode(modeDV, 0x17, "DV")});
|
||||
|
@ -3377,7 +3460,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.preamps.push_back('\x01');
|
||||
rigCaps.bands = standardHF;
|
||||
rigCaps.bands.insert(rigCaps.bands.end(), standardVU.begin(), standardVU.end());
|
||||
rigCaps.bands.push_back(bandGen);
|
||||
rigCaps.bands.push_back(bandDefGen);
|
||||
rigCaps.bsr[band2m] = 0x11;
|
||||
rigCaps.bsr[band70cm] = 0x12;
|
||||
rigCaps.bsr[bandGen] = 0x13;
|
||||
|
@ -3402,7 +3485,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.preamps.push_back('\x02');
|
||||
rigCaps.antennas = {0x00, 0x01};
|
||||
rigCaps.bands = standardHF;
|
||||
rigCaps.bands.push_back(bandGen);
|
||||
rigCaps.bands.push_back(bandDefGen);
|
||||
rigCaps.bsr[bandGen] = 0x11;
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x40");
|
||||
|
@ -3426,8 +3509,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.preamps.push_back('\x02');
|
||||
rigCaps.bands = standardHF;
|
||||
rigCaps.bands.insert(rigCaps.bands.end(), standardVU.begin(), standardVU.end());
|
||||
rigCaps.bands.push_back(band4m);
|
||||
rigCaps.bands.push_back(bandGen);
|
||||
rigCaps.bands.insert(rigCaps.bands.end(), { bandDef4m, bandDefGen});
|
||||
rigCaps.bsr[band2m] = 0x11;
|
||||
rigCaps.bsr[band70cm] = 0x12;
|
||||
rigCaps.bsr[bandGen] = 0x13;
|
||||
|
@ -3453,7 +3535,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.attenuators.push_back('\x20');
|
||||
rigCaps.preamps.push_back('\x01');
|
||||
rigCaps.bands = standardHF;
|
||||
rigCaps.bands.push_back(bandGen);
|
||||
rigCaps.bands.push_back(bandDefGen);
|
||||
rigCaps.bsr[bandGen] = 0x11;
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x03\x48");
|
||||
|
@ -3478,14 +3560,33 @@ void rigCommander::determineRigCaps()
|
|||
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.bands.insert(rigCaps.bands.end(), { bandDefGen, bandDef630m, bandDef2200m });
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.modes.insert(rigCaps.modes.end(), {createMode(modePSK, 0x12, "PSK"),
|
||||
createMode(modePSK_R, 0x13, "PSK-R")});
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x95");
|
||||
break;
|
||||
case model703:
|
||||
rigCaps.modelName = QString("IC-703");
|
||||
rigCaps.rigctlModel = 3055;
|
||||
rigCaps.hasSpectrum = false;
|
||||
rigCaps.inputs.clear();
|
||||
rigCaps.hasLan = false;
|
||||
rigCaps.hasEthernet = false;
|
||||
rigCaps.hasWiFi = false;
|
||||
rigCaps.hasFDcomms = false;
|
||||
rigCaps.hasATU = true;
|
||||
rigCaps.hasPTTCommand = false;
|
||||
rigCaps.useRTSforPTT = true;
|
||||
rigCaps.hasDataModes = false;
|
||||
rigCaps.attenuators.push_back('\x20');
|
||||
rigCaps.bands = standardHF;
|
||||
rigCaps.bands.insert(rigCaps.bands.end(), standardVU.begin(), standardVU.end());
|
||||
rigCaps.bands.push_back(bandDefGen);
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.modes.insert(rigCaps.modes.end(), createMode(modeWFM, 0x06, "WFM"));
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x00");
|
||||
break;
|
||||
case model706:
|
||||
rigCaps.modelName = QString("IC-706");
|
||||
rigCaps.rigctlModel = 3009;
|
||||
|
@ -3502,7 +3603,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.attenuators.push_back('\x20');
|
||||
rigCaps.bands = standardHF;
|
||||
rigCaps.bands.insert(rigCaps.bands.end(), standardVU.begin(), standardVU.end());
|
||||
rigCaps.bands.push_back(bandGen);
|
||||
rigCaps.bands.push_back(bandDefGen);
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.modes.insert(rigCaps.modes.end(), createMode(modeWFM, 0x06, "WFM"));
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x00");
|
||||
|
@ -3523,9 +3624,9 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.hasDataModes = false;
|
||||
rigCaps.attenuators.push_back('\x20');
|
||||
rigCaps.preamps.push_back('\x01');
|
||||
rigCaps.bands = {band10m, band10m, band12m,
|
||||
band15m, band17m, band20m, band30m,
|
||||
band40m, band60m, band80m, band160m, bandGen};
|
||||
rigCaps.bands = {bandDef10m, bandDef10m, bandDef12m,
|
||||
bandDef15m, bandDef17m, bandDef20m, bandDef30m,
|
||||
bandDef40m, bandDef60m, bandDef80m, bandDef160m, bandDefGen};
|
||||
rigCaps.modes = { createMode(modeLSB, 0x00, "LSB"), createMode(modeUSB, 0x01, "USB"),
|
||||
createMode(modeAM, 0x02, "AM"),
|
||||
createMode(modeCW, 0x03, "CW"), createMode(modeCW_R, 0x07, "CW-R"),
|
||||
|
@ -3546,7 +3647,48 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.hasPTTCommand = false;
|
||||
rigCaps.useRTSforPTT = true;
|
||||
rigCaps.hasDataModes = false;
|
||||
rigCaps.hasIFShift = true; // untested
|
||||
rigCaps.attenuators.push_back('\x20');
|
||||
rigCaps.preamps.push_back('\x01');
|
||||
rigCaps.bands = standardHF;
|
||||
rigCaps.modes = { createMode(modeLSB, 0x00, "LSB"), createMode(modeUSB, 0x01, "USB"),
|
||||
createMode(modeAM, 0x02, "AM"), createMode(modeFM, 0x05, "FM"),
|
||||
createMode(modeCW, 0x03, "CW"), createMode(modeCW_R, 0x07, "CW-R"),
|
||||
};
|
||||
break;
|
||||
case model737:
|
||||
rigCaps.modelName = QString("IC-737");
|
||||
rigCaps.rigctlModel = 3021;
|
||||
rigCaps.hasSpectrum = false;
|
||||
rigCaps.inputs.clear();
|
||||
rigCaps.hasLan = false;
|
||||
rigCaps.hasEthernet = false;
|
||||
rigCaps.hasWiFi = false;
|
||||
rigCaps.hasFDcomms = false;
|
||||
rigCaps.hasATU = false;
|
||||
rigCaps.hasPTTCommand = false;
|
||||
rigCaps.useRTSforPTT = true;
|
||||
rigCaps.hasDataModes = false;
|
||||
rigCaps.attenuators.push_back('\x20');
|
||||
rigCaps.preamps.push_back('\x01');
|
||||
rigCaps.bands = standardHF;
|
||||
rigCaps.modes = { createMode(modeLSB, 0x00, "LSB"), createMode(modeUSB, 0x01, "USB"),
|
||||
createMode(modeAM, 0x02, "AM"), createMode(modeFM, 0x05, "FM"),
|
||||
createMode(modeCW, 0x03, "CW"), createMode(modeCW_R, 0x07, "CW-R"),
|
||||
};
|
||||
break;
|
||||
case model738:
|
||||
rigCaps.modelName = QString("IC-738");
|
||||
rigCaps.rigctlModel = 3022;
|
||||
rigCaps.hasSpectrum = false;
|
||||
rigCaps.inputs.clear();
|
||||
rigCaps.hasLan = false;
|
||||
rigCaps.hasEthernet = false;
|
||||
rigCaps.hasWiFi = false;
|
||||
rigCaps.hasFDcomms = false;
|
||||
rigCaps.hasATU = false;
|
||||
rigCaps.hasPTTCommand = false;
|
||||
rigCaps.useRTSforPTT = true;
|
||||
rigCaps.hasDataModes = false;
|
||||
rigCaps.attenuators.push_back('\x20');
|
||||
rigCaps.preamps.push_back('\x01');
|
||||
rigCaps.bands = standardHF;
|
||||
|
@ -3577,12 +3719,32 @@ void rigCommander::determineRigCaps()
|
|||
// this incorrectly shows up as 2 and 3 in the drop down.
|
||||
rigCaps.antennas = {0x01, 0x02};
|
||||
rigCaps.bands = standardHF;
|
||||
rigCaps.bands.push_back(band2m);
|
||||
rigCaps.bands.push_back(bandGen);
|
||||
rigCaps.bands.push_back(bandDef2m);
|
||||
rigCaps.bands.push_back(bandDefGen);
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x00");
|
||||
break;
|
||||
case model756:
|
||||
rigCaps.modelName = QString("IC-756");
|
||||
rigCaps.rigctlModel = 3026;
|
||||
rigCaps.hasSpectrum = false;
|
||||
rigCaps.inputs.clear();
|
||||
rigCaps.hasLan = false;
|
||||
rigCaps.hasEthernet = false;
|
||||
rigCaps.hasWiFi = false;
|
||||
rigCaps.hasFDcomms = false;
|
||||
rigCaps.hasATU = true;
|
||||
rigCaps.hasTBPF = true;
|
||||
rigCaps.preamps.push_back('\x01');
|
||||
rigCaps.preamps.push_back('\x02');
|
||||
rigCaps.attenuators.insert(rigCaps.attenuators.end(),{ '\x06' , '\x12', '\x18'});
|
||||
rigCaps.antennas = {0x00, 0x01};
|
||||
rigCaps.bands = standardHF;
|
||||
rigCaps.bands.push_back(bandDefGen);
|
||||
rigCaps.bsr[bandGen] = 0x11;
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x00");
|
||||
break;
|
||||
|
||||
case model756pro:
|
||||
rigCaps.modelName = QString("IC-756 Pro");
|
||||
rigCaps.rigctlModel = 3027;
|
||||
|
@ -3599,7 +3761,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.attenuators.insert(rigCaps.attenuators.end(),{ '\x06' , '\x12', '\x18'});
|
||||
rigCaps.antennas = {0x00, 0x01};
|
||||
rigCaps.bands = standardHF;
|
||||
rigCaps.bands.push_back(bandGen);
|
||||
rigCaps.bands.push_back(bandDefGen);
|
||||
rigCaps.bsr[bandGen] = 0x11;
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x00");
|
||||
|
@ -3620,7 +3782,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.attenuators.insert(rigCaps.attenuators.end(),{ '\x06' , '\x12', '\x18'});
|
||||
rigCaps.antennas = {0x00, 0x01};
|
||||
rigCaps.bands = standardHF;
|
||||
rigCaps.bands.push_back(bandGen);
|
||||
rigCaps.bands.push_back(bandDefGen);
|
||||
rigCaps.bsr[bandGen] = 0x11;
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x00");
|
||||
|
@ -3641,7 +3803,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.attenuators.insert(rigCaps.attenuators.end(),{ '\x06' , '\x12', '\x18'});
|
||||
rigCaps.antennas = {0x00, 0x01};
|
||||
rigCaps.bands = standardHF;
|
||||
rigCaps.bands.push_back(bandGen);
|
||||
rigCaps.bands.push_back(bandDefGen);
|
||||
rigCaps.bsr[bandGen] = 0x11;
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x00");
|
||||
|
@ -3665,8 +3827,8 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.antennas = {0x00, 0x01};
|
||||
rigCaps.bands = standardHF;
|
||||
rigCaps.bands.insert(rigCaps.bands.end(), standardVU.begin(), standardVU.end());
|
||||
rigCaps.bands.push_back(band23cm);
|
||||
rigCaps.bands.push_back(bandGen);
|
||||
rigCaps.bands.push_back(bandDef23cm);
|
||||
rigCaps.bands.push_back(bandDefGen);
|
||||
rigCaps.bsr[band2m] = 0x11;
|
||||
rigCaps.bsr[band70cm] = 0x12;
|
||||
rigCaps.bsr[band23cm] = 0x13;
|
||||
|
@ -3692,7 +3854,7 @@ void rigCommander::determineRigCaps()
|
|||
rigCaps.attenuators.push_back('\x20');
|
||||
rigCaps.bands = standardHF;
|
||||
rigCaps.bands.insert(rigCaps.bands.end(), standardVU.begin(), standardVU.end());
|
||||
rigCaps.bands.insert(rigCaps.bands.end(), {band23cm, band4m, band630m, band2200m, bandGen});
|
||||
rigCaps.bands.insert(rigCaps.bands.end(), {bandDef23cm, bandDef4m, bandDef630m, bandDef2200m, bandDefGen});
|
||||
rigCaps.modes = commonModes;
|
||||
rigCaps.transceiveCommand = QByteArrayLiteral("\x1a\x05\x00\x00");
|
||||
qInfo(logRig()) << "Found unknown rig: 0x" << QString("%1").arg(rigCaps.modelID, 2, 16);
|
||||
|
@ -4084,9 +4246,88 @@ void rigCommander::parseMode()
|
|||
} else {
|
||||
filter = 0;
|
||||
}
|
||||
emit haveMode((unsigned char)payloadIn[01], filter);
|
||||
state.set(MODE,(unsigned char)payloadIn[01],false);
|
||||
state.set(FILTER,filter,false);
|
||||
unsigned char mode = (unsigned char)payloadIn[01];
|
||||
emit haveMode(mode, filter);
|
||||
state.set(MODE,mode,false);
|
||||
state.set(FILTER, filter, false);
|
||||
quint16 pass = 0;
|
||||
|
||||
if (!state.isValid(PASSBAND)) {
|
||||
|
||||
/* We haven't got a valid passband from the rig so we
|
||||
need to create a 'fake' one from default values
|
||||
This will be replaced with a valid one if we get it */
|
||||
|
||||
if (mode == 3 || mode == 7 || mode == 12 || mode == 17) {
|
||||
switch (filter) {
|
||||
case 1:
|
||||
pass=1200;
|
||||
break;
|
||||
case 2:
|
||||
pass=500;
|
||||
break;
|
||||
case 3:
|
||||
pass=250;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (mode == 4 || mode == 8)
|
||||
{
|
||||
switch (filter) {
|
||||
case 1:
|
||||
pass=2400;
|
||||
break;
|
||||
case 2:
|
||||
pass=500;
|
||||
break;
|
||||
case 3:
|
||||
pass=250;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (mode == 2)
|
||||
{
|
||||
switch (filter) {
|
||||
case 1:
|
||||
pass=9000;
|
||||
break;
|
||||
case 2:
|
||||
pass=6000;
|
||||
break;
|
||||
case 3:
|
||||
pass=3000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (mode == 5)
|
||||
{
|
||||
switch (filter) {
|
||||
case 1:
|
||||
pass=15000;
|
||||
break;
|
||||
case 2:
|
||||
pass=10000;
|
||||
break;
|
||||
case 3:
|
||||
pass=7000;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else { // SSB or unknown mode
|
||||
switch (filter) {
|
||||
case 1:
|
||||
pass=3000;
|
||||
break;
|
||||
case 2:
|
||||
pass=2400;
|
||||
break;
|
||||
case 3:
|
||||
pass=1800;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
state.set(PASSBAND, pass, false);
|
||||
}
|
||||
|
||||
|
||||
|
@ -4312,7 +4553,7 @@ void rigCommander::setRigID(unsigned char rigID)
|
|||
// It can be used for radios without Rig ID commands,
|
||||
// or to force a specific radio model
|
||||
|
||||
qInfo(logRig()) << "Sending rig ID to: (int)" << (int)rigID;
|
||||
qInfo(logRig()) << "Setting rig ID to: (int)" << (int)rigID;
|
||||
|
||||
|
||||
lookingForRig = true;
|
||||
|
@ -4433,11 +4674,17 @@ void rigCommander::stateUpdated()
|
|||
break;
|
||||
case MODE:
|
||||
case FILTER:
|
||||
if (i.value()._valid) {
|
||||
if (state.isValid(MODE) && state.isValid(FILTER)) {
|
||||
setMode(state.getChar(MODE), state.getChar(FILTER));
|
||||
}
|
||||
getMode();
|
||||
break;
|
||||
case PASSBAND:
|
||||
if (i.value()._valid && state.isValid(MODE)) {
|
||||
setPassband(state.getUInt16(PASSBAND));
|
||||
}
|
||||
getPassband();
|
||||
break;
|
||||
case DUPLEX:
|
||||
if (i.value()._valid) {
|
||||
setDuplexMode(state.getDuplex(DUPLEX));
|
||||
|
@ -4696,13 +4943,70 @@ void rigCommander::stateUpdated()
|
|||
break;
|
||||
case SATMODEFUNC:
|
||||
break;
|
||||
case NBLEVEL:
|
||||
break;
|
||||
case NBDEPTH:
|
||||
break;
|
||||
case NBWIDTH:
|
||||
break;
|
||||
case NRLEVEL:
|
||||
case NB:
|
||||
break;
|
||||
case NR: {
|
||||
if (i.value()._valid) {
|
||||
QByteArray payload("\x14\x06");
|
||||
payload.append(bcdEncodeInt(state.getChar(NR)));
|
||||
prepDataAndSend(payload);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case PBTIN: {
|
||||
if (i.value()._valid) {
|
||||
QByteArray payload("\x14\x07");
|
||||
payload.append(bcdEncodeInt(state.getChar(PBTIN)));
|
||||
prepDataAndSend(payload);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case PBTOUT: {
|
||||
if (i.value()._valid) {
|
||||
QByteArray payload("\x14\x08");
|
||||
payload.append(bcdEncodeInt(state.getChar(PBTOUT)));
|
||||
prepDataAndSend(payload);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case CWPITCH: {
|
||||
if (i.value()._valid) {
|
||||
QByteArray payload("\x14\x09");
|
||||
payload.append(bcdEncodeInt(state.getChar(CWPITCH)));
|
||||
prepDataAndSend(payload);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case KEYSPD: {
|
||||
if (i.value()._valid) {
|
||||
QByteArray payload("\x14\x0c");
|
||||
payload.append(bcdEncodeInt(state.getChar(KEYSPD)));
|
||||
prepDataAndSend(payload);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case NOTCHF: {
|
||||
if (i.value()._valid) {
|
||||
QByteArray payload("\x14\x0d");
|
||||
payload.append(bcdEncodeInt(state.getChar(NOTCHF)));
|
||||
prepDataAndSend(payload);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case IF: {
|
||||
if (i.value()._valid) {
|
||||
setIFShift(state.getChar(IF));
|
||||
}
|
||||
getIFShift();
|
||||
break;
|
||||
}
|
||||
case APF:
|
||||
break;
|
||||
case BAL:
|
||||
break;
|
||||
case RESUMEFUNC:
|
||||
break;
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <QMutexLocker>
|
||||
#include <QDebug>
|
||||
|
||||
|
||||
#include "wfviewtypes.h"
|
||||
#include "commhandler.h"
|
||||
#include "pttyhandler.h"
|
||||
#include "udphandler.h"
|
||||
|
@ -23,48 +23,6 @@
|
|||
// note: using a define because switch case doesn't even work with const unsigned char. Surprised me.
|
||||
#define compCivAddr 0xE1
|
||||
|
||||
enum meterKind {
|
||||
meterNone=0,
|
||||
meterS,
|
||||
meterCenter,
|
||||
meterSWR,
|
||||
meterPower,
|
||||
meterALC,
|
||||
meterComp,
|
||||
meterVoltage,
|
||||
meterCurrent,
|
||||
meterRxdB,
|
||||
meterTxMod,
|
||||
meterRxAudio,
|
||||
meterAudio,
|
||||
meterLatency
|
||||
};
|
||||
|
||||
enum spectrumMode {
|
||||
spectModeCenter=0x00,
|
||||
spectModeFixed=0x01,
|
||||
spectModeScrollC=0x02,
|
||||
spectModeScrollF=0x03,
|
||||
spectModeUnknown=0xff
|
||||
};
|
||||
|
||||
struct freqt {
|
||||
quint64 Hz;
|
||||
double MHzDouble;
|
||||
};
|
||||
|
||||
struct datekind {
|
||||
uint16_t year;
|
||||
unsigned char month;
|
||||
unsigned char day;
|
||||
};
|
||||
|
||||
struct timekind {
|
||||
unsigned char hours;
|
||||
unsigned char minutes;
|
||||
bool isMinus;
|
||||
};
|
||||
|
||||
class rigCommander : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -123,6 +81,7 @@ public slots:
|
|||
void getRitValue();
|
||||
void setRitValue(int ritValue);
|
||||
void setRitEnable(bool ritEnabled);
|
||||
void setPassband(quint16 pass);
|
||||
|
||||
// PTT, ATU, ATT, Antenna, and Preamp:
|
||||
void getPTT();
|
||||
|
@ -323,7 +282,7 @@ signals:
|
|||
void haveBandStackReg(freqt f, char mode, char filter, bool dataOn);
|
||||
void haveRitEnabled(bool ritEnabled);
|
||||
void haveRitFrequency(int ritHz);
|
||||
void havePassband(quint8 pass);
|
||||
void havePassband(quint16 pass);
|
||||
|
||||
// Repeater:
|
||||
void haveDuplexMode(duplexMode);
|
||||
|
|
506
rigctld.cpp
506
rigctld.cpp
|
@ -133,7 +133,7 @@ void rigCtlClient::socketReadyRead()
|
|||
char responseCode = 0;
|
||||
QStringList response;
|
||||
bool setCommand = false;
|
||||
//commands.chop(1); // Remove \n character
|
||||
//commands.chop(1); // Remove \n
|
||||
if (commands.endsWith('\r'))
|
||||
{
|
||||
commands.chop(1); // Remove \n character
|
||||
|
@ -144,7 +144,7 @@ void rigCtlClient::socketReadyRead()
|
|||
continue;
|
||||
}
|
||||
|
||||
//qDebug(logRigCtlD()) << sessionId << "command received" << commands;
|
||||
qDebug(logRigCtlD()) << sessionId << "RX:" << commands;
|
||||
|
||||
// We have a full line so process command.
|
||||
|
||||
|
@ -195,46 +195,90 @@ void rigCtlClient::socketReadyRead()
|
|||
}
|
||||
else if (command[0] == "dump_state")
|
||||
{
|
||||
// Currently send "fake" state information until I can work out what is required!
|
||||
response.append("1"); // rigctld protocol version
|
||||
quint64 modes = getRadioModes();
|
||||
|
||||
// rigctld protocol version
|
||||
response.append("1");
|
||||
// Radio model
|
||||
response.append(QString("%1").arg(rigCaps.rigctlModel));
|
||||
response.append("0"); // Print something
|
||||
bandType lastBand=(bandType)-1;
|
||||
// Print something (used to be ITU region)
|
||||
response.append("0");
|
||||
// Supported RX bands (startf,endf,modes,low_power,high_power,vfo,ant)
|
||||
quint32 lowFreq = 0;
|
||||
quint32 highFreq = 0;
|
||||
for (bandType band : rigCaps.bands)
|
||||
{
|
||||
if (band != lastBand)
|
||||
response.append(generateFreqRange(band));
|
||||
lastBand = band;
|
||||
if (lowFreq == 0 || band.lowFreq < lowFreq)
|
||||
lowFreq = band.lowFreq;
|
||||
if (band.highFreq > highFreq)
|
||||
highFreq = band.highFreq;
|
||||
}
|
||||
response.append(QString("%1.000000 %2.000000 0x%3 %4 %5 0x%6 0x%7").arg(lowFreq).arg(highFreq)
|
||||
.arg(modes, 0, 16).arg(-1).arg(-1).arg(0x16000000, 0, 16).arg(getAntennas(), 0, 16));
|
||||
response.append("0 0 0 0 0 0 0");
|
||||
|
||||
if (rigCaps.hasTransmit) {
|
||||
// Supported TX bands (startf,endf,modes,low_power,high_power,vfo,ant)
|
||||
for (bandType band : rigCaps.bands)
|
||||
{
|
||||
if (band != lastBand)
|
||||
response.append(generateFreqRange(band));
|
||||
lastBand = band;
|
||||
response.append(QString("%1.000000 %2.000000 0x%3 %4 %5 0x%6 0x%7").arg(band.lowFreq).arg(band.highFreq)
|
||||
.arg(modes, 0, 16).arg(2000).arg(100000).arg(0x16000000, 0, 16).arg(getAntennas(), 0, 16));
|
||||
}
|
||||
}
|
||||
response.append("0 0 0 0 0 0 0");
|
||||
|
||||
response.append(QString("0x%1 1").arg(getRadioModes(), 0, 16));
|
||||
response.append(QString("0x%1 10").arg(getRadioModes(), 0, 16));
|
||||
response.append(QString("0x%1 100").arg(getRadioModes(), 0, 16));
|
||||
response.append(QString("0x%1 1000").arg(getRadioModes(), 0, 16));
|
||||
response.append(QString("0x%1 2500").arg(getRadioModes(), 0, 16));
|
||||
response.append(QString("0x%1 5000").arg(getRadioModes(), 0, 16));
|
||||
response.append(QString("0x%1 6125").arg(getRadioModes(), 0, 16));
|
||||
response.append(QString("0x%1 8333").arg(getRadioModes(), 0, 16));
|
||||
response.append(QString("0x%1 10000").arg(getRadioModes(), 0, 16));
|
||||
response.append(QString("0x%1 12500").arg(getRadioModes(), 0, 16));
|
||||
response.append(QString("0x%1 25000").arg(getRadioModes(), 0, 16));
|
||||
response.append(QString("0x%1 100000").arg(getRadioModes(), 0, 16));
|
||||
response.append(QString("0x%1 250000").arg(getRadioModes(), 0, 16));
|
||||
response.append(QString("0x%1 1000000").arg(getRadioModes(), 0, 16));
|
||||
response.append(QString("0x%1 1").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 10").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 100").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 1000").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 2500").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 5000").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 6125").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 8333").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 10000").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 12500").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 25000").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 100000").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 250000").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 1000000").arg(modes, 0, 16));
|
||||
response.append("0 0");
|
||||
response.append(QString("0x%1 1200").arg(getRadioModes(), 0, 16));
|
||||
response.append(QString("0x%1 2400").arg(getRadioModes(), 0, 16));
|
||||
response.append(QString("0x%1 3000").arg(getRadioModes(), 0, 16));
|
||||
|
||||
modes = getRadioModes("SB");
|
||||
if (modes) {
|
||||
response.append(QString("0x%1 3000").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 2400").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 1800").arg(modes, 0, 16));
|
||||
}
|
||||
modes = getRadioModes("AM");
|
||||
if (modes) {
|
||||
response.append(QString("0x%1 9000").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 6000").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 3000").arg(modes, 0, 16));
|
||||
}
|
||||
modes = getRadioModes("CW");
|
||||
if (modes) {
|
||||
response.append(QString("0x%1 1200").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 500").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 200").arg(modes, 0, 16));
|
||||
}
|
||||
modes = getRadioModes("FM");
|
||||
if (modes) {
|
||||
response.append(QString("0x%1 15000").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 10000").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 7000").arg(modes, 0, 16));
|
||||
}
|
||||
modes = getRadioModes("RTTY");
|
||||
if (modes) {
|
||||
response.append(QString("0x%1 2400").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 500").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 250").arg(modes, 0, 16));
|
||||
}
|
||||
modes = getRadioModes("PSK");
|
||||
if (modes) {
|
||||
response.append(QString("0x%1 1200").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 500").arg(modes, 0, 16));
|
||||
response.append(QString("0x%1 250").arg(modes, 0, 16));
|
||||
}
|
||||
response.append("0 0");
|
||||
response.append("9900");
|
||||
response.append("9900");
|
||||
|
@ -242,7 +286,7 @@ void rigCtlClient::socketReadyRead()
|
|||
response.append("0");
|
||||
QString preamps="";
|
||||
if (rigCaps.hasPreamp) {
|
||||
for (unsigned char pre : rigCaps.preamps)
|
||||
for (quint8 pre : rigCaps.preamps)
|
||||
{
|
||||
if (pre == 0)
|
||||
continue;
|
||||
|
@ -258,7 +302,7 @@ void rigCtlClient::socketReadyRead()
|
|||
|
||||
QString attens = "";
|
||||
if (rigCaps.hasAttenuator) {
|
||||
for (unsigned char att : rigCaps.attenuators)
|
||||
for (quint8 att : rigCaps.attenuators)
|
||||
{
|
||||
if (att == 0)
|
||||
continue;
|
||||
|
@ -272,7 +316,6 @@ void rigCtlClient::socketReadyRead()
|
|||
}
|
||||
response.append(attens);
|
||||
|
||||
|
||||
response.append("0xffffffffffffffff");
|
||||
response.append("0xffffffffffffffff");
|
||||
response.append("0xffffffffffffffff");
|
||||
|
@ -280,23 +323,6 @@ void rigCtlClient::socketReadyRead()
|
|||
response.append("0xffffffffffffffff");
|
||||
response.append("0xffffffffffffffff");
|
||||
|
||||
/*
|
||||
response.append("0xffffffffffffffff");
|
||||
response.append("0xffffffffffffffff");
|
||||
response.append("0xfffffffff7ffffff");
|
||||
response.append("0xfffffff083ffffff");
|
||||
response.append("0xffffffffffffffff");
|
||||
response.append("0xffffffffffffffbf");
|
||||
*/
|
||||
|
||||
/*
|
||||
response.append("0x3effffff");
|
||||
response.append("0x3effffff");
|
||||
response.append("0x7fffffff");
|
||||
response.append("0x7fffffff");
|
||||
response.append("0x7fffffff");
|
||||
response.append("0x7fffffff");
|
||||
*/
|
||||
if (chkVfoEecuted) {
|
||||
response.append(QString("vfo_ops=0x%1").arg(255, 0, 16));
|
||||
response.append(QString("ptt_type=0x%1").arg(rigCaps.hasTransmit, 0, 16));
|
||||
|
@ -325,8 +351,8 @@ void rigCtlClient::socketReadyRead()
|
|||
response.append(resp);
|
||||
resp = "";
|
||||
response.append(QString("%1").arg(getMode(rigState->getChar(MODE), rigState->getBool(DATAMODE))));
|
||||
response.append(QString("%1").arg(getFilter(rigState->getChar(MODE), rigState->getChar(FILTER))));
|
||||
|
||||
response.append(QString("%1").arg(rigState->getUInt16(PASSBAND)));
|
||||
|
||||
if (rigState->getChar(CURRENTVFO) == 0) {
|
||||
resp.append("VFOA");
|
||||
}
|
||||
|
@ -357,7 +383,7 @@ void rigCtlClient::socketReadyRead()
|
|||
freqt freq;
|
||||
bool ok=false;
|
||||
double newFreq=0.0f;
|
||||
unsigned char vfo=0;
|
||||
quint8 vfo=0;
|
||||
if (command.length() == 2)
|
||||
{
|
||||
newFreq = command[1].toDouble(&ok);
|
||||
|
@ -375,10 +401,10 @@ void rigCtlClient::socketReadyRead()
|
|||
freq.Hz = static_cast<int>(newFreq);
|
||||
qDebug(logRigCtlD()) << QString("Set frequency: %1 (%2)").arg(freq.Hz).arg(command[1]);
|
||||
if (vfo == 0) {
|
||||
rigState->set(VFOAFREQ, freq.Hz,true);
|
||||
rigState->set(VFOAFREQ, (quint64)freq.Hz,true);
|
||||
}
|
||||
else {
|
||||
rigState->set(VFOBFREQ, freq.Hz,true);
|
||||
rigState->set(VFOBFREQ, (quint64)freq.Hz,true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -430,7 +456,7 @@ void rigCtlClient::socketReadyRead()
|
|||
}
|
||||
else if (command[0] == "v" || command[0] == "v\nv" || command[0] == "get_vfo")
|
||||
{
|
||||
QString resp;
|
||||
QString resp;
|
||||
if (longReply) {
|
||||
resp.append("VFO: ");
|
||||
}
|
||||
|
@ -438,15 +464,18 @@ void rigCtlClient::socketReadyRead()
|
|||
if (rigState->getChar(CURRENTVFO) == 0) {
|
||||
resp.append("VFOA");
|
||||
}
|
||||
else {
|
||||
else if (rigState->getChar(CURRENTVFO) == 1) {
|
||||
resp.append("VFOB");
|
||||
}
|
||||
else if (rigState->getChar(CURRENTVFO) == 2) {
|
||||
resp.append("MEM");
|
||||
}
|
||||
|
||||
response.append(resp);
|
||||
}
|
||||
else if (command.length() > 1 && (command[0] == "V" || command[0] == "set_vfo"))
|
||||
{
|
||||
setCommand = true;
|
||||
setCommand = true;
|
||||
if (command[1] == "?") {
|
||||
response.append("set_vfo: ?");
|
||||
response.append("VFOA");
|
||||
|
@ -455,16 +484,22 @@ void rigCtlClient::socketReadyRead()
|
|||
response.append("Main");
|
||||
response.append("MEM");
|
||||
}
|
||||
else if (command[1] == "VFOB" || command[1] == "Sub") {
|
||||
else if (command[1] == "VFOA" || command[1] == "Main")
|
||||
{
|
||||
rigState->set(CURRENTVFO, (quint8)0, true);
|
||||
}
|
||||
else if (command[1] == "VFOB" || command[1] == "Sub")
|
||||
{
|
||||
rigState->set(CURRENTVFO, (quint8)1, true);
|
||||
}
|
||||
else {
|
||||
rigState->set(CURRENTVFO, (quint8)0, true);
|
||||
else if (command[1] == "MEM")
|
||||
{
|
||||
rigState->set(CURRENTVFO, (quint8)2, true);
|
||||
}
|
||||
}
|
||||
else if (command[0] == "s" || command[0] == "get_split_vfo")
|
||||
{
|
||||
|
||||
|
||||
if (longReply) {
|
||||
response.append(QString("Split: %1").arg(rigState->getChar(DUPLEX)));
|
||||
}
|
||||
|
@ -519,7 +554,8 @@ void rigCtlClient::socketReadyRead()
|
|||
response.append(QString("Freq: %1").arg(rigState->getInt64(VFOAFREQ)));
|
||||
}
|
||||
response.append(QString("Mode: %1").arg(getMode(rigState->getChar(MODE), rigState->getBool(DATAMODE))));
|
||||
response.append(QString("Width: %1").arg(getFilter(rigState->getChar(MODE), rigState->getChar(FILTER))));
|
||||
response.append(QString("Width: %1").arg(rigState->getUInt16(PASSBAND)));
|
||||
|
||||
response.append(QString("Split: %1").arg(rigState->getDuplex(DUPLEX)));
|
||||
response.append(QString("SatMode: %1").arg(0)); // Need to get satmode
|
||||
}
|
||||
|
@ -531,7 +567,8 @@ void rigCtlClient::socketReadyRead()
|
|||
response.append(QString("%1").arg(rigState->getInt64(VFOAFREQ)));
|
||||
}
|
||||
response.append(QString("%1").arg(getMode(rigState->getChar(MODE), rigState->getBool(DATAMODE))));
|
||||
response.append(QString("%1").arg(getFilter(rigState->getChar(MODE), rigState->getChar(FILTER))));
|
||||
response.append(QString("%1").arg(rigState->getUInt16(PASSBAND)));
|
||||
|
||||
}
|
||||
}
|
||||
else if (command[0] == "i" || command[0] == "get_split_freq")
|
||||
|
@ -570,11 +607,11 @@ void rigCtlClient::socketReadyRead()
|
|||
{
|
||||
if (longReply) {
|
||||
response.append(QString("TX Mode: %1").arg(getMode(rigState->getChar(MODE), rigState->getBool(DATAMODE))));
|
||||
response.append(QString("TX Passband: %1").arg(getFilter(rigState->getChar(MODE), rigState->getChar(FILTER))));
|
||||
response.append(QString("TX Passband: %1").arg(rigState->getUInt16(PASSBAND)));
|
||||
}
|
||||
else {
|
||||
response.append(QString("%1").arg(getMode(rigState->getChar(MODE), rigState->getBool(DATAMODE))));
|
||||
response.append(QString("%1").arg(getFilter(rigState->getChar(MODE), rigState->getChar(FILTER))));
|
||||
response.append(QString("%1").arg(rigState->getUInt16(PASSBAND)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -582,58 +619,60 @@ void rigCtlClient::socketReadyRead()
|
|||
{
|
||||
if (longReply) {
|
||||
response.append(QString("TX Mode: %1").arg(getMode(rigState->getChar(MODE), rigState->getBool(DATAMODE))));
|
||||
response.append(QString("TX Passband: %1").arg(getFilter(rigState->getChar(MODE), rigState->getChar(FILTER))));
|
||||
response.append(QString("TX Passband: %1").arg(rigState->getUInt16(PASSBAND)));
|
||||
}
|
||||
else {
|
||||
response.append(QString("%1").arg(getMode(rigState->getChar(MODE), rigState->getBool(DATAMODE))));
|
||||
response.append(QString("%1").arg(getFilter(rigState->getChar(MODE), rigState->getChar(FILTER))));
|
||||
response.append(QString("%1").arg(rigState->getUInt16(PASSBAND)));
|
||||
}
|
||||
//qDebug(logRigCtlD()) << QString("get_mode: %1 passband: %2").arg(getMode(rigState->getChar(MODE), rigState->getBool(DATAMODE))).arg(rigState->getUInt16(PASSBAND));
|
||||
}
|
||||
else if (command[0] == "M" || command[0] == "set_mode")
|
||||
{
|
||||
// Set mode
|
||||
setCommand = true;
|
||||
int width = -1;
|
||||
quint8 width = 0;
|
||||
quint16 passband = 0;
|
||||
QString vfo = "VFOA";
|
||||
QString mode = "USB";
|
||||
if (command.length() == 3) {
|
||||
width = command[2].toInt();
|
||||
passband = command[2].toInt();
|
||||
mode = command[1];
|
||||
}
|
||||
else if (command.length() == 4) {
|
||||
width = command[3].toInt();
|
||||
passband = command[3].toInt();
|
||||
mode = command[2];
|
||||
vfo = command[1];
|
||||
}
|
||||
qDebug(logRigCtlD()) << "setting mode: VFO:" << vfo << getMode(mode) << mode << "width" << width;
|
||||
qDebug(logRigCtlD()) << "setting mode: VFO:" << vfo << getMode(mode) << mode << "passband" << passband << "command:" << commands;
|
||||
|
||||
if (width != -1 && width <= 1800)
|
||||
width = 2;
|
||||
else
|
||||
width = 1;
|
||||
|
||||
rigState->set(MODE,getMode(mode),true);
|
||||
rigState->set(FILTER,(quint8)width, true);
|
||||
if (mode.mid(0, 3) == "PKT") {
|
||||
rigState->set(DATAMODE, true, true);
|
||||
}
|
||||
else {
|
||||
rigState->set(DATAMODE, false, true);
|
||||
}
|
||||
|
||||
}
|
||||
else if (command[0] == "s" || command[0] == "get_split_vfo")
|
||||
{
|
||||
if (longReply) {
|
||||
response.append(QString("Split: 1"));
|
||||
response.append(QString("TX VFO: VFOB"));
|
||||
}
|
||||
else
|
||||
if (!mode.isEmpty())
|
||||
{
|
||||
response.append("1");
|
||||
response.append("VFOb");
|
||||
rigState->set(MODE, getMode(mode), true);
|
||||
if (mode.mid(0, 3) == "PKT") {
|
||||
rigState->set(DATAMODE, true, true);
|
||||
}
|
||||
else {
|
||||
rigState->set(DATAMODE, false, true);
|
||||
}
|
||||
}
|
||||
|
||||
if (passband > 0)
|
||||
{
|
||||
if (passband > 1800 && passband < 2700) {
|
||||
width = 1;
|
||||
}
|
||||
else if (passband <= 1800)
|
||||
{
|
||||
width = 2;
|
||||
}
|
||||
else if (passband >= 2700)
|
||||
{
|
||||
width = 0;
|
||||
}
|
||||
rigState->set(FILTER, width, true);
|
||||
rigState->set(PASSBAND, passband, true);
|
||||
}
|
||||
}
|
||||
else if (command[0] == "j" || command[0] == "get_rit")
|
||||
{
|
||||
|
@ -655,13 +694,13 @@ void rigCtlClient::socketReadyRead()
|
|||
|
||||
if (command.length() > 1) {
|
||||
if (longReply) {
|
||||
response.append(QString("AntCurr: %1").arg(getAntName((unsigned char)command[1].toInt())));
|
||||
response.append(QString("AntCurr: %1").arg(getAntName((quint8)command[1].toInt())));
|
||||
response.append(QString("Option: %1").arg(0));
|
||||
response.append(QString("AntTx: %1").arg(getAntName(rigState->getChar(ANTENNA))));
|
||||
response.append(QString("AntRx: %1").arg(getAntName(rigState->getChar(ANTENNA))));
|
||||
}
|
||||
else {
|
||||
response.append(QString("%1").arg(getAntName((unsigned char)command[1].toInt())));
|
||||
response.append(QString("%1").arg(getAntName((quint8)command[1].toInt())));
|
||||
response.append(QString("%1").arg(0));
|
||||
response.append(QString("%1").arg(getAntName(rigState->getChar(ANTENNA))));
|
||||
response.append(QString("%1").arg(getAntName(rigState->getChar(ANTENNA))));
|
||||
|
@ -740,6 +779,33 @@ void rigCtlClient::socketReadyRead()
|
|||
else if (command[1] == "ATT") {
|
||||
resp.append(QString("%1").arg(rigState->getChar(ATTENUATOR)));
|
||||
}
|
||||
else if (command[1] == "CWPITCH") {
|
||||
resp.append(QString("%1").arg(rigState->getInt16(CWPITCH)));
|
||||
}
|
||||
else if (command[1] == "NOTCHF") {
|
||||
resp.append(QString("%1").arg(rigState->getInt16(NOTCHF)));
|
||||
}
|
||||
else if (command[1] == "IF") {
|
||||
resp.append(QString("%1").arg(rigState->getInt16(IF)));
|
||||
}
|
||||
else if (command[1] == "PBT_IN") {
|
||||
resp.append(QString("%1").arg((float)rigState->getChar(PBTIN) / 255.0));
|
||||
}
|
||||
else if (command[1] == "PBT_OUT") {
|
||||
resp.append(QString("%1").arg((float)rigState->getChar(PBTOUT) / 255.0));
|
||||
}
|
||||
else if (command[1] == "APF") {
|
||||
resp.append(QString("%1").arg((float)rigState->getChar(APF) / 255.0));
|
||||
}
|
||||
else if (command[1] == "NR") {
|
||||
resp.append(QString("%1").arg((float)rigState->getChar(NR) / 255.0));
|
||||
}
|
||||
else if (command[1] == "BAL") {
|
||||
resp.append(QString("%1").arg((float)rigState->getChar(BAL) / 255.0));
|
||||
}
|
||||
else if (command[1] == "KEYSPD") {
|
||||
resp.append(QString("%1").arg(rigState->getChar(KEYSPD)/5.1));
|
||||
}
|
||||
else {
|
||||
resp.append(QString("%1").arg(value));
|
||||
}
|
||||
|
@ -748,55 +814,91 @@ void rigCtlClient::socketReadyRead()
|
|||
}
|
||||
else if (command.length() > 2 && (command[0] == "L" || command[0] == "set_level"))
|
||||
{
|
||||
unsigned char value=0;
|
||||
int value=0;
|
||||
setCommand = true;
|
||||
if (command[1] == "AF") {
|
||||
value = command[2].toFloat() * 255;
|
||||
rigState->set(AFGAIN, value, true);
|
||||
rigState->set(AFGAIN, quint8(value), true);
|
||||
}
|
||||
else if (command[1] == "RF") {
|
||||
value = command[2].toFloat() * 255;
|
||||
rigState->set(RFGAIN, value, true);
|
||||
rigState->set(RFGAIN, quint8(value), true);
|
||||
}
|
||||
else if (command[1] == "RFPOWER") {
|
||||
value = command[2].toFloat() * 255;
|
||||
rigState->set(RFPOWER, value, true);
|
||||
value = command[2].toFloat() * 255;
|
||||
rigState->set(RFPOWER, quint8(value), true);
|
||||
}
|
||||
else if (command[1] == "SQL") {
|
||||
value = command[2].toFloat() * 255;
|
||||
rigState->set(SQUELCH, value, true);
|
||||
rigState->set(SQUELCH, quint8(value), true);
|
||||
}
|
||||
else if (command[1] == "COMP") {
|
||||
value = command[2].toFloat() * 255;
|
||||
rigState->set(COMPLEVEL, value, true);
|
||||
rigState->set(COMPLEVEL, quint8(value), true);
|
||||
}
|
||||
else if (command[1] == "MICGAIN") {
|
||||
value = command[2].toFloat() * 255;
|
||||
rigState->set(MICGAIN, value, true);
|
||||
rigState->set(MICGAIN, quint8(value), true);
|
||||
}
|
||||
else if (command[1] == "MON") {
|
||||
value = command[2].toFloat() * 255;
|
||||
rigState->set(MONITORLEVEL, value, true);
|
||||
rigState->set(MONITORLEVEL, quint8(value), true);
|
||||
}
|
||||
else if (command[1] == "VOXGAIN") {
|
||||
value = command[2].toFloat() * 255;
|
||||
rigState->set(VOXGAIN, value, true);
|
||||
rigState->set(VOXGAIN, quint8(value), true);
|
||||
}
|
||||
else if (command[1] == "ANTIVOX") {
|
||||
value = command[2].toFloat() * 255;
|
||||
rigState->set(ANTIVOXGAIN, value, true);
|
||||
rigState->set(ANTIVOXGAIN, quint8(value), true);
|
||||
}
|
||||
else if (command[1] == "ATT") {
|
||||
value = command[2].toInt();
|
||||
rigState->set(ATTENUATOR, value, true);
|
||||
rigState->set(ATTENUATOR, quint8(value), true);
|
||||
}
|
||||
else if (command[1] == "PREAMP") {
|
||||
value = command[2].toFloat() / 10;
|
||||
rigState->set(PREAMP, value, true);
|
||||
rigState->set(PREAMP, quint8(value), true);
|
||||
}
|
||||
else if (command[1] == "AGC") {
|
||||
value = command[2].toInt();;
|
||||
rigState->set(AGC, value, true);
|
||||
value = command[2].toFloat() * 255;
|
||||
rigState->set(AGC, quint8(value), true);
|
||||
}
|
||||
else if (command[1] == "CWPITCH") {
|
||||
value = command[2].toInt();
|
||||
rigState->set(CWPITCH, value, true);
|
||||
}
|
||||
else if (command[1] == "NOTCHF") {
|
||||
value = command[2].toInt();
|
||||
rigState->set(NOTCHF, value, true);
|
||||
}
|
||||
else if (command[1] == "IF") {
|
||||
value = command[2].toInt();
|
||||
rigState->set(IF, qint16(value), true);
|
||||
}
|
||||
else if (command[1] == "PBT_IN") {
|
||||
value = command[2].toFloat() * 255;
|
||||
rigState->set(PBTIN, quint8(value), true);
|
||||
}
|
||||
else if (command[1] == "PBT_OUT") {
|
||||
value = command[2].toFloat() * 255;
|
||||
rigState->set(PBTOUT, quint8(value), true);
|
||||
}
|
||||
else if (command[1] == "APF") {
|
||||
value = command[2].toFloat() * 255;
|
||||
rigState->set(APF, quint8(value), true);
|
||||
}
|
||||
else if (command[1] == "NR") {
|
||||
value = command[2].toFloat() * 255;
|
||||
rigState->set(NR, quint8(value), true);
|
||||
}
|
||||
else if (command[1] == "BAL") {
|
||||
value = command[2].toFloat() * 255;
|
||||
rigState->set(BAL, quint8(value), true);
|
||||
}
|
||||
else if (command[1] == "KEYSPD") {
|
||||
value = command[2].toInt() * 5.1;
|
||||
rigState->set(KEYSPD, quint8(value), true);
|
||||
}
|
||||
|
||||
qInfo(logRigCtlD()) << "Setting:" << command[1] << command[2] << value;
|
||||
|
@ -1153,7 +1255,7 @@ void rigCtlClient::closeSocket()
|
|||
|
||||
void rigCtlClient::sendData(QString data)
|
||||
{
|
||||
//qDebug(logRigCtlD()) << "Sending:" << data;
|
||||
//qDebug(logRigCtlD()) << sessionId << "TX:" << data;
|
||||
if (socket != Q_NULLPTR && socket->isValid() && socket->isOpen())
|
||||
{
|
||||
socket->write(data.toLatin1());
|
||||
|
@ -1164,8 +1266,7 @@ void rigCtlClient::sendData(QString data)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
QString rigCtlClient::getFilter(unsigned char mode, unsigned char filter) {
|
||||
QString rigCtlClient::getFilter(quint8 mode, quint8 filter) {
|
||||
|
||||
if (mode == 3 || mode == 7 || mode == 12 || mode == 17) {
|
||||
switch (filter) {
|
||||
|
@ -1223,51 +1324,52 @@ QString rigCtlClient::getFilter(unsigned char mode, unsigned char filter) {
|
|||
return QString("");
|
||||
}
|
||||
|
||||
QString rigCtlClient::getMode(unsigned char mode, bool datamode) {
|
||||
QString rigCtlClient::getMode(quint8 mode, bool datamode) {
|
||||
|
||||
QString ret;
|
||||
|
||||
|
||||
switch (mode) {
|
||||
case 0:
|
||||
case modeLSB:
|
||||
if (datamode) { ret = "PKT"; }
|
||||
ret.append("LSB");
|
||||
break;
|
||||
case 1:
|
||||
case modeUSB:
|
||||
if (datamode) { ret = "PKT"; }
|
||||
ret.append("USB");
|
||||
break;
|
||||
case 2:
|
||||
case modeAM:
|
||||
if (datamode) { ret = "PKT"; }
|
||||
ret.append("AM");
|
||||
break;
|
||||
case 3:
|
||||
case modeCW:
|
||||
ret.append("CW");
|
||||
break;
|
||||
case 4:
|
||||
case modeRTTY:
|
||||
ret.append("RTTY");
|
||||
break;
|
||||
case 5:
|
||||
case modeFM:
|
||||
if (datamode) { ret = "PKT"; }
|
||||
ret.append("FM");
|
||||
break;
|
||||
case 6:
|
||||
case modeWFM:
|
||||
ret.append("WFM");
|
||||
break;
|
||||
case 7:
|
||||
case modeCW_R:
|
||||
ret.append("CWR");
|
||||
break;
|
||||
case 8:
|
||||
case modeRTTY_R:
|
||||
ret.append("RTTYR");
|
||||
break;
|
||||
case 12:
|
||||
case modePSK:
|
||||
if (datamode) { ret = "PKT"; }
|
||||
ret.append("USB");
|
||||
break;
|
||||
case 17:
|
||||
case modeDV:
|
||||
if (datamode) { ret = "PKT"; }
|
||||
ret.append("LSB");
|
||||
break;
|
||||
case 22:
|
||||
case 22: // We don't seem to have a mode for this?
|
||||
if (datamode) { ret = "PKT"; }
|
||||
ret.append("FM");
|
||||
break;
|
||||
|
@ -1275,7 +1377,7 @@ QString rigCtlClient::getMode(unsigned char mode, bool datamode) {
|
|||
return ret;
|
||||
}
|
||||
|
||||
unsigned char rigCtlClient::getMode(QString modeString) {
|
||||
quint8 rigCtlClient::getMode(QString modeString) {
|
||||
|
||||
if (modeString == QString("LSB")) {
|
||||
return 0;
|
||||
|
@ -1319,140 +1421,48 @@ unsigned char rigCtlClient::getMode(QString modeString) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
QString rigCtlClient::generateFreqRange(bandType band)
|
||||
{
|
||||
unsigned int lowFreq = 0;
|
||||
unsigned int highFreq = 0;
|
||||
switch (band) {
|
||||
case band2200m:
|
||||
lowFreq = 135000;
|
||||
highFreq = 138000;
|
||||
break;
|
||||
case band630m:
|
||||
lowFreq = 493000;
|
||||
highFreq = 595000;
|
||||
break;
|
||||
case band160m:
|
||||
lowFreq = 1800000;
|
||||
highFreq = 2000000;
|
||||
break;
|
||||
case band80m:
|
||||
lowFreq = 3500000;
|
||||
highFreq = 4000000;
|
||||
break;
|
||||
case band60m:
|
||||
lowFreq = 5250000;
|
||||
highFreq = 5450000;
|
||||
break;
|
||||
case band40m:
|
||||
lowFreq = 7000000;
|
||||
highFreq = 7300000;
|
||||
break;
|
||||
case band30m:
|
||||
lowFreq = 10100000;
|
||||
highFreq = 10150000;
|
||||
break;
|
||||
case band20m:
|
||||
lowFreq = 14000000;
|
||||
highFreq = 14350000;
|
||||
break;
|
||||
case band17m:
|
||||
lowFreq = 18068000;
|
||||
highFreq = 18168000;
|
||||
break;
|
||||
case band15m:
|
||||
lowFreq = 21000000;
|
||||
highFreq = 21450000;
|
||||
break;
|
||||
case band12m:
|
||||
lowFreq = 24890000;
|
||||
highFreq = 24990000;
|
||||
break;
|
||||
case band10m:
|
||||
lowFreq = 28000000;
|
||||
highFreq = 29700000;
|
||||
break;
|
||||
case band6m:
|
||||
lowFreq = 50000000;
|
||||
highFreq = 54000000;
|
||||
break;
|
||||
case band4m:
|
||||
lowFreq = 70000000;
|
||||
highFreq = 70500000;
|
||||
break;
|
||||
case band2m:
|
||||
lowFreq = 144000000;
|
||||
highFreq = 148000000;
|
||||
break;
|
||||
case band70cm:
|
||||
lowFreq = 420000000;
|
||||
highFreq = 450000000;
|
||||
break;
|
||||
case band23cm:
|
||||
lowFreq = 1240000000;
|
||||
highFreq = 1400000000;
|
||||
break;
|
||||
case bandAir:
|
||||
lowFreq = 108000000;
|
||||
highFreq = 137000000;
|
||||
break;
|
||||
case bandWFM:
|
||||
lowFreq = 88000000;
|
||||
highFreq = 108000000;
|
||||
break;
|
||||
case bandGen:
|
||||
lowFreq = 10000;
|
||||
highFreq = 30000000;
|
||||
break;
|
||||
}
|
||||
QString ret = "";
|
||||
|
||||
if (lowFreq > 0 && highFreq > 0) {
|
||||
ret = QString("%1.000000 %2.000000 0x%3 %4 %5 0x%6 0x%7").arg(lowFreq).arg(highFreq).arg(getRadioModes(),0,16).arg(-1).arg(-1).arg(0x16000003,0,16).arg(getAntennas(),0,16);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
unsigned char rigCtlClient::getAntennas()
|
||||
quint8 rigCtlClient::getAntennas()
|
||||
{
|
||||
unsigned char ant=0;
|
||||
for (unsigned char i : rigCaps.antennas)
|
||||
quint8 ant=0;
|
||||
for (quint8 i : rigCaps.antennas)
|
||||
{
|
||||
ant |= 1<<i;
|
||||
}
|
||||
return ant;
|
||||
}
|
||||
|
||||
quint64 rigCtlClient::getRadioModes()
|
||||
quint64 rigCtlClient::getRadioModes(QString md)
|
||||
{
|
||||
quint64 modes = 0;
|
||||
for (mode_info mode : rigCaps.modes)
|
||||
{
|
||||
for (int i = 0; mode_str[i].str[0] != '\0'; i++)
|
||||
{
|
||||
QString curMode = mode.name;
|
||||
if (!strcmp(curMode.toLocal8Bit(), mode_str[i].str))
|
||||
{
|
||||
//qDebug(logRigCtlD()) << "Found mode:" << mode.name << mode_str[i].mode;
|
||||
modes |= mode_str[i].mode;
|
||||
}
|
||||
QString mstr = QString(mode_str[i].str);
|
||||
if (rigCaps.hasDataModes) {
|
||||
curMode = "PKT" + mode.name;
|
||||
if (!strcmp(curMode.toLocal8Bit(), mode_str[i].str))
|
||||
if (mstr.contains(mode.name))
|
||||
{
|
||||
if (mode.name == "LSB" || mode.name == "USB" || mode.name == "FM" || mode.name == "AM")
|
||||
{
|
||||
// qDebug(logRigCtlD()) << "Found data mode:" << mode.name << mode_str[i].mode;
|
||||
// qDebug(logRigCtlD()) << "Found data mode:" << mode.name << mode_str[i].mode;
|
||||
if (md.isEmpty() || mstr.contains(md)) {
|
||||
modes |= mode_str[i].mode;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (mode.name==mstr)
|
||||
{
|
||||
//qDebug(logRigCtlD()) << "Found mode:" << mode.name << mode_str[i].mode;
|
||||
if (md.isEmpty() || mstr==md)
|
||||
{
|
||||
modes |= mode_str[i].mode;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return modes;
|
||||
}
|
||||
|
||||
QString rigCtlClient::getAntName(unsigned char ant)
|
||||
QString rigCtlClient::getAntName(quint8 ant)
|
||||
{
|
||||
QString ret;
|
||||
switch (ant)
|
||||
|
@ -1469,29 +1479,29 @@ QString rigCtlClient::getAntName(unsigned char ant)
|
|||
return ret;
|
||||
}
|
||||
|
||||
unsigned char rigCtlClient::antFromName(QString name) {
|
||||
unsigned char ret;
|
||||
quint8 rigCtlClient::antFromName(QString name) {
|
||||
quint8 ret;
|
||||
|
||||
if (name == "ANT1")
|
||||
if (name.toUpper() == "ANT1")
|
||||
ret = 0;
|
||||
else if (name == "ANT2")
|
||||
else if (name.toUpper() == "ANT2")
|
||||
ret = 1;
|
||||
else if (name == "ANT3")
|
||||
else if (name.toUpper() == "ANT3")
|
||||
ret = 2;
|
||||
else if (name == "ANT4")
|
||||
else if (name.toUpper() == "ANT4")
|
||||
ret = 3;
|
||||
else if (name == "ANT5")
|
||||
else if (name.toUpper() == "ANT5")
|
||||
ret = 4;
|
||||
else if (name == "ANT_UNKNOWN")
|
||||
else if (name.toUpper() == "ANT_UNKNOWN")
|
||||
ret = 30;
|
||||
else if (name == "ANT_CURR")
|
||||
else if (name.toUpper() == "ANT_CURR")
|
||||
ret = 31;
|
||||
else
|
||||
ret = 99;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int rigCtlClient::getCalibratedValue(unsigned char meter,cal_table_t cal) {
|
||||
int rigCtlClient::getCalibratedValue(quint8 meter,cal_table_t cal) {
|
||||
|
||||
int interp;
|
||||
|
||||
|
|
49
rigctld.h
49
rigctld.h
|
@ -337,12 +337,12 @@ signals:
|
|||
void onStarted();
|
||||
void onStopped();
|
||||
void sendData(QString data);
|
||||
void setFrequency(unsigned char vfo, freqt freq);
|
||||
void setFrequency(quint8 vfo, freqt freq);
|
||||
void setPTT(bool state);
|
||||
void setMode(unsigned char mode, unsigned char modeFilter);
|
||||
void setDataMode(bool dataOn, unsigned char modeFilter);
|
||||
void setVFO(unsigned char vfo);
|
||||
void setSplit(unsigned char split);
|
||||
void setMode(quint8 mode, quint8 modeFilter);
|
||||
void setDataMode(bool dataOn, quint8 modeFilter);
|
||||
void setVFO(quint8 vfo);
|
||||
void setSplit(quint8 split);
|
||||
void setDuplexMode(duplexMode dm);
|
||||
void stateUpdated();
|
||||
// Power
|
||||
|
@ -350,19 +350,19 @@ signals:
|
|||
void sendPowerOff();
|
||||
|
||||
// Att/preamp
|
||||
void setAttenuator(unsigned char att);
|
||||
void setPreamp(unsigned char pre);
|
||||
void setAttenuator(quint8 att);
|
||||
void setPreamp(quint8 pre);
|
||||
|
||||
//Level set
|
||||
void setRfGain(unsigned char level);
|
||||
void setAfGain(unsigned char level);
|
||||
void setSql(unsigned char level);
|
||||
void setMicGain(unsigned char);
|
||||
void setCompLevel(unsigned char);
|
||||
void setTxPower(unsigned char);
|
||||
void setMonitorLevel(unsigned char);
|
||||
void setVoxGain(unsigned char);
|
||||
void setAntiVoxGain(unsigned char);
|
||||
void setRfGain(quint8 level);
|
||||
void setAfGain(quint8 level);
|
||||
void setSql(quint8 level);
|
||||
void setMicGain(quint8);
|
||||
void setCompLevel(quint8);
|
||||
void setTxPower(quint8);
|
||||
void setMonitorLevel(quint8);
|
||||
void setVoxGain(quint8);
|
||||
void setAntiVoxGain(quint8);
|
||||
void setSpectrumRefLevel(int);
|
||||
|
||||
|
||||
|
@ -403,15 +403,14 @@ private:
|
|||
rigstate* rigState = Q_NULLPTR;
|
||||
rigCtlD* parent;
|
||||
bool chkVfoEecuted=false;
|
||||
QString getMode(unsigned char mode, bool datamode);
|
||||
unsigned char getMode(QString modeString);
|
||||
QString getFilter(unsigned char mode, unsigned char filter);
|
||||
QString generateFreqRange(bandType band);
|
||||
unsigned char getAntennas();
|
||||
quint64 getRadioModes();
|
||||
QString getAntName(unsigned char ant);
|
||||
unsigned char antFromName(QString name);
|
||||
int getCalibratedValue(unsigned char meter,cal_table_t cal);
|
||||
QString getMode(quint8 mode, bool datamode);
|
||||
quint8 getMode(QString modeString);
|
||||
QString getFilter(quint8 mode, quint8 filter);
|
||||
quint8 getAntennas();
|
||||
quint64 getRadioModes(QString mode = "");
|
||||
QString getAntName(quint8 ant);
|
||||
quint8 antFromName(QString name);
|
||||
int getCalibratedValue(quint8 meter,cal_table_t cal);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -7,84 +7,7 @@ model_kind determineRadioModel(unsigned char rigID)
|
|||
{
|
||||
|
||||
model_kind rig;
|
||||
|
||||
switch(rigID)
|
||||
{
|
||||
case model7100:
|
||||
rig = model7100;
|
||||
break;
|
||||
case model7200:
|
||||
rig = model7200;
|
||||
break;
|
||||
case model7300:
|
||||
rig = model7300;
|
||||
break;
|
||||
case modelR8600:
|
||||
rig = modelR8600;
|
||||
break;
|
||||
case model7000:
|
||||
rig = model7000;
|
||||
break;
|
||||
case model7410:
|
||||
rig = model7410;
|
||||
break;
|
||||
case model7600:
|
||||
rig = model7600;
|
||||
break;
|
||||
case model7610:
|
||||
rig = model7610;
|
||||
break;
|
||||
case model7700:
|
||||
rig = model7700;
|
||||
break;
|
||||
case model7800:
|
||||
rig = model7800;
|
||||
break;
|
||||
case model7850:
|
||||
rig = model7850;
|
||||
break;
|
||||
case model9700:
|
||||
rig = model9700;
|
||||
break;
|
||||
case model706:
|
||||
rig = model706;
|
||||
break;
|
||||
case model705:
|
||||
rig = model705;
|
||||
break;
|
||||
case model718:
|
||||
rig = model718;
|
||||
break;
|
||||
case model736:
|
||||
rig = model736;
|
||||
break;
|
||||
case model746:
|
||||
rig = model746;
|
||||
break;
|
||||
case model756pro:
|
||||
rig = model756pro;
|
||||
break;
|
||||
case model756proii:
|
||||
rig = model756proii;
|
||||
break;
|
||||
case model756proiii:
|
||||
rig = model756proiii;
|
||||
break;
|
||||
case model910h:
|
||||
rig = model910h;
|
||||
break;
|
||||
case model9100:
|
||||
rig = model9100;
|
||||
break;
|
||||
default:
|
||||
rig = modelUnknown;
|
||||
break;
|
||||
}
|
||||
rig = (model_kind)rigID;
|
||||
|
||||
return rig;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -28,11 +28,15 @@ enum model_kind {
|
|||
model7410 = 0x80,
|
||||
model7850 = 0x8E,
|
||||
model9700 = 0xA2,
|
||||
model703 = 0x68,
|
||||
model705 = 0xA4,
|
||||
model706 = 0x58,
|
||||
model718 = 0x5E,
|
||||
model736 = 0x40,
|
||||
model737 = 0x3C,
|
||||
model738 = 0x44,
|
||||
model746 = 0x56,
|
||||
model756 = 0x50,
|
||||
model756pro = 0x5C,
|
||||
model756proii = 0x64,
|
||||
model756proiii = 0x6E,
|
||||
|
@ -51,7 +55,7 @@ enum rigInput{ inputMic=0,
|
|||
inputUnknown=0xff
|
||||
};
|
||||
|
||||
enum bandType { band23cm=0,
|
||||
enum availableBands { band23cm=0,
|
||||
band70cm,
|
||||
band2m,
|
||||
bandAir,
|
||||
|
@ -91,6 +95,18 @@ struct centerSpanData {
|
|||
QString name;
|
||||
};
|
||||
|
||||
struct bandType {
|
||||
bandType(availableBands band, quint32 lowFreq, quint32 highFreq, mode_kind defaultMode) :
|
||||
band(band), lowFreq(lowFreq), highFreq(highFreq), defaultMode(defaultMode) {}
|
||||
|
||||
bandType() {}
|
||||
|
||||
availableBands band;
|
||||
quint32 lowFreq;
|
||||
quint32 highFreq;
|
||||
mode_kind defaultMode;
|
||||
};
|
||||
|
||||
model_kind determineRadioModel(unsigned char rigID);
|
||||
|
||||
struct rigCapabilities {
|
||||
|
|
58
rigstate.h
58
rigstate.h
|
@ -12,12 +12,12 @@
|
|||
#include "rigidentities.h"
|
||||
|
||||
// Meters at the end as they are ALWAYS updated from the rig!
|
||||
enum stateTypes { VFOAFREQ, VFOBFREQ, CURRENTVFO, PTT, MODE, FILTER, DUPLEX, DATAMODE, ANTENNA, RXANTENNA, CTCSS, TSQL, DTCS, CSQL,
|
||||
PREAMP, AGC, ATTENUATOR, MODINPUT, AFGAIN, RFGAIN, SQUELCH, RFPOWER, MICGAIN, COMPLEVEL, MONITORLEVEL, VOXGAIN, ANTIVOXGAIN,
|
||||
enum stateTypes { VFOAFREQ, VFOBFREQ, CURRENTVFO, PTT, MODE, FILTER, PASSBAND, DUPLEX, DATAMODE, ANTENNA, RXANTENNA, CTCSS, TSQL, DTCS, CSQL,
|
||||
PREAMP, AGC, ATTENUATOR, MODINPUT, AFGAIN, RFGAIN, SQUELCH, RFPOWER, MICGAIN, COMPLEVEL, MONITORLEVEL, BAL, KEYSPD,
|
||||
VOXGAIN, ANTIVOXGAIN, CWPITCH, NOTCHF, IF, PBTIN, PBTOUT, APF, NR, NB, NBDEPTH, NBWIDTH, RIGINPUT, POWERONOFF, RITVALUE,
|
||||
FAGCFUNC, NBFUNC, COMPFUNC, VOXFUNC, TONEFUNC, TSQLFUNC, SBKINFUNC, FBKINFUNC, ANFFUNC, NRFUNC, AIPFUNC, APFFUNC, MONFUNC, MNFUNC,RFFUNC,
|
||||
AROFUNC, MUTEFUNC, VSCFUNC, REVFUNC, SQLFUNC, ABMFUNC, BCFUNC, MBCFUNC, RITFUNC, AFCFUNC, SATMODEFUNC, SCOPEFUNC,
|
||||
NBLEVEL, NBDEPTH, NBWIDTH, NRLEVEL, RIGINPUT, POWERONOFF, RITVALUE,
|
||||
RESUMEFUNC, TBURSTFUNC, TUNERFUNC, LOCKFUNC, SMETER, POWERMETER, SWRMETER, ALCMETER, COMPMETER, VOLTAGEMETER, CURRENTMETER
|
||||
AROFUNC, MUTEFUNC, VSCFUNC, REVFUNC, SQLFUNC, ABMFUNC, BCFUNC, MBCFUNC, RITFUNC, AFCFUNC, SATMODEFUNC, SCOPEFUNC,
|
||||
RESUMEFUNC, TBURSTFUNC, TUNERFUNC, LOCKFUNC, SMETER, POWERMETER, SWRMETER, ALCMETER, COMPMETER, VOLTAGEMETER, CURRENTMETER,
|
||||
};
|
||||
|
||||
struct value {
|
||||
|
@ -40,7 +40,7 @@ public:
|
|||
void set(stateTypes s, quint64 x, bool u) {
|
||||
if (x != map[s]._value) {
|
||||
_mutex.lock();
|
||||
map[s]._value = (quint64)x;
|
||||
map[s]._value = quint64(x);
|
||||
map[s]._valid = true;
|
||||
map[s]._updated = u;
|
||||
map[s]._dateUpdated = QDateTime::currentDateTime();
|
||||
|
@ -48,9 +48,19 @@ public:
|
|||
}
|
||||
}
|
||||
void set(stateTypes s, qint32 x, bool u) {
|
||||
if ((quint64)x != map[s]._value) {
|
||||
if (quint64(x) != map[s]._value) {
|
||||
_mutex.lock();
|
||||
map[s]._value = (quint64)x;
|
||||
map[s]._value = quint64(x);
|
||||
map[s]._valid = true;
|
||||
map[s]._updated = u;
|
||||
map[s]._dateUpdated = QDateTime::currentDateTime();
|
||||
_mutex.unlock();
|
||||
}
|
||||
}
|
||||
void set(stateTypes s, qint16 x, bool u) {
|
||||
if (quint64(x) != map[s]._value) {
|
||||
_mutex.lock();
|
||||
map[s]._value = quint64(x);
|
||||
map[s]._valid = true;
|
||||
map[s]._updated = u;
|
||||
map[s]._dateUpdated = QDateTime::currentDateTime();
|
||||
|
@ -58,9 +68,9 @@ public:
|
|||
}
|
||||
}
|
||||
void set(stateTypes s, quint16 x, bool u) {
|
||||
if ((quint64)x != map[s]._value) {
|
||||
if (quint64(x) != map[s]._value) {
|
||||
_mutex.lock();
|
||||
map[s]._value = (quint64)x;
|
||||
map[s]._value = quint64(x);
|
||||
map[s]._valid = true;
|
||||
map[s]._updated = u;
|
||||
map[s]._dateUpdated = QDateTime::currentDateTime();
|
||||
|
@ -68,9 +78,9 @@ public:
|
|||
}
|
||||
}
|
||||
void set(stateTypes s, quint8 x, bool u) {
|
||||
if ((quint64)x != map[s]._value) {
|
||||
if (quint64(x) != map[s]._value) {
|
||||
_mutex.lock();
|
||||
map[s]._value = (quint64)x;
|
||||
map[s]._value = quint64(x);
|
||||
map[s]._valid = true;
|
||||
map[s]._updated = u;
|
||||
map[s]._dateUpdated = QDateTime::currentDateTime();
|
||||
|
@ -78,9 +88,9 @@ public:
|
|||
}
|
||||
}
|
||||
void set(stateTypes s, bool x, bool u) {
|
||||
if ((quint64)x != map[s]._value) {
|
||||
if (quint64(x) != map[s]._value) {
|
||||
_mutex.lock();
|
||||
map[s]._value = (quint64)x;
|
||||
map[s]._value = quint64(x);
|
||||
map[s]._valid = true;
|
||||
map[s]._updated = u;
|
||||
map[s]._dateUpdated = QDateTime::currentDateTime();
|
||||
|
@ -88,9 +98,9 @@ public:
|
|||
}
|
||||
}
|
||||
void set(stateTypes s, duplexMode x, bool u) {
|
||||
if ((quint64)x != map[s]._value) {
|
||||
if (quint64(x) != map[s]._value) {
|
||||
_mutex.lock();
|
||||
map[s]._value = (quint64)x;
|
||||
map[s]._value = quint64(x);
|
||||
map[s]._valid = true;
|
||||
map[s]._updated = u;
|
||||
map[s]._dateUpdated = QDateTime::currentDateTime();
|
||||
|
@ -99,9 +109,9 @@ public:
|
|||
}
|
||||
|
||||
void set(stateTypes s, rigInput x, bool u) {
|
||||
if ((quint64)x != map[s]._value) {
|
||||
if (quint64(x) != map[s]._value) {
|
||||
_mutex.lock();
|
||||
map[s]._value = (quint64)x;
|
||||
map[s]._value = quint64(x);
|
||||
map[s]._valid = true;
|
||||
map[s]._updated = u;
|
||||
map[s]._dateUpdated = QDateTime::currentDateTime();
|
||||
|
@ -110,12 +120,14 @@ public:
|
|||
}
|
||||
|
||||
bool getBool(stateTypes s) { return map[s]._value != 0; }
|
||||
quint8 getChar(stateTypes s) { return (quint8)map[s]._value; }
|
||||
quint16 getInt16(stateTypes s) { return (qint16)map[s]._value; }
|
||||
qint32 getInt32(stateTypes s) { return (qint32)map[s]._value; }
|
||||
quint8 getChar(stateTypes s) { return quint8(map[s]._value); }
|
||||
qint16 getInt16(stateTypes s) { return qint16(map[s]._value); }
|
||||
quint16 getUInt16(stateTypes s) { return quint16(map[s]._value); }
|
||||
qint32 getInt32(stateTypes s) { return qint32(map[s]._value); }
|
||||
quint32 getUInt32(stateTypes s) { return quint32(map[s]._value); }
|
||||
quint64 getInt64(stateTypes s) { return map[s]._value; }
|
||||
duplexMode getDuplex(stateTypes s) { return(duplexMode)map[s]._value; }
|
||||
rigInput getInput(stateTypes s) { return(rigInput)map[s]._value; }
|
||||
duplexMode getDuplex(stateTypes s) { return duplexMode(map[s]._value); }
|
||||
rigInput getInput(stateTypes s) { return rigInput(map[s]._value); }
|
||||
QMap<stateTypes, value> map;
|
||||
|
||||
|
||||
|
|
|
@ -87,7 +87,7 @@ void servermain::openRig()
|
|||
{
|
||||
//qInfo(logSystem()) << "Got rig";
|
||||
QMetaObject::invokeMethod(radio->rig, [=]() {
|
||||
radio->rig->commSetup(radio->civAddr, radio->serialPort, radio->baudRate, QString("none"),prefs.tcpPort,radio->waterfallFormat);
|
||||
radio->rig->commSetup(radio->civAddr, radio->serialPort, radio->baudRate, QString("none"),0 ,radio->waterfallFormat);
|
||||
}, Qt::QueuedConnection);
|
||||
}
|
||||
}
|
||||
|
@ -485,7 +485,7 @@ void servermain::loadSettings()
|
|||
|
||||
numRadios = settings->beginReadArray("Radios");
|
||||
int tempNum = numRadios;
|
||||
|
||||
|
||||
for (int i = 0; i < numRadios; i++) {
|
||||
settings->setArrayIndex(i);
|
||||
RIGCONFIG* tempPrefs = new RIGCONFIG();
|
||||
|
@ -500,23 +500,16 @@ void servermain::loadSettings()
|
|||
tempPrefs->rxAudioSetup.type = prefs.audioSystem;
|
||||
tempPrefs->txAudioSetup.type = prefs.audioSystem;
|
||||
|
||||
QString tempPort = "auto";
|
||||
if (tempPrefs->rigName=="<NONE>")
|
||||
{
|
||||
if (tempPrefs->serialPort == "auto") {
|
||||
foreach(const QSerialPortInfo & serialPortInfo, QSerialPortInfo::availablePorts())
|
||||
{
|
||||
qDebug(logSystem()) << "Serial Port found: " << serialPortInfo.portName() << "Manufacturer:" << serialPortInfo.manufacturer() << "Product ID" << serialPortInfo.description() << "S/N" << serialPortInfo.serialNumber();
|
||||
if ((serialPortInfo.portName() == tempPrefs->serialPort || tempPrefs->serialPort == "auto") && !serialPortInfo.serialNumber().isEmpty())
|
||||
{
|
||||
if (serialPortInfo.serialNumber().startsWith("IC-")) {
|
||||
tempPrefs->rigName = serialPortInfo.serialNumber();
|
||||
tempPort = serialPortInfo.portName();
|
||||
}
|
||||
if (serialPortInfo.serialNumber().startsWith("IC-") && tempPrefs->serialPort == "auto") {
|
||||
tempPrefs->rigName = serialPortInfo.serialNumber();
|
||||
tempPrefs->serialPort = serialPortInfo.portName();
|
||||
}
|
||||
}
|
||||
}
|
||||
tempPrefs->serialPort = tempPort;
|
||||
|
||||
QString guid = settings->value("GUID", "").toString();
|
||||
if (guid.isEmpty()) {
|
||||
guid = QUuid::createUuid().toString();
|
||||
|
|
190
wfmain.cpp
190
wfmain.cpp
|
@ -31,7 +31,7 @@ wfmain::wfmain(const QString settingsFile, const QString logFile, bool debugMode
|
|||
setWindowIcon(QIcon( QString(":resources/wfview.png")));
|
||||
this->debugMode = debugMode;
|
||||
debugModeLogging = debugMode;
|
||||
version = QString("wfview version: %1 (Git:%2 on %3 at %4 by %5@%6)\nOperating System: %7 (%8)\nBuild Qt Version %9. Current Qt Version: %10\n")
|
||||
version = QString("wfview version: %1 (Git:%2 on %3 at %4 by %5@%6). Operating System: %7 (%8). Build Qt Version %9. Current Qt Version: %10")
|
||||
.arg(QString(WFVIEW_VERSION))
|
||||
.arg(GITSHORT).arg(__DATE__).arg(__TIME__).arg(UNAME).arg(HOST)
|
||||
.arg(QSysInfo::prettyProductName()).arg(QSysInfo::buildCpuArchitecture())
|
||||
|
@ -103,8 +103,6 @@ wfmain::wfmain(const QString settingsFile, const QString logFile, bool debugMode
|
|||
qDebug(logSystem()) << "Running setUIToPrefs()";
|
||||
setUIToPrefs();
|
||||
|
||||
loadColorPresetToUIandPlots(0);
|
||||
|
||||
qDebug(logSystem()) << "Running setInititalTiming()";
|
||||
setInitialTiming();
|
||||
|
||||
|
@ -131,6 +129,7 @@ wfmain::wfmain(const QString settingsFile, const QString logFile, bool debugMode
|
|||
connect(this, SIGNAL(setClusterPassword(QString)), cluster, SLOT(setTcpPassword(QString)));
|
||||
connect(this, SIGNAL(setClusterTimeout(int)), cluster, SLOT(setTcpTimeout(int)));
|
||||
connect(this, SIGNAL(setFrequencyRange(double, double)), cluster, SLOT(freqRange(double, double)));
|
||||
connect(this, SIGNAL(setClusterSkimmerSpots(bool)), cluster, SLOT(enableSkimmerSpots(bool)));
|
||||
|
||||
connect(cluster, SIGNAL(sendSpots(QList<spotData>)), this, SLOT(receiveSpots(QList<spotData>)));
|
||||
connect(cluster, SIGNAL(sendOutput(QString)), this, SLOT(receiveClusterOutput(QString)));
|
||||
|
@ -342,7 +341,7 @@ void wfmain::rigConnections()
|
|||
connect(this, SIGNAL(scopeDisplayEnable()), rig, SLOT(enableSpectrumDisplay()));
|
||||
connect(rig, SIGNAL(haveMode(unsigned char, unsigned char)), this, SLOT(receiveMode(unsigned char, unsigned char)));
|
||||
connect(rig, SIGNAL(haveDataMode(bool)), this, SLOT(receiveDataModeStatus(bool)));
|
||||
connect(rig, SIGNAL(havePassband(quint8)), this, SLOT(receivePassband(quint8)));
|
||||
connect(rig, SIGNAL(havePassband(quint16)), this, SLOT(receivePassband(quint16)));
|
||||
|
||||
connect(rpt, SIGNAL(getDuplexMode()), rig, SLOT(getDuplexMode()));
|
||||
connect(rpt, SIGNAL(setDuplexMode(duplexMode)), rig, SLOT(setDuplexMode(duplexMode)));
|
||||
|
@ -646,10 +645,13 @@ void wfmain::receiveCommReady()
|
|||
if(prefs.CIVisRadioModel)
|
||||
{
|
||||
qInfo(logSystem()) << "Skipping Rig ID query, using user-supplied model from CI-V address: " << prefs.radioCIVAddr;
|
||||
emit setCIVAddr(prefs.radioCIVAddr);
|
||||
emit setRigID(prefs.radioCIVAddr);
|
||||
} else {
|
||||
emit setCIVAddr(prefs.radioCIVAddr);
|
||||
emit getRigID();
|
||||
getInitialRigState();
|
||||
issueDelayedCommand(cmdGetRigID);
|
||||
delayedCommand->start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -741,6 +743,7 @@ void wfmain::setupPlots()
|
|||
passbandIndicator->setAntialiased(true);
|
||||
passbandIndicator->setPen(QPen(Qt::red));
|
||||
passbandIndicator->setBrush(QBrush(Qt::red));
|
||||
passbandIndicator->setSelectable(true);
|
||||
|
||||
freqIndicatorLine = new QCPItemLine(plot);
|
||||
freqIndicatorLine->setAntialiased(true);
|
||||
|
@ -1227,6 +1230,9 @@ void wfmain::setUIToPrefs()
|
|||
ui->colorPresetCombo->setItemText(pn, *p.presetName);
|
||||
}
|
||||
|
||||
ui->colorPresetCombo->setCurrentIndex(prefs.currentColorPresetNumber);
|
||||
loadColorPresetToUIandPlots(prefs.currentColorPresetNumber);
|
||||
|
||||
ui->wfthemeCombo->setCurrentIndex(ui->wfthemeCombo->findData(prefs.wftheme));
|
||||
colorMap->setGradient(static_cast<QCPColorGradient::GradientPreset>(prefs.wftheme));
|
||||
|
||||
|
@ -1530,6 +1536,7 @@ void wfmain::setDefPrefs()
|
|||
defPrefs.forceRTSasPTT = false;
|
||||
defPrefs.serialPortRadio = QString("auto");
|
||||
defPrefs.serialPortBaud = 115200;
|
||||
defPrefs.polling_ms = 0; // 0 = Automatic
|
||||
defPrefs.enablePTT = false;
|
||||
defPrefs.niceTS = true;
|
||||
defPrefs.enableRigCtlD = false;
|
||||
|
@ -1594,7 +1601,7 @@ void wfmain::loadSettings()
|
|||
// Load in the color presets. The default values are already loaded.
|
||||
|
||||
settings->beginGroup("ColorPresets");
|
||||
settings->value("currentColorPresetNumber", prefs.currentColorPresetNumber).toInt();
|
||||
prefs.currentColorPresetNumber = settings->value("currentColorPresetNumber", defPrefs.currentColorPresetNumber).toInt();
|
||||
if(prefs.currentColorPresetNumber > numColorPresetsTotal-1)
|
||||
prefs.currentColorPresetNumber = 0;
|
||||
|
||||
|
@ -1678,6 +1685,27 @@ void wfmain::loadSettings()
|
|||
serverConfig.baudRate = prefs.serialPortBaud;
|
||||
}
|
||||
|
||||
prefs.polling_ms = settings->value("polling_ms", defPrefs.polling_ms).toInt();
|
||||
if(prefs.polling_ms == 0)
|
||||
{
|
||||
// Automatic
|
||||
ui->pollingButtonGroup->blockSignals(true);
|
||||
ui->autoPollBtn->setChecked(true);
|
||||
ui->manualPollBtn->setChecked(false);
|
||||
ui->pollingButtonGroup->blockSignals(false);
|
||||
ui->pollTimeMsSpin->setEnabled(false);
|
||||
} else {
|
||||
// Manual
|
||||
ui->pollingButtonGroup->blockSignals(true);
|
||||
ui->autoPollBtn->setChecked(false);
|
||||
ui->manualPollBtn->setChecked(true);
|
||||
ui->pollingButtonGroup->blockSignals(false);
|
||||
ui->pollTimeMsSpin->blockSignals(true);
|
||||
ui->pollTimeMsSpin->setValue(prefs.polling_ms);
|
||||
ui->pollTimeMsSpin->blockSignals(false);
|
||||
ui->pollTimeMsSpin->setEnabled(true);
|
||||
}
|
||||
|
||||
prefs.virtualSerialPort = settings->value("VirtualSerialPort", defPrefs.virtualSerialPort).toString();
|
||||
int vspIndex = ui->vspCombo->findText(prefs.virtualSerialPort);
|
||||
if (vspIndex != -1) {
|
||||
|
@ -2381,6 +2409,10 @@ void wfmain::saveSettings()
|
|||
qInfo(logSystem()) << "Saving settings to " << settings->fileName();
|
||||
// Basic things to load:
|
||||
|
||||
settings->beginGroup("Program");
|
||||
settings->setValue("version", QString(WFVIEW_VERSION));
|
||||
settings->endGroup();
|
||||
|
||||
// UI: (full screen, dark theme, draw peaks, colors, etc)
|
||||
settings->beginGroup("Interface");
|
||||
settings->setValue("UseFullScreen", prefs.useFullScreen);
|
||||
|
@ -2410,6 +2442,7 @@ void wfmain::saveSettings()
|
|||
settings->setValue("RigCIVuInt", prefs.radioCIVAddr);
|
||||
settings->setValue("CIVisRadioModel", prefs.CIVisRadioModel);
|
||||
settings->setValue("ForceRTSasPTT", prefs.forceRTSasPTT);
|
||||
settings->setValue("polling_ms", prefs.polling_ms); // 0 = automatic
|
||||
settings->setValue("SerialPortRadio", prefs.serialPortRadio);
|
||||
settings->setValue("SerialPortBaud", prefs.serialPortBaud);
|
||||
settings->setValue("VirtualSerialPort", prefs.virtualSerialPort);
|
||||
|
@ -3461,8 +3494,12 @@ void wfmain::doCmd(cmds cmd)
|
|||
//qInfo(logSystem()) << "NOOP";
|
||||
break;
|
||||
case cmdGetRigID:
|
||||
emit getRigID();
|
||||
break;
|
||||
if(!haveRigCaps)
|
||||
{
|
||||
emit getRigID();
|
||||
issueDelayedCommand(cmdGetRigID);
|
||||
}
|
||||
break;
|
||||
case cmdGetRigCIV:
|
||||
// if(!know rig civ already)
|
||||
if(!haveRigCaps)
|
||||
|
@ -4041,13 +4078,10 @@ void wfmain::receiveRigID(rigCapabilities rigCaps)
|
|||
|
||||
setBandButtons();
|
||||
|
||||
|
||||
ui->tuneEnableChk->setEnabled(rigCaps.hasATU);
|
||||
ui->tuneNowBtn->setEnabled(rigCaps.hasATU);
|
||||
|
||||
ui->useRTSforPTTchk->blockSignals(true);
|
||||
ui->useRTSforPTTchk->setChecked(rigCaps.useRTSforPTT);
|
||||
ui->useRTSforPTTchk->blockSignals(false);
|
||||
ui->useRTSforPTTchk->setChecked(prefs.forceRTSasPTT);
|
||||
|
||||
ui->audioSystemCombo->setEnabled(false);
|
||||
ui->audioSystemServerCombo->setEnabled(false);
|
||||
|
@ -4065,7 +4099,12 @@ void wfmain::receiveRigID(rigCapabilities rigCaps)
|
|||
issueDelayedCommand(cmdGetFreq);
|
||||
issueDelayedCommand(cmdGetMode);
|
||||
// recalculate command timing now that we know the rig better:
|
||||
calculateTimingParameters();
|
||||
if(prefs.polling_ms != 0)
|
||||
{
|
||||
changePollTiming(prefs.polling_ms, true);
|
||||
} else {
|
||||
calculateTimingParameters();
|
||||
}
|
||||
initPeriodicCommands();
|
||||
|
||||
// Set the second meter here as I suspect we need to be connected for it to work?
|
||||
|
@ -4225,10 +4264,12 @@ void wfmain::receiveSpectrumData(QByteArray spectrum, double startFreq, double e
|
|||
// TODO: create non-button function to do this
|
||||
// This will break if the button is ever moved or renamed.
|
||||
on_clearPeakBtn_clicked();
|
||||
} else {
|
||||
plasmaPrepared = false;
|
||||
preparePlasma();
|
||||
}
|
||||
// Inform other threads (cluster) that the frequency range has changed.
|
||||
emit setFrequencyRange(startFreq, endFreq);
|
||||
// TODO: Add clear-out for the buffer
|
||||
}
|
||||
|
||||
oldLowerFreq = startFreq;
|
||||
|
@ -4271,8 +4312,10 @@ void wfmain::receiveSpectrumData(QByteArray spectrum, double startFreq, double e
|
|||
}
|
||||
plasmaMutex.lock();
|
||||
spectrumPlasma.push_front(spectrum);
|
||||
spectrumPlasma.pop_back();
|
||||
//spectrumPlasma.resize(spectrumPlasmaSize);
|
||||
if(spectrumPlasma.size() > (int)spectrumPlasmaSize)
|
||||
{
|
||||
spectrumPlasma.pop_back();
|
||||
}
|
||||
plasmaMutex.unlock();
|
||||
|
||||
|
||||
|
@ -4379,7 +4422,6 @@ void wfmain::preparePlasma()
|
|||
{
|
||||
if(plasmaPrepared)
|
||||
return;
|
||||
QByteArray empty((int)spectWidth, '\x01');
|
||||
|
||||
if(spectrumPlasmaSize == 0)
|
||||
spectrumPlasmaSize = 128;
|
||||
|
@ -4387,10 +4429,6 @@ void wfmain::preparePlasma()
|
|||
plasmaMutex.lock();
|
||||
spectrumPlasma.clear();
|
||||
|
||||
for(unsigned int p=0; p < spectrumPlasmaSize; p++)
|
||||
{
|
||||
spectrumPlasma.append(empty);
|
||||
}
|
||||
|
||||
spectrumPlasma.squeeze();
|
||||
plasmaMutex.unlock();
|
||||
|
@ -5902,9 +5940,9 @@ void wfmain::receiveLANGain(unsigned char level)
|
|||
processModLevel(inputLAN, level);
|
||||
}
|
||||
|
||||
void wfmain::receivePassband(quint8 pass)
|
||||
void wfmain::receivePassband(quint16 pass)
|
||||
{
|
||||
int calc;
|
||||
/* int calc;
|
||||
if (currentModeInfo.mk == modeAM) {
|
||||
calc = 200 + (pass * 200);
|
||||
}
|
||||
|
@ -5914,8 +5952,8 @@ void wfmain::receivePassband(quint8 pass)
|
|||
}
|
||||
else {
|
||||
calc = 600 + ((pass - 10) * 100);
|
||||
}
|
||||
passBand = (double)(calc / 1000000.0);
|
||||
} */
|
||||
passBand = (double)(pass / 1000000.0);
|
||||
}
|
||||
|
||||
void wfmain::receiveMeter(meterKind inMeter, unsigned char level)
|
||||
|
@ -6243,6 +6281,10 @@ void wfmain::calculateTimingParameters()
|
|||
|
||||
qInfo(logSystem()) << "Delay command interval timing: " << delayedCommand->interval() << "ms";
|
||||
|
||||
ui->pollTimeMsSpin->blockSignals(true);
|
||||
ui->pollTimeMsSpin->setValue(delayedCommand->interval());
|
||||
ui->pollTimeMsSpin->blockSignals(false);
|
||||
|
||||
// Normal:
|
||||
delayedCmdIntervalLAN_ms = delayedCommand->interval();
|
||||
delayedCmdIntervalSerial_ms = delayedCommand->interval();
|
||||
|
@ -6397,7 +6439,7 @@ void wfmain::setBandButtons()
|
|||
for(unsigned int i=0; i < rigCaps.bands.size(); i++)
|
||||
{
|
||||
bandSel = rigCaps.bands.at(i);
|
||||
switch(bandSel)
|
||||
switch(bandSel.band)
|
||||
{
|
||||
case(band23cm):
|
||||
showButton(ui->band23cmbtn);
|
||||
|
@ -6524,20 +6566,6 @@ void wfmain::on_wfLengthSlider_valueChanged(int value)
|
|||
prepareWf(value);
|
||||
}
|
||||
|
||||
void wfmain::on_pollingBtn_clicked()
|
||||
{
|
||||
bool ok;
|
||||
int timing = 0;
|
||||
timing = QInputDialog::getInt(this, "wfview Radio Polling Setup", "Poll Timing Interval (ms)", delayedCommand->interval(), 1, 200, 1, &ok );
|
||||
|
||||
if(ok && timing)
|
||||
{
|
||||
delayedCommand->setInterval( timing );
|
||||
qInfo(logSystem()) << "User changed radio polling interval to " << timing << "ms.";
|
||||
showStatusBarText("User changed radio polling interval to " + QString("%1").arg(timing) + "ms.");
|
||||
}
|
||||
}
|
||||
|
||||
void wfmain::on_wfAntiAliasChk_clicked(bool checked)
|
||||
{
|
||||
colorMap->setAntialiased(checked);
|
||||
|
@ -7037,6 +7065,7 @@ void wfmain::on_underlayBufferSlider_valueChanged(int value)
|
|||
{
|
||||
resizePlasmaBuffer(value);
|
||||
prefs.underlayBufferSize = value;
|
||||
spectrumPlasmaSize = value;
|
||||
}
|
||||
|
||||
void wfmain::resizePlasmaBuffer(int newSize)
|
||||
|
@ -7123,28 +7152,7 @@ void wfmain::on_underlayAverageBuffer_toggled(bool checked)
|
|||
void wfmain::on_debugBtn_clicked()
|
||||
{
|
||||
qInfo(logSystem()) << "Debug button pressed.";
|
||||
// issueDelayedCommand(cmdGetRigID);
|
||||
//emit getRigCIV();
|
||||
//trxadj->show();
|
||||
//setRadioTimeDatePrep();
|
||||
//wf->setInteraction(QCP::iRangeZoom, true);
|
||||
//wf->setInteraction(QCP::iRangeDrag, true);
|
||||
plot->yAxis->setRange(QCPRange(plotFloor, plotCeiling));
|
||||
colorMap->setDataRange(QCPRange(wfFloor, wfCeiling));
|
||||
|
||||
// bool ok;
|
||||
// int height = QInputDialog::getInt(this, "wfview window fixed height", "number: ", 350, 1, 500, 1, &ok );
|
||||
|
||||
// this->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
||||
// this->setMaximumSize(QSize(1025,height));
|
||||
// this->setMinimumSize(QSize(1025,height));
|
||||
// //this->setMaximumSize(QSize(929, 270));
|
||||
// //this->setMinimumSize(QSize(929, 270));
|
||||
|
||||
// resize(minimumSize());
|
||||
// adjustSize(); // main window
|
||||
// adjustSize();
|
||||
|
||||
emit getRigID();
|
||||
}
|
||||
|
||||
// ---------- color helper functions: ---------- //
|
||||
|
@ -8027,9 +8035,9 @@ void wfmain::on_clusterServerNameCombo_currentIndexChanged(int index)
|
|||
|
||||
for (int i = 0; i < clusters.size(); i++) {
|
||||
if (i == index)
|
||||
clusters[index].isdefault = true;
|
||||
clusters[i].isdefault = true;
|
||||
else
|
||||
clusters[index].isdefault = false;
|
||||
clusters[i].isdefault = false;
|
||||
}
|
||||
|
||||
emit setClusterServerName(clusters[index].server);
|
||||
|
@ -8100,8 +8108,8 @@ void wfmain::on_clusterTimeoutLineEdit_editingFinished()
|
|||
|
||||
void wfmain::receiveSpots(QList<spotData> spots)
|
||||
{
|
||||
QElapsedTimer timer;
|
||||
timer.start();
|
||||
//QElapsedTimer timer;
|
||||
//timer.start();
|
||||
|
||||
bool current = false;
|
||||
|
||||
|
@ -8178,7 +8186,7 @@ void wfmain::receiveSpots(QList<spotData> spots)
|
|||
|
||||
}
|
||||
|
||||
qDebug(logCluster()) << "Processing took" << timer.nsecsElapsed() / 1000 << "us";
|
||||
//qDebug(logCluster()) << "Processing took" << timer.nsecsElapsed() / 1000 << "us";
|
||||
}
|
||||
|
||||
void wfmain::on_clusterPopOutBtn_clicked()
|
||||
|
@ -8209,6 +8217,12 @@ void wfmain::on_clusterPopOutBtn_clicked()
|
|||
}
|
||||
}
|
||||
|
||||
void wfmain::on_clusterSkimmerSpotsEnable_clicked(bool enable)
|
||||
{
|
||||
prefs.clusterSkimmerSpotsEnable = enable;
|
||||
emit setClusterSkimmerSpots(enable);
|
||||
}
|
||||
|
||||
void wfmain::on_clickDragTuningEnableChk_clicked(bool checked)
|
||||
{
|
||||
prefs.clickDragTuningEnable = checked;
|
||||
|
@ -8224,5 +8238,47 @@ void wfmain::on_usbControllerBtn_clicked()
|
|||
shut->show();
|
||||
shut->raise();
|
||||
}
|
||||
|
||||
|
||||
void wfmain::on_autoPollBtn_clicked(bool checked)
|
||||
{
|
||||
ui->pollTimeMsSpin->setEnabled(!checked);
|
||||
if(checked)
|
||||
{
|
||||
prefs.polling_ms = 0;
|
||||
qInfo(logSystem()) << "User set radio polling interval to automatic.";
|
||||
calculateTimingParameters();
|
||||
}
|
||||
}
|
||||
|
||||
void wfmain::on_manualPollBtn_clicked(bool checked)
|
||||
{
|
||||
ui->pollTimeMsSpin->setEnabled(checked);
|
||||
if(checked)
|
||||
{
|
||||
prefs.polling_ms = ui->pollTimeMsSpin->value();
|
||||
changePollTiming(prefs.polling_ms);
|
||||
}
|
||||
}
|
||||
|
||||
void wfmain::on_pollTimeMsSpin_valueChanged(int timing_ms)
|
||||
{
|
||||
if(ui->manualPollBtn->isChecked())
|
||||
{
|
||||
changePollTiming(timing_ms);
|
||||
}
|
||||
}
|
||||
|
||||
void wfmain::changePollTiming(int timing_ms, bool setUI)
|
||||
{
|
||||
delayedCommand->setInterval(timing_ms);
|
||||
qInfo(logSystem()) << "User changed radio polling interval to " << timing_ms << "ms.";
|
||||
showStatusBarText("User changed radio polling interval to " + QString("%1").arg(timing_ms) + "ms.");
|
||||
prefs.polling_ms = timing_ms;
|
||||
if(setUI)
|
||||
{
|
||||
ui->pollTimeMsSpin->blockSignals(true);
|
||||
ui->pollTimeMsSpin->setValue(timing_ms);
|
||||
ui->pollTimeMsSpin->blockSignals(false);
|
||||
}
|
||||
}
|
||||
|
|
61
wfmain.h
61
wfmain.h
|
@ -21,6 +21,8 @@
|
|||
#include <QColor>
|
||||
|
||||
#include "logcategories.h"
|
||||
#include "wfviewtypes.h"
|
||||
#include "prefs.h"
|
||||
#include "commhandler.h"
|
||||
#include "rigcommander.h"
|
||||
#include "rigstate.h"
|
||||
|
@ -204,6 +206,7 @@ signals:
|
|||
void setClusterUserName(QString name);
|
||||
void setClusterPassword(QString pass);
|
||||
void setClusterTimeout(int timeout);
|
||||
void setClusterSkimmerSpots(bool enable);
|
||||
void setFrequencyRange(double low, double high);
|
||||
|
||||
private slots:
|
||||
|
@ -261,7 +264,7 @@ private slots:
|
|||
void receiveRITValue(int ritValHz);
|
||||
void receiveModInput(rigInput input, bool dataOn);
|
||||
//void receiveDuplexMode(duplexMode dm);
|
||||
void receivePassband(quint8 pass);
|
||||
void receivePassband(quint16 pass);
|
||||
|
||||
|
||||
// Levels:
|
||||
|
@ -531,8 +534,6 @@ private slots:
|
|||
|
||||
void on_wfLengthSlider_valueChanged(int value);
|
||||
|
||||
void on_pollingBtn_clicked();
|
||||
|
||||
void on_wfAntiAliasChk_clicked(bool checked);
|
||||
|
||||
void on_wfInterpolateChk_clicked(bool checked);
|
||||
|
@ -697,12 +698,19 @@ private slots:
|
|||
void on_clusterPasswordLineEdit_editingFinished();
|
||||
void on_clusterTimeoutLineEdit_editingFinished();
|
||||
void on_clusterPopOutBtn_clicked();
|
||||
void on_clusterSkimmerSpotsEnable_clicked(bool enable);
|
||||
|
||||
void on_clickDragTuningEnableChk_clicked(bool checked);
|
||||
|
||||
void receiveClusterOutput(QString text);
|
||||
void receiveSpots(QList<spotData> spots);
|
||||
|
||||
void on_autoPollBtn_clicked(bool checked);
|
||||
|
||||
void on_manualPollBtn_clicked(bool checked);
|
||||
|
||||
void on_pollTimeMsSpin_valueChanged(int arg1);
|
||||
|
||||
private:
|
||||
Ui::wfmain *ui;
|
||||
void closeEvent(QCloseEvent *event);
|
||||
|
@ -821,9 +829,6 @@ private:
|
|||
quint16 wfLength;
|
||||
bool spectrumDrawLock;
|
||||
|
||||
enum underlay_t { underlayNone, underlayPeakHold, underlayPeakBuffer, underlayAverageBuffer };
|
||||
|
||||
|
||||
QByteArray spectrumPeaks;
|
||||
QVector <double> spectrumPlasmaLine;
|
||||
QVector <QByteArray> spectrumPlasma;
|
||||
|
@ -926,48 +931,7 @@ private:
|
|||
|
||||
colorPrefsType colorPreset[numColorPresetsTotal];
|
||||
|
||||
struct preferences {
|
||||
bool useFullScreen;
|
||||
bool useSystemTheme;
|
||||
bool drawPeaks;
|
||||
underlay_t underlayMode = underlayNone;
|
||||
int underlayBufferSize = 64;
|
||||
bool wfAntiAlias;
|
||||
bool wfInterpolate;
|
||||
QString stylesheetPath;
|
||||
unsigned char radioCIVAddr;
|
||||
bool CIVisRadioModel;
|
||||
bool forceRTSasPTT;
|
||||
QString serialPortRadio;
|
||||
quint32 serialPortBaud;
|
||||
bool enablePTT;
|
||||
bool niceTS;
|
||||
bool enableLAN;
|
||||
bool enableRigCtlD;
|
||||
quint16 rigCtlPort;
|
||||
int currentColorPresetNumber = 0;
|
||||
QString virtualSerialPort;
|
||||
unsigned char localAFgain;
|
||||
unsigned int wflength;
|
||||
int wftheme;
|
||||
int plotFloor;
|
||||
int plotCeiling;
|
||||
bool confirmExit;
|
||||
bool confirmPowerOff;
|
||||
meterKind meter2Type;
|
||||
quint16 tcpPort;
|
||||
quint8 waterfallFormat;
|
||||
audioType audioSystem;
|
||||
bool clusterUdpEnable;
|
||||
bool clusterTcpEnable;
|
||||
int clusterUdpPort;
|
||||
QString clusterTcpServerName;
|
||||
QString clusterTcpUserName;
|
||||
QString clusterTcpPassword;
|
||||
int clusterTimeout;
|
||||
bool clickDragTuningEnable;
|
||||
} prefs;
|
||||
|
||||
preferences prefs;
|
||||
preferences defPrefs;
|
||||
udpPreferences udpPrefs;
|
||||
udpPreferences udpDefPrefs;
|
||||
|
@ -1037,6 +1001,7 @@ private:
|
|||
|
||||
void insertSlowPeriodicCommand(cmds cmd, unsigned char priority);
|
||||
void calculateTimingParameters();
|
||||
void changePollTiming(int timing_ms, bool setUI=false);
|
||||
|
||||
void changeMode(mode_kind mode);
|
||||
void changeMode(mode_kind mode, bool dataOn);
|
||||
|
|
97
wfmain.ui
97
wfmain.ui
|
@ -6,7 +6,7 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1023</width>
|
||||
<width>1082</width>
|
||||
<height>660</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -18,7 +18,7 @@
|
|||
<item>
|
||||
<widget class="QTabWidget" name="tabWidget">
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
<number>3</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="mainTab">
|
||||
<attribute name="title">
|
||||
|
@ -3147,18 +3147,51 @@
|
|||
<widget class="QComboBox" name="meter2selectionCombo"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="pollingBtn">
|
||||
<widget class="QRadioButton" name="autoPollBtn">
|
||||
<property name="toolTip">
|
||||
<string>Set up radio polling. The radio's meter is polled every-other interval.</string>
|
||||
</property>
|
||||
<property name="accessibleName">
|
||||
<string>Polling</string>
|
||||
</property>
|
||||
<property name="accessibleDescription">
|
||||
<string/>
|
||||
<string>wfview will automatically calculate command polling. Recommended.</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Polling</string>
|
||||
<string>AutoPolling</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">pollingButtonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="manualPollBtn">
|
||||
<property name="toolTip">
|
||||
<string>Manual (user-defined) command polling</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Manual Polling Inteval:</string>
|
||||
</property>
|
||||
<attribute name="buttonGroup">
|
||||
<string notr="true">pollingButtonGroup</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSpinBox" name="pollTimeMsSpin">
|
||||
<property name="toolTip">
|
||||
<string>Sets the polling interval, in ms. Automatic polling is recommended. Serial port and USB port radios should not poll quicker than about 75ms.</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>250</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_50">
|
||||
<property name="text">
|
||||
<string>ms</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -3350,8 +3383,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>799</width>
|
||||
<height>269</height>
|
||||
<width>858</width>
|
||||
<height>287</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
|
@ -5090,11 +5123,44 @@
|
|||
<string>Pop-Out</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QWidget" name="horizontalLayoutWidget_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>470</y>
|
||||
<width>801</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_45">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="clusterSkimmerSpotsEnable">
|
||||
<property name="text">
|
||||
<string>Show Skimmer Spots</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_36">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<zorder>groupBox_9</zorder>
|
||||
<zorder>horizontalLayoutWidget</zorder>
|
||||
<zorder>groupBox_10</zorder>
|
||||
<zorder>clusterOutputTextEdit</zorder>
|
||||
<zorder>clusterPopOutBtn</zorder>
|
||||
<zorder>horizontalLayoutWidget_2</zorder>
|
||||
</widget>
|
||||
<widget class="QWidget" name="experimental">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_28">
|
||||
|
@ -5286,8 +5352,8 @@
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>1023</width>
|
||||
<height>23</height>
|
||||
<width>1082</width>
|
||||
<height>21</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
|
@ -5315,6 +5381,7 @@
|
|||
<connections/>
|
||||
<buttongroups>
|
||||
<buttongroup name="underlayButtonGroup"/>
|
||||
<buttongroup name="pollingButtonGroup"/>
|
||||
<buttongroup name="buttonGroup"/>
|
||||
</buttongroups>
|
||||
</ui>
|
||||
|
|
|
@ -13,7 +13,7 @@ TEMPLATE = app
|
|||
|
||||
CONFIG += console
|
||||
|
||||
DEFINES += WFVIEW_VERSION=\\\"1.52\\\"
|
||||
DEFINES += WFVIEW_VERSION=\\\"1.54\\\"
|
||||
|
||||
DEFINES += BUILD_WFSERVER
|
||||
|
||||
|
@ -169,4 +169,5 @@ HEADERS += servermain.h \
|
|||
ulaw.h \
|
||||
tcpserver.h \
|
||||
audiotaper.h \
|
||||
keyboard.h
|
||||
keyboard.h \
|
||||
wfviewtypes.h
|
||||
|
|
|
@ -14,7 +14,7 @@ greaterThan(QT_MAJOR_VERSION, 4): QT += widgets printsupport
|
|||
TARGET = wfview
|
||||
TEMPLATE = app
|
||||
|
||||
DEFINES += WFVIEW_VERSION=\\\"1.52\\\"
|
||||
DEFINES += WFVIEW_VERSION=\\\"1.54\\\"
|
||||
|
||||
DEFINES += BUILD_WFVIEW
|
||||
|
||||
|
@ -193,6 +193,7 @@ HEADERS += wfmain.h \
|
|||
colorprefs.h \
|
||||
commhandler.h \
|
||||
loggingwindow.h \
|
||||
prefs.h \
|
||||
rigcommander.h \
|
||||
freqmemory.h \
|
||||
rigidentities.h \
|
||||
|
@ -218,6 +219,7 @@ HEADERS += wfmain.h \
|
|||
repeatersetup.h \
|
||||
repeaterattributes.h \
|
||||
rigctld.h \
|
||||
rigstate.h \
|
||||
ulaw.h \
|
||||
usbcontroller.h \
|
||||
controllersetup.h \
|
||||
|
@ -227,7 +229,8 @@ HEADERS += wfmain.h \
|
|||
tcpserver.h \
|
||||
cluster.h \
|
||||
database.h \
|
||||
aboutbox.h
|
||||
aboutbox.h \
|
||||
wfviewtypes.h
|
||||
|
||||
FORMS += wfmain.ui \
|
||||
calibrationwindow.ui \
|
||||
|
|
|
@ -0,0 +1,51 @@
|
|||
#ifndef WFVIEWTYPES_H
|
||||
#define WFVIEWTYPES_H
|
||||
|
||||
enum underlay_t { underlayNone, underlayPeakHold, underlayPeakBuffer, underlayAverageBuffer };
|
||||
|
||||
enum meterKind {
|
||||
meterNone=0,
|
||||
meterS,
|
||||
meterCenter,
|
||||
meterSWR,
|
||||
meterPower,
|
||||
meterALC,
|
||||
meterComp,
|
||||
meterVoltage,
|
||||
meterCurrent,
|
||||
meterRxdB,
|
||||
meterTxMod,
|
||||
meterRxAudio,
|
||||
meterAudio,
|
||||
meterLatency
|
||||
};
|
||||
|
||||
enum spectrumMode {
|
||||
spectModeCenter=0x00,
|
||||
spectModeFixed=0x01,
|
||||
spectModeScrollC=0x02,
|
||||
spectModeScrollF=0x03,
|
||||
spectModeUnknown=0xff
|
||||
};
|
||||
|
||||
struct freqt {
|
||||
quint64 Hz;
|
||||
double MHzDouble;
|
||||
};
|
||||
|
||||
struct datekind {
|
||||
uint16_t year;
|
||||
unsigned char month;
|
||||
unsigned char day;
|
||||
};
|
||||
|
||||
struct timekind {
|
||||
unsigned char hours;
|
||||
unsigned char minutes;
|
||||
bool isMinus;
|
||||
};
|
||||
|
||||
enum audioType {qtAudio,portAudio,rtAudio};
|
||||
|
||||
|
||||
#endif // WFVIEWTYPES_H
|
Ładowanie…
Reference in New Issue