diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-07-12 02:33:58 -0500 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-07-12 02:33:58 -0500 |
commit | c485c0ef46c7330eba93226ac0ca09415a765d9d (patch) | |
tree | 53cffe4344d910593115491e93274a1d52db58ae /clients/tde/src/part/commanalyzer | |
parent | ad5dff2bdac2afa6272db21aa4ee4908d6564d2b (diff) | |
download | ulab-c485c0ef46c7330eba93226ac0ca09415a765d9d.tar.gz ulab-c485c0ef46c7330eba93226ac0ca09415a765d9d.zip |
Enhance trace viewer
Diffstat (limited to 'clients/tde/src/part/commanalyzer')
-rw-r--r-- | clients/tde/src/part/commanalyzer/part.cpp | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/clients/tde/src/part/commanalyzer/part.cpp b/clients/tde/src/part/commanalyzer/part.cpp index 7aea8a3..3e53429 100644 --- a/clients/tde/src/part/commanalyzer/part.cpp +++ b/clients/tde/src/part/commanalyzer/part.cpp @@ -61,6 +61,11 @@ CommAnalyzerPart::CommAnalyzerPart( TQWidget *parentWidget, const char *widgetNa // Create widgets m_base = new CommAnalyzerBase(widget()); m_traceWidget = m_base->traceWidget; + m_base->traceWidget->setSizePolicy(TQSizePolicy(TQSizePolicy::MinimumExpanding, TQSizePolicy::MinimumExpanding)); + m_base->traceWidget->setTraceEnabled(0, true); + m_traceWidget->setTraceName(0, "Trace 1"); + m_traceWidget->setTraceHorizontalUnits(0, "Hz"); + m_traceWidget->setTraceVerticalUnits(0, "dBm"); m_base->saRefLevel->setFloatMin(-128); m_base->saRefLevel->setFloatMax(128); m_base->saRefLevel->setLineStep(1); @@ -80,7 +85,7 @@ CommAnalyzerPart::~CommAnalyzerPart() { } void CommAnalyzerPart::postInit() { - // + setUsingFixedSize(false); } bool CommAnalyzerPart::openURL(const KURL &url) { @@ -480,7 +485,7 @@ void CommAnalyzerPart::mainEventLoop() { if (result == "ACK") { // Update display widget(s) - m_traceWidget->setSamples(trace, 0); + m_traceWidget->setSamples(0, trace); postProcessTrace(); m_traceWidget->repaint(); } @@ -590,13 +595,23 @@ void CommAnalyzerPart::postProcessTrace() { } void CommAnalyzerPart::updateGraticule() { - m_traceWidget->setNumberOfSamples(m_samplesInTrace, 0); + m_traceWidget->setNumberOfSamples(0, m_samplesInTrace); m_traceWidget->setNumberOfHorizontalDivisions(m_hdivs); m_traceWidget->setNumberOfVerticalDivisions(m_vdivs); m_leftFrequency = m_centerfreq - (m_spanfreq/2.0); m_rightFrequency = m_centerfreq + (m_spanfreq/2.0); - m_traceWidget->setDisplayLimits(m_leftFrequency, m_rpower, m_rightFrequency, m_rpower-(m_vscale*m_hdivs), 0); + + double freqincr = (m_rightFrequency-m_leftFrequency)/m_samplesInTrace; + double freqpos = m_leftFrequency; + TQDoubleArray tracepositions; + tracepositions.resize(m_samplesInTrace); + for (int i=0; i<m_samplesInTrace; i++) { + tracepositions[i] = freqpos; + freqpos = freqpos + freqincr; + } + m_traceWidget->setPositions(0, tracepositions); + m_traceWidget->setDisplayLimits(0, m_leftFrequency, m_rpower, m_rightFrequency, m_rpower-(m_vscale*m_hdivs)); // Also update controls m_base->saRefLevel->blockSignals(true); |