changes needed for msr2data and default swap
This commit is contained in:
parent
c11503ccdf
commit
2e745ed581
@ -58,7 +58,7 @@ using namespace std;
|
||||
void musrfit_syntax()
|
||||
{
|
||||
cout << endl << "usage: musrfit [<msr-file> [-k, --keep-mn2-ouput] [-c, --chisq-only]";
|
||||
cout << endl << " [-s, --swap-msr-mlog] [--debug] [--dump <type>]] |";
|
||||
cout << endl << " [--debug] [--dump <type>]] |";
|
||||
cout << endl << " --version | --help";
|
||||
cout << endl << " <msr-file>: msr input file";
|
||||
cout << endl << " 'musrfit <msr-file>' will execute musrfit";
|
||||
@ -71,10 +71,12 @@ void musrfit_syntax()
|
||||
cout << endl << " -c, --chisq-only: instead of fitting the data, chisq is just calculated";
|
||||
cout << endl << " once and the result is set to the stdout. This feature is useful";
|
||||
cout << endl << " to adjust initial parameters.";
|
||||
cout << endl << " -s, --swap-msr-mlog: will swap msr-, mlog-file at the end of execution";
|
||||
cout << endl << " --debug is used to print additional infos";
|
||||
cout << endl << " --dump <type> is writing a data file with the fit data and the theory";
|
||||
cout << endl << " <type> can be 'ascii', 'root'";
|
||||
cout << endl << " <type> can be 'ascii', 'root'" << endl;
|
||||
cout << endl << " At the end of a fit, musrfit writes the fit results into an <mlog-file> and";
|
||||
cout << endl << " swaps them, i.e. in the <msr-file> you will find the fit results and in the";
|
||||
cout << endl << " <mlog-file> your initial guess values.";
|
||||
cout << endl << endl;
|
||||
}
|
||||
|
||||
@ -487,7 +489,6 @@ int main(int argc, char *argv[])
|
||||
bool debug = false;
|
||||
bool keep_mn2_output = false;
|
||||
bool chisq_only = false;
|
||||
bool swap_msr_mlog = false;
|
||||
TString dump("");
|
||||
char filename[256];
|
||||
|
||||
@ -532,8 +533,6 @@ int main(int argc, char *argv[])
|
||||
show_syntax = true;
|
||||
break;
|
||||
}
|
||||
} else if (!strcmp(argv[i], "-s") || !strcmp(argv[i], "--swap-msr-mlog")) {
|
||||
swap_msr_mlog = true;
|
||||
} else {
|
||||
show_syntax = true;
|
||||
break;
|
||||
@ -687,8 +686,8 @@ int main(int argc, char *argv[])
|
||||
gSystem->CopyFile("MINUIT2.root", fln.Data(), kTRUE);
|
||||
}
|
||||
|
||||
// swap msr-, mlog-file if wished
|
||||
if (swap_msr_mlog) {
|
||||
if (!chisq_only) {
|
||||
// swap msr- and mlog-file
|
||||
cout << endl << ">> swapping msr-, mlog-file ..." << endl;
|
||||
// copy msr-file -> __temp.msr
|
||||
gSystem->CopyFile(filename, "__temp.msr", kTRUE);
|
||||
|
@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
|
||||
PMlog2DbDialog.cpp
|
||||
PMsr2DataDialog.cpp
|
||||
|
||||
Author: Andreas Suter
|
||||
e-mail: andreas.suter@psi.ch
|
||||
@ -35,98 +35,98 @@
|
||||
#include <qtextedit.h>
|
||||
#include <qcheckbox.h>
|
||||
|
||||
#include "PMlog2DbDialog.h"
|
||||
#include "PMsr2DataDialog.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
PMlog2DbDialog::PMlog2DbDialog(PMlog2DbDataSet *mlog2DbDataSet) : fMlog2DbDataSet(mlog2DbDataSet)
|
||||
PMsr2DataDialog::PMsr2DataDialog(PMsr2DataParam *msr2DataParam) : fMsr2DataParam(msr2DataParam)
|
||||
{
|
||||
QString str;
|
||||
|
||||
fRunTag = -1;
|
||||
|
||||
fFirst_lineEdit->setValidator( new QIntValidator(fFirst_lineEdit) );
|
||||
if (fMlog2DbDataSet->firstRun != -1) {
|
||||
str = QString("%1").arg(fMlog2DbDataSet->firstRun);
|
||||
if (fMsr2DataParam->firstRun != -1) {
|
||||
str = QString("%1").arg(fMsr2DataParam->firstRun);
|
||||
fFirst_lineEdit->setText(str);
|
||||
}
|
||||
|
||||
fLast_lineEdit->setValidator( new QIntValidator(fLast_lineEdit) );
|
||||
if (fMlog2DbDataSet->lastRun != -1) {
|
||||
str = QString("%1").arg(fMlog2DbDataSet->lastRun);
|
||||
if (fMsr2DataParam->lastRun != -1) {
|
||||
str = QString("%1").arg(fMsr2DataParam->lastRun);
|
||||
fLast_lineEdit->setText(str);
|
||||
}
|
||||
|
||||
if (!fMlog2DbDataSet->runListFileName.isEmpty()) {
|
||||
fRunListFileName_lineEdit->setText(fMlog2DbDataSet->runListFileName);
|
||||
if (!fMsr2DataParam->runListFileName.isEmpty()) {
|
||||
fRunListFileName_lineEdit->setText(fMsr2DataParam->runListFileName);
|
||||
}
|
||||
|
||||
if (!fMlog2DbDataSet->runList.isEmpty()) {
|
||||
fRunList_lineEdit->setText(fMlog2DbDataSet->runList);
|
||||
if (!fMsr2DataParam->runList.isEmpty()) {
|
||||
fRunList_lineEdit->setText(fMsr2DataParam->runList);
|
||||
}
|
||||
|
||||
if (!fMlog2DbDataSet->msrFileExtension.isEmpty()) {
|
||||
fExtension_lineEdit->setText(fMlog2DbDataSet->msrFileExtension);
|
||||
if (!fMsr2DataParam->msrFileExtension.isEmpty()) {
|
||||
fExtension_lineEdit->setText(fMsr2DataParam->msrFileExtension);
|
||||
}
|
||||
|
||||
fTemplateRunNumber_lineEdit->setValidator( new QIntValidator(fTemplateRunNumber_lineEdit) );
|
||||
if (fMlog2DbDataSet->templateRunNo != -1) {
|
||||
str = QString("%1").arg(fMlog2DbDataSet->templateRunNo);
|
||||
if (fMsr2DataParam->templateRunNo != -1) {
|
||||
str = QString("%1").arg(fMsr2DataParam->templateRunNo);
|
||||
fTemplateRunNumber_lineEdit->setText(str);
|
||||
}
|
||||
|
||||
if (!fMlog2DbDataSet->dbOutputFileName.isEmpty()) {
|
||||
fDbOutputFileName_lineEdit->setText(fMlog2DbDataSet->dbOutputFileName);
|
||||
if (!fMsr2DataParam->dbOutputFileName.isEmpty()) {
|
||||
fDbOutputFileName_lineEdit->setText(fMsr2DataParam->dbOutputFileName);
|
||||
}
|
||||
|
||||
fWriteDbHeader_checkBox->setChecked(fMlog2DbDataSet->writeDbHeader);
|
||||
fSummaryPresent_checkBox->setChecked(fMlog2DbDataSet->summaryFilePresent);
|
||||
fKeepMinuit2Output_checkBox->setChecked(fMlog2DbDataSet->keepMinuit2Output);
|
||||
fWriteColumnData_checkBox->setChecked(fMlog2DbDataSet->writeColumnData);
|
||||
fRecreateDbFile_checkBox->setChecked(fMlog2DbDataSet->recreateDbFile);
|
||||
fWriteDbHeader_checkBox->setChecked(fMsr2DataParam->writeDbHeader);
|
||||
fSummaryPresent_checkBox->setChecked(fMsr2DataParam->summaryFilePresent);
|
||||
fKeepMinuit2Output_checkBox->setChecked(fMsr2DataParam->keepMinuit2Output);
|
||||
fWriteColumnData_checkBox->setChecked(fMsr2DataParam->writeColumnData);
|
||||
fRecreateDbFile_checkBox->setChecked(fMsr2DataParam->recreateDbFile);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
PMlog2DbDataSet* PMlog2DbDialog::getMlog2DbDataSet()
|
||||
PMsr2DataParam* PMsr2DataDialog::getMsr2DataParam()
|
||||
{
|
||||
if (fFirst_lineEdit->text().isEmpty()) {
|
||||
fMlog2DbDataSet->firstRun = -1;
|
||||
fMsr2DataParam->firstRun = -1;
|
||||
} else {
|
||||
fMlog2DbDataSet->firstRun = fFirst_lineEdit->text().toInt();
|
||||
fMsr2DataParam->firstRun = fFirst_lineEdit->text().toInt();
|
||||
}
|
||||
if (fLast_lineEdit->text().isEmpty()) {
|
||||
fMlog2DbDataSet->lastRun = -1;
|
||||
fMsr2DataParam->lastRun = -1;
|
||||
} else {
|
||||
fMlog2DbDataSet->lastRun = fLast_lineEdit->text().toInt();
|
||||
fMsr2DataParam->lastRun = fLast_lineEdit->text().toInt();
|
||||
}
|
||||
fMlog2DbDataSet->runList = fRunList_lineEdit->text();
|
||||
fMlog2DbDataSet->runListFileName = fRunListFileName_lineEdit->text();
|
||||
fMlog2DbDataSet->msrFileExtension = fExtension_lineEdit->text();
|
||||
fMsr2DataParam->runList = fRunList_lineEdit->text();
|
||||
fMsr2DataParam->runListFileName = fRunListFileName_lineEdit->text();
|
||||
fMsr2DataParam->msrFileExtension = fExtension_lineEdit->text();
|
||||
if (fTemplateRunNumber_lineEdit->text().isEmpty()) {
|
||||
fMlog2DbDataSet->templateRunNo = -1;
|
||||
fMsr2DataParam->templateRunNo = -1;
|
||||
} else {
|
||||
fMlog2DbDataSet->templateRunNo = fTemplateRunNumber_lineEdit->text().toInt();
|
||||
fMsr2DataParam->templateRunNo = fTemplateRunNumber_lineEdit->text().toInt();
|
||||
}
|
||||
fMlog2DbDataSet->dbOutputFileName = fDbOutputFileName_lineEdit->text();
|
||||
fMlog2DbDataSet->writeDbHeader = fWriteDbHeader_checkBox->isChecked();
|
||||
fMlog2DbDataSet->summaryFilePresent = fSummaryPresent_checkBox->isChecked();
|
||||
fMlog2DbDataSet->keepMinuit2Output = fKeepMinuit2Output_checkBox->isChecked();
|
||||
fMlog2DbDataSet->writeColumnData = fWriteColumnData_checkBox->isChecked();
|
||||
fMlog2DbDataSet->recreateDbFile = fRecreateDbFile_checkBox->isChecked();
|
||||
fMsr2DataParam->dbOutputFileName = fDbOutputFileName_lineEdit->text();
|
||||
fMsr2DataParam->writeDbHeader = fWriteDbHeader_checkBox->isChecked();
|
||||
fMsr2DataParam->summaryFilePresent = fSummaryPresent_checkBox->isChecked();
|
||||
fMsr2DataParam->keepMinuit2Output = fKeepMinuit2Output_checkBox->isChecked();
|
||||
fMsr2DataParam->writeColumnData = fWriteColumnData_checkBox->isChecked();
|
||||
fMsr2DataParam->recreateDbFile = fRecreateDbFile_checkBox->isChecked();
|
||||
|
||||
return fMlog2DbDataSet;
|
||||
return fMsr2DataParam;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PMlog2DbDialog::runFirstLastEntered()
|
||||
void PMsr2DataDialog::runFirstLastEntered()
|
||||
{
|
||||
fRunTag = 0;
|
||||
|
||||
@ -140,7 +140,7 @@ void PMlog2DbDialog::runFirstLastEntered()
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PMlog2DbDialog::runListEntered()
|
||||
void PMsr2DataDialog::runListEntered()
|
||||
{
|
||||
fRunTag = 1;
|
||||
|
||||
@ -156,7 +156,7 @@ void PMlog2DbDialog::runListEntered()
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PMlog2DbDialog::runListFileNameEntered()
|
||||
void PMsr2DataDialog::runListFileNameEntered()
|
||||
{
|
||||
fRunTag = 2;
|
||||
|
@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
|
||||
PMlog2DbDialog.h
|
||||
PMsr2DataDialog.h
|
||||
|
||||
Author: Andreas Suter
|
||||
e-mail: andreas.suter@psi.ch
|
||||
@ -29,19 +29,19 @@
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _PMLOG2DBDIALOG_H_
|
||||
#define _PMLOG2DBDIALOG_H_
|
||||
#ifndef _PMSR2DATADIALOG_H_
|
||||
#define _PMSR2DATADIALOG_H_
|
||||
|
||||
#include "musrgui.h"
|
||||
#include "forms/PMlog2DbDialogBase.h"
|
||||
#include "forms/PMsr2DataDialogBase.h"
|
||||
|
||||
class PMlog2DbDialog : public PMlog2DbDialogBase
|
||||
class PMsr2DataDialog : public PMsr2DataDialogBase
|
||||
{
|
||||
public:
|
||||
PMlog2DbDialog(PMlog2DbDataSet *mlog2DbDataSet);
|
||||
PMsr2DataDialog(PMsr2DataParam *msr2DataParam);
|
||||
|
||||
virtual int getRunTag() { return fRunTag; }
|
||||
virtual PMlog2DbDataSet* getMlog2DbDataSet();
|
||||
virtual PMsr2DataParam* getMsr2DataParam();
|
||||
|
||||
public slots:
|
||||
void runFirstLastEntered();
|
||||
@ -50,7 +50,7 @@ class PMlog2DbDialog : public PMlog2DbDialogBase
|
||||
|
||||
private:
|
||||
int fRunTag; // -1 = not valid, 0 = first last, 1 = run list, 2 = run list file name
|
||||
PMlog2DbDataSet *fMlog2DbDataSet;
|
||||
PMsr2DataParam *fMsr2DataParam;
|
||||
};
|
||||
|
||||
#endif // _PMLOG2DBDIALOG_H_
|
||||
#endif // _PMSR2DATADIALOG_H_
|
@ -63,7 +63,7 @@ using namespace std;
|
||||
#include "PPrefsDialog.h"
|
||||
#include "PGetDefaultDialog.h"
|
||||
#include "forms/PMusrGuiAbout.h"
|
||||
#include "PMlog2DbDialog.h"
|
||||
#include "PMsr2DataDialog.h"
|
||||
|
||||
/* XPM */
|
||||
static const char * const musrfit_xpm[] = {
|
||||
@ -103,7 +103,7 @@ PTextEdit::PTextEdit( QWidget *parent, const char *name )
|
||||
{
|
||||
fAdmin = new PAdmin();
|
||||
|
||||
fMlog2DbDataSet = 0;
|
||||
fMsr2DataParam = 0;
|
||||
|
||||
fKeepMinuit2Output = false;
|
||||
fDump = 0; // 0 = no dump, 1 = ascii dump, 2 = root dump
|
||||
@ -138,9 +138,9 @@ PTextEdit::PTextEdit( QWidget *parent, const char *name )
|
||||
*/
|
||||
PTextEdit::~PTextEdit()
|
||||
{
|
||||
if (fMlog2DbDataSet) {
|
||||
delete fMlog2DbDataSet;
|
||||
fMlog2DbDataSet = 0;
|
||||
if (fMsr2DataParam) {
|
||||
delete fMsr2DataParam;
|
||||
fMsr2DataParam = 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -294,8 +294,8 @@ void PTextEdit::setupMusrActions()
|
||||
a->addTo( tb );
|
||||
a->addTo( menu );
|
||||
|
||||
a = new QAction( QPixmap::fromMimeSource( "musrmlog2db.xpm" ), tr( "&Mlog2dB" ), ALT + Key_M, this, "musrMlog2Db" );
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( musrMlog2Db() ) );
|
||||
a = new QAction( QPixmap::fromMimeSource( "musrmsr2data.xpm" ), tr( "&Msr2Data" ), ALT + Key_M, this, "musrMsr2Data" );
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( musrMsr2Data() ) );
|
||||
a->addTo( tb );
|
||||
a->addTo( menu );
|
||||
|
||||
@ -939,36 +939,76 @@ void PTextEdit::musrFit()
|
||||
fitOutputHandler.setModal(true);
|
||||
fitOutputHandler.exec();
|
||||
|
||||
musrSwapMsrMlog();
|
||||
// handle the reloading of the files
|
||||
|
||||
// get current file name
|
||||
QString currentFileName = *fFilenames.find( currentEditor() );
|
||||
QString complementFileName;
|
||||
// check if it is a msr-, mlog-, or another file
|
||||
int idx;
|
||||
if ((idx = currentFileName.find(".msr")) > 0) { // msr-file
|
||||
complementFileName = currentFileName;
|
||||
complementFileName.replace(idx, 5, ".mlog");
|
||||
} else if ((idx = currentFileName.find(".mlog")) > 0) { // mlog-file
|
||||
complementFileName = currentFileName;
|
||||
complementFileName.replace(idx, 5, ".msr ");
|
||||
complementFileName = complementFileName.stripWhiteSpace();
|
||||
} else { // neither a msr- nor a mlog-file
|
||||
QMessageBox::information( this, "musrFit",
|
||||
"This is neither a msr- nor a mlog-file, hence no idea what to be done.\n",
|
||||
QMessageBox::Ok );
|
||||
return;
|
||||
}
|
||||
|
||||
int currentIdx = fTabWidget->currentPageIndex();
|
||||
|
||||
// reload current file
|
||||
fileClose();
|
||||
load(currentFileName);
|
||||
|
||||
// check if swap file is open as well, and if yes, reload it
|
||||
idx = -1;
|
||||
for (int i=0; i<fTabWidget->count(); i++) {
|
||||
if (fTabWidget->label(i).find(complementFileName) >= 0) {
|
||||
idx = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (idx >= 0) { // complement file is open
|
||||
fTabWidget->setCurrentPage(idx);
|
||||
fileClose();
|
||||
load(complementFileName);
|
||||
fTabWidget->setCurrentPage(currentIdx);
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::musrMlog2Db()
|
||||
void PTextEdit::musrMsr2Data()
|
||||
{
|
||||
if ( !currentEditor() )
|
||||
return;
|
||||
|
||||
if (fMlog2DbDataSet == 0) {
|
||||
fMlog2DbDataSet = new PMlog2DbDataSet();
|
||||
// init fMlog2DbDataSet
|
||||
fMlog2DbDataSet->firstRun = -1;
|
||||
fMlog2DbDataSet->lastRun = -1;
|
||||
fMlog2DbDataSet->runList = QString("");
|
||||
fMlog2DbDataSet->runListFileName = QString("");
|
||||
fMlog2DbDataSet->msrFileExtension = QString("");
|
||||
fMlog2DbDataSet->templateRunNo = -1;
|
||||
fMlog2DbDataSet->dbOutputFileName = QString("");
|
||||
fMlog2DbDataSet->writeDbHeader = false;
|
||||
fMlog2DbDataSet->summaryFilePresent = false;
|
||||
fMlog2DbDataSet->keepMinuit2Output = fKeepMinuit2Output;
|
||||
fMlog2DbDataSet->writeColumnData = false;
|
||||
fMlog2DbDataSet->recreateDbFile = false;
|
||||
if (fMsr2DataParam == 0) {
|
||||
fMsr2DataParam = new PMsr2DataParam();
|
||||
// init fMsr2DataParam
|
||||
fMsr2DataParam->firstRun = -1;
|
||||
fMsr2DataParam->lastRun = -1;
|
||||
fMsr2DataParam->runList = QString("");
|
||||
fMsr2DataParam->runListFileName = QString("");
|
||||
fMsr2DataParam->msrFileExtension = QString("");
|
||||
fMsr2DataParam->templateRunNo = -1;
|
||||
fMsr2DataParam->dbOutputFileName = QString("");
|
||||
fMsr2DataParam->writeDbHeader = false;
|
||||
fMsr2DataParam->summaryFilePresent = false;
|
||||
fMsr2DataParam->keepMinuit2Output = fKeepMinuit2Output;
|
||||
fMsr2DataParam->writeColumnData = false;
|
||||
fMsr2DataParam->recreateDbFile = false;
|
||||
}
|
||||
|
||||
PMlog2DbDialog *dlg = new PMlog2DbDialog(fMlog2DbDataSet);
|
||||
PMsr2DataDialog *dlg = new PMsr2DataDialog(fMsr2DataParam);
|
||||
|
||||
if (dlg->exec() == QDialog::Accepted) {
|
||||
QString first, last;
|
||||
@ -978,7 +1018,7 @@ void PTextEdit::musrMlog2Db()
|
||||
QString str;
|
||||
int i, end;
|
||||
|
||||
fMlog2DbDataSet = dlg->getMlog2DbDataSet();
|
||||
fMsr2DataParam = dlg->getMsr2DataParam();
|
||||
|
||||
// analyze parameters
|
||||
switch (dlg->getRunTag()) {
|
||||
@ -989,8 +1029,8 @@ void PTextEdit::musrMlog2Db()
|
||||
return;
|
||||
break;
|
||||
case 0: // first last
|
||||
first = QString("%1").arg(fMlog2DbDataSet->firstRun);
|
||||
last = QString("%1").arg(fMlog2DbDataSet->lastRun);
|
||||
first = QString("%1").arg(fMsr2DataParam->firstRun);
|
||||
last = QString("%1").arg(fMsr2DataParam->lastRun);
|
||||
if (first.isEmpty() || last.isEmpty()) {
|
||||
QMessageBox::critical(this, "**ERROR**",
|
||||
"If you choose the first/last option,\nfirst AND last needs to be provided.",
|
||||
@ -999,7 +1039,7 @@ void PTextEdit::musrMlog2Db()
|
||||
}
|
||||
break;
|
||||
case 1: // run list
|
||||
runList = fMlog2DbDataSet->runList;
|
||||
runList = fMsr2DataParam->runList;
|
||||
if (!validRunList(runList)) {
|
||||
QMessageBox::critical(this, "**ERROR**",
|
||||
"Invalid Run List!\nThe run list needs to be a space separated list of run numbers.",
|
||||
@ -1008,7 +1048,7 @@ void PTextEdit::musrMlog2Db()
|
||||
}
|
||||
break;
|
||||
case 2: // run list file name
|
||||
runListFileName = fMlog2DbDataSet->runListFileName;
|
||||
runListFileName = fMsr2DataParam->runListFileName;
|
||||
fi = runListFileName;
|
||||
if (!fi.exists()) {
|
||||
str = QString("Run List File '%1' doesn't exist.").arg(runListFileName);
|
||||
@ -1027,7 +1067,7 @@ void PTextEdit::musrMlog2Db()
|
||||
|
||||
// form command
|
||||
QValueVector<QString> cmd;
|
||||
str = fAdmin->getExecPath() + "/mlog2db";
|
||||
str = fAdmin->getExecPath() + "/msr2data";
|
||||
cmd.append(str);
|
||||
|
||||
// run list argument
|
||||
@ -1064,7 +1104,7 @@ void PTextEdit::musrMlog2Db()
|
||||
}
|
||||
|
||||
// file extension
|
||||
str = fMlog2DbDataSet->msrFileExtension;
|
||||
str = fMsr2DataParam->msrFileExtension;
|
||||
if (str.isEmpty())
|
||||
cmd.append("");
|
||||
else
|
||||
@ -1073,55 +1113,50 @@ void PTextEdit::musrMlog2Db()
|
||||
// options
|
||||
|
||||
// no header flag?
|
||||
if (!fMlog2DbDataSet->writeDbHeader)
|
||||
if (!fMsr2DataParam->writeDbHeader)
|
||||
cmd.append("noheader");
|
||||
|
||||
// no summary flag?
|
||||
if (!fMlog2DbDataSet->summaryFilePresent)
|
||||
if (!fMsr2DataParam->summaryFilePresent)
|
||||
cmd.append("nosummary");
|
||||
|
||||
// template run no
|
||||
if (fMlog2DbDataSet->templateRunNo != -1) {
|
||||
str = QString("%1").arg(fMlog2DbDataSet->templateRunNo);
|
||||
if (fMsr2DataParam->templateRunNo != -1) {
|
||||
str = QString("%1").arg(fMsr2DataParam->templateRunNo);
|
||||
str = "fit-" + str;
|
||||
cmd.append(str);
|
||||
}
|
||||
|
||||
// keep minuit2 output
|
||||
if (fMlog2DbDataSet->keepMinuit2Output) {
|
||||
if (fMsr2DataParam->keepMinuit2Output) {
|
||||
cmd.append("-k");
|
||||
}
|
||||
|
||||
// DB output wished
|
||||
if (!fMlog2DbDataSet->dbOutputFileName.isEmpty()) {
|
||||
str = "-o" + fMlog2DbDataSet->dbOutputFileName;
|
||||
if (!fMsr2DataParam->dbOutputFileName.isEmpty()) {
|
||||
str = "-o" + fMsr2DataParam->dbOutputFileName;
|
||||
cmd.append(str);
|
||||
}
|
||||
|
||||
// write column data
|
||||
if (fMlog2DbDataSet->writeColumnData) {
|
||||
if (fMsr2DataParam->writeColumnData) {
|
||||
cmd.append("data");
|
||||
}
|
||||
|
||||
// recreate db file
|
||||
if (fMlog2DbDataSet->recreateDbFile) {
|
||||
if (!QFile::remove(fMlog2DbDataSet->dbOutputFileName)) {
|
||||
str = QString("Couldn't delete db-file '%1'. Will **NOT** proceed.").arg(fMlog2DbDataSet->dbOutputFileName);
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
// add the swap flag
|
||||
cmd.append("-s");
|
||||
|
||||
/*
|
||||
for (unsigned int i=0; i<cmd.size(); i++) {
|
||||
cout << endl << ">> " << cmd[i].latin1();
|
||||
}
|
||||
cout << endl;
|
||||
*/
|
||||
|
||||
PFitOutputHandler fitOutputHandler(cmd);
|
||||
fitOutputHandler.setModal(true);
|
||||
@ -1242,6 +1277,8 @@ void PTextEdit::musrSwapMsrMlog()
|
||||
cmd = QString("rm ") + tempFileName;
|
||||
system(cmd.latin1());
|
||||
|
||||
int currentIdx = fTabWidget->currentPageIndex();
|
||||
|
||||
// reload current file
|
||||
fileClose();
|
||||
load(currentFileName);
|
||||
@ -1255,7 +1292,6 @@ void PTextEdit::musrSwapMsrMlog()
|
||||
}
|
||||
}
|
||||
if (idx >= 0) { // swap file is open
|
||||
int currentIdx = fTabWidget->currentPageIndex();
|
||||
fTabWidget->setCurrentPage(idx);
|
||||
fileClose();
|
||||
load(swapFileName);
|
||||
|
@ -88,7 +88,7 @@ private slots:
|
||||
void musrGetSingleHistoDefault();
|
||||
void musrCalcChisq();
|
||||
void musrFit();
|
||||
void musrMlog2Db();
|
||||
void musrMsr2Data();
|
||||
void musrView();
|
||||
void musrT0();
|
||||
void musrPrefs();
|
||||
@ -107,7 +107,7 @@ private:
|
||||
bool fKeepMinuit2Output;
|
||||
int fDump;
|
||||
|
||||
PMlog2DbDataSet *fMlog2DbDataSet;
|
||||
PMsr2DataParam *fMsr2DataParam;
|
||||
|
||||
QComboBox *fComboFont;
|
||||
QComboBox *fComboSize;
|
||||
|
@ -1,8 +1,8 @@
|
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
||||
<class>PMlog2DbDialogBase</class>
|
||||
<class>PMsr2DataDialogBase</class>
|
||||
<widget class="QDialog">
|
||||
<property name="name">
|
||||
<cstring>PMlog2DbDialogBase</cstring>
|
||||
<cstring>PMsr2DataDialogBase</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
@ -551,37 +551,37 @@
|
||||
<connection>
|
||||
<sender>fOk_button</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>PMlog2DbDialogBase</receiver>
|
||||
<receiver>PMsr2DataDialogBase</receiver>
|
||||
<slot>accept()</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>fCancel_button</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>PMlog2DbDialogBase</receiver>
|
||||
<receiver>PMsr2DataDialogBase</receiver>
|
||||
<slot>reject()</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>fFirst_lineEdit</sender>
|
||||
<signal>textChanged(const QString&)</signal>
|
||||
<receiver>PMlog2DbDialogBase</receiver>
|
||||
<receiver>PMsr2DataDialogBase</receiver>
|
||||
<slot>runFirstLastEntered()</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>fLast_lineEdit</sender>
|
||||
<signal>textChanged(const QString&)</signal>
|
||||
<receiver>PMlog2DbDialogBase</receiver>
|
||||
<receiver>PMsr2DataDialogBase</receiver>
|
||||
<slot>runFirstLastEntered()</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>fRunList_lineEdit</sender>
|
||||
<signal>textChanged(const QString&)</signal>
|
||||
<receiver>PMlog2DbDialogBase</receiver>
|
||||
<receiver>PMsr2DataDialogBase</receiver>
|
||||
<slot>runListEntered()</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>fRunListFileName_lineEdit</sender>
|
||||
<signal>textChanged(const QString&)</signal>
|
||||
<receiver>PMlog2DbDialogBase</receiver>
|
||||
<receiver>PMsr2DataDialogBase</receiver>
|
||||
<slot>runListFileNameEntered()</slot>
|
||||
</connection>
|
||||
</connections>
|
@ -47,6 +47,6 @@ typedef struct {
|
||||
bool keepMinuit2Output;
|
||||
bool writeColumnData;
|
||||
bool recreateDbFile;
|
||||
} PMlog2DbDataSet;
|
||||
} PMsr2DataParam;
|
||||
|
||||
#endif // _MUSRGUI_H_
|
||||
|
@ -27,7 +27,7 @@ HEADERS = musrgui.h \
|
||||
PGetSingleHistoRunBlockDialog.h \
|
||||
PGetNonMusrRunBlockDialog.h \
|
||||
PGetFourierDialog.h \
|
||||
PMlog2DbDialog.h \
|
||||
PMsr2DataDialog.h \
|
||||
PGetPlotDialog.h
|
||||
|
||||
SOURCES = PTextEdit.cpp \
|
||||
@ -44,7 +44,7 @@ SOURCES = PTextEdit.cpp \
|
||||
PGetNonMusrRunBlockDialog.cpp \
|
||||
PGetFourierDialog.cpp \
|
||||
PGetPlotDialog.cpp \
|
||||
PMlog2DbDialog.cpp \
|
||||
PMsr2DataDialog.cpp \
|
||||
main.cpp
|
||||
|
||||
FORMS = forms/PGetDefaultDialogBase.ui \
|
||||
@ -59,7 +59,7 @@ FORMS = forms/PGetDefaultDialogBase.ui \
|
||||
forms/PGetNonMusrRunBlockDialogBase.ui \
|
||||
forms/PGetFourierDialogBase.ui \
|
||||
forms/PGetPlotDialogBase.ui \
|
||||
forms/PMlog2DbDialogBase.ui
|
||||
forms/PMsr2DataDialogBase.ui
|
||||
|
||||
IMAGES = images/editcopy.xpm \
|
||||
images/editcut.xpm \
|
||||
@ -74,7 +74,7 @@ IMAGES = images/editcopy.xpm \
|
||||
images/musrsinglehisto.xpm \
|
||||
images/musrcalcchisq.xpm \
|
||||
images/musrfit.xpm \
|
||||
images/musrmlog2db.xpm \
|
||||
images/musrmsr2data.xpm \
|
||||
images/musrview.xpm \
|
||||
images/musrt0.xpm \
|
||||
images/musrprefs.xpm \
|
||||
|
Loading…
x
Reference in New Issue
Block a user