00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include "channelscanner_gui_scan_pane.h"
00031 #include "loglist.h"
00032
00033 ChannelScannerGUIScanPane::ChannelScannerGUIScanPane(
00034 bool lock, bool strength,
00035 bool snr, bool rotorpos,
00036 QObject *target, const char *slot) :
00037 VerticalConfigurationGroup(false, false, true, true),
00038 ss(NULL), sn(NULL), pos(NULL),
00039 progressBar(NULL), sl(NULL), sta(NULL)
00040 {
00041 setLabel(tr("Scan Progress"));
00042
00043 ConfigurationGroup *slg =
00044 new HorizontalConfigurationGroup(false, false, true, true);
00045 slg->addChild(sta = new TransLabelSetting());
00046 sta->setLabel(tr("Status"));
00047 sta->setValue(tr("Tuning"));
00048
00049 if (lock)
00050 {
00051 slg->addChild(sl = new TransLabelSetting());
00052 sl->setValue(" "
00053 " ");
00054 }
00055
00056 addChild(slg);
00057
00058 if (rotorpos)
00059 {
00060 addChild(pos = new TransProgressSetting());
00061 pos->setLabel(tr("Rotor Movement"));
00062 }
00063
00064 ConfigurationGroup *ssg = NULL;
00065 if (strength || snr)
00066 ssg = new HorizontalConfigurationGroup(false, false, true, true);
00067
00068 if (strength)
00069 {
00070 ssg->addChild(ss = new TransProgressSetting());
00071 ss->setLabel(tr("Signal Strength"));
00072 }
00073
00074 if (snr)
00075 {
00076 ssg->addChild(sn = new TransProgressSetting());
00077 sn->setLabel(tr("Signal/Noise"));
00078 }
00079
00080 if (strength || snr)
00081 addChild(ssg);
00082
00083 addChild(progressBar = new TransProgressSetting());
00084 progressBar->setValue(0);
00085 progressBar->setLabel(tr("Scan"));
00086
00087 addChild(log = new LogList());
00088
00089 TransButtonSetting *cancel = new TransButtonSetting();
00090 cancel->setLabel(tr("Stop Scan"));
00091 addChild(cancel);
00092
00093 connect(cancel, SIGNAL(pressed(void)), target, slot);
00094
00095
00096 setUseLabel(false);
00097 setUseFrame(false);
00098 }
00099
00100 void ChannelScannerGUIScanPane::SetStatusRotorPosition(int value)
00101 {
00102 if (pos)
00103 pos->setValue(value);
00104 }
00105
00106 void ChannelScannerGUIScanPane::SetStatusSignalToNoise(int value)
00107 {
00108 if (sn)
00109 sn->setValue(value);
00110 }
00111
00112 void ChannelScannerGUIScanPane::SetStatusSignalStrength(int value)
00113 {
00114 if (ss)
00115 ss->setValue(value);
00116 }
00117
00118 void ChannelScannerGUIScanPane::SetStatusLock(int value)
00119 {
00120 if (sl)
00121 sl->setValue((value) ? tr("Locked") : tr("No Lock"));
00122 }
00123
00124 void ChannelScannerGUIScanPane::SetStatusText(const QString &value)
00125 {
00126 if (sta)
00127 sta->setValue(value);
00128 }
00129
00130 void ChannelScannerGUIScanPane::SetStatusTitleText(const QString &value)
00131 {
00132 QString msg = tr("Scan Progress") + QString(" %1").arg(value);
00133 setLabel(msg);
00134 }
00135
00136 void ChannelScannerGUIScanPane::AppendLine(const QString &text)
00137 {
00138 log->AppendLine(text);
00139 }