2022-10-14 18:27:31 -04:00
|
|
|
#ifndef PROGRAM_SETTING_H
|
|
|
|
#define PROGRAM_SETTING_H
|
|
|
|
|
|
|
|
#include <TQObject.h>
|
|
|
|
#include <RQ_OBJECT.h>
|
|
|
|
#include <TGNumberEntry.h>
|
|
|
|
#include <TGButton.h>
|
|
|
|
#include <TGComboBox.h>
|
|
|
|
#include <TThread.h>
|
|
|
|
#include <TGLabel.h>
|
|
|
|
#include <TGTextEdit.h>
|
|
|
|
#include "ClassDigitizer.h"
|
|
|
|
#include "macro.h"
|
|
|
|
|
|
|
|
class TGWindow;
|
|
|
|
class TGMainFrame;
|
|
|
|
|
|
|
|
class ProgramSetting{
|
|
|
|
RQ_OBJECT("ProgramSetting")
|
|
|
|
private:
|
|
|
|
TGMainFrame * fMain;
|
|
|
|
|
|
|
|
TGTextEntry * txtIP;
|
|
|
|
TGTextEntry * txtDBName;
|
2022-10-18 17:23:29 -04:00
|
|
|
TGTextEntry * txtDataPath;
|
2022-10-26 18:38:55 -04:00
|
|
|
TGTextEntry * txtExpName;
|
|
|
|
TGTextEntry * txtElogIP;
|
2022-10-14 18:27:31 -04:00
|
|
|
|
2022-10-31 16:39:19 -04:00
|
|
|
TGCheckButton * cbDatabase;
|
|
|
|
TGCheckButton * cbElog;
|
|
|
|
|
2022-11-01 18:38:01 -04:00
|
|
|
TGNumberEntry * numPort;
|
|
|
|
TGNumberEntry * numBoard;
|
|
|
|
|
2022-10-14 18:27:31 -04:00
|
|
|
public:
|
|
|
|
ProgramSetting(const TGWindow *p);
|
|
|
|
virtual ~ProgramSetting();
|
|
|
|
|
|
|
|
void CloseWindow() { delete this;}
|
|
|
|
|
2022-10-26 18:38:55 -04:00
|
|
|
static std::string databaseIP;
|
2022-10-14 18:27:31 -04:00
|
|
|
static std::string databaseName;
|
2022-10-18 17:23:29 -04:00
|
|
|
static std::string DataSavingPath;
|
2022-10-26 18:38:55 -04:00
|
|
|
static std::string ExpName;
|
|
|
|
static std::string ElogIP;
|
2022-10-14 18:27:31 -04:00
|
|
|
|
2022-10-31 16:39:19 -04:00
|
|
|
static bool EnableElog;
|
|
|
|
static bool EnableDatabase;
|
|
|
|
|
2022-11-01 18:38:01 -04:00
|
|
|
static unsigned short maxPort;
|
|
|
|
static unsigned short maxBoardPrePort;
|
|
|
|
|
2022-10-26 18:38:55 -04:00
|
|
|
const static std::string settingFileName; // fixed as FSUDAQ.sh
|
2022-10-31 21:26:10 -04:00
|
|
|
const static std::string programPath;
|
2022-10-26 18:38:55 -04:00
|
|
|
|
|
|
|
void SetSetting(); // *SIGNAL*
|
2022-11-02 15:43:23 -04:00
|
|
|
void LogMsg(TString msg); // *SIGNAL*
|
2022-10-26 18:38:55 -04:00
|
|
|
|
|
|
|
static void PrintSettings();
|
|
|
|
static void LoadProgramSetting();
|
2022-11-02 15:43:23 -04:00
|
|
|
static int SaveProgramSetting(); /// return 1 for OK. return 0 for not OK
|
2022-10-26 18:38:55 -04:00
|
|
|
|
2022-10-31 15:00:04 -04:00
|
|
|
void SetFolder();
|
2022-10-31 16:39:19 -04:00
|
|
|
|
|
|
|
void SetDataBaseElogOnOff();
|
2022-11-01 18:38:01 -04:00
|
|
|
|
|
|
|
void SetSearchRange();
|
2022-10-31 15:00:04 -04:00
|
|
|
|
2022-10-14 18:27:31 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|