Starting to implement CAT control. Not finished yet, and there may be bugs!

PTT control not yet done...


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@3078 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2013-03-24 12:55:13 +00:00
parent 82936270dc
commit b752c8c517
5 changed files with 1191 additions and 238 deletions

View File

@ -113,9 +113,19 @@ void DevSetup::initDlg()
}
}
connect(&p4, SIGNAL(readyReadStandardOutput()),
this, SLOT(p4ReadFromStdout()));
connect(&p4, SIGNAL(readyReadStandardError()),
this, SLOT(p4ReadFromStderr()));
connect(&p4, SIGNAL(error(QProcess::ProcessError)),
this, SLOT(p4Error()));
p4.start("rigctl -l");
p4.waitForFinished(1000);
ui.myCallEntry->setText(m_myCall);
ui.myGridEntry->setText(m_myGrid);
ui.idIntSpinBox->setValue(m_idInt);
ui.pttMethodComboBox->setCurrentIndex(m_pttMethodIndex);
ui.pttComboBox->setCurrentIndex(m_pttPort);
ui.saveDirEntry->setText(m_saveDir);
ui.comboBoxSndIn->setCurrentIndex(m_nDevIn);
@ -123,6 +133,20 @@ void DevSetup::initDlg()
ui.cbPSKReporter->setChecked(m_pskReporter);
m_paInDevice=m_inDevList[m_nDevIn];
m_paOutDevice=m_outDevList[m_nDevOut];
ui.cbEnableCAT->setChecked(m_catEnabled);
ui.catPortComboBox->setEnabled(m_catEnabled);
ui.rigComboBox->setEnabled(m_catEnabled);
ui.serialRateComboBox->setEnabled(m_catEnabled);
ui.dataBitsComboBox->setEnabled(m_catEnabled);
ui.stopBitsComboBox->setEnabled(m_catEnabled);
ui.handshakeComboBox->setEnabled(m_catEnabled);
ui.rigComboBox->setCurrentIndex(m_rigIndex);
ui.catPortComboBox->setCurrentIndex(m_catPortIndex);
ui.serialRateComboBox->setCurrentIndex(m_serialRateIndex);
ui.dataBitsComboBox->setCurrentIndex(m_dataBitsIndex);
ui.stopBitsComboBox->setCurrentIndex(m_stopBitsIndex);
ui.handshakeComboBox->setCurrentIndex(m_handshakeIndex);
ui.macro1->setText(m_macro[0].toUpper());
ui.macro2->setText(m_macro[1].toUpper());
@ -153,6 +177,7 @@ void DevSetup::accept()
m_myCall=ui.myCallEntry->text();
m_myGrid=ui.myGridEntry->text();
m_idInt=ui.idIntSpinBox->value();
m_pttMethodIndex=ui.pttMethodComboBox->currentIndex();
m_pttPort=ui.pttComboBox->currentIndex();
m_saveDir=ui.saveDirEntry->text();
m_nDevIn=ui.comboBoxSndIn->currentIndex();
@ -175,6 +200,39 @@ void DevSetup::accept()
QDialog::accept();
}
void DevSetup::p4ReadFromStdout() //p4readFromStdout
{
while(p4.canReadLine()) {
QString t(p4.readLine());
QString t1,t2,t3;
if(t.mid(0,6)!=" Rig #") {
t1=t.mid(0,6);
t2=t.mid(8,22).trimmed();
t3=t.mid(31,23).trimmed();
t=t1 + " " + t2 + " " + t3;
ui.rigComboBox->addItem(t);
}
}
}
void DevSetup::p4ReadFromStderr() //p4readFromStderr
{
QByteArray t=p4.readAllStandardError();
if(t.length()>0) {
msgBox(t);
}
}
void DevSetup::p4Error() //p4rror
{
msgBox("Error running 'rigctl -l'.");
}
void DevSetup::msgBox(QString t) //msgBox
{
msgBox0.setText(t);
msgBox0.exec();
}
void DevSetup::on_myCallEntry_editingFinished()
{
@ -193,3 +251,56 @@ void DevSetup::on_cbPSKReporter_clicked(bool b)
{
m_pskReporter=b;
}
void DevSetup::on_pttMethodComboBox_activated(int index)
{
m_pttMethodIndex=index;
}
void DevSetup::on_catPortComboBox_activated(int index)
{
m_catPortIndex=index;
m_catPort=ui.catPortComboBox->itemText(index);
}
void DevSetup::on_cbEnableCAT_toggled(bool b)
{
m_catEnabled=b;
ui.catPortComboBox->setEnabled(b);
ui.rigComboBox->setEnabled(b);
ui.serialRateComboBox->setEnabled(b);
ui.dataBitsComboBox->setEnabled(b);
ui.stopBitsComboBox->setEnabled(b);
ui.handshakeComboBox->setEnabled(b);
}
void DevSetup::on_serialRateComboBox_activated(int index)
{
m_serialRateIndex=index;
m_serialRate=ui.serialRateComboBox->itemText(index).toInt();
}
void DevSetup::on_handshakeComboBox_activated(int index)
{
m_handshakeIndex=index;
m_handshake=ui.handshakeComboBox->itemText(index);
}
void DevSetup::on_dataBitsComboBox_activated(int index)
{
m_dataBitsIndex=index;
m_dataBits=ui.dataBitsComboBox->itemText(index).toInt();
}
void DevSetup::on_stopBitsComboBox_activated(int index)
{
m_stopBitsIndex=index;
m_stopBits=ui.stopBitsComboBox->itemText(index).toInt();
}
void DevSetup::on_rigComboBox_activated(int index)
{
m_rigIndex=index;
QString t=ui.rigComboBox->itemText(index);
m_rig=t.mid(0,7).toInt();
}

View File

@ -2,6 +2,8 @@
#define DEVSETUP_H
#include <QDialog>
#include <QProcess>
#include <QMessageBox>
#include "ui_devsetup.h"
class DevSetup : public QDialog
@ -13,6 +15,7 @@ public:
void initDlg();
qint32 m_idInt;
qint32 m_pttMethodIndex;
qint32 m_pttPort;
qint32 m_nDevIn;
qint32 m_nDevOut;
@ -20,28 +23,60 @@ public:
qint32 m_outDevList[100];
qint32 m_paInDevice;
qint32 m_paOutDevice;
qint32 m_catPortIndex;
qint32 m_rig;
qint32 m_rigIndex;
qint32 m_serialRate;
qint32 m_serialRateIndex;
qint32 m_dataBits;
qint32 m_dataBitsIndex;
qint32 m_stopBits;
qint32 m_stopBitsIndex;
qint32 m_handshakeIndex;
bool m_restartSoundIn;
bool m_restartSoundOut;
bool m_pskReporter;
bool m_firstCall;
bool m_catEnabled;
QString m_myCall;
QString m_myGrid;
QString m_saveDir;
QString m_azelDir;
QString m_catPort;
QString m_handshake;
QStringList m_macro;
QProcess p4;
QMessageBox msgBox0;
public slots:
void accept();
void p4ReadFromStdout();
void p4ReadFromStderr();
void p4Error();
private slots:
void on_myCallEntry_editingFinished();
void on_myGridEntry_editingFinished();
void on_cbPSKReporter_clicked(bool checked);
void on_pttMethodComboBox_activated(int index);
void on_catPortComboBox_activated(int index);
void on_cbEnableCAT_toggled(bool checked);
void on_serialRateComboBox_activated(int index);
void on_handshakeComboBox_activated(int index);
void on_dataBitsComboBox_activated(int index);
void on_stopBitsComboBox_activated(int index);
void on_rigComboBox_activated(int index);
private:
void msgBox(QString t);
Ui::DialogSndCard ui;
};

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>462</width>
<height>362</height>
<height>478</height>
</rect>
</property>
<property name="windowTitle">
@ -23,81 +23,60 @@
<attribute name="title">
<string>Station</string>
</attribute>
<widget class="QWidget" name="layoutWidget">
<widget class="QWidget" name="">
<property name="geometry">
<rect>
<x>10</x>
<y>34</y>
<x>11</x>
<y>10</y>
<width>421</width>
<height>221</height>
<height>385</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QLabel" name="label">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<width>80</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>80</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>My Call:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>My Grid:</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_3">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>ID Interval (min):</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>PTT Port:</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QLineEdit" name="myCallEntry">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>90</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<width>90</width>
<height>16777215</height>
</size>
</property>
@ -106,8 +85,58 @@
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>20</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>80</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>My Grid:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="myGridEntry">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>60</width>
@ -119,36 +148,138 @@
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QSpinBox" name="idIntSpinBox">
<property name="enabled">
<bool>false</bool>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_5">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<width>80</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-20</number>
<property name="text">
<string>PTT method:</string>
</property>
<property name="maximum">
<number>10</number>
</widget>
</item>
<item>
<widget class="QComboBox" name="pttMethodComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>90</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>90</width>
<height>16777215</height>
</size>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<item>
<property name="text">
<string>CAT</string>
</property>
</item>
<item>
<property name="text">
<string>DTR</string>
</property>
</item>
<item>
<property name="text">
<string>RTS</string>
</property>
</item>
<item>
<property name="text">
<string>VOX</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_9">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>80</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>PTT Port:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="pttComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>60</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="editable">
<bool>false</bool>
</property>
<item>
<property name="text">
<string>None</string>
@ -219,40 +350,631 @@
<string>COM13</string>
</property>
</item>
<item>
<property name="text">
<string>COM14</string>
</property>
</item>
<item>
<property name="text">
<string>COM15</string>
</property>
</item>
<item>
<property name="text">
<string>USB</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_4"/>
</item>
<layout class="QHBoxLayout" name="horizontalLayout_6">
<item>
<layout class="QVBoxLayout" name="verticalLayout_5">
<item>
<widget class="QCheckBox" name="cbPSKReporter">
<widget class="QLabel" name="label_3">
<property name="minimumSize">
<size>
<width>0</width>
<height>20</height>
</size>
</property>
<property name="text">
<string>Enable PSK Reporter</string>
<string>ID Interval (min):</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
<widget class="QSpinBox" name="idIntSpinBox">
<property name="enabled">
<bool>false</bool>
</property>
<property name="sizeType">
<enum>QSizePolicy::Expanding</enum>
<property name="maximumSize">
<size>
<width>60</width>
<height>16777215</height>
</size>
</property>
<property name="minimum">
<number>-20</number>
</property>
<property name="maximum">
<number>10</number>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QCheckBox" name="cbPSKReporter">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>146</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>146</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Enable PSK Reporter</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>15</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_7">
<item>
<widget class="QCheckBox" name="cbEnableCAT">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>77</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>77</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Enable CAT</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>20</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>20</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Rig:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="rigComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="QLabel" name="label_21">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>80</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>CAT port:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="catPortComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>90</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>90</width>
<height>16777215</height>
</size>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<item>
<property name="text">
<string>None</string>
</property>
</item>
<item>
<property name="text">
<string>COM1</string>
</property>
</item>
<item>
<property name="text">
<string>COM2</string>
</property>
</item>
<item>
<property name="text">
<string>COM3</string>
</property>
</item>
<item>
<property name="text">
<string>COM4</string>
</property>
</item>
<item>
<property name="text">
<string>COM5</string>
</property>
</item>
<item>
<property name="text">
<string>COM6</string>
</property>
</item>
<item>
<property name="text">
<string>COM7</string>
</property>
</item>
<item>
<property name="text">
<string>COM8</string>
</property>
</item>
<item>
<property name="text">
<string>COM9</string>
</property>
</item>
<item>
<property name="text">
<string>COM10</string>
</property>
</item>
<item>
<property name="text">
<string>COM11</string>
</property>
</item>
<item>
<property name="text">
<string>COM12</string>
</property>
</item>
<item>
<property name="text">
<string>COM13</string>
</property>
</item>
<item>
<property name="text">
<string>COM14</string>
</property>
</item>
<item>
<property name="text">
<string>COM15</string>
</property>
</item>
<item>
<property name="text">
<string>USB</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_4">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_24">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Data bits:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="dataBitsComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<item>
<property name="text">
<string>7</string>
</property>
</item>
<item>
<property name="text">
<string>8</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_9">
<item>
<widget class="QLabel" name="label_22">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>80</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Serial rate:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="serialRateComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>90</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>90</width>
<height>16777215</height>
</size>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<item>
<property name="text">
<string>1200</string>
</property>
</item>
<item>
<property name="text">
<string>4800</string>
</property>
</item>
<item>
<property name="text">
<string>9600</string>
</property>
</item>
<item>
<property name="text">
<string>19200</string>
</property>
</item>
<item>
<property name="text">
<string>38400</string>
</property>
</item>
<item>
<property name="text">
<string>57600</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="label_25">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Stop bits:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="stopBitsComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>50</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>50</width>
<height>16777215</height>
</size>
</property>
<property name="currentIndex">
<number>1</number>
</property>
<item>
<property name="text">
<string>1</string>
</property>
</item>
<item>
<property name="text">
<string>2</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_10">
<item>
<widget class="QLabel" name="label_23">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>80</width>
<height>16777215</height>
</size>
</property>
<property name="text">
<string>Handshake:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="handshakeComboBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>90</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>90</width>
<height>16777215</height>
</size>
</property>
<property name="currentIndex">
<number>2</number>
</property>
<item>
<property name="text">
<string>None</string>
</property>
</item>
<item>
<property name="text">
<string>XonXoff</string>
</property>
</item>
<item>
<property name="text">
<string>Hardware</string>
</property>
</item>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_6">
<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>
</item>
<item>
@ -263,7 +985,7 @@
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
<height>15</height>
</size>
</property>
</spacer>
@ -339,19 +1061,6 @@
</item>
</layout>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>

View File

@ -1,4 +1,4 @@
//--------------------------------------------------------------- MainWindow
//---------------------------------------------------------------- MainWindow
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "devsetup.h"
@ -281,6 +281,7 @@ void MainWindow::writeSettings()
settings.setValue("MyCall",m_myCall);
settings.setValue("MyGrid",m_myGrid);
settings.setValue("IDint",m_idInt);
settings.setValue("PTTmethod",m_pttMethodIndex);
settings.setValue("PTTport",m_pttPort);
settings.setValue("SaveDir",m_saveDir);
settings.setValue("SoundInIndex",m_nDevIn);
@ -309,6 +310,19 @@ void MainWindow::writeSettings()
settings.setValue("toRTTY",m_toRTTY);
settings.setValue("NoSuffix",m_noSuffix);
settings.setValue("dBtoComments",m_dBtoComments);
settings.setValue("catEnabled",m_catEnabled);
settings.setValue("Rig",m_rig);
settings.setValue("RigIndex",m_rigIndex);
settings.setValue("CATport",m_catPort);
settings.setValue("CATportIndex",m_catPortIndex);
settings.setValue("SerialRate",m_serialRate);
settings.setValue("SerialRateIndex",m_serialRateIndex);
settings.setValue("DataBits",m_dataBits);
settings.setValue("DataBitsIndex",m_dataBitsIndex);
settings.setValue("StopBits",m_stopBits);
settings.setValue("StopBitsIndex",m_stopBitsIndex);
settings.setValue("Handshake",m_handshake);
settings.setValue("HandshakeIndex",m_handshakeIndex);
settings.endGroup();
}
@ -332,6 +346,7 @@ void MainWindow::readSettings()
m_myCall=settings.value("MyCall","").toString();
m_myGrid=settings.value("MyGrid","").toString();
m_idInt=settings.value("IDint",0).toInt();
m_pttMethodIndex=settings.value("PTTmethod",1).toInt();
m_pttPort=settings.value("PTTport",0).toInt();
m_saveDir=settings.value("SaveDir",m_appDir + "/save").toString();
m_nDevIn = settings.value("SoundInIndex", 0).toInt();
@ -379,6 +394,20 @@ void MainWindow::readSettings()
ui->actionLog_JT9_without_submode->setChecked(m_noSuffix);
m_dBtoComments=settings.value("dBtoComments",false).toBool();
ui->actionLog_dB_reports_to_Comments->setChecked(m_dBtoComments);
m_catEnabled=settings.value("catEnabled",false).toBool();
m_rig=settings.value("Rig",214).toInt();
m_rigIndex=settings.value("RigIndex",100).toInt();
m_catPort=settings.value("CATport","None").toString();
m_catPortIndex=settings.value("CATportIndex",0).toInt();
m_serialRate=settings.value("SerialRate",4800).toInt();
m_serialRateIndex=settings.value("SerialRateIndex",1).toInt();
m_dataBits=settings.value("DataBits",8).toInt();
m_dataBitsIndex=settings.value("DataBitsIndex",1).toInt();
m_stopBits=settings.value("StopBits",8).toInt();
m_stopBitsIndex=settings.value("StopBitsIndex",1).toInt();
m_handshake=settings.value("Handshake","None").toString();
m_handshakeIndex=settings.value("HandshakeIndex",0).toInt();
settings.endGroup();
if(!ui->actionLinrad->isChecked() && !ui->actionCuteSDR->isChecked() &&
@ -464,18 +493,32 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog
dlg.m_myCall=m_myCall;
dlg.m_myGrid=m_myGrid;
dlg.m_idInt=m_idInt;
dlg.m_pttMethodIndex=m_pttMethodIndex;
dlg.m_pttPort=m_pttPort;
dlg.m_saveDir=m_saveDir;
dlg.m_nDevIn=m_nDevIn;
dlg.m_nDevOut=m_nDevOut;
dlg.m_pskReporter=m_pskReporter;
dlg.m_macro=m_macro;
dlg.m_catEnabled=m_catEnabled;
dlg.m_rig=m_rig;
dlg.m_rigIndex=m_rigIndex;
dlg.m_catPort=m_catPort;
dlg.m_catPortIndex=m_catPortIndex;
dlg.m_serialRate=m_serialRate;
dlg.m_serialRateIndex=m_serialRateIndex;
dlg.m_dataBits=m_dataBits;
dlg.m_dataBitsIndex=m_dataBitsIndex;
dlg.m_stopBits=m_stopBits;
dlg.m_stopBitsIndex=m_stopBitsIndex;
dlg.m_handshake=m_handshake;
dlg.m_handshakeIndex=m_handshakeIndex;
dlg.initDlg();
if(dlg.exec() == QDialog::Accepted) {
m_myCall=dlg.m_myCall;
m_myGrid=dlg.m_myGrid;
m_idInt=dlg.m_idInt;
m_pttMethodIndex=dlg.m_pttMethodIndex;
m_pttPort=dlg.m_pttPort;
m_saveDir=dlg.m_saveDir;
m_nDevIn=dlg.m_nDevIn;
@ -483,6 +526,19 @@ void MainWindow::on_actionDeviceSetup_triggered() //Setup Dialog
m_nDevOut=dlg.m_nDevOut;
m_paOutDevice=dlg.m_paOutDevice;
m_macro=dlg.m_macro;
m_catEnabled=dlg.m_catEnabled;
m_rig=dlg.m_rig;
m_rigIndex=dlg.m_rigIndex;
m_catPort=dlg.m_catPort;
m_catPortIndex=dlg.m_catPortIndex;
m_serialRate=dlg.m_serialRate;
m_serialRateIndex=dlg.m_serialRateIndex;
m_dataBits=dlg.m_dataBits;
m_dataBitsIndex=dlg.m_dataBitsIndex;
m_stopBits=dlg.m_stopBits;
m_stopBitsIndex=dlg.m_stopBitsIndex;
m_handshake=dlg.m_handshake;
m_handshakeIndex=dlg.m_handshakeIndex;
#ifdef WIN32
if(dlg.m_pskReporter!=m_pskReporter) {
@ -1167,14 +1223,20 @@ void MainWindow::guiUpdate()
bTxTime=true;
if(bTxTime and iptt==0 and !btxMute) {
int itx=1;
int ierr = ptt(m_pttPort,itx,&iptt); // Raise PTT
/*
if(ierr<0) {
on_stopTxButton_clicked();
char s[18];
sprintf(s,"PTT Error %d",ierr);
msgBox(s);
//Raise PTT
if(m_pttMethodIndex==0) {
m_cmnd=rig_command() + " T 1";
p3.start(m_cmnd);
p3.waitForFinished();
}
if(m_pttMethodIndex==1 or m_pttMethodIndex==2) {
// ptt(m_pttPort,1,&m_iptt,&m_COMportOpen);
ptt(m_pttPort,1,&m_iptt);
}
*/
if(!soundOutThread.isRunning()) {
@ -1266,13 +1328,20 @@ void MainWindow::guiUpdate()
if(nc0 == 0) {
int itx=0;
int ierr=ptt(m_pttPort,itx,&iptt); // Lower PTT
/*
if(ierr<0) {
char s[18];
sprintf(s,"PTT Error %d",ierr);
msgBox(s);
//Lower PTT
if(m_pttMethodIndex==0) {
m_cmnd=rig_command() + " T 0";
p3.start(m_cmnd);
p3.waitForFinished();
}
if(m_pttMethodIndex==1 or m_pttMethodIndex==2) {
// ptt(m_pttPort,0,&m_iptt,&m_COMportOpen);
ptt(m_pttPort,0,&m_iptt);
}
*/
if(!btxMute) soundOutThread.quitExecution=true;
m_transmitting=false;
if(m_auto) {
@ -1348,6 +1417,17 @@ void MainWindow::guiUpdate()
btxok0=btxok;
}
QString MainWindow::rig_command()
{
QString cmnd1,cmnd2;
cmnd1.sprintf("rigctl -m %d -r ",m_rig);
cmnd1+=m_catPort;
cmnd2.sprintf(" -s %d -C data_bits=%d -C stop_bits=%d -C serial_handshake=",
m_serialRate,m_dataBits,m_stopBits);
cmnd2+=m_handshake;
return cmnd1+cmnd2;
}
void MainWindow::ba2msg(QByteArray ba, char message[]) //ba2msg()
{
bool eom;
@ -1627,7 +1707,6 @@ void MainWindow::msgtype(QString t, QLineEdit* tx) //msgtype()
char message[23];
char msgsent[23];
int len1=22;
int jtone[85];
t=t.toUpper();
QByteArray s=t.toUpper().toLocal8Bit();

View File

@ -139,6 +139,7 @@ private:
qint32 m_nDevOut;
qint32 m_idInt;
qint32 m_waterfallAvg;
qint32 m_pttMethodIndex;
qint32 m_tol;
qint32 m_QSOfreq0;
qint32 m_ntx;
@ -161,6 +162,20 @@ private:
qint32 m_len1;
qint32 m_inGain;
qint32 m_nsave;
qint32 m_catPortIndex;
qint32 m_rig;
qint32 m_rigIndex;
qint32 m_serialRate;
qint32 m_serialRateIndex;
qint32 m_dataBits;
qint32 m_dataBitsIndex;
qint32 m_stopBits;
qint32 m_stopBitsIndex;
qint32 m_handshakeIndex;
qint32 m_ncw;
qint32 m_secID;
qint32 m_COMportOpen;
qint32 m_iptt;
bool m_monitoring;
bool m_transmitting;
@ -188,6 +203,7 @@ private:
bool m_noSuffix;
bool m_toRTTY;
bool m_dBtoComments;
bool m_catEnabled;
char m_decoded[80];
@ -212,6 +228,7 @@ private:
QFutureWatcher<void>* watcher3;
QProcess proc_jt9;
QProcess p3;
QString m_path;
QString m_pbdecoding_style1;
@ -232,8 +249,10 @@ private:
QString m_rptRcvd;
QString m_qsoStart;
QString m_qsoStop;
QString m_catPort;
QString m_handshake;
QStringList m_macro;
QString m_cmnd;
SoundInThread soundInThread; //Instantiate the audio threads
SoundOutThread soundOutThread;
@ -250,8 +269,8 @@ private:
void msgtype(QString t, QLineEdit* tx);
void stub();
void statusChanged();
bool gridOK(QString g);
QString rig_command();
};
extern void getfile(QString fname, int ntrperiod);