Clean up HRD information file format

Merged from wsjtx-1.4 branch.




git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4514 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Bill Somerville 2014-10-13 10:53:15 +00:00
parent 9cee2342a2
commit 69b2eac75a
2 changed files with 20 additions and 12 deletions

View File

@ -224,28 +224,34 @@ void HRDTransceiver::do_start ()
HRD_info << "Buttons: {" << buttons_.join (", ") << "}\n"; HRD_info << "Buttons: {" << buttons_.join (", ") << "}\n";
dropdown_names_ = send_command ("get dropdowns").trimmed ().split (',', QString::SkipEmptyParts); dropdown_names_ = send_command ("get dropdowns").trimmed ().split (',', QString::SkipEmptyParts);
#if WSJT_TRACE_CAT
qDebug () << "Dropdowns:\n";
#endif
HRD_info << "Dropdowns:\n"; HRD_info << "Dropdowns:\n";
Q_FOREACH (auto const& dd, dropdown_names_) Q_FOREACH (auto const& dd, dropdown_names_)
{ {
auto selections = send_command ("get dropdown-list {" + dd + "}").trimmed ().split (',', QString::SkipEmptyParts); auto selections = send_command ("get dropdown-list {" + dd + "}").trimmed ().split (',', QString::SkipEmptyParts);
#if WSJT_TRACE_CAT
qDebug () << "\t" << dd << ": {" << selections.join (", ") << "}\n";
#endif
HRD_info << "\t" << dd << ": {" << selections.join (", ") << "}\n"; HRD_info << "\t" << dd << ": {" << selections.join (", ") << "}\n";
dropdowns_[dd] = selections; dropdowns_[dd] = selections;
} }
#if WSJT_TRACE_CAT
qDebug () << "HRD Dropdowns: " << dropdowns_;
#endif
sliders_ = send_command ("get sliders").trimmed ().split (',', QString::SkipEmptyParts).replaceInStrings (" ", "~"); slider_names_ = send_command ("get sliders").trimmed ().split (',', QString::SkipEmptyParts).replaceInStrings (" ", "~");
#if WSJT_TRACE_CAT
qDebug () << "Sliders:\n";
#endif
HRD_info << "Sliders:\n"; HRD_info << "Sliders:\n";
HRD_info << "Sliders: {" << sliders_.join (", ") << "}\n"; Q_FOREACH (auto const& s, slider_names_)
Q_FOREACH (auto const& s, sliders_)
{ {
auto range = send_command ("get slider-range " + current_radio_name + " " + s).trimmed ().split (',', QString::SkipEmptyParts); auto range = send_command ("get slider-range " + current_radio_name + " " + s).trimmed ().split (',', QString::SkipEmptyParts);
HRD_info << "\t" << s << ": {" << range.join (", ") << "}\n";
}
#if WSJT_TRACE_CAT #if WSJT_TRACE_CAT
qDebug () << "HRD Dropdowns: " << dropdowns_; qDebug () << "\t" << s << ": {" << range.join (", ") << "}\n";
#endif #endif
HRD_info << "\t" << s << ": {" << range.join (", ") << "}\n";
sliders_[s] = range;
}
vfo_A_button_ = find_button (QRegExp ("^(VFO~A|Main)$")); vfo_A_button_ = find_button (QRegExp ("^(VFO~A|Main)$"));
vfo_B_button_ = find_button (QRegExp ("^(VFO~B|Sub)$")); vfo_B_button_ = find_button (QRegExp ("^(VFO~B|Sub)$"));

View File

@ -104,10 +104,12 @@ private:
// available. // available.
QMap<QString, QStringList> dropdowns_; // Dictionary of available QMap<QString, QStringList> dropdowns_; // Dictionary of available
// drop down selections // drop down selections.
// available.
QStringList sliders_; // The sliders available. QStringList slider_names_; // The name of available sliders.
QMap<QString, QStringList> sliders_; // Dictionary of available
// slider ranges.
int vfo_A_button_; // The button we use to select VFO int vfo_A_button_; // The button we use to select VFO
// A. May be -1 if none available. // A. May be -1 if none available.