Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoTW Upload Station Profiles #551

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
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
Loading