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-