changed musredit/musrgui msr2data interface such that it is hopefully closer to the command line (MUSR-162, MUSR-173)
This commit is contained in:
@@ -97,8 +97,8 @@ bool PAdminXMLParser::startElement( const QString&, const QString&,
|
||||
fKeyWord = eChainFit;
|
||||
} else if (qName == "write_data_header") {
|
||||
fKeyWord = eWriteDataHeader;
|
||||
} else if (qName == "summary_files_present") {
|
||||
fKeyWord = eSummaryFilesPresent;
|
||||
} else if (qName == "ignore_data_header_info") {
|
||||
fKeyWord = eIgnoreDataHeaderInfo;
|
||||
} else if (qName == "keep_minuit2_output") {
|
||||
fKeyWord = eKeepMinuit2Output;
|
||||
} else if (qName == "write_column_data") {
|
||||
@@ -113,6 +113,8 @@ bool PAdminXMLParser::startElement( const QString&, const QString&,
|
||||
fKeyWord = eFitOnly;
|
||||
} else if (qName == "global") {
|
||||
fKeyWord = eGlobal;
|
||||
} else if (qName == "global_plus") {
|
||||
fKeyWord = eGlobalPlus;
|
||||
} else if (qName == "func_pixmap_path") {
|
||||
fKeyWord = eTheoFuncPixmapPath;
|
||||
} else if (qName == "func") {
|
||||
@@ -236,12 +238,12 @@ bool PAdminXMLParser::characters(const QString& str)
|
||||
flag = false;
|
||||
fAdmin->fMsr2DataParam.writeDbHeader = flag;
|
||||
break;
|
||||
case eSummaryFilesPresent:
|
||||
case eIgnoreDataHeaderInfo:
|
||||
if (str == "y")
|
||||
flag = true;
|
||||
else
|
||||
flag = false;
|
||||
fAdmin->fMsr2DataParam.summaryFilePresent = flag;
|
||||
fAdmin->fMsr2DataParam.ignoreDataHeaderInfo = flag;
|
||||
break;
|
||||
case eKeepMinuit2Output:
|
||||
if (str == "y")
|
||||
@@ -292,6 +294,13 @@ bool PAdminXMLParser::characters(const QString& str)
|
||||
flag = false;
|
||||
fAdmin->fMsr2DataParam.global = flag;
|
||||
break;
|
||||
case eGlobalPlus:
|
||||
if (str == "y")
|
||||
flag = true;
|
||||
else
|
||||
flag = false;
|
||||
fAdmin->fMsr2DataParam.globalPlus = flag;
|
||||
break;
|
||||
case eTheoFuncPixmapPath:
|
||||
fAdmin->setTheoFuncPixmapPath(QString(str.ascii()).stripWhiteSpace());
|
||||
break;
|
||||
@@ -490,7 +499,7 @@ PAdmin::PAdmin()
|
||||
fMsr2DataParam.templateRunNo = -1;
|
||||
fMsr2DataParam.dbOutputFileName = QString("");
|
||||
fMsr2DataParam.writeDbHeader = true;
|
||||
fMsr2DataParam.summaryFilePresent = true;
|
||||
fMsr2DataParam.ignoreDataHeaderInfo = false;
|
||||
fMsr2DataParam.keepMinuit2Output = false;
|
||||
fMsr2DataParam.writeColumnData = false;
|
||||
fMsr2DataParam.recreateDbFile = false;
|
||||
@@ -500,6 +509,7 @@ PAdmin::PAdmin()
|
||||
fMsr2DataParam.createMsrFileOnly = false;
|
||||
fMsr2DataParam.fitOnly = false;
|
||||
fMsr2DataParam.global = false;
|
||||
fMsr2DataParam.globalPlus = false;
|
||||
|
||||
// XML Parser part
|
||||
QString fln = "./musrgui_startup.xml";
|
||||
|
||||
@@ -63,8 +63,8 @@ class PAdminXMLParser : public QXmlDefaultHandler
|
||||
eBeamline, eInstitute, eFileFormat, eLifetimeCorrection, eMsrDefaultFilePath,
|
||||
eHelpMain, eTheoFuncPixmapPath, eFunc, eFuncName, eFuncComment, eFuncLabel,
|
||||
eFuncPixmap, eFuncParams,
|
||||
eChainFit, eWriteDataHeader, eSummaryFilesPresent, eKeepMinuit2Output, eWriteColumnData,
|
||||
eRecreateDataFile, eOpenFileAfterFitting, eCreateMsrFileOnly, eFitOnly, eGlobal};
|
||||
eChainFit, eWriteDataHeader, eIgnoreDataHeaderInfo, eKeepMinuit2Output, eWriteColumnData,
|
||||
eRecreateDataFile, eOpenFileAfterFitting, eCreateMsrFileOnly, eFitOnly, eGlobal, eGlobalPlus};
|
||||
|
||||
bool startDocument();
|
||||
bool startElement( const QString&, const QString&, const QString& ,
|
||||
|
||||
@@ -82,7 +82,7 @@ PMsr2DataDialog::PMsr2DataDialog(PMsr2DataParam *msr2DataParam) : fMsr2DataParam
|
||||
}
|
||||
|
||||
fWriteDbHeader_checkBox->setChecked(fMsr2DataParam->writeDbHeader);
|
||||
fSummaryPresent_checkBox->setChecked(fMsr2DataParam->summaryFilePresent);
|
||||
fIgnoreDataHeaderInfo_checkBox->setChecked(fMsr2DataParam->ignoreDataHeaderInfo);
|
||||
fKeepMinuit2Output_checkBox->setChecked(fMsr2DataParam->keepMinuit2Output);
|
||||
fWriteColumnData_checkBox->setChecked(fMsr2DataParam->writeColumnData);
|
||||
fRecreateDbFile_checkBox->setChecked(fMsr2DataParam->recreateDbFile);
|
||||
@@ -92,6 +92,10 @@ PMsr2DataDialog::PMsr2DataDialog(PMsr2DataParam *msr2DataParam) : fMsr2DataParam
|
||||
fCreateMsrFileOnly_checkBox->setChecked(fMsr2DataParam->createMsrFileOnly);
|
||||
fFitOnly_checkBox->setChecked(fMsr2DataParam->fitOnly);
|
||||
fGlobal_checkBox->setChecked(fMsr2DataParam->global);
|
||||
fGlobalPlus_checkBox->setChecked(fMsr2DataParam->globalPlus);
|
||||
|
||||
connect(fGlobal_checkBox, SIGNAL(toggled(bool)), this, SLOT(globalOptionSet(bool)));
|
||||
connect(fGlobalPlus_checkBox, SIGNAL(toggled(bool)), this, SLOT(globalPlusOptionSet(bool)));
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
@@ -120,7 +124,7 @@ PMsr2DataParam* PMsr2DataDialog::getMsr2DataParam()
|
||||
}
|
||||
fMsr2DataParam->dbOutputFileName = fDbOutputFileName_lineEdit->text();
|
||||
fMsr2DataParam->writeDbHeader = fWriteDbHeader_checkBox->isChecked();
|
||||
fMsr2DataParam->summaryFilePresent = fSummaryPresent_checkBox->isChecked();
|
||||
fMsr2DataParam->ignoreDataHeaderInfo = fIgnoreDataHeaderInfo_checkBox->isChecked();
|
||||
fMsr2DataParam->keepMinuit2Output = fKeepMinuit2Output_checkBox->isChecked();
|
||||
fMsr2DataParam->writeColumnData = fWriteColumnData_checkBox->isChecked();
|
||||
fMsr2DataParam->recreateDbFile = fRecreateDbFile_checkBox->isChecked();
|
||||
@@ -240,11 +244,38 @@ void PMsr2DataDialog::fitOnlyChanged(int buttonState)
|
||||
{
|
||||
if (buttonState == QButton::On) {
|
||||
fCreateMsrFileOnly_checkBox->setChecked(false);
|
||||
fGlobal_checkBox->setChecked(false);
|
||||
fTemplateRunNumber_lineEdit->clear();
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Unchecks global+ if global is checked since global/global+ are excluding options
|
||||
*
|
||||
* \param checked true, if the check-box is checked
|
||||
*/
|
||||
void PMsr2DataDialog::globalOptionSet(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
if (fGlobalPlus_checkBox->isChecked())
|
||||
fGlobalPlus_checkBox->setChecked(false);
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Unchecks global if global+ is checked since global/global+ are excluding options
|
||||
*
|
||||
* \param checked true, if the check-box is checked
|
||||
*/
|
||||
void PMsr2DataDialog::globalPlusOptionSet(bool checked)
|
||||
{
|
||||
if (checked) {
|
||||
if (fGlobal_checkBox->isChecked())
|
||||
fGlobal_checkBox->setChecked(false);
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// END
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -52,6 +52,10 @@ class PMsr2DataDialog : public PMsr2DataDialogBase
|
||||
void createMsrFileOnlyChanged(int);
|
||||
void fitOnlyChanged(int);
|
||||
|
||||
private slots:
|
||||
void globalOptionSet(bool checked);
|
||||
void globalPlusOptionSet(bool checked);
|
||||
|
||||
private:
|
||||
int fRunTag; // -1 = not valid, 0 = first last, 1 = run list, 2 = run list file name
|
||||
PMsr2DataParam *fMsr2DataParam;
|
||||
|
||||
@@ -1564,8 +1564,8 @@ void PTextEdit::musrMsr2Data()
|
||||
if (!fMsr2DataParam->writeDbHeader)
|
||||
cmd.append("noheader");
|
||||
|
||||
// no summary flag?
|
||||
if (!fMsr2DataParam->summaryFilePresent)
|
||||
// ignore data header info flag present?
|
||||
if (fMsr2DataParam->ignoreDataHeaderInfo)
|
||||
cmd.append("nosummary");
|
||||
|
||||
// template run no fitting but: (i) no fit only flag, (ii) no create msr-file only flag
|
||||
@@ -1596,8 +1596,8 @@ void PTextEdit::musrMsr2Data()
|
||||
cmd.append("-k");
|
||||
}
|
||||
|
||||
// replace msr-file title by data file title
|
||||
if (fMsr2DataParam->titleFromDataFile) {
|
||||
// replace msr-file title by data file title. Add flag only if a fit is done
|
||||
if (fMsr2DataParam->titleFromDataFile && (fMsr2DataParam->fitOnly || fMsr2DataParam->templateRunNo != -1)) {
|
||||
cmd.append("-t");
|
||||
}
|
||||
|
||||
@@ -1617,16 +1617,18 @@ void PTextEdit::musrMsr2Data()
|
||||
cmd.append("global");
|
||||
}
|
||||
|
||||
// global+ flag check
|
||||
if (fMsr2DataParam->globalPlus) {
|
||||
if (fMsr2DataParam->chainFit) {
|
||||
cmd.append("global+");
|
||||
} else {
|
||||
cmd.append("global+!");
|
||||
}
|
||||
}
|
||||
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
cmd.append("new");
|
||||
}
|
||||
|
||||
PFitOutputHandler fitOutputHandler(QFileInfo(*fFilenames.find( currentEditor() )).dirPath(), cmd);
|
||||
|
||||
@@ -397,25 +397,6 @@
|
||||
<string>will keep the Minuit2 output files</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox">
|
||||
<property name="name">
|
||||
<cstring>fSummaryPresent_checkBox</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>50</y>
|
||||
<width>180</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Summary Files Present</string>
|
||||
</property>
|
||||
<property name="toolTip" stdset="0">
|
||||
<string>will try to extract information from the summary file (LEM)</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox">
|
||||
<property name="name">
|
||||
<cstring>fWriteDbHeader_checkBox</cstring>
|
||||
@@ -537,6 +518,22 @@
|
||||
<string>Fit Only</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox">
|
||||
<property name="name">
|
||||
<cstring>fGlobalPlus_checkBox</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>480</x>
|
||||
<y>90</y>
|
||||
<width>80</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Global+</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox">
|
||||
<property name="name">
|
||||
<cstring>fGlobal_checkBox</cstring>
|
||||
@@ -545,7 +542,7 @@
|
||||
<rect>
|
||||
<x>400</x>
|
||||
<y>90</y>
|
||||
<width>106</width>
|
||||
<width>70</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -553,6 +550,25 @@
|
||||
<string>Global</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox">
|
||||
<property name="name">
|
||||
<cstring>fIgnoreDataHeaderInfo_checkBox</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>50</y>
|
||||
<width>180</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Ignore Data Header Info</string>
|
||||
</property>
|
||||
<property name="toolTip" stdset="0">
|
||||
<string>will try to extract information from the summary file (LEM)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
@@ -643,7 +659,7 @@
|
||||
</widget>
|
||||
<images>
|
||||
<image name="image0">
|
||||
<data format="PNG" length="340">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000011b49444154388db594c16ec4200c44c71207bea791f600df1f0e91d8efe180440fad776dea0089b6b9a021100f8f89291f19a8001c506a81775ee918628378f291697b6c8d47744f3e32a102ae7fb9a79dbcf3ef22bf8b59975a00fc14e5f91862ebf739b9c9740eadb9d848975ad61c330e36218b59fae5d8722a37e59449bd07d01757da62fce722a08b5e72fc1f8c09c090f1dd916639b6f4d7636bcfc94915e33eaf67a3c574cab8bf5d4b5b4ca7391eb10e21b6947662c7ac3fc23888dec11fb5d6df4ac5c8a972bc9a862b7ac9b175fcd1fc52afe014706e4388ed9932c979542084ad49e6662acefaaf771e29edc41f51bf3bb49969af18f606e085839d5fcab17426b564dbffe6a78ccffaef9b31d4491496d51cdf49c53749ce1f9de06199f60000000049454e44ae426082</data>
|
||||
<data format="PNG" length="342">89504e470d0a1a0a0000000d4948445200000016000000160806000000c4b46c3b0000011d49444154388db594b192c3200c445733295cf21de72e257cbf29dd91efa0a4e38a4489c4c9803d3937cc62b096c75a94f60414000b904b865b9cd2c1870af1a43dd17a5f2b8f689eb42742016eedcb2d6ee416f729f25acc3a970ce05994e7830fb5dd77939b4ce7d09a8bf5742e79ce31e36013b298a5df8e2da772538a89d47b006d71a52dc67f2e02bae829c7ffc1980074195f1d6994634bffdcd7fa189c54316ef37a345a4c878cdbdbb5b4c57498e31e6bef438d712376ccfa2b8cbde81dfc516bfda554f49c2ac7b36938a3a71c5bc7efcd4ff50a4e01e7d6fb501f31919c4701bc5fab646ea6e2a8ffbac521c68df823ea77873633ec15ddde00bc71b0f3533996cea4966cdbdffc90f151fffd30863a89c2329be32ba9f8057c4e21e9a95dc13d0000000049454e44ae426082</data>
|
||||
</image>
|
||||
</images>
|
||||
<connections>
|
||||
@@ -712,7 +728,7 @@
|
||||
<tabstop>fChainFit_checkBox</tabstop>
|
||||
<tabstop>fDbOutputFileName_lineEdit</tabstop>
|
||||
<tabstop>fWriteDbHeader_checkBox</tabstop>
|
||||
<tabstop>fSummaryPresent_checkBox</tabstop>
|
||||
<tabstop>fIgnoreDataHeaderInfo_checkBox</tabstop>
|
||||
<tabstop>fKeepMinuit2Output_checkBox</tabstop>
|
||||
<tabstop>fWriteColumnData_checkBox</tabstop>
|
||||
<tabstop>fRecreateDbFile_checkBox</tabstop>
|
||||
@@ -720,6 +736,8 @@
|
||||
<tabstop>fTitleFromData_checkBox</tabstop>
|
||||
<tabstop>fCreateMsrFileOnly_checkBox</tabstop>
|
||||
<tabstop>fFitOnly_checkBox</tabstop>
|
||||
<tabstop>fGlobal_checkBox</tabstop>
|
||||
<tabstop>fGlobalPlus_checkBox</tabstop>
|
||||
<tabstop>fOk_button</tabstop>
|
||||
<tabstop>fCancel_button</tabstop>
|
||||
<tabstop>fHelp_button</tabstop>
|
||||
@@ -732,6 +750,8 @@
|
||||
<slot>createMsrFileOnlyChanged(int)</slot>
|
||||
<slot>fitOnlyChanged(int)</slot>
|
||||
<slot>templateRunEntered(const QString&)</slot>
|
||||
<slot access="private">globalOptionSet(bool checked)</slot>
|
||||
<slot access="private">globalPlusOptionSet(bool checked)</slot>
|
||||
</slots>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
</UI>
|
||||
|
||||
@@ -43,7 +43,7 @@ typedef struct {
|
||||
int templateRunNo;
|
||||
QString dbOutputFileName;
|
||||
bool writeDbHeader;
|
||||
bool summaryFilePresent;
|
||||
bool ignoreDataHeaderInfo;
|
||||
bool keepMinuit2Output;
|
||||
bool writeColumnData;
|
||||
bool recreateDbFile;
|
||||
@@ -53,6 +53,7 @@ typedef struct {
|
||||
bool createMsrFileOnly;
|
||||
bool fitOnly;
|
||||
bool global;
|
||||
bool globalPlus; ///< flag: true = 'global+' option
|
||||
} PMsr2DataParam;
|
||||
|
||||
typedef struct {
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<msr2data_defaults>
|
||||
<chain_fit>y</chain_fit>
|
||||
<write_data_header>y</write_data_header>
|
||||
<summary_files_present>y</summary_files_present>
|
||||
<ignore_data_header_info>n</ignore_data_header_info>
|
||||
<keep_minuit2_output>n</keep_minuit2_output>
|
||||
<write_column_data>n</write_column_data>
|
||||
<recreate_data_file>n</recreate_data_file>
|
||||
@@ -38,6 +38,7 @@
|
||||
<create_msr_file_only>n</create_msr_file_only>
|
||||
<fit_only>n</fit_only>
|
||||
<global>n</global>
|
||||
<global_plus>n</global_plus>
|
||||
</msr2data_defaults>
|
||||
<func_pixmap_path>$HOME/analysis/musrfit/src/musrgui/latex_images</func_pixmap_path>
|
||||
<theory_functions>
|
||||
|
||||
Reference in New Issue
Block a user