add a switch to musrview that it plots initially the Fouier data rather than the time domain data.

This commit is contained in:
2015-02-20 12:22:24 +01:00
parent c971aac129
commit 7be8b4c2ea
12 changed files with 128 additions and 56 deletions

View File

@ -85,6 +85,8 @@ bool PAdminXMLParser::startElement( const QString&, const QString&,
fKeyWord = eDefaultSavePath;
} else if (qName == "title_from_data_file") {
fKeyWord = eTitleFromDataFile;
} else if (qName == "musrview_show_fourier") {
fKeyWord = eMusrviewShowFourier;
} else if (qName == "enable_musrt0") {
fKeyWord = eEnableMusrT0;
} else if (qName == "keep_minuit2_output") {
@ -242,6 +244,13 @@ bool PAdminXMLParser::characters(const QString& str)
flag = false;
fAdmin->setTitleFromDataFileFlag(flag);
break;
case eMusrviewShowFourier:
if (str == "y")
flag = true;
else
flag = false;
fAdmin->setMusrviewShowFourierFlag(flag);
break;
case eEnableMusrT0:
if (str == "y")
flag = true;
@ -603,6 +612,8 @@ PAdmin::PAdmin() : QObject()
fInstitute = QString("");
fFileFormat = QString("");
fMusrviewShowFourier = false;
fTitleFromDataFile = false;
fEnableMusrT0 = false;
fLifetimeCorrection = true;

View File

@ -69,7 +69,7 @@ class PAdminXMLParser : public QXmlDefaultHandler
private:
enum EAdminKeyWords {eEmpty, eTimeout, eKeepMinuit2Output, eDumpAscii, eDumpRoot,
eTitleFromDataFile, eChisqPreRunBlock, eEstimateN0, eEnableMusrT0,
eTitleFromDataFile, eChisqPreRunBlock, eEstimateN0, eMusrviewShowFourier, eEnableMusrT0,
eFontName, eFontSize, eExecPath, eDefaultSavePath,
eRecentFile, eBeamline, eInstitute, eFileFormat, eLifetimeCorrection, eMsrDefaultFilePath,
eTheoFuncPixmapPath, eFunc, eFuncName, eFuncComment, eFuncLabel,
@ -118,6 +118,7 @@ class PAdmin : public QObject
QString getExecPath() { return fExecPath; }
QString getDefaultSavePath() { return fDefaultSavePath; }
bool getTitleFromDataFileFlag() { return fTitleFromDataFile; }
bool getMusrviewShowFourierFlag() { return fMusrviewShowFourier; }
bool getEnableMusrT0Flag() { return fEnableMusrT0; }
bool getKeepMinuit2OutputFlag() { return fKeepMinuit2Output; }
bool getDumpAsciiFlag() { return fDumpAscii; }
@ -139,6 +140,7 @@ class PAdmin : public QObject
void setTimeout(const int ival) { fTimeout = ival; }
void setTitleFromDataFileFlag(const bool flag) { fTitleFromDataFile = flag; }
void setMusrviewShowFourierFlag(const bool flag) { fMusrviewShowFourier = flag; }
void setEnableMusrT0Flag(const bool flag) { fEnableMusrT0 = flag; }
void setKeepMinuit2OutputFlag(const bool flag) { fKeepMinuit2Output = flag; }
void setDumpAsciiFlag(const bool flag) { fDumpAscii = flag; }
@ -180,13 +182,14 @@ class PAdmin : public QObject
QVector<QString> fRecentFile; ///< keep vector of recent path-file names
bool fKeepMinuit2Output; ///< flag indicating if the Minuit2 output shall be kept (default: no)
bool fDumpAscii; ///< flag indicating if musrfit shall make an ascii-dump file (for debugging purposes, default: no).
bool fDumpRoot; ///< flag indicating if musrfit shall make an root-dump file (for debugging purposes, default: no).
bool fTitleFromDataFile; ///< flag indicating if the title should be extracted from the data file (default: yes).
bool fChisqPreRunBlock; ///< flag indicating if musrfit shall write 'per run block' chisq to the msr-file (default: no).
bool fEstimateN0; ///< flag indicating if musrfit shall estimate N0 for single histogram fits (default: yes).
bool fEnableMusrT0; ///< flag indicating if musrT0 shall be enabled at startup from within musredit (default: yes).
bool fMusrviewShowFourier; ///< flag indicating if musrview should show at startup data (=false) or Fourier of data (=true).
bool fKeepMinuit2Output; ///< flag indicating if the Minuit2 output shall be kept (default: no)
bool fDumpAscii; ///< flag indicating if musrfit shall make an ascii-dump file (for debugging purposes, default: no).
bool fDumpRoot; ///< flag indicating if musrfit shall make an root-dump file (for debugging purposes, default: no).
bool fTitleFromDataFile; ///< flag indicating if the title should be extracted from the data file (default: yes).
bool fChisqPreRunBlock; ///< flag indicating if musrfit shall write 'per run block' chisq to the msr-file (default: no).
bool fEstimateN0; ///< flag indicating if musrfit shall estimate N0 for single histogram fits (default: yes).
bool fEnableMusrT0; ///< flag indicating if musrT0 shall be enabled at startup from within musredit (default: yes).
QString fBeamline; ///< name of the beamline. Used to generate default run header lines.
QString fInstitute; ///< name of the institute. Used to generate default run header lines.

View File

@ -61,6 +61,7 @@ PPrefsDialog::PPrefsDialog(PAdmin *admin) : fAdmin(admin)
fEnableMusrT0_checkBox->setChecked(fAdmin->getEnableMusrT0Flag());
fPerRunBlockChisq_checkBox->setChecked(fAdmin->getChisqPerRunBlockFlag());
fEstimateN0_checkBox->setChecked(fAdmin->getEstimateN0Flag());
fFourier_checkBox->setChecked(fAdmin->getMusrviewShowFourierFlag());
fTimeout_lineEdit->setText(QString("%1").arg(fAdmin->getTimeout()));
fTimeout_lineEdit->setValidator(new QIntValidator(fTimeout_lineEdit));

View File

@ -46,6 +46,7 @@ class PPrefsDialog : public QDialog, private Ui::PPrefsDialog
public:
PPrefsDialog(PAdmin *admin);
bool getMusrviewShowFourierFlag() { return fFourier_checkBox->isChecked(); }
bool getKeepMinuit2OutputFlag() { return fKeepMn2Output_checkBox->isChecked(); }
bool getTitleFromDataFileFlag() { return fTitleFromData_checkBox->isChecked(); }
bool getEnableMusrT0Flag() { return fEnableMusrT0_checkBox->isChecked(); }

View File

@ -2191,7 +2191,10 @@ void PTextEdit::musrView()
str = *fFilenames.find( currentEditor() );
QString numStr;
numStr.setNum(fAdmin->getTimeout());
cmd += str + "\" --timeout " + numStr + " &";
cmd += str + "\" --timeout " + numStr;
if (fAdmin->getMusrviewShowFourierFlag())
cmd += " -f ";
cmd += " &";
int status=system(cmd.toLatin1());
}
@ -2272,6 +2275,7 @@ void PTextEdit::musrPrefs()
}
if (dlg->exec() == QDialog::Accepted) {
fAdmin->setMusrviewShowFourierFlag(dlg->getMusrviewShowFourierFlag());
fAdmin->setKeepMinuit2OutputFlag(dlg->getKeepMinuit2OutputFlag());
fAdmin->setTitleFromDataFileFlag(dlg->getTitleFromDataFileFlag());
fAdmin->setEnableMusrT0Flag(dlg->getEnableMusrT0Flag());

View File

@ -33,9 +33,9 @@
<item>
<widget class="QTabWidget" name="fTabWidget">
<property name="currentIndex">
<number>1</number>
<number>0</number>
</property>
<widget class="QWidget" name="tab_3">
<widget class="QWidget" name="fGeneral_tab">
<attribute name="title">
<string>general</string>
</attribute>
@ -75,7 +75,7 @@
</layout>
</widget>
</widget>
<widget class="QWidget" name="tab">
<widget class="QWidget" name="fMusrfit_tab">
<attribute name="title">
<string>musrfit</string>
</attribute>
@ -158,7 +158,25 @@
</property>
</widget>
</widget>
<widget class="QWidget" name="tab_2">
<widget class="QWidget" name="fMusrview_tab">
<attribute name="title">
<string>musrview</string>
</attribute>
<widget class="QCheckBox" name="fFourier_checkBox">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>141</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>start with Fourier</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="fMusrt0_tab">
<attribute name="title">
<string>musrt0</string>
</attribute>