FSUDAQ_Qt6/FSUDAQ.h

155 lines
3.0 KiB
C
Raw Normal View History

2023-04-11 11:13:23 -04:00
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
2023-04-14 16:12:52 -04:00
#include <QWidget>
#include <QPushButton>
#include <QPlainTextEdit>
#include <QLineEdit>
2023-04-17 15:17:25 -04:00
#include <QLabel>
2023-04-18 13:12:05 -04:00
#include <QComboBox>
#include <QCheckBox>
2023-04-17 15:17:25 -04:00
#include <QGridLayout>
2023-04-14 16:12:52 -04:00
#include "ClassDigitizer.h"
#include "CustomThreads.h"
#include "CustomWidgets.h"
2023-04-18 13:12:05 -04:00
#include "Scope.h"
2023-04-24 17:37:03 -04:00
#include "DigiSettingsPanel.h"
#include "CanvasClass.h"
2023-05-24 16:04:32 -04:00
#include "influxdb.h"
2023-04-11 11:13:23 -04:00
//^#===================================================== MainWindow
class MainWindow : public QMainWindow{
Q_OBJECT
public:
MainWindow(QWidget *parent = nullptr);
~MainWindow();
void closeEvent(QCloseEvent * event){
if( scope ) scope->close();
2023-04-24 16:37:57 -04:00
if( digiSettings ) digiSettings->close();
if( canvas ) canvas->close();
event->accept();
}
2023-04-14 16:12:52 -04:00
private slots:
2023-04-17 15:17:25 -04:00
void OpenDataPath();
2023-04-17 14:09:21 -04:00
void LoadProgramSettings();
void SaveProgramSettings();
void LoadLastRunFile();
void SaveLastRunFile();
2023-04-14 16:12:52 -04:00
void OpenDigitizers();
void CloseDigitizers();
void WaitForDigitizersOpen(bool onOff);
2023-04-14 16:12:52 -04:00
2023-04-17 15:17:25 -04:00
void SetupScalar();
void CleanUpScalar();
void OpenScalar();
void UpdateScalar();
2023-04-14 16:12:52 -04:00
void StartACQ();
void StopACQ();
2023-04-18 13:12:05 -04:00
void AutoRun();
bool CommentDialog(bool isStartRun);
void WriteRunTimestamp(bool isStartRun);
void OpenScope();
2023-04-14 16:12:52 -04:00
2023-04-24 16:37:57 -04:00
void OpenDigiSettings();
void OpenCanvas();
void UpdateAllPanels(int panelID);
void SetUpInflux();
2023-05-25 14:20:55 -04:00
void CheckElog();
void WriteElog(QString htmlText, QString subject, QString category, int runNumber);
void AppendElog(QString appendHtmlText);
2023-04-14 16:12:52 -04:00
private:
Digitizer ** digi;
unsigned int nDigi;
2023-04-17 14:09:21 -04:00
QString programSettingsFilePath;
QString rawDataPath;
QString prefix;
unsigned int runID;
2023-05-25 14:20:55 -04:00
int elogID;
2023-04-17 14:09:21 -04:00
2023-04-17 15:17:25 -04:00
QPushButton * bnOpenDigitizers;
QPushButton * bnCloseDigitizers;
QPushButton * bnOpenScope;
QPushButton * bnDigiSettings;
QPushButton * bnAnalyzer;
2023-04-17 15:17:25 -04:00
QPushButton * bnOpenScaler;
QPushButton * bnStartACQ;
QPushButton * bnStopACQ;
QPushButton * bnCanvas;
2023-05-24 16:04:32 -04:00
//@----- influx
InfluxDB * influx;
2023-05-25 14:20:55 -04:00
QString influxIP;
QString dataBaseName;
QLineEdit * leInfluxIP;
QLineEdit * leDatabaseName;
QPushButton * bnLock;
//@----- Elog
2023-05-25 14:20:55 -04:00
QString elogIP;
QString elogName;
QString elogUser;
QString elogPWD;
QLineEdit * leElogIP;
2023-05-25 14:20:55 -04:00
QLineEdit * leElogName;
2023-04-14 16:12:52 -04:00
//@----- log msg
QPlainTextEdit * logInfo;
void LogMsg(QString msg);
bool logMsgHTMLMode = true;
//@-----
QLineEdit * leDataPath;
QLineEdit * lePrefix;
QLineEdit * leComment;
2023-04-17 14:09:21 -04:00
QLineEdit * leRunID;
2023-04-14 16:12:52 -04:00
2023-04-18 13:12:05 -04:00
QCheckBox * chkSaveData;
RComboBox * cbAutoRun;
2023-04-18 13:12:05 -04:00
QString startComment;
QString stopComment;
2023-04-14 16:12:52 -04:00
//@----- Scalar
QMainWindow * scalar;
2023-04-17 15:17:25 -04:00
QGridLayout * scalarLayout;
2023-04-19 16:21:14 -04:00
TimingThread * scalarThread;
2023-04-18 13:12:05 -04:00
QLineEdit *** leTrigger; // need to delete manually
QLineEdit *** leAccept; // need to delete manually
2023-04-17 15:17:25 -04:00
QLabel * lbLastUpdateTime;
QLabel * lbScalarACQStatus;
2023-04-14 16:12:52 -04:00
//@----- ACQ
ReadDataThread ** readDataThread;
2023-04-18 13:12:05 -04:00
//@----- Scope
Scope * scope;
2023-04-24 16:37:57 -04:00
//@----- DigiSettings
2023-04-24 17:37:03 -04:00
DigiSettingsPanel * digiSettings;
2023-04-24 16:37:57 -04:00
//@----- Canvas
Canvas * canvas;
2023-05-19 16:23:04 -04:00
TimingThread * histThread;
2023-04-11 11:13:23 -04:00
};
#endif // MAINWINDOW_H