newly added musrgui. Still under heavy development.
This commit is contained in:
parent
acb5eda314
commit
bb68989a75
181
src/musrgui/PAdmin.cpp
Normal file
181
src/musrgui/PAdmin.cpp
Normal file
@ -0,0 +1,181 @@
|
||||
/****************************************************************************
|
||||
|
||||
PAdmin.cpp
|
||||
|
||||
Author: Andreas Suter
|
||||
e-mail: andreas.suter@psi.ch
|
||||
|
||||
$Id$
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qmessagebox.h>
|
||||
|
||||
#include "PAdmin.h"
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// implementation of PAdminXMLParser class
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>XML Parser class for the musrgui administration file.
|
||||
*
|
||||
* \param admin pointer to an admin class instance.
|
||||
*/
|
||||
PAdminXMLParser::PAdminXMLParser(PAdmin *admin) : fAdmin(admin)
|
||||
{
|
||||
fKeyWord = eEmpty;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Routine called at the beginning of the XML parsing process.
|
||||
*/
|
||||
bool PAdminXMLParser::startDocument()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Routine called when a new XML tag is found. Here it is used
|
||||
* to set a tag for filtering afterwards the content.
|
||||
*
|
||||
* \param qName name of the XML tag.
|
||||
*/
|
||||
bool PAdminXMLParser::startElement( const QString&, const QString&,
|
||||
const QString& qName,
|
||||
const QXmlAttributes& )
|
||||
{
|
||||
if (qName == "exec_path") {
|
||||
fKeyWord = eExecPath;
|
||||
} else if (qName == "default_save_path") {
|
||||
fKeyWord = eDefaultSavePath;
|
||||
} else if (qName == "beamline") {
|
||||
fKeyWord = eBeamline;
|
||||
} else if (qName == "institute") {
|
||||
fKeyWord = eInstitute;
|
||||
} else if (qName == "file_format") {
|
||||
fKeyWord = eFileFormat;
|
||||
} else if (qName == "msr_default_file_path") {
|
||||
fKeyWord = eMsrDefaultFilePath;
|
||||
} else if (qName == "show_mlog") {
|
||||
fKeyWord = eShowMlog;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Routine called when the end XML tag is found. It is used to
|
||||
* put the filtering tag to 'empty'.
|
||||
*/
|
||||
bool PAdminXMLParser::endElement( const QString&, const QString&, const QString& )
|
||||
{
|
||||
fKeyWord = eEmpty;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>This routine delivers the content of an XML tag. It fills the
|
||||
* content into the load data structure.
|
||||
*/
|
||||
bool PAdminXMLParser::characters(const QString& str)
|
||||
{
|
||||
switch (fKeyWord) {
|
||||
case eExecPath:
|
||||
fAdmin->setExecPath(QString(str.ascii()).stripWhiteSpace());
|
||||
break;
|
||||
case eDefaultSavePath:
|
||||
fAdmin->setDefaultSavePath(QString(str.ascii()).stripWhiteSpace());
|
||||
break;
|
||||
case eBeamline:
|
||||
fAdmin->setBeamline(QString(str.ascii()).stripWhiteSpace());
|
||||
break;
|
||||
case eInstitute:
|
||||
fAdmin->setInstitute(QString(str.ascii()).stripWhiteSpace());
|
||||
break;
|
||||
case eFileFormat:
|
||||
fAdmin->setFileFormat(QString(str.ascii()).stripWhiteSpace());
|
||||
break;
|
||||
case eMsrDefaultFilePath:
|
||||
fAdmin->setMsrDefaultFilePath(QString(str.ascii()).stripWhiteSpace());
|
||||
break;
|
||||
case eShowMlog:
|
||||
if (str == "n")
|
||||
fAdmin->setShowMlog(false);
|
||||
else
|
||||
fAdmin->setShowMlog(true);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Called at the end of the XML parse process.
|
||||
*/
|
||||
bool PAdminXMLParser::endDocument()
|
||||
{
|
||||
// check if all necessary items are found
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// implementation of PAdmin class
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
PAdmin::PAdmin()
|
||||
{
|
||||
fExecPath = QString("");
|
||||
fDefaultSavePath = QString("");
|
||||
|
||||
fBeamline = QString("");
|
||||
fInstitute = QString("");
|
||||
fFileFormat = QString("");
|
||||
|
||||
fShowMlog = true;
|
||||
|
||||
// XML Parser part
|
||||
QString fln = "/home/nemu/analysis/bin/musrgui_startup.xml";
|
||||
if (QFile::exists(fln)) { // administrations file present
|
||||
PAdminXMLParser handler(this);
|
||||
QFile xmlFile(fln);
|
||||
QXmlInputSource source( &xmlFile );
|
||||
QXmlSimpleReader reader;
|
||||
reader.setContentHandler( &handler );
|
||||
reader.parse( source );
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// END
|
||||
//--------------------------------------------------------------------------
|
102
src/musrgui/PAdmin.h
Normal file
102
src/musrgui/PAdmin.h
Normal file
@ -0,0 +1,102 @@
|
||||
/****************************************************************************
|
||||
|
||||
PAdmin.h
|
||||
|
||||
Author: Andreas Suter
|
||||
e-mail: andreas.suter@psi.ch
|
||||
|
||||
$Id$
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _PADMIN_H_
|
||||
#define _PADMIN_H_
|
||||
|
||||
#include <qstring.h>
|
||||
#include <qptrlist.h>
|
||||
#include <qxml.h>
|
||||
|
||||
class PAdmin;
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
class PAdminXMLParser : public QXmlDefaultHandler
|
||||
{
|
||||
public:
|
||||
PAdminXMLParser(PAdmin*);
|
||||
virtual ~PAdminXMLParser() {}
|
||||
|
||||
private:
|
||||
enum EAdminKeyWords {eEmpty, eExecPath, eDefaultSavePath, eBeamline, eInstitute, eFileFormat,
|
||||
eMsrDefaultFilePath, eShowMlog};
|
||||
|
||||
bool startDocument();
|
||||
bool startElement( const QString&, const QString&, const QString& ,
|
||||
const QXmlAttributes& );
|
||||
bool endElement( const QString&, const QString&, const QString& );
|
||||
|
||||
bool characters(const QString&);
|
||||
bool endDocument();
|
||||
|
||||
EAdminKeyWords fKeyWord;
|
||||
PAdmin *fAdmin;
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
class PAdmin
|
||||
{
|
||||
public:
|
||||
PAdmin();
|
||||
virtual ~PAdmin() {}
|
||||
|
||||
QString getExecPath() { return fExecPath; }
|
||||
QString getDefaultSavePath() { return fDefaultSavePath; }
|
||||
QString getBeamline() { return fBeamline; }
|
||||
QString getInstitute() { return fInstitute; }
|
||||
QString getFileFormat() { return fFileFormat; }
|
||||
QString getMsrDefaultFilePath() { return fMsrDefaultFilePath; }
|
||||
bool getShowMlog() { return fShowMlog; }
|
||||
|
||||
protected:
|
||||
void setExecPath(const QString str) { fExecPath = str; }
|
||||
void setDefaultSavePath(const QString str) { fDefaultSavePath = str; }
|
||||
void setBeamline(const QString str) { fBeamline = str; }
|
||||
void setInstitute(const QString str) { fInstitute = str; }
|
||||
void setFileFormat(const QString str) { fFileFormat = str; }
|
||||
void setMsrDefaultFilePath(const QString str) { fMsrDefaultFilePath = str; }
|
||||
void setShowMlog(const bool flag) { fShowMlog = flag; }
|
||||
|
||||
private:
|
||||
friend class PAdminXMLParser;
|
||||
|
||||
QString fExecPath;
|
||||
QString fDefaultSavePath;
|
||||
|
||||
QString fBeamline;
|
||||
QString fInstitute;
|
||||
QString fFileFormat;
|
||||
|
||||
QString fMsrDefaultFilePath;
|
||||
bool fShowMlog;
|
||||
};
|
||||
|
||||
#endif // _PADMIN_H_
|
110
src/musrgui/PFitOutputHandler.cpp
Normal file
110
src/musrgui/PFitOutputHandler.cpp
Normal file
@ -0,0 +1,110 @@
|
||||
/****************************************************************************
|
||||
|
||||
PFitOutputHandler.cpp
|
||||
|
||||
Author: Andreas Suter
|
||||
e-mail: andreas.suter@psi.ch
|
||||
|
||||
$Id$
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include "PFitOutputHandler.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
PFitOutputHandler::PFitOutputHandler(QValueVector<QString> &cmd)
|
||||
{
|
||||
if (cmd.empty())
|
||||
return;
|
||||
|
||||
// Layout
|
||||
vbox = new QVBox( this );
|
||||
vbox->resize(800, 500);
|
||||
output = new QTextEdit( vbox );
|
||||
output->setMinimumSize(800, 455);
|
||||
output->setReadOnly(true);
|
||||
quitButton = new QPushButton( tr("Done"), vbox );
|
||||
connect( quitButton, SIGNAL(clicked()),
|
||||
this, SLOT(accept()) );
|
||||
resize( 800, 500 );
|
||||
|
||||
// QProcess related code
|
||||
proc = new QProcess( this );
|
||||
|
||||
// Set up the command and arguments.
|
||||
for (unsigned int i=0; i<cmd.size(); i++)
|
||||
proc->addArgument(cmd[i]);
|
||||
|
||||
connect( proc, SIGNAL(readyReadStdout()), this, SLOT(readFromStdOut()) );
|
||||
connect( proc, SIGNAL(readyReadStderr()), this, SLOT(readFromStdErr()) );
|
||||
// connect( proc, SIGNAL(processExited()), this, SLOT(scrollToTop()) );
|
||||
|
||||
if ( !proc->start() ) {
|
||||
// error handling
|
||||
QMessageBox::critical( 0,
|
||||
tr("Fatal error"),
|
||||
tr("Could not start the musrfit command: "+cmd[0]),
|
||||
tr("Quit") );
|
||||
done(0);
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PFitOutputHandler::readFromStdOut()
|
||||
{
|
||||
// Read and process the data.
|
||||
// Bear in mind that the data might be output in chunks.
|
||||
output->append( proc->readStdout() );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PFitOutputHandler::readFromStdErr()
|
||||
{
|
||||
// Read and process the data.
|
||||
// Bear in mind that the data might be output in chunks.
|
||||
output->append( proc->readStderr() );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
/*
|
||||
void PFitOutputHandler::scrollToTop()
|
||||
{
|
||||
output->setContentsPos( 0, 0 );
|
||||
}
|
||||
*/
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// END
|
||||
//----------------------------------------------------------------------------------------------------
|
66
src/musrgui/PFitOutputHandler.h
Normal file
66
src/musrgui/PFitOutputHandler.h
Normal file
@ -0,0 +1,66 @@
|
||||
/****************************************************************************
|
||||
|
||||
PFitOutputHandler.h
|
||||
|
||||
Author: Andreas Suter
|
||||
e-mail: andreas.suter@psi.ch
|
||||
|
||||
$Id$
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _PFITOUTPUTHANDLER_H_
|
||||
#define _PFITOUTPUTHANDLER_H_
|
||||
|
||||
#include <qobject.h>
|
||||
#include <qprocess.h>
|
||||
#include <qdialog.h>
|
||||
#include <qvbox.h>
|
||||
#include <qtextedit.h>
|
||||
#include <qpushbutton.h>
|
||||
#include <qmessagebox.h>
|
||||
#include <qvaluevector.h>
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
class PFitOutputHandler : public QDialog
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PFitOutputHandler(QValueVector<QString> &cmd);
|
||||
~PFitOutputHandler() {}
|
||||
|
||||
public slots:
|
||||
void readFromStdOut();
|
||||
void readFromStdErr();
|
||||
// void scrollToTop();
|
||||
|
||||
private:
|
||||
QProcess *proc;
|
||||
QVBox *vbox;
|
||||
QTextEdit *output;
|
||||
QPushButton *quitButton;
|
||||
};
|
||||
|
||||
#endif // _PFITOUTPUTHANDLER_H_
|
101
src/musrgui/PGetDefaultDialog.cpp
Normal file
101
src/musrgui/PGetDefaultDialog.cpp
Normal file
@ -0,0 +1,101 @@
|
||||
/****************************************************************************
|
||||
|
||||
PGetDefaultDialog.cpp
|
||||
|
||||
Author: Andreas Suter
|
||||
e-mail: andreas.suter@psi.ch
|
||||
|
||||
$Id$
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qobject.h>
|
||||
#include <qcombobox.h>
|
||||
|
||||
#include "PGetDefaultDialog.h"
|
||||
|
||||
#define INSTITUTE_PSI 0
|
||||
#define INSTITUTE_RAL 1
|
||||
#define INSTITUTE_TRIUMF 2
|
||||
#define INSTITUTE_JPARC 3
|
||||
|
||||
#define FILE_FORMAT_NEXUS 0
|
||||
#define FILE_FORMAT_ROOT_NPP 1
|
||||
#define FILE_FORMAT_ROOT_PPC 2
|
||||
#define FILE_FORMAT_PSIBIN 3
|
||||
#define FILE_FORMAT_MUD 4
|
||||
#define FILE_FORMAT_WKM 5
|
||||
#define FILE_FORMAT_ASCII 6
|
||||
#define FILE_FORMAT_DB 7
|
||||
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
PGetDefaultDialog::PGetDefaultDialog(QWidget *parent, const char *name,
|
||||
bool modal, WFlags f) :
|
||||
PGetDefaultDialogBase(parent, name, modal, f)
|
||||
{
|
||||
fInstitute = fInstitute_comboBox->currentText();
|
||||
fFileFormat = fFileFormat_comboBox->currentText();
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PGetDefaultDialog::runFileNameChanged(const QString &text)
|
||||
{
|
||||
fRunFileName = text;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PGetDefaultDialog::beamlineChanged(const QString &text)
|
||||
{
|
||||
fBeamline = text;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PGetDefaultDialog::instituteChanged(const QString &text)
|
||||
{
|
||||
fInstitute = text;
|
||||
}
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PGetDefaultDialog::fileFormatChanged(const QString &text)
|
||||
{
|
||||
fFileFormat = text;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
// END
|
||||
//---------------------------------------------------------------------------
|
67
src/musrgui/PGetDefaultDialog.h
Normal file
67
src/musrgui/PGetDefaultDialog.h
Normal file
@ -0,0 +1,67 @@
|
||||
/****************************************************************************
|
||||
|
||||
PGetDefaultDialog.h
|
||||
|
||||
Author: Andreas Suter
|
||||
e-mail: andreas.suter@psi.ch
|
||||
|
||||
$Id$
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _PGETDEFAULTDIALOG_H_
|
||||
#define _PGETDEFAULTDIALOG_H_
|
||||
|
||||
#include <qstring.h>
|
||||
#include <qwidget.h>
|
||||
|
||||
#include "forms/PGetDefaultDialogBase.h"
|
||||
|
||||
class PGetDefaultDialog : public PGetDefaultDialogBase
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PGetDefaultDialog(QWidget *parent = 0, const char *name = 0,
|
||||
bool modal = TRUE, WFlags f = 0);
|
||||
virtual ~PGetDefaultDialog() {}
|
||||
|
||||
virtual const QString getRunFileName() const { return fRunFileName; }
|
||||
virtual const QString getBeamline() const { return fBeamline; }
|
||||
virtual const QString getInstitute() const { return fInstitute; }
|
||||
virtual const QString getFileFormat() const { return fFileFormat; }
|
||||
|
||||
private:
|
||||
QString fRunFileName;
|
||||
QString fBeamline;
|
||||
QString fInstitute;
|
||||
QString fFileFormat;
|
||||
|
||||
private slots:
|
||||
void runFileNameChanged(const QString&);
|
||||
void beamlineChanged(const QString&);
|
||||
void instituteChanged(const QString&);
|
||||
void fileFormatChanged(const QString&);
|
||||
};
|
||||
|
||||
#endif // _PGETDEFAULTDIALOG_H_
|
844
src/musrgui/PTextEdit.cpp
Normal file
844
src/musrgui/PTextEdit.cpp
Normal file
@ -0,0 +1,844 @@
|
||||
/****************************************************************************
|
||||
|
||||
PTextEdit.cpp
|
||||
|
||||
Author: Andreas Suter
|
||||
e-mail: andreas.suter@psi.ch
|
||||
|
||||
$Id$
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qtextedit.h>
|
||||
#include <qaction.h>
|
||||
#include <qmenubar.h>
|
||||
#include <qpopupmenu.h>
|
||||
#include <qtoolbar.h>
|
||||
#include <qtabwidget.h>
|
||||
#include <qapplication.h>
|
||||
#include <qfontdatabase.h>
|
||||
#include <qcombobox.h>
|
||||
#include <qlineedit.h>
|
||||
#include <qfileinfo.h>
|
||||
#include <qfile.h>
|
||||
#include <qfiledialog.h>
|
||||
#include <qprinter.h>
|
||||
#include <qpaintdevicemetrics.h>
|
||||
#include <qsimplerichtext.h>
|
||||
#include <qcolordialog.h>
|
||||
#include <qpainter.h>
|
||||
#include <qmessagebox.h>
|
||||
#include <qdialog.h>
|
||||
#include <qvaluevector.h>
|
||||
|
||||
#include "PTextEdit.h"
|
||||
#include "PAdmin.h"
|
||||
#include "PFitOutputHandler.h"
|
||||
#include "PGetDefaultDialog.h"
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
PTextEdit::PTextEdit( QWidget *parent, const char *name )
|
||||
: QMainWindow( parent, name )
|
||||
{
|
||||
fAdmin = new PAdmin();
|
||||
|
||||
fShowMlog = true;
|
||||
|
||||
setupFileActions();
|
||||
setupEditActions();
|
||||
setupTextActions();
|
||||
setupMusrActions();
|
||||
setupHelpActions();
|
||||
|
||||
fTabWidget = new QTabWidget( this );
|
||||
setCentralWidget( fTabWidget );
|
||||
|
||||
textFamily("Courier");
|
||||
textSize("11"); // 11pt
|
||||
|
||||
if ( qApp->argc() != 1 ) {
|
||||
for ( int i = 1; i < qApp->argc(); ++i )
|
||||
load( qApp->argv()[ i ] );
|
||||
} else {
|
||||
fileNew();
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::setupFileActions()
|
||||
{
|
||||
QToolBar *tb = new QToolBar( this );
|
||||
tb->setLabel( "File Actions" );
|
||||
QPopupMenu *menu = new QPopupMenu( this );
|
||||
menuBar()->insertItem( tr( "&File" ), menu );
|
||||
|
||||
QAction *a;
|
||||
a = new QAction( QPixmap::fromMimeSource( "filenew.xpm" ), tr( "&New..." ), CTRL + Key_N, this, "fileNew" );
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( fileNew() ) );
|
||||
a->addTo( tb );
|
||||
a->addTo( menu );
|
||||
a = new QAction( QPixmap::fromMimeSource( "fileopen.xpm" ), tr( "&Open..." ), CTRL + Key_O, this, "fileOpen" );
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( fileOpen() ) );
|
||||
a->addTo( tb );
|
||||
a->addTo( menu );
|
||||
menu->insertSeparator();
|
||||
a = new QAction( QPixmap::fromMimeSource( "filesave.xpm" ), tr( "&Save..." ), CTRL + Key_S, this, "fileSave" );
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( fileSave() ) );
|
||||
a->addTo( tb );
|
||||
a->addTo( menu );
|
||||
a = new QAction( tr( "Save &As..." ), 0, this, "fileSaveAs" );
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( fileSaveAs() ) );
|
||||
a->addTo( menu );
|
||||
menu->insertSeparator();
|
||||
a = new QAction( QPixmap::fromMimeSource( "fileprint.xpm" ), tr( "&Print..." ), CTRL + Key_P, this, "filePrint" );
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( filePrint() ) );
|
||||
a->addTo( tb );
|
||||
a->addTo( menu );
|
||||
a = new QAction( tr( "&Close" ), CTRL + Key_W, this, "fileClose" );
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( fileClose() ) );
|
||||
a->addTo( menu );
|
||||
a = new QAction( tr( "E&xit" ), CTRL + Key_Q, this, "fileExit" );
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( fileExit() ) );
|
||||
a->addTo( menu );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::setupEditActions()
|
||||
{
|
||||
QToolBar *tb = new QToolBar( this );
|
||||
tb->setLabel( "Edit Actions" );
|
||||
QPopupMenu *menu = new QPopupMenu( this );
|
||||
menuBar()->insertItem( tr( "&Edit" ), menu );
|
||||
|
||||
QAction *a;
|
||||
a = new QAction( QPixmap::fromMimeSource( "editundo.xpm" ), tr( "&Undo" ), CTRL + Key_Z, this, "editUndo" );
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( editUndo() ) );
|
||||
a->addTo( tb );
|
||||
a->addTo( menu );
|
||||
a = new QAction( QPixmap::fromMimeSource( "editredo.xpm" ), tr( "&Redo" ), CTRL + Key_Y, this, "editRedo" );
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( editRedo() ) );
|
||||
a->addTo( tb );
|
||||
a->addTo( menu );
|
||||
menu->insertSeparator();
|
||||
a = new QAction( tr( "Select &All" ), CTRL + Key_A, this, "editSelectAll" );
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( editSelectAll() ) );
|
||||
a->addTo( menu );
|
||||
menu->insertSeparator();
|
||||
a = new QAction( QPixmap::fromMimeSource( "editcopy.xpm" ), tr( "&Copy" ), CTRL + Key_C, this, "editCopy" );
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( editCopy() ) );
|
||||
a->addTo( tb );
|
||||
a->addTo( menu );
|
||||
a = new QAction( QPixmap::fromMimeSource( "editcut.xpm" ), tr( "Cu&t" ), CTRL + Key_X, this, "editCut" );
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( editCut() ) );
|
||||
a->addTo( tb );
|
||||
a->addTo( menu );
|
||||
a = new QAction( QPixmap::fromMimeSource( "editpaste.xpm" ), tr( "&Paste" ), CTRL + Key_V, this, "editPaste" );
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( editPaste() ) );
|
||||
a->addTo( tb );
|
||||
a->addTo( menu );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::setupTextActions()
|
||||
{
|
||||
QToolBar *tb = new QToolBar( this );
|
||||
tb->setLabel( "Format Actions" );
|
||||
|
||||
fComboFont = new QComboBox( TRUE, tb );
|
||||
QFontDatabase db;
|
||||
fComboFont->insertStringList( db.families() );
|
||||
connect( fComboFont, SIGNAL( activated( const QString & ) ),
|
||||
this, SLOT( textFamily( const QString & ) ) );
|
||||
fComboFont->lineEdit()->setText( "Courier" );
|
||||
|
||||
fComboSize = new QComboBox( TRUE, tb );
|
||||
QValueList<int> sizes = db.standardSizes();
|
||||
QValueList<int>::Iterator it = sizes.begin();
|
||||
for ( ; it != sizes.end(); ++it )
|
||||
fComboSize->insertItem( QString::number( *it ) );
|
||||
connect( fComboSize, SIGNAL( activated( const QString & ) ),
|
||||
this, SLOT( textSize( const QString & ) ) );
|
||||
fComboSize->lineEdit()->setText( "11" ); // 11pt font size
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::setupMusrActions()
|
||||
{
|
||||
QToolBar *tb = new QToolBar( this );
|
||||
tb->setLabel( "Musr Actions" );
|
||||
QPopupMenu *menu = new QPopupMenu( this );
|
||||
menuBar()->insertItem( tr( "&MusrFit" ), menu );
|
||||
|
||||
QAction *a;
|
||||
a = new QAction( QPixmap::fromMimeSource( "musrasym.xpm" ), tr( "&Asymetry Default" ), CTRL + SHIFT + Key_A, this, "musrGetAsymetryDefault" );
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( musrGetAsymetryDefault() ) );
|
||||
a->addTo( tb );
|
||||
a->addTo( menu );
|
||||
|
||||
a = new QAction( QPixmap::fromMimeSource( "musrsinglehisto.xpm" ), tr( "Single &Histo Default" ), CTRL + SHIFT + Key_H, this, "musrGetSinglHistoDefault" );
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( musrGetSingleHistoDefault() ) );
|
||||
a->addTo( tb );
|
||||
a->addTo( menu );
|
||||
|
||||
a = new QAction( QPixmap::fromMimeSource( "musrcalcchisq.xpm" ), tr( "Calc Chisq" ), CTRL + SHIFT + Key_C, this, "cacluates for the given parameters chiSq/maxLH" );
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( musrCalcChisq() ) );
|
||||
a->addTo( tb );
|
||||
a->addTo( menu );
|
||||
|
||||
a = new QAction( QPixmap::fromMimeSource( "musrfit.xpm" ), tr( "&Fit" ), CTRL + SHIFT + Key_F, this, "musrFit" );
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( musrFit() ) );
|
||||
a->addTo( tb );
|
||||
a->addTo( menu );
|
||||
|
||||
a = new QAction( QPixmap::fromMimeSource( "musrview.xpm" ), tr( "&View" ), CTRL + SHIFT + Key_V, this, "musrView" );
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( musrView() ) );
|
||||
a->addTo( tb );
|
||||
a->addTo( menu );
|
||||
|
||||
a = new QAction( QPixmap::fromMimeSource( "musrt0.xpm" ), tr( "&T0" ), 0, this, "musrT0" );
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( musrT0() ) );
|
||||
a->addTo( tb );
|
||||
a->addTo( menu );
|
||||
|
||||
a = new QAction( QPixmap::fromMimeSource( "musrprefs.xpm" ), tr( "&Preferences" ), 0, this, "musrPrefs" );
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( musrPrefs() ) );
|
||||
a->addTo( tb );
|
||||
a->addTo( menu );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::setupHelpActions()
|
||||
{
|
||||
QPopupMenu *menu = new QPopupMenu( this );
|
||||
menuBar()->insertItem( tr( "&Help" ), menu);
|
||||
|
||||
QAction *a;
|
||||
a = new QAction(tr( "Contents ..." ), 0, this, "help contents");
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( helpContents() ));
|
||||
a->addTo( menu );
|
||||
|
||||
a = new QAction(tr( "About ..." ), 0, this, "about");
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( helpAbout() ));
|
||||
a->addTo( menu );
|
||||
|
||||
a = new QAction(tr( "About Qt..." ), 0, this, "about Qt");
|
||||
connect( a, SIGNAL( activated() ), this, SLOT( helpAboutQt() ));
|
||||
a->addTo( menu );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::load( const QString &f )
|
||||
{
|
||||
if ( !QFile::exists( f ) )
|
||||
return;
|
||||
QTextEdit *edit = new QTextEdit( fTabWidget );
|
||||
edit->setTextFormat( PlainText );
|
||||
edit->setFamily("Courier");
|
||||
edit->setPointSize(11); // 11pt
|
||||
edit->setFont(QFont("Courier", 11));
|
||||
fTabWidget->addTab( edit, QFileInfo( f ).fileName() );
|
||||
QFile file( f );
|
||||
if ( !file.open( IO_ReadOnly ) )
|
||||
return;
|
||||
QTextStream ts( &file );
|
||||
QString txt = ts.read();
|
||||
edit->setText( txt );
|
||||
doConnections( edit );
|
||||
fTabWidget->showPage( edit );
|
||||
edit->viewport()->setFocus();
|
||||
fFilenames.replace( edit, f );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
QTextEdit *PTextEdit::currentEditor() const
|
||||
{
|
||||
if ( fTabWidget->currentPage() && fTabWidget->currentPage()->inherits( "QTextEdit" ) )
|
||||
return (QTextEdit*)fTabWidget->currentPage();
|
||||
return 0;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::doConnections( QTextEdit *e )
|
||||
{
|
||||
connect( e, SIGNAL( currentFontChanged( const QFont & ) ),
|
||||
this, SLOT( fontChanged( const QFont & ) ) );
|
||||
|
||||
connect( e, SIGNAL( textChanged() ), this, SLOT( textChanged() ));
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::fileNew()
|
||||
{
|
||||
QTextEdit *edit = new QTextEdit( fTabWidget );
|
||||
edit->setTextFormat( PlainText );
|
||||
edit->setFamily("Courier");
|
||||
edit->setPointSize(11); // 11pt
|
||||
doConnections( edit );
|
||||
fTabWidget->addTab( edit, tr( "noname" ) );
|
||||
fTabWidget->showPage( edit );
|
||||
edit->viewport()->setFocus();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::fileOpen()
|
||||
{
|
||||
QStringList flns = QFileDialog::getOpenFileNames(
|
||||
tr( "msr-Files (*.msr *.mlog);;All Files (*)" ),
|
||||
tr( fAdmin->getDefaultSavePath() ), this);
|
||||
|
||||
QStringList::Iterator it = flns.begin();
|
||||
while( it != flns.end() ) {
|
||||
load(*it);
|
||||
++it;
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::fileSave()
|
||||
{
|
||||
if ( !currentEditor() )
|
||||
return;
|
||||
|
||||
if ( fFilenames.find( currentEditor() ) == fFilenames.end() ) {
|
||||
fileSaveAs();
|
||||
} else {
|
||||
QFile file( *fFilenames.find( currentEditor() ) );
|
||||
if ( !file.open( IO_WriteOnly ) )
|
||||
return;
|
||||
QTextStream ts( &file );
|
||||
ts << currentEditor()->text();
|
||||
|
||||
// remove trailing '*' modification indicators
|
||||
QString fln = *fFilenames.find( currentEditor() );
|
||||
fTabWidget->setTabLabel(fTabWidget->currentPage(), QFileInfo(fln).fileName());
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::fileSaveAs()
|
||||
{
|
||||
if ( !currentEditor() )
|
||||
return;
|
||||
|
||||
QString fn = QFileDialog::getSaveFileName( QString::null, tr( "msr-Files (*.msr *.mlog);;All Files (*)" ), this );
|
||||
if ( !fn.isEmpty() ) {
|
||||
fFilenames.replace( currentEditor(), fn );
|
||||
fileSave();
|
||||
fTabWidget->setTabLabel( currentEditor(), QFileInfo( fn ).fileName() );
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::filePrint()
|
||||
{
|
||||
if ( !currentEditor() )
|
||||
return;
|
||||
#ifndef QT_NO_PRINTER
|
||||
QPrinter printer( QPrinter::HighResolution );
|
||||
printer.setFullPage(TRUE);
|
||||
if ( printer.setup( this ) ) {
|
||||
QPainter p( &printer );
|
||||
// Check that there is a valid device to print to.
|
||||
if ( !p.device() ) return;
|
||||
QPaintDeviceMetrics metrics( p.device() );
|
||||
int dpiy = metrics.logicalDpiY();
|
||||
int margin = (int) ( (2/2.54)*dpiy ); // 2 cm margins
|
||||
QRect view( margin, margin, metrics.width() - 2*margin, metrics.height() - 2*margin );
|
||||
QFont font( currentEditor()->QWidget::font() );
|
||||
font.setPointSize( 10 ); // we define 10pt to be a nice base size for printing
|
||||
|
||||
QSimpleRichText richText( currentEditor()->text(), font,
|
||||
currentEditor()->context(),
|
||||
currentEditor()->styleSheet(),
|
||||
currentEditor()->mimeSourceFactory(),
|
||||
view.height() );
|
||||
richText.setWidth( &p, view.width() );
|
||||
int page = 1;
|
||||
do {
|
||||
richText.draw( &p, margin, margin, view, colorGroup() );
|
||||
view.moveBy( 0, view.height() );
|
||||
p.translate( 0 , -view.height() );
|
||||
p.setFont( font );
|
||||
p.drawText( view.right() - p.fontMetrics().width( QString::number( page ) ),
|
||||
view.bottom() + p.fontMetrics().ascent() + 5, QString::number( page ) );
|
||||
if ( view.top() - margin >= richText.height() )
|
||||
break;
|
||||
printer.newPage();
|
||||
page++;
|
||||
} while (TRUE);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::fileClose()
|
||||
{
|
||||
// check if the has modification
|
||||
int idx = fTabWidget->currentPageIndex();
|
||||
if (fTabWidget->label(idx).find("*")>0) {
|
||||
int result = QMessageBox::warning(this, "**WARNING**",
|
||||
"Do you really want to close this file.\nChanges will be lost",
|
||||
QMessageBox::Yes, QMessageBox::Cancel);
|
||||
if (result == QMessageBox::Cancel)
|
||||
return;
|
||||
}
|
||||
|
||||
delete currentEditor();
|
||||
if ( currentEditor() )
|
||||
currentEditor()->viewport()->setFocus();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::fileExit()
|
||||
{
|
||||
// check if there are still some modified files open
|
||||
for (int i=0; i < fTabWidget->count(); i++) {
|
||||
if (fTabWidget->label(i).find("*") > 0) {
|
||||
int result = QMessageBox::warning(this, "**WARNING**",
|
||||
"Do you really want to exit from the applcation.\nChanges will be lost",
|
||||
QMessageBox::Yes, QMessageBox::Cancel);
|
||||
if (result == QMessageBox::Cancel)
|
||||
return;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
qApp->quit();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::editUndo()
|
||||
{
|
||||
if ( !currentEditor() )
|
||||
return;
|
||||
currentEditor()->undo();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::editRedo()
|
||||
{
|
||||
if ( !currentEditor() )
|
||||
return;
|
||||
currentEditor()->redo();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::editSelectAll()
|
||||
{
|
||||
if ( !currentEditor() )
|
||||
return;
|
||||
currentEditor()->selectAll();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::editCut()
|
||||
{
|
||||
if ( !currentEditor() )
|
||||
return;
|
||||
currentEditor()->cut();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::editCopy()
|
||||
{
|
||||
if ( !currentEditor() )
|
||||
return;
|
||||
currentEditor()->copy();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::editPaste()
|
||||
{
|
||||
if ( !currentEditor() )
|
||||
return;
|
||||
currentEditor()->paste();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::textFamily( const QString &f )
|
||||
{
|
||||
if ( !currentEditor() )
|
||||
return;
|
||||
currentEditor()->setFamily( f );
|
||||
currentEditor()->viewport()->setFocus();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::textSize( const QString &p )
|
||||
{
|
||||
if ( !currentEditor() )
|
||||
return;
|
||||
currentEditor()->setPointSize( p.toInt() );
|
||||
currentEditor()->viewport()->setFocus();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::musrGetAsymetryDefault()
|
||||
{
|
||||
QString runFileName, beamline, institute, fileFormat;
|
||||
|
||||
PGetDefaultDialog *dlg = new PGetDefaultDialog();
|
||||
// set defaults
|
||||
dlg->fBeamline_lineEdit->setText(fAdmin->getBeamline());
|
||||
|
||||
for (int i=0; i<dlg->fInstitute_comboBox->count(); i++) {
|
||||
if (dlg->fInstitute_comboBox->text(i).lower() == fAdmin->getInstitute().lower()) {
|
||||
dlg->fInstitute_comboBox->setCurrentItem(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<dlg->fFileFormat_comboBox->count(); i++) {
|
||||
if (dlg->fFileFormat_comboBox->text(i).lower() == fAdmin->getFileFormat().lower()) {
|
||||
dlg->fFileFormat_comboBox->setCurrentItem(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
dlg->exec();
|
||||
|
||||
if (dlg->result() != QDialog::Accepted) {
|
||||
delete dlg;
|
||||
return;
|
||||
}
|
||||
|
||||
runFileName = dlg->getRunFileName();
|
||||
beamline = dlg->getBeamline();
|
||||
institute = dlg->getInstitute();
|
||||
fileFormat = dlg->getFileFormat();
|
||||
delete dlg;
|
||||
|
||||
QFile file(fAdmin->getMsrDefaultFilePath()+"/asymDefault.msr");
|
||||
if (file.open(IO_ReadOnly)) {
|
||||
// make a new file tab
|
||||
fileNew();
|
||||
QTextStream ts( &file );
|
||||
QString line;
|
||||
while ( !ts.atEnd() ) {
|
||||
line = ts.readLine(); // line of text excluding '\n'
|
||||
if (line.startsWith("RUN")) {
|
||||
QString runHeader = "RUN " + runFileName + " " + beamline.upper() + " " + institute + " " + fileFormat.upper() + " (name beamline institute data-file-format)\n";
|
||||
currentEditor()->insert(runHeader);
|
||||
} else { // just copy the text
|
||||
currentEditor()->insert(line+"\n");
|
||||
}
|
||||
}
|
||||
currentEditor()->setContentsPos(0, 0);
|
||||
|
||||
file.close();
|
||||
} else {
|
||||
QMessageBox::critical(this, "**ERROR**",
|
||||
"Couldn't find default asymmetry file template :-(",
|
||||
QMessageBox::Ok, QMessageBox::NoButton);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::musrGetSingleHistoDefault()
|
||||
{
|
||||
QString runFileName, beamline, institute, fileFormat;
|
||||
|
||||
PGetDefaultDialog *dlg = new PGetDefaultDialog();
|
||||
// set defaults
|
||||
dlg->fBeamline_lineEdit->setText(fAdmin->getBeamline());
|
||||
|
||||
for (int i=0; i<dlg->fInstitute_comboBox->count(); i++) {
|
||||
if (dlg->fInstitute_comboBox->text(i).lower() == fAdmin->getInstitute().lower()) {
|
||||
dlg->fInstitute_comboBox->setCurrentItem(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0; i<dlg->fFileFormat_comboBox->count(); i++) {
|
||||
if (dlg->fFileFormat_comboBox->text(i).lower() == fAdmin->getFileFormat().lower()) {
|
||||
dlg->fFileFormat_comboBox->setCurrentItem(i);
|
||||
break;
|
||||
}
|
||||
}
|
||||
dlg->exec();
|
||||
|
||||
if (dlg->result() != QDialog::Accepted) {
|
||||
delete dlg;
|
||||
return;
|
||||
}
|
||||
|
||||
runFileName = dlg->getRunFileName();
|
||||
beamline = dlg->getBeamline();
|
||||
institute = dlg->getInstitute();
|
||||
fileFormat = dlg->getFileFormat();
|
||||
delete dlg;
|
||||
|
||||
QFile file(fAdmin->getMsrDefaultFilePath()+"/singleHistoDefault.msr");
|
||||
if (file.open(IO_ReadOnly)) {
|
||||
// make a new file tab
|
||||
fileNew();
|
||||
QTextStream ts( &file );
|
||||
QString line;
|
||||
while ( !ts.atEnd() ) {
|
||||
line = ts.readLine(); // line of text excluding '\n'
|
||||
if (line.startsWith("RUN")) {
|
||||
QString runHeader = "RUN " + runFileName + " " + beamline.upper() + " " + institute + " " + fileFormat.upper() + " (name beamline institute data-file-format)\n";
|
||||
currentEditor()->insert(runHeader);
|
||||
} else { // just copy the text
|
||||
currentEditor()->insert(line+"\n");
|
||||
}
|
||||
}
|
||||
currentEditor()->setContentsPos(0, 0);
|
||||
|
||||
file.close();
|
||||
} else {
|
||||
QMessageBox::critical(this, "**ERROR**",
|
||||
"Couldn't find default single histo file template :-(",
|
||||
QMessageBox::Ok, QMessageBox::NoButton);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::musrCalcChisq()
|
||||
{
|
||||
if ( !currentEditor() )
|
||||
return;
|
||||
|
||||
QValueVector<QString> cmd;
|
||||
QString str;
|
||||
str = fAdmin->getExecPath() + "/musrfit";
|
||||
|
||||
cmd.append(str);
|
||||
cmd.append(*fFilenames.find( currentEditor()));
|
||||
cmd.append("--chisq-only");
|
||||
PFitOutputHandler fitOutputHandler(cmd);
|
||||
fitOutputHandler.setModal(true);
|
||||
fitOutputHandler.exec();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::musrFit()
|
||||
{
|
||||
if ( !currentEditor() )
|
||||
return;
|
||||
|
||||
QValueVector<QString> cmd;
|
||||
QString str;
|
||||
str = fAdmin->getExecPath() + "/musrfit";
|
||||
|
||||
cmd.append(str);
|
||||
cmd.append(*fFilenames.find( currentEditor()));
|
||||
PFitOutputHandler fitOutputHandler(cmd);
|
||||
fitOutputHandler.setModal(true);
|
||||
fitOutputHandler.exec();
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::musrView()
|
||||
{
|
||||
if ( !currentEditor() )
|
||||
return;
|
||||
|
||||
QMessageBox::information( this, "musrView",
|
||||
"Will call musrview.\n"
|
||||
"NOT IMPLEMENTED YET :-(" );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::musrT0()
|
||||
{
|
||||
if ( !currentEditor() )
|
||||
return;
|
||||
|
||||
QMessageBox::information( this, "musrT0",
|
||||
"Will call musrt0.\n"
|
||||
"NOT IMPLEMENTED YET :-(" );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::musrPrefs()
|
||||
{
|
||||
QMessageBox::information( this, "musrPrefs",
|
||||
"Will call musr related perferences dialog.\n"
|
||||
"NOT IMPLEMENTED YET :-(" );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::helpContents()
|
||||
{
|
||||
QMessageBox::information( this, "helpContents",
|
||||
"Will deliver eventually a help content.\n"
|
||||
"NOT IMPLEMENTED YET :-(" );
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::helpAbout()
|
||||
{
|
||||
QMessageBox::about(this, "MuSR-GUI",
|
||||
"andreas.suter@psi.ch");
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::helpAboutQt()
|
||||
{
|
||||
QMessageBox::aboutQt(this);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::fontChanged( const QFont &f )
|
||||
{
|
||||
currentEditor()->selectAll();
|
||||
fComboFont->lineEdit()->setText( f.family() );
|
||||
fComboSize->lineEdit()->setText( QString::number( f.pointSize() ) );
|
||||
currentEditor()->setFamily( f.family() );
|
||||
currentEditor()->setPointSize( f.pointSize() );
|
||||
currentEditor()->viewport()->setFocus();
|
||||
currentEditor()->selectAll(false);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PTextEdit::textChanged()
|
||||
{
|
||||
if (!currentEditor())
|
||||
return;
|
||||
|
||||
QString tabLabel = fTabWidget->label(fTabWidget->currentPageIndex());
|
||||
|
||||
if ((fTabWidget->label(fTabWidget->currentPageIndex()).find("*") > 0) &&
|
||||
!currentEditor()->isModified()) {
|
||||
tabLabel.truncate(tabLabel.length()-1);
|
||||
fTabWidget->setTabLabel(fTabWidget->currentPage(), tabLabel);
|
||||
}
|
||||
|
||||
if ((fTabWidget->label(fTabWidget->currentPageIndex()).find("*") < 0) &&
|
||||
currentEditor()->isModified())
|
||||
fTabWidget->setTabLabel(fTabWidget->currentPage(), tabLabel+"*");
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// END
|
||||
//----------------------------------------------------------------------------------------------------
|
108
src/musrgui/PTextEdit.h
Normal file
108
src/musrgui/PTextEdit.h
Normal file
@ -0,0 +1,108 @@
|
||||
/****************************************************************************
|
||||
|
||||
PTextEdit.h
|
||||
|
||||
Author: Andreas Suter
|
||||
e-mail: andreas.suter@psi.ch
|
||||
|
||||
$Id$
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef _PTEXTEDIT_H_
|
||||
#define _PTEXTEDIT_H_
|
||||
|
||||
#include <qmainwindow.h>
|
||||
#include <qmap.h>
|
||||
|
||||
class PAdmin;
|
||||
class QAction;
|
||||
class QComboBox;
|
||||
class QTabWidget;
|
||||
class QTextEdit;
|
||||
|
||||
class PTextEdit : public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
PTextEdit( QWidget *parent = 0, const char *name = 0 );
|
||||
|
||||
private:
|
||||
void setupFileActions();
|
||||
void setupEditActions();
|
||||
void setupTextActions();
|
||||
void setupMusrActions();
|
||||
void setupHelpActions();
|
||||
void load( const QString &f );
|
||||
QTextEdit *currentEditor() const;
|
||||
void doConnections( QTextEdit *e );
|
||||
|
||||
private slots:
|
||||
void fileNew();
|
||||
void fileOpen();
|
||||
void fileSave();
|
||||
void fileSaveAs();
|
||||
void filePrint();
|
||||
void fileClose();
|
||||
void fileExit();
|
||||
|
||||
void editUndo();
|
||||
void editRedo();
|
||||
void editSelectAll();
|
||||
void editCut();
|
||||
void editCopy();
|
||||
void editPaste();
|
||||
|
||||
void textFamily( const QString &f );
|
||||
void textSize( const QString &p );
|
||||
|
||||
void musrGetAsymetryDefault();
|
||||
void musrGetSingleHistoDefault();
|
||||
void musrCalcChisq();
|
||||
void musrFit();
|
||||
void musrView();
|
||||
void musrT0();
|
||||
void musrPrefs();
|
||||
|
||||
void helpContents();
|
||||
void helpAboutQt();
|
||||
void helpAbout();
|
||||
|
||||
void fontChanged( const QFont &f );
|
||||
void textChanged();
|
||||
|
||||
private:
|
||||
PAdmin *fAdmin;
|
||||
|
||||
bool fShowMlog;
|
||||
|
||||
QComboBox *fComboFont;
|
||||
QComboBox *fComboSize;
|
||||
|
||||
QTabWidget *fTabWidget;
|
||||
QMap<QTextEdit*, QString> fFilenames;
|
||||
};
|
||||
|
||||
|
||||
#endif // _PTEXTEDIT_H_
|
59
src/musrgui/asymDefault.msr
Normal file
59
src/musrgui/asymDefault.msr
Normal file
@ -0,0 +1,59 @@
|
||||
TITLE
|
||||
###############################################################
|
||||
FITPARAMETER
|
||||
# Nr. Name Value Step Pos_Error Bounderies
|
||||
1 alpha 0.989765 1.0 none 0 none
|
||||
2 asy 0.26 0.1 none 0 0.33
|
||||
3 phase 8.5 1.0 none
|
||||
4 field 100.0 0.1 none 0 none
|
||||
5 rate 0.36 0.02 none 0 100
|
||||
|
||||
###############################################################
|
||||
THEORY
|
||||
asymmetry 2
|
||||
TFieldCos 3 fun1 (phase frequency)
|
||||
simplExpo 5
|
||||
|
||||
###############################################################
|
||||
FUNCTIONS
|
||||
fun1 = par4 * gamma_mu
|
||||
|
||||
###############################################################
|
||||
RUN lem07_his_0147 MUE4 PSI ROOT-NPP (name beamline institute data-file-format)
|
||||
fittype 2 (asymmetry fit)
|
||||
alpha 1
|
||||
map 0 0 0 0 0 0 0 0 0 0
|
||||
forward 1
|
||||
backward 3
|
||||
background 65000 66500 65000 66500
|
||||
data 3413 63000 3413 63000
|
||||
t0 3413 3413
|
||||
fit 0.00 8.00 (fw bw)
|
||||
packing 75
|
||||
|
||||
###############################################################
|
||||
COMMANDS
|
||||
SET BATCH
|
||||
MINIMIZE
|
||||
MINOS
|
||||
SAVE
|
||||
END RETURN
|
||||
|
||||
###############################################################
|
||||
FOURIER
|
||||
units Gauss # fourier in field units
|
||||
fourier_power 12
|
||||
apodization NONE # NONE, WEAK, MEDIUM, STRONG
|
||||
plot power
|
||||
phase 8.5
|
||||
#range_for_phase_correction 50.0 70.0
|
||||
range 0.0 200.0
|
||||
|
||||
###############################################################
|
||||
PLOT 2 (asymmetry plot)
|
||||
runs 1
|
||||
range 0.00 8.00 -0.30 0.30
|
||||
|
||||
###############################################################
|
||||
STATISTIC --- 2008-04-04 07:44:31
|
||||
chisq = 569.50931, NDF = 542, chisq/NDF = 1.05075518
|
36
src/musrgui/editcopy.xpm
Normal file
36
src/musrgui/editcopy.xpm
Normal file
@ -0,0 +1,36 @@
|
||||
/* XPM */
|
||||
static char *magick[] = {
|
||||
/* columns rows colors chars-per-pixel */
|
||||
"22 22 8 1",
|
||||
" c Gray100",
|
||||
". c #8b8bfd",
|
||||
"X c #3c3cfd",
|
||||
"o c #000082",
|
||||
"O c Gray0",
|
||||
"+ c None",
|
||||
"@ c Gray0",
|
||||
"# c Gray0",
|
||||
/* pixels */
|
||||
"++++++++++++++++++++++",
|
||||
"++++++++++++++++++++++",
|
||||
"OOOOOOOO++++++++++++++",
|
||||
"O OO+++++++++++++",
|
||||
"O OOOO O O++++++++++++",
|
||||
"O O O+++++++++++",
|
||||
"O OOOO Ooooooooo++++++",
|
||||
"O Oo oo+++++",
|
||||
"O OOOOO o OOOO oXo++++",
|
||||
"O o o.Xo+++",
|
||||
"O OOOOO o OOOO o .Xo++",
|
||||
"O o oooooo+",
|
||||
"O OOOOO o OOOO o+",
|
||||
"O o o+",
|
||||
"O OOOOO o OOOOOOOOO o+",
|
||||
"O o o+",
|
||||
"OOOOOOOOo OOOOOOOOO o+",
|
||||
"++++++++o o+",
|
||||
"++++++++o OOOOOOOOO o+",
|
||||
"++++++++o o+",
|
||||
"++++++++ooooooooooooo+",
|
||||
"++++++++++++++++++++++"
|
||||
};
|
32
src/musrgui/editcut.xpm
Normal file
32
src/musrgui/editcut.xpm
Normal file
@ -0,0 +1,32 @@
|
||||
/* XPM */
|
||||
static char *magick[] = {
|
||||
/* columns rows colors chars-per-pixel */
|
||||
"22 22 4 1",
|
||||
" c Gray100",
|
||||
". c #000082",
|
||||
"X c Gray0",
|
||||
"o c None",
|
||||
/* pixels */
|
||||
"oooooooooooooooooooooo",
|
||||
"oooooooXoooooXoooooooo",
|
||||
"oooooooXoooooXoooooooo",
|
||||
"oooooooXoooooXoooooooo",
|
||||
"oooooooXooooXXoooooooo",
|
||||
"oooooooXXoooXooooooooo",
|
||||
"ooooooooXoooXooooooooo",
|
||||
"ooooooooXXoXXooooooooo",
|
||||
"oooooooooXXXoooooooooo",
|
||||
"oooooooooXXXoooooooooo",
|
||||
"ooooooooooXooooooooooo",
|
||||
"ooooooooo.X.oooooooooo",
|
||||
"oooooooo..o...oooooooo",
|
||||
"ooooooo.o.o.oo.ooooooo",
|
||||
"oooooo.oo.o.ooo.oooooo",
|
||||
"ooooo.ooo.o.oooo.ooooo",
|
||||
"oooo.oooo.o.oooo.ooooo",
|
||||
"oooo.oooo.oo.ooo.ooooo",
|
||||
"oooo.oooo.oo.oo.oooooo",
|
||||
"oooo.ooo.oooo..ooooooo",
|
||||
"ooooo...oooooooooooooo",
|
||||
"oooooooooooooooooooooo"
|
||||
};
|
36
src/musrgui/editpaste.xpm
Normal file
36
src/musrgui/editpaste.xpm
Normal file
@ -0,0 +1,36 @@
|
||||
/* XPM */
|
||||
static char *magick[] = {
|
||||
/* columns rows colors chars-per-pixel */
|
||||
"22 22 8 1",
|
||||
" c Gray100",
|
||||
". c Yellow",
|
||||
"X c #c6c3c6",
|
||||
"o c #848284",
|
||||
"O c #848200",
|
||||
"+ c #000084",
|
||||
"@ c Gray0",
|
||||
"# c None",
|
||||
/* pixels */
|
||||
"######################",
|
||||
"#######@@@@@##########",
|
||||
"##@@@@@@...@@@@@@#####",
|
||||
"#@@@@@@.....@@@@@@####",
|
||||
"@@oOo@@.@@@.@@oOo@@###",
|
||||
"@oOo@XXXXXXXXX@oOo@###",
|
||||
"@OoO@XXXXXXXXX@OoO@###",
|
||||
"@oOo@@@@@@@@@@@oOo@###",
|
||||
"@OoOoOoOoOoOoOoOoO@###",
|
||||
"@oOoOoOoOoOoOoOoOo@###",
|
||||
"@OoOoOoO++++++++++@###",
|
||||
"@oOoOoOo+ + +###",
|
||||
"@OoOoOoO+ +++++ + +##",
|
||||
"@oOoOoOo+ + +#",
|
||||
"@OoOoOoO+ +++++ + +",
|
||||
"@oOoOoOo+ ++++++",
|
||||
"@OoOoOoO+ +++++ +",
|
||||
"@oOoOoOo+ +",
|
||||
"@OoOoOoO+ ++++++++++ +",
|
||||
"#@@@@@@@+ +",
|
||||
"########++++++++++++++",
|
||||
"######################"
|
||||
};
|
36
src/musrgui/editredo.xpm
Normal file
36
src/musrgui/editredo.xpm
Normal file
@ -0,0 +1,36 @@
|
||||
/* XPM */
|
||||
static char *magick[] = {
|
||||
/* columns rows colors chars-per-pixel */
|
||||
"22 22 8 1",
|
||||
" c Gray100",
|
||||
". c #848284",
|
||||
"X c #000084",
|
||||
"o c Gray0",
|
||||
"O c None",
|
||||
"+ c Gray0",
|
||||
"@ c Gray0",
|
||||
"# c Gray0",
|
||||
/* pixels */
|
||||
"OOOOOOOOOOOOOOOOOOOOOO",
|
||||
"OOOOOOOOOOOOOOOOOOOOOO",
|
||||
"OOOOOOOOOOOOOOOOOOOOOO",
|
||||
"OOOOOOOOOOOOOOOOOOOOOO",
|
||||
"OOOOOOOOOOOOOOOOOOOOOO",
|
||||
"OOOO.XXXXXXOOOOOOOOOOO",
|
||||
"OOOXXXXXXXXXXOOOOOOXOO",
|
||||
"OO.XXOOOOOOXXXXOOOXXOO",
|
||||
"OOXXOOOOOOOOOXXXOXXXOO",
|
||||
"OOXXOOOOOOOOOOXXXXXXOO",
|
||||
"OOXXOOOOOOOOOOOXXXXXOO",
|
||||
"OOXXOOOOOOOOOOXXXXXXOO",
|
||||
"OOXXOOOOOOOOOXXXXXXXOO",
|
||||
"OO.XXOOOOOOOXXXXXXXXOO",
|
||||
"OOOXXX.OOOOOOOOOOOOOOO",
|
||||
"OOOOXXXOOOOOOOOOOOOOOO",
|
||||
"OOOOOOOOOOOOOOOOOOOOOO",
|
||||
"OOOOOOOOOOOOOOOOOOOOOO",
|
||||
"OOOOOOOOOOOOOOOOOOOOOO",
|
||||
"OOOOOOOOOOOOOOOOOOOOOO",
|
||||
"OOOOOOOOOOOOOOOOOOOOOO",
|
||||
"OOOOOOOOOOOOOOOOOOOOOO"
|
||||
};
|
36
src/musrgui/editundo.xpm
Normal file
36
src/musrgui/editundo.xpm
Normal file
@ -0,0 +1,36 @@
|
||||
/* XPM */
|
||||
static char *magick[] = {
|
||||
/* columns rows colors chars-per-pixel */
|
||||
"22 22 8 1",
|
||||
" c Gray100",
|
||||
". c #848284",
|
||||
"X c #000084",
|
||||
"o c Gray0",
|
||||
"O c None",
|
||||
"+ c Gray0",
|
||||
"@ c Gray0",
|
||||
"# c Gray0",
|
||||
/* pixels */
|
||||
"OOOOOOOOOOOOOOOOOOOOOO",
|
||||
"OOOOOOOOOOOOOOOOOOOOOO",
|
||||
"OOOOOOOOOOOOOOOOOOOOOO",
|
||||
"OOOOOOOOOOOOOOOOOOOOOO",
|
||||
"OOOOOOOOOOOOOOOOOOOOOO",
|
||||
"OOOOOOOOOOOXXXXXX.OOOO",
|
||||
"OOXOOOOOOXXXXXXXXXXOOO",
|
||||
"OOXXOOOXXXXOOOOOOXX.OO",
|
||||
"OOXXXOXXXOOOOOOOOOXXOO",
|
||||
"OOXXXXXXOOOOOOOOOOXXOO",
|
||||
"OOXXXXXOOOOOOOOOOOXXOO",
|
||||
"OOXXXXXXOOOOOOOOOOXXOO",
|
||||
"OOXXXXXXXOOOOOOOOOXXOO",
|
||||
"OOXXXXXXXXOOOOOOOXX.OO",
|
||||
"OOOOOOOOOOOOOOO.XXXOOO",
|
||||
"OOOOOOOOOOOOOOOXXXOOOO",
|
||||
"OOOOOOOOOOOOOOOOOOOOOO",
|
||||
"OOOOOOOOOOOOOOOOOOOOOO",
|
||||
"OOOOOOOOOOOOOOOOOOOOOO",
|
||||
"OOOOOOOOOOOOOOOOOOOOOO",
|
||||
"OOOOOOOOOOOOOOOOOOOOOO",
|
||||
"OOOOOOOOOOOOOOOOOOOOOO"
|
||||
};
|
36
src/musrgui/filenew.xpm
Normal file
36
src/musrgui/filenew.xpm
Normal file
@ -0,0 +1,36 @@
|
||||
/* XPM */
|
||||
static char *magick[] = {
|
||||
/* columns rows colors chars-per-pixel */
|
||||
"22 22 8 1",
|
||||
" c Gray100",
|
||||
". c Gray76",
|
||||
"X c Gray53",
|
||||
"o c Gray36",
|
||||
"O c Gray18",
|
||||
"+ c Gray0",
|
||||
"@ c None",
|
||||
"# c Gray0",
|
||||
/* pixels */
|
||||
"@@@@@@@@@@@@@@@@@@@@@@",
|
||||
"@@@@++++++++++@@@@@@@@",
|
||||
"@@@@+ +O+@@@@@@@",
|
||||
"@@@@+ +oO+@@@@@@",
|
||||
"@@@@+ +XoO+@@@@@",
|
||||
"@@@@+ +.XoO+@@@@",
|
||||
"@@@@+ + .XoO+@@@",
|
||||
"@@@@+ +++++++@@@",
|
||||
"@@@@+ +@@@",
|
||||
"@@@@+ +@@@",
|
||||
"@@@@+ +@@@",
|
||||
"@@@@+ +@@@",
|
||||
"@@@@+ +@@@",
|
||||
"@@@@+ +@@@",
|
||||
"@@@@+ +@@@",
|
||||
"@@@@+ +@@@",
|
||||
"@@@@+ +@@@",
|
||||
"@@@@+ +@@@",
|
||||
"@@@@+ +@@@",
|
||||
"@@@@+++++++++++++++@@@",
|
||||
"@@@@@@@@@@@@@@@@@@@@@@",
|
||||
"@@@@@@@@@@@@@@@@@@@@@@"
|
||||
};
|
36
src/musrgui/fileopen.xpm
Normal file
36
src/musrgui/fileopen.xpm
Normal file
@ -0,0 +1,36 @@
|
||||
/* XPM */
|
||||
static char *magick[] = {
|
||||
/* columns rows colors chars-per-pixel */
|
||||
"22 22 8 1",
|
||||
" c Gray100",
|
||||
". c Yellow",
|
||||
"X c #848200",
|
||||
"o c Gray0",
|
||||
"O c None",
|
||||
"+ c Gray0",
|
||||
"@ c Gray0",
|
||||
"# c Gray0",
|
||||
/* pixels */
|
||||
"OOOOOOOOOOOOOOOOOOOOOO",
|
||||
"OOOOOOOOOOOOOOOOOOOOOO",
|
||||
"OOOOOOOOOOOOOOOOOOOOOO",
|
||||
"OOOOOOOOOOOOooooOOOOoO",
|
||||
"OOOOOOOOOOOoOOOOooOooO",
|
||||
"OOOOOOOOOOOOOOOOOOoooO",
|
||||
"OOOOOOOOOOOOOOOOOooooO",
|
||||
"OooooOOOOOOOOOOOoooooO",
|
||||
"o. . ooooooooooOOOOOOO",
|
||||
"o . . . . . . oOOOOOOO",
|
||||
"o. . . . . . .oOOOOOOO",
|
||||
"o . . . . . . oOOOOOOO",
|
||||
"o. . . ooooooooooooooo",
|
||||
"o . . ooXXXXXXXXXXXXoo",
|
||||
"o. . ooXXXXXXXXXXXXooO",
|
||||
"o . ooXXXXXXXXXXXXooOO",
|
||||
"o. ooXXXXXXXXXXXXooOOO",
|
||||
"o ooXXXXXXXXXXXXooOOOO",
|
||||
"oooXXXXXXXXXXXXooOOOOO",
|
||||
"ooXXXXXXXXXXXXooOOOOOO",
|
||||
"oooooooooooooooOOOOOOO",
|
||||
"OOOOOOOOOOOOOOOOOOOOOO"
|
||||
};
|
117
src/musrgui/fileprint.xpm
Normal file
117
src/musrgui/fileprint.xpm
Normal file
@ -0,0 +1,117 @@
|
||||
/* XPM */
|
||||
static char *magick[] = {
|
||||
/* columns rows colors chars-per-pixel */
|
||||
"22 22 89 1",
|
||||
" c Gray0",
|
||||
". c #101008081010",
|
||||
"X c #101010101010",
|
||||
"o c #101010101818",
|
||||
"O c #181810101818",
|
||||
"+ c #181818181818",
|
||||
"@ c #181818182121",
|
||||
"# c #212118182121",
|
||||
"$ c Gray13",
|
||||
"% c #212121212929",
|
||||
"& c #292921212929",
|
||||
"* c Gray16",
|
||||
"= c #292929293131",
|
||||
"- c #313129293131",
|
||||
"; c #313131313131",
|
||||
": c #313131313939",
|
||||
"> c #393931313939",
|
||||
", c #393939393939",
|
||||
"< c #393939394242",
|
||||
"1 c #424239394242",
|
||||
"2 c Gray26",
|
||||
"3 c #4a4a4a4a5252",
|
||||
"4 c #5a5a52525a5a",
|
||||
"5 c #5a5a5a5a6363",
|
||||
"6 c #6b6b63636b6b",
|
||||
"7 c Gray42",
|
||||
"8 c #6b6b6b6b7373",
|
||||
"9 c #73736b6b7373",
|
||||
"0 c #7b7b73737b7b",
|
||||
"q c #7b7b73738484",
|
||||
"w c #0808ffff0808",
|
||||
"e c #2929ffff2929",
|
||||
"r c #3131ffff3131",
|
||||
"t c #5a5acece5a5a",
|
||||
"y c #6b6bffff6363",
|
||||
"u c #7b7bffff7b7b",
|
||||
"i c #84847b7b8484",
|
||||
"p c #84847b7b8c8c",
|
||||
"a c #8c8c7b7b9494",
|
||||
"s c #848484848c8c",
|
||||
"d c #8c8c84848c8c",
|
||||
"f c Gray55",
|
||||
"g c #8c8c84849494",
|
||||
"h c #8c8c8c8c9494",
|
||||
"j c #94948c8c9494",
|
||||
"k c #94948c8c9c9c",
|
||||
"l c Gray58",
|
||||
"z c #949494949c9c",
|
||||
"x c #9c9c94949c9c",
|
||||
"c c Gray61",
|
||||
"v c #9c9c9494a5a5",
|
||||
"b c #9c9c9c9ca5a5",
|
||||
"n c #a5a59c9ca5a5",
|
||||
"m c #a5a59c9cadad",
|
||||
"M c #adad9c9cadad",
|
||||
"N c #a5a5a5a5a5a5",
|
||||
"B c #a5a5a5a5adad",
|
||||
"V c #adada5a5adad",
|
||||
"C c Gray68",
|
||||
"Z c #adadadadb5b5",
|
||||
"A c #b5b5adadb5b5",
|
||||
"S c Gray71",
|
||||
"D c Gray74",
|
||||
"F c #9494c6c69494",
|
||||
"G c #9c9ccecea5a5",
|
||||
"H c #bdbdd6d6bdbd",
|
||||
"J c #c0c0c0c0c0c0",
|
||||
"K c #c6c6c6c6c6c6",
|
||||
"L c #cecec6c6cece",
|
||||
"P c #cececececece",
|
||||
"I c #cecececed6d6",
|
||||
"U c #d6d6ceced6d6",
|
||||
"Y c #d6d6cecedede",
|
||||
"T c Gray84",
|
||||
"R c #d6d6d6d6dede",
|
||||
"E c #deded6d6dede",
|
||||
"W c Gray87",
|
||||
"Q c #deded6d6e7e7",
|
||||
"! c #dedededee7e7",
|
||||
"~ c #d6d6ffffd6d6",
|
||||
"^ c #e7e7dedee7e7",
|
||||
"/ c #e7e7e7e7e7e7",
|
||||
"( c #e7e7e7e7efef",
|
||||
") c #efefe7e7efef",
|
||||
"_ c #efefefefefef",
|
||||
"` c #e7e7ffffe7e7",
|
||||
"' c Gray97",
|
||||
"] c Gray100",
|
||||
"[ c None",
|
||||
/* pixels */
|
||||
"[[[[[[SDPPPPKKDDCD[[[[",
|
||||
"[[[[[[D_/////___WD[[[[",
|
||||
"[[[[[[DKKKPPKKKKDK[[[[",
|
||||
"[[[[[[SDDDDSDDSSCD[[[[",
|
||||
"[[[[[KCKDKKKDDDKS[[[[[",
|
||||
"[[[[[DDSDDDDDDKKS[[[[[",
|
||||
"[[[[[DSKDDDDDKDKC[[[[[",
|
||||
"[[[[[KDDDDDDDDDDS[[[[[",
|
||||
"[[[[[CP/WWWWWWTWNNZ[[[",
|
||||
"[[[Dc9STPTPTPTWWj427S[",
|
||||
"[[Dziq0000000pag8<%@2N",
|
||||
"[DcE(!ERRRRUYGtFn2##O<",
|
||||
"Db)]]]]]]]]]~ewePa;@X#",
|
||||
"V']]]]]]]]]]`yru]Q0@ #",
|
||||
"BRILITRRW^!E!RHUILhO @",
|
||||
"jAZVBmBnmmNmnmMvzh6o #",
|
||||
"jZZmBnnnbnbbbbvxxg6o +",
|
||||
"lmmnbnbbbvcvxxxvjs6O 3",
|
||||
"jBnnvcvxvcvxvxzjhd8o+C",
|
||||
"lsdgfgdhgdhhjhjkhg6+l[",
|
||||
"S9%@$%&&&=--::>>:-:l[[",
|
||||
"[[C511,:;;;**%++.2c[[["
|
||||
};
|
36
src/musrgui/filesave.xpm
Normal file
36
src/musrgui/filesave.xpm
Normal file
@ -0,0 +1,36 @@
|
||||
/* XPM */
|
||||
static char *magick[] = {
|
||||
/* columns rows colors chars-per-pixel */
|
||||
"22 22 8 1",
|
||||
" c Gray100",
|
||||
". c #cab5d1",
|
||||
"X c #c1c1c1",
|
||||
"o c #848200",
|
||||
"O c Gray0",
|
||||
"+ c None",
|
||||
"@ c Gray0",
|
||||
"# c Gray0",
|
||||
/* pixels */
|
||||
"++++++++++++++++++++++",
|
||||
"+OOOOOOOOOOOOOOOOOOOO+",
|
||||
"+OooOXXXXXXXXXXXXOXXO+",
|
||||
"+OooOXXXXXXXXXXXXOXXO+",
|
||||
"+OooOXXXXXXXXX.XXOOOO+",
|
||||
"+OooOXXX..XXXXXXXOooO+",
|
||||
"+OooOXXX..XXXXXXXOooO+",
|
||||
"+OooOXXXXXXXXXXXXOooO+",
|
||||
"+OooOXXXXXXXXXXXXOooO+",
|
||||
"+OooOXXXXXXXXXXXXOooO+",
|
||||
"+OooOXXXXXXXXXXXXOooO+",
|
||||
"+OoooOOOOOOOOOOOOoooO+",
|
||||
"+OooooooooooooooooooO+",
|
||||
"+OooooooooooooooooooO+",
|
||||
"+OoooOOOOOOOOOOOOOooO+",
|
||||
"+OoooOOOOOOOOOXXXOooO+",
|
||||
"+OoooOOOOOOOOOXXXOooO+",
|
||||
"+OoooOOOOOOOOOXXXOooO+",
|
||||
"+OoooOOOOOOOOOXXXOooO+",
|
||||
"+OoooOOOOOOOOOXXXOooO+",
|
||||
"++OOOOOOOOOOOOOOOOOO++",
|
||||
"++++++++++++++++++++++"
|
||||
};
|
338
src/musrgui/forms/PGetDefaultDialogBase.ui
Normal file
338
src/musrgui/forms/PGetDefaultDialogBase.ui
Normal file
@ -0,0 +1,338 @@
|
||||
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
|
||||
<class>PGetDefaultDialogBase</class>
|
||||
<widget class="QDialog">
|
||||
<property name="name">
|
||||
<cstring>PGetDefaultDialogBase</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>511</width>
|
||||
<height>222</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="caption">
|
||||
<string>RUN</string>
|
||||
</property>
|
||||
<property name="sizeGripEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QLabel">
|
||||
<property name="name">
|
||||
<cstring>fRunFileName_textLabel</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>20</y>
|
||||
<width>100</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Run File Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel">
|
||||
<property name="name">
|
||||
<cstring>fBeamline_textLabel</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>60</y>
|
||||
<width>71</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Beamline</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel">
|
||||
<property name="name">
|
||||
<cstring>fInstitute_textLabel</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>100</y>
|
||||
<width>71</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Institute</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel">
|
||||
<property name="name">
|
||||
<cstring>textLabel4</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>140</y>
|
||||
<width>80</width>
|
||||
<height>20</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>File Format</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>Layout1</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>180</y>
|
||||
<width>476</width>
|
||||
<height>33</height>
|
||||
</rect>
|
||||
</property>
|
||||
<hbox>
|
||||
<property name="name">
|
||||
<cstring>unnamed</cstring>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="spacing">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>buttonHelp</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Help</string>
|
||||
</property>
|
||||
<property name="accel">
|
||||
<string>F1</string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<spacer>
|
||||
<property name="name">
|
||||
<cstring>Horizontal Spacing2</cstring>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>Expanding</enum>
|
||||
</property>
|
||||
<property name="sizeHint">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>buttonOk</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&OK</string>
|
||||
</property>
|
||||
<property name="accel">
|
||||
<string></string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="default">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QPushButton">
|
||||
<property name="name">
|
||||
<cstring>buttonCancel</cstring>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>&Cancel</string>
|
||||
</property>
|
||||
<property name="accel">
|
||||
<string></string>
|
||||
</property>
|
||||
<property name="autoDefault">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</hbox>
|
||||
</widget>
|
||||
<widget class="QLineEdit">
|
||||
<property name="name">
|
||||
<cstring>fBeamline_lineEdit</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>130</x>
|
||||
<y>60</y>
|
||||
<width>360</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QComboBox">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>NeXuS</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>ROOT-NPP</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>ROOT-PPC</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>PSIBIN</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>MUD</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>WKM</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>ASCII</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>DB</string>
|
||||
</property>
|
||||
</item>
|
||||
<property name="name">
|
||||
<cstring>fFileFormat_comboBox</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>130</x>
|
||||
<y>140</y>
|
||||
<width>99</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QComboBox">
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>PSI</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>RAL</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>TRIUMF</string>
|
||||
</property>
|
||||
</item>
|
||||
<item>
|
||||
<property name="text">
|
||||
<string>JPARC</string>
|
||||
</property>
|
||||
</item>
|
||||
<property name="name">
|
||||
<cstring>fInstitute_comboBox</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>130</x>
|
||||
<y>100</y>
|
||||
<width>99</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLineEdit">
|
||||
<property name="name">
|
||||
<cstring>fRunFileName_lineEdit</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>130</x>
|
||||
<y>20</y>
|
||||
<width>360</width>
|
||||
<height>24</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonOk</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>PGetDefaultDialogBase</receiver>
|
||||
<slot>accept()</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonCancel</sender>
|
||||
<signal>clicked()</signal>
|
||||
<receiver>PGetDefaultDialogBase</receiver>
|
||||
<slot>reject()</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>fRunFileName_lineEdit</sender>
|
||||
<signal>textChanged(const QString&)</signal>
|
||||
<receiver>PGetDefaultDialogBase</receiver>
|
||||
<slot>runFileNameChanged(const QString&)</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>fBeamline_lineEdit</sender>
|
||||
<signal>textChanged(const QString&)</signal>
|
||||
<receiver>PGetDefaultDialogBase</receiver>
|
||||
<slot>beamlineChanged(const QString&)</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>fInstitute_comboBox</sender>
|
||||
<signal>activated(const QString&)</signal>
|
||||
<receiver>PGetDefaultDialogBase</receiver>
|
||||
<slot>instituteChanged(const QString&)</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>fFileFormat_comboBox</sender>
|
||||
<signal>activated(const QString&)</signal>
|
||||
<receiver>PGetDefaultDialogBase</receiver>
|
||||
<slot>fileFormatChanged(const QString&)</slot>
|
||||
</connection>
|
||||
</connections>
|
||||
<tabstops>
|
||||
<tabstop>fRunFileName_lineEdit</tabstop>
|
||||
<tabstop>fBeamline_lineEdit</tabstop>
|
||||
<tabstop>fInstitute_comboBox</tabstop>
|
||||
<tabstop>fFileFormat_comboBox</tabstop>
|
||||
<tabstop>buttonOk</tabstop>
|
||||
<tabstop>buttonCancel</tabstop>
|
||||
<tabstop>buttonHelp</tabstop>
|
||||
</tabstops>
|
||||
<slots>
|
||||
<slot>runFileNameChanged(const QString&)</slot>
|
||||
<slot>beamlineChanged(const QString&)</slot>
|
||||
<slot>instituteChanged(const QString&)</slot>
|
||||
<slot>fileFormatChanged(const QString&)</slot>
|
||||
</slots>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
</UI>
|
49
src/musrgui/main.cpp
Normal file
49
src/musrgui/main.cpp
Normal file
@ -0,0 +1,49 @@
|
||||
/****************************************************************************
|
||||
|
||||
main.cpp
|
||||
|
||||
Author: Andreas Suter
|
||||
e-mail: andreas.suter@psi.ch
|
||||
|
||||
$Id$
|
||||
|
||||
*****************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
* This program is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU General Public License *
|
||||
* along with this program; if not, write to the *
|
||||
* Free Software Foundation, Inc., *
|
||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||
***************************************************************************/
|
||||
|
||||
#include <qapplication.h>
|
||||
|
||||
#include "PTextEdit.h"
|
||||
|
||||
#include "PFitOutputHandler.h"
|
||||
|
||||
int main( int argc, char ** argv )
|
||||
{
|
||||
QApplication a( argc, argv );
|
||||
|
||||
PTextEdit * mw = new PTextEdit();
|
||||
mw->setCaption( "MusrFit Editor" );
|
||||
mw->resize( 800, 800 );
|
||||
mw->show();
|
||||
|
||||
a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
|
||||
return a.exec();
|
||||
}
|
29
src/musrgui/musrasym.xpm
Normal file
29
src/musrgui/musrasym.xpm
Normal file
@ -0,0 +1,29 @@
|
||||
/* XPM */
|
||||
static char * musrasym_xpm[] = {
|
||||
"22 22 4 1",
|
||||
" c None",
|
||||
". c #3D20CF",
|
||||
"+ c #FF0000",
|
||||
"@ c #000000",
|
||||
" ",
|
||||
" . .. . . . .",
|
||||
" . . . . . . .. ..",
|
||||
". . . . . . . .",
|
||||
". . .. . . . .",
|
||||
"..... . . . .",
|
||||
". . . . . . .",
|
||||
". . .. . . .",
|
||||
" ",
|
||||
" ++ ",
|
||||
"+ + ",
|
||||
" + ",
|
||||
" + ",
|
||||
" + ",
|
||||
" + ++ ",
|
||||
" + + + +",
|
||||
"@@@@@@@+@@@@+@@@@+@@+ ",
|
||||
" + + ++ ",
|
||||
" ++ ",
|
||||
" ",
|
||||
" ",
|
||||
" "};
|
28
src/musrgui/musrcalcchisq.xpm
Normal file
28
src/musrgui/musrcalcchisq.xpm
Normal file
@ -0,0 +1,28 @@
|
||||
/* XPM */
|
||||
static char * musrcalcchisq_xpm[] = {
|
||||
"22 22 3 1",
|
||||
" c None",
|
||||
". c #FF0000",
|
||||
"+ c #000000",
|
||||
" ... ",
|
||||
" +... . ",
|
||||
" .+ ...+. ",
|
||||
" ... . ... ",
|
||||
" ... ... ",
|
||||
" ... ... ",
|
||||
"+ . . ",
|
||||
" . ",
|
||||
" +++ ",
|
||||
" ++..+ ",
|
||||
" + ..+ . ",
|
||||
" .+.+ . ",
|
||||
"++ + +. + ... ",
|
||||
"+++ ++ + ...++... ",
|
||||
" ++ ++ +++++.. ... ",
|
||||
" +++ ... .+ ",
|
||||
" ++ . ",
|
||||
" ++ ...",
|
||||
" +++ ...",
|
||||
" ++ + ...",
|
||||
" ++ +++ . ",
|
||||
"++ +++ "};
|
28
src/musrgui/musrfit.xpm
Normal file
28
src/musrgui/musrfit.xpm
Normal file
@ -0,0 +1,28 @@
|
||||
/* XPM */
|
||||
static char * musrfit_xpm[] = {
|
||||
"22 22 3 1",
|
||||
" c None",
|
||||
". c #FF0000",
|
||||
"+ c #000000",
|
||||
" ... ",
|
||||
" +... . ",
|
||||
" .+ ...+. ",
|
||||
" ... . ... ",
|
||||
" ... ... ",
|
||||
" ... ... ",
|
||||
"+ . .+ ",
|
||||
" .+ ",
|
||||
" . ",
|
||||
" ... ",
|
||||
" ... . ",
|
||||
" ...+ . ",
|
||||
" . + ... ",
|
||||
" ...++... ",
|
||||
"++++ + +++++... ... ",
|
||||
"+ + + ... .+ ",
|
||||
"+ + + . ",
|
||||
"++++ + + ...",
|
||||
"+ + + ...",
|
||||
"+ + + ...",
|
||||
"+ + + . ",
|
||||
" "};
|
46
src/musrgui/musrgui.pro
Normal file
46
src/musrgui/musrgui.pro
Normal file
@ -0,0 +1,46 @@
|
||||
TEMPLATE = app
|
||||
|
||||
TARGET = musrgui
|
||||
target.path = $$(HOME)/analysis/bin
|
||||
INSTALLS += target
|
||||
|
||||
# install path for the XML configuration file
|
||||
unix: xml.path = $$(HOME)/analysis/bin/
|
||||
win32: xml.path = $$(HOME)/analysis/bin/
|
||||
xml.files = musrgui_startup.xml
|
||||
INSTALLS += xml
|
||||
|
||||
CONFIG += qt warn_on debug
|
||||
|
||||
|
||||
|
||||
HEADERS = PTextEdit.h \
|
||||
PAdmin.h \
|
||||
PFitOutputHandler.h \
|
||||
PGetDefaultDialog.h
|
||||
|
||||
SOURCES = PTextEdit.cpp \
|
||||
PAdmin.cpp \
|
||||
PFitOutputHandler.cpp \
|
||||
PGetDefaultDialog.cpp \
|
||||
main.cpp
|
||||
|
||||
FORMS = forms/PGetDefaultDialogBase.ui
|
||||
|
||||
IMAGES = editcopy.xpm \
|
||||
editcut.xpm \
|
||||
editpaste.xpm \
|
||||
editredo.xpm \
|
||||
editundo.xpm \
|
||||
filenew.xpm \
|
||||
fileopen.xpm \
|
||||
fileprint.xpm \
|
||||
filesave.xpm \
|
||||
musrasym.xpm \
|
||||
musrsinglehisto.xpm \
|
||||
musrcalcchisq.xpm \
|
||||
musrfit.xpm \
|
||||
musrview.xpm \
|
||||
musrt0.xpm \
|
||||
musrprefs.xpm
|
||||
|
38
src/musrgui/musrgui_startup.xml
Normal file
38
src/musrgui/musrgui_startup.xml
Normal file
@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<musrgui_startup xmlns="http://nemu.web.psi.ch/musrgui">
|
||||
<comment>
|
||||
$Id$
|
||||
This is handling default setting parameters for the musrgui.
|
||||
</comment>
|
||||
<general>
|
||||
<exec_path>/home/nemu/analysis/bin</exec_path>
|
||||
<default_save_path>/mnt/home/nemu/analysis</default_save_path>
|
||||
<msr_default_file_path>/afs/psi.ch/user/s/suter_a/development/musrgui</msr_default_file_path>
|
||||
<show_mlog>y</show_mlog>
|
||||
</general>
|
||||
<msr_file_defaults>
|
||||
<beamline>mue4</beamline>
|
||||
<institute>psi</institute>
|
||||
<file_format>root-npp</file_format>
|
||||
<msr_parameters>
|
||||
<asymmetry>
|
||||
<fittype>
|
||||
<required>y</required>
|
||||
</fittype>
|
||||
<alpha>
|
||||
<required>n</required>
|
||||
</alpha>
|
||||
<beta>
|
||||
<required>n</required>
|
||||
</beta>
|
||||
</asymmetry>
|
||||
<single_histo>
|
||||
</single_histo>
|
||||
<rrf>
|
||||
</rrf>
|
||||
<nonMusr>
|
||||
</nonMusr>
|
||||
</msr_parameters>
|
||||
</msr_file_defaults>
|
||||
</musrgui_startup>
|
||||
|
28
src/musrgui/musrprefs.xpm
Normal file
28
src/musrgui/musrprefs.xpm
Normal file
@ -0,0 +1,28 @@
|
||||
/* XPM */
|
||||
static char * musrprefs_xpm[] = {
|
||||
"22 22 3 1",
|
||||
" c None",
|
||||
". c #3D20CF",
|
||||
"+ c #000000",
|
||||
"... ... ... ... ... ",
|
||||
". . . . . . . ",
|
||||
"... ... ... ... ... ",
|
||||
". . . . . . ",
|
||||
". . . ... . ... ",
|
||||
" ",
|
||||
" + + ",
|
||||
" + + + ",
|
||||
"+ ++++ ++ + ",
|
||||
" + + + + ",
|
||||
" + + ",
|
||||
" ",
|
||||
" + + ",
|
||||
" + + + ++ ++ + ",
|
||||
"+ + +++ + + + + + ",
|
||||
" + + + + ",
|
||||
" + + ",
|
||||
" ",
|
||||
" + + + ",
|
||||
" + + + + + ",
|
||||
"+ + +++++++++ + ++ +",
|
||||
" + ++ ++ + + "};
|
29
src/musrgui/musrsinglehisto.xpm
Normal file
29
src/musrgui/musrsinglehisto.xpm
Normal file
@ -0,0 +1,29 @@
|
||||
/* XPM */
|
||||
static char * musrsinglehisto_xpm[] = {
|
||||
"22 22 4 1",
|
||||
" c None",
|
||||
". c #3D20CF",
|
||||
"+ c #FF0000",
|
||||
"@ c #000000",
|
||||
" ",
|
||||
". . . .. ..... ... ",
|
||||
".++ . . . . . . .",
|
||||
". + . . . . . .",
|
||||
"..... . .. . . .",
|
||||
". +. . . . . .",
|
||||
". . . . . . . .",
|
||||
". .+. .. . ... ",
|
||||
"@ + ",
|
||||
"@ + ",
|
||||
"@ + ",
|
||||
"@ ++ ",
|
||||
"@ + ",
|
||||
"@ + ",
|
||||
"@ + ",
|
||||
"@ + ",
|
||||
"@ ++ ",
|
||||
"@ + ",
|
||||
"@ ++ ",
|
||||
"@ ++ ",
|
||||
"@ ++ ",
|
||||
"@@@@@@@@@@@@@@@@@@@+++"};
|
28
src/musrgui/musrt0.xpm
Normal file
28
src/musrgui/musrt0.xpm
Normal file
@ -0,0 +1,28 @@
|
||||
/* XPM */
|
||||
static char * musrt0_xpm[] = {
|
||||
"22 22 3 1",
|
||||
" c None",
|
||||
". c #3D20CF",
|
||||
"+ c #000000",
|
||||
"..... .. ",
|
||||
" . . . ",
|
||||
" . . . ",
|
||||
" . . . ",
|
||||
" . + . . ++ ",
|
||||
" . + . .+ ++ ",
|
||||
" . + .. + + ",
|
||||
" + + +++ ",
|
||||
" + + + ",
|
||||
" + + ++ ",
|
||||
" + + + ",
|
||||
" + + + ",
|
||||
" + + ++ ",
|
||||
" + + ++++ ",
|
||||
" + + + ",
|
||||
" + + ++",
|
||||
" + + ",
|
||||
" + + ",
|
||||
" + + ",
|
||||
" + ++ + ",
|
||||
"++ + + ",
|
||||
" "};
|
28
src/musrgui/musrview.xpm
Normal file
28
src/musrgui/musrview.xpm
Normal file
@ -0,0 +1,28 @@
|
||||
/* XPM */
|
||||
static char * musrview_xpm[] = {
|
||||
"22 22 3 1",
|
||||
" c None",
|
||||
". c #000000",
|
||||
"+ c #FF0000",
|
||||
" .. ... .. ",
|
||||
" ",
|
||||
"......................",
|
||||
" . ",
|
||||
" . . ... ",
|
||||
" ++ . ",
|
||||
" ++ . ..... ",
|
||||
" + + . ",
|
||||
" + ... . ..... ",
|
||||
" + . + . . ",
|
||||
" +. + . . . ....",
|
||||
" +. + . . ",
|
||||
" + . + . . ... . ",
|
||||
" + . + . . ",
|
||||
" +. + . . ",
|
||||
" +. + ... ",
|
||||
" ++ . ",
|
||||
" . ",
|
||||
"......................",
|
||||
" ",
|
||||
" ....... .... .... ",
|
||||
" "};
|
60
src/musrgui/singleHistoDefault.msr
Normal file
60
src/musrgui/singleHistoDefault.msr
Normal file
@ -0,0 +1,60 @@
|
||||
TITLE
|
||||
###############################################################
|
||||
FITPARAMETER
|
||||
# Nr. Name Value Step Pos_Error Bounderies
|
||||
1 Asy 0.26 0.01 none 0 0.33
|
||||
2 Rate 0.36 0.01 none
|
||||
3 Field 100.0 1.0 none 0 200
|
||||
4 N0_L 150.0 0.01 none
|
||||
5 Bkg_L 4.9 0.01 none
|
||||
6 Phase_L 7.0 1.5 none -50 50
|
||||
|
||||
###############################################################
|
||||
THEORY
|
||||
asymmetry 1
|
||||
simplExpo 2 (rate)
|
||||
TFieldCos map1 fun1 (phase frequency)
|
||||
|
||||
###############################################################
|
||||
FUNCTIONS
|
||||
fun1 = par3 * gamma_mu
|
||||
|
||||
###############################################################
|
||||
RUN lem07_his_0111 MUE4 PSI ROOT-NPP (name beamline institute data-file-format)
|
||||
fittype 0 (single histogram fit)
|
||||
norm 4
|
||||
backgr.fit 5
|
||||
lifetimecorrection
|
||||
map 6 0 0 0 0 0 0 0 0 0
|
||||
forward 1
|
||||
data 3413 65000
|
||||
t0 3413
|
||||
fit 0.20 8.2
|
||||
packing 50
|
||||
|
||||
###############################################################
|
||||
COMMANDS
|
||||
SET BATCH
|
||||
MINIMIZE
|
||||
MINOS
|
||||
SAVE
|
||||
END RETURN
|
||||
|
||||
###############################################################
|
||||
PLOT 0 (single histo plot)
|
||||
runs 1
|
||||
range 0.00 7.00 -0.30 0.30
|
||||
|
||||
###############################################################
|
||||
FOURIER
|
||||
units Gauss # fourier in field units
|
||||
fourier_power 12
|
||||
apodization NONE # NONE, WEAK, MEDIUM, STRONG
|
||||
plot power
|
||||
phase 8.5
|
||||
#range_for_phase_correction 50.0 70.0
|
||||
range 0.0 200.0
|
||||
|
||||
###############################################################
|
||||
STATISTIC --- 2008-06-09 14:09:39
|
||||
chisq = 1446.93547, NDF = 1377, chisq/NDF = 1.05078829
|
Loading…
x
Reference in New Issue
Block a user