#ifndef RADARACTIONS_H #define RADARACTIONS_H #include #include #include #include #include #include #include #include #include #include #include "constants.h" #include "activityLog.h" #include "channelFeedback.h" #include "radarStatus.h" #include "radarParams.h" #include "runCmd.h" #include "hddWindow.h" #include "quickLook.h" #include "channelMasks.h" #include "loadRef.h" class RadarActions : public QWidget { Q_OBJECT public: RadarActions( QWidget* parent, int r, int c ); // Default constructor. ~RadarActions(); // Default destructor. QGroupBox* getGroupBox( QString title ); // Returns the QGroupBox containing the module. void themeSound( bool toggle ); // Change the theme sound. public slots: void startQLook(); // Create a new instance of Quick Look. void closeQLook(); // Close the open instance of Quick Look. void showChannelMasks(); // Set the channel masks. void mountHDD(); // Run the commands to try mounting the HDDs on each slice. void mountHDDFin(); // Finish the mounting process. void unmountHDD(); // Run the commands to try umounting the HDDs on each slice. void unmountHDDFin(); // Finish the unmounting process. void radarParams(); // Create a new instance of the radar parameter window. void startHDDRec0(); // Start recording on /d0. void startHDDRec1(); // Start recording on /d1. void stopHDDRec(); // Stop recording on HDDs. void startRadar(); // Start the radar on the control slice. void startRadarFin(); // Run after the radar on the control slice has been started. void stopRadar(); // Stop the radar on the control slice. void stopRadarFin(); // Finish the stopping process. void rebootRadar(); // Reboot void rebootRadarFin(); // Finish the rebooting processes. void pingChannels(); // Used to ping the channels to determine when they finish rebooting. void shutdownRadar(); // Shutdown void shutdownRadarFin(); // Finish the shutdown processes. void shutdownDialog(); // Shtudown dialog ensuring you want to shutdown the whole radar. void loadDAQSlices(); // Run the radar program on each of the DAQ slices. void loadDAQSlicesFin(); // Finish the loading process. void startServers(); // Start the server programs on each slice. void startServersFin(); // Finish the servers process. void showHDDStats(); // Show the HDD Status window. void showRunCmd(); // Show the Run Command window. void offsetChanged( double offset ); // Change the Quick-Look axes offset, if Quick-Look open. void setTau( double tau ); // Change the tau value that Quick-Look uses for pulse-compressed axes, if Quick-Look is open. void exitGUI(); // Close the program. void readLinesProc(); // Read in available lines from the QProcess proc. void writeLog( QString t, int type ); // Function to take in text and type and emit writeMsg(). void dispDataRate( QString msg ); // Emit a signal to the control panel to display the new estimated recording speed. void readLinesSockets(); // Read in available lines from the TCP sockets. signals: void writeMsg( QString text, int lType ); void changeFeedbackLED( QColor color, int type ); void changeStatusLED( QColor color, int type ); void recSpeed( QString t ); // Signal to send the estimated recording speed. private: enum { numButtons = 17, // Number of buttons. CONFIG = 0, // Radar Configuration. DAQ = 1, // Load DAQ Slices. SERVER = 2, // Start Servers. RADARON = 3, // Start Radar. QLOOK = 4, // Quick Look. RADAROFF = 5, // Stop Radar. MOUNT = 6, // Mount Drives. REC0 = 7, // HDD Rec On /d0. REC1 = 8, // HDD Rec on /d1. RECOFF = 9, // HDD Rec Off. REBOOT = 10, // Reboot Radar. SHUTDOWN = 11, // Shutdown Radar. MASKS = 12, // Set Channel Masks. UNMOUNT = 13, // Unmount Drives HDDSTATS = 14, // HDD Status RUNCMD = 15, // Run Command DONE = 16 }; enum { numLEDs = 3, RADAR = 0, REC = 1, Q = 2 }; enum{ numStatus = 4, numStatusLEDs = 3, PPS = 0, EPRI = 1, REFRESH = 2 }; void enableButtons(); // Function looks at the set state for each button and enables/disables depending on state. void disableButtons(); // Function disables every button. void sendCharServer( const char* letter ); // Function sends a specific character to the server programs on each slice. QString timeStamp(); // Returns a formatted timestamp. QGroupBox* raBox; // Group box for the buttons. QPushButton* buttons[ numButtons ]; // The buttons in the layout. QVBoxLayout* layout; // Main layout for the module. QProcess* proc; // Pointer to the process to run single remote commands. QProcess* procReboot; // Pointer to the process used to check if the control slice has finished rebooting. QProcess** procMount; // Pointers to the processes to mount the HDDs on each slice. QProcess** procSendChar; // Pointer to the processes that will send characters to the server programs on each slice. QProcess** procCmd; // Pointer to general processes used for different commands. QTcpSocket** tcpClient; // Pointers to the TCP Sockets to connect to the slices. QSplashScreen* splashQLook; // Pointer to the splash screen object when starting QLook. QPixmap splashQLookPic; // QPixmap which contains the picture for the QLook splash screen. QWidget* parentCP; // Pointer to the control panel parent window. QTime* hddStatusTimes; // Pointer to timers for each channel to determine actual write speed. QuickLook* quickLook; // Pointer to a Quick Look window. ChannelMasks* chanMaskWindow; // Pointer to the Channel Masks window. RadarParams* radarParamWindow; // Pointer to the Radar Parameter Window. RunCmd* runCmd; // Pointer to the Run Commands window. HDDWindow* hddWin; // Pointer to the HDD Status window. bool buttonState[ numButtons ]; // Boolean states for each button. Enabled = true, Disabled = false. bool d0Mounted; // Is /d0 mounted? bool d1Mounted; // Is /d1 mounted? bool radarStarted; // Has the ./radar program been run on the control slice? bool recQLook; // Has recording been turned of for the Quick Look data? bool digitalChassisOn; // Are the slices in the digital chassis currently running or have they been shutdown? bool recHDD; // Has recording been turned on for the hard drives on the slices? bool* procMountFinished; // General bool when the mount processes are finished. bool* procCmdFinished; // General bool when the general processes are finished. bool procFinished; // General bool when the control process is finished. bool procRebootFinished; // Bool to show when the reboot check process has finished. bool runRadarOnce; // Bool to show if the radar has been run once, and needs to be run again. int rNumber; // Radar number. int cNumber; // Number of channels. }; #endif // RADARACTIONS_H