#ifndef QUICKLOOK_H #define QUICKLOOK_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "echogram.h" #include "ascope.h" #include "dataProcessing.h" #include "refPulse.h" #include "loadRef.h" #include "channelMasks.h" class QuickLook: public QMainWindow { Q_OBJECT public: QuickLook( int rNum, int cNum, ChannelMasks* chMasks, QWidget * = NULL, QWidget* = NULL ); // Default constructor. ~QuickLook(); // Default destructor. void loadClasses( bool rec, ProcParams* pp ); // Performs the creation of the DataProcessing and MatrixData classes, which take a few seconds. void setOffset( double offset ); // Set the time offset value. public slots: void createEcho(); // Create a new Echogram window. void createAScope(); // Create a new A-Scope window. void createRefPulse(); // Create a new Reference Pulse window. void deleteEWindow( QObject* window ); // Delete a specific Echogram window. void deleteAWindow( QObject* window ); // Delete a specific A-Scope window. void deleteRWindow( QObject* window ); // Delete a specific Reference Pulse window. void updateWinOptions( PlotOptions* p ); // Copy the currently selected parameters to the window whose 'Update' button was clicked. void timerEvent(); // Executed whenever the timer is emitted. void refreshWindows(); // Function to refresh every Echogram and A-Scope window that is open. void enableButtons(); // Enable the Echogram and Plot buttons when 1 trace of data has arrived. void disableChannel( int c ); // Disable a channel from the main window as it's not receiving data. void setStatus( QString utc, uint32_t pps, uint32_t epri ); // Send the data back to the control panel by emitting a signal. void closeQL(); // Close Quick-Look because of an error. void writeToLog( QString t, int type ); // Function that will emit writeMsg to pass along a string to a log. void setRecDirectory(); // Set the directory for the data recording files to be written to. void startRecording(); // Beging recording Quick-Look data. void stopRecording(); // Stop recording Quick-Look data. void changeTOffset(); // Change the value of the time offset. void changeAOffset(); // Change the value of the air meter offset. void setNewTau( double t ); // Set the new tau value. void refWavesSelect(); // Open the reference waveforms window. void setWaveChange(); // Tell ProcessingData object that the reference waveforms have changed. signals: void quickLookClosed(); void updateStatus( QString utc, uint32_t pps, uint32_t epri ); // Signal to the control panel for the status information. void updateRefresh( QString refresh ); // Signal to the control panel for the refresh time. void writeMsg( QString text, int type ); // Signal to write message to log. void updateLED( QColor color, int type ); protected: void closeEvent( QCloseEvent* event ); private: void readDataIn(); //Function to read in data from a file (for now). void updateData(); //Function to read data from the UAV over the socket and store it in the data container. void createButtons(); //Create the buttons that spawn new Echogram or A-Scope windows. void createMenu(); //Create the menu for the Q-Look window. void createChannelBox(); //Create the checkboxes for the UAV channel selection. bool checkChannelVals(); //Return whether at least one channel is checked true. void resetChannelVals(); //Reset the values for every channel. Default: Channel 1 is checked, others are not. void createAScopeOptions(); //Create the options box for the Plot window. void createEchoOptions(); // Create the options box for the Echogram window. void createGenOptions(); // Create the general options box for Plot and Echogram windows. PlotOptions* createPlotOptionsStruct(); // Create a new PlotOptions struct. void copyPlotOptions( PlotOptions* p ); // Copy the window options into the PlotOptions struct provided. double convertAir( double tVal ); // Convert time value to air meters. double convertIce( double tVal ); // Convert time value to ice meters. double convertTime( double aVal ); // Convert air meters to time. enum { numButtons = 3, numAOpRadios = 2, numEColorMap = 3, dataTypes = 3, dataScales = 2 }; ChannelMasks* cMasks; // Pointer to the channel masks. LoadRefPulse* refPulse; // Pointer ro the reference pulse load/set window. MatrixData* uavData; // Data container for every channel from the UAV. DataProcessing* processData; std::vector< Echogram* > echoWidgets; // Stores a list of every Echogram window created. std::vector< AScope* > aScopeWidgets; // Stores a list of every A-Scope window created. std::vector< RefPulse* > refPulseWidgets; // Stores a list of every Reference Pulse window created. QWidget* parCP; // Pointer to the control panel window. QWidget* par; // Pointer to the parent object, RadarActions. QPushButton* buttons[ numButtons ]; // New window buttons. QPushButton* recButtons[ numButtons ]; // Data recording buttons. QPushButton* refWaves; // Reference waveforms button. QCheckBox** channels; QRadioButton* radios[ numAOpRadios ]; QRadioButton* depthScale[ dataTypes ]; QRadioButton* dataType[ dataTypes ]; QRadioButton* dataScale[ dataScales ]; QLabel* eColorMapLabels[ numEColorMap ]; QLineEdit* eColorMapLines[ numEColorMap ]; QLabel* timeOffsetLabel; QLabel* airOffsetLabel; QLineEdit* timeOffsetLine; QLineEdit* airOffsetLine; QGroupBox* buttonBox; QGroupBox* channelBox; QGroupBox* aOptionsBox; QGroupBox* eOptionsBox; QGroupBox* gOffsetBox; QGroupBox* gOptionsBox; QGroupBox* gDepthBox; QGroupBox* gDTypeBox; QGroupBox* gDScaleBox; QMenuBar* menuBar; QMenu* fileMenu; QAction* exitAction; QString recPath; // Path to the directory for the data recording files. time_t time1; time_t time2; QTimer* timer; int cNumber; int rNumber; double tOffset; // The time offset value. double aOffset; // The air meter offset value. double iOffset; // The ice meter offset value. bool* channelVals; // Stores a value corresponding to whether a channel's check box is checked. bool checked; // Flag to check if any channels are checked. }; #endif // QUICKLOOK_H