summaryrefslogtreecommitdiffstats
path: root/clients/tde/src/part
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2015-09-12 21:17:28 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2015-09-12 21:17:28 -0500
commite4fcc7fd8faab801c98d972fe305aeed9b9d7790 (patch)
treee28081593695b434ce3f9bf9b364e7b6486b5478 /clients/tde/src/part
parentc62b282dffaec31b3f4eac488144fb5b6a2c2eea (diff)
downloadulab-e4fcc7fd8faab801c98d972fe305aeed9b9d7790.tar.gz
ulab-e4fcc7fd8faab801c98d972fe305aeed9b9d7790.zip
Restore measured parameters when waveform file is loaded
Consolidate parameter set routines
Diffstat (limited to 'clients/tde/src/part')
-rwxr-xr-xclients/tde/src/part/companalyzer/part.cpp46
-rw-r--r--clients/tde/src/part/companalyzer/part.h1
2 files changed, 17 insertions, 30 deletions
diff --git a/clients/tde/src/part/companalyzer/part.cpp b/clients/tde/src/part/companalyzer/part.cpp
index 8762616..32eede1 100755
--- a/clients/tde/src/part/companalyzer/part.cpp
+++ b/clients/tde/src/part/companalyzer/part.cpp
@@ -1089,19 +1089,20 @@ void CompAnalyzerPart::frequencyInputChanged(double value) {
processLockouts();
}
-void CompAnalyzerPart::parameterASourceChanged(int index) {
+void CompAnalyzerPart::parameterSourceChanged() {
TQValueList<TQ_UINT32> sourceIndexList;
- TQString newSource = m_base->parameterASourceCombo->text(index);
- TQString source = m_base->parameterBSourceCombo->currentText();
-
AllowedMeasurementInfoList::iterator it2;
+ TQString source;
+
+ source = m_base->parameterASourceCombo->currentText();
for (it2 = m_parameterSourceValues[0].begin(); it2 != m_parameterSourceValues[0].end(); ++it2) {
- if ((*it2).second == newSource) {
+ if ((*it2).second == source) {
sourceIndexList.append((*it2).first);
break;
}
}
+ source = m_base->parameterBSourceCombo->currentText();
for (it2 = m_parameterSourceValues[1].begin(); it2 != m_parameterSourceValues[1].end(); ++it2) {
if ((*it2).second == source) {
sourceIndexList.append((*it2).first);
@@ -1113,35 +1114,15 @@ void CompAnalyzerPart::parameterASourceChanged(int index) {
m_worker->setNewParameterSourceList(sourceIndexList);
requestNetworkOperation(CompAnalyzerEvent(ChangeMeasurementSource, TQVariant()), true);
}
+}
+void CompAnalyzerPart::parameterASourceChanged(int) {
+ parameterSourceChanged();
processLockouts();
}
-void CompAnalyzerPart::parameterBSourceChanged(int index) {
- TQValueList<TQ_UINT32> sourceIndexList;
- TQString newSource = m_base->parameterBSourceCombo->text(index);
- TQString source = m_base->parameterASourceCombo->currentText();
-
- AllowedMeasurementInfoList::iterator it2;
- for (it2 = m_parameterSourceValues[0].begin(); it2 != m_parameterSourceValues[0].end(); ++it2) {
- if ((*it2).second == source) {
- sourceIndexList.append((*it2).first);
- break;
- }
- }
-
- for (it2 = m_parameterSourceValues[1].begin(); it2 != m_parameterSourceValues[1].end(); ++it2) {
- if ((*it2).second == newSource) {
- sourceIndexList.append((*it2).first);
- break;
- }
- }
-
- if (sourceIndexList.count() >= 2) {
- m_worker->setNewParameterSourceList(sourceIndexList);
- requestNetworkOperation(CompAnalyzerEvent(ChangeMeasurementSource, TQVariant()), true);
- }
-
+void CompAnalyzerPart::parameterBSourceChanged(int) {
+ parameterSourceChanged();
processLockouts();
}
@@ -1304,6 +1285,10 @@ void CompAnalyzerPart::recallWaveforms() {
if (traceno == 0) {
m_worker->setSweepStartFrequency(positions[0]);
m_worker->setSweepEndFrequency(positions[positions.count() - 1]);
+ m_base->parameterASourceCombo->setCurrentText(m_sensorList[traceno].name);
+ }
+ else if (traceno == 1) {
+ m_base->parameterBSourceCombo->setCurrentText(m_sensorList[traceno].name);
}
}
for (int cursorno=0; cursorno<4; cursorno++) {
@@ -1320,6 +1305,7 @@ void CompAnalyzerPart::recallWaveforms() {
m_base->sweepStartFrequencyBox->setFloatValue(sweepStartFrequency / 1000000.0);
m_base->sweepEndFrequencyBox->setFloatValue(sweepEndFrequency / 1000000.0);
m_base->sweepStepFrequencyBox->setFloatValue(sweepStepFrequency / 1000000.0);
+ parameterSourceChanged();
}
else {
KMessageBox::error(0, i18n("<qt>The selected waveform file version does not match this client</qt>"), i18n("Invalid File"));
diff --git a/clients/tde/src/part/companalyzer/part.h b/clients/tde/src/part/companalyzer/part.h
index 517e81d..6795eb9 100644
--- a/clients/tde/src/part/companalyzer/part.h
+++ b/clients/tde/src/part/companalyzer/part.h
@@ -227,6 +227,7 @@ namespace RemoteLab
TQString parameterMeasurementUnits(TQ_UINT32 parameter);
TQString parameterNameToMeasurementUnits(TQString name, unsigned int parameter_index);
void requestNetworkOperation(CompAnalyzerEvent item, bool syncPoint=false);
+ void parameterSourceChanged();
void patWatchDog();
private: