added a feature which brings up a error message box, if there was any issue with the msr-file when starting musrview from musredit.
This commit is contained in:
54
src/include/PMsgBox.h
Normal file
54
src/include/PMsgBox.h
Normal file
@@ -0,0 +1,54 @@
|
||||
/***************************************************************************
|
||||
|
||||
PMsgBox.h
|
||||
|
||||
Author: Andreas Suter
|
||||
e-mail: andreas.suter@psi.ch
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 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 _PMSGBOX_H_
|
||||
#define _PMSGBOX_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <TApplication.h>
|
||||
#include <TGClient.h>
|
||||
#include <TGButton.h>
|
||||
#include <TGListBox.h>
|
||||
#include <TList.h>
|
||||
|
||||
class PMsgBox : public TGMainFrame {
|
||||
|
||||
private:
|
||||
TGListBox *fListBox;
|
||||
|
||||
public:
|
||||
PMsgBox(const std::string errMsg, const TGWindow *p, UInt_t w, UInt_t h);
|
||||
~PMsgBox() override;
|
||||
void DoExit();
|
||||
|
||||
ClassDefOverride(PMsgBox, 0)
|
||||
};
|
||||
|
||||
#endif // _PMSGBOX_H_
|
||||
39
src/include/PMsgBoxLinkDef.h
Normal file
39
src/include/PMsgBoxLinkDef.h
Normal file
@@ -0,0 +1,39 @@
|
||||
/***************************************************************************
|
||||
|
||||
PMsgBoxLinkDef.h
|
||||
|
||||
Author: Andreas Suter
|
||||
e-mail: andreas.suter@psi.ch
|
||||
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 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. *
|
||||
***************************************************************************/
|
||||
|
||||
#ifdef __CINT__
|
||||
|
||||
#pragma link off all globals;
|
||||
#pragma link off all classes;
|
||||
#pragma link off all functions;
|
||||
|
||||
#pragma link C++ class PMsgBox+;
|
||||
|
||||
#endif
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
#define _PMSRHANDLER_H_
|
||||
|
||||
#include <memory>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#include <TString.h>
|
||||
#include <TComplex.h>
|
||||
@@ -102,6 +104,8 @@ class PMsrHandler
|
||||
|
||||
virtual void GetGroupingString(Int_t runNo, TString detector, TString &groupingStr);
|
||||
virtual Bool_t EstimateN0();
|
||||
|
||||
virtual std::string GetLastErrorMsg() { return fLastErrorMsg.str(); }
|
||||
|
||||
private:
|
||||
Bool_t fFourierOnly; ///< flag indicating if Fourier transform only is wished. If yes, some part of the msr-file blocks are not needed.
|
||||
@@ -128,6 +132,8 @@ class PMsrHandler
|
||||
|
||||
Bool_t fCopyStatisticsBlock; ///< flag, if true: just copy to old statistics block (musrt0), otherwise write a new one (musrfit)
|
||||
|
||||
std::stringstream fLastErrorMsg;
|
||||
|
||||
virtual Bool_t HandleFitParameterEntry(PMsrLines &line);
|
||||
virtual Bool_t HandleTheoryEntry(PMsrLines &line);
|
||||
virtual Bool_t HandleFunctionsEntry(PMsrLines &line);
|
||||
|
||||
Reference in New Issue
Block a user