hide the token from GUI

This commit is contained in:
Ryan Tang 2024-03-01 20:22:51 -05:00
parent 7eb02891a5
commit b3ab5da207
3 changed files with 48 additions and 17 deletions

View File

@ -123,15 +123,6 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent){
leDatabaseName->setReadOnly(true);
layout->addWidget(leDatabaseName, rowID, 4);
rowID ++;
QLabel * lbToken = new QLabel("Influx Token : ", this);
lbToken->setAlignment(Qt::AlignRight | Qt::AlignCenter);
layout->addWidget(lbToken, rowID, 1);
leInfluxToken = new QLineEdit(this);
leInfluxToken->setReadOnly(true);
layout->addWidget(leInfluxToken, rowID, 2, 1, 3);
rowID ++;
QLabel * lbElogIP = new QLabel("Elog IP : ", this);
lbElogIP->setAlignment(Qt::AlignRight | Qt::AlignCenter);
@ -460,7 +451,6 @@ void MainWindow::LoadProgramSettings(){
leDataPath->setText(rawDataPath);
leInfluxIP->setText(influxIP);
leDatabaseName->setText(dataBaseName);
leInfluxToken->setText(influxToken);
leElogIP->setText(elogIP);
leElogName->setText(elogName);
@ -1397,19 +1387,16 @@ void MainWindow::SetAndLockInfluxElog(){
leInfluxIP->setReadOnly(false);
leDatabaseName->setReadOnly(false);
leInfluxToken->setReadOnly(false);
leElogIP->setReadOnly(false);
leElogName->setReadOnly(false);
leInfluxIP->setEnabled(true);
leDatabaseName->setEnabled(true);
leInfluxToken->setEnabled(true);
leElogIP->setEnabled(true);
leElogName->setEnabled(true);
leInfluxIP->setStyleSheet("color : blue;");
leDatabaseName->setStyleSheet("color : blue;");
leInfluxToken->setStyleSheet("color : blue;");
leElogIP->setStyleSheet("color : blue;");
leElogName->setStyleSheet("color : blue;");
@ -1418,22 +1405,48 @@ void MainWindow::SetAndLockInfluxElog(){
leInfluxIP->setReadOnly(true);
leDatabaseName->setReadOnly(true);
leInfluxToken->setReadOnly(true);
leElogIP->setReadOnly(true);
leElogName->setReadOnly(true);
leInfluxIP->setStyleSheet("");
leDatabaseName->setStyleSheet("");
leInfluxToken->setStyleSheet("");
leElogIP->setStyleSheet("");
leElogName->setStyleSheet("");
influxIP = leInfluxIP->text();
dataBaseName = leDatabaseName->text();
influxToken = leInfluxToken->text();
elogIP = leElogIP->text();
elogName = leElogName->text();
if( !influxIP.isEmpty() && !dataBaseName.isEmpty() ){
QDialog dialog;
dialog.setWindowTitle("Database Token");
QVBoxLayout layout(&dialog);
QLineEdit tokenLineEdit;
tokenLineEdit.setFixedSize(1000, 20);
tokenLineEdit.setText(influxToken);
layout.addWidget(new QLabel("Only for version 2+, version 1+ can be skipped."));
layout.addWidget(&tokenLineEdit);
// Buttons for OK and Cancel
QDialogButtonBox buttonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
layout.addWidget(&buttonBox);
QObject::connect(&buttonBox, &QDialogButtonBox::accepted, &dialog, &QDialog::accept);
QObject::connect(&buttonBox, &QDialogButtonBox::rejected, &dialog, &QDialog::reject);
dialog.resize(400, dialog.sizeHint().height()); // Set the width to 400 pixels
// Show the dialog and get the result
if (dialog.exec() == QDialog::Accepted) {
influxToken = tokenLineEdit.text();
}
}
if( !elogIP.isEmpty() && !elogName.isEmpty() ){
QDialog dialog;
dialog.setWindowTitle("ELog Login info.");

View File

@ -131,7 +131,6 @@ private:
QString influxIP;
QString dataBaseName;
QLineEdit * leInfluxToken;
QLineEdit * leInfluxIP;
QLineEdit * leDatabaseName;
QPushButton * bnLock;

View File

@ -41,8 +41,27 @@ When programSettings.txt is presented in the same folder as the FSUDAQ_Qt, the p
- (line 8) elog user password
If no programSettings.txt is found. The program can still search for all digitizers that connected using optical cable.
Missing the raw data path will disable save data run, but still can start the ACQ. Missing InfluxDB (elog) variables will disable influxDB (elog).
## Keyboard control
- F4 open any drop-down list
- tab for next element
- crtl+tab for previous element
- space for "press a button"
- alt + tab for switching different windows
- up/down arrow for increase/decrease number (<span style="color:blue">Blue Tex</span> = value not set, <span style="color:red">Red Tex</span> = value cannot set)
## Data folder
User must setup the data path for data take. Without the data path, user still can run the DAQ. Inside the data path, when a run is started there are
- RunTimestamp.dat <- this store the timestamps and comments for all runs
- RunTimestamp.csv <- csv format for the RunTimestamp.dat, easy for inport to excel
- lastRun.sh <- some data for bash script
- *.fsu <- all data file
- *.bin <- setting file
# ToDo