added the 'global' option to msr2data GUI from within musrgui/musredit
This commit is contained in:
@@ -39,6 +39,10 @@
|
||||
*/
|
||||
PFitOutputHandler::PFitOutputHandler(QString workingDirectory, QValueVector<QString> &cmd)
|
||||
{
|
||||
qDebug("workingDirectory = %s", workingDirectory.latin1());
|
||||
for (int i=0; i<cmd.size(); i++)
|
||||
qDebug("%s ", cmd[i].latin1());
|
||||
|
||||
if (cmd.empty())
|
||||
return;
|
||||
|
||||
|
||||
@@ -91,6 +91,7 @@ PMsr2DataDialog::PMsr2DataDialog(PMsr2DataParam *msr2DataParam) : fMsr2DataParam
|
||||
fTitleFromData_checkBox->setChecked(fMsr2DataParam->titleFromDataFile);
|
||||
fCreateMsrFileOnly_checkBox->setChecked(fMsr2DataParam->createMsrFileOnly);
|
||||
fFitOnly_checkBox->setChecked(fMsr2DataParam->fitOnly);
|
||||
fGlobal_checkBox->setChecked(fMsr2DataParam->global);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
@@ -128,6 +129,7 @@ PMsr2DataParam* PMsr2DataDialog::getMsr2DataParam()
|
||||
fMsr2DataParam->titleFromDataFile = fTitleFromData_checkBox->isChecked();
|
||||
fMsr2DataParam->createMsrFileOnly = fCreateMsrFileOnly_checkBox->isChecked();
|
||||
fMsr2DataParam->fitOnly = fFitOnly_checkBox->isChecked();
|
||||
fMsr2DataParam->global = fGlobal_checkBox->isChecked();
|
||||
|
||||
return fMsr2DataParam;
|
||||
}
|
||||
@@ -238,10 +240,22 @@ void PMsr2DataDialog::fitOnlyChanged(int buttonState)
|
||||
{
|
||||
if (buttonState == QButton::On) {
|
||||
fCreateMsrFileOnly_checkBox->setChecked(false);
|
||||
fGlobal_checkBox->setChecked(false);
|
||||
fTemplateRunNumber_lineEdit->clear();
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>
|
||||
*/
|
||||
void PMsr2DataDialog::globalChanged(int buttonState)
|
||||
{
|
||||
if (buttonState == QButton::On) {
|
||||
fFitOnly_checkBox->setChecked(false);
|
||||
}
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
// END
|
||||
//----------------------------------------------------------------------------------------------------
|
||||
|
||||
@@ -51,6 +51,7 @@ class PMsr2DataDialog : public PMsr2DataDialogBase
|
||||
void templateRunEntered(const QString&);
|
||||
void createMsrFileOnlyChanged(int);
|
||||
void fitOnlyChanged(int);
|
||||
void globalChanged(int);
|
||||
|
||||
private:
|
||||
int fRunTag; // -1 = not valid, 0 = first last, 1 = run list, 2 = run list file name
|
||||
|
||||
@@ -1468,6 +1468,7 @@ void PTextEdit::musrMsr2Data()
|
||||
fMsr2DataParam->titleFromDataFile = fTitleFromDataFile;
|
||||
fMsr2DataParam->createMsrFileOnly = false;
|
||||
fMsr2DataParam->fitOnly = false;
|
||||
fMsr2DataParam->global = false;
|
||||
}
|
||||
|
||||
PMsr2DataDialog *dlg = new PMsr2DataDialog(fMsr2DataParam);
|
||||
@@ -1628,22 +1629,22 @@ void PTextEdit::musrMsr2Data()
|
||||
cmd.append("data");
|
||||
}
|
||||
|
||||
// recreate db file
|
||||
if (fMsr2DataParam->recreateDbFile) {
|
||||
if (!QFile::remove(fMsr2DataParam->dbOutputFileName)) {
|
||||
str = QString("Couldn't delete db-file '%1'. Will **NOT** proceed.").arg(fMsr2DataParam->dbOutputFileName);
|
||||
QMessageBox::critical(this, "**ERROR**", str,
|
||||
QMessageBox::Ok, QMessageBox::NoButton);
|
||||
return;
|
||||
}
|
||||
// check global option
|
||||
if (fMsr2DataParam->global) {
|
||||
cmd.append("global");
|
||||
}
|
||||
|
||||
/*
|
||||
for (unsigned int i=0; i<cmd.size(); i++) {
|
||||
cout << endl << ">> " << cmd[i].latin1();
|
||||
}
|
||||
cout << endl;
|
||||
*/
|
||||
// recreate db file
|
||||
if (fMsr2DataParam->recreateDbFile) {
|
||||
if (QFile::exists(fMsr2DataParam->dbOutputFileName)) {
|
||||
if (!QFile::remove(fMsr2DataParam->dbOutputFileName)) {
|
||||
str = QString("Couldn't delete db-file '%1'. Will **NOT** proceed.").arg(fMsr2DataParam->dbOutputFileName);
|
||||
QMessageBox::critical(this, "**ERROR**", str,
|
||||
QMessageBox::Ok, QMessageBox::NoButton);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PFitOutputHandler fitOutputHandler(QFileInfo(*fFilenames.find( currentEditor() )).dirPath(), cmd);
|
||||
fitOutputHandler.setModal(true);
|
||||
|
||||
@@ -200,92 +200,6 @@
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>Layout1</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>530</y>
|
||||
<width>580</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>fHelp_button</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>fOk_button</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>fCancel_button</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="QGroupBox">
|
||||
<property name="name">
|
||||
<cstring>fExtension_groupBox</cstring>
|
||||
@@ -458,7 +372,7 @@
|
||||
<x>10</x>
|
||||
<y>400</y>
|
||||
<width>581</width>
|
||||
<height>110</height>
|
||||
<height>120</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
@@ -623,6 +537,108 @@
|
||||
<string>Fit Only</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QCheckBox">
|
||||
<property name="name">
|
||||
<cstring>fGlobal_checkBox</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>400</x>
|
||||
<y>90</y>
|
||||
<width>106</width>
|
||||
<height>22</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Global</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QLayoutWidget">
|
||||
<property name="name">
|
||||
<cstring>Layout1</cstring>
|
||||
</property>
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>530</y>
|
||||
<width>580</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>fHelp_button</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>fOk_button</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>fCancel_button</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>
|
||||
<images>
|
||||
@@ -685,6 +701,12 @@
|
||||
<receiver>PMsr2DataDialogBase</receiver>
|
||||
<slot>templateRunEntered(const QString&)</slot>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>fGlobal_checkBox</sender>
|
||||
<signal>stateChanged(int)</signal>
|
||||
<receiver>PMsr2DataDialogBase</receiver>
|
||||
<slot>globalChanged(int)</slot>
|
||||
</connection>
|
||||
</connections>
|
||||
<tabstops>
|
||||
<tabstop>fFirst_lineEdit</tabstop>
|
||||
@@ -716,6 +738,7 @@
|
||||
<slot>createMsrFileOnlyChanged(int)</slot>
|
||||
<slot>fitOnlyChanged(int)</slot>
|
||||
<slot>templateRunEntered(const QString&)</slot>
|
||||
<slot>globalChanged(int)</slot>
|
||||
</slots>
|
||||
<layoutdefaults spacing="6" margin="11"/>
|
||||
</UI>
|
||||
|
||||
@@ -52,6 +52,7 @@ typedef struct {
|
||||
bool titleFromDataFile;
|
||||
bool createMsrFileOnly;
|
||||
bool fitOnly;
|
||||
bool global;
|
||||
} PMsr2DataParam;
|
||||
|
||||
typedef struct {
|
||||
|
||||
Reference in New Issue
Block a user