Merge remote-tracking branch 'origin/ui-enhance' into lan-alpha

merge-requests/2/head
Phil Taylor 2021-02-28 20:23:31 +00:00
commit b4ea60e5d2
4 zmienionych plików z 65 dodań i 27 usunięć

Wyświetl plik

@ -16,7 +16,7 @@
// The IC-7300 "full" manual also contains a command reference.
// How to make spectrum display stop using rigctl:
// echo "w \0xFE\0xFE\0x94\0xE0\0x27\0x11\0x00\0xFD" | rigctl -m 373 -r /dev/ttyUSB0 -s 115200 -vvvvv
// echo "w \0xFE\0xFE\0x94\0xE0\0x27\0x11\0x00\0xFD" | rigctl -m 3073 -r /dev/ttyUSB0 -s 115200 -vvvvv
// Note: When sending \x00, must use QByteArray.setRawData()
@ -242,7 +242,7 @@ void rigCommander::disableSpectrumDisplay()
void rigCommander::setSpectrumBounds(double startFreq, double endFreq, unsigned char edgeNumber)
{
if((edgeNumber > 3) || (!edgeNumber))
if((edgeNumber > 4) || (!edgeNumber))
{
return;
}
@ -307,7 +307,7 @@ void rigCommander::setSpectrumBounds(double startFreq, double endFreq, unsigned
}
QByteArray lowerEdge = makeFreqPayload(startFreq);
QByteArray lowerEdge = makeFreqPayload(startFreq);
QByteArray higherEdge = makeFreqPayload(endFreq);
@ -342,7 +342,7 @@ void rigCommander::setScopeEdge(char edge)
{
// 1 2 or 3
// 27 16 00 0X
if((edge <1) || (edge >3))
if((edge <1) || (edge >4))
return;
QByteArray payload;
payload.setRawData("\x27\x16\x00", 3);

Wyświetl plik

@ -257,7 +257,7 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, QWidget *parent
spans << "50k" << "100k" << "250k" << "500k";
ui->scopeBWCombo->insertItems(0, spans);
edges << "1" << "2" << "3"; // yep
edges << "1" << "2" << "3" << "4"; // yep
ui->scopeEdgeCombo->insertItems(0, edges);
ui->splitter->setHandleWidth(5);
@ -429,8 +429,8 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, QWidget *parent
drawPeaks = false;
SMeterReadings.fill(0,10);
powerMeterReadings.fill(0,10);
SMeterReadings.fill(0,30);
powerMeterReadings.fill(0,30);
ui->freqMhzLineEdit->setValidator( new QDoubleValidator(0, 100, 6, this));
@ -443,6 +443,9 @@ wfmain::wfmain(const QString serialPortCL, const QString hostCL, QWidget *parent
pttTimer->setSingleShot(true);
connect(pttTimer, SIGNAL(timeout()), this, SLOT(handlePttLimit()));
amTransmitting = false;
ui->tuneLockChk->setChecked(false);
freqLock = false;
// Not needed since we automate this now.
/*
@ -1194,6 +1197,7 @@ void wfmain::setTuningSteps()
tsPlusShift = 0.0001f;
tsPage = 1.0f;
tsPageShift = 0.5f; // TODO, unbind this keystroke from the dial
tsWfScroll = 0.0001f;
}
double wfmain::roundFrequency(double frequency)
@ -2016,8 +2020,7 @@ void wfmain::handlePlotDoubleClick(QMouseEvent *me)
//y = plot->yAxis->pixelToCoord(me->pos().y());
x = plot->xAxis->pixelToCoord(me->pos().x());
emit setFrequency(x);
cmdOut = cmdGetFreq;
delayedCommand->start();
issueDelayedCommand(cmdGetFreq);
showStatusBarText(QString("Going to %1 MHz").arg(x));
}
}
@ -2033,8 +2036,7 @@ void wfmain::handleWFDoubleClick(QMouseEvent *me)
{
x = plot->xAxis->pixelToCoord(me->pos().x());
emit setFrequency(x);
cmdOut = cmdGetFreq;
delayedCommand->start();
issueDelayedCommand(cmdGetFreq);
showStatusBarText(QString("Going to %1 MHz").arg(x));
}
}
@ -2058,36 +2060,54 @@ void wfmain::handleWFScroll(QWheelEvent *we)
// We will click the dial once for every 120 received.
//QPoint delta = we->angleDelta();
// TODO: Use other method, knob has too few positions to be useful for large steps.
if(freqLock)
return;
int clicks = we->angleDelta().y() / 120;
float steps = tsWfScroll * clicks;
int steps = we->angleDelta().y() / 120;
Qt::KeyboardModifiers key= we->modifiers();
if (key == Qt::ShiftModifier)
{
steps *=20;
steps /= 10;
} else if (key == Qt::ControlModifier)
{
steps *=10;
}
ui->freqDial->setValue( ui->freqDial->value() + (steps)*ui->freqDial->singleStep() );
freqMhz = roundFrequency(freqMhz - steps);
knobFreqMhz = freqMhz;
emit setFrequency(freqMhz);
ui->freqLabel->setText(QString("%1").arg(freqMhz, 0, 'f'));
issueDelayedCommand(cmdGetFreq);
}
void wfmain::handlePlotScroll(QWheelEvent *we)
{
int steps = we->angleDelta().y() / 120;
if(freqLock)
return;
int clicks = we->angleDelta().y() / 120;
float steps = tsWfScroll * clicks;
Qt::KeyboardModifiers key= we->modifiers();
if (key == Qt::ShiftModifier)
{
// TODO: Zoom
steps /= 10;
} else if (key == Qt::ControlModifier)
{
steps *=10;
}
ui->freqDial->setValue( ui->freqDial->value() + (steps)*ui->freqDial->singleStep() );
freqMhz = roundFrequency(freqMhz - steps);
knobFreqMhz = freqMhz;
emit setFrequency(freqMhz);
ui->freqLabel->setText(QString("%1").arg(freqMhz, 0, 'f'));
issueDelayedCommand(cmdGetFreq);
}
void wfmain::on_scopeEnableWFBtn_clicked(bool checked)
@ -2204,9 +2224,7 @@ void wfmain::on_goFreqBtn_clicked()
if(ok)
{
emit setFrequency(freq);
// TODO: change to cmdQueue
cmdOut = cmdGetFreq;
delayedCommand->start();
issueDelayedCommand(cmdGetFreq);
}
ui->freqMhzLineEdit->selectAll();
freqTextSelected = true;

Wyświetl plik

@ -604,6 +604,7 @@ private:
float tsPlusControl;
float tsPage;
float tsPageShift;
float tsWfScroll;

Wyświetl plik

@ -18,7 +18,7 @@
<item>
<widget class="QTabWidget" name="tabWidget">
<property name="currentIndex">
<number>3</number>
<number>0</number>
</property>
<widget class="QWidget" name="mainTab">
<attribute name="title">
@ -63,7 +63,11 @@
</widget>
</item>
<item>
<widget class="QComboBox" name="scopeBWCombo"/>
<widget class="QComboBox" name="scopeBWCombo">
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_7">
@ -73,7 +77,11 @@
</widget>
</item>
<item>
<widget class="QComboBox" name="scopeEdgeCombo"/>
<widget class="QComboBox" name="scopeEdgeCombo">
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="toFixedBtn">
@ -247,6 +255,9 @@
<property name="toolTip">
<string>Tuning Step Selection possibly. Or not...</string>
</property>
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
</widget>
</item>
<item>
@ -277,7 +288,11 @@
</widget>
</item>
<item>
<widget class="QComboBox" name="modeSelectCombo"/>
<widget class="QComboBox" name="modeSelectCombo">
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="dataModeBtn">
@ -297,7 +312,11 @@
</widget>
</item>
<item>
<widget class="QComboBox" name="modeFilterCombo"/>
<widget class="QComboBox" name="modeFilterCombo">
<property name="sizeAdjustPolicy">
<enum>QComboBox::AdjustToContents</enum>
</property>
</widget>
</item>
</layout>
</item>
@ -1978,7 +1997,7 @@
<x>0</x>
<y>0</y>
<width>810</width>
<height>21</height>
<height>22</height>
</rect>
</property>
</widget>