only show N0 estimate dialog in chisq if fittype fits.
This commit is contained in:
@ -62,6 +62,31 @@ PSubTextEdit::PSubTextEdit(PAdmin *admin, QWidget *parent) :
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* @brief PSubTextEdit::getFitType
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
int PSubTextEdit::getFitType()
|
||||||
|
{
|
||||||
|
QString str = toPlainText();
|
||||||
|
int idx = str.indexOf("fittype");
|
||||||
|
if (idx == -1)
|
||||||
|
return -1;
|
||||||
|
|
||||||
|
bool ok;
|
||||||
|
for (int i=idx+7; i<str.length(); i++) {
|
||||||
|
if (str[i] != ' ') {
|
||||||
|
idx = QString(str[i]).toInt(&ok);
|
||||||
|
if (!ok)
|
||||||
|
idx = -1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return idx;
|
||||||
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* <p>Starts the msr-title input dialog window.
|
* <p>Starts the msr-title input dialog window.
|
||||||
|
@ -46,6 +46,7 @@ class PSubTextEdit : public QPlainTextEdit
|
|||||||
public:
|
public:
|
||||||
PSubTextEdit(PAdmin *admin = 0, QWidget *parent = 0);
|
PSubTextEdit(PAdmin *admin = 0, QWidget *parent = 0);
|
||||||
virtual ~PSubTextEdit() {}
|
virtual ~PSubTextEdit() {}
|
||||||
|
int getFitType();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void insertTitle();
|
void insertTitle();
|
||||||
|
@ -1700,7 +1700,8 @@ void PTextEdit::musrCalcChisq()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
int result = 0;
|
int result = 0;
|
||||||
if (fAdmin->getEstimateN0Flag())
|
int fittype = currentEditor()->getFitType();
|
||||||
|
if (fAdmin->getEstimateN0Flag() && ((fittype==0) || (fittype==4)))
|
||||||
result = QMessageBox::question(this, "Estimate N0 active",
|
result = QMessageBox::question(this, "Estimate N0 active",
|
||||||
"Do you wish a chisq/mlh evaluation with an automatic N0 estimate?",
|
"Do you wish a chisq/mlh evaluation with an automatic N0 estimate?",
|
||||||
QMessageBox::Yes, QMessageBox::No);
|
QMessageBox::Yes, QMessageBox::No);
|
||||||
@ -1722,7 +1723,7 @@ void PTextEdit::musrCalcChisq()
|
|||||||
cmd.append(str);
|
cmd.append(str);
|
||||||
cmd.append(QFileInfo(*fFilenames.find( currentEditor())).fileName() );
|
cmd.append(QFileInfo(*fFilenames.find( currentEditor())).fileName() );
|
||||||
cmd.append("--chisq-only");
|
cmd.append("--chisq-only");
|
||||||
if (fAdmin->getEstimateN0Flag() && (result == QMessageBox::Yes))
|
if (fAdmin->getEstimateN0Flag() && (result == QMessageBox::Yes) && ((fittype==0) || (fittype==4)))
|
||||||
cmd.append("--estimateN0");
|
cmd.append("--estimateN0");
|
||||||
PFitOutputHandler fitOutputHandler(QFileInfo(*fFilenames.find( currentEditor() )).absolutePath(), cmd);
|
PFitOutputHandler fitOutputHandler(QFileInfo(*fFilenames.find( currentEditor() )).absolutePath(), cmd);
|
||||||
fitOutputHandler.setModal(true);
|
fitOutputHandler.setModal(true);
|
||||||
|
Reference in New Issue
Block a user