Merged muonspin/musrfit:root6 into master
This commit is contained in:
commit
a1bc47c39e
@ -42,14 +42,16 @@
|
|||||||
#include "fftw3.h"
|
#include "fftw3.h"
|
||||||
|
|
||||||
#define PMUSR_SUCCESS 0
|
#define PMUSR_SUCCESS 0
|
||||||
#define PMUSR_WRONG_STARTUP_SYNTAX -1
|
#define PMUSR_SYNTAX_REQUEST -1
|
||||||
#define PMUSR_MSR_FILE_NOT_FOUND -2
|
#define PMUSR_WRONG_STARTUP_SYNTAX -2
|
||||||
#define PMUSR_MSR_ALLOCATION_ERROR -3
|
#define PMUSR_MSR_FILE_NOT_FOUND -3
|
||||||
#define PMUSR_MSR_SYNTAX_ERROR -4
|
#define PMUSR_MSR_ALLOCATION_ERROR -4
|
||||||
#define PMUSR_TOKENIZE_ERROR -5
|
#define PMUSR_MSR_SYNTAX_ERROR -5
|
||||||
#define PMUSR_MSR_LOG_FILE_WRITE_ERROR -6
|
#define PMUSR_TOKENIZE_ERROR -6
|
||||||
#define PMUSR_MSR_FILE_WRITE_ERROR -7
|
#define PMUSR_MSR_LOG_FILE_WRITE_ERROR -7
|
||||||
#define PMUSR_DATA_FILE_READ_ERROR -8
|
#define PMUSR_MSR_FILE_WRITE_ERROR -8
|
||||||
|
#define PMUSR_DATA_FILE_READ_ERROR -9
|
||||||
|
#define PMUSR_MSR_RUN_ERROR -10
|
||||||
|
|
||||||
#define PRUN_SINGLE_HISTO 0
|
#define PRUN_SINGLE_HISTO 0
|
||||||
#define PRUN_SINGLE_HISTO_RRF 1
|
#define PRUN_SINGLE_HISTO_RRF 1
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2010-2016 by Andreas Suter *
|
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
@ -29,7 +29,6 @@
|
|||||||
|
|
||||||
#include <cstdlib>
|
#include <cstdlib>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
@ -800,7 +799,7 @@ int PAdmin::savePrefs(QString pref_fln)
|
|||||||
QVector<QString> data;
|
QVector<QString> data;
|
||||||
QFile file(fln);
|
QFile file(fln);
|
||||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||||
cerr << endl << ">> PAdmin::savePrefs: **ERROR** Cannot open " << fln.toLatin1().data() << " for reading." << endl;
|
std::cerr << std::endl << ">> PAdmin::savePrefs: **ERROR** Cannot open " << fln.toLatin1().data() << " for reading." << std::endl;
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
QTextStream fin(&file);
|
QTextStream fin(&file);
|
||||||
@ -879,7 +878,7 @@ int PAdmin::savePrefs(QString pref_fln)
|
|||||||
// write prefs
|
// write prefs
|
||||||
file.setFileName(pref_fln);
|
file.setFileName(pref_fln);
|
||||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||||
cerr << endl << ">> PAdmin::savePrefs: **ERROR** Cannot open " << pref_fln.toLatin1().data() << " for writing." << endl;
|
std::cerr << std::endl << ">> PAdmin::savePrefs: **ERROR** Cannot open " << pref_fln.toLatin1().data() << " for writing." << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
fin.setDevice(&file);
|
fin.setDevice(&file);
|
||||||
@ -933,7 +932,7 @@ void PAdmin::saveRecentFiles()
|
|||||||
QVector<QString> data;
|
QVector<QString> data;
|
||||||
QFile file(fln);
|
QFile file(fln);
|
||||||
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||||
cerr << endl << ">> PAdmin::saveRecentFile: **ERROR** Cannot open " << fln.toLatin1().data() << " for reading." << endl;
|
std::cerr << std::endl << ">> PAdmin::saveRecentFile: **ERROR** Cannot open " << fln.toLatin1().data() << " for reading." << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
QTextStream fin(&file);
|
QTextStream fin(&file);
|
||||||
@ -958,7 +957,7 @@ void PAdmin::saveRecentFiles()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (i == data.size()) {
|
if (i == data.size()) {
|
||||||
cerr << endl << ">> PAdmin::saveRecentFile: **ERROR** " << fln.toLatin1().data() << " seems to be corrupt." << endl;
|
std::cerr << std::endl << ">> PAdmin::saveRecentFile: **ERROR** " << fln.toLatin1().data() << " seems to be corrupt." << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
@ -968,7 +967,7 @@ void PAdmin::saveRecentFiles()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) {
|
||||||
cerr << endl << ">> PAdmin::saveRecentFile: **ERROR** Cannot open " << fln.toLatin1().data() << " for reading." << endl;
|
std::cerr << std::endl << ">> PAdmin::saveRecentFile: **ERROR** Cannot open " << fln.toLatin1().data() << " for reading." << std::endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fin.setDevice(&file);
|
fin.setDevice(&file);
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2010-2016 by Andreas Suter *
|
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2010-2017 by Andreas Suter *
|
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2010-2017 by Andreas Suter *
|
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2012-2016 by Andreas Suter *
|
* Copyright (C) 2012-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2012-2016 by Andreas Suter *
|
* Copyright (C) 2012-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2009-2016 by Andreas Suter *
|
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2010-2016 by Andreas Suter *
|
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2009-2016 by Andreas Suter *
|
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
@ -83,7 +83,7 @@ PFitOutputHandler::PFitOutputHandler(QString workingDirectory, QVector<QString>
|
|||||||
if ( !fProc->waitForStarted() ) {
|
if ( !fProc->waitForStarted() ) {
|
||||||
// error handling
|
// error handling
|
||||||
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
||||||
QMessageBox::critical( 0,
|
QMessageBox::critical( nullptr,
|
||||||
tr("Fatal error"),
|
tr("Fatal error"),
|
||||||
msg,
|
msg,
|
||||||
tr("Quit") );
|
tr("Quit") );
|
||||||
@ -114,7 +114,7 @@ PFitOutputHandler::~PFitOutputHandler()
|
|||||||
}
|
}
|
||||||
if (fProc) {
|
if (fProc) {
|
||||||
delete fProc;
|
delete fProc;
|
||||||
fProc = 0;
|
fProc = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2010-2016 by Andreas Suter *
|
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2009-2016 by Andreas Suter *
|
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2009-2016 by Andreas Suter *
|
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2009-2016 by Andreas Suter *
|
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2010-2016 by Andreas Suter *
|
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2009-2016 by Andreas Suter *
|
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2009-2016 by Andreas Suter *
|
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2009-2016 by Andreas Suter *
|
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2009-2016 by Andreas Suter *
|
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2010-2016 by Andreas Suter *
|
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2009-2016 by Andreas Suter *
|
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2009-2016 by Andreas Suter *
|
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2009-2016 by Andreas Suter *
|
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2009-2016 by Andreas Suter *
|
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2009-2016 by Andreas Suter *
|
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2009-2016 by Andreas Suter *
|
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2009-2016 by Andreas Suter *
|
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2009-2016 by Andreas Suter *
|
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2009-2016 by Andreas Suter *
|
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2009-2016 by Andreas Suter *
|
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2010-2016 by Andreas Suter *
|
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2010-2016 by Andreas Suter *
|
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2010-2016 by Andreas Suter *
|
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2010-2016 by Andreas Suter *
|
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2009-2016 by Andreas Suter *
|
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2010-2016 by Andreas Suter *
|
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2010-2016 by Andreas Suter *
|
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2010-2016 by Andreas Suter *
|
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2009-2016 by Andreas Suter *
|
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2010-2017 by Andreas Suter *
|
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2010-2016 by Andreas Suter *
|
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2010-2016 by Andreas Suter *
|
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2009-2016 by Andreas Suter *
|
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2010-2016 by Andreas Suter *
|
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2009-2016 by Andreas Suter *
|
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2009-2016 by Andreas Suter *
|
* Copyright (C) 2009-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2010-2016 by Andreas Suter *
|
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
@ -29,7 +29,6 @@
|
|||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
@ -94,17 +93,17 @@ PTextEdit::PTextEdit( QWidget *parent, Qt::WindowFlags f )
|
|||||||
// enable file system watcher. Needed to get notification if the msr-file is changed outside of musrfit at runtime
|
// enable file system watcher. Needed to get notification if the msr-file is changed outside of musrfit at runtime
|
||||||
fFileSystemWatcherActive = true;
|
fFileSystemWatcherActive = true;
|
||||||
fFileSystemWatcher = new QFileSystemWatcher();
|
fFileSystemWatcher = new QFileSystemWatcher();
|
||||||
if (fFileSystemWatcher == 0) {
|
if (fFileSystemWatcher == nullptr) {
|
||||||
QMessageBox::information(this, "**ERROR**", "Couldn't invoke QFileSystemWatcher!");
|
QMessageBox::information(this, "**ERROR**", "Couldn't invoke QFileSystemWatcher!");
|
||||||
} else {
|
} else {
|
||||||
connect( fFileSystemWatcher, SIGNAL(fileChanged(const QString&)), this, SLOT(fileChanged(const QString&)));
|
connect( fFileSystemWatcher, SIGNAL(fileChanged(const QString&)), this, SLOT(fileChanged(const QString&)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// initialize stuff
|
// initialize stuff
|
||||||
fMusrT0Action = 0;
|
fMusrT0Action = nullptr;
|
||||||
|
|
||||||
fMsr2DataParam = 0;
|
fMsr2DataParam = nullptr;
|
||||||
fFindReplaceData = 0,
|
fFindReplaceData = nullptr;
|
||||||
|
|
||||||
// setup menus
|
// setup menus
|
||||||
setupFileActions();
|
setupFileActions();
|
||||||
@ -150,19 +149,19 @@ void PTextEdit::aboutToQuit()
|
|||||||
{
|
{
|
||||||
if (fAdmin) {
|
if (fAdmin) {
|
||||||
delete fAdmin;
|
delete fAdmin;
|
||||||
fAdmin = 0;
|
fAdmin = nullptr;
|
||||||
}
|
}
|
||||||
if (fMusrT0Action) {
|
if (fMusrT0Action) {
|
||||||
delete fMusrT0Action;
|
delete fMusrT0Action;
|
||||||
fMusrT0Action = 0;
|
fMusrT0Action = nullptr;
|
||||||
}
|
}
|
||||||
if (fMsr2DataParam) {
|
if (fMsr2DataParam) {
|
||||||
delete fMsr2DataParam;
|
delete fMsr2DataParam;
|
||||||
fMsr2DataParam = 0;
|
fMsr2DataParam = nullptr;
|
||||||
}
|
}
|
||||||
if (fFindReplaceData) {
|
if (fFindReplaceData) {
|
||||||
delete fFindReplaceData;
|
delete fFindReplaceData;
|
||||||
fFindReplaceData = 0;
|
fFindReplaceData = nullptr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -580,7 +579,7 @@ void PTextEdit::setupTextActions()
|
|||||||
connect( fComboFont, SIGNAL( activated( const QString & ) ),
|
connect( fComboFont, SIGNAL( activated( const QString & ) ),
|
||||||
this, SLOT( textFamily( const QString & ) ) );
|
this, SLOT( textFamily( const QString & ) ) );
|
||||||
QLineEdit *edit = fComboFont->lineEdit();
|
QLineEdit *edit = fComboFont->lineEdit();
|
||||||
if (edit == 0) {
|
if (edit == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
edit->setText( fAdmin->getFontName() );
|
edit->setText( fAdmin->getFontName() );
|
||||||
@ -595,7 +594,7 @@ void PTextEdit::setupTextActions()
|
|||||||
connect( fComboSize, SIGNAL( activated( const QString & ) ),
|
connect( fComboSize, SIGNAL( activated( const QString & ) ),
|
||||||
this, SLOT( textSize( const QString & ) ) );
|
this, SLOT( textSize( const QString & ) ) );
|
||||||
edit = fComboSize->lineEdit();
|
edit = fComboSize->lineEdit();
|
||||||
if (edit == 0) {
|
if (edit == nullptr) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
edit->setText( QString("%1").arg(fAdmin->getFontSize()) );
|
edit->setText( QString("%1").arg(fAdmin->getFontSize()) );
|
||||||
@ -900,11 +899,11 @@ PSubTextEdit *PTextEdit::currentEditor() const
|
|||||||
{
|
{
|
||||||
if ( fTabWidget->currentWidget() ) {
|
if ( fTabWidget->currentWidget() ) {
|
||||||
if (fTabWidget->currentWidget()->inherits( "PSubTextEdit" )) {
|
if (fTabWidget->currentWidget()->inherits( "PSubTextEdit" )) {
|
||||||
return (PSubTextEdit*)fTabWidget->currentWidget();
|
return dynamic_cast<PSubTextEdit*>(fTabWidget->currentWidget());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
@ -1190,7 +1189,7 @@ void PTextEdit::fileOpenPrefs()
|
|||||||
|
|
||||||
if (fAdmin->loadPrefs(fln)) {
|
if (fAdmin->loadPrefs(fln)) {
|
||||||
msg = QString("Prefs from '") + fln + QString("' loaded.");
|
msg = QString("Prefs from '") + fln + QString("' loaded.");
|
||||||
QMessageBox::information(0, "Info", msg);
|
QMessageBox::information(nullptr, "Info", msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1277,7 +1276,7 @@ void PTextEdit::fileSavePrefs()
|
|||||||
if ( !fln.isEmpty() ) {
|
if ( !fln.isEmpty() ) {
|
||||||
fAdmin->savePrefs(fln);
|
fAdmin->savePrefs(fln);
|
||||||
msg = QString("Prefs to '") + fln + QString("' saved.");
|
msg = QString("Prefs to '") + fln + QString("' saved.");
|
||||||
QMessageBox::information(0, "Info", msg);
|
QMessageBox::information(nullptr, "Info", msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1308,7 +1307,7 @@ void PTextEdit::filePrint()
|
|||||||
int yPos = 0; // y-position for each line
|
int yPos = 0; // y-position for each line
|
||||||
QFontMetrics fm = p.fontMetrics();
|
QFontMetrics fm = p.fontMetrics();
|
||||||
int dpiy = printer.logicalDpiY();
|
int dpiy = printer.logicalDpiY();
|
||||||
int margin = (int) ( (2/2.54)*dpiy ); // 2 cm margins
|
int margin = static_cast<int>( (2/2.54)*dpiy ); // 2 cm margins
|
||||||
|
|
||||||
// print msr-file
|
// print msr-file
|
||||||
QString fln = *fFilenames.find(currentEditor());
|
QString fln = *fFilenames.find(currentEditor());
|
||||||
@ -1568,7 +1567,7 @@ void PTextEdit::editFind()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// check if first time called, and if yes create find and replace data structure
|
// check if first time called, and if yes create find and replace data structure
|
||||||
if (fFindReplaceData == 0) {
|
if (fFindReplaceData == nullptr) {
|
||||||
fFindReplaceData = new PFindReplaceData();
|
fFindReplaceData = new PFindReplaceData();
|
||||||
fFindReplaceData->findText = QString("");
|
fFindReplaceData->findText = QString("");
|
||||||
fFindReplaceData->replaceText = QString("");
|
fFindReplaceData->replaceText = QString("");
|
||||||
@ -1580,13 +1579,13 @@ void PTextEdit::editFind()
|
|||||||
fFindReplaceData->promptOnReplace = true;
|
fFindReplaceData->promptOnReplace = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fFindReplaceData == 0) {
|
if (fFindReplaceData == nullptr) {
|
||||||
QMessageBox::critical(this, "**ERROR**", "Couldn't invoke find data structure, sorry :-(", QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::critical(this, "**ERROR**", "Couldn't invoke find data structure, sorry :-(", QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PFindDialog *dlg = new PFindDialog(fFindReplaceData, currentEditor()->textCursor().hasSelection());
|
PFindDialog *dlg = new PFindDialog(fFindReplaceData, currentEditor()->textCursor().hasSelection());
|
||||||
if (dlg == 0) {
|
if (dlg == nullptr) {
|
||||||
QMessageBox::critical(this, "**ERROR**", "Couldn't invoke find dialog, sorry :-(", QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::critical(this, "**ERROR**", "Couldn't invoke find dialog, sorry :-(", QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1601,13 +1600,13 @@ void PTextEdit::editFind()
|
|||||||
fFindReplaceData = dlg->getData();
|
fFindReplaceData = dlg->getData();
|
||||||
|
|
||||||
delete dlg;
|
delete dlg;
|
||||||
dlg = 0;
|
dlg = nullptr;
|
||||||
|
|
||||||
// try to find the search text
|
// try to find the search text
|
||||||
if (!fFindReplaceData->fromCursor)
|
if (!fFindReplaceData->fromCursor)
|
||||||
currentEditor()->textCursor().setPosition(0);
|
currentEditor()->textCursor().setPosition(0);
|
||||||
|
|
||||||
QTextDocument::FindFlags flags = 0;
|
QTextDocument::FindFlags flags = nullptr;
|
||||||
if (fFindReplaceData->caseSensitive)
|
if (fFindReplaceData->caseSensitive)
|
||||||
flags |= QTextDocument::FindCaseSensitively;
|
flags |= QTextDocument::FindCaseSensitively;
|
||||||
else if (fFindReplaceData->findBackwards)
|
else if (fFindReplaceData->findBackwards)
|
||||||
@ -1624,7 +1623,7 @@ void PTextEdit::editFind()
|
|||||||
*/
|
*/
|
||||||
void PTextEdit::editFindNext()
|
void PTextEdit::editFindNext()
|
||||||
{
|
{
|
||||||
QTextDocument::FindFlags flags = 0;
|
QTextDocument::FindFlags flags = nullptr;
|
||||||
if (fFindReplaceData->caseSensitive)
|
if (fFindReplaceData->caseSensitive)
|
||||||
flags |= QTextDocument::FindCaseSensitively;
|
flags |= QTextDocument::FindCaseSensitively;
|
||||||
else if (fFindReplaceData->wholeWordsOnly)
|
else if (fFindReplaceData->wholeWordsOnly)
|
||||||
@ -1639,7 +1638,7 @@ void PTextEdit::editFindNext()
|
|||||||
*/
|
*/
|
||||||
void PTextEdit::editFindPrevious()
|
void PTextEdit::editFindPrevious()
|
||||||
{
|
{
|
||||||
QTextDocument::FindFlags flags = 0;
|
QTextDocument::FindFlags flags = nullptr;
|
||||||
if (fFindReplaceData->caseSensitive)
|
if (fFindReplaceData->caseSensitive)
|
||||||
flags |= QTextDocument::FindCaseSensitively;
|
flags |= QTextDocument::FindCaseSensitively;
|
||||||
else if (fFindReplaceData->wholeWordsOnly)
|
else if (fFindReplaceData->wholeWordsOnly)
|
||||||
@ -1660,7 +1659,7 @@ void PTextEdit::editFindAndReplace()
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
// check if first time called, and if yes create find and replace data structure
|
// check if first time called, and if yes create find and replace data structure
|
||||||
if (fFindReplaceData == 0) {
|
if (fFindReplaceData == nullptr) {
|
||||||
fFindReplaceData = new PFindReplaceData();
|
fFindReplaceData = new PFindReplaceData();
|
||||||
fFindReplaceData->findText = QString("");
|
fFindReplaceData->findText = QString("");
|
||||||
fFindReplaceData->replaceText = QString("");
|
fFindReplaceData->replaceText = QString("");
|
||||||
@ -1672,13 +1671,13 @@ void PTextEdit::editFindAndReplace()
|
|||||||
fFindReplaceData->promptOnReplace = true;
|
fFindReplaceData->promptOnReplace = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (fFindReplaceData == 0) {
|
if (fFindReplaceData == nullptr) {
|
||||||
QMessageBox::critical(this, "**ERROR**", "Couldn't invoke find&replace data structure, sorry :-(", QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::critical(this, "**ERROR**", "Couldn't invoke find&replace data structure, sorry :-(", QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PReplaceDialog *dlg = new PReplaceDialog(fFindReplaceData, currentEditor()->textCursor().hasSelection());
|
PReplaceDialog *dlg = new PReplaceDialog(fFindReplaceData, currentEditor()->textCursor().hasSelection());
|
||||||
if (dlg == 0) {
|
if (dlg == nullptr) {
|
||||||
QMessageBox::critical(this, "**ERROR**", "Couldn't invoke find&replace dialog, sorry :-(", QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::critical(this, "**ERROR**", "Couldn't invoke find&replace dialog, sorry :-(", QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -1693,7 +1692,7 @@ void PTextEdit::editFindAndReplace()
|
|||||||
fFindReplaceData = dlg->getData();
|
fFindReplaceData = dlg->getData();
|
||||||
|
|
||||||
delete dlg;
|
delete dlg;
|
||||||
dlg = 0;
|
dlg = nullptr;
|
||||||
|
|
||||||
if (fFindReplaceData->promptOnReplace) {
|
if (fFindReplaceData->promptOnReplace) {
|
||||||
editFindNext();
|
editFindNext();
|
||||||
@ -1853,7 +1852,7 @@ void PTextEdit::musrWiz()
|
|||||||
|
|
||||||
QProcess *proc = new QProcess(this);
|
QProcess *proc = new QProcess(this);
|
||||||
if (proc == nullptr) {
|
if (proc == nullptr) {
|
||||||
QMessageBox::critical(0, "**ERROR**", "Couldn't invoke QProcess!");
|
QMessageBox::critical(nullptr, "**ERROR**", "Couldn't invoke QProcess!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1870,7 +1869,7 @@ void PTextEdit::musrWiz()
|
|||||||
if (!proc->waitForStarted()) {
|
if (!proc->waitForStarted()) {
|
||||||
// error handling
|
// error handling
|
||||||
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
||||||
QMessageBox::critical( 0,
|
QMessageBox::critical( nullptr,
|
||||||
tr("Fatal error"),
|
tr("Fatal error"),
|
||||||
msg,
|
msg,
|
||||||
tr("Quit") );
|
tr("Quit") );
|
||||||
@ -2033,7 +2032,7 @@ void PTextEdit::musrFit()
|
|||||||
*/
|
*/
|
||||||
void PTextEdit::musrMsr2Data()
|
void PTextEdit::musrMsr2Data()
|
||||||
{
|
{
|
||||||
if (fMsr2DataParam == 0) {
|
if (fMsr2DataParam == nullptr) {
|
||||||
fMsr2DataParam = new PMsr2DataParam();
|
fMsr2DataParam = new PMsr2DataParam();
|
||||||
*fMsr2DataParam = fAdmin->getMsr2DataParam();
|
*fMsr2DataParam = fAdmin->getMsr2DataParam();
|
||||||
}
|
}
|
||||||
@ -2046,7 +2045,7 @@ void PTextEdit::musrMsr2Data()
|
|||||||
|
|
||||||
PMsr2DataDialog *dlg = new PMsr2DataDialog(fMsr2DataParam, fAdmin->getHelpUrl("msr2data"));
|
PMsr2DataDialog *dlg = new PMsr2DataDialog(fMsr2DataParam, fAdmin->getHelpUrl("msr2data"));
|
||||||
|
|
||||||
if (dlg == 0) {
|
if (dlg == nullptr) {
|
||||||
QMessageBox::critical(this, "**ERROR**", "Couldn't invoke msr2data dialog, sorry :-(", QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::critical(this, "**ERROR**", "Couldn't invoke msr2data dialog, sorry :-(", QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2361,7 +2360,7 @@ void PTextEdit::musrMsr2Data()
|
|||||||
}
|
}
|
||||||
|
|
||||||
delete dlg;
|
delete dlg;
|
||||||
dlg = 0;
|
dlg = nullptr;
|
||||||
|
|
||||||
fileSystemWatcherActivation();
|
fileSystemWatcherActivation();
|
||||||
}
|
}
|
||||||
@ -2410,6 +2409,7 @@ void PTextEdit::musrView()
|
|||||||
arg << "-a";
|
arg << "-a";
|
||||||
|
|
||||||
QProcess *proc = new QProcess(this);
|
QProcess *proc = new QProcess(this);
|
||||||
|
connect(proc, SIGNAL(finished(int, QProcess::ExitStatus)), this, SLOT(musrViewFinished(int, QProcess::ExitStatus)));
|
||||||
|
|
||||||
// make sure that the system environment variables are properly set
|
// make sure that the system environment variables are properly set
|
||||||
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
QProcessEnvironment env = QProcessEnvironment::systemEnvironment();
|
||||||
@ -2420,7 +2420,7 @@ void PTextEdit::musrView()
|
|||||||
if (!proc->waitForStarted()) {
|
if (!proc->waitForStarted()) {
|
||||||
// error handling
|
// error handling
|
||||||
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
||||||
QMessageBox::critical( 0,
|
QMessageBox::critical( nullptr,
|
||||||
tr("Fatal error"),
|
tr("Fatal error"),
|
||||||
msg,
|
msg,
|
||||||
tr("Quit") );
|
tr("Quit") );
|
||||||
@ -2430,7 +2430,24 @@ void PTextEdit::musrView()
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* <p>Callse musrt0 <msr-file>.
|
* <p>Checks if musrview terminated with error, and if yes pop up a message box.
|
||||||
|
* @param exitCode
|
||||||
|
*/
|
||||||
|
void PTextEdit::musrViewFinished(int exitCode, QProcess::ExitStatus)
|
||||||
|
{
|
||||||
|
if (exitCode != 0) {
|
||||||
|
QString msg = QString("musrview failed. Possible reasons:\n");
|
||||||
|
msg += QString("* corrupted msr-file.\n");
|
||||||
|
msg += QString("* cannot read data-file.\n");
|
||||||
|
msg += QString("* many more things can go wrong.\n");
|
||||||
|
msg += QString("Please check!");
|
||||||
|
QMessageBox::critical(nullptr, tr("Fatal Error"), msg, tr("Quit"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//----------------------------------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>Calls musrt0 <msr-file>.
|
||||||
*/
|
*/
|
||||||
void PTextEdit::musrT0()
|
void PTextEdit::musrT0()
|
||||||
{
|
{
|
||||||
@ -2474,7 +2491,7 @@ void PTextEdit::musrT0()
|
|||||||
if (!proc->waitForStarted()) {
|
if (!proc->waitForStarted()) {
|
||||||
// error handling
|
// error handling
|
||||||
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
||||||
QMessageBox::critical( 0,
|
QMessageBox::critical( nullptr,
|
||||||
tr("Fatal error"),
|
tr("Fatal error"),
|
||||||
msg,
|
msg,
|
||||||
tr("Quit") );
|
tr("Quit") );
|
||||||
@ -2492,7 +2509,7 @@ void PTextEdit::musrFT()
|
|||||||
|
|
||||||
PGetMusrFTOptionsDialog *dlg = new PGetMusrFTOptionsDialog(*fFilenames.find( currentEditor() ), fMusrFTPrevCmd, fAdmin->getHelpUrl("musrFT"));
|
PGetMusrFTOptionsDialog *dlg = new PGetMusrFTOptionsDialog(*fFilenames.find( currentEditor() ), fMusrFTPrevCmd, fAdmin->getHelpUrl("musrFT"));
|
||||||
|
|
||||||
if (dlg == 0) {
|
if (dlg == nullptr) {
|
||||||
QMessageBox::critical(this, "**ERROR** musrFT", "Couldn't invoke musrFT Options Dialog.");
|
QMessageBox::critical(this, "**ERROR** musrFT", "Couldn't invoke musrFT Options Dialog.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2510,7 +2527,7 @@ void PTextEdit::musrFT()
|
|||||||
if (!proc->waitForStarted()) {
|
if (!proc->waitForStarted()) {
|
||||||
// error handling
|
// error handling
|
||||||
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
||||||
QMessageBox::critical( 0,
|
QMessageBox::critical( nullptr,
|
||||||
tr("Fatal error"),
|
tr("Fatal error"),
|
||||||
msg,
|
msg,
|
||||||
tr("Quit") );
|
tr("Quit") );
|
||||||
@ -2519,7 +2536,7 @@ void PTextEdit::musrFT()
|
|||||||
}
|
}
|
||||||
|
|
||||||
delete dlg;
|
delete dlg;
|
||||||
dlg = 0;
|
dlg = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
@ -2530,7 +2547,7 @@ void PTextEdit::musrPrefs()
|
|||||||
{
|
{
|
||||||
PPrefsDialog *dlg = new PPrefsDialog(fAdmin);
|
PPrefsDialog *dlg = new PPrefsDialog(fAdmin);
|
||||||
|
|
||||||
if (dlg == 0) {
|
if (dlg == nullptr) {
|
||||||
QMessageBox::critical(this, "**ERROR** musrPrefs", "Couldn't invoke Preferences Dialog.");
|
QMessageBox::critical(this, "**ERROR** musrPrefs", "Couldn't invoke Preferences Dialog.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2558,7 +2575,7 @@ void PTextEdit::musrPrefs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
delete dlg;
|
delete dlg;
|
||||||
dlg = 0;
|
dlg = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
@ -2599,7 +2616,7 @@ void PTextEdit::musrSetSteps()
|
|||||||
|
|
||||||
QProcess *proc = new QProcess(this);
|
QProcess *proc = new QProcess(this);
|
||||||
if (proc == nullptr) {
|
if (proc == nullptr) {
|
||||||
QMessageBox::critical(0, "**ERROR**", "Couldn't invoke QProcess!");
|
QMessageBox::critical(nullptr, "**ERROR**", "Couldn't invoke QProcess!");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2616,7 +2633,7 @@ void PTextEdit::musrSetSteps()
|
|||||||
if (!proc->waitForStarted()) {
|
if (!proc->waitForStarted()) {
|
||||||
// error handling
|
// error handling
|
||||||
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
QString msg(tr("Could not execute the output command: ")+cmd[0]);
|
||||||
QMessageBox::critical( 0,
|
QMessageBox::critical( nullptr,
|
||||||
tr("Fatal error"),
|
tr("Fatal error"),
|
||||||
msg,
|
msg,
|
||||||
tr("Quit") );
|
tr("Quit") );
|
||||||
@ -2668,42 +2685,42 @@ void PTextEdit::musrSwapMsrMlog()
|
|||||||
fileSave();
|
fileSave();
|
||||||
}
|
}
|
||||||
|
|
||||||
QMessageBox::information(0, "INFO", QString("Will now swap files: %1 <-> %2").arg(currentFileName).arg(swapFileName));
|
QMessageBox::information(nullptr, "INFO", QString("Will now swap files: %1 <-> %2").arg(currentFileName).arg(swapFileName));
|
||||||
|
|
||||||
// swap files
|
// swap files
|
||||||
|
|
||||||
// copy currentFile -> tempFile
|
// copy currentFile -> tempFile
|
||||||
if (QFile::exists(tempFileName)) {
|
if (QFile::exists(tempFileName)) {
|
||||||
if (!QFile::remove(tempFileName)) {
|
if (!QFile::remove(tempFileName)) {
|
||||||
QMessageBox::critical(0, "ERROR", QString("failed to remove %1").arg(tempFileName));
|
QMessageBox::critical(nullptr, "ERROR", QString("failed to remove %1").arg(tempFileName));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!QFile::copy(currentFileName, tempFileName)) {
|
if (!QFile::copy(currentFileName, tempFileName)) {
|
||||||
QMessageBox::critical(0, "ERROR", QString("failed to copy %1 -> %2").arg(currentFileName).arg(tempFileName));
|
QMessageBox::critical(nullptr, "ERROR", QString("failed to copy %1 -> %2").arg(currentFileName).arg(tempFileName));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// copy swapFile -> currentFile
|
// copy swapFile -> currentFile
|
||||||
if (!QFile::remove(currentFileName)) {
|
if (!QFile::remove(currentFileName)) {
|
||||||
QMessageBox::critical(0, "ERROR", QString("failed to remove %1").arg(currentFileName));
|
QMessageBox::critical(nullptr, "ERROR", QString("failed to remove %1").arg(currentFileName));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!QFile::copy(swapFileName, currentFileName)) {
|
if (!QFile::copy(swapFileName, currentFileName)) {
|
||||||
QMessageBox::critical(0, "ERROR", QString("failed to copy %1 -> %2").arg(swapFileName).arg(currentFileName));
|
QMessageBox::critical(nullptr, "ERROR", QString("failed to copy %1 -> %2").arg(swapFileName).arg(currentFileName));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// copy tempFile -> swapFile
|
// copy tempFile -> swapFile
|
||||||
if (!QFile::remove(swapFileName)) {
|
if (!QFile::remove(swapFileName)) {
|
||||||
QMessageBox::critical(0, "ERROR", QString("failed to remove %1").arg(swapFileName));
|
QMessageBox::critical(nullptr, "ERROR", QString("failed to remove %1").arg(swapFileName));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!QFile::copy(tempFileName, swapFileName)) {
|
if (!QFile::copy(tempFileName, swapFileName)) {
|
||||||
QMessageBox::critical(0, "ERROR", QString("failed to copy %1 -> %2").arg(tempFileName).arg(swapFileName));
|
QMessageBox::critical(nullptr, "ERROR", QString("failed to copy %1 -> %2").arg(tempFileName).arg(swapFileName));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// clean up
|
// clean up
|
||||||
if (!QFile::remove(tempFileName)) {
|
if (!QFile::remove(tempFileName)) {
|
||||||
QMessageBox::critical(0, "ERROR", QString("failed to remove %1").arg(tempFileName));
|
QMessageBox::critical(nullptr, "ERROR", QString("failed to remove %1").arg(tempFileName));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2777,7 +2794,7 @@ void PTextEdit::mupp()
|
|||||||
if (!proc->waitForStarted()) {
|
if (!proc->waitForStarted()) {
|
||||||
// error handling
|
// error handling
|
||||||
QString msg(tr("Could not execute the output command: ")+cmd);
|
QString msg(tr("Could not execute the output command: ")+cmd);
|
||||||
QMessageBox::critical( 0,
|
QMessageBox::critical( nullptr,
|
||||||
tr("Fatal error"),
|
tr("Fatal error"),
|
||||||
msg,
|
msg,
|
||||||
tr("Quit") );
|
tr("Quit") );
|
||||||
@ -2824,7 +2841,7 @@ void PTextEdit::helpAboutQt()
|
|||||||
void PTextEdit::exitStatusMusrWiz(int exitCode, QProcess::ExitStatus exitStatus)
|
void PTextEdit::exitStatusMusrWiz(int exitCode, QProcess::ExitStatus exitStatus)
|
||||||
{
|
{
|
||||||
if (exitStatus == QProcess::CrashExit) {
|
if (exitStatus == QProcess::CrashExit) {
|
||||||
QMessageBox::critical(0, "**FATAL**", "musrWiz returned CrashExit.");
|
QMessageBox::critical(nullptr, "**FATAL**", "musrWiz returned CrashExit.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2837,10 +2854,10 @@ void PTextEdit::exitStatusMusrWiz(int exitCode, QProcess::ExitStatus exitStatus)
|
|||||||
QString pathName = procEnv.value("HOME", "");
|
QString pathName = procEnv.value("HOME", "");
|
||||||
pathName += "/.musrfit/musredit/musrWiz.log";
|
pathName += "/.musrfit/musredit/musrWiz.log";
|
||||||
QString errMsg;
|
QString errMsg;
|
||||||
ifstream fin(pathName.toLatin1().data(), ifstream::in);
|
std::ifstream fin(pathName.toLatin1().data(), std::ifstream::in);
|
||||||
if (!fin.is_open()) {
|
if (!fin.is_open()) {
|
||||||
errMsg = QString("PTextEdit::exitStatusMusrWiz: couldn't read %1 file.").arg(pathName);
|
errMsg = QString("PTextEdit::exitStatusMusrWiz: couldn't read %1 file.").arg(pathName);
|
||||||
QMessageBox::critical(0, "**ERROR**", errMsg);
|
QMessageBox::critical(nullptr, "**ERROR**", errMsg);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
char line[128];
|
char line[128];
|
||||||
@ -2875,7 +2892,7 @@ void PTextEdit::exitStatusMusrWiz(int exitCode, QProcess::ExitStatus exitStatus)
|
|||||||
QFile logFile(pathName);
|
QFile logFile(pathName);
|
||||||
if (!logFile.remove()) {
|
if (!logFile.remove()) {
|
||||||
errMsg = QString("PTextEdit::exitStatusMusrWiz: couldn't delete %1 file.").arg(pathName);
|
errMsg = QString("PTextEdit::exitStatusMusrWiz: couldn't delete %1 file.").arg(pathName);
|
||||||
QMessageBox::critical(0, "**ERROR**", errMsg);
|
QMessageBox::critical(nullptr, "**ERROR**", errMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2888,7 +2905,7 @@ void PTextEdit::exitStatusMusrWiz(int exitCode, QProcess::ExitStatus exitStatus)
|
|||||||
void PTextEdit::exitStatusMusrSetSteps(int exitCode, QProcess::ExitStatus exitStatus)
|
void PTextEdit::exitStatusMusrSetSteps(int exitCode, QProcess::ExitStatus exitStatus)
|
||||||
{
|
{
|
||||||
if (exitStatus == QProcess::CrashExit) {
|
if (exitStatus == QProcess::CrashExit) {
|
||||||
QMessageBox::critical(0, "**FATAL**", "musrStep returned CrashExit.");
|
QMessageBox::critical(nullptr, "**FATAL**", "musrStep returned CrashExit.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2010-2016 by Andreas Suter *
|
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
@ -39,6 +39,7 @@
|
|||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
#include <QByteArray>
|
||||||
|
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
@ -63,7 +64,7 @@ class PTextEdit : public QMainWindow
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
PTextEdit( QWidget *parent = 0, Qt::WindowFlags f = 0 );
|
PTextEdit( QWidget *parent = nullptr, Qt::WindowFlags f = nullptr );
|
||||||
virtual ~PTextEdit() {}
|
virtual ~PTextEdit() {}
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
@ -132,6 +133,7 @@ private slots:
|
|||||||
void musrFit();
|
void musrFit();
|
||||||
void musrMsr2Data();
|
void musrMsr2Data();
|
||||||
void musrView();
|
void musrView();
|
||||||
|
void musrViewFinished(int, QProcess::ExitStatus);
|
||||||
void musrT0();
|
void musrT0();
|
||||||
void musrFT();
|
void musrFT();
|
||||||
void musrPrefs();
|
void musrPrefs();
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2010-2016 by Andreas Suter *
|
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
@ -28,7 +28,6 @@
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
using namespace std;
|
|
||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
|
||||||
@ -49,12 +48,12 @@ int main( int argc, char ** argv )
|
|||||||
|
|
||||||
if (argc == 2) {
|
if (argc == 2) {
|
||||||
if (!strcmp(argv[1], "--help") || !strcmp(argv[1], "-h")) {
|
if (!strcmp(argv[1], "--help") || !strcmp(argv[1], "-h")) {
|
||||||
cout << endl << "usage: musredit [<msr-files>] | -h, --help | -v, --version";
|
std::cout << std::endl << "usage: musredit [<msr-files>] | -h, --help | -v, --version";
|
||||||
cout << endl << endl;
|
std::cout << std::endl << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
} else if (!strcmp(argv[1], "--version") || !strcmp(argv[1], "-v")) {
|
} else if (!strcmp(argv[1], "--version") || !strcmp(argv[1], "-v")) {
|
||||||
cout << endl << "musredit git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1;
|
std::cout << std::endl << "musredit git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1;
|
||||||
cout << endl << endl;
|
std::cout << std::endl << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2010-2016 by Andreas Suter *
|
* Copyright (C) 2010-2019 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
|
@ -98,6 +98,7 @@ void musrview_syntax()
|
|||||||
*/
|
*/
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
int result = PMUSR_SUCCESS;
|
||||||
bool show_syntax = false;
|
bool show_syntax = false;
|
||||||
int status;
|
int status;
|
||||||
bool success = true;
|
bool success = true;
|
||||||
@ -119,7 +120,7 @@ int main(int argc, char *argv[])
|
|||||||
// check input arguments
|
// check input arguments
|
||||||
if (argc == 1) {
|
if (argc == 1) {
|
||||||
musrview_syntax();
|
musrview_syntax();
|
||||||
return PMUSR_SUCCESS;
|
return PMUSR_SYNTAX_REQUEST;
|
||||||
}
|
}
|
||||||
for (int i=1; i<argc; i++) {
|
for (int i=1; i<argc; i++) {
|
||||||
if (strstr(argv[i], ".msr") || strstr(argv[i], ".mlog")) {
|
if (strstr(argv[i], ".msr") || strstr(argv[i], ".mlog")) {
|
||||||
@ -272,11 +273,12 @@ int main(int argc, char *argv[])
|
|||||||
success = dataHandler->IsAllDataAvailable();
|
success = dataHandler->IsAllDataAvailable();
|
||||||
if (!success) {
|
if (!success) {
|
||||||
std::cerr << std::endl << ">> musrview **ERROR** Couldn't read all data files, will quit ..." << std::endl;
|
std::cerr << std::endl << ">> musrview **ERROR** Couldn't read all data files, will quit ..." << std::endl;
|
||||||
|
result = PMUSR_DATA_FILE_READ_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
// generate the necessary histogramms for the view
|
// generate the necessary histogramms for the view
|
||||||
PRunListCollection *runListCollection = nullptr;
|
PRunListCollection *runListCollection = nullptr;
|
||||||
if (success) {
|
if (result == PMUSR_SUCCESS) {
|
||||||
// feed all the necessary histogramms for the view
|
// feed all the necessary histogramms for the view
|
||||||
runListCollection = new PRunListCollection(msrHandler, dataHandler);
|
runListCollection = new PRunListCollection(msrHandler, dataHandler);
|
||||||
for (unsigned int i=0; i<msrHandler->GetMsrRunList()->size(); i++) {
|
for (unsigned int i=0; i<msrHandler->GetMsrRunList()->size(); i++) {
|
||||||
@ -293,13 +295,14 @@ int main(int argc, char *argv[])
|
|||||||
if (!success) {
|
if (!success) {
|
||||||
std::cerr << std::endl << ">> musrview **ERROR** Couldn't handle run no " << i << " ";
|
std::cerr << std::endl << ">> musrview **ERROR** Couldn't handle run no " << i << " ";
|
||||||
std::cerr << (*msrHandler->GetMsrRunList())[i].GetRunName()->Data();
|
std::cerr << (*msrHandler->GetMsrRunList())[i].GetRunName()->Data();
|
||||||
|
result = PMUSR_MSR_RUN_ERROR;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (success) {
|
if (result == PMUSR_SUCCESS) {
|
||||||
// generate Root application needed for PMusrCanvas
|
// generate Root application needed for PMusrCanvas
|
||||||
if (graphicsOutput || asciiOutput) {
|
if (graphicsOutput || asciiOutput) {
|
||||||
argv[argc] = (char*)malloc(16*sizeof(char));
|
argv[argc] = (char*)malloc(16*sizeof(char));
|
||||||
@ -409,5 +412,5 @@ int main(int argc, char *argv[])
|
|||||||
runListCollection = nullptr;
|
runListCollection = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
return PMUSR_SUCCESS;
|
return result;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user