Fix a number of problems and streamline instrument parts

master
Timothy Pearson 12 years ago
parent 1f5a3c2804
commit 043cc2c3d9

@ -61,7 +61,7 @@ bool InstrumentView::eventFilter(TQObject *o, TQEvent *e) {
TQWidget *childPartWidget = m_instrumentPart->widget(); TQWidget *childPartWidget = m_instrumentPart->widget();
if (childPartWidget) { if (childPartWidget) {
if (o == childPartWidget) { if (o == childPartWidget) {
if (e->type() == TQEvent::Resize) { if ((e->type() == TQEvent::Resize) || (e->type() == TQEvent::LayoutHint)) {
setChildSizeData(); setChildSizeData();
} }
} }

@ -16,153 +16,132 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="TQTabWidget" row="0" column="0"> <widget class="TQGroupBox" row="0" column="0">
<property name="name"> <property name="name">
<cstring>TabWidget2</cstring> <cstring>groupSpectrumAnalyzer</cstring>
</property> </property>
<property name="enabled"> <property name="title">
<bool>true</bool> <string>Spectrum Analyzer</string>
</property> </property>
<widget class="TQWidget"> <grid>
<property name="name"> <property name="name">
<cstring>tab</cstring> <cstring>unnamed</cstring>
</property> </property>
<attribute name="title"> <widget class="TQGroupBox" row="0" column="0" rowspan="10">
<string>Spectrum Analyzer</string>
</attribute>
<grid>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>groupSpectrumAnalyzerView</cstring>
</property> </property>
<widget class="TQGroupBox" row="0" column="0"> <property name="title">
<string>Trace Viewer</string>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>1</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<grid>
<property name="name"> <property name="name">
<cstring>groupSpectrumAnalyzer</cstring> <cstring>unnamed</cstring>
</property> </property>
<property name="title"> <widget class="TQSplitter" row="0" column="0" colspan="1">
<string>Spectrum Analyzer</string>
</property>
<grid>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>splitter1</cstring>
</property> </property>
<widget class="TQGroupBox" row="0" column="0" rowspan="10"> <property name="orientation">
<enum>Vertical</enum>
</property>
<widget class="TraceWidget" row="0" column="0" colspan="1">
<property name="name"> <property name="name">
<cstring>groupSpectrumAnalyzerView</cstring> <cstring>traceWidget</cstring>
</property>
<property name="title">
<string>Trace Viewer</string>
</property> </property>
<property name="sizePolicy"> <property name="minimumSize">
<sizepolicy> <size>
<hsizetype>7</hsizetype> <width>0</width>
<vsizetype>7</vsizetype> <height>0</height>
<horstretch>1</horstretch> </size>
<verstretch>1</verstretch>
</sizepolicy>
</property> </property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="TQSplitter" row="0" column="0" colspan="1">
<property name="name">
<cstring>splitter1</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<widget class="TraceWidget" row="0" column="0" colspan="1">
<property name="name">
<cstring>traceWidget</cstring>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
<widget class="TraceWidget" row="1" column="0" colspan="1">
<property name="name">
<cstring>traceZoomWidget</cstring>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
</widget>
</grid>
</widget> </widget>
<widget class="TQGroupBox" row="0" column="1"> <widget class="TraceWidget" row="1" column="0" colspan="1">
<property name="name"> <property name="name">
<cstring>groupSpectrumAnalyzerRecControls</cstring> <cstring>traceZoomWidget</cstring>
</property> </property>
<property name="title"> <property name="minimumSize">
<string>Receiver Controls</string> <size>
<width>0</width>
<height>0</height>
</size>
</property> </property>
<grid>
<widget class="TQLabel" row="0" column="0" colspan="1">
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="text">
<string>Reference Power Level:</string>
</property>
<property name="textFormat">
<enum>PlainText</enum>
</property>
</widget>
<widget class="FloatSpinBox" row="0" column="1" colspan="1">
<property name="name">
<cstring>saRefLevel</cstring>
</property>
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maxValue">
<number>128</number>
</property>
<property name="minValue">
<number>-128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
<widget class="TQLabel" row="0" column="3" colspan="1">
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="text">
<string>dBm</string>
</property>
<property name="textFormat">
<enum>PlainText</enum>
</property>
</widget>
</grid>
</widget> </widget>
</grid> </widget>
</widget> </grid>
</grid> </widget>
</widget> <widget class="TQGroupBox" row="0" column="1">
<property name="name">
<cstring>groupSpectrumAnalyzerRecControls</cstring>
</property>
<property name="title">
<string>Receiver Controls</string>
</property>
<grid>
<widget class="TQLabel" row="0" column="0" colspan="1">
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="text">
<string>Reference Power Level:</string>
</property>
<property name="textFormat">
<enum>PlainText</enum>
</property>
</widget>
<widget class="FloatSpinBox" row="0" column="1" colspan="1">
<property name="name">
<cstring>saRefLevel</cstring>
</property>
<property name="enabled">
<bool>true</bool>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>3</hsizetype>
<vsizetype>0</vsizetype>
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="minimumSize">
<size>
<width>80</width>
<height>0</height>
</size>
</property>
<property name="maxValue">
<number>128</number>
</property>
<property name="minValue">
<number>-128</number>
</property>
<property name="value">
<number>0</number>
</property>
</widget>
<widget class="TQLabel" row="0" column="3" colspan="1">
<property name="name">
<cstring>unnamed</cstring>
</property>
<property name="text">
<string>dBm</string>
</property>
<property name="textFormat">
<enum>PlainText</enum>
</property>
</widget>
</grid>
</widget>
</grid>
</widget> </widget>
</grid> </grid>
</widget> </widget>

@ -16,163 +16,142 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="TQTabWidget" row="0" column="0"> <widget class="TQGroupBox" row="0" column="0">
<property name="name"> <property name="name">
<cstring>TabWidget2</cstring> <cstring>groupOscilloscope</cstring>
</property> </property>
<property name="enabled"> <property name="title">
<bool>true</bool> <string>Oscilloscope</string>
</property> </property>
<widget class="TQWidget"> <grid>
<property name="name"> <property name="name">
<cstring>tab</cstring> <cstring>unnamed</cstring>
</property> </property>
<attribute name="title"> <widget class="TQGroupBox" row="0" column="0" rowspan="10">
<string>Oscilloscope</string>
</attribute>
<grid>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>groupOscilloscopeView</cstring>
</property> </property>
<widget class="TQGroupBox" row="0" column="0"> <property name="title">
<string>Trace Viewer</string>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>1</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<grid>
<property name="name"> <property name="name">
<cstring>groupOscilloscope</cstring> <cstring>unnamed</cstring>
</property>
<property name="title">
<string>Oscilloscope</string>
</property> </property>
<grid> <widget class="TQSplitter" row="0" column="0" colspan="1">
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>splitter1</cstring>
</property> </property>
<widget class="TQGroupBox" row="0" column="0" rowspan="10"> <property name="orientation">
<property name="name"> <enum>Vertical</enum>
<cstring>groupOscilloscopeView</cstring> </property>
</property> <widget class="TraceWidget" row="0" column="0" colspan="1">
<property name="title">
<string>Trace Viewer</string>
</property>
<property name="sizePolicy">
<sizepolicy>
<hsizetype>7</hsizetype>
<vsizetype>7</vsizetype>
<horstretch>1</horstretch>
<verstretch>1</verstretch>
</sizepolicy>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="TQSplitter" row="0" column="0" colspan="1">
<property name="name">
<cstring>splitter1</cstring>
</property>
<property name="orientation">
<enum>Vertical</enum>
</property>
<widget class="TraceWidget" row="0" column="0" colspan="1">
<property name="name">
<cstring>traceWidget</cstring>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
<widget class="TraceWidget" row="1" column="0" colspan="1">
<property name="name">
<cstring>traceZoomWidget</cstring>
</property>
<property name="minimumSize">
<size>
<width>0</width>
<height>0</height>
</size>
</property>
</widget>
</widget>
</grid>
</widget>
<widget class="TQGroupBox" row="0" column="1">
<property name="name"> <property name="name">
<cstring>groupOscilloscopeCaptureControls</cstring> <cstring>traceWidget</cstring>
</property> </property>
<property name="title"> <property name="minimumSize">
<string>Capture Controls</string> <size>
<width>0</width>
<height>0</height>
</size>
</property> </property>
<grid>
<widget class="TQPushButton" row="0" column="0" colspan="1">
<property name="name">
<cstring>runControlStartButton</cstring>
</property>
<property name="text">
<string>Run</string>
</property>
</widget>
<widget class="TQPushButton" row="0" column="1" colspan="1">
<property name="name">
<cstring>runControlStopButton</cstring>
</property>
<property name="text">
<string>Stop</string>
</property>
</widget>
<widget class="TQWidget" row="1" column="0" colspan="2">
<property name="name">
<cstring>traceControlLayoutWidget</cstring>
</property>
</widget>
</grid>
</widget> </widget>
<widget class="TQGroupBox" row="1" column="1"> <widget class="TraceWidget" row="1" column="0" colspan="1">
<property name="name"> <property name="name">
<cstring>groupOscilloscopeAcquisitionControls</cstring> <cstring>traceZoomWidget</cstring>
</property> </property>
<property name="title"> <property name="minimumSize">
<string>Acquisition Controls</string> <size>
<width>0</width>
<height>0</height>
</size>
</property> </property>
<grid>
<widget class="TQPushButton" row="0" column="0" colspan="1">
<property name="name">
<cstring>acqStart</cstring>
</property>
<property name="text">
<string>Start Acquisition</string>
</property>
</widget>
<widget class="TQPushButton" row="0" column="1" colspan="1">
<property name="name">
<cstring>acqStop</cstring>
</property>
<property name="text">
<string>Stop Acquisition</string>
</property>
</widget>
<widget class="TQPushButton" row="1" column="0" colspan="1">
<property name="name">
<cstring>waveformSave</cstring>
</property>
<property name="text">
<string>Save Waveforms</string>
</property>
</widget>
<widget class="TQPushButton" row="1" column="1" colspan="1">
<property name="name">
<cstring>waveformRecall</cstring>
</property>
<property name="text">
<string>Recall Waveforms</string>
</property>
</widget>
</grid>
</widget> </widget>
</grid> </widget>
</widget> </grid>
</grid> </widget>
</widget> <widget class="TQGroupBox" row="0" column="1">
<property name="name">
<cstring>groupOscilloscopeCaptureControls</cstring>
</property>
<property name="title">
<string>Capture Controls</string>
</property>
<grid>
<widget class="TQPushButton" row="0" column="0" colspan="1">
<property name="name">
<cstring>runControlStartButton</cstring>
</property>
<property name="text">
<string>Run</string>
</property>
</widget>
<widget class="TQPushButton" row="0" column="1" colspan="1">
<property name="name">
<cstring>runControlStopButton</cstring>
</property>
<property name="text">
<string>Stop</string>
</property>
</widget>
<widget class="TQWidget" row="1" column="0" colspan="2">
<property name="name">
<cstring>traceControlLayoutWidget</cstring>
</property>
</widget>
</grid>
</widget>
<widget class="TQGroupBox" row="1" column="1">
<property name="name">
<cstring>groupOscilloscopeAcquisitionControls</cstring>
</property>
<property name="title">
<string>Acquisition Controls</string>
</property>
<grid>
<widget class="TQPushButton" row="0" column="0" colspan="1">
<property name="name">
<cstring>acqStart</cstring>
</property>
<property name="text">
<string>Start Acquisition</string>
</property>
</widget>
<widget class="TQPushButton" row="0" column="1" colspan="1">
<property name="name">
<cstring>acqStop</cstring>
</property>
<property name="text">
<string>Stop Acquisition</string>
</property>
</widget>
<widget class="TQPushButton" row="1" column="0" colspan="1">
<property name="name">
<cstring>waveformSave</cstring>
</property>
<property name="text">
<string>Save Waveforms</string>
</property>
</widget>
<widget class="TQPushButton" row="1" column="1" colspan="1">
<property name="name">
<cstring>waveformRecall</cstring>
</property>
<property name="text">
<string>Recall Waveforms</string>
</property>
</widget>
</grid>
</widget>
</grid>
</widget> </widget>
</grid> </grid>
</widget> </widget>

@ -76,7 +76,7 @@ TraceControlWidget::TraceControlWidget(TQWidget *parent, const char *name)
m_groupBox->setColumnLayout(0, TQt::Vertical); m_groupBox->setColumnLayout(0, TQt::Vertical);
topGrid->addMultiCellWidget(m_groupBox, 0, 0, 0, 0); topGrid->addMultiCellWidget(m_groupBox, 0, 0, 0, 0);
m_groupBox->setTitle(i18n("Unknown Channel")); m_groupBox->setTitle(i18n("Unknown Channel"));
m_primaryLayout = new TQGridLayout(m_groupBox->layout(), KDialog::marginHint(), KDialog::spacingHint()); m_primaryLayout = new TQGridLayout(m_groupBox->layout(), 1, 1, KDialog::spacingHint());
m_channelEnabledCheckBox = new TQCheckBox(m_groupBox); m_channelEnabledCheckBox = new TQCheckBox(m_groupBox);
connect(m_channelEnabledCheckBox, SIGNAL(clicked()), this, SLOT(enableClicked())); connect(m_channelEnabledCheckBox, SIGNAL(clicked()), this, SLOT(enableClicked()));

@ -16,31 +16,31 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="TQTabWidget" row="0" column="0"> <widget class="TQGroupBox" row="0" column="0">
<property name="name"> <property name="name">
<cstring>TabWidget2</cstring> <cstring>groupMonitor</cstring>
</property> </property>
<property name="enabled"> <property name="title">
<bool>true</bool> <string>Monitor</string>
</property> </property>
<widget class="TQWidget"> <grid>
<property name="name"> <property name="name">
<cstring>tab</cstring> <cstring>unnamed</cstring>
</property> </property>
<attribute name="title"> <widget class="TQTabWidget" row="0" column="0">
<string>Monitor</string>
</attribute>
<grid>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>TabWidget2</cstring>
</property> </property>
<widget class="TQGroupBox" row="0" column="0"> <property name="enabled">
<bool>true</bool>
</property>
<widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>groupMonitor</cstring> <cstring>tab</cstring>
</property>
<property name="title">
<string>Monitor</string>
</property> </property>
<attribute name="title">
<string>Plotter</string>
</attribute>
<grid> <grid>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
@ -96,86 +96,99 @@
</widget> </widget>
</grid> </grid>
</widget> </widget>
<widget class="TQGroupBox" row="0" column="1">
<property name="name">
<cstring>groupMonitorCaptureControls</cstring>
</property>
<property name="title">
<string>Sensor Capture Controls</string>
</property>
<grid>
<widget class="TQWidget" row="1" column="0" colspan="2">
<property name="name">
<cstring>traceControlLayoutWidget</cstring>
</property>
</widget>
</grid>
</widget>
<widget class="TQGroupBox" row="1" column="1">
<property name="name">
<cstring>groupAcquisitionControls</cstring>
</property>
<property name="title">
<string>Acquisition Controls</string>
</property>
<grid>
<widget class="TQPushButton" row="0" column="0" colspan="1">
<property name="name">
<cstring>runControlStartButton</cstring>
</property>
<property name="text">
<string>Start Acquisition</string>
</property>
</widget>
<widget class="TQPushButton" row="0" column="1" colspan="1">
<property name="name">
<cstring>runControlStopButton</cstring>
</property>
<property name="text">
<string>Stop Acquisition</string>
</property>
</widget>
<widget class="TQPushButton" row="1" column="0" colspan="1">
<property name="name">
<cstring>waveformSave</cstring>
</property>
<property name="text">
<string>Save Waveforms</string>
</property>
</widget>
<widget class="TQPushButton" row="1" column="1" colspan="1">
<property name="name">
<cstring>waveformRecall</cstring>
</property>
<property name="text">
<string>Recall Waveforms</string>
</property>
</widget>
<widget class="TQCheckBox" row="2" column="0" colspan="2">
<property name="name">
<cstring>autoSave</cstring>
</property>
<property name="text">
<string>Enable Automatic Saving</string>
</property>
</widget>
<widget class="KURLRequester" row="3" column="0" colspan="2">
<property name="name">
<cstring>autoSaveFile</cstring>
</property>
<property name="mode">
<number>25</number>
</property>
<property name="filter">
<cstring>*.wfm|Waveform Files (*.wfm)</cstring>
</property>
</widget>
</grid>
</widget>
</grid> </grid>
</widget> </widget>
</grid> </widget>
</widget> </grid>
</widget>
<widget class="TQGroupBox" row="0" column="1">
<property name="name">
<cstring>groupControl</cstring>
</property>
<property name="title">
<string>Controls</string>
</property>
<grid>
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="TQGroupBox" row="0" column="1">
<property name="name">
<cstring>groupMonitorCaptureControls</cstring>
</property>
<property name="title">
<string>Capture Controls</string>
</property>
<grid>
<widget class="TQWidget" row="1" column="0" colspan="2">
<property name="name">
<cstring>traceControlLayoutWidget</cstring>
</property>
</widget>
</grid>
</widget>
<widget class="TQGroupBox" row="1" column="1">
<property name="name">
<cstring>groupAcquisitionControls</cstring>
</property>
<property name="title">
<string>Acquisition Controls</string>
</property>
<grid>
<widget class="TQPushButton" row="0" column="0" colspan="1">
<property name="name">
<cstring>runControlStartButton</cstring>
</property>
<property name="text">
<string>Start Acquisition</string>
</property>
</widget>
<widget class="TQPushButton" row="0" column="1" colspan="1">
<property name="name">
<cstring>runControlStopButton</cstring>
</property>
<property name="text">
<string>Stop Acquisition</string>
</property>
</widget>
<widget class="TQPushButton" row="1" column="0" colspan="1">
<property name="name">
<cstring>waveformSave</cstring>
</property>
<property name="text">
<string>Save Waveforms</string>
</property>
</widget>
<widget class="TQPushButton" row="1" column="1" colspan="1">
<property name="name">
<cstring>waveformRecall</cstring>
</property>
<property name="text">
<string>Recall Waveforms</string>
</property>
</widget>
<widget class="TQCheckBox" row="2" column="0" colspan="2">
<property name="name">
<cstring>autoSave</cstring>
</property>
<property name="text">
<string>Enable Automatic Saving</string>
</property>
</widget>
<widget class="KURLRequester" row="3" column="0" colspan="2">
<property name="name">
<cstring>autoSaveFile</cstring>
</property>
<property name="mode">
<number>25</number>
</property>
<property name="filter">
<cstring>*.wfm|Waveform Files (*.wfm)</cstring>
</property>
</widget>
</grid>
</widget>
</grid>
</widget> </widget>
</grid> </grid>
</widget> </widget>

@ -114,39 +114,46 @@ TraceControlWidget::TraceControlWidget(TQWidget *parent, const char *name)
m_groupBox->setColumnLayout(0, TQt::Vertical); m_groupBox->setColumnLayout(0, TQt::Vertical);
topGrid->addMultiCellWidget(m_groupBox, 0, 0, 0, 0); topGrid->addMultiCellWidget(m_groupBox, 0, 0, 0, 0);
m_groupBox->setTitle(i18n("Unknown Channel")); m_groupBox->setTitle(i18n("Unknown Channel"));
m_primaryLayout = new TQGridLayout(m_groupBox->layout(), KDialog::marginHint(), KDialog::spacingHint()); m_primaryLayout = new TQGridLayout(m_groupBox->layout(), 1, 1, KDialog::spacingHint());
m_channelEnabledCheckBox = new TQCheckBox(m_groupBox); m_channelEnabledCheckBox = new TQCheckBox(m_groupBox);
connect(m_channelEnabledCheckBox, SIGNAL(clicked()), this, SLOT(enableClicked())); connect(m_channelEnabledCheckBox, SIGNAL(clicked()), this, SLOT(enableClicked()));
m_channelEnabledCheckBox->setText(i18n("Enable")); m_channelEnabledCheckBox->setText(i18n("Enable"));
m_primaryLayout->addMultiCellWidget(m_channelEnabledCheckBox, 0, 0, 0, 0); m_primaryLayout->addMultiCellWidget(m_channelEnabledCheckBox, 0, 0, 0, 2);
m_valueLabel = new TQLabel(m_groupBox); m_valueLabel = new TQLabel(m_groupBox);
m_valueLabel->setText(i18n("<qt><nobr>Value: <b>%1</b></qt>").arg(i18n("<unknown>"))); m_valueLabel->setText(i18n("<qt><nobr>Value: <b>%1</b></qt>").arg(i18n("<unknown>")));
m_primaryLayout->addMultiCellWidget(m_valueLabel, 1, 1, 0, 1); m_primaryLayout->addMultiCellWidget(m_valueLabel, 1, 1, 0, 2);
m_valueLabel->hide(); m_valueLabel->hide();
m_timestampLabel = new TQLabel(m_groupBox); m_timestampLabel = new TQLabel(m_groupBox);
m_timestampLabel->setText(i18n("<qt><nobr>Sampled: <b>%1</b></qt>").arg(i18n("<unknown>"))); m_timestampLabel->setText(i18n("<qt><nobr>Sampled: <b>%1</b></qt>").arg(i18n("<unknown>")));
m_primaryLayout->addMultiCellWidget(m_timestampLabel, 2, 2, 0, 1); m_primaryLayout->addMultiCellWidget(m_timestampLabel, 2, 2, 0, 2);
m_timestampLabel->hide(); m_timestampLabel->hide();
m_timestepLabel1 = new TQLabel(m_groupBox); m_timestepLabel1 = new TQLabel(m_groupBox);
m_timestepLabel1->setText(i18n("Sample every:")); m_timestepLabel1->setText(i18n("<qt><nobr>Sample every:</qt>"));
m_primaryLayout->addMultiCellWidget(m_timestepLabel1, 3, 3, 0, 0); m_primaryLayout->addMultiCellWidget(m_timestepLabel1, 3, 3, 0, 0);
m_timestepLabel1->hide(); m_timestepLabel1->hide();
m_timestepSpinBox = new FloatSpinBox(m_groupBox); m_timestepSpinBox = new FloatSpinBox(m_groupBox);
m_timestepSpinBox->setFloatMax(60*60*24); // 1 day m_timestepSpinBox->setFloatMax(60*60*24); // 1 day
connect(m_timestepSpinBox, SIGNAL(floatValueChanged(double)), this, SLOT(timestepChanged(double))); connect(m_timestepSpinBox, SIGNAL(floatValueChanged(double)), this, SLOT(timestepChanged(double)));
m_primaryLayout->addMultiCellWidget(m_timestepSpinBox, 4, 4, 0, 0); m_primaryLayout->addMultiCellWidget(m_timestepSpinBox, 3, 3, 1, 1);
m_timestepSpinBox->hide(); m_timestepSpinBox->hide();
m_timestepLabel2 = new TQLabel(m_groupBox); m_timestepLabel2 = new TQLabel(m_groupBox);
m_timestepLabel2->setText(i18n("seconds")); m_timestepLabel2->setText(i18n("<qt><nobr>seconds<qt>"));
m_primaryLayout->addMultiCellWidget(m_timestepLabel2, 4, 4, 1, 1); m_primaryLayout->addMultiCellWidget(m_timestepLabel2, 3, 3, 2, 2);
m_timestepLabel2->hide(); m_timestepLabel2->hide();
m_clearPushButton = new TQPushButton(m_groupBox);
m_clearPushButton->setText(i18n("Erase Existing Data"));
connect(m_clearPushButton, SIGNAL(clicked()), this, SLOT(clearTraceDataClicked()));
m_primaryLayout->addMultiCellWidget(m_clearPushButton, 5, 5, 0, 2);
m_clearPushButton->setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::Minimum));
m_clearPushButton->hide();
m_sampleTimer = new TQTimer(); m_sampleTimer = new TQTimer();
connect(m_sampleTimer, SIGNAL(timeout()), this, SIGNAL(newSampleDesired())); connect(m_sampleTimer, SIGNAL(timeout()), this, SIGNAL(newSampleDesired()));
} }
@ -156,6 +163,10 @@ TraceControlWidget::~TraceControlWidget() {
delete m_sampleTimer; delete m_sampleTimer;
} }
void TraceControlWidget::clearTraceDataClicked() {
emit(clearTraceRequested());
}
void TraceControlWidget::startSampleTimer(int msecs) { void TraceControlWidget::startSampleTimer(int msecs) {
if (m_channelEnabledCheckBox->isOn()) { if (m_channelEnabledCheckBox->isOn()) {
m_nominalTimeStep = msecs/1.0e3; m_nominalTimeStep = msecs/1.0e3;
@ -178,6 +189,7 @@ void TraceControlWidget::setTraceEnabled(bool enabled) {
m_timestepSpinBox->show(); m_timestepSpinBox->show();
m_valueLabel->show(); m_valueLabel->show();
m_timestampLabel->show(); m_timestampLabel->show();
m_clearPushButton->show();
} }
else { else {
m_timestepLabel1->hide(); m_timestepLabel1->hide();
@ -185,6 +197,7 @@ void TraceControlWidget::setTraceEnabled(bool enabled) {
m_timestepSpinBox->hide(); m_timestepSpinBox->hide();
m_valueLabel->hide(); m_valueLabel->hide();
m_timestampLabel->hide(); m_timestampLabel->hide();
m_clearPushButton->hide();
} }
} }
@ -205,6 +218,18 @@ void TraceControlWidget::setTimestep(double seconds) {
void TraceControlWidget::setMinTimestep(double seconds) { void TraceControlWidget::setMinTimestep(double seconds) {
m_minimumTimeStep = seconds; m_minimumTimeStep = seconds;
m_timestepSpinBox->setFloatMin(seconds); m_timestepSpinBox->setFloatMin(seconds);
if (seconds < 0.001) {
m_timestepSpinBox->setPrecision(3);
}
else if (seconds < 0.01) {
m_timestepSpinBox->setPrecision(2);
}
else if (seconds < 0.1) {
m_timestepSpinBox->setPrecision(1);
}
else {
m_timestepSpinBox->setPrecision(0);
}
} }
void TraceControlWidget::enableClicked() { void TraceControlWidget::enableClicked() {
@ -223,7 +248,7 @@ void TraceControlWidget::setCurrentSampleValue(double value, TQString units) {
} }
void TraceControlWidget::setCurrentSampleTimestamp(TQDateTime timestamp) { void TraceControlWidget::setCurrentSampleTimestamp(TQDateTime timestamp) {
m_timestampLabel->setText(i18n("<qt><nobr>Sampled: <b>%1</b></qt>").arg(timestamp.toString())); m_timestampLabel->setText(i18n("<qt><nobr>Sampled: <b>%1 UTC</b></qt>").arg(timestamp.toString()));
} }
SensorMonitorPart::SensorMonitorPart(TQWidget *parentWidget, const char *widgetName, TQObject *parent, const char *name, const TQStringList&) SensorMonitorPart::SensorMonitorPart(TQWidget *parentWidget, const char *widgetName, TQObject *parent, const char *name, const TQStringList&)
@ -701,6 +726,7 @@ void SensorMonitorPart::updateTraceControlWidgets() {
m_traceControlWidgetList[i] = new TraceControlWidget(m_base->traceControlLayoutWidget); m_traceControlWidgetList[i] = new TraceControlWidget(m_base->traceControlLayoutWidget);
connect(m_traceControlWidgetList[i], SIGNAL(enableChanged(bool)), this, SLOT(traceControlEnableChanged(bool))); connect(m_traceControlWidgetList[i], SIGNAL(enableChanged(bool)), this, SLOT(traceControlEnableChanged(bool)));
connect(m_traceControlWidgetList[i], SIGNAL(newSampleDesired()), this, SLOT(processNewSampleRequest())); connect(m_traceControlWidgetList[i], SIGNAL(newSampleDesired()), this, SLOT(processNewSampleRequest()));
connect(m_traceControlWidgetList[i], SIGNAL(clearTraceRequested()), this, SLOT(traceControlClearRequested()));
m_traceControlWidgetGrid->addMultiCellWidget(m_traceControlWidgetList[i], i, i, 0, 0); m_traceControlWidgetGrid->addMultiCellWidget(m_traceControlWidgetList[i], i, i, 0, 0);
m_traceControlWidgetList[i]->setTraceName(i18n("Sensor %1").arg(m_sensorList[i].name)); m_traceControlWidgetList[i]->setTraceName(i18n("Sensor %1").arg(m_sensorList[i].name));
m_traceControlWidgetList[i]->show(); m_traceControlWidgetList[i]->show();
@ -739,6 +765,36 @@ void SensorMonitorPart::traceControlEnableChanged(bool enabled) {
updateTraceControlWidgets(); updateTraceControlWidgets();
} }
void SensorMonitorPart::traceControlClearRequested() {
int i;
int channel = -1;
const TraceControlWidget* widget = dynamic_cast<const TraceControlWidget*>(sender());
if (widget) {
for (i=0; i<MAXTRACES;i++) {
if (m_traceControlWidgetList[i] == widget) {
channel = i;
break;
}
}
if ((channel >= 0) && (channel <=MAXTRACES)) {
m_samplesInTrace[channel] = 0;
TQDoubleArray sampleArray;
TQDoubleArray positionArray;
m_traceWidget->setSamples(m_sampleRequestIndex, sampleArray);
m_traceWidget->setPositions(m_sampleRequestIndex, positionArray);
m_base->traceZoomWidget->setSamples(m_sampleRequestIndex, sampleArray);
m_base->traceZoomWidget->setPositions(m_sampleRequestIndex, positionArray);
m_traceControlWidgetList[m_sampleRequestIndex]->setCurrentSampleValue(0, m_sensorList[channel].units);
m_traceControlWidgetList[m_sampleRequestIndex]->setCurrentSampleTimestamp(TQDateTime());
}
}
updateGraticule();
m_traceWidget->repaint(false);
m_base->traceZoomWidget->repaint(false);
updateTraceControlWidgets();
}
void SensorMonitorPart::processNewSampleRequest() { void SensorMonitorPart::processNewSampleRequest() {
int i; int i;
int channel = -1; int channel = -1;
@ -901,6 +957,12 @@ void SensorMonitorPart::recallWaveforms() {
m_traceWidget->setPositions(traceno, positions); m_traceWidget->setPositions(traceno, positions);
m_base->traceZoomWidget->setSamples(traceno, values); m_base->traceZoomWidget->setSamples(traceno, values);
m_base->traceZoomWidget->setPositions(traceno, positions); m_base->traceZoomWidget->setPositions(traceno, positions);
if (m_samplesInTrace[traceno] > 0) {
m_traceControlWidgetList[traceno]->setCurrentSampleValue(values[m_samplesInTrace[traceno]-1], m_sensorList[traceno].units);
TQDateTime lastSampleTime;
lastSampleTime.setTime_t(positions[m_samplesInTrace[traceno]-1]);
m_traceControlWidgetList[traceno]->setCurrentSampleTimestamp(lastSampleTime);
}
} }
for (int cursorno=0; cursorno<4; cursorno++) { for (int cursorno=0; cursorno<4; cursorno++) {
double cursorPos; double cursorPos;

@ -53,6 +53,7 @@ class TQCheckBox;
class TQGroupBox; class TQGroupBox;
class TQFile; class TQFile;
class TQLabel; class TQLabel;
class TQPushButton;
class SensorMonitorBase; class SensorMonitorBase;
namespace RemoteLab namespace RemoteLab
@ -99,10 +100,12 @@ namespace RemoteLab
signals: signals:
void enableChanged(bool enabled); void enableChanged(bool enabled);
void newSampleDesired(); void newSampleDesired();
void clearTraceRequested();
private slots: private slots:
void enableClicked(); void enableClicked();
void timestepChanged(double); void timestepChanged(double);
void clearTraceDataClicked();
private: private:
TQGroupBox* m_groupBox; TQGroupBox* m_groupBox;
@ -114,6 +117,7 @@ namespace RemoteLab
TQLabel* m_timestepLabel2; TQLabel* m_timestepLabel2;
TQLabel* m_valueLabel; TQLabel* m_valueLabel;
TQLabel* m_timestampLabel; TQLabel* m_timestampLabel;
TQPushButton* m_clearPushButton;
double m_minimumTimeStep; double m_minimumTimeStep;
double m_nominalTimeStep; double m_nominalTimeStep;
@ -149,6 +153,7 @@ namespace RemoteLab
void updateGraticule(); void updateGraticule();
void updateTraceControlWidgets(); void updateTraceControlWidgets();
void traceControlEnableChanged(bool enabled); void traceControlEnableChanged(bool enabled);
void traceControlClearRequested();
void processNewSampleRequest(); void processNewSampleRequest();
void processNewSampleRequest(int channel); void processNewSampleRequest(int channel);
void processAutosave(); void processAutosave();

@ -25,14 +25,19 @@ FloatSpinBox::FloatSpinBox(TQWidget *parent , const char* name) : TQSpinBox(pare
connect( this, SIGNAL(valueChanged(int)), SLOT(acceptValueChanged(int)) ); connect( this, SIGNAL(valueChanged(int)), SLOT(acceptValueChanged(int)) );
} }
void FloatSpinBox::init(double fmin, double fmax, double fvalue) { void FloatSpinBox::init(double fmin, double fmax, double fvalue, int precision) {
min = fmin; min = fmin;
max = fmax; max = fmax;
value = fvalue; value = fvalue;
// How many decimals after the floating point? // How many decimals after the floating point?
dec = ((fmax - fmin) == 0) ? 2 : 2 - (int)( log10(fabs(fmax - fmin)) ); if (precision < 0) {
if (dec < 0) dec = 0; dec = ((fmax - fmin) == 0) ? 2 : 2 - (int)( log10(fabs(fmax - fmin)) );
if (dec < 0) dec = 0;
}
else {
dec = precision;
}
int intmax = (int)((max - min) * pow( 10, dec )); int intmax = (int)((max - min) * pow( 10, dec ));
int intval = ROUND( (value - min) * pow( 10, dec ) ); int intval = ROUND( (value - min) * pow( 10, dec ) );
@ -45,11 +50,15 @@ void FloatSpinBox::init(double fmin, double fmax, double fvalue) {
} }
void FloatSpinBox::setFloatMin(double fmin) { void FloatSpinBox::setFloatMin(double fmin) {
init(fmin, max, value); init(fmin, max, value, dec);
} }
void FloatSpinBox::setFloatMax(double fmax) { void FloatSpinBox::setFloatMax(double fmax) {
init(min, fmax, value); init(min, fmax, value, dec);
}
void FloatSpinBox::setPrecision(int precision) {
init(min, max, value, precision);
} }
TQString FloatSpinBox::mapValueToText(int ival) { TQString FloatSpinBox::mapValueToText(int ival) {

@ -21,9 +21,10 @@ class FloatSpinBox : public TQSpinBox
FloatSpinBox(double min, double max, double value, TQWidget *parent = 0); FloatSpinBox(double min, double max, double value, TQWidget *parent = 0);
~FloatSpinBox(); ~FloatSpinBox();
void init(double min, double max, double value); void init(double min, double max, double value, int precision=-1);
void setFloatMin(double min); void setFloatMin(double min);
void setFloatMax(double max); void setFloatMax(double max);
void setPrecision(int precision);
private: private:
int dec; int dec;

@ -822,6 +822,7 @@ TraceWidget::TraceWidget(TQWidget* parent, const char* name) : TQWidget(parent,
m_graticuleWidget = new GraticuleWidget(this); m_graticuleWidget = new GraticuleWidget(this);
connect(m_graticuleWidget, SIGNAL(cursorPositionChanged(uint, double)), this, SLOT(processChangedCursor(uint, double))); connect(m_graticuleWidget, SIGNAL(cursorPositionChanged(uint, double)), this, SLOT(processChangedCursor(uint, double)));
m_primaryLayout->addMultiCellWidget(m_graticuleWidget, 0, 254, 0, 254); m_primaryLayout->addMultiCellWidget(m_graticuleWidget, 0, 254, 0, 254);
m_primaryLayout->setAlignment(TQt::AlignTop);
m_rightPaneLayout = new TQGridLayout; m_rightPaneLayout = new TQGridLayout;
m_traceLabelLayout = new TQGridLayout; m_traceLabelLayout = new TQGridLayout;
m_infoLabelLayout = new TQGridLayout; m_infoLabelLayout = new TQGridLayout;
@ -1578,7 +1579,7 @@ void TraceWidget::resizeTraceArray(uint newsize) {
m_traceLabelLayout->addWidget(m_traceArray[i]->singleIncrBtn, 0, (i*2)+1); m_traceLabelLayout->addWidget(m_traceArray[i]->singleIncrBtn, 0, (i*2)+1);
m_traceLabelLayout->addWidget(m_traceArray[i]->posResetBtn, 1, (i*2)+1); m_traceLabelLayout->addWidget(m_traceArray[i]->posResetBtn, 1, (i*2)+1);
m_traceLabelLayout->addWidget(m_traceArray[i]->singleDecrBtn, 2, (i*2)+1); m_traceLabelLayout->addWidget(m_traceArray[i]->singleDecrBtn, 2, (i*2)+1);
m_statusLabelLayout->insertWidget(i, m_traceArray[i]->graphStatusLabel); m_statusLabelLayout->insertWidget(i, m_traceArray[i]->graphStatusLabel, TQt::AlignTop);
m_statusLabelLayoutInner->insertWidget(i, m_traceArray[i]->graphStatusLabelInner); m_statusLabelLayoutInner->insertWidget(i, m_traceArray[i]->graphStatusLabelInner);
} }
} }
@ -1609,10 +1610,10 @@ void TraceWidget::resizeCursorArray(uint newsize) {
connect(m_cursorArray[i], SIGNAL(positionChanged(double)), this, SLOT(processChangedCusorPosition(double))); connect(m_cursorArray[i], SIGNAL(positionChanged(double)), this, SLOT(processChangedCusorPosition(double)));
if (m_cursorArray[i]->paramLabel) { if (m_cursorArray[i]->paramLabel) {
m_cursorLabelLayout->addMultiCellWidget(m_cursorArray[i]->paramLabel, i*2, i*2, 0, 3); m_cursorLabelLayout->addMultiCellWidget(m_cursorArray[i]->paramLabel, i*2, i*2, 0, 3);
m_cursorLabelLayout->addMultiCellWidget(m_cursorArray[i]->multiIncrBtn, (i*2)+1, (i*2)+1, 0, 0); m_cursorLabelLayout->addMultiCellWidget(m_cursorArray[i]->multiIncrBtn, (i*2)+1, (i*2)+1, 0, 0, TQt::AlignHCenter);
m_cursorLabelLayout->addMultiCellWidget(m_cursorArray[i]->singleIncrBtn, (i*2)+1, (i*2)+1, 1, 1); m_cursorLabelLayout->addMultiCellWidget(m_cursorArray[i]->singleIncrBtn, (i*2)+1, (i*2)+1, 1, 1, TQt::AlignHCenter);
m_cursorLabelLayout->addMultiCellWidget(m_cursorArray[i]->singleDecrBtn, (i*2)+1, (i*2)+1, 2, 2); m_cursorLabelLayout->addMultiCellWidget(m_cursorArray[i]->singleDecrBtn, (i*2)+1, (i*2)+1, 2, 2, TQt::AlignHCenter);
m_cursorLabelLayout->addMultiCellWidget(m_cursorArray[i]->multiDecrBtn, (i*2)+1, (i*2)+1, 3, 3); m_cursorLabelLayout->addMultiCellWidget(m_cursorArray[i]->multiDecrBtn, (i*2)+1, (i*2)+1, 3, 3, TQt::AlignHCenter);
} }
} }
} }

Loading…
Cancel
Save