changed default behavior. Now musredit will create a musredit_startup.xml default file at run-time if none is found.

This commit is contained in:
suter_a 2017-02-15 09:32:58 +01:00
parent bcbed139f9
commit a17abc952b
9 changed files with 650 additions and 541 deletions

View File

@ -1263,8 +1263,6 @@ AC_CONFIG_FILES([Makefile \
src/musredit_qt5/Makefile \ src/musredit_qt5/Makefile \
src/musredit/Makefile \ src/musredit/Makefile \
src/musrgui/Makefile \ src/musrgui/Makefile \
src/musredit_qt5/musredit_startup.xml \
src/musredit/musredit_startup.xml \
src/musrgui/musrgui_startup.xml]) src/musrgui/musrgui_startup.xml])
AC_OUTPUT AC_OUTPUT
@ -1425,3 +1423,15 @@ echo " Programs: ${INSTALLDIR}/bin"
echo " XML configuration files: ${HOME}/.musrfit" echo " XML configuration files: ${HOME}/.musrfit"
echo " Documentation: ${DOCDIR}" echo " Documentation: ${DOCDIR}"
echo "" echo ""
dnl --------------
dnl create header file that musredit knows at runtime where to find the documentation
dnl --------------
if test "x$enable_editor" != "xno" && test "x${QMAKEBIN}" != "x" && test "x${QTEDITOR}" = "xmusredit_qt5"; then
echo \#define MUSRFIT_PREFIX \"${INSTALLDIR}\" > src/musredit_qt5/musrfit-info.h
echo \#define MUSRFIT_DOC_DIR \"${DOCDIR}\" >> src/musredit_qt5/musrfit-info.h
fi
if test "x$enable_editor" != "xno" && test "x${QMAKEBIN}" != "x" && test "x${QTEDITOR}" = "xmusredit"; then
echo \#define MUSRFIT_PREFIX \"${INSTALLDIR}\" > src/musredit/musrfit-info.h
echo \#define MUSRFIT_DOC_DIR \"${DOCDIR}\" >> src/musredit/musrfit-info.h
fi

View File

@ -36,7 +36,10 @@ using namespace std;
#include <QFile> #include <QFile>
#include <QTextStream> #include <QTextStream>
#include <QVector> #include <QVector>
#include <QDir>
#include <QProcessEnvironment>
#include "musrfit-info.h"
#include "PAdmin.h" #include "PAdmin.h"
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
@ -578,13 +581,21 @@ QString PAdminXMLParser::expandPath(const QString &str)
QString msg; QString msg;
QString newStr=""; QString newStr="";
QProcessEnvironment procEnv = QProcessEnvironment::systemEnvironment();
QStringList list = str.split("/"); QStringList list = str.split("/");
for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) { for ( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) {
token = *it; token = *it;
if (token.contains("$")) { if (token.contains("$")) {
token.remove('$'); token.remove('$');
path = std::getenv(token.toLatin1()); if (!procEnv.contains(token)) {
msg = QString("Couldn't find '%1'. Some things might not work properly").arg(token);
QMessageBox::warning(0, "**WARNING**", msg, QMessageBox::Ok, QMessageBox::NoButton);
newStr = "";
break;
}
path = procEnv.value(token, "");
if (path.isEmpty()) { if (path.isEmpty()) {
msg = QString("Couldn't expand '%1'. Some things might not work properly").arg(token); msg = QString("Couldn't expand '%1'. Some things might not work properly").arg(token);
QMessageBox::warning(0, "**WARNING**", msg, QMessageBox::Ok, QMessageBox::NoButton); QMessageBox::warning(0, "**WARNING**", msg, QMessageBox::Ok, QMessageBox::NoButton);
@ -658,18 +669,25 @@ PAdmin::PAdmin() : QObject()
QString path = QString("./"); QString path = QString("./");
QString fln = QString("musredit_startup.xml"); QString fln = QString("musredit_startup.xml");
QString pathFln = path + fln; QString pathFln = path + fln;
QProcessEnvironment procEnv = QProcessEnvironment::systemEnvironment();
if (!QFile::exists(pathFln)) { if (!QFile::exists(pathFln)) {
// 2nd: check $HOME/.musrfit/musredit/musredit_startup.xml // 2nd: check $HOME/.musrfit/musredit/musredit_startup.xml
path = std::getenv("HOME"); path = procEnv.value("HOME", "");
pathFln = path + "/.musrfit/musredit/" + fln; pathFln = path + "/.musrfit/musredit/" + fln;
if (!QFile::exists(pathFln)) { if (!QFile::exists(pathFln)) {
// 3rd: check $MUSRFITPATH/musredit_startup.xml // 3rd: check $MUSRFITPATH/musredit_startup.xml
path = std::getenv("MUSRFITPATH"); path = procEnv.value("MUSRFITPATH", "");
pathFln = path + "/" + fln; pathFln = path + "/" + fln;
if (!QFile::exists(pathFln)) { if (!QFile::exists(pathFln)) {
// 4th: check $ROOTSYS/bin/musredit_startup.xml // 4th: check $ROOTSYS/bin/musredit_startup.xml
path = std::getenv("ROOTSYS"); path = procEnv.value("ROOTSYS", "");
pathFln = path + "/bin/" + fln; pathFln = path + "/bin/" + fln;
if (!QFile::exists(pathFln)) {
// 5th: not found anyware hence create it
path = procEnv.value("HOME", "");
pathFln = path + "/.musrfit/musredit/" + fln;
createMusreditStartupFile();
}
} }
} }
} }
@ -861,6 +879,12 @@ int PAdmin::savePrefs(QString pref_fln)
else else
data[i] = " <enable_musrt0>n</enable_musrt0>"; data[i] = " <enable_musrt0>n</enable_musrt0>";
} }
if (data[i].contains("<font_name>") && data[i].contains("</font_name>")) {
data[i] = QString(" <font_name>%1</font_name>").arg(fFontName);
}
if (data[i].contains("<font_size>") && data[i].contains("</font_size>")) {
data[i] = QString(" <font_size>%1</font_size>").arg(fFontSize);
}
} }
// write prefs // write prefs
@ -910,6 +934,7 @@ void PAdmin::saveRecentFiles()
{ {
// check if musredit_startup.xml is present in the current directory, and if yes, use this file to // check if musredit_startup.xml is present in the current directory, and if yes, use this file to
// save the recent file names otherwise use the "master" musredit_startup.xml // save the recent file names otherwise use the "master" musredit_startup.xml
QString str(""); QString str("");
QString fln = QString("./musredit_startup.xml"); QString fln = QString("./musredit_startup.xml");
if (!QFile::exists(fln)) if (!QFile::exists(fln))
@ -967,6 +992,302 @@ void PAdmin::saveRecentFiles()
} }
} }
//--------------------------------------------------------------------------
/**
* @brief PAdmin::createMusreditStartupFile
*/
void PAdmin::createMusreditStartupFile()
{
// get $HOME
QProcessEnvironment procEnv = QProcessEnvironment::systemEnvironment();
QString pathName = procEnv.value("HOME", "");
pathName += "/.musrfit/musredit";
// check if the directory $HOME/.musrfit/musredit exists if not create it
QDir dir(pathName);
if (!dir.exists()) {
// directory $HOME/.musrfit/musredit does not exist hence create it
dir.mkpath(pathName);
}
// create default musredit_startup.xml file in $HOME/.musrfit/musredit
pathName += "/musredit_startup.xml";
QFile file(pathName);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
return;
QTextStream fout(&file);
fout << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
fout << "<musredit_startup xmlns=\"http://lmu.web.psi.ch/musrfit/user/MUSR/MusrGui.html\">" << endl;
fout << " <comment>" << endl;
fout << " This is handling default setting parameters for the musredit." << endl;
fout << " </comment>" << endl;
fout << " <general>" << endl;
fout << " <exec_path>" << MUSRFIT_PREFIX << "/bin</exec_path>" << endl;
fout << " <default_save_path>./</default_save_path>" << endl;
fout << " <msr_default_file_path>" << MUSRFIT_DOC_DIR << "/templates</msr_default_file_path>" << endl;
fout << " <timeout>3600</timeout>" << endl;
fout << " <keep_minuit2_output>n</keep_minuit2_output>" << endl;
fout << " <dump_ascii>n</dump_ascii>" << endl;
fout << " <dump_root>n</dump_root>" << endl;
fout << " <title_from_data_file>y</title_from_data_file>" << endl;
fout << " <chisq_per_run_block>n</chisq_per_run_block>" << endl;
fout << " <estimate_n0>y</estimate_n0>" << endl;
fout << " <musrview_show_fourier>n</musrview_show_fourier>" << endl;
fout << " <musrview_show_avg>n</musrview_show_avg>" << endl;
fout << " <enable_musrt0>y</enable_musrt0>" << endl;
fout << " </general>" << endl;
fout << " <recent_files>" << endl;
fout << " <path_file_name>" << MUSRFIT_DOC_DIR << "/examples/test-histo-PSI-BIN.msr</path_file_name>" << endl;
fout << " </recent_files>" << endl;
fout << " <help_section>" << endl;
fout << " <musr_web_main>file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html</musr_web_main>" << endl;
fout << " <musr_web_title>file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheTitle</musr_web_title>" << endl;
fout << " <musr_web_parameters>file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheFitparameterBlock</musr_web_parameters>" << endl;
fout << " <musr_web_theory>file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheTheoryBlock</musr_web_theory>" << endl;
fout << " <musr_web_functions>file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheFunctionsBlock</musr_web_functions>" << endl;
fout << " <musr_web_run>file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheRunBlock</musr_web_run>" << endl;
fout << " <musr_web_command>file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheCommandsBlock</musr_web_command>" << endl;
fout << " <musr_web_fourier>file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheFourierBlock</musr_web_fourier>" << endl;
fout << " <musr_web_plot>file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#ThePlotBlock</musr_web_plot>" << endl;
fout << " <musr_web_statistic>file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheStatisticBlock</musr_web_statistic>" << endl;
fout << " <musr_web_msr2data>file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/Msr2Data.html</musr_web_msr2data>" << endl;
fout << " <musr_web_musrFT>file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#A_2.3_musrFT</musr_web_musrFT>" << endl;
fout << " </help_section>" << endl;
fout << " <font_settings>" << endl;
#ifdef Q_OS_MAC
fout << " <font_name>Courier New</font_name>" << endl;
fout << " <font_size>16</font_size>" << endl;
#else
fout << " <font_name>Monospace</font_name>" << endl;
fout << " <font_size>12</font_size>" << endl;
#endif
fout << " </font_settings>" << endl;
fout << " <msr_file_defaults>" << endl;
fout << " <beamline>mue4</beamline>" << endl;
fout << " <institute>psi</institute>" << endl;
fout << " <file_format>root-npp</file_format>" << endl;
fout << " <lifetime_correction>y</lifetime_correction>" << endl;
fout << " </msr_file_defaults>" << endl;
fout << " <msr2data_defaults>" << endl;
fout << " <chain_fit>y</chain_fit>" << endl;
fout << " <write_data_header>y</write_data_header>" << endl;
fout << " <ignore_data_header_info>n</ignore_data_header_info>" << endl;
fout << " <keep_minuit2_output>n</keep_minuit2_output>" << endl;
fout << " <write_column_data>n</write_column_data>" << endl;
fout << " <recreate_data_file>n</recreate_data_file>" << endl;
fout << " <open_file_after_fitting>y</open_file_after_fitting>" << endl;
fout << " <create_msr_file_only>n</create_msr_file_only>" << endl;
fout << " <fit_only>n</fit_only>" << endl;
fout << " <global>n</global>" << endl;
fout << " <global_plus>n</global_plus>" << endl;
fout << " </msr2data_defaults>" << endl;
fout << " <func_pixmap_path>" << MUSRFIT_DOC_DIR << "/latex_images</func_pixmap_path>" << endl;
fout << " <theory_functions>" << endl;
fout << " <func>" << endl;
fout << " <name>asymmetry</name>" << endl;
fout << " <comment></comment>" << endl;
fout << " <label>Asymmetry</label>" << endl;
fout << " <pixmap>asymmetry.png</pixmap>" << endl;
fout << " <params>1</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>simplExpo</name>" << endl;
fout << " <comment>(rate)</comment>" << endl;
fout << " <label>simple Exp</label>" << endl;
fout << " <pixmap>simpleExp.png</pixmap>" << endl;
fout << " <params>1</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>generExpo</name>" << endl;
fout << " <comment>(rate exponent)</comment>" << endl;
fout << " <label>general Exp</label>" << endl;
fout << " <pixmap>generalExp.png</pixmap>" << endl;
fout << " <params>2</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>simpleGss</name>" << endl;
fout << " <comment>(rate)</comment>" << endl;
fout << " <label>simple Gauss</label>" << endl;
fout << " <pixmap>simpleGauss.png</pixmap>" << endl;
fout << " <params>1</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>statGssKT</name>" << endl;
fout << " <comment>(rate)</comment>" << endl;
fout << " <label>static Gauss KT</label>" << endl;
fout << " <pixmap>statGssKT.png</pixmap>" << endl;
fout << " <params>1</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>statGssKTLF</name>" << endl;
fout << " <comment>(frequency damping)</comment>" << endl;
fout << " <label>static Gauss KT LF</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>2</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>dynGssKTLF</name>" << endl;
fout << " <comment>(frequency damping hopping-rate)</comment>" << endl;
fout << " <label>dynamic Gauss KT LF</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>3</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>statExpKT</name>" << endl;
fout << " <comment>(rate)</comment>" << endl;
fout << " <label>static Lorentz KT</label>" << endl;
fout << " <pixmap>statExpKT.png</pixmap>" << endl;
fout << " <params>1</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>statExpKTLF</name>" << endl;
fout << " <comment>(frequency damping)</comment>" << endl;
fout << " <label>static Lorentz KT LF</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>2</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>dynExpKTLF</name>" << endl;
fout << " <comment>(frequency damping hopping-rate)</comment>" << endl;
fout << " <label>dynamic Lorentz KT LF</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>3</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>combiLGKT</name>" << endl;
fout << " <comment>(lorentzRate gaussRate)</comment>" << endl;
fout << " <label>combined Lorentz-Gauss KT</label>" << endl;
fout << " <pixmap>combiLGKT.png</pixmap>" << endl;
fout << " <params>2</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>strKT</name>" << endl;
fout << " <comment>(rate beta)</comment>" << endl;
fout << " <label>stretched Kubo-Toyabe</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>2</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>spinGlass</name>" << endl;
fout << " <comment>(rate hopping-rate order)</comment>" << endl;
fout << " <label>zero field spin glass function</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>3</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>rdAnisoHf</name>" << endl;
fout << " <comment>(frequency rate)</comment>" << endl;
fout << " <label>random anisotropic hyperfine function</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>2</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>abragam</name>" << endl;
fout << " <comment>(rate hopping-rate)</comment>" << endl;
fout << " <label>Abragam</label>" << endl;
fout << " <pixmap>abragam.png</pixmap>" << endl;
fout << " <params>2</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>TFieldCos</name>" << endl;
fout << " <comment>(phase frequency)</comment>" << endl;
fout << " <label>TF cos</label>" << endl;
fout << " <pixmap>tfCos.png</pixmap>" << endl;
fout << " <params>2</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>internFld</name>" << endl;
fout << " <comment>(fraction phase frequency Trate Lrate)</comment>" << endl;
fout << " <label>internal Lorentz field</label>" << endl;
fout << " <pixmap>internalField.png</pixmap>" << endl;
fout << " <params>5</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>internFldGK</name>" << endl;
fout << " <comment>(fraction frequency Trate Lrate beta)</comment>" << endl;
fout << " <label>internal field, Gaussian broadened</label>" << endl;
fout << " <pixmap>internalFieldGK.png</pixmap>" << endl;
fout << " <params>5</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>internFldLL</name>" << endl;
fout << " <comment>(fraction frequency Trate Lrate)</comment>" << endl;
fout << " <label>internal field, Lorentzian broadened</label>" << endl;
fout << " <pixmap>internalFieldLL.png</pixmap>" << endl;
fout << " <params>4</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>bessel</name>" << endl;
fout << " <comment>(phase frequency)</comment>" << endl;
fout << " <label>spherical Bessel 0th order</label>" << endl;
fout << " <pixmap>bessel.png</pixmap>" << endl;
fout << " <params>2</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>internBsl</name>" << endl;
fout << " <comment>(fraction phase frequency Trate Lrate)</comment>" << endl;
fout << " <label>static internal Bessel</label>" << endl;
fout << " <pixmap>internalBessel.png</pixmap>" << endl;
fout << " <params>5</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>skewedGss</name>" << endl;
fout << " <comment>(phase frequency rate_m rate_p)</comment>" << endl;
fout << " <label>skewed Gaussian</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>4</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>staticNKZF</name>" << endl;
fout << " <comment>(damping_D0 R_b)</comment>" << endl;
fout << " <label>static Noakes-Kalvius ZF</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>2</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>staticNKTF</name>" << endl;
fout << " <comment>(phase frequency damping_D0 R_b)</comment>" << endl;
fout << " <label>static Noakes-Kalvius TF</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>4</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>dynamicNKZF</name>" << endl;
fout << " <comment>(damping_D0 R_b nu_c)</comment>" << endl;
fout << " <label>dynamic Noakes-Kalvius ZF</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>3</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>dynamicNKTF</name>" << endl;
fout << " <comment>(phase frequency damping_D0 R_b nu_c)</comment>" << endl;
fout << " <label>dynamic Noakes-Kalvius TF</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>5</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>polynom</name>" << endl;
fout << " <comment>(tshift p0 p1 ... pn)</comment>" << endl;
fout << " <label>polynom</label>" << endl;
fout << " <pixmap>polynom.png</pixmap>" << endl;
fout << " <params>4</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>userFcn</name>" << endl;
fout << " <comment></comment>" << endl;
fout << " <label>user function</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>0</params>" << endl;
fout << " </func>" << endl;
fout << " </theory_functions>" << endl;
fout << "</musredit_startup>" << endl;
file.close();
}
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// END // END
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------

View File

@ -209,6 +209,7 @@ class PAdmin : public QObject
QVector<PTheory> fTheory; ///< stores all known theories. Needed when generating theory blocks from within musredit. QVector<PTheory> fTheory; ///< stores all known theories. Needed when generating theory blocks from within musredit.
void saveRecentFiles(); ///< save recent file list void saveRecentFiles(); ///< save recent file list
void createMusreditStartupFile(); ///< create default musredit_startup.xml
}; };
#endif // _PADMIN_H_ #endif // _PADMIN_H_

View File

@ -1,10 +1,6 @@
TEMPLATE = app TEMPLATE = app
TARGET = musredit TARGET = musredit
!exists( musredit_startup.xml ) {
error( "Configuration file musredit_startup.xml not found! Please configure musrfit first, before trying to install musredit!" )
}
# install path for musredit # install path for musredit
count( PREFIX, 1 ) { count( PREFIX, 1 ) {
MUSREDIT_INSTALL_PATH = $${PREFIX}/bin MUSREDIT_INSTALL_PATH = $${PREFIX}/bin
@ -67,8 +63,6 @@ macx {
unix:xml.path = $$(HOME)/.musrfit/musredit unix:xml.path = $$(HOME)/.musrfit/musredit
macx:xml.path = $$(HOME)/.musrfit/musredit macx:xml.path = $$(HOME)/.musrfit/musredit
win32:xml.path = c:/musrfit/bin win32:xml.path = c:/musrfit/bin
xml.files = musredit_startup.xml
INSTALLS += xml
CONFIG += qt \ CONFIG += qt \
warn_on \ warn_on \
@ -78,7 +72,10 @@ QT += xml
QT += webkit QT += webkit
QT += network QT += network
INCLUDEPATH += "../include"
HEADERS = musredit.h \ HEADERS = musredit.h \
musrfit-info.h \
PHelp.h \ PHelp.h \
PTextEdit.h \ PTextEdit.h \
PSubTextEdit.h \ PSubTextEdit.h \
@ -101,7 +98,8 @@ HEADERS = musredit.h \
PGetFourierBlockDialog.h \ PGetFourierBlockDialog.h \
PGetPlotBlockDialog.h \ PGetPlotBlockDialog.h \
PMsr2DataDialog.h \ PMsr2DataDialog.h \
PMusrEditAbout.h PMusrEditAbout.h \
../include/git-revision.h
SOURCES = PHelp.cpp \ SOURCES = PHelp.cpp \
PTextEdit.cpp \ PTextEdit.cpp \

View File

@ -1,260 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<musredit_startup xmlns="http://lmu.web.psi.ch/musrfit/user/MUSR/MusrGui.html">
<comment>
This is handling default setting parameters for the musredit.
</comment>
<general>
<exec_path>@prefix@/bin</exec_path>
<default_save_path>./</default_save_path>
<msr_default_file_path>@DOCDIR@/templates</msr_default_file_path>
<timeout>3600</timeout>
<keep_minuit2_output>n</keep_minuit2_output>
<dump_ascii>n</dump_ascii>
<dump_root>n</dump_root>
<title_from_data_file>y</title_from_data_file>
<chisq_per_run_block>n</chisq_per_run_block>
<estimate_n0>y</estimate_n0>
<musrview_show_fourier>n</musrview_show_fourier>
<musrview_show_avg>n</musrview_show_avg>
<enable_musrt0>y</enable_musrt0>
</general>
<recent_files>
<path_file_name>/home/nemu/analysis/musrfit/doc/examples/test-histo-PSI-BIN.msr</path_file_name>
</recent_files>
<help_section>
<musr_web_main>file://@DOCDIR@/html/user/MUSR/MusrFit.html</musr_web_main>
<musr_web_title>file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheTitle</musr_web_title>
<musr_web_parameters>file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheFitparameterBlock</musr_web_parameters>
<musr_web_theory>file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheTheoryBlock</musr_web_theory>
<musr_web_functions>file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheFunctionsBlock</musr_web_functions>
<musr_web_run>file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheRunBlock</musr_web_run>
<musr_web_command>file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheCommandsBlock</musr_web_command>
<musr_web_fourier>file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheFourierBlock</musr_web_fourier>
<musr_web_plot>file://@DOCDIR@/html/user/MUSR/MusrFit.html#ThePlotBlock</musr_web_plot>
<musr_web_statistic>file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheStatisticBlock</musr_web_statistic>
<musr_web_msr2data>file://@DOCDIR@/html/user/MUSR/Msr2Data.html</musr_web_msr2data>
<musr_web_musrFT>file://@DOCDIR@/html/user/MUSR/MusrFit.html#A_2.3_musrFT</musr_web_musrFT>
</help_section>
<font_settings>
<font_name>Courier New</font_name>
<font_size>12</font_size>
</font_settings>
<msr_file_defaults>
<beamline>mue4</beamline>
<institute>psi</institute>
<file_format>root-npp</file_format>
<lifetime_correction>y</lifetime_correction>
</msr_file_defaults>
<msr2data_defaults>
<chain_fit>y</chain_fit>
<write_data_header>y</write_data_header>
<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>
<open_file_after_fitting>y</open_file_after_fitting>
<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>@DOCDIR@/latex_images</func_pixmap_path>
<theory_functions>
<func>
<name>asymmetry</name>
<comment></comment>
<label>Asymmetry</label>
<pixmap>asymmetry.png</pixmap>
<params>1</params>
</func>
<func>
<name>simplExpo</name>
<comment>(rate)</comment>
<label>simple Exp</label>
<pixmap>simpleExp.png</pixmap>
<params>1</params>
</func>
<func>
<name>generExpo</name>
<comment>(rate exponent)</comment>
<label>general Exp</label>
<pixmap>generalExp.png</pixmap>
<params>2</params>
</func>
<func>
<name>simpleGss</name>
<comment>(rate)</comment>
<label>simple Gauss</label>
<pixmap>simpleGauss.png</pixmap>
<params>1</params>
</func>
<func>
<name>statGssKT</name>
<comment>(rate)</comment>
<label>static Gauss KT</label>
<pixmap>statGssKT.png</pixmap>
<params>1</params>
</func>
<func>
<name>statGssKTLF</name>
<comment>(frequency damping)</comment>
<label>static Gauss KT LF</label>
<pixmap></pixmap>
<params>2</params>
</func>
<func>
<name>dynGssKTLF</name>
<comment>(frequency damping hopping-rate)</comment>
<label>dynamic Gauss KT LF</label>
<pixmap></pixmap>
<params>3</params>
</func>
<func>
<name>statExpKT</name>
<comment>(rate)</comment>
<label>static Lorentz KT</label>
<pixmap>statExpKT.png</pixmap>
<params>1</params>
</func>
<func>
<name>statExpKTLF</name>
<comment>(frequency damping)</comment>
<label>static Lorentz KT LF</label>
<pixmap></pixmap>
<params>2</params>
</func>
<func>
<name>dynExpKTLF</name>
<comment>(frequency damping hopping-rate)</comment>
<label>dynamic Lorentz KT LF</label>
<pixmap></pixmap>
<params>3</params>
</func>
<func>
<name>combiLGKT</name>
<comment>(lorentzRate gaussRate)</comment>
<label>combined Lorentz-Gauss KT</label>
<pixmap>combiLGKT.png</pixmap>
<params>2</params>
</func>
<func>
<name>strKT</name>
<comment>(rate beta)</comment>
<label>stretched Kubo-Toyabe</label>
<pixmap></pixmap>
<params>2</params>
</func>
<func>
<name>spinGlass</name>
<comment>(rate hopping-rate order)</comment>
<label>zero field spin glass function</label>
<pixmap></pixmap>
<params>3</params>
</func>
<func>
<name>rdAnisoHf</name>
<comment>(frequency rate)</comment>
<label>random anisotropic hyperfine function</label>
<pixmap></pixmap>
<params>2</params>
</func>
<func>
<name>abragam</name>
<comment>(rate hopping-rate)</comment>
<label>Abragam</label>
<pixmap>abragam.png</pixmap>
<params>2</params>
</func>
<func>
<name>TFieldCos</name>
<comment>(phase frequency)</comment>
<label>TF cos</label>
<pixmap>tfCos.png</pixmap>
<params>2</params>
</func>
<func>
<name>internFld</name>
<comment>(fraction phase frequency Trate Lrate)</comment>
<label>internal Lorentz field</label>
<pixmap>internalField.png</pixmap>
<params>5</params>
</func>
<func>
<name>internFldGK</name>
<comment>(fraction frequency Trate Lrate beta)</comment>
<label>internal field, Gaussian broadened</label>
<pixmap>internalFieldGK.png</pixmap>
<params>5</params>
</func>
<func>
<name>internFldLL</name>
<comment>(fraction frequency Trate Lrate)</comment>
<label>internal field, Lorentzian broadened</label>
<pixmap>internalFieldLL.png</pixmap>
<params>4</params>
</func>
<func>
<name>bessel</name>
<comment>(phase frequency)</comment>
<label>spherical Bessel 0th order</label>
<pixmap>bessel.png</pixmap>
<params>2</params>
</func>
<func>
<name>internBsl</name>
<comment>(fraction phase frequency Trate Lrate)</comment>
<label>static internal Bessel</label>
<pixmap>internalBessel.png</pixmap>
<params>5</params>
</func>
<func>
<name>skewedGss</name>
<comment>(phase frequency rate_m rate_p)</comment>
<label>skewed Gaussian</label>
<pixmap></pixmap>
<params>4</params>
</func>
<func>
<name>staticNKZF</name>
<comment>(damping_D0 R_b)</comment>
<label>static Noakes-Kalvius ZF</label>
<pixmap></pixmap>
<params>2</params>
</func>
<func>
<name>staticNKTF</name>
<comment>(phase frequency damping_D0 R_b)</comment>
<label>static Noakes-Kalvius TF</label>
<pixmap></pixmap>
<params>4</params>
</func>
<func>
<name>dynamicNKZF</name>
<comment>(damping_D0 R_b nu_c)</comment>
<label>dynamic Noakes-Kalvius ZF</label>
<pixmap></pixmap>
<params>3</params>
</func>
<func>
<name>dynamicNKTF</name>
<comment>(phase frequency damping_D0 R_b nu_c)</comment>
<label>dynamic Noakes-Kalvius TF</label>
<pixmap></pixmap>
<params>5</params>
</func>
<func>
<name>polynom</name>
<comment>(tshift p0 p1 ... pn)</comment>
<label>polynom</label>
<pixmap>polynom.png</pixmap>
<params>4</params>
</func>
<func>
<name>userFcn</name>
<comment></comment>
<label>user function</label>
<pixmap></pixmap>
<params>0</params>
</func>
</theory_functions>
</musredit_startup>

View File

@ -36,9 +36,10 @@ using namespace std;
#include <QFile> #include <QFile>
#include <QTextStream> #include <QTextStream>
#include <QVector> #include <QVector>
#include <QDir>
#include <QProcessEnvironment> #include <QProcessEnvironment>
#include "musrfit-info.h"
#include "PAdmin.h" #include "PAdmin.h"
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
@ -681,6 +682,12 @@ PAdmin::PAdmin() : QObject()
// 4th: check $ROOTSYS/bin/musredit_startup.xml // 4th: check $ROOTSYS/bin/musredit_startup.xml
path = procEnv.value("ROOTSYS", ""); path = procEnv.value("ROOTSYS", "");
pathFln = path + "/bin/" + fln; pathFln = path + "/bin/" + fln;
if (!QFile::exists(pathFln)) {
// 5th: not found anyware hence create it
path = procEnv.value("HOME", "");
pathFln = path + "/.musrfit/musredit/" + fln;
createMusreditStartupFile();
}
} }
} }
} }
@ -985,6 +992,302 @@ void PAdmin::saveRecentFiles()
} }
} }
//--------------------------------------------------------------------------
/**
* @brief PAdmin::createMusreditStartupFile
*/
void PAdmin::createMusreditStartupFile()
{
// get $HOME
QProcessEnvironment procEnv = QProcessEnvironment::systemEnvironment();
QString pathName = procEnv.value("HOME", "");
pathName += "/.musrfit/musredit";
// check if the directory $HOME/.musrfit/musredit exists if not create it
QDir dir(pathName);
if (!dir.exists()) {
// directory $HOME/.musrfit/musredit does not exist hence create it
dir.mkpath(pathName);
}
// create default musredit_startup.xml file in $HOME/.musrfit/musredit
pathName += "/musredit_startup.xml";
QFile file(pathName);
if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
return;
QTextStream fout(&file);
fout << "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" << endl;
fout << "<musredit_startup xmlns=\"http://lmu.web.psi.ch/musrfit/user/MUSR/MusrGui.html\">" << endl;
fout << " <comment>" << endl;
fout << " This is handling default setting parameters for the musredit." << endl;
fout << " </comment>" << endl;
fout << " <general>" << endl;
fout << " <exec_path>" << MUSRFIT_PREFIX << "/bin</exec_path>" << endl;
fout << " <default_save_path>./</default_save_path>" << endl;
fout << " <msr_default_file_path>" << MUSRFIT_DOC_DIR << "/templates</msr_default_file_path>" << endl;
fout << " <timeout>3600</timeout>" << endl;
fout << " <keep_minuit2_output>n</keep_minuit2_output>" << endl;
fout << " <dump_ascii>n</dump_ascii>" << endl;
fout << " <dump_root>n</dump_root>" << endl;
fout << " <title_from_data_file>y</title_from_data_file>" << endl;
fout << " <chisq_per_run_block>n</chisq_per_run_block>" << endl;
fout << " <estimate_n0>y</estimate_n0>" << endl;
fout << " <musrview_show_fourier>n</musrview_show_fourier>" << endl;
fout << " <musrview_show_avg>n</musrview_show_avg>" << endl;
fout << " <enable_musrt0>y</enable_musrt0>" << endl;
fout << " </general>" << endl;
fout << " <recent_files>" << endl;
fout << " <path_file_name>" << MUSRFIT_DOC_DIR << "/examples/test-histo-PSI-BIN.msr</path_file_name>" << endl;
fout << " </recent_files>" << endl;
fout << " <help_section>" << endl;
fout << " <musr_web_main>file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html</musr_web_main>" << endl;
fout << " <musr_web_title>file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheTitle</musr_web_title>" << endl;
fout << " <musr_web_parameters>file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheFitparameterBlock</musr_web_parameters>" << endl;
fout << " <musr_web_theory>file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheTheoryBlock</musr_web_theory>" << endl;
fout << " <musr_web_functions>file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheFunctionsBlock</musr_web_functions>" << endl;
fout << " <musr_web_run>file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheRunBlock</musr_web_run>" << endl;
fout << " <musr_web_command>file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheCommandsBlock</musr_web_command>" << endl;
fout << " <musr_web_fourier>file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheFourierBlock</musr_web_fourier>" << endl;
fout << " <musr_web_plot>file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#ThePlotBlock</musr_web_plot>" << endl;
fout << " <musr_web_statistic>file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#TheStatisticBlock</musr_web_statistic>" << endl;
fout << " <musr_web_msr2data>file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/Msr2Data.html</musr_web_msr2data>" << endl;
fout << " <musr_web_musrFT>file://" << MUSRFIT_DOC_DIR << "/html/user/MUSR/MusrFit.html#A_2.3_musrFT</musr_web_musrFT>" << endl;
fout << " </help_section>" << endl;
fout << " <font_settings>" << endl;
#ifdef Q_OS_MAC
fout << " <font_name>Courier New</font_name>" << endl;
fout << " <font_size>16</font_size>" << endl;
#else
fout << " <font_name>Monospace</font_name>" << endl;
fout << " <font_size>12</font_size>" << endl;
#endif
fout << " </font_settings>" << endl;
fout << " <msr_file_defaults>" << endl;
fout << " <beamline>mue4</beamline>" << endl;
fout << " <institute>psi</institute>" << endl;
fout << " <file_format>root-npp</file_format>" << endl;
fout << " <lifetime_correction>y</lifetime_correction>" << endl;
fout << " </msr_file_defaults>" << endl;
fout << " <msr2data_defaults>" << endl;
fout << " <chain_fit>y</chain_fit>" << endl;
fout << " <write_data_header>y</write_data_header>" << endl;
fout << " <ignore_data_header_info>n</ignore_data_header_info>" << endl;
fout << " <keep_minuit2_output>n</keep_minuit2_output>" << endl;
fout << " <write_column_data>n</write_column_data>" << endl;
fout << " <recreate_data_file>n</recreate_data_file>" << endl;
fout << " <open_file_after_fitting>y</open_file_after_fitting>" << endl;
fout << " <create_msr_file_only>n</create_msr_file_only>" << endl;
fout << " <fit_only>n</fit_only>" << endl;
fout << " <global>n</global>" << endl;
fout << " <global_plus>n</global_plus>" << endl;
fout << " </msr2data_defaults>" << endl;
fout << " <func_pixmap_path>" << MUSRFIT_DOC_DIR << "/latex_images</func_pixmap_path>" << endl;
fout << " <theory_functions>" << endl;
fout << " <func>" << endl;
fout << " <name>asymmetry</name>" << endl;
fout << " <comment></comment>" << endl;
fout << " <label>Asymmetry</label>" << endl;
fout << " <pixmap>asymmetry.png</pixmap>" << endl;
fout << " <params>1</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>simplExpo</name>" << endl;
fout << " <comment>(rate)</comment>" << endl;
fout << " <label>simple Exp</label>" << endl;
fout << " <pixmap>simpleExp.png</pixmap>" << endl;
fout << " <params>1</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>generExpo</name>" << endl;
fout << " <comment>(rate exponent)</comment>" << endl;
fout << " <label>general Exp</label>" << endl;
fout << " <pixmap>generalExp.png</pixmap>" << endl;
fout << " <params>2</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>simpleGss</name>" << endl;
fout << " <comment>(rate)</comment>" << endl;
fout << " <label>simple Gauss</label>" << endl;
fout << " <pixmap>simpleGauss.png</pixmap>" << endl;
fout << " <params>1</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>statGssKT</name>" << endl;
fout << " <comment>(rate)</comment>" << endl;
fout << " <label>static Gauss KT</label>" << endl;
fout << " <pixmap>statGssKT.png</pixmap>" << endl;
fout << " <params>1</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>statGssKTLF</name>" << endl;
fout << " <comment>(frequency damping)</comment>" << endl;
fout << " <label>static Gauss KT LF</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>2</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>dynGssKTLF</name>" << endl;
fout << " <comment>(frequency damping hopping-rate)</comment>" << endl;
fout << " <label>dynamic Gauss KT LF</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>3</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>statExpKT</name>" << endl;
fout << " <comment>(rate)</comment>" << endl;
fout << " <label>static Lorentz KT</label>" << endl;
fout << " <pixmap>statExpKT.png</pixmap>" << endl;
fout << " <params>1</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>statExpKTLF</name>" << endl;
fout << " <comment>(frequency damping)</comment>" << endl;
fout << " <label>static Lorentz KT LF</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>2</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>dynExpKTLF</name>" << endl;
fout << " <comment>(frequency damping hopping-rate)</comment>" << endl;
fout << " <label>dynamic Lorentz KT LF</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>3</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>combiLGKT</name>" << endl;
fout << " <comment>(lorentzRate gaussRate)</comment>" << endl;
fout << " <label>combined Lorentz-Gauss KT</label>" << endl;
fout << " <pixmap>combiLGKT.png</pixmap>" << endl;
fout << " <params>2</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>strKT</name>" << endl;
fout << " <comment>(rate beta)</comment>" << endl;
fout << " <label>stretched Kubo-Toyabe</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>2</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>spinGlass</name>" << endl;
fout << " <comment>(rate hopping-rate order)</comment>" << endl;
fout << " <label>zero field spin glass function</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>3</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>rdAnisoHf</name>" << endl;
fout << " <comment>(frequency rate)</comment>" << endl;
fout << " <label>random anisotropic hyperfine function</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>2</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>abragam</name>" << endl;
fout << " <comment>(rate hopping-rate)</comment>" << endl;
fout << " <label>Abragam</label>" << endl;
fout << " <pixmap>abragam.png</pixmap>" << endl;
fout << " <params>2</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>TFieldCos</name>" << endl;
fout << " <comment>(phase frequency)</comment>" << endl;
fout << " <label>TF cos</label>" << endl;
fout << " <pixmap>tfCos.png</pixmap>" << endl;
fout << " <params>2</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>internFld</name>" << endl;
fout << " <comment>(fraction phase frequency Trate Lrate)</comment>" << endl;
fout << " <label>internal Lorentz field</label>" << endl;
fout << " <pixmap>internalField.png</pixmap>" << endl;
fout << " <params>5</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>internFldGK</name>" << endl;
fout << " <comment>(fraction frequency Trate Lrate beta)</comment>" << endl;
fout << " <label>internal field, Gaussian broadened</label>" << endl;
fout << " <pixmap>internalFieldGK.png</pixmap>" << endl;
fout << " <params>5</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>internFldLL</name>" << endl;
fout << " <comment>(fraction frequency Trate Lrate)</comment>" << endl;
fout << " <label>internal field, Lorentzian broadened</label>" << endl;
fout << " <pixmap>internalFieldLL.png</pixmap>" << endl;
fout << " <params>4</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>bessel</name>" << endl;
fout << " <comment>(phase frequency)</comment>" << endl;
fout << " <label>spherical Bessel 0th order</label>" << endl;
fout << " <pixmap>bessel.png</pixmap>" << endl;
fout << " <params>2</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>internBsl</name>" << endl;
fout << " <comment>(fraction phase frequency Trate Lrate)</comment>" << endl;
fout << " <label>static internal Bessel</label>" << endl;
fout << " <pixmap>internalBessel.png</pixmap>" << endl;
fout << " <params>5</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>skewedGss</name>" << endl;
fout << " <comment>(phase frequency rate_m rate_p)</comment>" << endl;
fout << " <label>skewed Gaussian</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>4</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>staticNKZF</name>" << endl;
fout << " <comment>(damping_D0 R_b)</comment>" << endl;
fout << " <label>static Noakes-Kalvius ZF</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>2</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>staticNKTF</name>" << endl;
fout << " <comment>(phase frequency damping_D0 R_b)</comment>" << endl;
fout << " <label>static Noakes-Kalvius TF</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>4</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>dynamicNKZF</name>" << endl;
fout << " <comment>(damping_D0 R_b nu_c)</comment>" << endl;
fout << " <label>dynamic Noakes-Kalvius ZF</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>3</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>dynamicNKTF</name>" << endl;
fout << " <comment>(phase frequency damping_D0 R_b nu_c)</comment>" << endl;
fout << " <label>dynamic Noakes-Kalvius TF</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>5</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>polynom</name>" << endl;
fout << " <comment>(tshift p0 p1 ... pn)</comment>" << endl;
fout << " <label>polynom</label>" << endl;
fout << " <pixmap>polynom.png</pixmap>" << endl;
fout << " <params>4</params>" << endl;
fout << " </func>" << endl;
fout << " <func>" << endl;
fout << " <name>userFcn</name>" << endl;
fout << " <comment></comment>" << endl;
fout << " <label>user function</label>" << endl;
fout << " <pixmap></pixmap>" << endl;
fout << " <params>0</params>" << endl;
fout << " </func>" << endl;
fout << " </theory_functions>" << endl;
fout << "</musredit_startup>" << endl;
file.close();
}
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// END // END
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------

View File

@ -209,6 +209,7 @@ class PAdmin : public QObject
QVector<PTheory> fTheory; ///< stores all known theories. Needed when generating theory blocks from within musredit. QVector<PTheory> fTheory; ///< stores all known theories. Needed when generating theory blocks from within musredit.
void saveRecentFiles(); ///< save recent file list void saveRecentFiles(); ///< save recent file list
void createMusreditStartupFile(); ///< create default musredit_startup.xml
}; };
#endif // _PADMIN_H_ #endif // _PADMIN_H_

View File

@ -1,10 +1,6 @@
TEMPLATE = app TEMPLATE = app
TARGET = musredit TARGET = musredit
!exists( musredit_startup.xml ) {
error( "Configuration file musredit_startup.xml not found! Please configure musrfit first, before trying to install musredit!" )
}
# install path for musredit # install path for musredit
count( PREFIX, 1 ) { count( PREFIX, 1 ) {
MUSREDIT_INSTALL_PATH = $${PREFIX}/bin MUSREDIT_INSTALL_PATH = $${PREFIX}/bin
@ -67,8 +63,6 @@ macx {
unix:xml.path = $$(HOME)/.musrfit/musredit unix:xml.path = $$(HOME)/.musrfit/musredit
macx:xml.path = $$(HOME)/.musrfit/musredit macx:xml.path = $$(HOME)/.musrfit/musredit
win32:xml.path = c:/musrfit/bin win32:xml.path = c:/musrfit/bin
xml.files = musredit_startup.xml
INSTALLS += xml
CONFIG += qt \ CONFIG += qt \
warn_on \ warn_on \
@ -84,6 +78,7 @@ QT += svg
INCLUDEPATH += "../include" INCLUDEPATH += "../include"
HEADERS = musredit.h \ HEADERS = musredit.h \
musrfit-info.h \
PHelp.h \ PHelp.h \
PTextEdit.h \ PTextEdit.h \
PSubTextEdit.h \ PSubTextEdit.h \

View File

@ -1,260 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<musredit_startup xmlns="http://lmu.web.psi.ch/musrfit/user/MUSR/MusrGui.html">
<comment>
This is handling default setting parameters for the musredit.
</comment>
<general>
<exec_path>@prefix@/bin</exec_path>
<default_save_path>./</default_save_path>
<msr_default_file_path>@DOCDIR@/templates</msr_default_file_path>
<timeout>3600</timeout>
<keep_minuit2_output>n</keep_minuit2_output>
<dump_ascii>n</dump_ascii>
<dump_root>n</dump_root>
<title_from_data_file>y</title_from_data_file>
<chisq_per_run_block>n</chisq_per_run_block>
<estimate_n0>y</estimate_n0>
<musrview_show_fourier>n</musrview_show_fourier>
<musrview_show_avg>n</musrview_show_avg>
<enable_musrt0>y</enable_musrt0>
</general>
<recent_files>
<path_file_name>/home/nemu/analysis/musrfit/doc/examples/test-histo-PSI-BIN.msr</path_file_name>
</recent_files>
<help_section>
<musr_web_main>file://@DOCDIR@/html/user/MUSR/MusrFit.html</musr_web_main>
<musr_web_title>file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheTitle</musr_web_title>
<musr_web_parameters>file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheFitparameterBlock</musr_web_parameters>
<musr_web_theory>file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheTheoryBlock</musr_web_theory>
<musr_web_functions>file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheFunctionsBlock</musr_web_functions>
<musr_web_run>file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheRunBlock</musr_web_run>
<musr_web_command>file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheCommandsBlock</musr_web_command>
<musr_web_fourier>file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheFourierBlock</musr_web_fourier>
<musr_web_plot>file://@DOCDIR@/html/user/MUSR/MusrFit.html#ThePlotBlock</musr_web_plot>
<musr_web_statistic>file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheStatisticBlock</musr_web_statistic>
<musr_web_msr2data>file://@DOCDIR@/html/user/MUSR/Msr2Data.html</musr_web_msr2data>
<musr_web_musrFT>file://@DOCDIR@/html/user/MUSR/MusrFit.html#A_2.3_musrFT</musr_web_musrFT>
</help_section>
<font_settings>
<font_name>Monospace</font_name>
<font_size>12</font_size>
</font_settings>
<msr_file_defaults>
<beamline>mue4</beamline>
<institute>psi</institute>
<file_format>root-npp</file_format>
<lifetime_correction>y</lifetime_correction>
</msr_file_defaults>
<msr2data_defaults>
<chain_fit>y</chain_fit>
<write_data_header>y</write_data_header>
<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>
<open_file_after_fitting>y</open_file_after_fitting>
<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>@DOCDIR@/latex_images</func_pixmap_path>
<theory_functions>
<func>
<name>asymmetry</name>
<comment></comment>
<label>Asymmetry</label>
<pixmap>asymmetry.png</pixmap>
<params>1</params>
</func>
<func>
<name>simplExpo</name>
<comment>(rate)</comment>
<label>simple Exp</label>
<pixmap>simpleExp.png</pixmap>
<params>1</params>
</func>
<func>
<name>generExpo</name>
<comment>(rate exponent)</comment>
<label>general Exp</label>
<pixmap>generalExp.png</pixmap>
<params>2</params>
</func>
<func>
<name>simpleGss</name>
<comment>(rate)</comment>
<label>simple Gauss</label>
<pixmap>simpleGauss.png</pixmap>
<params>1</params>
</func>
<func>
<name>statGssKT</name>
<comment>(rate)</comment>
<label>static Gauss KT</label>
<pixmap>statGssKT.png</pixmap>
<params>1</params>
</func>
<func>
<name>statGssKTLF</name>
<comment>(frequency damping)</comment>
<label>static Gauss KT LF</label>
<pixmap></pixmap>
<params>2</params>
</func>
<func>
<name>dynGssKTLF</name>
<comment>(frequency damping hopping-rate)</comment>
<label>dynamic Gauss KT LF</label>
<pixmap></pixmap>
<params>3</params>
</func>
<func>
<name>statExpKT</name>
<comment>(rate)</comment>
<label>static Lorentz KT</label>
<pixmap>statExpKT.png</pixmap>
<params>1</params>
</func>
<func>
<name>statExpKTLF</name>
<comment>(frequency damping)</comment>
<label>static Lorentz KT LF</label>
<pixmap></pixmap>
<params>2</params>
</func>
<func>
<name>dynExpKTLF</name>
<comment>(frequency damping hopping-rate)</comment>
<label>dynamic Lorentz KT LF</label>
<pixmap></pixmap>
<params>3</params>
</func>
<func>
<name>combiLGKT</name>
<comment>(lorentzRate gaussRate)</comment>
<label>combined Lorentz-Gauss KT</label>
<pixmap>combiLGKT.png</pixmap>
<params>2</params>
</func>
<func>
<name>strKT</name>
<comment>(rate beta)</comment>
<label>stretched Kubo-Toyabe</label>
<pixmap></pixmap>
<params>2</params>
</func>
<func>
<name>spinGlass</name>
<comment>(rate hopping-rate order)</comment>
<label>zero field spin glass function</label>
<pixmap></pixmap>
<params>3</params>
</func>
<func>
<name>rdAnisoHf</name>
<comment>(frequency rate)</comment>
<label>random anisotropic hyperfine function</label>
<pixmap></pixmap>
<params>2</params>
</func>
<func>
<name>abragam</name>
<comment>(rate hopping-rate)</comment>
<label>Abragam</label>
<pixmap>abragam.png</pixmap>
<params>2</params>
</func>
<func>
<name>TFieldCos</name>
<comment>(phase frequency)</comment>
<label>TF cos</label>
<pixmap>tfCos.png</pixmap>
<params>2</params>
</func>
<func>
<name>internFld</name>
<comment>(fraction phase frequency Trate Lrate)</comment>
<label>internal Lorentz field</label>
<pixmap>internalField.png</pixmap>
<params>5</params>
</func>
<func>
<name>internFldGK</name>
<comment>(fraction frequency Trate Lrate beta)</comment>
<label>internal field, Gaussian broadened</label>
<pixmap>internalFieldGK.png</pixmap>
<params>5</params>
</func>
<func>
<name>internFldLL</name>
<comment>(fraction frequency Trate Lrate)</comment>
<label>internal field, Lorentzian broadened</label>
<pixmap>internalFieldLL.png</pixmap>
<params>4</params>
</func>
<func>
<name>bessel</name>
<comment>(phase frequency)</comment>
<label>spherical Bessel 0th order</label>
<pixmap>bessel.png</pixmap>
<params>2</params>
</func>
<func>
<name>internBsl</name>
<comment>(fraction phase frequency Trate Lrate)</comment>
<label>static internal Bessel</label>
<pixmap>internalBessel.png</pixmap>
<params>5</params>
</func>
<func>
<name>skewedGss</name>
<comment>(phase frequency rate_m rate_p)</comment>
<label>skewed Gaussian</label>
<pixmap></pixmap>
<params>4</params>
</func>
<func>
<name>staticNKZF</name>
<comment>(damping_D0 R_b)</comment>
<label>static Noakes-Kalvius ZF</label>
<pixmap></pixmap>
<params>2</params>
</func>
<func>
<name>staticNKTF</name>
<comment>(phase frequency damping_D0 R_b)</comment>
<label>static Noakes-Kalvius TF</label>
<pixmap></pixmap>
<params>4</params>
</func>
<func>
<name>dynamicNKZF</name>
<comment>(damping_D0 R_b nu_c)</comment>
<label>dynamic Noakes-Kalvius ZF</label>
<pixmap></pixmap>
<params>3</params>
</func>
<func>
<name>dynamicNKTF</name>
<comment>(phase frequency damping_D0 R_b nu_c)</comment>
<label>dynamic Noakes-Kalvius TF</label>
<pixmap></pixmap>
<params>5</params>
</func>
<func>
<name>polynom</name>
<comment>(tshift p0 p1 ... pn)</comment>
<label>polynom</label>
<pixmap>polynom.png</pixmap>
<params>4</params>
</func>
<func>
<name>userFcn</name>
<comment></comment>
<label>user function</label>
<pixmap></pixmap>
<params>0</params>
</func>
</theory_functions>
</musredit_startup>