Added control key shortcuts and function key F12 to cause the 7300 to

speak current status.
merge-requests/1/merge
Elliott Liggett 2019-02-01 12:21:54 -08:00
rodzic a361b330d3
commit 47b7a99490
5 zmienionych plików z 104 dodań i 12 usunięć

Wyświetl plik

@ -1070,8 +1070,26 @@ void rigCommander::getRigID()
prepDataAndSend(payload);
}
void rigCommander::sayAll()
{
QByteArray payload;
payload.setRawData("\x13\x00", 2);
prepDataAndSend(payload);
}
void rigCommander::sayFrequency()
{
QByteArray payload;
payload.setRawData("\x13\x01", 2);
prepDataAndSend(payload);
}
void rigCommander::sayMode()
{
QByteArray payload;
payload.setRawData("\x13\x02", 2);
prepDataAndSend(payload);
}
// Other:

Wyświetl plik

@ -57,6 +57,9 @@ public slots:
void getRigID();
void setCIVAddr(unsigned char civAddr);
void handleNewData(const QByteArray &data);
void sayFrequency();
void sayMode();
void sayAll();
void getDebug();
signals:

Wyświetl plik

@ -19,10 +19,6 @@ wfmain::wfmain(QWidget *parent) :
ui->bandStkDataBtn->setVisible(false);
ui->bandStkCWBtn->setVisible(false);
keyF11 = new QShortcut(this);
keyF11->setKey(Qt::Key_F11);
connect(keyF11, SIGNAL(activated()), this, SLOT(shortcutF11()));
keyF1 = new QShortcut(this);
keyF1->setKey(Qt::Key_F1);
connect(keyF1, SIGNAL(activated()), this, SLOT(shortcutF1()));
@ -43,7 +39,6 @@ wfmain::wfmain(QWidget *parent) :
keyF5->setKey(Qt::Key_F5);
connect(keyF5, SIGNAL(activated()), this, SLOT(shortcutF5()));
keyF6 = new QShortcut(this);
keyF6->setKey(Qt::Key_F6);
connect(keyF6, SIGNAL(activated()), this, SLOT(shortcutF6()));
@ -64,6 +59,30 @@ wfmain::wfmain(QWidget *parent) :
keyF10->setKey(Qt::Key_F10);
connect(keyF10, SIGNAL(activated()), this, SLOT(shortcutF10()));
keyF11 = new QShortcut(this);
keyF11->setKey(Qt::Key_F11);
connect(keyF11, SIGNAL(activated()), this, SLOT(shortcutF11()));
keyF12 = new QShortcut(this);
keyF12->setKey(Qt::Key_F12);
connect(keyF12, SIGNAL(activated()), this, SLOT(shortcutF12()));
keyControlT = new QShortcut(this);
keyControlT->setKey(Qt::CTRL + Qt::Key_T);
connect(keyControlT, SIGNAL(activated()), this, SLOT(shortcutControlT()));
keyControlR = new QShortcut(this);
keyControlR->setKey(Qt::CTRL + Qt::Key_R);
connect(keyControlR, SIGNAL(activated()), this, SLOT(shortcutControlR()));
keyControlI = new QShortcut(this);
keyControlI->setKey(Qt::CTRL + Qt::Key_I);
connect(keyControlI, SIGNAL(activated()), this, SLOT(shortcutControlI()));
keyControlU = new QShortcut(this);
keyControlU->setKey(Qt::CTRL + Qt::Key_U);
connect(keyControlU, SIGNAL(activated()), this, SLOT(shortcutControlU()));
keyStar = new QShortcut(this);
keyStar->setKey(Qt::Key_Asterisk);
connect(keyStar, SIGNAL(activated()), this, SLOT(shortcutStar()));
@ -191,6 +210,10 @@ wfmain::wfmain(QWidget *parent) :
connect(this, SIGNAL(getRigID()), rig, SLOT(getRigID()));
connect(rig, SIGNAL(haveATUStatus(unsigned char)), this, SLOT(receiveATUStatus(unsigned char)));
// Speech (emitted from IC-7300 speaker)
connect(this, SIGNAL(sayAll()), rig, SLOT(sayAll()));
connect(this, SIGNAL(sayFrequency()), rig, SLOT(sayFrequency()));
connect(this, SIGNAL(sayMode()), rig, SLOT(sayMode()));
// Plot user interaction
connect(plot, SIGNAL(mouseDoubleClick(QMouseEvent*)), this, SLOT(handlePlotDoubleClick(QMouseEvent*)));
@ -512,8 +535,6 @@ void wfmain::shortcutF9()
ui->modeSelectCombo->setCurrentIndex(9);
}
void wfmain::shortcutF10()
{
// Build information, debug, whatever you wish
@ -521,6 +542,38 @@ void wfmain::shortcutF10()
showStatusBarText(buildInfo);
}
void wfmain::shortcutF12()
{
// Speak current frequency and mode via IC-7300
showStatusBarText("Sending speech command to radio.");
emit sayAll();
}
void wfmain::shortcutControlT()
{
// Transmit
qDebug() << "Activated Control-T shortcut";
ui->pttOnBtn->click();
}
void wfmain::shortcutControlR()
{
// Receive
ui->pttOffBtn->click();
}
void wfmain::shortcutControlI()
{
// Enable ATU
ui->tuneEnableChk->click();
}
void wfmain::shortcutControlU()
{
// Run ATU tuning cycle
ui->tuneNowBtn->click();
}
void wfmain::shortcutStar()
{
// Jump to frequency tab from Asterisk key on keypad
@ -532,8 +585,7 @@ void wfmain::shortcutStar()
void wfmain::shortcutSlash()
{
// Cycle through available modes
// mode+=1%maxmodes
// TODO
ui->modeSelectCombo->setCurrentIndex( (ui->modeSelectCombo->currentIndex()+1) % ui->modeSelectCombo->count() );
}
void wfmain::getInitialRigState()

Wyświetl plik

@ -58,9 +58,12 @@ signals:
void getScopeMode();
void getScopeEdge();
void getScopeSpan();
void sayFrequency();
void sayMode();
void sayAll();
private slots:
void shortcutF11();
void shortcutF1();
void shortcutF2();
void shortcutF3();
@ -72,6 +75,13 @@ private slots:
void shortcutF8();
void shortcutF9();
void shortcutF10();
void shortcutF11();
void shortcutF12();
void shortcutControlT();
void shortcutControlR();
void shortcutControlI();
void shortcutControlU();
void shortcutStar();
void shortcutSlash();
@ -219,7 +229,6 @@ private:
QStringList portList;
QString serialPortRig;
QShortcut *keyF11;
QShortcut *keyF1;
QShortcut *keyF2;
QShortcut *keyF3;
@ -231,6 +240,13 @@ private:
QShortcut *keyF8;
QShortcut *keyF9;
QShortcut *keyF10;
QShortcut *keyF11;
QShortcut *keyF12;
QShortcut *keyControlT;
QShortcut *keyControlR;
QShortcut *keyControlI;
QShortcut *keyControlU;
QShortcut *keyStar;

Wyświetl plik

@ -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">
@ -1117,6 +1117,9 @@
<property name="text">
<string>PTT On</string>
</property>
<property name="shortcut">
<string>Ctrl+S</string>
</property>
</widget>
</item>
<item>