Restore measured parameters when waveform file is loaded

Consolidate parameter set routines
master
Timothy Pearson 9 years ago
parent c62b282dff
commit e4fcc7fd8f

@ -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"));

@ -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:

Loading…
Cancel
Save