Skip to content

Commit

Permalink
LoTW Upload Station Profiles
Browse files Browse the repository at this point in the history
Since adding the County to the Station Profile I have experienced tQSL errors due to county not matching my location in tQSL.  So I added logic to allow the user to select the station profile.  Since the station profile name isn't stored in the contact, I linked on the fields taht seemed to matter to tQSL.
  • Loading branch information
aa5sh committed Dec 15, 2024
1 parent 94e55cd commit ace8058
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
21 changes: 18 additions & 3 deletions ui/LotwDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ LotwDialog::LotwDialog(QWidget *parent) :
ui->myGridCombo->setModel(new SqlListModel("SELECT DISTINCT UPPER(my_gridsquare) FROM contacts WHERE station_callsign ='"
+ ui->myCallsignCombo->currentText()
+ "' ORDER BY my_gridsquare", ""));

ui->myStationCombo->setModel(new SqlListModel("SELECT profile_name FROM station_profiles WHERE callsign ='"
+ ui->myCallsignCombo->currentText()
+"' ORDER BY profile_name", ""));

/* Download */
ui->qslRadioButton->setChecked(true);
ui->qsoRadioButton->setChecked(false);
Expand Down Expand Up @@ -114,14 +119,20 @@ void LotwDialog::upload() {
qslSentStatuses << "'N'";
}

QString query_string = "SELECT callsign, freq, band, freq_rx, "
QString query_string = "SELECT contacts.callsign, freq, band, freq_rx, "
" mode, submode, start_time, prop_mode, "
" sat_name, station_callsign, operator, "
" rst_sent, rst_rcvd, my_state, my_cnty, "
" my_vucc_grids "
"FROM contacts ";
"FROM contacts inner join station_profiles on contacts.station_callsign = station_profiles.callsign "
"and (contacts.my_cnty = station_profiles.county or contacts.my_cnty is null) "
"and (contacts.my_pota_ref = station_profiles.pota or contacts.my_pota_ref is null) "
"and (contacts.my_itu_zone = station_profiles.ituz or contacts.my_itu_zone is null) "
"and (contacts.my_cq_zone = station_profiles.cqz or contacts.my_cq_zone is null) "
"and (contacts.my_iota = station_profiles.iota or contacts.my_iota is null)";
QString query_where = QString("WHERE (upper(lotw_qsl_sent) in (%1) OR lotw_qsl_sent is NULL) "
" AND (upper(prop_mode) NOT IN ('INTERNET', 'RPT', 'ECH', 'IRL') OR prop_mode IS NULL) ").arg(qslSentStatuses.join(","));
" AND (upper(prop_mode) NOT IN ('INTERNET', 'RPT', 'ECH', 'IRL') OR prop_mode IS NULL) ").arg(qslSentStatuses.join(",")) + " "
" AND station_profiles.profile_name = '" + ui->myStationCombo->currentText() + "'";
QString query_order = " ORDER BY start_time ";

saveDialogState();
Expand Down Expand Up @@ -219,6 +230,10 @@ void LotwDialog::upload() {
void LotwDialog::uploadCallsignChanged(const QString &my_callsign)
{
ui->myGridCombo->setModel(new SqlListModel("SELECT DISTINCT UPPER(my_gridsquare) FROM contacts WHERE station_callsign ='" + my_callsign + "' ORDER BY my_gridsquare", ""));

ui->myStationCombo->setModel(new SqlListModel("SELECT profile_name FROM station_profiles WHERE callsign ='"
+ ui->myCallsignCombo->currentText()
+"' ORDER BY profile_name", ""));
}

void LotwDialog::saveDialogState()
Expand Down
13 changes: 12 additions & 1 deletion ui/LotwDialog.ui
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@
</property>
</widget>
</item>
<item row="4" column="0" colspan="3">
<item row="4" column="0">
<widget class="QLabel" name="myStationLabel">
<property name="text">
<string>My Station</string>
</property>
</widget>
</item>

<item row="5" column="0" colspan="3">
<widget class="QPushButton" name="showButton">
<property name="text">
<string>Show Selection</string>
Expand All @@ -53,6 +61,9 @@
<string>Include QSOs with Sent Status</string>
</property>
</widget>
</item>
<item row="4" column="1" colspan="2">
<widget class="QComboBox" name="myStationCombo"/>
</item>
<item row="3" column="1">
<layout class="QHBoxLayout" name="horizontalLayout">
Expand Down

0 comments on commit ace8058

Please sign in to comment.