Compare commits
8 Commits
Author | SHA1 | Date | |
---|---|---|---|
0e2d880249 | |||
be8689853b | |||
a81515cb95 | |||
a09d6878f2 | |||
5ec1228ea6 | |||
8ecac5fd57 | |||
35760525bb | |||
c42bbd16f3 |
@ -5,7 +5,7 @@ if (CMAKE_VERSION GREATER_EQUAL 3.12)
|
|||||||
cmake_policy(SET CMP0075 NEW)
|
cmake_policy(SET CMP0075 NEW)
|
||||||
endif (CMAKE_VERSION GREATER_EQUAL 3.12)
|
endif (CMAKE_VERSION GREATER_EQUAL 3.12)
|
||||||
|
|
||||||
project(musrfit VERSION 1.6.2 LANGUAGES C CXX)
|
project(musrfit VERSION 1.6.3 LANGUAGES C CXX)
|
||||||
|
|
||||||
#--- musrfit specific options -------------------------------------------------
|
#--- musrfit specific options -------------------------------------------------
|
||||||
option(nexus "build optional NeXus support. Needed for ISIS" OFF)
|
option(nexus "build optional NeXus support. Needed for ISIS" OFF)
|
||||||
|
@ -12,6 +12,12 @@ or
|
|||||||
|
|
||||||
https://bitbucket.org/muonspin/musrfit/commits/all
|
https://bitbucket.org/muonspin/musrfit/commits/all
|
||||||
|
|
||||||
|
Release of V1.6.3, 2020/07/27
|
||||||
|
=============================
|
||||||
|
|
||||||
|
A single asymmetry plot allows to toggle the color of the theory function line
|
||||||
|
by the key 't'.
|
||||||
|
|
||||||
Release of V1.6.2, 2020/06/17
|
Release of V1.6.2, 2020/06/17
|
||||||
=============================
|
=============================
|
||||||
|
|
||||||
|
@ -141,6 +141,9 @@ Additionally, some functions can be accessed using *key-shortcuts*:
|
|||||||
reset the plotting range to the area given in the msr file ("un-zoom").
|
reset the plotting range to the area given in the msr file ("un-zoom").
|
||||||
**c**
|
**c**
|
||||||
toggles between normal and cross-hair cursor.
|
toggles between normal and cross-hair cursor.
|
||||||
|
**t**
|
||||||
|
a plot of a **single** data set allows to toggle the color of the theory function line.
|
||||||
|
|
||||||
|
|
||||||
.. index:: musrFT
|
.. index:: musrFT
|
||||||
.. _musrFT:
|
.. _musrFT:
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
var DOCUMENTATION_OPTIONS = {
|
var DOCUMENTATION_OPTIONS = {
|
||||||
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
|
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
|
||||||
VERSION: '1.6.2',
|
VERSION: '1.6.3',
|
||||||
LANGUAGE: 'None',
|
LANGUAGE: 'None',
|
||||||
COLLAPSE_INDEX: false,
|
COLLAPSE_INDEX: false,
|
||||||
FILE_SUFFIX: '.html',
|
FILE_SUFFIX: '.html',
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>Acknowledgements — musrfit 1.6.2 documentation</title>
|
<title>Acknowledgements — musrfit 1.6.3 documentation</title>
|
||||||
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||||
@ -30,7 +30,7 @@
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="musr-root.html" title="MusrRoot - an Extensible Open File Format for μSR"
|
<a href="musr-root.html" title="MusrRoot - an Extensible Open File Format for μSR"
|
||||||
accesskey="P">previous</a> |</li>
|
accesskey="P">previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -100,12 +100,12 @@ extremely competent way to deal with his projects as well as to deal with the ch
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="musr-root.html" title="MusrRoot - an Extensible Open File Format for μSR"
|
<a href="musr-root.html" title="MusrRoot - an Extensible Open File Format for μSR"
|
||||||
>previous</a> |</li>
|
>previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer" role="contentinfo">
|
<div class="footer" role="contentinfo">
|
||||||
© Copyright 2020, Andreas Suter.
|
© Copyright 2020, Andreas Suter.
|
||||||
Last updated on Jun 17, 2020.
|
Last updated on Jul 27, 2020.
|
||||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>any2many - a Universal μSR-file-format converter — musrfit 1.6.2 documentation</title>
|
<title>any2many - a Universal μSR-file-format converter — musrfit 1.6.3 documentation</title>
|
||||||
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||||
@ -30,7 +30,7 @@
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="msr2data.html" title="msr2data - A Program for Automatically Processing Multiple musrfit msr Files"
|
<a href="msr2data.html" title="msr2data - A Program for Automatically Processing Multiple musrfit msr Files"
|
||||||
accesskey="P">previous</a> |</li>
|
accesskey="P">previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -90,12 +90,12 @@ For a detailed description see <a class="reference internal" href="user-manual.h
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="msr2data.html" title="msr2data - A Program for Automatically Processing Multiple musrfit msr Files"
|
<a href="msr2data.html" title="msr2data - A Program for Automatically Processing Multiple musrfit msr Files"
|
||||||
>previous</a> |</li>
|
>previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer" role="contentinfo">
|
<div class="footer" role="contentinfo">
|
||||||
© Copyright 2020, Andreas Suter.
|
© Copyright 2020, Andreas Suter.
|
||||||
Last updated on Jun 17, 2020.
|
Last updated on Jul 27, 2020.
|
||||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>Bugtracking — musrfit 1.6.2 documentation</title>
|
<title>Bugtracking — musrfit 1.6.3 documentation</title>
|
||||||
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||||
@ -26,7 +26,7 @@
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="acknowledgement.html" title="Acknowledgements"
|
<a href="acknowledgement.html" title="Acknowledgements"
|
||||||
accesskey="P">previous</a> |</li>
|
accesskey="P">previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -81,12 +81,12 @@ or send an e-mail to A. Suter at PSI.</p>
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="acknowledgement.html" title="Acknowledgements"
|
<a href="acknowledgement.html" title="Acknowledgements"
|
||||||
>previous</a> |</li>
|
>previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer" role="contentinfo">
|
<div class="footer" role="contentinfo">
|
||||||
© Copyright 2020, Andreas Suter.
|
© Copyright 2020, Andreas Suter.
|
||||||
Last updated on Jun 17, 2020.
|
Last updated on Jul 27, 2020.
|
||||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>How to Cite musrfit? — musrfit 1.6.2 documentation</title>
|
<title>How to Cite musrfit? — musrfit 1.6.3 documentation</title>
|
||||||
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||||
@ -30,7 +30,7 @@
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="index.html" title="Welcome to the musrfit documentation!"
|
<a href="index.html" title="Welcome to the musrfit documentation!"
|
||||||
accesskey="P">previous</a> |</li>
|
accesskey="P">previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -102,12 +102,12 @@
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="index.html" title="Welcome to the musrfit documentation!"
|
<a href="index.html" title="Welcome to the musrfit documentation!"
|
||||||
>previous</a> |</li>
|
>previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer" role="contentinfo">
|
<div class="footer" role="contentinfo">
|
||||||
© Copyright 2020, Andreas Suter.
|
© Copyright 2020, Andreas Suter.
|
||||||
Last updated on Jun 17, 2020.
|
Last updated on Jul 27, 2020.
|
||||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>Index — musrfit 1.6.2 documentation</title>
|
<title>Index — musrfit 1.6.3 documentation</title>
|
||||||
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||||
@ -23,7 +23,7 @@
|
|||||||
<li class="right" style="margin-right: 10px">
|
<li class="right" style="margin-right: 10px">
|
||||||
<a href="#" title="General Index"
|
<a href="#" title="General Index"
|
||||||
accesskey="I">index</a></li>
|
accesskey="I">index</a></li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -613,12 +613,12 @@
|
|||||||
<li class="right" style="margin-right: 10px">
|
<li class="right" style="margin-right: 10px">
|
||||||
<a href="#" title="General Index"
|
<a href="#" title="General Index"
|
||||||
>index</a></li>
|
>index</a></li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer" role="contentinfo">
|
<div class="footer" role="contentinfo">
|
||||||
© Copyright 2020, Andreas Suter.
|
© Copyright 2020, Andreas Suter.
|
||||||
Last updated on Jun 17, 2020.
|
Last updated on Jul 27, 2020.
|
||||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>Welcome to the musrfit documentation! — musrfit 1.6.2 documentation</title>
|
<title>Welcome to the musrfit documentation! — musrfit 1.6.3 documentation</title>
|
||||||
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||||
@ -26,7 +26,7 @@
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="cite.html" title="How to Cite musrfit?"
|
<a href="cite.html" title="How to Cite musrfit?"
|
||||||
accesskey="N">next</a> |</li>
|
accesskey="N">next</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="#">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="#">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -168,12 +168,12 @@
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="cite.html" title="How to Cite musrfit?"
|
<a href="cite.html" title="How to Cite musrfit?"
|
||||||
>next</a> |</li>
|
>next</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="#">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="#">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer" role="contentinfo">
|
<div class="footer" role="contentinfo">
|
||||||
© Copyright 2020, Andreas Suter.
|
© Copyright 2020, Andreas Suter.
|
||||||
Last updated on Jun 17, 2020.
|
Last updated on Jul 27, 2020.
|
||||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>msr2data - A Program for Automatically Processing Multiple musrfit msr Files — musrfit 1.6.2 documentation</title>
|
<title>msr2data - A Program for Automatically Processing Multiple musrfit msr Files — musrfit 1.6.3 documentation</title>
|
||||||
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||||
@ -30,7 +30,7 @@
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="mupp.html" title="mupp - μSR Parameter Plotter"
|
<a href="mupp.html" title="mupp - μSR Parameter Plotter"
|
||||||
accesskey="P">previous</a> |</li>
|
accesskey="P">previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -418,12 +418,12 @@ fit serves as template for the second and so on. The template field stays empty
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="mupp.html" title="mupp - μSR Parameter Plotter"
|
<a href="mupp.html" title="mupp - μSR Parameter Plotter"
|
||||||
>previous</a> |</li>
|
>previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer" role="contentinfo">
|
<div class="footer" role="contentinfo">
|
||||||
© Copyright 2020, Andreas Suter.
|
© Copyright 2020, Andreas Suter.
|
||||||
Last updated on Jun 17, 2020.
|
Last updated on Jul 27, 2020.
|
||||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>mupp - μSR Parameter Plotter — musrfit 1.6.2 documentation</title>
|
<title>mupp - μSR Parameter Plotter — musrfit 1.6.3 documentation</title>
|
||||||
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||||
@ -30,7 +30,7 @@
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="musredit.html" title="musredit: the GUI Based Interface to musrfit"
|
<a href="musredit.html" title="musredit: the GUI Based Interface to musrfit"
|
||||||
accesskey="P">previous</a> |</li>
|
accesskey="P">previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -298,12 +298,12 @@ SCRIPT COMMANDS:
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="musredit.html" title="musredit: the GUI Based Interface to musrfit"
|
<a href="musredit.html" title="musredit: the GUI Based Interface to musrfit"
|
||||||
>previous</a> |</li>
|
>previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer" role="contentinfo">
|
<div class="footer" role="contentinfo">
|
||||||
© Copyright 2020, Andreas Suter.
|
© Copyright 2020, Andreas Suter.
|
||||||
Last updated on Jun 17, 2020.
|
Last updated on Jul 27, 2020.
|
||||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>MusrRoot - an Extensible Open File Format for μSR — musrfit 1.6.2 documentation</title>
|
<title>MusrRoot - an Extensible Open File Format for μSR — musrfit 1.6.3 documentation</title>
|
||||||
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||||
@ -30,7 +30,7 @@
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="any2many.html" title="any2many - a Universal μSR-file-format converter"
|
<a href="any2many.html" title="any2many - a Universal μSR-file-format converter"
|
||||||
accesskey="P">previous</a> |</li>
|
accesskey="P">previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -910,12 +910,12 @@ the entry has been added. The last token, <code class="docutils literal notransl
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="any2many.html" title="any2many - a Universal μSR-file-format converter"
|
<a href="any2many.html" title="any2many - a Universal μSR-file-format converter"
|
||||||
>previous</a> |</li>
|
>previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer" role="contentinfo">
|
<div class="footer" role="contentinfo">
|
||||||
© Copyright 2020, Andreas Suter.
|
© Copyright 2020, Andreas Suter.
|
||||||
Last updated on Jun 17, 2020.
|
Last updated on Jul 27, 2020.
|
||||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>musredit: the GUI Based Interface to musrfit — musrfit 1.6.2 documentation</title>
|
<title>musredit: the GUI Based Interface to musrfit — musrfit 1.6.3 documentation</title>
|
||||||
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||||
@ -30,7 +30,7 @@
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="setup-dks.html" title="Setting up musrfit / DKS: High Speed Fitting with GPU’s"
|
<a href="setup-dks.html" title="Setting up musrfit / DKS: High Speed Fitting with GPU’s"
|
||||||
accesskey="P">previous</a> |</li>
|
accesskey="P">previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -531,12 +531,12 @@ the corresponding fit parameter value, except the phases where the step will be
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="setup-dks.html" title="Setting up musrfit / DKS: High Speed Fitting with GPU’s"
|
<a href="setup-dks.html" title="Setting up musrfit / DKS: High Speed Fitting with GPU’s"
|
||||||
>previous</a> |</li>
|
>previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer" role="contentinfo">
|
<div class="footer" role="contentinfo">
|
||||||
© Copyright 2020, Andreas Suter.
|
© Copyright 2020, Andreas Suter.
|
||||||
Last updated on Jun 17, 2020.
|
Last updated on Jul 27, 2020.
|
||||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>Search — musrfit 1.6.2 documentation</title>
|
<title>Search — musrfit 1.6.3 documentation</title>
|
||||||
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||||
|
|
||||||
@ -27,7 +27,7 @@
|
|||||||
<li class="right" style="margin-right: 10px">
|
<li class="right" style="margin-right: 10px">
|
||||||
<a href="genindex.html" title="General Index"
|
<a href="genindex.html" title="General Index"
|
||||||
accesskey="I">index</a></li>
|
accesskey="I">index</a></li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -75,12 +75,12 @@
|
|||||||
<li class="right" style="margin-right: 10px">
|
<li class="right" style="margin-right: 10px">
|
||||||
<a href="genindex.html" title="General Index"
|
<a href="genindex.html" title="General Index"
|
||||||
>index</a></li>
|
>index</a></li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer" role="contentinfo">
|
<div class="footer" role="contentinfo">
|
||||||
© Copyright 2020, Andreas Suter.
|
© Copyright 2020, Andreas Suter.
|
||||||
Last updated on Jun 17, 2020.
|
Last updated on Jul 27, 2020.
|
||||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
File diff suppressed because one or more lines are too long
@ -4,7 +4,7 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>Setting up musrfit / DKS: High Speed Fitting with GPU’s — musrfit 1.6.2 documentation</title>
|
<title>Setting up musrfit / DKS: High Speed Fitting with GPU’s — musrfit 1.6.3 documentation</title>
|
||||||
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||||
@ -30,7 +30,7 @@
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="setup-standard.html" title="Setting up musrfit on Different Platforms"
|
<a href="setup-standard.html" title="Setting up musrfit on Different Platforms"
|
||||||
accesskey="P">previous</a> |</li>
|
accesskey="P">previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -309,12 +309,12 @@ The only thing you need <code class="docutils literal notranslate"><span class="
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="setup-standard.html" title="Setting up musrfit on Different Platforms"
|
<a href="setup-standard.html" title="Setting up musrfit on Different Platforms"
|
||||||
>previous</a> |</li>
|
>previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer" role="contentinfo">
|
<div class="footer" role="contentinfo">
|
||||||
© Copyright 2020, Andreas Suter.
|
© Copyright 2020, Andreas Suter.
|
||||||
Last updated on Jun 17, 2020.
|
Last updated on Jul 27, 2020.
|
||||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>Setting up musrfit on Different Platforms — musrfit 1.6.2 documentation</title>
|
<title>Setting up musrfit on Different Platforms — musrfit 1.6.3 documentation</title>
|
||||||
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||||
@ -30,7 +30,7 @@
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="user-libs.html" title="Documentation of user libs (user functions)"
|
<a href="user-libs.html" title="Documentation of user libs (user functions)"
|
||||||
accesskey="P">previous</a> |</li>
|
accesskey="P">previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -1293,12 +1293,12 @@ $ musrview test-histo-ROOT-NPP.msr
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="user-libs.html" title="Documentation of user libs (user functions)"
|
<a href="user-libs.html" title="Documentation of user libs (user functions)"
|
||||||
>previous</a> |</li>
|
>previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer" role="contentinfo">
|
<div class="footer" role="contentinfo">
|
||||||
© Copyright 2020, Andreas Suter.
|
© Copyright 2020, Andreas Suter.
|
||||||
Last updated on Jun 17, 2020.
|
Last updated on Jul 27, 2020.
|
||||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>Tutorial for musrfit — musrfit 1.6.2 documentation</title>
|
<title>Tutorial for musrfit — musrfit 1.6.3 documentation</title>
|
||||||
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||||
@ -30,7 +30,7 @@
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="cite.html" title="How to Cite musrfit?"
|
<a href="cite.html" title="How to Cite musrfit?"
|
||||||
accesskey="P">previous</a> |</li>
|
accesskey="P">previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -431,12 +431,12 @@ For a complete description please refer to the manuals of <a class="reference in
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="cite.html" title="How to Cite musrfit?"
|
<a href="cite.html" title="How to Cite musrfit?"
|
||||||
>previous</a> |</li>
|
>previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer" role="contentinfo">
|
<div class="footer" role="contentinfo">
|
||||||
© Copyright 2020, Andreas Suter.
|
© Copyright 2020, Andreas Suter.
|
||||||
Last updated on Jun 17, 2020.
|
Last updated on Jul 27, 2020.
|
||||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>Documentation of user libs (user functions) — musrfit 1.6.2 documentation</title>
|
<title>Documentation of user libs (user functions) — musrfit 1.6.3 documentation</title>
|
||||||
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||||
@ -30,7 +30,7 @@
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="user-manual.html" title="User manual"
|
<a href="user-manual.html" title="User manual"
|
||||||
accesskey="P">previous</a> |</li>
|
accesskey="P">previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -647,12 +647,12 @@ K(m)&=\int_0^{\pi/2}\frac{\mathrm d\varphi}{\sqrt{1-m^2\sin^2{\varphi}}},\en
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="user-manual.html" title="User manual"
|
<a href="user-manual.html" title="User manual"
|
||||||
>previous</a> |</li>
|
>previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer" role="contentinfo">
|
<div class="footer" role="contentinfo">
|
||||||
© Copyright 2020, Andreas Suter.
|
© Copyright 2020, Andreas Suter.
|
||||||
Last updated on Jun 17, 2020.
|
Last updated on Jul 27, 2020.
|
||||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8" />
|
<meta charset="utf-8" />
|
||||||
<title>User manual — musrfit 1.6.2 documentation</title>
|
<title>User manual — musrfit 1.6.3 documentation</title>
|
||||||
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
|
||||||
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
|
||||||
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
<script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
|
||||||
@ -30,7 +30,7 @@
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="tutorial.html" title="Tutorial for musrfit"
|
<a href="tutorial.html" title="Tutorial for musrfit"
|
||||||
accesskey="P">previous</a> |</li>
|
accesskey="P">previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -148,6 +148,8 @@ Supported values for <code class="docutils literal notranslate"><span class="pre
|
|||||||
</dd>
|
</dd>
|
||||||
<dt><strong>c</strong></dt><dd><p>toggles between normal and cross-hair cursor.</p>
|
<dt><strong>c</strong></dt><dd><p>toggles between normal and cross-hair cursor.</p>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt><strong>t</strong></dt><dd><p>a plot of a <strong>single</strong> data set allows to toggle the color of the theory function line.</p>
|
||||||
|
</dd>
|
||||||
</dl>
|
</dl>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -2465,12 +2467,12 @@ In case this cannot be ensured, the parallelization can be disabled by <em>–di
|
|||||||
<li class="right" >
|
<li class="right" >
|
||||||
<a href="tutorial.html" title="Tutorial for musrfit"
|
<a href="tutorial.html" title="Tutorial for musrfit"
|
||||||
>previous</a> |</li>
|
>previous</a> |</li>
|
||||||
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.2 documentation</a> »</li>
|
<li class="nav-item nav-item-0"><a href="index.html">musrfit 1.6.3 documentation</a> »</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<div class="footer" role="contentinfo">
|
<div class="footer" role="contentinfo">
|
||||||
© Copyright 2020, Andreas Suter.
|
© Copyright 2020, Andreas Suter.
|
||||||
Last updated on Jun 17, 2020.
|
Last updated on Jul 27, 2020.
|
||||||
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 2.2.2.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
@ -125,6 +125,7 @@ PMusrCanvas::PMusrCanvas()
|
|||||||
fValid = false;
|
fValid = false;
|
||||||
fAveragedView = false;
|
fAveragedView = false;
|
||||||
fDifferenceView = false;
|
fDifferenceView = false;
|
||||||
|
fToggleColor = false;
|
||||||
fCurrentPlotView = PV_DATA;
|
fCurrentPlotView = PV_DATA;
|
||||||
fPreviousPlotView = PV_DATA;
|
fPreviousPlotView = PV_DATA;
|
||||||
fPlotType = -1;
|
fPlotType = -1;
|
||||||
@ -1182,6 +1183,19 @@ void PMusrCanvas::HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected)
|
|||||||
fDataTheoryPad->SetCrosshair(0);
|
fDataTheoryPad->SetCrosshair(0);
|
||||||
}
|
}
|
||||||
fMainCanvas->Update();
|
fMainCanvas->Update();
|
||||||
|
} else if (x == 't') { // toggle theory color
|
||||||
|
if (fData.size() == 1) { // only do something if there is a single data set
|
||||||
|
if (fToggleColor) {
|
||||||
|
fData[0].theory->SetLineColor(kRed);
|
||||||
|
fData[0].theory->SetLineWidth(2);
|
||||||
|
} else {
|
||||||
|
fData[0].theory->SetLineColor(fColorList[0]);
|
||||||
|
fData[0].theory->SetLineWidth(1);
|
||||||
|
}
|
||||||
|
fToggleColor = !fToggleColor;
|
||||||
|
fDataTheoryPad->Modified();
|
||||||
|
fMainCanvas->Update();
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
fMainCanvas->Update();
|
fMainCanvas->Update();
|
||||||
}
|
}
|
||||||
@ -2384,6 +2398,7 @@ void PMusrCanvas::InitMusrCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy,
|
|||||||
fValid = false;
|
fValid = false;
|
||||||
fAveragedView = false;
|
fAveragedView = false;
|
||||||
fDifferenceView = false;
|
fDifferenceView = false;
|
||||||
|
fToggleColor = false;
|
||||||
fCurrentPlotView = PV_DATA;
|
fCurrentPlotView = PV_DATA;
|
||||||
fPreviousPlotView = PV_DATA;
|
fPreviousPlotView = PV_DATA;
|
||||||
fPlotType = -1;
|
fPlotType = -1;
|
||||||
|
@ -244,6 +244,7 @@ class PMusrCanvas : public TObject, public TQObject
|
|||||||
Bool_t fValid; ///< if true, everything looks OK
|
Bool_t fValid; ///< if true, everything looks OK
|
||||||
Bool_t fAveragedView; ///< tag showing that the averaged view or normal view should be presented.
|
Bool_t fAveragedView; ///< tag showing that the averaged view or normal view should be presented.
|
||||||
Bool_t fDifferenceView; ///< tag showing that the shown data, fourier, are the difference between data and theory
|
Bool_t fDifferenceView; ///< tag showing that the shown data, fourier, are the difference between data and theory
|
||||||
|
Bool_t fToggleColor; ///< tag showing if a single histo theory is color toggled
|
||||||
Int_t fCurrentPlotView; ///< tag showing what the current plot view is: data, fourier, ...
|
Int_t fCurrentPlotView; ///< tag showing what the current plot view is: data, fourier, ...
|
||||||
Int_t fPreviousPlotView; ///< tag showing the previous plot view
|
Int_t fPreviousPlotView; ///< tag showing the previous plot view
|
||||||
Int_t fPlotType; ///< plot type tag: -1 == undefined, MSR_PLOT_SINGLE_HISTO == single histogram, MSR_PLOT_ASYM == asymmetry, MSR_PLOT_BNMR == beta-NMR asymmetry, MSR_PLOT_MU_MINUS == mu minus (not yet implemented), MSR_PLOT_NON_MUSR == non-muSR
|
Int_t fPlotType; ///< plot type tag: -1 == undefined, MSR_PLOT_SINGLE_HISTO == single histogram, MSR_PLOT_ASYM == asymmetry, MSR_PLOT_BNMR == beta-NMR asymmetry, MSR_PLOT_MU_MINUS == mu minus (not yet implemented), MSR_PLOT_NON_MUSR == non-muSR
|
||||||
|
@ -32,6 +32,7 @@
|
|||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <QStringRef>
|
||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
@ -82,9 +83,56 @@ void PmuppColor::setRGB(const int r, const int g, const int b)
|
|||||||
*
|
*
|
||||||
* \param admin pointer to an admin class instance.
|
* \param admin pointer to an admin class instance.
|
||||||
*/
|
*/
|
||||||
PmuppAdminXMLParser::PmuppAdminXMLParser(PmuppAdmin *admin) : fAdmin(admin)
|
PmuppAdminXMLParser::PmuppAdminXMLParser(const QString& fln, PmuppAdmin *admin) : fAdmin(admin)
|
||||||
{
|
{
|
||||||
|
fValid = false;
|
||||||
fKeyWord = eEmpty;
|
fKeyWord = eEmpty;
|
||||||
|
|
||||||
|
QFile file(fln);
|
||||||
|
if (!file.open(QFile::ReadOnly | QFile::Text)) {
|
||||||
|
// warning and create default - STILL MISSING
|
||||||
|
}
|
||||||
|
|
||||||
|
fValid = parse(&file);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>parse the mupp startup xml-file.
|
||||||
|
*
|
||||||
|
* \param device QFile object of the mupp startup xml-file
|
||||||
|
*
|
||||||
|
* @return true on success, false otherwise
|
||||||
|
*/
|
||||||
|
bool PmuppAdminXMLParser::parse(QIODevice *device)
|
||||||
|
{
|
||||||
|
fXml.setDevice(device);
|
||||||
|
|
||||||
|
bool expectChars = false;
|
||||||
|
while (!fXml.atEnd()) {
|
||||||
|
fXml.readNext();
|
||||||
|
if (fXml.isStartDocument()) {
|
||||||
|
startDocument();
|
||||||
|
} else if (fXml.isStartElement()) {
|
||||||
|
startElement();
|
||||||
|
expectChars = true;
|
||||||
|
} else if (fXml.isCharacters() && expectChars) {
|
||||||
|
characters();
|
||||||
|
} else if (fXml.isEndElement()) {
|
||||||
|
endElement();
|
||||||
|
expectChars = false;
|
||||||
|
} else if (fXml.isEndDocument()) {
|
||||||
|
endDocument();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (fXml.hasError()) {
|
||||||
|
QString msg;
|
||||||
|
msg = QString("%1 Line %2, column %3").arg(fXml.errorString()).arg(fXml.lineNumber()).arg(fXml.columnNumber());
|
||||||
|
QMessageBox::critical(0, "**ERROR**", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -93,6 +141,7 @@ PmuppAdminXMLParser::PmuppAdminXMLParser(PmuppAdmin *admin) : fAdmin(admin)
|
|||||||
*/
|
*/
|
||||||
bool PmuppAdminXMLParser::startDocument()
|
bool PmuppAdminXMLParser::startDocument()
|
||||||
{
|
{
|
||||||
|
// nothing to be done here for now
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,13 +149,11 @@ bool PmuppAdminXMLParser::startDocument()
|
|||||||
/**
|
/**
|
||||||
* <p>Routine called when a new XML tag is found. Here it is used
|
* <p>Routine called when a new XML tag is found. Here it is used
|
||||||
* to set a tag for filtering afterwards the content.
|
* to set a tag for filtering afterwards the content.
|
||||||
*
|
|
||||||
* \param qName name of the XML tag.
|
|
||||||
*/
|
*/
|
||||||
bool PmuppAdminXMLParser::startElement( const QString&, const QString&,
|
bool PmuppAdminXMLParser::startElement()
|
||||||
const QString& qName,
|
|
||||||
const QXmlAttributes& )
|
|
||||||
{
|
{
|
||||||
|
QStringRef qName = fXml.name();
|
||||||
|
|
||||||
if (qName == "path_file_name") {
|
if (qName == "path_file_name") {
|
||||||
fKeyWord = eRecentFile;
|
fKeyWord = eRecentFile;
|
||||||
} else if (qName == "dark_theme") {
|
} else if (qName == "dark_theme") {
|
||||||
@ -125,10 +172,8 @@ bool PmuppAdminXMLParser::startElement( const QString&, const QString&,
|
|||||||
* <p>Routine called when the end XML tag is found. It is used to
|
* <p>Routine called when the end XML tag is found. It is used to
|
||||||
* put the filtering tag to 'empty'. It also resets the fFunc flag in case
|
* put the filtering tag to 'empty'. It also resets the fFunc flag in case
|
||||||
* the entry was a theory function.
|
* the entry was a theory function.
|
||||||
*
|
|
||||||
* \param qName name of the element.
|
|
||||||
*/
|
*/
|
||||||
bool PmuppAdminXMLParser::endElement( const QString&, const QString&, const QString& )
|
bool PmuppAdminXMLParser::endElement()
|
||||||
{
|
{
|
||||||
fKeyWord = eEmpty;
|
fKeyWord = eEmpty;
|
||||||
|
|
||||||
@ -139,11 +184,13 @@ bool PmuppAdminXMLParser::endElement( const QString&, const QString&, const QStr
|
|||||||
/**
|
/**
|
||||||
* <p>This routine delivers the content of an XML tag. It fills the
|
* <p>This routine delivers the content of an XML tag. It fills the
|
||||||
* content into the load data structure.
|
* content into the load data structure.
|
||||||
*
|
|
||||||
* \param str keeps the content of the XML tag.
|
|
||||||
*/
|
*/
|
||||||
bool PmuppAdminXMLParser::characters(const QString& str)
|
bool PmuppAdminXMLParser::characters()
|
||||||
{
|
{
|
||||||
|
QString str = *fXml.text().string();
|
||||||
|
if (str.isEmpty())
|
||||||
|
return true;
|
||||||
|
|
||||||
bool ok;
|
bool ok;
|
||||||
int ival, r, g, b;
|
int ival, r, g, b;
|
||||||
double dval;
|
double dval;
|
||||||
@ -218,66 +265,6 @@ bool PmuppAdminXMLParser::endDocument()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>Report XML warnings.
|
|
||||||
*
|
|
||||||
* \param exception holds the information of the XML warning
|
|
||||||
*/
|
|
||||||
bool PmuppAdminXMLParser::warning( const QXmlParseException & exception )
|
|
||||||
{
|
|
||||||
QString msg;
|
|
||||||
|
|
||||||
msg = QString("**WARNING** while parsing mupp_startup.xml in line no %1\n").arg(exception.lineNumber());
|
|
||||||
msg += QString("**WARNING MESSAGE** ") + exception.message();
|
|
||||||
|
|
||||||
qWarning() << endl << msg << endl;
|
|
||||||
|
|
||||||
QMessageBox::warning(0, "WARNING", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>Report recoverable XML errors.
|
|
||||||
*
|
|
||||||
* \param exception holds the information of the XML recoverable errors.
|
|
||||||
*/
|
|
||||||
bool PmuppAdminXMLParser::error( const QXmlParseException & exception )
|
|
||||||
{
|
|
||||||
QString msg;
|
|
||||||
|
|
||||||
msg = QString("**ERROR** while parsing mupp_startup.xml in line no %1\n").arg(exception.lineNumber());
|
|
||||||
msg += QString("**ERROR MESSAGE** ") + exception.message();
|
|
||||||
|
|
||||||
qWarning() << endl << msg << endl;
|
|
||||||
|
|
||||||
QMessageBox::critical(0, "ERROR", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>Report fatal XML errors.
|
|
||||||
*
|
|
||||||
* \param exception holds the information of the XML fatal errors.
|
|
||||||
*/
|
|
||||||
bool PmuppAdminXMLParser::fatalError( const QXmlParseException & exception )
|
|
||||||
{
|
|
||||||
QString msg;
|
|
||||||
|
|
||||||
msg = QString("**FATAL ERROR** while parsing mupp_startup.xml in line no %1\n").arg(exception.lineNumber());
|
|
||||||
msg += QString("**FATAL ERROR MESSAGE** ") + exception.message();
|
|
||||||
|
|
||||||
qWarning() << endl << msg << endl;
|
|
||||||
|
|
||||||
QMessageBox::critical(0, "FATAL ERROR", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
// implementation of PmuppAdmin class
|
// implementation of PmuppAdmin class
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -315,21 +302,16 @@ PmuppAdmin::PmuppAdmin() : QObject(), fDarkTheme(false)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (QFile::exists(pathFln)) { // administration file present
|
if (QFile::exists(pathFln)) { // administration file present
|
||||||
PmuppAdminXMLParser handler(this);
|
PmuppAdminXMLParser handler(pathFln, this);
|
||||||
QFile xmlFile(pathFln);
|
if (!handler.isValid()) {
|
||||||
QXmlInputSource source( &xmlFile );
|
QMessageBox::critical(0, "**ERROR**",
|
||||||
QXmlSimpleReader reader;
|
|
||||||
reader.setContentHandler( &handler );
|
|
||||||
reader.setErrorHandler( &handler );
|
|
||||||
if (!reader.parse( source )) {
|
|
||||||
QMessageBox::critical(0, "ERROR",
|
|
||||||
"Error parsing mupp_startup.xml settings file.\nProbably a few things will not work porperly.\nPlease fix this first.",
|
"Error parsing mupp_startup.xml settings file.\nProbably a few things will not work porperly.\nPlease fix this first.",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::critical(0, "ERROR",
|
QMessageBox::critical(0, "**ERROR**",
|
||||||
"Couldn't find the mupp_startup.xml settings file.\nProbably a few things will not work porperly.\nPlease fix this first.",
|
"Couldn't find the mupp_startup.xml settings file.\nProbably a few things will not work porperly.\nPlease fix this first.",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return;
|
return;
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
#include <QtXml>
|
#include <QXmlStreamReader>
|
||||||
|
|
||||||
#include "mupp.h"
|
#include "mupp.h"
|
||||||
|
|
||||||
@ -93,29 +93,28 @@ class PmuppMarker {
|
|||||||
* necessary informations about executable pathes, online help informations,
|
* necessary informations about executable pathes, online help informations,
|
||||||
* default font sizes, etc.
|
* default font sizes, etc.
|
||||||
*/
|
*/
|
||||||
class PmuppAdminXMLParser : public QXmlDefaultHandler
|
class PmuppAdminXMLParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PmuppAdminXMLParser(PmuppAdmin*);
|
PmuppAdminXMLParser(const QString &fln, PmuppAdmin*);
|
||||||
virtual ~PmuppAdminXMLParser() {}
|
virtual ~PmuppAdminXMLParser() {}
|
||||||
|
|
||||||
|
virtual bool isValid() { return fValid; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum EAdminKeyWords {eEmpty, eRecentFile, eDarkTheme, eMarker, eColor};
|
enum EAdminKeyWords {eEmpty, eRecentFile, eDarkTheme, eMarker, eColor};
|
||||||
|
|
||||||
|
bool parse(QIODevice *device);
|
||||||
bool startDocument();
|
bool startDocument();
|
||||||
bool startElement( const QString&, const QString&, const QString& ,
|
bool startElement();
|
||||||
const QXmlAttributes& );
|
bool endElement();
|
||||||
bool endElement( const QString&, const QString&, const QString& );
|
bool characters();
|
||||||
|
|
||||||
bool characters(const QString&);
|
|
||||||
bool endDocument();
|
bool endDocument();
|
||||||
|
|
||||||
bool warning( const QXmlParseException & exception );
|
QXmlStreamReader fXml; ///< xml stream reader object
|
||||||
bool error( const QXmlParseException & exception );
|
bool fValid; ///< flag showing if XML read has been successful
|
||||||
bool fatalError( const QXmlParseException & exception );
|
EAdminKeyWords fKeyWord; ///< key word tag to know how to handle the content
|
||||||
|
PmuppAdmin *fAdmin; ///< a pointer to the main administration class object
|
||||||
EAdminKeyWords fKeyWord; ///< key word tag to know how to handle the content
|
|
||||||
PmuppAdmin *fAdmin; ///< a pointer to the main administration class object
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include <cmath>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include <QProcessEnvironment>
|
#include <QProcessEnvironment>
|
||||||
|
@ -37,6 +37,8 @@
|
|||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
#include <QTextStream>
|
||||||
|
#include <QTimer>
|
||||||
|
|
||||||
#include "mupp_version.h"
|
#include "mupp_version.h"
|
||||||
#include "PmuppScript.h"
|
#include "PmuppScript.h"
|
||||||
|
@ -70,9 +70,16 @@ namespace mupp { namespace ast
|
|||||||
fun_sin,
|
fun_sin,
|
||||||
fun_cos,
|
fun_cos,
|
||||||
fun_tan,
|
fun_tan,
|
||||||
|
fun_sinh,
|
||||||
|
fun_cosh,
|
||||||
|
fun_tanh,
|
||||||
|
fun_asin,
|
||||||
|
fun_acos,
|
||||||
|
fun_atan,
|
||||||
fun_exp,
|
fun_exp,
|
||||||
fun_log,
|
fun_log,
|
||||||
fun_ln
|
fun_ln,
|
||||||
|
fun_sqrt
|
||||||
};
|
};
|
||||||
|
|
||||||
struct nil {};
|
struct nil {};
|
||||||
|
@ -86,9 +86,16 @@ namespace mupp { namespace parser
|
|||||||
("sin", ast::fun_sin)
|
("sin", ast::fun_sin)
|
||||||
("cos", ast::fun_cos)
|
("cos", ast::fun_cos)
|
||||||
("tan", ast::fun_tan)
|
("tan", ast::fun_tan)
|
||||||
|
("sinh", ast::fun_sinh)
|
||||||
|
("cosh", ast::fun_cosh)
|
||||||
|
("tanh", ast::fun_tanh)
|
||||||
|
("asin", ast::fun_asin)
|
||||||
|
("acos", ast::fun_acos)
|
||||||
|
("atan", ast::fun_atan)
|
||||||
("exp", ast::fun_exp)
|
("exp", ast::fun_exp)
|
||||||
("log", ast::fun_log)
|
("log", ast::fun_log)
|
||||||
("ln", ast::fun_ln)
|
("ln", ast::fun_ln)
|
||||||
|
("sqrt", ast::fun_sqrt)
|
||||||
;
|
;
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
|
@ -102,9 +102,16 @@ namespace mupp { namespace prog {
|
|||||||
case ast::fun_sin:
|
case ast::fun_sin:
|
||||||
case ast::fun_cos:
|
case ast::fun_cos:
|
||||||
case ast::fun_tan:
|
case ast::fun_tan:
|
||||||
|
case ast::fun_sinh:
|
||||||
|
case ast::fun_cosh:
|
||||||
|
case ast::fun_tanh:
|
||||||
|
case ast::fun_asin:
|
||||||
|
case ast::fun_acos:
|
||||||
|
case ast::fun_atan:
|
||||||
case ast::fun_exp:
|
case ast::fun_exp:
|
||||||
case ast::fun_log:
|
case ast::fun_log:
|
||||||
case ast::fun_ln:
|
case ast::fun_ln:
|
||||||
|
case ast::fun_sqrt:
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
BOOST_ASSERT(0);
|
BOOST_ASSERT(0);
|
||||||
@ -412,6 +419,30 @@ namespace mupp { namespace prog {
|
|||||||
for (unsigned int i=0; i<vec.size(); i++)
|
for (unsigned int i=0; i<vec.size(); i++)
|
||||||
vec[i] = tan(vec[i]);
|
vec[i] = tan(vec[i]);
|
||||||
break;
|
break;
|
||||||
|
case ast::fun_sinh:
|
||||||
|
for (unsigned int i=0; i<vec.size(); i++)
|
||||||
|
vec[i] = sinh(vec[i]);
|
||||||
|
break;
|
||||||
|
case ast::fun_cosh:
|
||||||
|
for (unsigned int i=0; i<vec.size(); i++)
|
||||||
|
vec[i] = cosh(vec[i]);
|
||||||
|
break;
|
||||||
|
case ast::fun_tanh:
|
||||||
|
for (unsigned int i=0; i<vec.size(); i++)
|
||||||
|
vec[i] = tanh(vec[i]);
|
||||||
|
break;
|
||||||
|
case ast::fun_asin:
|
||||||
|
for (unsigned int i=0; i<vec.size(); i++)
|
||||||
|
vec[i] = asin(vec[i]);
|
||||||
|
break;
|
||||||
|
case ast::fun_acos:
|
||||||
|
for (unsigned int i=0; i<vec.size(); i++)
|
||||||
|
vec[i] = acos(vec[i]);
|
||||||
|
break;
|
||||||
|
case ast::fun_atan:
|
||||||
|
for (unsigned int i=0; i<vec.size(); i++)
|
||||||
|
vec[i] = atan(vec[i]);
|
||||||
|
break;
|
||||||
case ast::fun_exp:
|
case ast::fun_exp:
|
||||||
for (unsigned int i=0; i<vec.size(); i++)
|
for (unsigned int i=0; i<vec.size(); i++)
|
||||||
vec[i] = exp(vec[i]);
|
vec[i] = exp(vec[i]);
|
||||||
@ -436,6 +467,16 @@ namespace mupp { namespace prog {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case ast::fun_sqrt:
|
||||||
|
for (unsigned int i=0; i<vec.size(); i++) {
|
||||||
|
if (vec[i] <= 0.0) {
|
||||||
|
BOOST_ASSERT(0);
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
vec[i] = sqrt(vec[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
BOOST_ASSERT(0);
|
BOOST_ASSERT(0);
|
||||||
break;
|
break;
|
||||||
|
@ -36,6 +36,9 @@ using namespace std;
|
|||||||
#include <QFile>
|
#include <QFile>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
#include <QXmlStreamAttributes>
|
||||||
|
|
||||||
|
#include <QtDebug>
|
||||||
|
|
||||||
#include "PAdmin.h"
|
#include "PAdmin.h"
|
||||||
|
|
||||||
@ -47,28 +50,78 @@ using namespace std;
|
|||||||
*
|
*
|
||||||
* \param admin pointer to an admin class instance.
|
* \param admin pointer to an admin class instance.
|
||||||
*/
|
*/
|
||||||
PFuncXMLParser::PFuncXMLParser(PAdmin *admin) : fAdmin(admin)
|
PFuncXMLParser::PFuncXMLParser(const QString& fln, PAdmin *admin) : fAdmin(admin)
|
||||||
{
|
{
|
||||||
|
fValid = false;
|
||||||
fKeyWord = eEmpty;
|
fKeyWord = eEmpty;
|
||||||
|
|
||||||
|
QFile file(fln);
|
||||||
|
if (!file.open(QFile::ReadOnly | QFile::Text)) {
|
||||||
|
// warning and create default - STILL MISSING
|
||||||
|
}
|
||||||
|
|
||||||
|
fValid = parse(&file);
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>parse musrfit_funcs.xml
|
||||||
|
*
|
||||||
|
* \param device QFile object of musrfit_funcs.xml
|
||||||
|
*
|
||||||
|
* @return true on success, false otherwise
|
||||||
*/
|
*/
|
||||||
bool PFuncXMLParser::startDocument()
|
bool PFuncXMLParser::parse(QIODevice *device)
|
||||||
{
|
{
|
||||||
|
fXml.setDevice(device);
|
||||||
|
|
||||||
|
bool expectChars = false;
|
||||||
|
while (!fXml.atEnd()) {
|
||||||
|
fXml.readNext();
|
||||||
|
if (fXml.isStartDocument()) {
|
||||||
|
startDocument();
|
||||||
|
} else if (fXml.isStartElement()) {
|
||||||
|
startElement();
|
||||||
|
expectChars = true;
|
||||||
|
} else if (fXml.isCharacters() && expectChars) {
|
||||||
|
characters();
|
||||||
|
} else if (fXml.isEndElement()) {
|
||||||
|
endElement();
|
||||||
|
expectChars = false;
|
||||||
|
} else if (fXml.isEndDocument()) {
|
||||||
|
endDocument();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (fXml.hasError()) {
|
||||||
|
QString msg;
|
||||||
|
msg = QString("%1 Line %2, column %3").arg(fXml.errorString()).arg(fXml.lineNumber()).arg(fXml.columnNumber());
|
||||||
|
QMessageBox::critical(0, "**ERROR**", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>Routine called at the beginning of the XML parsing process.
|
||||||
*/
|
*/
|
||||||
bool PFuncXMLParser::startElement(const QString&, const QString&,
|
bool PFuncXMLParser::startDocument()
|
||||||
const QString& qName,
|
|
||||||
const QXmlAttributes& qAttr)
|
|
||||||
{
|
{
|
||||||
|
// nothing to be done here for now
|
||||||
|
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.
|
||||||
|
*/
|
||||||
|
bool PFuncXMLParser::startElement()
|
||||||
|
{
|
||||||
|
QStringRef qName = fXml.name();
|
||||||
|
QString str;
|
||||||
|
|
||||||
QString errMsg("");
|
QString errMsg("");
|
||||||
int ival;
|
int ival;
|
||||||
double dval;
|
double dval;
|
||||||
@ -83,29 +136,26 @@ bool PFuncXMLParser::startElement(const QString&, const QString&,
|
|||||||
} else if (qName == "theo_fun") {
|
} else if (qName == "theo_fun") {
|
||||||
fKeyWord = eTemplateFunc;
|
fKeyWord = eTemplateFunc;
|
||||||
} else if (qName == "theo_map") {
|
} else if (qName == "theo_map") {
|
||||||
|
QXmlStreamAttributes qAttr = fXml.attributes();
|
||||||
if (qAttr.count() != 2) {
|
if (qAttr.count() != 2) {
|
||||||
errMsg = QString("theo_map should have 2 attributes, called 'no', and 'name', found %1").arg(qAttr.count());
|
errMsg = QString("theo_map should have 2 attributes, called 'no', and 'name', found %1").arg(qAttr.count());
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
QMessageBox::critical(0, "ERROR", errMsg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
PParam map;
|
PParam map;
|
||||||
for (int i=0; i<qAttr.count(); i++) {
|
// get map number
|
||||||
if (qAttr.qName(i) == "no") {
|
str = qAttr.value("no").toString();
|
||||||
ival = qAttr.value(i).toInt(&ok);
|
ival = str.toInt(&ok);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
errMsg = QString("theo_map attribute 'no' is not a number (%1)").arg(qAttr.value(i));
|
errMsg = QString("theo_map attribute 'no' is not a number (%1)").arg(str);
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
QMessageBox::critical(0, "ERROR", errMsg);
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
map.setNumber(ival);
|
|
||||||
} else if (qAttr.qName(i) == "name") {
|
|
||||||
map.setName(qAttr.value(i));
|
|
||||||
} else {
|
|
||||||
errMsg = QString("found unkown theo_map attribute (%1)").arg(qAttr.qName(i));
|
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
map.setNumber(ival);
|
||||||
|
// get map name
|
||||||
|
str = qAttr.value("name").toString();
|
||||||
|
map.setName(str);
|
||||||
|
|
||||||
// check that all necessary attributes where found
|
// check that all necessary attributes where found
|
||||||
if ((map.getName() == "UnDef") || (map.getNumber() == -1)) {
|
if ((map.getName() == "UnDef") || (map.getNumber() == -1)) {
|
||||||
errMsg = QString("found theo_map with missing attribute(s)");
|
errMsg = QString("found theo_map with missing attribute(s)");
|
||||||
@ -114,45 +164,51 @@ bool PFuncXMLParser::startElement(const QString&, const QString&,
|
|||||||
}
|
}
|
||||||
fTheoTemplate.appendMap(map);
|
fTheoTemplate.appendMap(map);
|
||||||
} else if (qName == "template_param") {
|
} else if (qName == "template_param") {
|
||||||
|
QXmlStreamAttributes qAttr = fXml.attributes();
|
||||||
if ((qAttr.count() != 4) && (qAttr.count() != 6)) {
|
if ((qAttr.count() != 4) && (qAttr.count() != 6)) {
|
||||||
errMsg = QString("template_param should have 4 or 6 attributes, called\n'no', 'name', 'value', 'step', ['boundLow', 'boundHigh'] found %1").arg(qAttr.count());
|
errMsg = QString("template_param should have 4 or 6 attributes, called\n'no', 'name', 'value', 'step', ['boundLow', 'boundHigh'] found %1").arg(qAttr.count());
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
QMessageBox::critical(0, "ERROR", errMsg);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
PParam param;
|
PParam param;
|
||||||
for (int i=0; i<qAttr.count(); i++) {
|
// parameter number
|
||||||
if (qAttr.qName(i) == "no") {
|
str = qAttr.value("no").toString();
|
||||||
ival = qAttr.value(i).toInt(&ok);
|
ival = str.toInt(&ok);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
errMsg = QString("template_param attribute 'no' is not a number (%1)").arg(qAttr.value(i));
|
errMsg = QString("template_param attribute 'no' is not a number (%1)").arg(str);
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
QMessageBox::critical(0, "ERROR", errMsg);
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
param.setNumber(ival);
|
|
||||||
} else if (qAttr.qName(i) == "name") {
|
|
||||||
param.setName(qAttr.value(i));
|
|
||||||
} else if (qAttr.qName(i) == "value") {
|
|
||||||
dval = qAttr.value(i).toDouble(&ok);
|
|
||||||
if (!ok) {
|
|
||||||
errMsg = QString("template_param attribute 'value' is not a number (%1)").arg(qAttr.value(i));
|
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
param.setValue(dval);
|
|
||||||
} else if (qAttr.qName(i) == "step") {
|
|
||||||
dval = qAttr.value(i).toDouble(&ok);
|
|
||||||
if (!ok) {
|
|
||||||
errMsg = QString("template_param attribute 'step' is not a number (%1)").arg(qAttr.value(i));
|
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
param.setStep(dval);
|
|
||||||
} else if (qAttr.qName(i) == "boundLow") {
|
|
||||||
param.setBoundLow(qAttr.qName(i));
|
|
||||||
} else if (qAttr.qName(i) == "boundHigh") {
|
|
||||||
param.setBoundHigh(qAttr.qName(i));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
param.setNumber(ival);
|
||||||
|
// parameter name
|
||||||
|
str = qAttr.value("name").toString();
|
||||||
|
param.setName(str);
|
||||||
|
// parameter value
|
||||||
|
str = qAttr.value("value").toString();
|
||||||
|
dval = str.toDouble(&ok);
|
||||||
|
if (!ok) {
|
||||||
|
errMsg = QString("template_param attribute 'value' is not a number (%1)").arg(str);
|
||||||
|
QMessageBox::critical(0, "ERROR", errMsg);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
param.setValue(dval);
|
||||||
|
// parameter step
|
||||||
|
str = qAttr.value("step").toString();
|
||||||
|
dval = str.toDouble(&ok);
|
||||||
|
if (!ok) {
|
||||||
|
errMsg = QString("template_param attribute 'step' is not a number (%1)").arg(str);
|
||||||
|
QMessageBox::critical(0, "ERROR", errMsg);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
param.setStep(dval);
|
||||||
|
// parameter lower bound
|
||||||
|
str = qAttr.value("boundLow").toString();
|
||||||
|
if (!str.isEmpty())
|
||||||
|
param.setBoundLow(str);
|
||||||
|
// parameter upper bound
|
||||||
|
str = qAttr.value("boundHigh").toString();
|
||||||
|
if (!str.isEmpty())
|
||||||
|
param.setBoundHigh(str);
|
||||||
fTheoTemplate.appendParam(param);
|
fTheoTemplate.appendParam(param);
|
||||||
} else if (qName == "func") {
|
} else if (qName == "func") {
|
||||||
fFunc.initFunc();
|
fFunc.initFunc();
|
||||||
@ -177,12 +233,16 @@ bool PFuncXMLParser::startElement(const QString&, const QString&,
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>Routine called when the end XML tag is found. It is used to
|
||||||
|
* put the filtering tag to 'empty'. It also resets the fFunc flag in case
|
||||||
|
* the entry was a theory function.
|
||||||
*/
|
*/
|
||||||
bool PFuncXMLParser::endElement( const QString&, const QString&, const QString &qName )
|
bool PFuncXMLParser::endElement()
|
||||||
{
|
{
|
||||||
fKeyWord = eEmpty;
|
fKeyWord = eEmpty;
|
||||||
|
|
||||||
|
QStringRef qName = fXml.name();
|
||||||
|
|
||||||
if (qName == "theo_template") {
|
if (qName == "theo_template") {
|
||||||
fAdmin->fTheoTemplate.push_back(fTheoTemplate);
|
fAdmin->fTheoTemplate.push_back(fTheoTemplate);
|
||||||
} else if (qName == "func") {
|
} else if (qName == "func") {
|
||||||
@ -196,10 +256,15 @@ bool PFuncXMLParser::endElement( const QString&, const QString&, const QString &
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>This routine delivers the content of an XML tag. It fills the
|
||||||
|
* content into the load data structure.
|
||||||
*/
|
*/
|
||||||
bool PFuncXMLParser::characters(const QString &str)
|
bool PFuncXMLParser::characters()
|
||||||
{
|
{
|
||||||
|
QString str = *fXml.text().string();
|
||||||
|
if (str.isEmpty())
|
||||||
|
return true;
|
||||||
|
|
||||||
bool ok;
|
bool ok;
|
||||||
int ival;
|
int ival;
|
||||||
double dval;
|
double dval;
|
||||||
@ -246,82 +311,77 @@ bool PFuncXMLParser::characters(const QString &str)
|
|||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>Called at the end of the XML parse process. It checks if default paths
|
||||||
|
* contain system variables, and if so expand them for the further use.
|
||||||
*/
|
*/
|
||||||
bool PFuncXMLParser::endDocument()
|
bool PFuncXMLParser::endDocument()
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
*/
|
|
||||||
bool PFuncXMLParser::warning( const QXmlParseException & exception )
|
|
||||||
{
|
|
||||||
QString msg;
|
|
||||||
|
|
||||||
msg = QString("**WARNING** while parsing musrfit_funcs.xml in line no %1\n").arg(exception.lineNumber());
|
|
||||||
msg += QString("**WARNING MESSAGE** ") + exception.message();
|
|
||||||
|
|
||||||
qWarning() << endl << msg << endl;
|
|
||||||
|
|
||||||
QMessageBox::warning(0, "WARNING", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
*/
|
|
||||||
bool PFuncXMLParser::error( const QXmlParseException & exception )
|
|
||||||
{
|
|
||||||
QString msg;
|
|
||||||
|
|
||||||
msg = QString("**ERROR** while parsing musrfit_funcs.xml in line no %1\n").arg(exception.lineNumber());
|
|
||||||
msg += QString("**ERROR MESSAGE** ") + exception.message();
|
|
||||||
|
|
||||||
qWarning() << endl << msg << endl;
|
|
||||||
|
|
||||||
QMessageBox::warning(0, "ERROR", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
*/
|
|
||||||
bool PFuncXMLParser::fatalError( const QXmlParseException & exception )
|
|
||||||
{
|
|
||||||
QString msg;
|
|
||||||
|
|
||||||
msg = QString("**FATAL ERROR** while parsing musrfit_funcs.xml in line no %1\n").arg(exception.lineNumber());
|
|
||||||
msg += QString("**FATAL ERROR MESSAGE** ") + exception.message();
|
|
||||||
|
|
||||||
qWarning() << endl << msg << endl;
|
|
||||||
|
|
||||||
QMessageBox::warning(0, "FATAL ERROR", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
// implementation of PInstrumentDefXMLParser class
|
// implementation of PInstrumentDefXMLParser class
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* <p>XML Parser class for the instrument definition file(s).
|
* <p>XML Parser class for the instrument definition file(s).
|
||||||
*
|
*
|
||||||
|
* \param file name of the instrument definition file(s).
|
||||||
* \param admin pointer to an admin class instance.
|
* \param admin pointer to an admin class instance.
|
||||||
*/
|
*/
|
||||||
PInstrumentDefXMLParser::PInstrumentDefXMLParser(PAdmin *admin) : fAdmin(admin)
|
PInstrumentDefXMLParser::PInstrumentDefXMLParser(const QString& fln, PAdmin *admin) : fAdmin(admin)
|
||||||
{
|
{
|
||||||
|
fValid = false;
|
||||||
fKeyWord = eEmpty;
|
fKeyWord = eEmpty;
|
||||||
|
|
||||||
fInstituteName = "";
|
fInstituteName = "";
|
||||||
fInstrument = 0;
|
fInstrument = 0;
|
||||||
fSetup = 0;
|
fSetup = 0;
|
||||||
|
|
||||||
|
QFile file(fln);
|
||||||
|
if (!file.open(QFile::ReadOnly | QFile::Text)) {
|
||||||
|
// warning and create default - STILL MISSING
|
||||||
|
}
|
||||||
|
|
||||||
|
fValid = parse(&file);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>parse the instrument definition xml-file(s).
|
||||||
|
*
|
||||||
|
* \param device QFile object of the instrument definition xml-file(s).
|
||||||
|
*
|
||||||
|
* @return true on success, false otherwise
|
||||||
|
*/
|
||||||
|
bool PInstrumentDefXMLParser::parse(QIODevice *device)
|
||||||
|
{
|
||||||
|
fXml.setDevice(device);
|
||||||
|
|
||||||
|
bool expectChars = false;
|
||||||
|
while (!fXml.atEnd()) {
|
||||||
|
fXml.readNext();
|
||||||
|
if (fXml.isStartDocument()) {
|
||||||
|
startDocument();
|
||||||
|
} else if (fXml.isStartElement()) {
|
||||||
|
startElement();
|
||||||
|
expectChars = true;
|
||||||
|
} else if (fXml.isCharacters() && expectChars) {
|
||||||
|
characters();
|
||||||
|
} else if (fXml.isEndElement()) {
|
||||||
|
endElement();
|
||||||
|
expectChars = false;
|
||||||
|
} else if (fXml.isEndDocument()) {
|
||||||
|
endDocument();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (fXml.hasError()) {
|
||||||
|
QString msg;
|
||||||
|
msg = QString("%1 Line %2, column %3").arg(fXml.errorString()).arg(fXml.lineNumber()).arg(fXml.columnNumber());
|
||||||
|
QMessageBox::critical(0, "**ERROR**", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -330,6 +390,7 @@ PInstrumentDefXMLParser::PInstrumentDefXMLParser(PAdmin *admin) : fAdmin(admin)
|
|||||||
*/
|
*/
|
||||||
bool PInstrumentDefXMLParser::startDocument()
|
bool PInstrumentDefXMLParser::startDocument()
|
||||||
{
|
{
|
||||||
|
// nothing to be done here for now
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -337,13 +398,11 @@ bool PInstrumentDefXMLParser::startDocument()
|
|||||||
/**
|
/**
|
||||||
* <p>Routine called when a new XML tag is found. Here it is used
|
* <p>Routine called when a new XML tag is found. Here it is used
|
||||||
* to set a tag for filtering afterwards the content.
|
* to set a tag for filtering afterwards the content.
|
||||||
*
|
|
||||||
* \param qName name of the XML tag.
|
|
||||||
*/
|
*/
|
||||||
bool PInstrumentDefXMLParser::startElement( const QString&, const QString&,
|
bool PInstrumentDefXMLParser::startElement()
|
||||||
const QString& qName,
|
|
||||||
const QXmlAttributes& qAttr)
|
|
||||||
{
|
{
|
||||||
|
QStringRef qName = fXml.name();
|
||||||
|
|
||||||
bool ok;
|
bool ok;
|
||||||
double dval;
|
double dval;
|
||||||
double ival;
|
double ival;
|
||||||
@ -356,6 +415,7 @@ bool PInstrumentDefXMLParser::startElement( const QString&, const QString&,
|
|||||||
fKeyWord = eInstitute;
|
fKeyWord = eInstitute;
|
||||||
} else if (qName == "instrument") {
|
} else if (qName == "instrument") {
|
||||||
fKeyWord = eInstrument;
|
fKeyWord = eInstrument;
|
||||||
|
QXmlStreamAttributes qAttr = fXml.attributes();
|
||||||
if (qAttr.count() != 1) {
|
if (qAttr.count() != 1) {
|
||||||
errMsg = QString("instrument should have 1 attribute, called 'name', found %1").arg(qAttr.count());
|
errMsg = QString("instrument should have 1 attribute, called 'name', found %1").arg(qAttr.count());
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
QMessageBox::critical(0, "ERROR", errMsg);
|
||||||
@ -369,7 +429,7 @@ bool PInstrumentDefXMLParser::startElement( const QString&, const QString&,
|
|||||||
// create an instrument object
|
// create an instrument object
|
||||||
fInstrument = new PInstrument();
|
fInstrument = new PInstrument();
|
||||||
fInstrument->setInstitue(fInstituteName);
|
fInstrument->setInstitue(fInstituteName);
|
||||||
fInstrument->setName(qAttr.value(0));
|
fInstrument->setName(qAttr.value("name").toString());
|
||||||
} else if (qName == "run_name_template") {
|
} else if (qName == "run_name_template") {
|
||||||
fKeyWord = eRunNameTemplate;
|
fKeyWord = eRunNameTemplate;
|
||||||
} else if (qName == "beamline") {
|
} else if (qName == "beamline") {
|
||||||
@ -378,23 +438,26 @@ bool PInstrumentDefXMLParser::startElement( const QString&, const QString&,
|
|||||||
fKeyWord = eDataFileFormat;
|
fKeyWord = eDataFileFormat;
|
||||||
} else if (qName == "tf") {
|
} else if (qName == "tf") {
|
||||||
fKeyWord = eTf;
|
fKeyWord = eTf;
|
||||||
|
QXmlStreamAttributes qAttr = fXml.attributes();
|
||||||
fSetup = new PSetup();
|
fSetup = new PSetup();
|
||||||
if (qAttr.count() == 1)
|
if (qAttr.count() == 1)
|
||||||
fSetup->setName(qAttr.value(0));
|
fSetup->setName(qAttr.value("name").toString());
|
||||||
else
|
else
|
||||||
fSetup->setName("Default");
|
fSetup->setName("Default");
|
||||||
} else if (qName == "zf") {
|
} else if (qName == "zf") {
|
||||||
fKeyWord = eZf;
|
fKeyWord = eZf;
|
||||||
|
QXmlStreamAttributes qAttr = fXml.attributes();
|
||||||
fSetup = new PSetup();
|
fSetup = new PSetup();
|
||||||
if (qAttr.count() == 1)
|
if (qAttr.count() == 1)
|
||||||
fSetup->setName(qAttr.value(0));
|
fSetup->setName(qAttr.value("name").toString());
|
||||||
else
|
else
|
||||||
fSetup->setName("Default");
|
fSetup->setName("Default");
|
||||||
} else if (qName == "lf") {
|
} else if (qName == "lf") {
|
||||||
fKeyWord = eLf;
|
fKeyWord = eLf;
|
||||||
|
QXmlStreamAttributes qAttr = fXml.attributes();
|
||||||
fSetup = new PSetup();
|
fSetup = new PSetup();
|
||||||
if (qAttr.count() == 1)
|
if (qAttr.count() == 1)
|
||||||
fSetup->setName(qAttr.value(0));
|
fSetup->setName(qAttr.value("name").toString());
|
||||||
else
|
else
|
||||||
fSetup->setName("Default");
|
fSetup->setName("Default");
|
||||||
} else if (qName == "no_of_detectors") {
|
} else if (qName == "no_of_detectors") {
|
||||||
@ -406,94 +469,78 @@ bool PInstrumentDefXMLParser::startElement( const QString&, const QString&,
|
|||||||
} else if (qName == "asym_bkg_range") {
|
} else if (qName == "asym_bkg_range") {
|
||||||
fKeyWord = eBkgRange;
|
fKeyWord = eBkgRange;
|
||||||
} else if (qName == "logic_detector") {
|
} else if (qName == "logic_detector") {
|
||||||
|
QXmlStreamAttributes qAttr = fXml.attributes();
|
||||||
if (qAttr.count() < 3)
|
if (qAttr.count() < 3)
|
||||||
return false;
|
return false;
|
||||||
PDetector detect;
|
PDetector detect;
|
||||||
int count=0;
|
// detector name
|
||||||
for (int i=0; i<qAttr.count(); i++) {
|
str = qAttr.value("name").toString();
|
||||||
if (qAttr.localName(i) == "name") {
|
detect.setName(str);
|
||||||
detect.setName(qAttr.value(i)); // detector name
|
// detector relative phase
|
||||||
count++;
|
str = qAttr.value("rel_phase").toString();
|
||||||
} else if (qAttr.localName(i) == "rel_phase") {
|
dval = str.toDouble(&ok);
|
||||||
str = qAttr.value(i);
|
if (!ok) {
|
||||||
dval = str.toDouble(&ok);
|
|
||||||
if (ok) {
|
|
||||||
detect.setRelGeomPhase(dval);
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
} else if (qAttr.localName(i) == "forward") {
|
|
||||||
str = qAttr.value(i);
|
|
||||||
strL.clear();
|
|
||||||
strL = str.split(' ');
|
|
||||||
forward.clear();
|
|
||||||
for (int j=0; j<strL.size(); j++) {
|
|
||||||
ival = strL[j].toInt(&ok);
|
|
||||||
if (!ok)
|
|
||||||
return false;
|
|
||||||
forward.push_back(ival);
|
|
||||||
}
|
|
||||||
detect.setForwards(forward);
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (count != 3) // i.e. didn't find all needed attributes
|
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
detect.setRelGeomPhase(dval);
|
||||||
|
// detector number(s)
|
||||||
|
str = qAttr.value("forward").toString();
|
||||||
|
strL.clear();
|
||||||
|
strL = str.split(' ');
|
||||||
|
forward.clear();
|
||||||
|
for (int j=0; j<strL.size(); j++) {
|
||||||
|
ival = strL[j].toInt(&ok);
|
||||||
|
if (!ok)
|
||||||
|
return false;
|
||||||
|
forward.push_back(ival);
|
||||||
|
}
|
||||||
|
detect.setForwards(forward);
|
||||||
fSetup->addDetector(detect);
|
fSetup->addDetector(detect);
|
||||||
} else if (qName == "logic_asym_detector") {
|
} else if (qName == "logic_asym_detector") {
|
||||||
|
QXmlStreamAttributes qAttr = fXml.attributes();
|
||||||
if (qAttr.count() != 5)
|
if (qAttr.count() != 5)
|
||||||
return false;
|
return false;
|
||||||
PDetector detect;
|
PDetector detect;
|
||||||
int count=0;
|
// detector name
|
||||||
for (int i=0; i<5; i++) {
|
str = qAttr.value("name").toString();
|
||||||
if (qAttr.localName(i) == "name") {
|
detect.setName(str);
|
||||||
detect.setName(qAttr.value(i)); // detector name
|
// detector relative phase
|
||||||
count++;
|
str = qAttr.value("rel_phase").toString();
|
||||||
} else if (qAttr.localName(i) == "rel_phase") {
|
dval = str.toDouble(&ok);
|
||||||
str = qAttr.value(i);
|
if (!ok) {
|
||||||
dval = str.toDouble(&ok);
|
|
||||||
if (ok) {
|
|
||||||
detect.setRelGeomPhase(dval);
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
} else if (qAttr.localName(i) == "forward") {
|
|
||||||
str = qAttr.value(i);
|
|
||||||
strL.clear();
|
|
||||||
strL = str.split(' ');
|
|
||||||
forward.clear();
|
|
||||||
for (int j=0; j<strL.size(); j++) {
|
|
||||||
ival = strL[j].toInt(&ok);
|
|
||||||
if (!ok)
|
|
||||||
return false;
|
|
||||||
forward.push_back(ival);
|
|
||||||
}
|
|
||||||
detect.setForwards(forward);
|
|
||||||
count++;
|
|
||||||
} else if (qAttr.localName(i) == "backward") {
|
|
||||||
str = qAttr.value(i);
|
|
||||||
strL.clear();
|
|
||||||
strL = str.split(' ');
|
|
||||||
backward.clear();
|
|
||||||
for (int j=0; j<strL.size(); j++) {
|
|
||||||
ival = strL[j].toInt(&ok);
|
|
||||||
if (!ok)
|
|
||||||
return false;
|
|
||||||
backward.push_back(ival);
|
|
||||||
}
|
|
||||||
detect.setBackwards(backward);
|
|
||||||
count++;
|
|
||||||
} else if (qAttr.localName(i) == "alpha") {
|
|
||||||
str = qAttr.value(i);
|
|
||||||
dval = str.toDouble(&ok);
|
|
||||||
if (!ok)
|
|
||||||
return false;
|
|
||||||
detect.setAlpha(dval);
|
|
||||||
count++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (count != 5) // i.e. didn't find all needed attributes
|
|
||||||
return false;
|
return false;
|
||||||
|
}
|
||||||
|
detect.setRelGeomPhase(dval);
|
||||||
|
// detector forward
|
||||||
|
str = qAttr.value("forward").toString();
|
||||||
|
strL.clear();
|
||||||
|
strL = str.split(' ');
|
||||||
|
forward.clear();
|
||||||
|
for (int j=0; j<strL.size(); j++) {
|
||||||
|
ival = strL[j].toInt(&ok);
|
||||||
|
if (!ok)
|
||||||
|
return false;
|
||||||
|
forward.push_back(ival);
|
||||||
|
}
|
||||||
|
detect.setForwards(forward);
|
||||||
|
// detector backward
|
||||||
|
str = qAttr.value("backward").toString();
|
||||||
|
strL.clear();
|
||||||
|
strL = str.split(' ');
|
||||||
|
backward.clear();
|
||||||
|
for (int j=0; j<strL.size(); j++) {
|
||||||
|
ival = strL[j].toInt(&ok);
|
||||||
|
if (!ok)
|
||||||
|
return false;
|
||||||
|
backward.push_back(ival);
|
||||||
|
}
|
||||||
|
detect.setForwards(backward);
|
||||||
|
// detector alpha
|
||||||
|
str = qAttr.value("alpha").toString();
|
||||||
|
dval = str.toDouble(&ok);
|
||||||
|
if (!ok)
|
||||||
|
return false;
|
||||||
|
detect.setAlpha(dval);
|
||||||
fSetup->addAsymDetector(detect);
|
fSetup->addAsymDetector(detect);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -505,13 +552,13 @@ bool PInstrumentDefXMLParser::startElement( const QString&, const QString&,
|
|||||||
* <p>Routine called when the end XML tag is found. It is used to
|
* <p>Routine called when the end XML tag is found. It is used to
|
||||||
* put the filtering tag to 'empty'. It also resets the fFunc flag in case
|
* put the filtering tag to 'empty'. It also resets the fFunc flag in case
|
||||||
* the entry was a theory function.
|
* the entry was a theory function.
|
||||||
*
|
|
||||||
* \param qName name of the element.
|
|
||||||
*/
|
*/
|
||||||
bool PInstrumentDefXMLParser::endElement( const QString&, const QString&, const QString &qName )
|
bool PInstrumentDefXMLParser::endElement()
|
||||||
{
|
{
|
||||||
fKeyWord = eEmpty;
|
fKeyWord = eEmpty;
|
||||||
|
|
||||||
|
QStringRef qName = fXml.name();
|
||||||
|
|
||||||
if (qName == "instrument") {
|
if (qName == "instrument") {
|
||||||
// store instrument
|
// store instrument
|
||||||
fAdmin->addInstrument(fInstituteName, *fInstrument);
|
fAdmin->addInstrument(fInstituteName, *fInstrument);
|
||||||
@ -557,11 +604,13 @@ bool PInstrumentDefXMLParser::endElement( const QString&, const QString&, const
|
|||||||
/**
|
/**
|
||||||
* <p>This routine delivers the content of an XML tag. It fills the
|
* <p>This routine delivers the content of an XML tag. It fills the
|
||||||
* content into the load data structure.
|
* content into the load data structure.
|
||||||
*
|
|
||||||
* \param str keeps the content of the XML tag.
|
|
||||||
*/
|
*/
|
||||||
bool PInstrumentDefXMLParser::characters(const QString& str)
|
bool PInstrumentDefXMLParser::characters()
|
||||||
{
|
{
|
||||||
|
QString str = *fXml.text().string();
|
||||||
|
if (str.isEmpty())
|
||||||
|
return true;
|
||||||
|
|
||||||
bool ok;
|
bool ok;
|
||||||
int ival, start, end;
|
int ival, start, end;
|
||||||
QString errMsg;
|
QString errMsg;
|
||||||
@ -649,66 +698,6 @@ bool PInstrumentDefXMLParser::endDocument()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>Report XML warnings.
|
|
||||||
*
|
|
||||||
* \param exception holds the information of the XML warning
|
|
||||||
*/
|
|
||||||
bool PInstrumentDefXMLParser::warning( const QXmlParseException & exception )
|
|
||||||
{
|
|
||||||
QString msg;
|
|
||||||
|
|
||||||
msg = QString("**WARNING** while parsing instrument_def_XXX.xml in line no %1\n").arg(exception.lineNumber());
|
|
||||||
msg += QString("**WARNING MESSAGE** ") + exception.message();
|
|
||||||
|
|
||||||
qWarning() << endl << msg << endl;
|
|
||||||
|
|
||||||
QMessageBox::warning(0, "WARNING", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>Report recoverable XML errors.
|
|
||||||
*
|
|
||||||
* \param exception holds the information of the XML recoverable errors.
|
|
||||||
*/
|
|
||||||
bool PInstrumentDefXMLParser::error( const QXmlParseException & exception )
|
|
||||||
{
|
|
||||||
QString msg;
|
|
||||||
|
|
||||||
msg = QString("**ERROR** while parsing instrument_def_XXX.xml in line no %1\n").arg(exception.lineNumber());
|
|
||||||
msg += QString("**ERROR MESSAGE** ") + exception.message();
|
|
||||||
|
|
||||||
qWarning() << endl << msg << endl;
|
|
||||||
|
|
||||||
QMessageBox::critical(0, "ERROR", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>Report fatal XML errors.
|
|
||||||
*
|
|
||||||
* \param exception holds the information of the XML fatal errors.
|
|
||||||
*/
|
|
||||||
bool PInstrumentDefXMLParser::fatalError( const QXmlParseException & exception )
|
|
||||||
{
|
|
||||||
QString msg;
|
|
||||||
|
|
||||||
msg = QString("**FATAL ERROR** while parsing parsing instrument_def_XXX.xml in line no %1\n").arg(exception.lineNumber());
|
|
||||||
msg += QString("**FATAL ERROR MESSAGE** ") + exception.message();
|
|
||||||
|
|
||||||
qWarning() << endl << msg << endl;
|
|
||||||
|
|
||||||
QMessageBox::critical(0, "FATAL ERROR", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
// implementation of PMusrWizDefault class
|
// implementation of PMusrWizDefault class
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -730,9 +719,56 @@ PMusrWizDefault::PMusrWizDefault()
|
|||||||
*
|
*
|
||||||
* \param admin pointer to an admin class instance.
|
* \param admin pointer to an admin class instance.
|
||||||
*/
|
*/
|
||||||
PMusrWizDefaultXMLParser::PMusrWizDefaultXMLParser(PAdmin *admin) : fAdmin(admin)
|
PMusrWizDefaultXMLParser::PMusrWizDefaultXMLParser(const QString& fln, PAdmin *admin) : fAdmin(admin)
|
||||||
{
|
{
|
||||||
|
fValid = false;
|
||||||
fKeyWord = eEmpty;
|
fKeyWord = eEmpty;
|
||||||
|
|
||||||
|
QFile file(fln);
|
||||||
|
if (!file.open(QFile::ReadOnly | QFile::Text)) {
|
||||||
|
// warning and create default - STILL MISSING
|
||||||
|
}
|
||||||
|
|
||||||
|
fValid = parse(&file);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>parse the musrWiz startup xml-file.
|
||||||
|
*
|
||||||
|
* \param device QFile object of the musrWiz startup xml-file
|
||||||
|
*
|
||||||
|
* @return true on success, false otherwise
|
||||||
|
*/
|
||||||
|
bool PMusrWizDefaultXMLParser::parse(QIODevice *device)
|
||||||
|
{
|
||||||
|
fXml.setDevice(device);
|
||||||
|
|
||||||
|
bool expectChars = false;
|
||||||
|
while (!fXml.atEnd()) {
|
||||||
|
fXml.readNext();
|
||||||
|
if (fXml.isStartDocument()) {
|
||||||
|
startDocument();
|
||||||
|
} else if (fXml.isStartElement()) {
|
||||||
|
startElement();
|
||||||
|
expectChars = true;
|
||||||
|
} else if (fXml.isCharacters() && expectChars) {
|
||||||
|
characters();
|
||||||
|
} else if (fXml.isEndElement()) {
|
||||||
|
endElement();
|
||||||
|
expectChars = false;
|
||||||
|
} else if (fXml.isEndDocument()) {
|
||||||
|
endDocument();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (fXml.hasError()) {
|
||||||
|
QString msg;
|
||||||
|
msg = QString("%1 Line %2, column %3").arg(fXml.errorString()).arg(fXml.lineNumber()).arg(fXml.columnNumber());
|
||||||
|
QMessageBox::critical(0, "**ERROR**", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -741,6 +777,7 @@ PMusrWizDefaultXMLParser::PMusrWizDefaultXMLParser(PAdmin *admin) : fAdmin(admin
|
|||||||
*/
|
*/
|
||||||
bool PMusrWizDefaultXMLParser::startDocument()
|
bool PMusrWizDefaultXMLParser::startDocument()
|
||||||
{
|
{
|
||||||
|
// nothing to be done here for now
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -748,13 +785,11 @@ bool PMusrWizDefaultXMLParser::startDocument()
|
|||||||
/**
|
/**
|
||||||
* <p>Routine called when a new XML tag is found. Here it is used
|
* <p>Routine called when a new XML tag is found. Here it is used
|
||||||
* to set a tag for filtering afterwards the content.
|
* to set a tag for filtering afterwards the content.
|
||||||
*
|
|
||||||
* \param qName name of the XML tag.
|
|
||||||
*/
|
*/
|
||||||
bool PMusrWizDefaultXMLParser::startElement( const QString&, const QString&,
|
bool PMusrWizDefaultXMLParser::startElement()
|
||||||
const QString& qName,
|
|
||||||
const QXmlAttributes& )
|
|
||||||
{
|
{
|
||||||
|
QStringRef qName = fXml.name();
|
||||||
|
|
||||||
if (qName == "institute") {
|
if (qName == "institute") {
|
||||||
fKeyWord = eInstitute;
|
fKeyWord = eInstitute;
|
||||||
} else if (qName == "instrument") {
|
} else if (qName == "instrument") {
|
||||||
@ -771,10 +806,8 @@ bool PMusrWizDefaultXMLParser::startElement( const QString&, const QString&,
|
|||||||
* <p>Routine called when the end XML tag is found. It is used to
|
* <p>Routine called when the end XML tag is found. It is used to
|
||||||
* put the filtering tag to 'empty'. It also resets the fFunc flag in case
|
* put the filtering tag to 'empty'. It also resets the fFunc flag in case
|
||||||
* the entry was a theory function.
|
* the entry was a theory function.
|
||||||
*
|
|
||||||
* \param qName name of the element.
|
|
||||||
*/
|
*/
|
||||||
bool PMusrWizDefaultXMLParser::endElement( const QString&, const QString&, const QString& )
|
bool PMusrWizDefaultXMLParser::endElement()
|
||||||
{
|
{
|
||||||
fKeyWord = eEmpty;
|
fKeyWord = eEmpty;
|
||||||
|
|
||||||
@ -785,11 +818,13 @@ bool PMusrWizDefaultXMLParser::endElement( const QString&, const QString&, const
|
|||||||
/**
|
/**
|
||||||
* <p>This routine delivers the content of an XML tag. It fills the
|
* <p>This routine delivers the content of an XML tag. It fills the
|
||||||
* content into the load data structure.
|
* content into the load data structure.
|
||||||
*
|
|
||||||
* \param str keeps the content of the XML tag.
|
|
||||||
*/
|
*/
|
||||||
bool PMusrWizDefaultXMLParser::characters(const QString& str)
|
bool PMusrWizDefaultXMLParser::characters()
|
||||||
{
|
{
|
||||||
|
QString str = *fXml.text().string();
|
||||||
|
if (str.isEmpty())
|
||||||
|
return true;
|
||||||
|
|
||||||
switch (fKeyWord) {
|
switch (fKeyWord) {
|
||||||
case eInstitute:
|
case eInstitute:
|
||||||
fDefault.setInstitute(str);
|
fDefault.setInstitute(str);
|
||||||
@ -818,66 +853,6 @@ bool PMusrWizDefaultXMLParser::endDocument()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>Report XML warnings.
|
|
||||||
*
|
|
||||||
* \param exception holds the information of the XML warning
|
|
||||||
*/
|
|
||||||
bool PMusrWizDefaultXMLParser::warning( const QXmlParseException & exception )
|
|
||||||
{
|
|
||||||
QString msg;
|
|
||||||
|
|
||||||
msg = QString("**WARNING** while parsing musrWiz.xml in line no %1\n").arg(exception.lineNumber());
|
|
||||||
msg += QString("**WARNING MESSAGE** ") + exception.message();
|
|
||||||
|
|
||||||
qWarning() << endl << msg << endl;
|
|
||||||
|
|
||||||
QMessageBox::warning(0, "WARNING", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>Report recoverable XML errors.
|
|
||||||
*
|
|
||||||
* \param exception holds the information of the XML recoverable errors.
|
|
||||||
*/
|
|
||||||
bool PMusrWizDefaultXMLParser::error( const QXmlParseException & exception )
|
|
||||||
{
|
|
||||||
QString msg;
|
|
||||||
|
|
||||||
msg = QString("**ERROR** while parsing musrWiz.xml in line no %1\n").arg(exception.lineNumber());
|
|
||||||
msg += QString("**ERROR MESSAGE** ") + exception.message();
|
|
||||||
|
|
||||||
qWarning() << endl << msg << endl;
|
|
||||||
|
|
||||||
QMessageBox::critical(0, "ERROR", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>Report fatal XML errors.
|
|
||||||
*
|
|
||||||
* \param exception holds the information of the XML fatal errors.
|
|
||||||
*/
|
|
||||||
bool PMusrWizDefaultXMLParser::fatalError( const QXmlParseException & exception )
|
|
||||||
{
|
|
||||||
QString msg;
|
|
||||||
|
|
||||||
msg = QString("**FATAL ERROR** while parsing parsing musrWiz.xml in line no %1\n").arg(exception.lineNumber());
|
|
||||||
msg += QString("**FATAL ERROR MESSAGE** ") + exception.message();
|
|
||||||
|
|
||||||
qWarning() << endl << msg << endl;
|
|
||||||
|
|
||||||
QMessageBox::critical(0, "FATAL ERROR", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
// implementation of PAdmin class
|
// implementation of PAdmin class
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -1245,12 +1220,8 @@ int PAdmin::loadMusrWizDefault(QString fln)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PMusrWizDefaultXMLParser handler(this);
|
PMusrWizDefaultXMLParser handler(fln, this);
|
||||||
QFile xmlFile(fln);
|
if (!handler.isValid()) {
|
||||||
QXmlInputSource source( &xmlFile );
|
|
||||||
QXmlSimpleReader reader;
|
|
||||||
reader.setContentHandler( &handler );
|
|
||||||
if (!reader.parse(source)) {
|
|
||||||
QString errMsg = QString("Error parsing %1 file.").arg(fln);
|
QString errMsg = QString("Error parsing %1 file.").arg(fln);
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
QMessageBox::critical(0, "ERROR", errMsg);
|
||||||
return 1;
|
return 1;
|
||||||
@ -1282,12 +1253,8 @@ int PAdmin::loadMusrfitFunc(QString fln)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PFuncXMLParser handler(this);
|
PFuncXMLParser handler(fln, this);
|
||||||
QFile xmlFile(fln);
|
if (!handler.isValid()) {
|
||||||
QXmlInputSource source( &xmlFile );
|
|
||||||
QXmlSimpleReader reader;
|
|
||||||
reader.setContentHandler( &handler );
|
|
||||||
if (!reader.parse(source)) {
|
|
||||||
QString errMsg = QString("Error parsing %1 musrfit func file.").arg(fln);
|
QString errMsg = QString("Error parsing %1 musrfit func file.").arg(fln);
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
QMessageBox::critical(0, "ERROR", errMsg);
|
||||||
return 1;
|
return 1;
|
||||||
@ -1326,12 +1293,8 @@ int PAdmin::loadInstrumentDef(QString path, QString fln)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PInstrumentDefXMLParser handler(this);
|
PInstrumentDefXMLParser handler(pathFln, this);
|
||||||
QFile xmlFile(pathFln);
|
if (!handler.isValid()) {
|
||||||
QXmlInputSource source( &xmlFile );
|
|
||||||
QXmlSimpleReader reader;
|
|
||||||
reader.setContentHandler( &handler );
|
|
||||||
if (!reader.parse(source)) {
|
|
||||||
QString errMsg = QString("Error parsing %1 instrument def file.").arg(pathFln);
|
QString errMsg = QString("Error parsing %1 instrument def file.").arg(pathFln);
|
||||||
QMessageBox::critical(0, "ERROR", errMsg);
|
QMessageBox::critical(0, "ERROR", errMsg);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -32,7 +32,10 @@
|
|||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QtXml>
|
#include <QXmlStreamReader>
|
||||||
|
#include <QIODevice>
|
||||||
|
#include <QProcessEnvironment>
|
||||||
|
#include <QDir>
|
||||||
|
|
||||||
#include "PTheoTemplate.h"
|
#include "PTheoTemplate.h"
|
||||||
#include "PMusrfitFunc.h"
|
#include "PMusrfitFunc.h"
|
||||||
@ -41,32 +44,32 @@
|
|||||||
class PAdmin;
|
class PAdmin;
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
class PFuncXMLParser : public QXmlDefaultHandler
|
class PFuncXMLParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PFuncXMLParser(PAdmin*);
|
PFuncXMLParser(const QString &fln, PAdmin*);
|
||||||
virtual ~PFuncXMLParser() {}
|
virtual ~PFuncXMLParser() {}
|
||||||
|
|
||||||
|
virtual bool isValid() { return fValid; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum EFuncKeyWords {eEmpty,
|
enum EFuncKeyWords {eEmpty,
|
||||||
eTemplateName, eTemplateTheo, eTemplateFunc,
|
eTemplateName, eTemplateTheo, eTemplateFunc,
|
||||||
eName, eAbbrv, eNoOfParam, eParam,
|
eName, eAbbrv, eNoOfParam, eParam,
|
||||||
eParamName, eParamValue, eParamMap};
|
eParamName, eParamValue, eParamMap};
|
||||||
|
|
||||||
|
bool parse(QIODevice *device);
|
||||||
bool startDocument();
|
bool startDocument();
|
||||||
bool startElement(const QString&, const QString&, const QString& ,
|
bool startElement();
|
||||||
const QXmlAttributes& qAttr);
|
bool endElement();
|
||||||
bool endElement( const QString&, const QString&, const QString& );
|
bool characters();
|
||||||
|
|
||||||
bool characters(const QString&);
|
|
||||||
bool endDocument();
|
bool endDocument();
|
||||||
|
|
||||||
bool warning( const QXmlParseException & exception );
|
|
||||||
bool error( const QXmlParseException & exception );
|
|
||||||
bool fatalError( const QXmlParseException & exception );
|
|
||||||
|
|
||||||
EFuncKeyWords fKeyWord; ///< key word tag to know how to handle the content
|
QXmlStreamReader fXml; ///< xml stream reader object
|
||||||
PAdmin *fAdmin; ///< a pointer to the main administration class object
|
bool fValid; ///< flag showing if XML read has been successful
|
||||||
|
EFuncKeyWords fKeyWord; ///< key word tag to know how to handle the content
|
||||||
|
PAdmin *fAdmin; ///< a pointer to the main administration class object
|
||||||
|
|
||||||
PTheoTemplate fTheoTemplate;
|
PTheoTemplate fTheoTemplate;
|
||||||
PMusrfitFunc fFunc;
|
PMusrfitFunc fFunc;
|
||||||
@ -74,32 +77,31 @@ class PFuncXMLParser : public QXmlDefaultHandler
|
|||||||
};
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
class PInstrumentDefXMLParser : public QXmlDefaultHandler
|
class PInstrumentDefXMLParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PInstrumentDefXMLParser(PAdmin*);
|
PInstrumentDefXMLParser(const QString &fln, PAdmin*);
|
||||||
virtual ~PInstrumentDefXMLParser() {}
|
virtual ~PInstrumentDefXMLParser() {}
|
||||||
|
|
||||||
|
virtual bool isValid() { return fValid; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum EKeyWords {eEmpty, eInstitute, eInstrument, eRunNameTemplate,
|
enum EKeyWords {eEmpty, eInstitute, eInstrument, eRunNameTemplate,
|
||||||
eBeamline, eDataFileFormat, eTf, eZf, eLf,
|
eBeamline, eDataFileFormat, eTf, eZf, eLf,
|
||||||
eNoOfDetectors, eFgbOffset, eLgb, eBkgRange,
|
eNoOfDetectors, eFgbOffset, eLgb, eBkgRange,
|
||||||
eLogicDetector};
|
eLogicDetector};
|
||||||
|
|
||||||
|
bool parse(QIODevice *device);
|
||||||
bool startDocument();
|
bool startDocument();
|
||||||
bool startElement(const QString&, const QString&, const QString& ,
|
bool startElement();
|
||||||
const QXmlAttributes& qAttr);
|
bool endElement();
|
||||||
bool endElement( const QString&, const QString&, const QString& );
|
bool characters();
|
||||||
|
|
||||||
bool characters(const QString&);
|
|
||||||
bool endDocument();
|
bool endDocument();
|
||||||
|
|
||||||
bool warning( const QXmlParseException & exception );
|
QXmlStreamReader fXml; ///< xml stream reader object
|
||||||
bool error( const QXmlParseException & exception );
|
bool fValid; ///< flag showing if XML read has been successful
|
||||||
bool fatalError( const QXmlParseException & exception );
|
EKeyWords fKeyWord; ///< key word tag to know how to handle the content
|
||||||
|
PAdmin *fAdmin; ///< a pointer to the main administration class object
|
||||||
EKeyWords fKeyWord; ///< key word tag to know how to handle the content
|
|
||||||
PAdmin *fAdmin; ///< a pointer to the main administration class object
|
|
||||||
|
|
||||||
QString fInstituteName;
|
QString fInstituteName;
|
||||||
PInstrument *fInstrument;
|
PInstrument *fInstrument;
|
||||||
@ -128,27 +130,26 @@ class PMusrWizDefault
|
|||||||
};
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
class PMusrWizDefaultXMLParser : public QXmlDefaultHandler
|
class PMusrWizDefaultXMLParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PMusrWizDefaultXMLParser(PAdmin*);
|
PMusrWizDefaultXMLParser(const QString &fln, PAdmin*);
|
||||||
virtual ~PMusrWizDefaultXMLParser() {}
|
virtual ~PMusrWizDefaultXMLParser() {}
|
||||||
|
|
||||||
|
virtual bool isValid() { return fValid; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum EKeyWords {eEmpty, eInstitute, eInstrument, eFitType};
|
enum EKeyWords {eEmpty, eInstitute, eInstrument, eFitType};
|
||||||
|
|
||||||
|
bool parse(QIODevice *device);
|
||||||
bool startDocument();
|
bool startDocument();
|
||||||
bool startElement(const QString&, const QString&, const QString& ,
|
bool startElement();
|
||||||
const QXmlAttributes& );
|
bool endElement();
|
||||||
bool endElement( const QString&, const QString&, const QString& );
|
bool characters();
|
||||||
|
|
||||||
bool characters(const QString&);
|
|
||||||
bool endDocument();
|
bool endDocument();
|
||||||
|
|
||||||
bool warning( const QXmlParseException & exception );
|
QXmlStreamReader fXml; ///< xml stream reader object
|
||||||
bool error( const QXmlParseException & exception );
|
bool fValid; ///< flag showing if XML read has been successful
|
||||||
bool fatalError( const QXmlParseException & exception );
|
|
||||||
|
|
||||||
EKeyWords fKeyWord; ///< key word tag to know how to handle the content
|
EKeyWords fKeyWord; ///< key word tag to know how to handle the content
|
||||||
PAdmin *fAdmin; ///< a pointer to the main administration class object
|
PAdmin *fAdmin; ///< a pointer to the main administration class object
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@
|
|||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QProcessEnvironment>
|
#include <QProcessEnvironment>
|
||||||
#include <QSysInfo>
|
#include <QSysInfo>
|
||||||
|
#include <QIODevice>
|
||||||
|
|
||||||
#include "musrfit-info.h"
|
#include "musrfit-info.h"
|
||||||
#include "PAdmin.h"
|
#include "PAdmin.h"
|
||||||
@ -48,12 +49,60 @@
|
|||||||
/**
|
/**
|
||||||
* <p>XML Parser class for the musredit administration file.
|
* <p>XML Parser class for the musredit administration file.
|
||||||
*
|
*
|
||||||
|
* \param fln file name of the musredit startup xml-file
|
||||||
* \param admin pointer to an admin class instance.
|
* \param admin pointer to an admin class instance.
|
||||||
*/
|
*/
|
||||||
PAdminXMLParser::PAdminXMLParser(PAdmin *admin) : fAdmin(admin)
|
PAdminXMLParser::PAdminXMLParser(const QString& fln, PAdmin *admin) : fAdmin(admin)
|
||||||
{
|
{
|
||||||
|
fValid = false;
|
||||||
fKeyWord = eEmpty;
|
fKeyWord = eEmpty;
|
||||||
fFunc = false;
|
fFunc = false;
|
||||||
|
|
||||||
|
QFile file(fln);
|
||||||
|
if (!file.open(QFile::ReadOnly | QFile::Text)) {
|
||||||
|
// warning and create default - STILL MISSING
|
||||||
|
}
|
||||||
|
|
||||||
|
fValid = parse(&file);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>parse the musredit startup xml-file.
|
||||||
|
*
|
||||||
|
* \param device QFile object of the musredit startup xml-file
|
||||||
|
*
|
||||||
|
* @return true on success, false otherwise
|
||||||
|
*/
|
||||||
|
bool PAdminXMLParser::parse(QIODevice *device)
|
||||||
|
{
|
||||||
|
fXml.setDevice(device);
|
||||||
|
|
||||||
|
bool expectChars = false;
|
||||||
|
while (!fXml.atEnd()) {
|
||||||
|
fXml.readNext();
|
||||||
|
if (fXml.isStartDocument()) {
|
||||||
|
startDocument();
|
||||||
|
} else if (fXml.isStartElement()) {
|
||||||
|
startElement();
|
||||||
|
expectChars = true;
|
||||||
|
} else if (fXml.isCharacters() && expectChars) {
|
||||||
|
characters();
|
||||||
|
} else if (fXml.isEndElement()) {
|
||||||
|
endElement();
|
||||||
|
expectChars = false;
|
||||||
|
} else if (fXml.isEndDocument()) {
|
||||||
|
endDocument();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (fXml.hasError()) {
|
||||||
|
QString msg;
|
||||||
|
msg = QString("%1 Line %2, column %3").arg(fXml.errorString()).arg(fXml.lineNumber()).arg(fXml.columnNumber());
|
||||||
|
QMessageBox::critical(0, "**ERROR**", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -62,6 +111,7 @@ PAdminXMLParser::PAdminXMLParser(PAdmin *admin) : fAdmin(admin)
|
|||||||
*/
|
*/
|
||||||
bool PAdminXMLParser::startDocument()
|
bool PAdminXMLParser::startDocument()
|
||||||
{
|
{
|
||||||
|
// nothing to be done here for now
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -69,13 +119,11 @@ bool PAdminXMLParser::startDocument()
|
|||||||
/**
|
/**
|
||||||
* <p>Routine called when a new XML tag is found. Here it is used
|
* <p>Routine called when a new XML tag is found. Here it is used
|
||||||
* to set a tag for filtering afterwards the content.
|
* to set a tag for filtering afterwards the content.
|
||||||
*
|
|
||||||
* \param qName name of the XML tag.
|
|
||||||
*/
|
*/
|
||||||
bool PAdminXMLParser::startElement( const QString&, const QString&,
|
bool PAdminXMLParser::startElement()
|
||||||
const QString& qName,
|
|
||||||
const QXmlAttributes& )
|
|
||||||
{
|
{
|
||||||
|
QStringRef qName = fXml.name();
|
||||||
|
|
||||||
if (qName == "timeout") {
|
if (qName == "timeout") {
|
||||||
fKeyWord = eTimeout;
|
fKeyWord = eTimeout;
|
||||||
} else if (qName == "font_name") {
|
} else if (qName == "font_name") {
|
||||||
@ -196,13 +244,13 @@ bool PAdminXMLParser::startElement( const QString&, const QString&,
|
|||||||
* <p>Routine called when the end XML tag is found. It is used to
|
* <p>Routine called when the end XML tag is found. It is used to
|
||||||
* put the filtering tag to 'empty'. It also resets the fFunc flag in case
|
* put the filtering tag to 'empty'. It also resets the fFunc flag in case
|
||||||
* the entry was a theory function.
|
* the entry was a theory function.
|
||||||
*
|
|
||||||
* \param qName name of the element.
|
|
||||||
*/
|
*/
|
||||||
bool PAdminXMLParser::endElement( const QString&, const QString&, const QString &qName )
|
bool PAdminXMLParser::endElement()
|
||||||
{
|
{
|
||||||
fKeyWord = eEmpty;
|
fKeyWord = eEmpty;
|
||||||
|
|
||||||
|
QStringRef qName = fXml.name();
|
||||||
|
|
||||||
if (qName == "func") {
|
if (qName == "func") {
|
||||||
fFunc = false;
|
fFunc = false;
|
||||||
fAdmin->addTheoryItem(fTheoryItem);
|
fAdmin->addTheoryItem(fTheoryItem);
|
||||||
@ -215,11 +263,13 @@ bool PAdminXMLParser::endElement( const QString&, const QString&, const QString
|
|||||||
/**
|
/**
|
||||||
* <p>This routine delivers the content of an XML tag. It fills the
|
* <p>This routine delivers the content of an XML tag. It fills the
|
||||||
* content into the load data structure.
|
* content into the load data structure.
|
||||||
*
|
|
||||||
* \param str keeps the content of the XML tag.
|
|
||||||
*/
|
*/
|
||||||
bool PAdminXMLParser::characters(const QString& str)
|
bool PAdminXMLParser::characters()
|
||||||
{
|
{
|
||||||
|
QString str = *fXml.text().string();
|
||||||
|
if (str.isEmpty())
|
||||||
|
return true;
|
||||||
|
|
||||||
QString help;
|
QString help;
|
||||||
bool flag, ok;
|
bool flag, ok;
|
||||||
int ival;
|
int ival;
|
||||||
@ -512,67 +562,90 @@ bool PAdminXMLParser::endDocument()
|
|||||||
fAdmin->setTheoFuncPixmapPath(str);
|
fAdmin->setTheoFuncPixmapPath(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
//as35 dump admin - only for debugging
|
||||||
}
|
//as35 dump();
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>Report XML warnings.
|
|
||||||
*
|
|
||||||
* \param exception holds the information of the XML warning
|
|
||||||
*/
|
|
||||||
bool PAdminXMLParser::warning( const QXmlParseException & exception )
|
|
||||||
{
|
|
||||||
QString msg;
|
|
||||||
|
|
||||||
msg = QString("**WARNING** while parsing musredit_startup.xml in line no %1\n").arg(exception.lineNumber());
|
|
||||||
msg += QString("**WARNING MESSAGE** ") + exception.message();
|
|
||||||
|
|
||||||
qWarning() << endl << msg << endl;
|
|
||||||
|
|
||||||
QMessageBox::warning(0, "WARNING", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* <p>Report recoverable XML errors.
|
* <p>Dumps the content of the admin class. For debugging purposes only.
|
||||||
*
|
|
||||||
* \param exception holds the information of the XML recoverable errors.
|
|
||||||
*/
|
*/
|
||||||
bool PAdminXMLParser::error( const QXmlParseException & exception )
|
void PAdminXMLParser::dump()
|
||||||
{
|
{
|
||||||
QString msg;
|
std::cout << "debug> +++++++++++++++++++++++" << std::endl;
|
||||||
|
std::cout << "debug> general:" << std::endl;
|
||||||
msg = QString("**ERROR** while parsing musredit_startup.xml in line no %1\n").arg(exception.lineNumber());
|
std::cout << "debug> exec_path : " << fAdmin->getExecPath().toLatin1().data() << std::endl;
|
||||||
msg += QString("**ERROR MESSAGE** ") + exception.message();
|
std::cout << "debug> default_save_path : " << fAdmin->getDefaultSavePath().toLatin1().data() << std::endl;
|
||||||
|
std::cout << "debug> timeout : " << fAdmin->getTimeout() << std::endl;
|
||||||
qWarning() << endl << msg << endl;
|
std::cout << "debug> keep_minuit2_output : " << fAdmin->getKeepMinuit2OutputFlag() << std::endl;
|
||||||
|
std::cout << "debug> dump_ascii : " << fAdmin->getDumpAsciiFlag() << std::endl;
|
||||||
QMessageBox::critical(0, "ERROR", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
std::cout << "debug> dump_root : " << fAdmin->getDumpRootFlag() << std::endl;
|
||||||
|
std::cout << "debug> title_from_data_file : " << fAdmin->getTitleFromDataFileFlag() << std::endl;
|
||||||
return true;
|
std::cout << "debug> chisq_per_run_block : " << fAdmin->getChisqPerRunBlockFlag() << std::endl;
|
||||||
}
|
std::cout << "debug> estimate_n0 : " << fAdmin->getEstimateN0Flag() << std::endl;
|
||||||
|
std::cout << "debug> musrview_show_fourier : " << fAdmin->getMusrviewShowFourierFlag() << std::endl;
|
||||||
//--------------------------------------------------------------------------
|
std::cout << "debug> musrview_show_avg : " << fAdmin->getMusrviewShowAvgFlag() << std::endl;
|
||||||
/**
|
std::cout << "debug> enable_musrt0 : " << fAdmin->getEnableMusrT0Flag() << std::endl;
|
||||||
* <p>Report fatal XML errors.
|
std::cout << "debug> dark_theme_icons_menu : " << fAdmin->getDarkThemeIconsMenuFlag() << std::endl;
|
||||||
*
|
std::cout << "debug> dark_theme_icons_toolbar : " << fAdmin->getDarkThemeIconsToolbarFlag() << std::endl;
|
||||||
* \param exception holds the information of the XML fatal errors.
|
std::cout << "debug> +++++++++++++++++++++++" << std::endl;
|
||||||
*/
|
std::cout << "debug> recent_files:" << std::endl;
|
||||||
bool PAdminXMLParser::fatalError( const QXmlParseException & exception )
|
for (int i=0; i<fAdmin->getNumRecentFiles(); i++) {
|
||||||
{
|
std::cout << "debug> recent_file " << i << ":" << fAdmin->getRecentFile(i).toLatin1().data() << std::endl;
|
||||||
QString msg;
|
}
|
||||||
|
std::cout << "debug> +++++++++++++++++++++++" << std::endl;
|
||||||
msg = QString("**FATAL ERROR** while parsing musredit_startup.xml in line no %1\n").arg(exception.lineNumber());
|
std::cout << "debug> help_section:" << std::endl;
|
||||||
msg += QString("**FATAL ERROR MESSAGE** ") + exception.message();
|
std::cout << "debug> musr_web_main : " << fAdmin->getHelpUrl("main").toLatin1().data() << std::endl;
|
||||||
|
std::cout << "debug> musr_web_title : " << fAdmin->getHelpUrl("title").toLatin1().data() << std::endl;
|
||||||
qWarning() << endl << msg << endl;
|
std::cout << "debug> musr_web_parameters : " << fAdmin->getHelpUrl("parameters").toLatin1().data() << std::endl;
|
||||||
|
std::cout << "debug> musr_web_theory : " << fAdmin->getHelpUrl("theory").toLatin1().data() << std::endl;
|
||||||
QMessageBox::critical(0, "FATAL ERROR", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
std::cout << "debug> musr_web_functions : " << fAdmin->getHelpUrl("functions").toLatin1().data() << std::endl;
|
||||||
|
std::cout << "debug> musr_web_run : " << fAdmin->getHelpUrl("run").toLatin1().data() << std::endl;
|
||||||
return true;
|
std::cout << "debug> musr_web_command : " << fAdmin->getHelpUrl("command").toLatin1().data() << std::endl;
|
||||||
|
std::cout << "debug> musr_web_fourier : " << fAdmin->getHelpUrl("fourier").toLatin1().data() << std::endl;
|
||||||
|
std::cout << "debug> musr_web_plot : " << fAdmin->getHelpUrl("plot").toLatin1().data() << std::endl;
|
||||||
|
std::cout << "debug> musr_web_statistic : " << fAdmin->getHelpUrl("statistic").toLatin1().data() << std::endl;
|
||||||
|
std::cout << "debug> musr_web_msr2data : " << fAdmin->getHelpUrl("msr2data").toLatin1().data() << std::endl;
|
||||||
|
std::cout << "debug> musr_web_musrFT : " << fAdmin->getHelpUrl("musrFT").toLatin1().data() << std::endl;
|
||||||
|
std::cout << "debug> +++++++++++++++++++++++" << std::endl;
|
||||||
|
std::cout << "debug> font_section:" << std::endl;
|
||||||
|
std::cout << "debug> font_name : " << fAdmin->getFontName().toLatin1().data() << std::endl;
|
||||||
|
std::cout << "debug> font_size : " << fAdmin->getFontSize() << std::endl;
|
||||||
|
std::cout << "debug> +++++++++++++++++++++++" << std::endl;
|
||||||
|
std::cout << "debug> msr_file_defaults:" << std::endl;
|
||||||
|
std::cout << "debug> beamline : " << fAdmin->getBeamline().toLatin1().data() << std::endl;
|
||||||
|
std::cout << "debug> institute : " << fAdmin->getInstitute().toLatin1().data() << std::endl;
|
||||||
|
std::cout << "debug> file_format : " << fAdmin->getFileFormat().toLatin1().data() << std::endl;
|
||||||
|
std::cout << "debug> lifetime_correction : " << fAdmin->getLifetimeCorrectionFlag() << std::endl;
|
||||||
|
std::cout << "debug> +++++++++++++++++++++++" << std::endl;
|
||||||
|
std::cout << "debug> msr2data_defaults:" << std::endl;
|
||||||
|
std::cout << "debug> chain_fit : " << fAdmin->getMsr2DataParam().chainFit << std::endl;
|
||||||
|
std::cout << "debug> write_data_header : " << fAdmin->getMsr2DataParam().writeDbHeader << std::endl;
|
||||||
|
std::cout << "debug> ignore_data_header_info : " << fAdmin->getMsr2DataParam().ignoreDataHeaderInfo << std::endl;
|
||||||
|
std::cout << "debug> keep_minuit2_output : " << fAdmin->getMsr2DataParam().keepMinuit2Output << std::endl;
|
||||||
|
std::cout << "debug> write_column_data : " << fAdmin->getMsr2DataParam().writeColumnData << std::endl;
|
||||||
|
std::cout << "debug> recreate_data_file : " << fAdmin->getMsr2DataParam().recreateDbFile << std::endl;
|
||||||
|
std::cout << "debug> open_file_after_fitting : " << fAdmin->getMsr2DataParam().openFilesAfterFitting << std::endl;
|
||||||
|
std::cout << "debug> create_msr_file_only : " << fAdmin->getMsr2DataParam().createMsrFileOnly << std::endl;
|
||||||
|
std::cout << "debug> fit_only : " << fAdmin->getMsr2DataParam().fitOnly << std::endl;
|
||||||
|
std::cout << "debug> global : " << fAdmin->getMsr2DataParam().global << std::endl;
|
||||||
|
std::cout << "debug> global_plus : " << fAdmin->getMsr2DataParam().globalPlus << std::endl;
|
||||||
|
std::cout << "debug> +++++++++++++++++++++++" << std::endl;
|
||||||
|
std::cout << "debug> theory_functions:" << std::endl;
|
||||||
|
std::cout << "debug> func_pixmap_path : " << fAdmin->getTheoFuncPixmapPath().toLatin1().data() << std::endl;
|
||||||
|
std::cout << "debug> #theory : " << fAdmin->getTheoryCounts() << std::endl;
|
||||||
|
PTheory *theo;
|
||||||
|
for (unsigned int i=0; i<fAdmin->getTheoryCounts(); i++) {
|
||||||
|
theo = fAdmin->getTheoryItem(i);
|
||||||
|
std::cout << "debug> -------" << std::endl;
|
||||||
|
std::cout << "debug> name : " << theo->name.toLatin1().data() << std::endl;
|
||||||
|
std::cout << "debug> comment : " << theo->comment.toLatin1().data() << std::endl;
|
||||||
|
std::cout << "debug> label : " << theo->label.toLatin1().data() << std::endl;
|
||||||
|
std::cout << "debug> pixmapName : " << theo->pixmapName.toLatin1().data() << std::endl;
|
||||||
|
std::cout << "debug> params : " << theo->params << std::endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -700,6 +773,34 @@ PAdmin::PAdmin() : QObject()
|
|||||||
fPrefPathName = pathFln;
|
fPrefPathName = pathFln;
|
||||||
|
|
||||||
loadPrefs(fPrefPathName);
|
loadPrefs(fPrefPathName);
|
||||||
|
|
||||||
|
// make sure that musrfit, musrview, etc are found under the fExecPath provided
|
||||||
|
QString str = fExecPath + "/musrfit";
|
||||||
|
QFileInfo info(str);
|
||||||
|
if (info.exists()) {
|
||||||
|
if (!info.isExecutable())
|
||||||
|
QMessageBox::critical(0, "ERROR", "musrfit found but not recognized as executable.\nPlease check!");
|
||||||
|
} else {
|
||||||
|
QMessageBox::critical(0, "ERROR", "musrfit not found.\nHave you set the necessary system variables properly?\nPlease check the manual.\nBefore you can use musrfit, this needs to be fixed.");
|
||||||
|
}
|
||||||
|
|
||||||
|
// check if system variables are set properly
|
||||||
|
bool sysVarMissing = false;
|
||||||
|
QString msg("Missing System Variables:\n");
|
||||||
|
path = procEnv.value("ROOTSYS", "");
|
||||||
|
if (path.isEmpty()) {
|
||||||
|
msg += "> ROOTSYS\n";
|
||||||
|
sysVarMissing = true;
|
||||||
|
}
|
||||||
|
path = procEnv.value("MUSRFITPATH", "");
|
||||||
|
if (path.isEmpty()) {
|
||||||
|
msg += "> MUSRFITPATH\n";
|
||||||
|
sysVarMissing = true;
|
||||||
|
}
|
||||||
|
if (sysVarMissing) {
|
||||||
|
msg += "Please set this/these system variables.";
|
||||||
|
QMessageBox::warning(0, "WARNING", msg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -776,20 +877,15 @@ void PAdmin::setHelpUrl(const QString tag, const QString url)
|
|||||||
int PAdmin::loadPrefs(QString fln)
|
int PAdmin::loadPrefs(QString fln)
|
||||||
{
|
{
|
||||||
if (QFile::exists(fln)) { // administration file present
|
if (QFile::exists(fln)) { // administration file present
|
||||||
PAdminXMLParser handler(this);
|
PAdminXMLParser handler(fln, this);
|
||||||
QFile xmlFile(fln);
|
if (!handler.isValid()) {
|
||||||
QXmlInputSource source( &xmlFile );
|
QMessageBox::critical(0, "**ERROR**",
|
||||||
QXmlSimpleReader reader;
|
|
||||||
reader.setContentHandler( &handler );
|
|
||||||
reader.setErrorHandler( &handler );
|
|
||||||
if (!reader.parse( source )) {
|
|
||||||
QMessageBox::critical(0, "ERROR",
|
|
||||||
"Error parsing musredit_startup.xml settings file.\nProbably a few things will not work porperly.\nPlease fix this first.",
|
"Error parsing musredit_startup.xml settings file.\nProbably a few things will not work porperly.\nPlease fix this first.",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
QMessageBox::critical(0, "ERROR",
|
QMessageBox::critical(0, "**ERROR**",
|
||||||
"Couldn't find the musredit_startup.xml settings file.\nProbably a few things will not work porperly.\nPlease fix this first.",
|
"Couldn't find the musredit_startup.xml settings file.\nProbably a few things will not work porperly.\nPlease fix this first.",
|
||||||
QMessageBox::Ok, QMessageBox::NoButton);
|
QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
#include <QVector>
|
#include <QVector>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
#include <QtXml>
|
#include <QXmlStreamReader>
|
||||||
|
|
||||||
#include <musredit.h>
|
#include <musredit.h>
|
||||||
|
|
||||||
@ -61,12 +61,14 @@ typedef struct {
|
|||||||
* necessary informations about executable pathes, online help informations,
|
* necessary informations about executable pathes, online help informations,
|
||||||
* default font sizes, etc.
|
* default font sizes, etc.
|
||||||
*/
|
*/
|
||||||
class PAdminXMLParser : public QXmlDefaultHandler
|
class PAdminXMLParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PAdminXMLParser(PAdmin*);
|
PAdminXMLParser(const QString &fln, PAdmin*);
|
||||||
virtual ~PAdminXMLParser() {}
|
virtual ~PAdminXMLParser() {}
|
||||||
|
|
||||||
|
virtual bool isValid() { return fValid; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum EAdminKeyWords {eEmpty, eTimeout, eKeepMinuit2Output, eDumpAscii, eDumpRoot,
|
enum EAdminKeyWords {eEmpty, eTimeout, eKeepMinuit2Output, eDumpAscii, eDumpRoot,
|
||||||
eTitleFromDataFile, eChisqPreRunBlock, eEstimateN0,
|
eTitleFromDataFile, eChisqPreRunBlock, eEstimateN0,
|
||||||
@ -80,24 +82,23 @@ class PAdminXMLParser : public QXmlDefaultHandler
|
|||||||
eChainFit, eWriteDataHeader, eIgnoreDataHeaderInfo, eWriteColumnData,
|
eChainFit, eWriteDataHeader, eIgnoreDataHeaderInfo, eWriteColumnData,
|
||||||
eRecreateDataFile, eOpenFileAfterFitting, eCreateMsrFileOnly, eFitOnly, eGlobal, eGlobalPlus};
|
eRecreateDataFile, eOpenFileAfterFitting, eCreateMsrFileOnly, eFitOnly, eGlobal, eGlobalPlus};
|
||||||
|
|
||||||
|
bool parse(QIODevice *device);
|
||||||
bool startDocument();
|
bool startDocument();
|
||||||
bool startElement( const QString&, const QString&, const QString& ,
|
bool startElement();
|
||||||
const QXmlAttributes& );
|
bool endElement();
|
||||||
bool endElement( const QString&, const QString&, const QString& );
|
bool characters();
|
||||||
|
|
||||||
bool characters(const QString&);
|
|
||||||
bool endDocument();
|
bool endDocument();
|
||||||
|
|
||||||
bool warning( const QXmlParseException & exception );
|
void dump();
|
||||||
bool error( const QXmlParseException & exception );
|
|
||||||
bool fatalError( const QXmlParseException & exception );
|
|
||||||
|
|
||||||
QString expandPath(const QString&);
|
QString expandPath(const QString&);
|
||||||
|
|
||||||
EAdminKeyWords fKeyWord; ///< key word tag to know how to handle the content
|
QXmlStreamReader fXml; ///< xml stream reader object
|
||||||
bool fFunc; ///< flag needed to indicate that a new theory function is found
|
bool fValid; ///< flag showing if XML read has been successful
|
||||||
PTheory fTheoryItem; ///< holding the informations necessary for a theory item
|
EAdminKeyWords fKeyWord; ///< key word tag to know how to handle the content
|
||||||
PAdmin *fAdmin; ///< a pointer to the main administration class object
|
bool fFunc; ///< flag needed to indicate that a new theory function is found
|
||||||
|
PTheory fTheoryItem; ///< holding the informations necessary for a theory item
|
||||||
|
PAdmin *fAdmin; ///< a pointer to the main administration class object
|
||||||
};
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
@ -27,21 +27,76 @@
|
|||||||
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
|
#include <QString>
|
||||||
|
#include <QStringRef>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QFileDialog>
|
#include <QFileDialog>
|
||||||
#include <QListWidgetItem>
|
#include <QListWidgetItem>
|
||||||
|
#include <QIODevice>
|
||||||
|
#include <QFile>
|
||||||
|
#include <QProcessEnvironment>
|
||||||
|
#include <QTextStream>
|
||||||
|
|
||||||
#include "PChangeDefaultPathsDialog.h"
|
#include "PChangeDefaultPathsDialog.h"
|
||||||
|
|
||||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
/**
|
/**
|
||||||
* @brief PDefaultPathsXMLParser::PDefaultPathsXMLParser
|
* <p>XML Parser class for the musrfit administration file.
|
||||||
|
*
|
||||||
|
* \param fln file name of the musredit startup xml-file
|
||||||
* @param defaultPaths
|
* @param defaultPaths
|
||||||
*/
|
*/
|
||||||
PDefaultPathsXMLParser::PDefaultPathsXMLParser(PDefaultPaths *defaultPaths) :
|
PDefaultPathsXMLParser::PDefaultPathsXMLParser(const QString& fln, PDefaultPaths *defaultPaths) :
|
||||||
fDefaultPaths(defaultPaths)
|
fDefaultPaths(defaultPaths)
|
||||||
{
|
{
|
||||||
|
fValid = false;
|
||||||
fKeyWord = eEmpty;
|
fKeyWord = eEmpty;
|
||||||
|
|
||||||
|
QFile file(fln);
|
||||||
|
if (!file.open(QFile::ReadOnly | QFile::Text)) {
|
||||||
|
// warning and create default - STILL MISSING
|
||||||
|
}
|
||||||
|
|
||||||
|
fValid = parse(&file);
|
||||||
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------------
|
||||||
|
/**
|
||||||
|
* <p>parse the musrfit startup xml-file.
|
||||||
|
*
|
||||||
|
* \param device QFile object of the musrfit startup xml-file
|
||||||
|
*
|
||||||
|
* @return true on success, false otherwise
|
||||||
|
*/
|
||||||
|
bool PDefaultPathsXMLParser::parse(QIODevice *device)
|
||||||
|
{
|
||||||
|
fXml.setDevice(device);
|
||||||
|
|
||||||
|
bool expectChars = false;
|
||||||
|
while (!fXml.atEnd()) {
|
||||||
|
fXml.readNext();
|
||||||
|
if (fXml.isStartDocument()) {
|
||||||
|
startDocument();
|
||||||
|
} else if (fXml.isStartElement()) {
|
||||||
|
startElement();
|
||||||
|
expectChars = true;
|
||||||
|
} else if (fXml.isCharacters() && expectChars) {
|
||||||
|
characters();
|
||||||
|
} else if (fXml.isEndElement()) {
|
||||||
|
endElement();
|
||||||
|
expectChars = false;
|
||||||
|
} else if (fXml.isEndDocument()) {
|
||||||
|
endDocument();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (fXml.hasError()) {
|
||||||
|
QString msg;
|
||||||
|
msg = QString("%1 Line %2, column %3").arg(fXml.errorString()).arg(fXml.lineNumber()).arg(fXml.columnNumber());
|
||||||
|
QMessageBox::critical(0, "**ERROR**", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
@ -50,6 +105,7 @@ PDefaultPathsXMLParser::PDefaultPathsXMLParser(PDefaultPaths *defaultPaths) :
|
|||||||
*/
|
*/
|
||||||
bool PDefaultPathsXMLParser::startDocument()
|
bool PDefaultPathsXMLParser::startDocument()
|
||||||
{
|
{
|
||||||
|
// nothing to be done here for now
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,13 +113,11 @@ bool PDefaultPathsXMLParser::startDocument()
|
|||||||
/**
|
/**
|
||||||
* <p>Routine called when a new XML tag is found. Here it is used
|
* <p>Routine called when a new XML tag is found. Here it is used
|
||||||
* to set a tag for filtering afterwards the content.
|
* to set a tag for filtering afterwards the content.
|
||||||
*
|
|
||||||
* \param qName name of the XML tag.
|
|
||||||
*/
|
*/
|
||||||
bool PDefaultPathsXMLParser::startElement( const QString&, const QString&,
|
bool PDefaultPathsXMLParser::startElement()
|
||||||
const QString& qName,
|
|
||||||
const QXmlAttributes& )
|
|
||||||
{
|
{
|
||||||
|
QStringRef qName = fXml.name();
|
||||||
|
|
||||||
if (qName == "data_path") {
|
if (qName == "data_path") {
|
||||||
fKeyWord = eDataPath;
|
fKeyWord = eDataPath;
|
||||||
}
|
}
|
||||||
@ -75,10 +129,8 @@ bool PDefaultPathsXMLParser::startElement( const QString&, const QString&,
|
|||||||
/**
|
/**
|
||||||
* <p>Routine called when the end XML tag is found. It is used to
|
* <p>Routine called when the end XML tag is found. It is used to
|
||||||
* put the filtering tag to 'empty'.
|
* put the filtering tag to 'empty'.
|
||||||
*
|
|
||||||
* \param qName name of the element.
|
|
||||||
*/
|
*/
|
||||||
bool PDefaultPathsXMLParser::endElement( const QString&, const QString&, const QString & )
|
bool PDefaultPathsXMLParser::endElement()
|
||||||
{
|
{
|
||||||
fKeyWord = eEmpty;
|
fKeyWord = eEmpty;
|
||||||
|
|
||||||
@ -89,11 +141,13 @@ bool PDefaultPathsXMLParser::endElement( const QString&, const QString&, const Q
|
|||||||
/**
|
/**
|
||||||
* <p>This routine delivers the content of an XML tag. It fills the
|
* <p>This routine delivers the content of an XML tag. It fills the
|
||||||
* content into the load data structure.
|
* content into the load data structure.
|
||||||
*
|
|
||||||
* \param str keeps the content of the XML tag.
|
|
||||||
*/
|
*/
|
||||||
bool PDefaultPathsXMLParser::characters(const QString& str)
|
bool PDefaultPathsXMLParser::characters()
|
||||||
{
|
{
|
||||||
|
QString str = *fXml.text().string();
|
||||||
|
if (str.isEmpty())
|
||||||
|
return true;
|
||||||
|
|
||||||
switch (fKeyWord) {
|
switch (fKeyWord) {
|
||||||
case eDataPath:
|
case eDataPath:
|
||||||
fDefaultPaths->appendDefaultPath(str);
|
fDefaultPaths->appendDefaultPath(str);
|
||||||
@ -115,67 +169,10 @@ bool PDefaultPathsXMLParser::endDocument()
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>Report XML warnings.
|
|
||||||
*
|
|
||||||
* \param exception holds the information of the XML warning
|
|
||||||
*/
|
|
||||||
bool PDefaultPathsXMLParser::warning( const QXmlParseException & exception )
|
|
||||||
{
|
|
||||||
QString msg;
|
|
||||||
|
|
||||||
msg = QString("**WARNING** while parsing musrfit_startup.xml in line no %1\n").arg(exception.lineNumber());
|
|
||||||
msg += QString("**WARNING MESSAGE** ") + exception.message();
|
|
||||||
|
|
||||||
qWarning() << endl << msg << endl;
|
|
||||||
|
|
||||||
QMessageBox::warning(0, "WARNING", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>Report recoverable XML errors.
|
|
||||||
*
|
|
||||||
* \param exception holds the information of the XML recoverable errors.
|
|
||||||
*/
|
|
||||||
bool PDefaultPathsXMLParser::error( const QXmlParseException & exception )
|
|
||||||
{
|
|
||||||
QString msg;
|
|
||||||
|
|
||||||
msg = QString("**ERROR** while parsing musrfit_startup.xml in line no %1\n").arg(exception.lineNumber());
|
|
||||||
msg += QString("**ERROR MESSAGE** ") + exception.message();
|
|
||||||
|
|
||||||
qWarning() << endl << msg << endl;
|
|
||||||
|
|
||||||
QMessageBox::critical(0, "ERROR", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* <p>Report fatal XML errors.
|
|
||||||
*
|
|
||||||
* \param exception holds the information of the XML fatal errors.
|
|
||||||
*/
|
|
||||||
bool PDefaultPathsXMLParser::fatalError( const QXmlParseException & exception )
|
|
||||||
{
|
|
||||||
QString msg;
|
|
||||||
|
|
||||||
msg = QString("**FATAL ERROR** while parsing musrfit_startup.xml in line no %1\n").arg(exception.lineNumber());
|
|
||||||
msg += QString("**FATAL ERROR MESSAGE** ") + exception.message();
|
|
||||||
|
|
||||||
qWarning() << endl << msg << endl;
|
|
||||||
|
|
||||||
QMessageBox::critical(0, "FATAL ERROR", msg, QMessageBox::Ok, QMessageBox::NoButton);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
/**
|
||||||
|
* @brief PDefaultPaths::PDefaultPaths
|
||||||
|
*/
|
||||||
PDefaultPaths::PDefaultPaths() : QObject()
|
PDefaultPaths::PDefaultPaths() : QObject()
|
||||||
{
|
{
|
||||||
fValid = true;
|
fValid = true;
|
||||||
@ -204,13 +201,8 @@ PDefaultPaths::PDefaultPaths() : QObject()
|
|||||||
fPrefPathName = pathFln;
|
fPrefPathName = pathFln;
|
||||||
|
|
||||||
// read musrfit_startup.xml and extract default data file search paths
|
// read musrfit_startup.xml and extract default data file search paths
|
||||||
PDefaultPathsXMLParser handler(this);
|
PDefaultPathsXMLParser handler(fPrefPathName, this);
|
||||||
QFile xmlFile(fPrefPathName);
|
if (!handler.isValid()) {
|
||||||
QXmlInputSource source( &xmlFile );
|
|
||||||
QXmlSimpleReader reader;
|
|
||||||
reader.setContentHandler( &handler );
|
|
||||||
reader.setErrorHandler( &handler );
|
|
||||||
if (!reader.parse( source )) {
|
|
||||||
fValid = false;
|
fValid = false;
|
||||||
QMessageBox::critical(0, "ERROR",
|
QMessageBox::critical(0, "ERROR",
|
||||||
"Error parsing musrfit_startup.xml settings file.\nProbably a few things will not work porperly.\nPlease fix this first.",
|
"Error parsing musrfit_startup.xml settings file.\nProbably a few things will not work porperly.\nPlease fix this first.",
|
||||||
|
@ -32,36 +32,36 @@
|
|||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
#include <QtXml>
|
#include <QXmlStreamReader>
|
||||||
|
#include <QIODevice>
|
||||||
|
|
||||||
#include "ui_PChangeDefaultPathsDialog.h"
|
#include "ui_PChangeDefaultPathsDialog.h"
|
||||||
|
|
||||||
class PDefaultPaths;
|
class PDefaultPaths;
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
class PDefaultPathsXMLParser : public QXmlDefaultHandler
|
class PDefaultPathsXMLParser
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PDefaultPathsXMLParser(PDefaultPaths *defaultPaths);
|
PDefaultPathsXMLParser(const QString &fln, PDefaultPaths *defaultPaths);
|
||||||
virtual ~PDefaultPathsXMLParser() {}
|
virtual ~PDefaultPathsXMLParser() {}
|
||||||
|
|
||||||
|
virtual bool isValid() { return fValid; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
enum EAdminKeyWords {eEmpty, eDataPath};
|
enum EAdminKeyWords {eEmpty, eDataPath};
|
||||||
|
|
||||||
|
bool parse(QIODevice *device);
|
||||||
bool startDocument();
|
bool startDocument();
|
||||||
bool startElement( const QString&, const QString&, const QString& ,
|
bool startElement();
|
||||||
const QXmlAttributes& );
|
bool endElement();
|
||||||
bool endElement( const QString&, const QString&, const QString& );
|
bool characters();
|
||||||
|
|
||||||
bool characters(const QString&);
|
|
||||||
bool endDocument();
|
bool endDocument();
|
||||||
|
|
||||||
bool warning( const QXmlParseException & exception );
|
QXmlStreamReader fXml; ///< xml stream reader object
|
||||||
bool error( const QXmlParseException & exception );
|
bool fValid; ///< flag showing if XML read has been successful
|
||||||
bool fatalError( const QXmlParseException & exception );
|
EAdminKeyWords fKeyWord; ///< key word tag to know how to handle the content
|
||||||
|
PDefaultPaths *fDefaultPaths; ///< keeps the default search paths for the data files
|
||||||
EAdminKeyWords fKeyWord; ///< key word tag to know how to handle the content
|
|
||||||
PDefaultPaths *fDefaultPaths; ///< keeps the default search paths for the data files
|
|
||||||
};
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
|
Reference in New Issue
Block a user