00001 /* 00002 * TestrigGUI.h 00003 * 00004 * Created on: Feb 18, 2010 00005 * Author: uscr 00006 */ 00007 00008 #ifndef TESTRIGGUI_H_ 00009 #define TESTRIGGUI_H_ 00010 00011 #include <QtGui/QMainWindow> 00012 #include <QtGui/QImage> 00013 #include <opencv/cv.h> 00014 #include <qwt_plot_curve.h> 00015 00016 #include <fftw3.h> 00017 00018 #include "ui_testrig.h" 00019 #include "DataThreads.h" 00020 #include "KalmanFilter.h" 00021 00022 00023 class TestrigGUI : public QMainWindow { 00024 00025 Q_OBJECT 00026 00027 public: 00028 TestrigGUI(); 00029 virtual ~TestrigGUI(); 00030 void emitReadyToUpdateGUI(); 00031 double getStandardDeviation(double * vals); 00032 double getMean(double * vals); 00033 00034 signals: 00035 void readyToUpdateGUI(); 00036 00037 public slots: 00038 void updateGUIDisplay(); 00039 void updateControls(); 00040 void updatePitchFilter(); 00041 void updateRollFilter(); 00042 00043 private: 00044 Ui::testrig ui; 00045 QImage curQImage; 00046 char * inputImageDataPtr; //READ ONLY and unstable 00047 IplImage * curIplImage; 00048 int frameCounter; 00049 struct CollectedData myGuiData, myGuiPlotData; 00050 struct KalmanFilterData guiRollFilter, guiPitchFilter; 00051 QwtPlotCurve * rollGyroCurve, * pitchGyroCurve, * rollAccelCurve, * pitchAccelCurve, * rollFilterCurve, * pitchFilterCurve; 00052 QwtPlotCurve * fftCurve; 00053 fftw_complex *fft_in, *fft_out; 00054 fftw_plan plan_forward; 00055 00056 double incrementalTime[NUM_POINTS]; 00057 00058 }; 00059 00060 #endif /* TESTRIGGUI_H_ */