diff --git a/Configuration.cpp b/Configuration.cpp index 9288b7c86..9405b0225 100644 --- a/Configuration.cpp +++ b/Configuration.cpp @@ -443,7 +443,11 @@ private: Q_SLOT void on_pbMyCall_clicked(); Q_SLOT void on_pbTxMsg_clicked(); Q_SLOT void on_pbNewDXCC_clicked(); + Q_SLOT void on_pbNewDXCCband_clicked(); Q_SLOT void on_pbNewCall_clicked(); + Q_SLOT void on_pbNewCallBand_clicked(); + Q_SLOT void on_pbNewGrid_clicked(); + Q_SLOT void on_pbNewGridBand_clicked(); Q_SLOT void on_cbFox_clicked (bool); Q_SLOT void on_cbHound_clicked (bool); Q_SLOT void on_cbx2ToneSpacing_clicked(bool); @@ -540,8 +544,16 @@ private: QColor next_color_TxMsg_; QColor color_DXCC_; QColor next_color_DXCC_; + QColor color_DXCCband_; + QColor next_color_DXCCband_; QColor color_NewCall_; QColor next_color_NewCall_; + QColor color_NewCallBand_; + QColor next_color_NewCallBand_; + QColor color_NewGrid_; + QColor next_color_NewGrid_; + QColor color_NewGridBand_; + QColor next_color_NewGridBand_; qint32 id_interval_; qint32 ntrials_; qint32 aggressive_; @@ -643,7 +655,11 @@ QColor Configuration::color_CQ () const {return m_->color_CQ_;} QColor Configuration::color_MyCall () const {return m_->color_MyCall_;} QColor Configuration::color_TxMsg () const {return m_->color_TxMsg_;} QColor Configuration::color_DXCC () const {return m_->color_DXCC_;} +QColor Configuration::color_DXCCband() const {return m_->color_DXCCband_;} QColor Configuration::color_NewCall () const {return m_->color_NewCall_;} +QColor Configuration::color_NewCallBand () const {return m_->color_NewCallBand_;} +QColor Configuration::color_NewGrid () const {return m_->color_NewGrid_;} +QColor Configuration::color_NewGridBand () const {return m_->color_NewGridBand_;} QFont Configuration::text_font () const {return m_->font_;} QFont Configuration::decoded_text_font () const {return m_->decoded_text_font_;} qint32 Configuration::id_interval () const {return m_->id_interval_;} @@ -1154,8 +1170,12 @@ void Configuration::impl::initialize_models () ui_->labMyCall->setStyleSheet(QString("background: %1").arg(color_MyCall_.name())); ui_->labTx->setStyleSheet(QString("background: %1").arg(color_TxMsg_.name())); ui_->labDXCC->setStyleSheet(QString("background: %1").arg(color_DXCC_.name())); + ui_->labDXCCband->setStyleSheet(QString("background: %1").arg(color_DXCCband_.name())); ui_->labNewCall->setStyleSheet(QString("background: %1").arg(color_NewCall_.name())); - ui_->CW_id_interval_spin_box->setValue (id_interval_); + ui_->labNewCallBand->setStyleSheet(QString("background: %1").arg(color_NewCallBand_.name())); + ui_->labNewGrid->setStyleSheet(QString("background: %1").arg(color_NewGrid_.name())); + ui_->labNewGridBand->setStyleSheet(QString("background: %1").arg(color_NewGridBand_.name())); + ui_->CW_id_interval_spin_box->setValue (id_interval_); ui_->sbNtrials->setValue (ntrials_); ui_->sbTxDelay->setValue (txDelay_); ui_->sbAggressive->setValue (aggressive_); @@ -1281,8 +1301,11 @@ void Configuration::impl::read_settings () next_color_MyCall_ = color_MyCall_ = settings_->value("colorMyCall","#ff6666").toString(); next_color_TxMsg_ = color_TxMsg_ = settings_->value("colorTxMsg","#ffff00").toString(); next_color_DXCC_ = color_DXCC_ = settings_->value("colorDXCC","#ff00ff").toString(); - next_color_NewCall_ = color_NewCall_ = settings_->value("colorNewCall","#ffaaff").toString(); - + next_color_DXCCband_ = color_DXCCband_ = settings_->value("colorDXCCband","#ffaaff").toString(); + next_color_NewCall_ = color_NewCall_ = settings_->value("colorNewCall","#00ffff").toString(); + next_color_NewCallBand_ = color_NewCallBand_ = settings_->value("colorNewCallBand","#99ffff").toString(); + next_color_NewGrid_ = color_NewGrid_ = settings_->value("colorNewGrid","#ff80ff").toString(); + next_color_NewGridBand_ = color_NewGridBand_ = settings_->value("colorNewGridBand","#ffcc99").toString(); if (next_font_.fromString (settings_->value ("Font", QGuiApplication::font ().toString ()).toString ()) && next_font_ != font_) { @@ -1473,7 +1496,11 @@ void Configuration::impl::write_settings () settings_->setValue("colorMyCall",color_MyCall_); settings_->setValue("colorTxMsg",color_TxMsg_); settings_->setValue("colorDXCC",color_DXCC_); + settings_->setValue("colorDXCCband",color_DXCCband_); settings_->setValue("colorNewCall",color_NewCall_); + settings_->setValue("colorNewCallBand",color_NewCallBand_); + settings_->setValue("colorNewGrid",color_NewGrid_); + settings_->setValue("colorNewGridBand",color_NewGridBand_); settings_->setValue ("Font", font_.toString ()); settings_->setValue ("DecodedTextFont", decoded_text_font_.toString ()); settings_->setValue ("IDint", id_interval_); @@ -1844,7 +1871,11 @@ void Configuration::impl::accept () color_MyCall_ = next_color_MyCall_; color_TxMsg_ = next_color_TxMsg_; color_DXCC_ = next_color_DXCC_; + color_DXCCband_ = next_color_DXCCband_; color_NewCall_ = next_color_NewCall_; + color_NewCallBand_ = next_color_NewCallBand_; + color_NewGrid_ = next_color_NewGrid_; + color_NewGridBand_ = next_color_NewGridBand_; rig_params_ = temp_rig_params; // now we can go live with the rig // related configuration parameters @@ -2097,6 +2128,16 @@ void Configuration::impl::on_pbNewDXCC_clicked() } } +void Configuration::impl::on_pbNewDXCCband_clicked() +{ + auto new_color = QColorDialog::getColor(next_color_DXCCband_, this, "New DXCCband Color"); + if (new_color.isValid ()) + { + next_color_DXCCband_ = new_color; + ui_->labDXCCband->setStyleSheet(QString("background: %1").arg(next_color_DXCCband_.name())); + } +} + void Configuration::impl::on_pbNewCall_clicked() { auto new_color = QColorDialog::getColor(next_color_NewCall_, this, "New Call Messages Color"); @@ -2107,6 +2148,35 @@ void Configuration::impl::on_pbNewCall_clicked() } } +void Configuration::impl::on_pbNewCallBand_clicked() +{ + auto new_color = QColorDialog::getColor(next_color_NewCallBand_, this, "New CallBand Color"); + if (new_color.isValid ()) + { + next_color_NewCallBand_ = new_color; + ui_->labNewCallBand->setStyleSheet(QString("background: %1").arg(next_color_NewCallBand_.name())); + } +} + +void Configuration::impl::on_pbNewGrid_clicked() +{ + auto new_color = QColorDialog::getColor(next_color_NewGrid_, this, "New Grid Messages Color"); + if (new_color.isValid ()) + { + next_color_NewGrid_ = new_color; + ui_->labNewGrid->setStyleSheet(QString("background: %1").arg(next_color_NewGrid_.name())); + } +} + +void Configuration::impl::on_pbNewGridBand_clicked() +{ + auto new_color = QColorDialog::getColor(next_color_NewGridBand_, this, "New GridBand Messages Color"); + if (new_color.isValid ()) + { + next_color_NewGridBand_ = new_color; + ui_->labNewGridBand->setStyleSheet(QString("background: %1").arg(next_color_NewGridBand_.name())); + } +} void Configuration::impl::on_decoded_text_font_push_button_clicked () { next_decoded_text_font_ = QFontDialog::getFont (0, decoded_text_font_ , this diff --git a/Configuration.hpp b/Configuration.hpp index 11dafeb58..0228fc46b 100644 --- a/Configuration.hpp +++ b/Configuration.hpp @@ -172,7 +172,11 @@ public: QColor color_MyCall () const; QColor color_TxMsg () const; QColor color_DXCC () const; + QColor color_DXCCband () const; QColor color_NewCall () const; + QColor color_NewCallBand () const; + QColor color_NewGrid () const; + QColor color_NewGridBand () const; bool pwrBandTxMemory () const; bool pwrBandTuneMemory () const; diff --git a/Configuration.ui b/Configuration.ui index cdc287e5d..9cdcd1d11 100644 --- a/Configuration.ui +++ b/Configuration.ui @@ -2176,22 +2176,24 @@ Right click for insert and delete options. - - - - - 80 - 20 - - - - QLabel{background-color: #66ff66} - + + - K1ABC + New DXCC on Band - - Qt::AlignCenter + + + + + + New Call on Band + + + + + + + New grid @@ -2221,6 +2223,44 @@ Right click for insert and delete options. + + + + + 80 + 20 + + + + QLabel{background-color: #66ff66} + + + K1ABC + + + Qt::AlignCenter + + + + + + + + 80 + 20 + + + + QLabel{background-color: yellow} + + + K1ABC + + + Qt::AlignCenter + + + @@ -2253,25 +2293,6 @@ Right click for insert and delete options. - - - - - 80 - 20 - - - - QLabel{background-color: yellow} - - - K1ABC - - - Qt::AlignCenter - - - @@ -2281,7 +2302,7 @@ Right click for insert and delete options. - QLabel{background-color: #ff66ff} + QLabel{background-color: #ff00ff} K1ABC @@ -2291,19 +2312,6 @@ Right click for insert and delete options. - - - - - 140 - 0 - - - - New Call - - - @@ -2317,7 +2325,7 @@ Right click for insert and delete options. - + @@ -2326,7 +2334,7 @@ Right click for insert and delete options. - QLabel{background-color: #66ffff} + QLabel{background-color: #00ffff} K1ABC @@ -2336,6 +2344,79 @@ Right click for insert and delete options. + + + + + 140 + 0 + + + + New Call + + + + + + + New Grid on Band + + + + + + + QLabel{background-color: #ffaaff} + + + + K1ABC + + + Qt::AlignCenter + + + + + + + QLabel{background-color: #99ffff} + + + K1ABC + + + Qt::AlignCenter + + + + + + + QLabel{background-color: #ff8000} + + + K1ABC + + + Qt::AlignCenter + + + + + + + QLabel{background-color: #ffcc99} + + + K1ABC + + + Qt::AlignCenter + + + @@ -3023,12 +3104,12 @@ soundcard changes - - - - - + + + + + diff --git a/mainwindow.cpp b/mainwindow.cpp index bf7559f7c..8955f479a 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1049,6 +1049,22 @@ void MainWindow::readLog() } } +bool MainWindow::isWorked(int itype, QString key, float fMHz, QString mode) +{ + bool worked; + int i=0; + if(itype==CALL) i = m_callWorked[key]; + if(itype==GRID) i = m_gridWorked[key]; + if(fMHz==0.0) { + worked=(i!=0); + } else { + int ib=iband(fMHz); + worked=((i>>ib) & 1)!=0; + } +// Check mode here... + return worked; +} + //--------------------------------------------------- MainWindow destructor MainWindow::~MainWindow() { @@ -3094,7 +3110,12 @@ void MainWindow::readFromStdout() //readFromStdout QString deCall; QString grid; decodedtext.deCallAndGrid(/*out*/deCall,grid); -// qDebug() << "bb" << deCall << grid << m_callWorked[deCall] << m_gridWorked[grid]; +/* + qDebug() << "Worked" << deCall << grid << m_callWorked[deCall] << m_gridWorked[grid] + << isWorked(int(CALL),deCall,float(m_freqNominal/1000000.0)) + << isWorked(int(CALL),deCall) + << isWorked(int(GRID),grid); +*/ { QString t=Radio::base_callsign(ui->dxCallEntry->text()); if((t==deCall or t=="") and rpt!="") m_rptRcvd=rpt; diff --git a/mainwindow.h b/mainwindow.h index d81f6e159..4e12daa12 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -519,6 +519,8 @@ private: RTTY } m_nContest; //Contest type + enum {CALL, GRID, DXCC, MULT}; + int m_ihsym; int m_nzap; int m_npts8; @@ -544,7 +546,6 @@ private: QLabel watchdog_label; QFuture m_wav_future; - QFuture m_readLogFuture; QFutureWatcher m_wav_future_watcher; QFutureWatcher watcher3; QFutureWatcher m_saveWAVWatcher; @@ -696,6 +697,7 @@ private: void CQTxFreq(); void cabLog(); void readLog(); + bool isWorked(int itype, QString key, float fMHz=0, QString=""); int iband(float fMHz); QString hamBand(int iband);