Several changes to operational logic for FreqCal mode.

1. Menu item *Tools -> Execute frequency calibration cycle* is renamed and checkable.  Cycling does not start until checked.
2. Ctrl+F10 now allows you to cycle manually through the list of calibration frequencies.
3. Calibration sequence lengths can be set to 5, 10, 15, or 30 s with the sbTR spinBox.

Also: don't set sbTR index to 0 when entering a slow mode.



git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7485 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2017-01-12 18:21:58 +00:00
parent 1b1aa99a68
commit 247aa1a2ee
3 changed files with 39 additions and 37 deletions

View File

@ -1088,7 +1088,7 @@ void MainWindow::fixStop()
m_hsymStop=179; m_hsymStop=179;
if(m_config.decode_at_52s()) m_hsymStop=186; if(m_config.decode_at_52s()) m_hsymStop=186;
} else if (m_mode=="FreqCal"){ } else if (m_mode=="FreqCal"){
m_hsymStop=96; m_hsymStop=((int(m_TRperiod/0.288))/8)*8;
} }
} }
@ -1143,7 +1143,7 @@ void MainWindow::dataSink(qint64 frames)
if (m_mode == "FreqCal" if (m_mode == "FreqCal"
// only calculate after 1st chunk, also skip chunk where rig // only calculate after 1st chunk, also skip chunk where rig
// changed frequency // changed frequency
&& !(m_ihsym % 8) && m_ihsym > 8 && m_ihsym <= 96) { && !(m_ihsym % 8) && m_ihsym > 8 && m_ihsym <= m_hsymStop) {
int RxFreq=ui->RxFreqSpinBox->value (); int RxFreq=ui->RxFreqSpinBox->value ();
int nkhz=(m_freqNominal+RxFreq)/1000; int nkhz=(m_freqNominal+RxFreq)/1000;
freqcal_(&dec_data.d2[0],&k,&nkhz,&RxFreq,&m_Ftol,&line[0],80); freqcal_(&dec_data.d2[0],&k,&nkhz,&RxFreq,&m_Ftol,&line[0],80);
@ -1164,8 +1164,8 @@ void MainWindow::dataSink(qint64 frames)
, tr ("Cannot open \"%1\" for append: %2") , tr ("Cannot open \"%1\" for append: %2")
.arg (f.fileName ()).arg (f.errorString ())); .arg (f.fileName ()).arg (f.errorString ()));
} }
if(m_ihsym==96) { if(m_ihsym==m_hsymStop and m_bFreqCalStep) {
on_actionFrequency_calibration_triggered(); freqCalStep();
} }
} }
@ -1626,6 +1626,9 @@ void MainWindow::keyPressEvent (QKeyEvent * e)
return; return;
} }
break; break;
case Qt::Key_F10:
if(e->modifiers() & Qt::ControlModifier) freqCalStep();
break;
case Qt::Key_F11: case Qt::Key_F11:
n=11; n=11;
if(e->modifiers() & Qt::ControlModifier) n+=100; if(e->modifiers() & Qt::ControlModifier) n+=100;
@ -3109,6 +3112,7 @@ void MainWindow::guiUpdate()
//Once per second: //Once per second:
if(nsec != m_sec0) { if(nsec != m_sec0) {
if(m_freqNominal!=0 and m_freqNominal<50000000 and m_config.enable_VHF_features()) { if(m_freqNominal!=0 and m_freqNominal<50000000 and m_config.enable_VHF_features()) {
if(!m_bVHFwarned) vhfWarning(); if(!m_bVHFwarned) vhfWarning();
} else { } else {
@ -4225,7 +4229,6 @@ void MainWindow::on_actionJT4_triggered()
ui->sbSubmode->setValue(m_nSubMode); ui->sbSubmode->setValue(m_nSubMode);
} else { } else {
ui->sbSubmode->setValue(0); ui->sbSubmode->setValue(0);
ui->sbTR->setValue(0);
} }
statusChanged(); statusChanged();
} }
@ -4316,7 +4319,6 @@ void MainWindow::on_actionJT9_JT65_triggered()
m_bFast9=false; m_bFast9=false;
fast_config(false); fast_config(false);
ui->sbSubmode->setValue(0); ui->sbSubmode->setValue(0);
ui->sbTR->setValue(0);
ui->label_6->setText("Band Activity"); ui->label_6->setText("Band Activity");
ui->label_7->setText("Rx Frequency"); ui->label_7->setText("Rx Frequency");
statusChanged(); statusChanged();
@ -4366,7 +4368,6 @@ void MainWindow::on_actionJT65_triggered()
ui->label_7->setText("Average Decodes"); ui->label_7->setText("Average Decodes");
} else { } else {
ui->sbSubmode->setValue(0); ui->sbSubmode->setValue(0);
ui->sbTR->setValue(0);
ui->label_6->setText("Band Activity"); ui->label_6->setText("Band Activity");
ui->label_7->setText("Rx Frequency"); ui->label_7->setText("Rx Frequency");
} }
@ -4547,19 +4548,20 @@ void MainWindow::on_actionEcho_triggered()
void MainWindow::on_actionFreqCal_triggered() void MainWindow::on_actionFreqCal_triggered()
{ {
on_actionJT9_triggered(); on_actionJT9_triggered();
displayWidgets(nWidgets("001100000000000000000000")); displayWidgets(nWidgets("001101000000000000000000"));
m_mode="FreqCal"; m_mode="FreqCal";
ui->actionFreqCal->setChecked(true); ui->actionFreqCal->setChecked(true);
switch_mode(Modes::FreqCal); switch_mode(Modes::FreqCal);
m_wideGraph->setMode(m_mode); m_wideGraph->setMode(m_mode);
statusChanged(); statusChanged();
m_TRperiod=30; ui->sbTR->setValue(14);
m_TRperiod=ui->sbTR->cleanText().toInt();
m_modulator->setPeriod(m_TRperiod); // TODO - not thread safe m_modulator->setPeriod(m_TRperiod); // TODO - not thread safe
m_detector->setPeriod(m_TRperiod); // TODO - not thread safe m_detector->setPeriod(m_TRperiod); // TODO - not thread safe
m_nsps=6912; //For symspec only m_nsps=6912; //For symspec only
m_FFTSize = m_nsps / 2; m_FFTSize = m_nsps / 2;
Q_EMIT FFTSize (m_FFTSize); Q_EMIT FFTSize (m_FFTSize);
m_hsymStop=96; m_hsymStop=((int(m_TRperiod/0.288))/8)*8;
m_frequency_list_fcal_iter = m_config.frequencies ()->begin (); m_frequency_list_fcal_iter = m_config.frequencies ()->begin ();
ui->RxFreqSpinBox->setValue(1500); ui->RxFreqSpinBox->setValue(1500);
setup_status_bar (true); setup_status_bar (true);
@ -4633,7 +4635,6 @@ void MainWindow::WSPR_config(bool b)
void MainWindow::fast_config(bool b) void MainWindow::fast_config(bool b)
{ {
m_bFastMode=b; m_bFastMode=b;
// ui->ClrAvgButton->setVisible(!b);
ui->TxFreqSpinBox->setEnabled(!b); ui->TxFreqSpinBox->setEnabled(!b);
ui->sbTR->setVisible(b); ui->sbTR->setVisible(b);
if(b and (m_bFast9 or m_mode=="MSK144" or m_mode=="ISCAT")) { if(b and (m_bFast9 or m_mode=="MSK144" or m_mode=="ISCAT")) {
@ -5491,9 +5492,10 @@ void MainWindow::on_sbTR_valueChanged(int index)
{ {
m_TRindex=index; m_TRindex=index;
// if(!m_bFastMode and n>m_nSubMode) m_MinW=m_nSubMode; // if(!m_bFastMode and n>m_nSubMode) m_MinW=m_nSubMode;
if(m_bFastMode) { if(m_bFastMode or m_mode=="FreqCal") {
m_TRperiod=ui->sbTR->cleanText().toInt(); m_TRperiod=ui->sbTR->cleanText().toInt();
if(m_TRperiod<5 or m_TRperiod>30) m_TRperiod=30; if(m_TRperiod<5 or m_TRperiod>30) m_TRperiod=15;
m_TRindex=ui->sbTR->value();
m_TRperiodFast=m_TRperiod; m_TRperiodFast=m_TRperiod;
progressBar.setMaximum(m_TRperiod); progressBar.setMaximum(m_TRperiod);
} }
@ -6104,26 +6106,24 @@ void MainWindow::on_actionErase_reference_spectrum_triggered()
m_bClearRefSpec=true; m_bClearRefSpec=true;
} }
void MainWindow::on_actionFrequency_calibration_triggered() void MainWindow::on_actionFrequency_calibration_triggered(bool b)
{ {
// pick the next time signal // m_bFreqCalStep=ui->actionFrequency_calibration->isChecked();
if (m_frequency_list_fcal_iter != m_config.frequencies ()->end ()) m_bFreqCalStep=b;
{ }
while (++m_frequency_list_fcal_iter != m_config.frequencies () ->end ()
&& m_frequency_list_fcal_iter->mode_ == Modes::NULL_MODE) void MainWindow::freqCalStep()
{ {
} FrequencyList::const_iterator flist=m_frequency_list_fcal_iter;
if (m_frequency_list_fcal_iter == m_config.frequencies ()->end ()) if (++flist == m_config.frequencies ()->end ()) {
{ m_frequency_list_fcal_iter = m_config.frequencies ()->begin ();
// loop back to beginning } else {
m_frequency_list_fcal_iter = m_config.frequencies ()->begin (); ++m_frequency_list_fcal_iter;
} }
}
// allow for empty list // allow for empty list
if (m_frequency_list_fcal_iter != m_config.frequencies ()->end ()) if (m_frequency_list_fcal_iter != m_config.frequencies ()->end ()) {
{ setRig (m_frequency_list_fcal_iter->frequency_ - ui->RxFreqSpinBox->value ());
setRig (m_frequency_list_fcal_iter->frequency_ - ui->RxFreqSpinBox->value ()); }
}
} }
void MainWindow::on_sbCQTxFreq_valueChanged(int) void MainWindow::on_sbCQTxFreq_valueChanged(int)

View File

@ -250,7 +250,7 @@ private slots:
void fast_decode_done(); void fast_decode_done();
void on_actionMeasure_reference_spectrum_triggered(); void on_actionMeasure_reference_spectrum_triggered();
void on_actionErase_reference_spectrum_triggered(); void on_actionErase_reference_spectrum_triggered();
void on_actionFrequency_calibration_triggered(); void on_actionFrequency_calibration_triggered(bool b);
void on_sbTR_valueChanged(int index); void on_sbTR_valueChanged(int index);
void on_sbFtol_valueChanged(int index); void on_sbFtol_valueChanged(int index);
void on_cbFast9_clicked(bool b); void on_cbFast9_clicked(bool b);
@ -526,6 +526,7 @@ private:
bool m_tx_watchdog; // true when watchdog triggered bool m_tx_watchdog; // true when watchdog triggered
bool m_block_pwr_tooltip; bool m_block_pwr_tooltip;
bool m_PwrBandSetOK; bool m_PwrBandSetOK;
bool m_bFreqCalStep;
bool m_bVHFwarned; bool m_bVHFwarned;
Frequency m_lastMonitoredFrequency; Frequency m_lastMonitoredFrequency;
double m_toneSpacing; double m_toneSpacing;
@ -568,6 +569,7 @@ private:
void enable_DXCC_entity (bool on); void enable_DXCC_entity (bool on);
void switch_mode (Mode); void switch_mode (Mode);
void WSPR_scheduling (); void WSPR_scheduling ();
void freqCalStep();
void setRig (Frequency = 0); // zero frequency means no change void setRig (Frequency = 0); // zero frequency means no change
void WSPR_history(Frequency dialFreq, int ndecodes); void WSPR_history(Frequency dialFreq, int ndecodes);
QString WSPR_hhmm(int n); QString WSPR_hhmm(int n);

View File

@ -650,7 +650,7 @@ QLabel[oob=&quot;true&quot;] {
<item row="9" column="0"> <item row="9" column="0">
<widget class="LettersSpinBox" name="sbTR"> <widget class="LettersSpinBox" name="sbTR">
<property name="toolTip"> <property name="toolTip">
<string>Tx/Rx sequence length</string> <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Tx/Rx or Frequency calibration sequence length&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
<property name="alignment"> <property name="alignment">
<set>Qt::AlignCenter</set> <set>Qt::AlignCenter</set>
@ -2969,11 +2969,11 @@ QPushButton[state=&quot;ok&quot;] {
</property> </property>
</action> </action>
<action name="actionFrequency_calibration"> <action name="actionFrequency_calibration">
<property name="text"> <property name="checkable">
<string>Frequency calibration</string> <bool>true</bool>
</property> </property>
<property name="shortcut"> <property name="text">
<string>Ctrl+F10</string> <string>Execute frequency calibration cycle</string>
</property> </property>
</action> </action>
</widget> </widget>