Compare commits
3 Commits
4a5fd7a769
...
880afdab8b
Author | SHA1 | Date | |
---|---|---|---|
|
880afdab8b | ||
|
9090acbaf6 | ||
|
de52dc6c98 |
3
.vscode/c_cpp_properties.json
vendored
3
.vscode/c_cpp_properties.json
vendored
|
@ -4,7 +4,8 @@
|
||||||
"name": "Linux",
|
"name": "Linux",
|
||||||
"includePath": [
|
"includePath": [
|
||||||
"${workspaceFolder}/**",
|
"${workspaceFolder}/**",
|
||||||
"/usr/include/x86_64-linux-gnu/qt6/**"
|
"/usr/include/x86_64-linux-gnu/qt6/**",
|
||||||
|
"/opt/root/**"
|
||||||
],
|
],
|
||||||
"defines": [],
|
"defines": [],
|
||||||
"compilerPath": "/usr/bin/gcc",
|
"compilerPath": "/usr/bin/gcc",
|
||||||
|
|
|
@ -10,8 +10,19 @@
|
||||||
//#include "TClonesArray.h" // plan to save trace as TVector with TClonesArray
|
//#include "TClonesArray.h" // plan to save trace as TVector with TClonesArray
|
||||||
//#include "TVector.h"
|
//#include "TVector.h"
|
||||||
|
|
||||||
|
#include <sys/time.h> /** struct timeval, select() */
|
||||||
|
|
||||||
|
inline unsigned int getTime_us(){
|
||||||
|
unsigned int time_us;
|
||||||
|
struct timeval t1;
|
||||||
|
struct timezone tz;
|
||||||
|
gettimeofday(&t1, &tz);
|
||||||
|
time_us = (t1.tv_sec) * 1000 * 1000 + t1.tv_usec;
|
||||||
|
return time_us;
|
||||||
|
}
|
||||||
|
|
||||||
#define MAX_MULTI 64
|
#define MAX_MULTI 64
|
||||||
#define MAX_TRACE_LEN 2500
|
#define MAX_TRACE_LEN 1250 /// = 10 us
|
||||||
|
|
||||||
#define tick2ns 8 // 1 tick = 8 ns
|
#define tick2ns 8 // 1 tick = 8 ns
|
||||||
|
|
||||||
|
@ -109,9 +120,7 @@ int main(int argc, char ** argv){
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// for( int i = 0; i < argc; i++){
|
unsigned int runStartTime = getTime_us();
|
||||||
// printf("%d | %s\n", i, argv[i]);
|
|
||||||
// }
|
|
||||||
|
|
||||||
TString outFileName = argv[1];
|
TString outFileName = argv[1];
|
||||||
int timeWindow = abs(atoi(argv[2]));
|
int timeWindow = abs(atoi(argv[2]));
|
||||||
|
@ -219,21 +228,22 @@ int main(int argc, char ** argv){
|
||||||
|
|
||||||
TTree * tree = new TTree("tree", outFileName);
|
TTree * tree = new TTree("tree", outFileName);
|
||||||
|
|
||||||
tree->Branch("evID", &evID, "event_ID/l");
|
tree->Branch("evID", &evID, "evID/l");
|
||||||
tree->Branch("multi", &multi, "multi/i");
|
tree->Branch("multi", &multi, "multi/i");
|
||||||
tree->Branch("bd", bd, "board[multi]/s");
|
tree->Branch("bd", bd, "bd[multi]/s");
|
||||||
tree->Branch("sn", sn, "sn[multi]/s");
|
tree->Branch("sn", sn, "sn[multi]/s");
|
||||||
tree->Branch("ch", ch, "channel[multi]/s");
|
tree->Branch("ch", ch, "ch[multi]/s");
|
||||||
tree->Branch("e", e, "energy[multi]/s");
|
tree->Branch("e", e, "e[multi]/s");
|
||||||
tree->Branch("e2", e2, "energy_short[multi]/s");
|
tree->Branch("e2", e2, "e2[multi]/s");
|
||||||
tree->Branch("e_t", e_t, "timestamp[multi]/l");
|
tree->Branch("e_t", e_t, "e_t[multi]/l");
|
||||||
tree->Branch("e_f", e_f, "fine_timestamp[multi]/s");
|
tree->Branch("e_f", e_f, "e_f[multi]/s");
|
||||||
tree->Branch("lowFlag", lowFlag, "lowFlag[multi]/s");
|
tree->Branch("lowFlag", lowFlag, "lowFlag[multi]/s");
|
||||||
tree->Branch("highFlag", highFlag, "highFlag[multi]/s");
|
tree->Branch("highFlag", highFlag, "highFlag[multi]/s");
|
||||||
|
|
||||||
if( saveTrace){
|
if( saveTrace){
|
||||||
tree->Branch("tl", traceLen, "traceLen[multi]/I");
|
tree->Branch("traceLen", traceLen, "traceLen[multi]/I");
|
||||||
tree->Branch("trace", trace, Form("trace[multi][%d]/I", MAX_TRACE_LEN));
|
tree->Branch("trace", trace, Form("trace[multi][%d]/I", MAX_TRACE_LEN));
|
||||||
|
tree->GetBranch("trace")->SetCompressionSettings(205);
|
||||||
}
|
}
|
||||||
|
|
||||||
//*=========================================== build event
|
//*=========================================== build event
|
||||||
|
@ -331,7 +341,10 @@ int main(int argc, char ** argv){
|
||||||
numBlock += reader[i]->GetBlockID() + 1;
|
numBlock += reader[i]->GetBlockID() + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned int runEndTime = getTime_us();
|
||||||
|
double runTime = (runEndTime - runStartTime) * 1e-6;
|
||||||
printf("===================================== done. \n");
|
printf("===================================== done. \n");
|
||||||
|
printf(" event building time : %.2f sec = %.2f min\n", runTime, runTime/60.);
|
||||||
printf("Number of Block Scanned : %u\n", numBlock);
|
printf("Number of Block Scanned : %u\n", numBlock);
|
||||||
printf(" Number of Event Built : %lld\n", evID);
|
printf(" Number of Event Built : %lld\n", evID);
|
||||||
printf(" Output Root File Size : %.2f MB\n", outRootFile->GetSize()/1024./1024.);
|
printf(" Output Root File Size : %.2f MB\n", outRootFile->GetSize()/1024./1024.);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
CC=g++
|
CC=g++
|
||||||
CFLAG= -g
|
CFLAG= -O2
|
||||||
|
#CFLAG= -g -O0
|
||||||
ROOTFLAG=`root-config --cflags --glibs`
|
ROOTFLAG=`root-config --cflags --glibs`
|
||||||
all: EventBuilder
|
all: EventBuilder
|
||||||
|
|
||||||
|
|
108
Aux/SolReader.h
108
Aux/SolReader.h
|
@ -25,6 +25,8 @@ class SolReader {
|
||||||
|
|
||||||
std::vector<unsigned int> blockPos;
|
std::vector<unsigned int> blockPos;
|
||||||
|
|
||||||
|
size_t dummy;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SolReader();
|
SolReader();
|
||||||
SolReader(std::string fileName, unsigned short dataType);
|
SolReader(std::string fileName, unsigned short dataType);
|
||||||
|
@ -73,7 +75,7 @@ SolReader::SolReader(std::string fileName, unsigned short dataType = 0){
|
||||||
}
|
}
|
||||||
|
|
||||||
SolReader::~SolReader(){
|
SolReader::~SolReader(){
|
||||||
if( !inFile ) fclose(inFile);
|
if( inFile ) fclose(inFile);
|
||||||
delete hit;
|
delete hit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -109,7 +111,7 @@ inline int SolReader::ReadNextBlock(bool fastRead, bool debug){
|
||||||
if( feof(inFile) ) return -1;
|
if( feof(inFile) ) return -1;
|
||||||
if( filePos >= inFileSize) return -1;
|
if( filePos >= inFileSize) return -1;
|
||||||
|
|
||||||
fread(&blockStartIdentifier, 2, 1, inFile);
|
dummy = fread(&blockStartIdentifier, 2, 1, inFile);
|
||||||
|
|
||||||
if( (blockStartIdentifier & 0xAA00) != 0xAA00 ) {
|
if( (blockStartIdentifier & 0xAA00) != 0xAA00 ) {
|
||||||
printf("header fail.\n");
|
printf("header fail.\n");
|
||||||
|
@ -129,94 +131,94 @@ inline int SolReader::ReadNextBlock(bool fastRead, bool debug){
|
||||||
|
|
||||||
if( hit->dataType == DataFormat::ALL){
|
if( hit->dataType == DataFormat::ALL){
|
||||||
if( !fastRead ){
|
if( !fastRead ){
|
||||||
fread(&hit->channel, 1, 1, inFile);
|
dummy = fread(&hit->channel, 1, 1, inFile);
|
||||||
fread(&hit->energy, 2, 1, inFile);
|
dummy = fread(&hit->energy, 2, 1, inFile);
|
||||||
if( hit->DPPType == DPPType::PSD ) fread(&hit->energy_short, 2, 1, inFile);
|
if( hit->DPPType == DPPType::PSD ) dummy = fread(&hit->energy_short, 2, 1, inFile);
|
||||||
fread(&hit->timestamp, 6, 1, inFile);
|
dummy = fread(&hit->timestamp, 6, 1, inFile);
|
||||||
fread(&hit->fine_timestamp, 2, 1, inFile);
|
dummy = fread(&hit->fine_timestamp, 2, 1, inFile);
|
||||||
fread(&hit->flags_high_priority, 1, 1, inFile);
|
dummy = fread(&hit->flags_high_priority, 1, 1, inFile);
|
||||||
fread(&hit->flags_low_priority, 2, 1, inFile);
|
dummy = fread(&hit->flags_low_priority, 2, 1, inFile);
|
||||||
fread(&hit->downSampling, 1, 1, inFile);
|
dummy = fread(&hit->downSampling, 1, 1, inFile);
|
||||||
fread(&hit->board_fail, 1, 1, inFile);
|
dummy = fread(&hit->board_fail, 1, 1, inFile);
|
||||||
fread(&hit->flush, 1, 1, inFile);
|
dummy = fread(&hit->flush, 1, 1, inFile);
|
||||||
fread(&hit->trigger_threashold, 2, 1, inFile);
|
dummy = fread(&hit->trigger_threashold, 2, 1, inFile);
|
||||||
fread(&hit->event_size, 8, 1, inFile);
|
dummy = fread(&hit->event_size, 8, 1, inFile);
|
||||||
fread(&hit->aggCounter, 4, 1, inFile);
|
dummy = fread(&hit->aggCounter, 4, 1, inFile);
|
||||||
}else{
|
}else{
|
||||||
fseek(inFile, hit->DPPType == DPPType::PHA ? 31 : 33, SEEK_CUR);
|
fseek(inFile, hit->DPPType == DPPType::PHA ? 31 : 33, SEEK_CUR);
|
||||||
}
|
}
|
||||||
fread(&hit->traceLenght, 8, 1, inFile);
|
dummy = fread(&hit->traceLenght, 8, 1, inFile);
|
||||||
if( !fastRead ){
|
if( !fastRead ){
|
||||||
fread(hit->analog_probes_type, 2, 1, inFile);
|
dummy = fread(hit->analog_probes_type, 2, 1, inFile);
|
||||||
fread(hit->digital_probes_type, 4, 1, inFile);
|
dummy = fread(hit->digital_probes_type, 4, 1, inFile);
|
||||||
fread(hit->analog_probes[0], hit->traceLenght*4, 1, inFile);
|
dummy = fread(hit->analog_probes[0], hit->traceLenght*4, 1, inFile);
|
||||||
fread(hit->analog_probes[1], hit->traceLenght*4, 1, inFile);
|
dummy = fread(hit->analog_probes[1], hit->traceLenght*4, 1, inFile);
|
||||||
fread(hit->digital_probes[0], hit->traceLenght, 1, inFile);
|
dummy = fread(hit->digital_probes[0], hit->traceLenght, 1, inFile);
|
||||||
fread(hit->digital_probes[1], hit->traceLenght, 1, inFile);
|
dummy = fread(hit->digital_probes[1], hit->traceLenght, 1, inFile);
|
||||||
fread(hit->digital_probes[2], hit->traceLenght, 1, inFile);
|
dummy = fread(hit->digital_probes[2], hit->traceLenght, 1, inFile);
|
||||||
fread(hit->digital_probes[3], hit->traceLenght, 1, inFile);
|
dummy = fread(hit->digital_probes[3], hit->traceLenght, 1, inFile);
|
||||||
}else{
|
}else{
|
||||||
fseek(inFile, 6 + hit->traceLenght*(12), SEEK_CUR);
|
dummy = fseek(inFile, 6 + hit->traceLenght*(12), SEEK_CUR);
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if( hit->dataType == DataFormat::OneTrace){
|
}else if( hit->dataType == DataFormat::OneTrace){
|
||||||
if( !fastRead ){
|
if( !fastRead ){
|
||||||
fread(&hit->channel, 1, 1, inFile);
|
dummy = fread(&hit->channel, 1, 1, inFile);
|
||||||
fread(&hit->energy, 2, 1, inFile);
|
dummy = fread(&hit->energy, 2, 1, inFile);
|
||||||
if( hit->DPPType == DPPType::PSD ) fread(&hit->energy_short, 2, 1, inFile);
|
if( hit->DPPType == DPPType::PSD ) dummy = fread(&hit->energy_short, 2, 1, inFile);
|
||||||
fread(&hit->timestamp, 6, 1, inFile);
|
dummy = fread(&hit->timestamp, 6, 1, inFile);
|
||||||
fread(&hit->fine_timestamp, 2, 1, inFile);
|
dummy = fread(&hit->fine_timestamp, 2, 1, inFile);
|
||||||
fread(&hit->flags_high_priority, 1, 1, inFile);
|
dummy = fread(&hit->flags_high_priority, 1, 1, inFile);
|
||||||
fread(&hit->flags_low_priority, 2, 1, inFile);
|
dummy = fread(&hit->flags_low_priority, 2, 1, inFile);
|
||||||
}else{
|
}else{
|
||||||
fseek(inFile, hit->DPPType == DPPType::PHA ? 14 : 16, SEEK_CUR);
|
fseek(inFile, hit->DPPType == DPPType::PHA ? 14 : 16, SEEK_CUR);
|
||||||
}
|
}
|
||||||
fread(&hit->traceLenght, 8, 1, inFile);
|
dummy = fread(&hit->traceLenght, 8, 1, inFile);
|
||||||
if( !fastRead ){
|
if( !fastRead ){
|
||||||
fread(&hit->analog_probes_type[0], 1, 1, inFile);
|
dummy = fread(&hit->analog_probes_type[0], 1, 1, inFile);
|
||||||
fread(hit->analog_probes[0], hit->traceLenght*4, 1, inFile);
|
dummy = fread(hit->analog_probes[0], hit->traceLenght*4, 1, inFile);
|
||||||
}else{
|
}else{
|
||||||
fseek(inFile, 1 + hit->traceLenght*4, SEEK_CUR);
|
fseek(inFile, 1 + hit->traceLenght*4, SEEK_CUR);
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if( hit->dataType == DataFormat::NoTrace){
|
}else if( hit->dataType == DataFormat::NoTrace){
|
||||||
if( !fastRead ){
|
if( !fastRead ){
|
||||||
fread(&hit->channel, 1, 1, inFile);
|
dummy = fread(&hit->channel, 1, 1, inFile);
|
||||||
fread(&hit->energy, 2, 1, inFile);
|
dummy = fread(&hit->energy, 2, 1, inFile);
|
||||||
if( hit->DPPType == DPPType::PSD ) fread(&hit->energy_short, 2, 1, inFile);
|
if( hit->DPPType == DPPType::PSD ) dummy = fread(&hit->energy_short, 2, 1, inFile);
|
||||||
fread(&hit->timestamp, 6, 1, inFile);
|
dummy = fread(&hit->timestamp, 6, 1, inFile);
|
||||||
fread(&hit->fine_timestamp, 2, 1, inFile);
|
dummy = fread(&hit->fine_timestamp, 2, 1, inFile);
|
||||||
fread(&hit->flags_high_priority, 1, 1, inFile);
|
dummy = fread(&hit->flags_high_priority, 1, 1, inFile);
|
||||||
fread(&hit->flags_low_priority, 2, 1, inFile);
|
dummy = fread(&hit->flags_low_priority, 2, 1, inFile);
|
||||||
}else{
|
}else{
|
||||||
fseek(inFile, hit->DPPType == DPPType::PHA ? 14 : 16, SEEK_CUR);
|
fseek(inFile, hit->DPPType == DPPType::PHA ? 14 : 16, SEEK_CUR);
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if( hit->dataType == DataFormat::MiniWithFineTime){
|
}else if( hit->dataType == DataFormat::MiniWithFineTime){
|
||||||
if( !fastRead ){
|
if( !fastRead ){
|
||||||
fread(&hit->channel, 1, 1, inFile);
|
dummy = fread(&hit->channel, 1, 1, inFile);
|
||||||
fread(&hit->energy, 2, 1, inFile);
|
dummy = fread(&hit->energy, 2, 1, inFile);
|
||||||
if( hit->DPPType == DPPType::PSD ) fread(&hit->energy_short, 2, 1, inFile);
|
if( hit->DPPType == DPPType::PSD ) dummy = fread(&hit->energy_short, 2, 1, inFile);
|
||||||
fread(&hit->timestamp, 6, 1, inFile);
|
dummy = fread(&hit->timestamp, 6, 1, inFile);
|
||||||
fread(&hit->fine_timestamp, 2, 1, inFile);
|
dummy = fread(&hit->fine_timestamp, 2, 1, inFile);
|
||||||
}else{
|
}else{
|
||||||
fseek(inFile, hit->DPPType == DPPType::PHA ? 11 : 13, SEEK_CUR);
|
fseek(inFile, hit->DPPType == DPPType::PHA ? 11 : 13, SEEK_CUR);
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if( hit->dataType == DataFormat::Minimum){
|
}else if( hit->dataType == DataFormat::Minimum){
|
||||||
if( !fastRead ){
|
if( !fastRead ){
|
||||||
fread(&hit->channel, 1, 1, inFile);
|
dummy = fread(&hit->channel, 1, 1, inFile);
|
||||||
fread(&hit->energy, 2, 1, inFile);
|
dummy = fread(&hit->energy, 2, 1, inFile);
|
||||||
if( hit->DPPType == DPPType::PSD ) fread(&hit->energy_short, 2, 1, inFile);
|
if( hit->DPPType == DPPType::PSD ) dummy = fread(&hit->energy_short, 2, 1, inFile);
|
||||||
fread(&hit->timestamp, 6, 1, inFile);
|
dummy = fread(&hit->timestamp, 6, 1, inFile);
|
||||||
}else{
|
}else{
|
||||||
fseek(inFile, hit->DPPType == DPPType::PHA ? 9 : 11, SEEK_CUR);
|
fseek(inFile, hit->DPPType == DPPType::PHA ? 9 : 11, SEEK_CUR);
|
||||||
}
|
}
|
||||||
|
|
||||||
}else if( hit->dataType == DataFormat::Raw){
|
}else if( hit->dataType == DataFormat::Raw){
|
||||||
fread(&hit->dataSize, 8, 1, inFile);
|
dummy = fread(&hit->dataSize, 8, 1, inFile);
|
||||||
if( !fastRead ){
|
if( !fastRead ){
|
||||||
fread(hit->data, hit->dataSize, 1, inFile);
|
dummy = fread(hit->data, hit->dataSize, 1, inFile);
|
||||||
}else{
|
}else{
|
||||||
fseek(inFile, hit->dataSize, SEEK_CUR);
|
fseek(inFile, hit->dataSize, SEEK_CUR);
|
||||||
}
|
}
|
||||||
|
|
|
@ -60,7 +60,7 @@ QStringList chToolTip = { "Channel signal delay initialization status (1 = initi
|
||||||
|
|
||||||
QColor orangeColor(255, 165, 0);
|
QColor orangeColor(255, 165, 0);
|
||||||
|
|
||||||
DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi, QString analysisPath, QWidget * parent) : QWidget(parent){
|
DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi, QString settingPath, QWidget * parent) : QWidget(parent){
|
||||||
|
|
||||||
setWindowTitle("Digitizers Settings");
|
setWindowTitle("Digitizers Settings");
|
||||||
setGeometry(0, 0, 1850, 1050);
|
setGeometry(0, 0, 1850, 1050);
|
||||||
|
@ -72,7 +72,7 @@ DigiSettingsPanel::DigiSettingsPanel(Digitizer2Gen ** digi, unsigned short nDigi
|
||||||
this->nDigi = MaxNumberOfDigitizer;
|
this->nDigi = MaxNumberOfDigitizer;
|
||||||
qDebug() << "Please increase the MaxNumberOfChannel";
|
qDebug() << "Please increase the MaxNumberOfChannel";
|
||||||
}
|
}
|
||||||
this->digiSettingPath = analysisPath + "/working/Settings/";
|
this->digiSettingPath = settingPath;
|
||||||
|
|
||||||
ID = 0;
|
ID = 0;
|
||||||
enableSignalSlot = false;
|
enableSignalSlot = false;
|
||||||
|
|
|
@ -708,7 +708,7 @@ void MainWindow::OpenDigitizers(){
|
||||||
nDigiConnected = 0;
|
nDigiConnected = 0;
|
||||||
|
|
||||||
//Check path exist
|
//Check path exist
|
||||||
QDir dir(analysisPath + "/working/Settings/");
|
QDir dir(expDataPath + "/Settings/");
|
||||||
if( !dir.exists() ) dir.mkpath(".");
|
if( !dir.exists() ) dir.mkpath(".");
|
||||||
|
|
||||||
for( int i = 0; i < nDigi; i++){
|
for( int i = 0; i < nDigi; i++){
|
||||||
|
@ -726,7 +726,7 @@ void MainWindow::OpenDigitizers(){
|
||||||
connect(readDataThread[i], &ReadDataThread::sendMsg, this, &MainWindow::LogMsg);
|
connect(readDataThread[i], &ReadDataThread::sendMsg, this, &MainWindow::LogMsg);
|
||||||
|
|
||||||
//*------ search for settings_XXX_YYY.dat, YYY is DPP-type, XXX is serial number
|
//*------ search for settings_XXX_YYY.dat, YYY is DPP-type, XXX is serial number
|
||||||
QString settingFile = analysisPath + "/working/Settings/setting_" + QString::number(digi[i]->GetSerialNumber()) + "_" + QString::fromStdString(digi[i]->GetFPGAType().substr(4)) + ".dat";
|
QString settingFile = expDataPath + "/Settings/setting_" + QString::number(digi[i]->GetSerialNumber()) + "_" + QString::fromStdString(digi[i]->GetFPGAType().substr(4)) + ".dat";
|
||||||
if( digi[i]->LoadSettingsFromFile( settingFile.toStdString().c_str() ) ){
|
if( digi[i]->LoadSettingsFromFile( settingFile.toStdString().c_str() ) ){
|
||||||
LogMsg("Found setting file <b>" + settingFile + "</b> and loading. please wait.");
|
LogMsg("Found setting file <b>" + settingFile + "</b> and loading. please wait.");
|
||||||
digi[i]->SetSettingFileName(settingFile.toStdString());
|
digi[i]->SetSettingFileName(settingFile.toStdString());
|
||||||
|
@ -967,7 +967,7 @@ void MainWindow::OpenDigitizersSettings(){
|
||||||
LogMsg("Open digitizers Settings Panel");
|
LogMsg("Open digitizers Settings Panel");
|
||||||
|
|
||||||
if( digiSetting == NULL){
|
if( digiSetting == NULL){
|
||||||
digiSetting = new DigiSettingsPanel(digi, nDigi, analysisPath);
|
digiSetting = new DigiSettingsPanel(digi, nDigi, expDataPath + "/Settings/");
|
||||||
connect(digiSetting, &DigiSettingsPanel::SendLogMsg, this, &MainWindow::LogMsg);
|
connect(digiSetting, &DigiSettingsPanel::SendLogMsg, this, &MainWindow::LogMsg);
|
||||||
connect(digiSetting, &DigiSettingsPanel::UpdateOtherPanels, this, [=](){ UpdateAllPanel(1);});
|
connect(digiSetting, &DigiSettingsPanel::UpdateOtherPanels, this, [=](){ UpdateAllPanel(1);});
|
||||||
|
|
||||||
|
@ -1488,6 +1488,7 @@ void MainWindow::ProgramSettingsPanel(){
|
||||||
rawDataPath = expDataPath + "/data_raw/";
|
rawDataPath = expDataPath + "/data_raw/";
|
||||||
rootDataPath = expDataPath + "/root_data/";
|
rootDataPath = expDataPath + "/root_data/";
|
||||||
leExpName->setText(expName);
|
leExpName->setText(expName);
|
||||||
|
leRawDataPath->setText(rawDataPath);
|
||||||
|
|
||||||
CreateRawDataFolder();
|
CreateRawDataFolder();
|
||||||
|
|
||||||
|
@ -1777,12 +1778,12 @@ void MainWindow::SetupNewExpPanel(){
|
||||||
git.waitForFinished();
|
git.waitForFinished();
|
||||||
|
|
||||||
QByteArray output = git.readAllStandardOutput();
|
QByteArray output = git.readAllStandardOutput();
|
||||||
QStringList branches = (QString::fromLocal8Bit(output)).split("\n");
|
existGitBranches = (QString::fromLocal8Bit(output)).split("\n");
|
||||||
branches.removeAll("");
|
existGitBranches.removeAll("");
|
||||||
|
|
||||||
//qDebug() << branches;
|
//qDebug() << branches;
|
||||||
|
|
||||||
if( branches.size() == 0) {
|
if( existGitBranches.size() == 0) {
|
||||||
isGitExist = false;
|
isGitExist = false;
|
||||||
}else{
|
}else{
|
||||||
isGitExist = true;
|
isGitExist = true;
|
||||||
|
@ -1790,9 +1791,9 @@ void MainWindow::SetupNewExpPanel(){
|
||||||
|
|
||||||
QString presentBranch;
|
QString presentBranch;
|
||||||
unsigned short bID = 0; // id of the present branch
|
unsigned short bID = 0; // id of the present branch
|
||||||
for( unsigned short i = 0; i < branches.size(); i++){
|
for( unsigned short i = 0; i < existGitBranches.size(); i++){
|
||||||
if( branches[i].indexOf("*") != -1 ){
|
if( existGitBranches[i].indexOf("*") != -1 ){
|
||||||
presentBranch = branches[i].remove("*").remove(" ");
|
presentBranch = existGitBranches[i].remove("*").remove(" ");
|
||||||
bID = i;
|
bID = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1867,11 +1868,11 @@ void MainWindow::SetupNewExpPanel(){
|
||||||
cb->setEnabled(false);
|
cb->setEnabled(false);
|
||||||
bnChangeBranch->setEnabled(false);
|
bnChangeBranch->setEnabled(false);
|
||||||
}else{
|
}else{
|
||||||
for( int i = 0; i < branches.size(); i++){
|
for( int i = 0; i < existGitBranches.size(); i++){
|
||||||
if( i == bID ) continue;
|
if( i == bID ) continue;
|
||||||
if( branches[i].contains("HEAD")) continue;
|
if( existGitBranches[i].contains("HEAD")) continue;
|
||||||
if( branches[i].contains(presentBranch)) continue;
|
if( existGitBranches[i].contains(presentBranch)) continue;
|
||||||
cb->addItem(branches[i].remove(" "));
|
cb->addItem(existGitBranches[i].remove(" "));
|
||||||
}
|
}
|
||||||
if ( cb->count() == 0) {
|
if ( cb->count() == 0) {
|
||||||
cb->setEnabled(false);
|
cb->setEnabled(false);
|
||||||
|
@ -2023,6 +2024,27 @@ void MainWindow::WriteExpNameSh(){
|
||||||
|
|
||||||
void MainWindow::CreateNewExperiment(const QString newExpName){
|
void MainWindow::CreateNewExperiment(const QString newExpName){
|
||||||
|
|
||||||
|
if( newExpName == "HEAD" || newExpName == "head") {
|
||||||
|
LogMsg("Cannot name new exp as HEAD or head");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if( newExpName == expName ){
|
||||||
|
LogMsg("Already at this branch.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Check if newExpName already exist, if exist, go to run ChanegExperiment()
|
||||||
|
for( int i = 0; i < existGitBranches.size(); i++){
|
||||||
|
if( existGitBranches[i].contains("HEAD")) continue;
|
||||||
|
|
||||||
|
if( existGitBranches[i] == newExpName ) {
|
||||||
|
ChangeExperiment(newExpName);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
LogMsg("======================================");
|
LogMsg("======================================");
|
||||||
LogMsg("Creating new Exp. : <font style=\"color: red;\">" + newExpName + "</font>");
|
LogMsg("Creating new Exp. : <font style=\"color: red;\">" + newExpName + "</font>");
|
||||||
|
|
||||||
|
|
|
@ -176,6 +176,8 @@ private:
|
||||||
QLineEdit * lDatbaseName;
|
QLineEdit * lDatbaseName;
|
||||||
QLineEdit * lElogIP;
|
QLineEdit * lElogIP;
|
||||||
|
|
||||||
|
QStringList existGitBranches;
|
||||||
|
|
||||||
QString programPath;
|
QString programPath;
|
||||||
QString analysisPath;
|
QString analysisPath;
|
||||||
QString masterExpDataPath;
|
QString masterExpDataPath;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user