[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] r10790 - gnuradio/branches/developers/trondeau/qtdevel
From: |
trondeau |
Subject: |
[Commit-gnuradio] r10790 - gnuradio/branches/developers/trondeau/qtdevel2/gr-qtgui/src/lib |
Date: |
Wed, 8 Apr 2009 18:46:31 -0600 (MDT) |
Author: trondeau
Date: 2009-04-08 18:46:30 -0600 (Wed, 08 Apr 2009)
New Revision: 10790
Modified:
gnuradio/branches/developers/trondeau/qtdevel2/gr-qtgui/src/lib/SpectrumGUIClass.cc
gnuradio/branches/developers/trondeau/qtdevel2/gr-qtgui/src/lib/SpectrumGUIClass.h
Log:
cleaning up to more standardized format.
Modified:
gnuradio/branches/developers/trondeau/qtdevel2/gr-qtgui/src/lib/SpectrumGUIClass.cc
===================================================================
---
gnuradio/branches/developers/trondeau/qtdevel2/gr-qtgui/src/lib/SpectrumGUIClass.cc
2009-04-07 19:53:17 UTC (rev 10789)
+++
gnuradio/branches/developers/trondeau/qtdevel2/gr-qtgui/src/lib/SpectrumGUIClass.cc
2009-04-09 00:46:30 UTC (rev 10790)
@@ -43,7 +43,8 @@
_powerValue = 1;
}
-SpectrumGUIClass::~SpectrumGUIClass(){
+SpectrumGUIClass::~SpectrumGUIClass()
+{
if(GetWindowOpenFlag()){
delete _spectrumDisplayForm;
}
@@ -57,7 +58,8 @@
//delete _windowStateLock;
}
-void SpectrumGUIClass::OpenSpectrumWindow(QWidget* parent)
+void
+SpectrumGUIClass::OpenSpectrumWindow(QWidget* parent)
{
//_windowStateLock->Lock();
@@ -90,10 +92,9 @@
SetDisplayTitle(_title);
Reset();
- qApp->postEvent(_spectrumDisplayForm, new
QEvent(QEvent::Type(QEvent::User+3)));
+ qApp->postEvent(_spectrumDisplayForm,
+ new QEvent(QEvent::Type(QEvent::User+3)));
- _spectrumDisplayForm->show();
-
qApp->processEvents();
timespec_reset(&_lastGUIUpdateTime);
@@ -105,11 +106,14 @@
qApp->processEvents();
}
-void SpectrumGUIClass::Reset(){
- if(GetWindowOpenFlag()){
- qApp->postEvent(_spectrumDisplayForm, new
SpectrumFrequencyRangeEvent(_centerFrequency,
-
_startFrequency,
-
_stopFrequency));
+void
+SpectrumGUIClass::Reset()
+{
+ if(GetWindowOpenFlag()) {
+ qApp->postEvent(_spectrumDisplayForm,
+ new SpectrumFrequencyRangeEvent(_centerFrequency,
+ _startFrequency,
+ _stopFrequency));
qApp->postEvent(_spectrumDisplayForm, new SpectrumWindowResetEvent());
}
_droppedEntriesCount = 0;
@@ -117,16 +121,20 @@
// ResetPendingGUIUpdateEvents();
}
-void SpectrumGUIClass::SetDisplayTitle(const std::string newString){
+void
+SpectrumGUIClass::SetDisplayTitle(const std::string newString)
+{
_title.assign(newString);
if(GetWindowOpenFlag()){
- qApp->postEvent(_spectrumDisplayForm, new
SpectrumWindowCaptionEvent(_title.c_str()));
+ qApp->postEvent(_spectrumDisplayForm,
+ new SpectrumWindowCaptionEvent(_title.c_str()));
}
-
}
-bool SpectrumGUIClass::GetWindowOpenFlag(){
+bool
+SpectrumGUIClass::GetWindowOpenFlag()
+{
bool returnFlag = false;
//_windowStateLock->Lock();
returnFlag = _windowOpennedFlag;
@@ -135,13 +143,19 @@
}
-void SpectrumGUIClass::SetWindowOpenFlag(const bool newFlag){
+void
+SpectrumGUIClass::SetWindowOpenFlag(const bool newFlag)
+{
//_windowStateLock->Lock();
_windowOpennedFlag = newFlag;
//_windowStateLock->Unlock();
}
-void SpectrumGUIClass::SetFrequencyRange(const double centerFreq, const double
startFreq, const double stopFreq){
+void
+SpectrumGUIClass::SetFrequencyRange(const double centerFreq,
+ const double startFreq,
+ const double stopFreq)
+{
//_windowStateLock->Lock();
_centerFrequency = centerFreq;
_startFrequency = startFreq;
@@ -149,7 +163,9 @@
//_windowStateLock->Unlock();
}
-double SpectrumGUIClass::GetStartFrequency()const{
+double
+SpectrumGUIClass::GetStartFrequency() const
+{
double returnValue = 0.0;
//_windowStateLock->Lock();
returnValue = _startFrequency;
@@ -157,7 +173,9 @@
return returnValue;
}
-double SpectrumGUIClass::GetStopFrequency()const{
+double
+SpectrumGUIClass::GetStopFrequency() const
+{
double returnValue = 0.0;
//_windowStateLock->Lock();
returnValue = _stopFrequency;
@@ -165,7 +183,9 @@
return returnValue;
}
-double SpectrumGUIClass::GetCenterFrequency()const{
+double
+SpectrumGUIClass::GetCenterFrequency() const
+{
double returnValue = 0.0;
//_windowStateLock->Lock();
returnValue = _centerFrequency;
@@ -174,8 +194,18 @@
}
-void SpectrumGUIClass::UpdateWindow(const bool updateDisplayFlag, const
std::complex<float>* fftBuffer, const uint64_t inputBufferSize, const float*
realTimeDomainData, const uint64_t realTimeDomainDataSize, const float*
complexTimeDomainData, const uint64_t complexTimeDomainDataSize, const double
timePerFFT, const timespec timestamp, const bool lastOfMultipleFFTUpdateFlag){
-
+void
+SpectrumGUIClass::UpdateWindow(const bool updateDisplayFlag,
+ const std::complex<float>* fftBuffer,
+ const uint64_t inputBufferSize,
+ const float* realTimeDomainData,
+ const uint64_t realTimeDomainDataSize,
+ const float* complexTimeDomainData,
+ const uint64_t complexTimeDomainDataSize,
+ const double timePerFFT,
+ const timespec timestamp,
+ const bool lastOfMultipleFFTUpdateFlag)
+{
int64_t bufferSize = inputBufferSize;
bool repeatDataFlag = false;
if(bufferSize > _dataPoints){
@@ -229,25 +259,36 @@
const timespec currentTime = get_highres_clock();
const timespec lastUpdateGUITime = GetLastGUIUpdateTime();
- if((diff_timespec(currentTime, lastUpdateGUITime) > (4*timePerFFT)) &&
(GetPendingGUIUpdateEvents() > 0) && !timespec_empty(&lastUpdateGUITime)){
+ if((diff_timespec(currentTime, lastUpdateGUITime) > (4*timePerFFT)) &&
+ (GetPendingGUIUpdateEvents() > 0) && !timespec_empty(&lastUpdateGUITime))
{
// Do not update the display if too much data is pending to be displayed
_droppedEntriesCount++;
}
else{
// Draw the Data
IncrementPendingGUIUpdateEvents();
- qApp->postEvent(_spectrumDisplayForm, new SpectrumUpdateEvent(_fftPoints,
bufferSize, _realTimeDomainPoints, _imagTimeDomainPoints, timeDomainBufferSize,
timePerFFT, timestamp, repeatDataFlag, lastOfMultipleFFTUpdateFlag,
currentTime, _droppedEntriesCount));
+ qApp->postEvent(_spectrumDisplayForm,
+ new SpectrumUpdateEvent(_fftPoints, bufferSize,
+ _realTimeDomainPoints,
+ _imagTimeDomainPoints,
+ timeDomainBufferSize,
+ timePerFFT, timestamp,
+ repeatDataFlag,
+ lastOfMultipleFFTUpdateFlag,
+ currentTime,
+ _droppedEntriesCount));
- // Only reset the dropped entries counter if this is not repeat data since
repeat data is dropped by the display systems
+ // Only reset the dropped entries counter if this is not
+ // repeat data since repeat data is dropped by the display systems
if(!repeatDataFlag){
_droppedEntriesCount = 0;
}
-
- //qApp->wakeUpGuiThread();
}
}
-float SpectrumGUIClass::GetPowerValue()const{
+float
+SpectrumGUIClass::GetPowerValue() const
+{
float returnValue = 0;
//_windowStateLock->Lock();
returnValue = _powerValue;
@@ -255,13 +296,17 @@
return returnValue;
}
-void SpectrumGUIClass::SetPowerValue(const float value){
+void
+SpectrumGUIClass::SetPowerValue(const float value)
+{
//_windowStateLock->Lock();
_powerValue = value;
//_windowStateLock->Unlock();
}
-int SpectrumGUIClass::GetWindowType()const{
+int
+SpectrumGUIClass::GetWindowType() const
+{
int returnValue = 0;
//_windowStateLock->Lock();
returnValue = _windowType;
@@ -269,13 +314,17 @@
return returnValue;
}
-void SpectrumGUIClass::SetWindowType(const int newType){
+void
+SpectrumGUIClass::SetWindowType(const int newType)
+{
//_windowStateLock->Lock();
_windowType = newType;
//_windowStateLock->Unlock();
}
-int SpectrumGUIClass::GetFFTSize()const{
+int
+SpectrumGUIClass::GetFFTSize() const
+{
int returnValue = 0;
//_windowStateLock->Lock();
returnValue = _fftSize;
@@ -283,7 +332,9 @@
return returnValue;
}
-int SpectrumGUIClass::GetFFTSizeIndex()const{
+int
+SpectrumGUIClass::GetFFTSizeIndex() const
+{
int fftsize = GetFFTSize();
switch(fftsize) {
case(1024): return 0; break;
@@ -296,13 +347,17 @@
}
}
-void SpectrumGUIClass::SetFFTSize(const int newSize){
+void
+SpectrumGUIClass::SetFFTSize(const int newSize)
+{
//_windowStateLock->Lock();
_fftSize = newSize;
//_windowStateLock->Unlock();
}
-timespec SpectrumGUIClass::GetLastGUIUpdateTime()const{
+timespec
+SpectrumGUIClass::GetLastGUIUpdateTime() const
+{
timespec returnValue;
//_windowStateLock->Lock();
returnValue = _lastGUIUpdateTime;
@@ -310,13 +365,17 @@
return returnValue;
}
-void SpectrumGUIClass::SetLastGUIUpdateTime(const timespec newTime){
+void
+SpectrumGUIClass::SetLastGUIUpdateTime(const timespec newTime)
+{
//_windowStateLock->Lock();
_lastGUIUpdateTime = newTime;
//_windowStateLock->Unlock();
}
-unsigned int SpectrumGUIClass::GetPendingGUIUpdateEvents()const{
+unsigned int
+SpectrumGUIClass::GetPendingGUIUpdateEvents() const
+{
unsigned int returnValue = 0;
//_windowStateLock->Lock();
returnValue = _pendingGUIUpdateEventsCount;
@@ -324,13 +383,17 @@
return returnValue;
}
-void SpectrumGUIClass::IncrementPendingGUIUpdateEvents(){
+void
+SpectrumGUIClass::IncrementPendingGUIUpdateEvents()
+{
//_windowStateLock->Lock();
_pendingGUIUpdateEventsCount++;
//_windowStateLock->Unlock();
}
-void SpectrumGUIClass::DecrementPendingGUIUpdateEvents(){
+void
+SpectrumGUIClass::DecrementPendingGUIUpdateEvents()
+{
//_windowStateLock->Lock();
if(_pendingGUIUpdateEventsCount > 0){
_pendingGUIUpdateEventsCount--;
@@ -338,17 +401,19 @@
//_windowStateLock->Unlock();
}
-void SpectrumGUIClass::ResetPendingGUIUpdateEvents(){
+void
+SpectrumGUIClass::ResetPendingGUIUpdateEvents()
+{
//_windowStateLock->Lock();
_pendingGUIUpdateEventsCount = 0;
//_windowStateLock->Unlock();
}
-SpectrumDisplayForm*
-SpectrumGUIClass::get_qdialog()
+QWidget*
+SpectrumGUIClass::qwidget()
{
- return _spectrumDisplayForm;
+ return (QWidget*)_spectrumDisplayForm;
}
Modified:
gnuradio/branches/developers/trondeau/qtdevel2/gr-qtgui/src/lib/SpectrumGUIClass.h
===================================================================
---
gnuradio/branches/developers/trondeau/qtdevel2/gr-qtgui/src/lib/SpectrumGUIClass.h
2009-04-07 19:53:17 UTC (rev 10789)
+++
gnuradio/branches/developers/trondeau/qtdevel2/gr-qtgui/src/lib/SpectrumGUIClass.h
2009-04-09 00:46:30 UTC (rev 10790)
@@ -65,7 +65,7 @@
static const long MAX_FFT_SIZE = /*1048576*/32768;
static const long MIN_FFT_SIZE = 1024;
- SpectrumDisplayForm* get_qdialog();
+ QWidget* qwidget();
protected:
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Commit-gnuradio] r10790 - gnuradio/branches/developers/trondeau/qtdevel2/gr-qtgui/src/lib,
trondeau <=