diff --git a/src/musredit/PMsr2DataDialog.cpp b/src/musredit/PMsr2DataDialog.cpp
index e80c26ca..a1d4fa9e 100644
--- a/src/musredit/PMsr2DataDialog.cpp
+++ b/src/musredit/PMsr2DataDialog.cpp
@@ -100,6 +100,7 @@ PMsr2DataDialog::PMsr2DataDialog(PMsr2DataParam *msr2DataParam, const QString he
fTitleFromData_checkBox->setChecked(fMsr2DataParam->titleFromDataFile);
fCreateMsrFileOnly_checkBox->setChecked(fMsr2DataParam->createMsrFileOnly);
fFitOnly_checkBox->setChecked(fMsr2DataParam->fitOnly);
+ fGlobal_checkBox->setChecked(fMsr2DataParam->global);
}
//----------------------------------------------------------------------------------------------------
@@ -137,6 +138,7 @@ PMsr2DataParam* PMsr2DataDialog::getMsr2DataParam()
fMsr2DataParam->titleFromDataFile = fTitleFromData_checkBox->isChecked();
fMsr2DataParam->createMsrFileOnly = fCreateMsrFileOnly_checkBox->isChecked();
fMsr2DataParam->fitOnly = fFitOnly_checkBox->isChecked();
+ fMsr2DataParam->global = fGlobal_checkBox->isChecked();
return fMsr2DataParam;
}
@@ -260,7 +262,7 @@ void PMsr2DataDialog::createMsrFileOnlyChanged(int buttonState)
//----------------------------------------------------------------------------------------------------
/**
*
SLOT: called when the 'Fit Only' QCheckBox under 'Options' is activated.
- * Sets at the same time the create-msr-file-only flag to false. Clears the 'Template Run Number'
+ * Sets at the same time the create-msr-file-only and global flags to false. Clears the 'Template Run Number'
* field.
*
* \param buttonState state of the button.
@@ -269,10 +271,25 @@ void PMsr2DataDialog::fitOnlyChanged(int buttonState)
{
if (buttonState == Qt::Checked) {
fCreateMsrFileOnly_checkBox->setChecked(false);
+ fGlobal_checkBox->setChecked(false);
fTemplateRunNumber_lineEdit->clear();
}
}
+//----------------------------------------------------------------------------------------------------
+/**
+ *
SLOT: called when the 'Global' QCheckBox under 'Options' is activated.
+ * Sets at the same time the fit-only flag to false.
+ *
+ * \param buttonState state of the button.
+ */
+void PMsr2DataDialog::globalChanged(int buttonState)
+{
+ if (buttonState == Qt::Checked) {
+ fFitOnly_checkBox->setChecked(false);
+ }
+}
+
//----------------------------------------------------------------------------------------------------
/**
*
Generates a help content window showing the description for msr2data.
diff --git a/src/musredit/PMsr2DataDialog.h b/src/musredit/PMsr2DataDialog.h
index 12fae817..25d6e2f6 100644
--- a/src/musredit/PMsr2DataDialog.h
+++ b/src/musredit/PMsr2DataDialog.h
@@ -60,6 +60,7 @@ class PMsr2DataDialog : public QDialog, private Ui::PMsr2DataDialog
void templateRunEntered(const QString&);
void createMsrFileOnlyChanged(int);
void fitOnlyChanged(int);
+ void globalChanged(int);
void helpContent();
private:
diff --git a/src/musredit/PTextEdit.cpp b/src/musredit/PTextEdit.cpp
index e2772dcc..726d86b8 100644
--- a/src/musredit/PTextEdit.cpp
+++ b/src/musredit/PTextEdit.cpp
@@ -1722,6 +1722,7 @@ void PTextEdit::musrMsr2Data()
fMsr2DataParam->titleFromDataFile = fTitleFromDataFile;
fMsr2DataParam->createMsrFileOnly = false;
fMsr2DataParam->fitOnly = false;
+ fMsr2DataParam->global = false;
}
PMsr2DataDialog *dlg = new PMsr2DataDialog(fMsr2DataParam, fAdmin->getHelpUrl("msr2data"));
@@ -1887,22 +1888,22 @@ void PTextEdit::musrMsr2Data()
cmd.append("data");
}
- // recreate db file
- if (fMsr2DataParam->recreateDbFile) {
- if (!QFile::remove(fMsr2DataParam->dbOutputFileName)) {
- str = QString("Couldn't delete db-file '%1'. Will **NOT** proceed.").arg(fMsr2DataParam->dbOutputFileName);
- QMessageBox::critical(this, "**ERROR**", str,
- QMessageBox::Ok, QMessageBox::NoButton);
- return;
- }
+ // global flag check
+ if (fMsr2DataParam->global) {
+ cmd.append("global");
}
-/*
-for (unsigned int i=0; i> " << cmd[i].toLatin1();
-}
-cout << endl;
-*/
+ // recreate db file
+ if (fMsr2DataParam->recreateDbFile) {
+ if (QFile::exists(fMsr2DataParam->dbOutputFileName)) {
+ if (!QFile::remove(fMsr2DataParam->dbOutputFileName)) {
+ str = QString("Couldn't delete db-file '%1'. Will **NOT** proceed.").arg(fMsr2DataParam->dbOutputFileName);
+ QMessageBox::critical(this, "**ERROR**", str,
+ QMessageBox::Ok, QMessageBox::NoButton);
+ return;
+ }
+ }
+ }
PFitOutputHandler fitOutputHandler(QFileInfo(*fFilenames.find( currentEditor() )).absolutePath(), cmd);
fitOutputHandler.setModal(true);
diff --git a/src/musredit/forms/PMsr2DataDialog.ui b/src/musredit/forms/PMsr2DataDialog.ui
index 71817a0c..7b8dabfa 100644
--- a/src/musredit/forms/PMsr2DataDialog.ui
+++ b/src/musredit/forms/PMsr2DataDialog.ui
@@ -6,8 +6,8 @@
0
0
- 542
- 522
+ 552
+ 551
@@ -22,7 +22,7 @@
0
0
- 541
+ 551
131
@@ -46,8 +46,8 @@
10
30
- 511
- 94
+ 531
+ 97
@@ -195,7 +195,7 @@
0
130
- 541
+ 551
71
@@ -207,8 +207,8 @@
10
30
- 511
- 28
+ 531
+ 29
@@ -256,7 +256,7 @@
0
200
- 541
+ 551
80
@@ -268,8 +268,8 @@
10
30
- 511
- 28
+ 531
+ 29
@@ -311,7 +311,7 @@
0
280
- 541
+ 551
80
@@ -323,8 +323,8 @@
10
30
- 511
- 28
+ 531
+ 29
@@ -362,20 +362,20 @@
0
360
- 541
- 111
+ 551
+ 141
Options
-
+
10
- 30
- 521
- 81
+ 31
+ 540
+ 108
@@ -452,6 +452,13 @@
+ -
+
+
+ Global
+
+
+
@@ -461,8 +468,8 @@
0
- 470
- 541
+ 500
+ 551
51
@@ -549,7 +556,7 @@
538
- 488
+ 534
508
@@ -564,8 +571,8 @@
accept()
- 453
- 506
+ 456
+ 541
380
@@ -580,8 +587,8 @@
helpContent()
- 57
- 488
+ 59
+ 534
96
@@ -589,38 +596,6 @@
-
- fFitOnly_checkBox
- stateChanged(int)
- PMsr2DataDialog
- fitOnlyChanged(int)
-
-
- 406
- 460
-
-
- 301
- 484
-
-
-
-
- fCreateMsrFileOnly_checkBox
- stateChanged(int)
- PMsr2DataDialog
- createMsrFileOnlyChanged(int)
-
-
- 377
- 429
-
-
- 150
- 487
-
-
-
fFirst_lineEdit
textChanged(QString)
@@ -701,6 +676,54 @@
+
+ fFitOnly_checkBox
+ stateChanged(int)
+ PMsr2DataDialog
+ fitOnlyChanged(int)
+
+
+ 406
+ 460
+
+
+ 301
+ 484
+
+
+
+
+ fCreateMsrFileOnly_checkBox
+ stateChanged(int)
+ PMsr2DataDialog
+ createMsrFileOnlyChanged(int)
+
+
+ 547
+ 442
+
+
+ 150
+ 487
+
+
+
+
+ fGlobal_checkBox
+ stateChanged(int)
+ PMsr2DataDialog
+ globalChanged(int)
+
+
+ 398
+ 479
+
+
+ 372
+ 520
+
+
+
helpContent()
@@ -711,5 +734,6 @@
runListEntered(QString)
runListFileNameEntered(QString)
templateRunEntered(QString)
+ globalChanged(int)
diff --git a/src/musredit/musredit.h b/src/musredit/musredit.h
index f55af60c..b388e92d 100644
--- a/src/musredit/musredit.h
+++ b/src/musredit/musredit.h
@@ -52,12 +52,13 @@ typedef struct {
bool summaryFilePresent; ///< flag indicating if a LEM summary file is present (== !nosummary in msr2data)
bool keepMinuit2Output; ///< flag indicating if the minuit2 output shall be kept ('-k' in msr2data)
bool writeColumnData; ///< flag indicating if instead of a db-file a column data ascii file shall be written ('data' in msr2data)
- bool recreateDbFile; ///< true = recreate db-file, false = append to present db-file
- bool chainFit; ///< true = chain fit, i.e. the template for a fit is the preceeding run. false = the template is always the source for the new msr-file
- bool openFilesAfterFitting; ///< true = open msr-file after fit in musredit. false = do not open msr-file after fit.
+ bool recreateDbFile; ///< flag: true = recreate db-file, false = append to present db-file
+ bool chainFit; ///< flag: true = chain fit, i.e. the template for a fit is the preceeding run. false = the template is always the source for the new msr-file
+ bool openFilesAfterFitting; ///< flag: true = open msr-file after fit in musredit. false = do not open msr-file after fit.
bool titleFromDataFile; ///< flag indicating if the title for the msr-file shall be extracted from the data-file ('-t' in msr2data)
- bool createMsrFileOnly; ///< true = just create the msr-files without any fitting ('msr-' in msr2data)
- bool fitOnly; ///< true = just perform the fits wihtout generating any msr-files ('fit' in msr2data).
+ bool createMsrFileOnly; ///< flag: true = just create the msr-files without any fitting ('msr-' in msr2data)
+ bool fitOnly; ///< flag: true = just perform the fits wihtout generating any msr-files ('fit' in msr2data).
+ bool global; ///< flag: true = 'global' option
} PMsr2DataParam;
//-------------------------------------------------------------------------------------------------
diff --git a/src/musrgui/PFitOutputHandler.cpp b/src/musrgui/PFitOutputHandler.cpp
index eafd7c95..b1d87a4b 100644
--- a/src/musrgui/PFitOutputHandler.cpp
+++ b/src/musrgui/PFitOutputHandler.cpp
@@ -39,6 +39,10 @@
*/
PFitOutputHandler::PFitOutputHandler(QString workingDirectory, QValueVector &cmd)
{
+qDebug("workingDirectory = %s", workingDirectory.latin1());
+for (int i=0; isetChecked(fMsr2DataParam->titleFromDataFile);
fCreateMsrFileOnly_checkBox->setChecked(fMsr2DataParam->createMsrFileOnly);
fFitOnly_checkBox->setChecked(fMsr2DataParam->fitOnly);
+ fGlobal_checkBox->setChecked(fMsr2DataParam->global);
}
//----------------------------------------------------------------------------------------------------
@@ -128,6 +129,7 @@ PMsr2DataParam* PMsr2DataDialog::getMsr2DataParam()
fMsr2DataParam->titleFromDataFile = fTitleFromData_checkBox->isChecked();
fMsr2DataParam->createMsrFileOnly = fCreateMsrFileOnly_checkBox->isChecked();
fMsr2DataParam->fitOnly = fFitOnly_checkBox->isChecked();
+ fMsr2DataParam->global = fGlobal_checkBox->isChecked();
return fMsr2DataParam;
}
@@ -238,10 +240,22 @@ void PMsr2DataDialog::fitOnlyChanged(int buttonState)
{
if (buttonState == QButton::On) {
fCreateMsrFileOnly_checkBox->setChecked(false);
+ fGlobal_checkBox->setChecked(false);
fTemplateRunNumber_lineEdit->clear();
}
}
+//----------------------------------------------------------------------------------------------------
+/**
+ *
+ */
+void PMsr2DataDialog::globalChanged(int buttonState)
+{
+ if (buttonState == QButton::On) {
+ fFitOnly_checkBox->setChecked(false);
+ }
+}
+
//----------------------------------------------------------------------------------------------------
// END
//----------------------------------------------------------------------------------------------------
diff --git a/src/musrgui/PMsr2DataDialog.h b/src/musrgui/PMsr2DataDialog.h
index 24aad2f9..e95a4874 100644
--- a/src/musrgui/PMsr2DataDialog.h
+++ b/src/musrgui/PMsr2DataDialog.h
@@ -51,6 +51,7 @@ class PMsr2DataDialog : public PMsr2DataDialogBase
void templateRunEntered(const QString&);
void createMsrFileOnlyChanged(int);
void fitOnlyChanged(int);
+ void globalChanged(int);
private:
int fRunTag; // -1 = not valid, 0 = first last, 1 = run list, 2 = run list file name
diff --git a/src/musrgui/PTextEdit.cpp b/src/musrgui/PTextEdit.cpp
index 0fc846ea..810a6f7e 100644
--- a/src/musrgui/PTextEdit.cpp
+++ b/src/musrgui/PTextEdit.cpp
@@ -1468,6 +1468,7 @@ void PTextEdit::musrMsr2Data()
fMsr2DataParam->titleFromDataFile = fTitleFromDataFile;
fMsr2DataParam->createMsrFileOnly = false;
fMsr2DataParam->fitOnly = false;
+ fMsr2DataParam->global = false;
}
PMsr2DataDialog *dlg = new PMsr2DataDialog(fMsr2DataParam);
@@ -1628,22 +1629,22 @@ void PTextEdit::musrMsr2Data()
cmd.append("data");
}
- // recreate db file
- if (fMsr2DataParam->recreateDbFile) {
- if (!QFile::remove(fMsr2DataParam->dbOutputFileName)) {
- str = QString("Couldn't delete db-file '%1'. Will **NOT** proceed.").arg(fMsr2DataParam->dbOutputFileName);
- QMessageBox::critical(this, "**ERROR**", str,
- QMessageBox::Ok, QMessageBox::NoButton);
- return;
- }
+ // check global option
+ if (fMsr2DataParam->global) {
+ cmd.append("global");
}
-/*
-for (unsigned int i=0; i> " << cmd[i].latin1();
-}
-cout << endl;
-*/
+ // recreate db file
+ if (fMsr2DataParam->recreateDbFile) {
+ if (QFile::exists(fMsr2DataParam->dbOutputFileName)) {
+ if (!QFile::remove(fMsr2DataParam->dbOutputFileName)) {
+ str = QString("Couldn't delete db-file '%1'. Will **NOT** proceed.").arg(fMsr2DataParam->dbOutputFileName);
+ QMessageBox::critical(this, "**ERROR**", str,
+ QMessageBox::Ok, QMessageBox::NoButton);
+ return;
+ }
+ }
+ }
PFitOutputHandler fitOutputHandler(QFileInfo(*fFilenames.find( currentEditor() )).dirPath(), cmd);
fitOutputHandler.setModal(true);
diff --git a/src/musrgui/forms/PMsr2DataDialogBase.ui b/src/musrgui/forms/PMsr2DataDialogBase.ui
index fd9c95d3..81d5e1a1 100644
--- a/src/musrgui/forms/PMsr2DataDialogBase.ui
+++ b/src/musrgui/forms/PMsr2DataDialogBase.ui
@@ -200,92 +200,6 @@
-
-
- Layout1
-
-
-
- 10
- 530
- 580
- 33
-
-
-
-
- unnamed
-
-
- 0
-
-
- 6
-
-
-
- fHelp_button
-
-
- &Help
-
-
- F1
-
-
- true
-
-
-
-
- Horizontal Spacing2
-
-
- Horizontal
-
-
- Expanding
-
-
-
- 20
- 20
-
-
-
-
-
- fOk_button
-
-
- &OK
-
-
-
-
-
- true
-
-
- true
-
-
-
-
- fCancel_button
-
-
- &Cancel
-
-
-
-
-
- true
-
-
-
-
fExtension_groupBox
@@ -458,7 +372,7 @@
10
400
581
- 110
+ 120
@@ -623,6 +537,108 @@
Fit Only
+
+
+ fGlobal_checkBox
+
+
+
+ 400
+ 90
+ 106
+ 22
+
+
+
+ Global
+
+
+
+
+
+ Layout1
+
+
+
+ 10
+ 530
+ 580
+ 33
+
+
+
+
+ unnamed
+
+
+ 0
+
+
+ 6
+
+
+
+ fHelp_button
+
+
+ &Help
+
+
+ F1
+
+
+ true
+
+
+
+
+ Horizontal Spacing2
+
+
+ Horizontal
+
+
+ Expanding
+
+
+
+ 20
+ 20
+
+
+
+
+
+ fOk_button
+
+
+ &OK
+
+
+
+
+
+ true
+
+
+ true
+
+
+
+
+ fCancel_button
+
+
+ &Cancel
+
+
+
+
+
+ true
+
+
+
@@ -685,6 +701,12 @@
PMsr2DataDialogBase
templateRunEntered(const QString&)
+
+ fGlobal_checkBox
+ stateChanged(int)
+ PMsr2DataDialogBase
+ globalChanged(int)
+
fFirst_lineEdit
@@ -716,6 +738,7 @@
createMsrFileOnlyChanged(int)
fitOnlyChanged(int)
templateRunEntered(const QString&)
+ globalChanged(int)
diff --git a/src/musrgui/musrgui.h b/src/musrgui/musrgui.h
index 434e1b27..2021229a 100644
--- a/src/musrgui/musrgui.h
+++ b/src/musrgui/musrgui.h
@@ -52,6 +52,7 @@ typedef struct {
bool titleFromDataFile;
bool createMsrFileOnly;
bool fitOnly;
+ bool global;
} PMsr2DataParam;
typedef struct {