itom  4.1.0
sharedFunctionsQt.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2020, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom and its software development toolkit (SDK).
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  In addition, as a special exception, the Institut fuer Technische
15  Optik (ITO) gives you certain additional rights.
16  These rights are described in the ITO LGPL Exception version 1.0,
17  which can be found in the file LGPL_EXCEPTION.txt in this package.
18 
19  itom is distributed in the hope that it will be useful, but
20  WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
22  General Public Licence for more details.
23 
24  You should have received a copy of the GNU Library General Public License
25  along with itom. If not, see <http://www.gnu.org/licenses/>.
26 *********************************************************************** */
27 
28 #ifndef SHAREDFUNCTIONSQT_H
29 #define SHAREDFUNCTIONSQT_H
30 
31 #include "typeDefs.h"
32 #include "../DataObject/dataobj.h"
33 #include "sharedStructures.h"
34 
35 #include <qfile.h>
36 #include <qmap.h>
37 #include <qstring.h>
38 
39 #if !defined(Q_MOC_RUN) || defined(ITOMCOMMONQT_MOC) //only moc this file in itomCommonQtLib but not in other libraries or executables linking against this itomCommonQtLib
40 
41 namespace ito
42 {
44  ITOMCOMMONQT_EXPORT ito::RetVal formatDoubleWithUnit(QStringList scaleThisUnitsOnly, QString unitIn, double dVal, double &dValOut, QString &unitOut);
46  ITOMCOMMONQT_EXPORT ito::RetVal generateAutoSaveParamFile(QString plugInName, QFile &paramFile);
48  ITOMCOMMONQT_EXPORT ito::RetVal loadXML2QLIST(QMap<QString, ito::Param> *paramList , QString id, QFile &paramFile);
50  ITOMCOMMONQT_EXPORT ito::RetVal saveQLIST2XML(QMap<QString, ito::Param> *paramList , QString id, QFile &paramFile);
52  ITOMCOMMONQT_EXPORT ito::RetVal mergeQLists(QMap<QString, ito::Param> *oldList, QMap<QString, ito::Param> *newList, bool checkAutoSave, bool deleteUnchangedParams = false);
53 
55  ITOMCOMMONQT_EXPORT ito::RetVal saveDOBJ2XML(ito::DataObject *dObjOut, QString folderFileName, bool onlyHeaderObjectFile = false, bool doubleAsBinary = false);
56 
58  ITOMCOMMONQT_EXPORT ito::RetVal loadXML2DOBJ(ito::DataObject *dObjIn, QString folderFileName, bool onlyHeaderObjectFile = false, bool appendEnding = true);
59 
60 } // end namespace ito
61 
62 #endif //#if !defined(Q_MOC_RUN) || defined(ITOMCOMMONQT_MOC)
63 
64 #endif
ITOMCOMMONQT_EXPORT ito::RetVal saveQLIST2XML(QMap< QString, ito::Param > *paramList, QString id, QFile &paramFile)
mergeQLists copies parameters from newList to oldList and performs some checks
ITOMCOMMONQT_EXPORT ito::RetVal mergeQLists(QMap< QString, ito::Param > *oldList, QMap< QString, ito::Param > *newList, bool checkAutoSave, bool deleteUnchangedParams=false)
Save a dataObject to harddrive in a readable ITO-XML-Format (.ido or .idh)
dataObject contains a n-dimensional matrix
Definition: dataobj.h:511
Class for managing status values (like errors or warning)
Definition: retVal.h:54
ITOMCOMMONQT_EXPORT ito::RetVal generateAutoSaveParamFile(QString plugInName, QFile &paramFile)
loadXML2QLIST loads parameters from an XML-File and saves them to paramList
Definition: sharedFunctionsQt.cpp:182
ITOMCOMMONQT_EXPORT ito::RetVal saveDOBJ2XML(ito::DataObject *dObjOut, QString folderFileName, bool onlyHeaderObjectFile=false, bool doubleAsBinary=false)
Import a dataObject from harddrive, saved in the ITO-XML-Format (.ido or .idh)
Definition: sharedFunctionsQt.cpp:1228
Definition: apiFunctionsGraph.cpp:39
ITOMCOMMONQT_EXPORT ito::RetVal loadXML2DOBJ(ito::DataObject *dObjIn, QString folderFileName, bool onlyHeaderObjectFile=false, bool appendEnding=true)
Definition: sharedFunctionsQt.cpp:2003
ITOMCOMMONQT_EXPORT ito::RetVal loadXML2QLIST(QMap< QString, ito::Param > *paramList, QString id, QFile &paramFile)
saveQLIST2XML writes parameters from paramList to an XML-File
ITOMCOMMONQT_EXPORT ito::RetVal formatDoubleWithUnit(QStringList scaleThisUnitsOnly, QString unitIn, double dVal, double &dValOut, QString &unitOut)
< Function to convert double values with unit to scaled values with scaled units (0.01m -> 10mm)
Definition: sharedFunctionsQt.cpp:55