#ifndef RADARPARAMS_H #define RADARPARAMS_H #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "constants.h" #include "waveformParams.h" class RadarParams : public QMainWindow { Q_OBJECT public: RadarParams( QWidget* parentCP, QWidget* parent ); // Default constructor. ~RadarParams(); // Default destructor. void offsetChange(); // The DAQ Record Delay or the Trigger Delay changed, changing the offset value. public slots: void initialFileLoad(); // Read in the default config file, if available. void readInFile(); // Read in a file. void writeToFile(); // Write to a file. void writeToLog( QString text, int type ); // Emit signal to write to a log file. void valuesChanged( int table ); // Perform actions when values in a table are changed. WaveformParams* addTab(); // Add a new tab to the QTabWidget. void deleteTab(); // Delete the currently selected tab from the QTabWidget. ProcParams* getProcessingValues(); // Return a struct with the values needed for Quick Look data processing. void emitSignals(); // Emit some signals for values that are changed in a bunch, like when reading in a new config file. void closeWindow(); // Close the window. // Slots when values in fields are changed. void sampFreqChange(); // The sample frequency was changed. void displayDataRate(); // Display the data rate in the window's status bar. void hiChanChange(); // The High Integration channel waveform was changed. void wfFreqChange(); // The start or stop frequency in the waveform was changed. void trigDivChange(); // The trigger divisor was changed. signals: void writeMsg( QString text, int type ); // Signal to write a message to a log. void recSpeed( QString t ); // Signal to send the estimated recording speed. void sFrequencyChanged( double freq ); // Signal to send the new sample frequency. void offsetValChanged( double offset ); // Signal to send the new offset value. void tauChanged( double tau ); // Signal to send the new tau value. protected: void closeEvent( QCloseEvent* event ); // The event on close. private: enum { genFields = 16, ddsFields = 8, comboFields = 4, waveShapeFields = 8 }; enum { SAMPF = 0, // Sample Frequency DDSF = 1, // DDS Frequency PRFSRC = 2, // PRF Source PRFD = 3, // PRF Desired DDSTD = 4, // DDS Trigger Delay BASEP = 5, // Base Pulse Length ADCB = 6, // ADC Bypass DDSMS = 7, // DDS Multisync HIENABLE = 8, // High Integration Enable HIRATE = 9, // High Integration Rate HIWF = 10, // High Integration Waveform Number HIPCNT = 11, // High Integration Presum Count HIRCNT = 12, // High Integration Readout Count TRIGDIV = 13, // Trigger Divisor TRIGCNT = 14, // Trigger Count TRIGINV = 15 // Trigger Inversion }; enum { COMBOTINV = 0, COMBOPRFSRC = 1, COMBOHIENABLE = 2, COMBOADC = 3 }; void parseFile( QString path ); // Parse the input from a file. void generateOutput( QString path ); // Generate the output to a file. void generateBinOutput( QString path ); // Generate the output to a binary file. double findDataRate(); // Find the estimated recording speed on the hard drives based on the configuration parameters. double megaToHertz( double mhz ); // Convert megahertz to hertz. double hertzToMega( double hz ); // Convert hertz to megahertz. double secToMicro( double sec ); // Convert seconds to microseconds. double microToSec( double micro ); // Convert microseconds to seconds. QPushButton* createWF; // Create waveform button. QPushButton* deleteWF; // Delete waveform button. QPushButton* loadFile; // Load configuration button. QPushButton* saveFile; // Save configuration button. QPushButton* done; // Finished with changing the configuration parameters. QTabWidget* tabWidgetWave; // Tabs to contain the parameters for each waveform. QTabWidget* tabWidgetGen; // Tabs to contain the general parameters. QLabel* genFieldLabels[ genFields ]; // Labels for genFieldLines. QLineEdit* genFieldLines[ genFields ]; // General radar fields. QComboBox* genFieldCombo[ comboFields ]; // General radar field comboboxes. QLabel* ddsFieldLabels[ ddsFields ]; // Labels for ddsFieldLines. QLineEdit* ddsFieldLines[ ddsFields ]; // General DDS fields. QLabel* waveShapeFieldLabels[ waveShapeFields ]; // Labels for the addLossDDS Waveshaping fields. QLineEdit* waveShapeFieldLines[ waveShapeFields ]; // Waveshape fields. QLabel* waveShapeTypeLabel; // Label for the waveshaping type combo box. QComboBox* waveShapeTypeCombo; // Combo box for the type of waveshaping. int numWaveforms; // The number of waveforms. // Variables that will be used by quick look for processing. double f0; double f1; double tau; double chirpRate; }; #endif // RADARPARAMS_H