Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion core/Migration.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Migration : public QObject
QString fixIntlField(QSqlQuery &query, const QString &columName, const QString &columnNameIntl);
bool refreshUploadStatusTrigger();

static const int latestVersion = 34;
static const int latestVersion = 35;
};

#endif // QLOG_CORE_MIGRATION_H
19 changes: 15 additions & 4 deletions data/RigProfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ QDataStream& operator<<(QDataStream& out, const RigProfile& v)
<< v.xitOffset << v.getRITInfo << v.getXITInfo
<< v.defaultPWR << v.getPTTInfo << v.QSYWiping
<< v.getKeySpeed << v.assignedCWKey << v.keySpeedSync
<< v.driver << v.dxSpot2Rig << v.pttType << v.pttPortPath;
<< v.driver << v.dxSpot2Rig << v.pttType << v.pttPortPath
<< v.rts << v.dtr;

return out;
}
Expand Down Expand Up @@ -57,6 +58,8 @@ QDataStream& operator>>(QDataStream& in, RigProfile& v)
in >> v.dxSpot2Rig;
in >> v.pttType;
in >> v.pttPortPath;
in >> v.rts;
in >> v.dtr;

return in;
}
Expand All @@ -73,7 +76,8 @@ RigProfilesManager::RigProfilesManager() :
"pollinterval, txfreq_start, txfreq_end, get_freq, get_mode, "
"get_vfo, get_pwr, rit_offset, xit_offset, get_rit, get_xit, "
"default_pwr, get_ptt, qsy_wiping, get_key_speed, assigned_cw_key, "
"key_speed_sync, driver, dxspot2rig, ptt_type, ptt_port_pathname "
"key_speed_sync, driver, dxspot2rig, ptt_type, ptt_port_pathname, "
"rts, dtr "
"FROM rig_profiles") )
{
qWarning()<< "Cannot prepare select";
Expand Down Expand Up @@ -115,6 +119,8 @@ RigProfilesManager::RigProfilesManager() :
profileDB.dxSpot2Rig = profileQuery.value(28).toBool();
profileDB.pttType = profileQuery.value(29).toString();
profileDB.pttPortPath = profileQuery.value(30).toString();
profileDB.rts = profileQuery.value(31).toString();
profileDB.dtr = profileQuery.value(32).toString();

addProfile(profileDB.profileName, profileDB);
}
Expand Down Expand Up @@ -142,12 +148,12 @@ void RigProfilesManager::save()
"baudrate, databits, stopbits, flowcontrol, parity, pollinterval, txfreq_start, "
"txfreq_end, get_freq, get_mode, get_vfo, get_pwr, rit_offset, xit_offset, get_rit, "
"get_xit, default_pwr, get_ptt, qsy_wiping, get_key_speed, assigned_cw_key, key_speed_sync, "
"driver, dxSpot2Rig, ptt_type, ptt_port_pathname ) "
"driver, dxSpot2Rig, ptt_type, ptt_port_pathname, rts, dtr ) "
"VALUES (:profile_name, :model, :port_pathname, :hostname, :netport, "
":baudrate, :databits, :stopbits, :flowcontrol, :parity, :pollinterval, :txfreq_start, "
":txfreq_end, :get_freq, :get_mode, :get_vfo, :get_pwr, :rit_offset, :xit_offset, :get_rit, "
":get_xit, :default_pwr, :get_ptt, :qsy_wiping, :get_key_speed, :assigned_cw_key, :key_speed_sync, "
":driver, :dxSpot2Rig, :ptt_type, :ptt_port_pathname)") )
":driver, :dxSpot2Rig, :ptt_type, :ptt_port_pathname, :rts, :dtr )") )
{
qWarning() << "cannot prepare Insert statement";
return;
Expand Down Expand Up @@ -191,6 +197,9 @@ void RigProfilesManager::save()
insertQuery.bindValue(":dxSpot2Rig", rigProfile.dxSpot2Rig);
insertQuery.bindValue(":ptt_type", rigProfile.pttType);
insertQuery.bindValue(":ptt_port_pathname", rigProfile.pttPortPath);
insertQuery.bindValue(":rts", rigProfile.rts);
insertQuery.bindValue(":dtr", rigProfile.dtr);


if ( ! insertQuery.exec() )
{
Expand Down Expand Up @@ -239,6 +248,8 @@ bool RigProfile::operator==(const RigProfile &profile)
&& profile.dxSpot2Rig == this->dxSpot2Rig
&& profile.pttType == this->pttType
&& profile.pttPortPath == this->pttPortPath
&& profile.rts == this->rts
&& profile.dtr == this->dtr
);
}

Expand Down
2 changes: 2 additions & 0 deletions data/RigProfile.h
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class RigProfile
bool dxSpot2Rig;
QString pttType;
QString pttPortPath;
QString rts;
QString dtr;

bool operator== (const RigProfile &profile);
bool operator!= (const RigProfile &profile);
Expand Down
1 change: 1 addition & 0 deletions res/res.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@
<file>sql/migration_032.sql</file>
<file>sql/migration_033.sql</file>
<file>sql/migration_034.sql</file>
<file>sql/migration_035.sql</file>
</qresource>
</RCC>
2 changes: 2 additions & 0 deletions res/sql/migration_035.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ALTER TABLE rig_profiles ADD COLUMN rts TEXT DEFAULT '';
ALTER TABLE rig_profiles ADD COLUMN dtr TEXT DEFAULT '';
17 changes: 17 additions & 0 deletions rig/drivers/HamlibRigDrv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ bool HamlibRigDrv::open()
rig->state.rigport.parm.serial.stop_bits = rigProfile.stopbits;
rig->state.rigport.parm.serial.handshake = stringToHamlibFlowControl(rigProfile.flowcontrol);
rig->state.rigport.parm.serial.parity = stringToHamlibParity(rigProfile.parity);
rig->state.rigport.parm.serial.dtr_state = stringToHamlibForceFlowControl(rigProfile.dtr);
rig->state.rigport.parm.serial.rts_state = stringToHamlibForceFlowControl(rigProfile.rts);

qCDebug(runtime) << "Using PTT Type" << rigProfile.pttType.toLocal8Bit().constData()
<< "PTT Path" << rigProfile.pttPortPath;
Expand Down Expand Up @@ -1149,6 +1151,21 @@ serial_parity_e HamlibRigDrv::stringToHamlibParity(const QString &in_parity)
return RIG_PARITY_NONE;
}

serial_control_state_e HamlibRigDrv::stringToHamlibForceFlowControl(const QString &flowcontrol)
{
FCT_IDENTIFICATION;

qCDebug(function_parameters) << flowcontrol;

if (flowcontrol == "HIGH")
return RIG_SIGNAL_ON;
if (flowcontrol == "LOW")
return RIG_SIGNAL_OFF;

return RIG_SIGNAL_UNSET;
}


QString HamlibRigDrv::hamlibErrorString(int errorCode)
{
FCT_IDENTIFICATION;
Expand Down
1 change: 1 addition & 0 deletions rig/drivers/HamlibRigDrv.h
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ private slots:
const QString hamlibVFO2String(const vfo_t vfo) const;
serial_handshake_e stringToHamlibFlowControl(const QString &in_flowcontrol);
serial_parity_e stringToHamlibParity(const QString &in_parity);
serial_control_state_e stringToHamlibForceFlowControl(const QString &flowcontrol);
QString hamlibErrorString(int);
RIG* rig;
QTimer timer;
Expand Down
13 changes: 13 additions & 0 deletions ui/SettingsDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,8 @@ void SettingsDialog::addRigProfile()
profile.parity = ui->rigParitySelect->currentData().toString();
profile.pttType = ui->rigPTTTypeCombo->currentData().toString();
profile.pttPortPath = ui->rigPTTPortEdit->text();
profile.rts = ui->cmbRigRTS->currentText();
profile.dtr = ui->cmbRigDTR->currentText();
}

if ( ui->rigPollIntervalSpinBox->isEnabled() )
Expand Down Expand Up @@ -582,6 +584,12 @@ void SettingsDialog::doubleClickRigProfile(QModelIndex i)
ui->rigPTTTypeCombo->setCurrentIndex(( pttIndex < 0 ) ? PTT_TYPE_CAT_INDEX : pttIndex);
ui->rigPTTPortEdit->setText(profile.pttPortPath);

int rtsIndex = ui->cmbRigRTS->findText(profile.rts);
ui->cmbRigRTS->setCurrentIndex(( rtsIndex < 0 ) ? PTT_TYPE_CAT_INDEX : rtsIndex);

int dtrIndex = ui->cmbRigDTR->findText(profile.dtr);
ui->cmbRigDTR->setCurrentIndex(( dtrIndex < 0 ) ? PTT_TYPE_CAT_INDEX : dtrIndex);

setUIBasedOnRigCaps(caps);

ui->rigAddProfileButton->setText(tr("Modify"));
Expand Down Expand Up @@ -726,12 +734,17 @@ void SettingsDialog::rigInterfaceChanged(int)
ui->rigModelSelect->setCurrentIndex(( driverID == Rig::HAMLIB_DRIVER ) ? ui->rigModelSelect->findData(DEFAULT_HAMLIB_RIG_MODEL)
: 0 );
ui->rigPTTTypeCombo->clear();
ui->cmbRigRTS->setCurrentIndex(0);
ui->cmbRigDTR->setCurrentIndex(0);

const QList<QPair<QString, QString>> &pttTypes = Rig::instance()->getPTTTypeList(static_cast<Rig::DriverID>(driverID));

for ( const QPair<QString, QString> &type : pttTypes )
ui->rigPTTTypeCombo->addItem(type.second, type.first);

ui->cmbRigRTS->setVisible((driverID == Rig::HAMLIB_DRIVER));
ui->cmbRigDTR->setVisible((driverID == Rig::HAMLIB_DRIVER));

ui->rigPTTTypeCombo->setVisible(( driverID == Rig::HAMLIB_DRIVER ));
ui->rigPTTTypeLabel->setVisible(( driverID == Rig::HAMLIB_DRIVER ));
ui->rigPTTPortEdit->setVisible(( driverID == Rig::HAMLIB_DRIVER ));
Expand Down
59 changes: 59 additions & 0 deletions ui/SettingsDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -2257,6 +2257,65 @@
</item>
</layout>
</item>
<item row="7" column="0">
<widget class="QLabel" name="rigFlowControlLines">
<property name="text">
<string>DTR</string>
</property>
</widget>
</item>
<item row="7" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_39">
<item>
<widget class="QComboBox" name="cmbRigDTR">
<item>
<property name="text">
<string></string>
</property>
</item>
<item>
<property name="text">
<string>High</string>
</property>
</item>
<item>
<property name="text">
<string>Low</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>RTS</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cmbRigRTS">
<item>
<property name="text">
<string></string>
</property>
</item>
<item>
<property name="text">
<string>High</string>
</property>
</item>
<item>
<property name="text">
<string>Low</string>
</property>
</item>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="rigNetworkPage">
Expand Down
Loading