COPASI API  4.16.103
DataModelGUI.h
Go to the documentation of this file.
1 // Copyright (C) 2010 - 2015 by Pedro Mendes, Virginia Tech Intellectual
2 // Properties, Inc., University of Heidelberg, and The University
3 // of Manchester.
4 // All rights reserved.
5 
6 // Copyright (C) 2008 - 2009 by Pedro Mendes, Virginia Tech Intellectual
7 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
8 // and The University of Manchester.
9 // All rights reserved.
10 
11 // Copyright (C) 2004 - 2007 by Pedro Mendes, Virginia Tech Intellectual
12 // Properties, Inc. and EML Research, gGmbH.
13 // All rights reserved.
14 
15 #ifndef DATAMODELGUI_H
16 #define DATAMODELGUI_H
17 
18 #include <QtCore/QVariant>
19 
20 #include <QtCore/QObject>
21 #include <QtGui/QApplication>
22 
24 #include "copasi/UI/listviews.h"
25 
26 //class CMathModel;
27 class QTimer;
28 class CMIRIAMResources;
29 class CQThread;
30 class CProgressBar;
31 class CQBrowserPaneDM;
32 class QNetworkReply;
33 
34 class DataModelGUI: public QObject
35 {
36  Q_OBJECT
37 private:
38  void linkDataModelToGUI();
39 
40 public:
41  DataModelGUI(QObject * parent);
42  virtual ~DataModelGUI();
43 
44  bool createModel();
45  void loadModel(const std::string & fileName);
46  void saveModel(const std::string & fileName, bool overwriteFile = false);
47 
48 #ifdef WITH_MERGEMODEL
49  void addModel(const std::string & fileName);
50  void addModelRun();
51 #endif
52 
53  void saveFunctionDB(const std::string & fileName);
54  void loadFunctionDB(const std::string & fileName);
55 
56  void importSBML(const std::string & fileName);
57  void exportSBML(const std::string & fileName, bool overwriteFile , int sbmlLevel, int sbmlVersion, bool exportIncomplete, bool exportCOPASIMIRIAM = true);
58  void importSBMLFromString(const std::string & sbmlDocumentText);
59  void exportSBMLToString(std::string & sbmlDocumentText);
60  void exportMathModel(const std::string & fileName, const std::string & filter, bool overwriteFile = false);
61  void importCellDesigner();
62 
63  //TODO SEDML
64 #ifdef COPASI_SEDML
65  void exportSEDML(const std::string & fileName, bool overwriteFile , int sedmlLevel, int sedmlVersion, bool exportIncomplete, bool exportCOPASIMIRIAM = true);
66  void exportSEDMLToString(std::string & sedmlDocumentText);
67  void importSEDML(const std::string & fileName);
68  void importSEDMLFromString(const std::string & sedmlDocumentText);
69 
70  void importSEDMLRun();
71  void exportSEDMLRun();
72  void importSEDMLFromStringRun();
73  void exportSEDMLToStringRun();
74 #endif
75 
76  void loadModelRun();
77  void saveModelRun();
78  void importSBMLRun();
79  void exportSBMLRun();
81  void exportSBMLToStringRun();
82  void exportMathModelRun();
83 
84 public slots:
85  void loadModelFinished();
86  void saveModelFinished();
87  void importSBMLFinished();
88  void exportSBMLFinished();
92 #ifdef WITH_MERGEMODEL
93  void addModelFinished();
94 #endif
95  void miriamDownloadFinished(QNetworkReply*);
96  void miriamDownloadProgress(qint64 received, qint64 total);
97 
98  //TODO SEDML
99 #ifdef COPASI_SEDML
100  void importSEDMLFinished();
101  void exportSEDMLFinished();
102  void importSEDMLFromStringFinished();
103  void exportSEDMLToStringFinished();
104 #endif
105 
106 public:
107  bool updateMIRIAM(CMIRIAMResources & miriamResources);
108 
110 
111  //CMathModel * getMathModel() {return mpMathModel;}
112  //bool updateMathModel();
113  //bool scheduleMathModelUpdate(const bool & update = true);
114 
115  bool notify(ListViews::ObjectType objectType, ListViews::Action action, const std::string & key = "");
116 
117  void registerListView(ListViews * pListView);
118  void deregisterListView(ListViews * pListView);
119 
120  void refreshInitialValues();
121  void buildChangedObjects();
122  void setFramework(int framework);
124  void commit();
125 
126 protected:
127 private:
128  void threadFinished();
129 
130 signals:
131  void updateCompleteView();
132  void notifyView(ListViews::ObjectType objectType, ListViews::Action action, std::string key = "");
133  void finished(bool success);
134 
135 private:
136  QApplication *mpApp;
138  std::set< ListViews * > mListViews;
140  std::vector< Refresh * > mUpdateVector;
141  std::set< const CCopasiObject * > mChangedObjects;
142 
145  bool mSuccess;
146  std::string mSBMLImportString;
147  std::string * mpSBMLExportString;
148  std::string mFileName;
154  std::string mExportFormat;
156  unsigned int mDownloadedBytes;
157  unsigned int mDownloadedTotalBytes;
158  size_t mUpdateItem;
159 
160  //TODO SEDML
161 #ifdef COPASI_SEDML
162  std::string mSEDMLImportString;
163  std::string * mpSEDMLExportString;
164  int mSEDMLLevel;
165  int mSEDMLVersion;
166  bool mSEDMLExportIncomplete;
167  bool mSEDMLExportCOPASIMIRIAM;
168 #endif
169 };
170 
171 #endif
void importSBMLFromStringRun()
void threadFinished()
COutputHandlerPlot mOutputHandlerPlot
Definition: DataModelGUI.h:137
CMIRIAMResources * mpMiriamResources
Definition: DataModelGUI.h:155
void buildChangedObjects()
objectType
void exportSBMLToStringFinished()
void updateCompleteView()
void importSBML(const std::string &fileName)
bool updateMIRIAM(CMIRIAMResources &miriamResources)
void loadFunctionDB(const std::string &fileName)
bool notify(ListViews::ObjectType objectType, ListViews::Action action, const std::string &key="")
void exportSBMLToStringRun()
void exportSBMLRun()
void saveModelRun()
void exportMathModelRun()
void loadModel(const std::string &fileName)
bool mSBMLExportIncomplete
Definition: DataModelGUI.h:152
COutputDefinitionVector & getPlotDefinitionList()
std::vector< Refresh * > mUpdateVector
Definition: DataModelGUI.h:140
void exportSBML(const std::string &fileName, bool overwriteFile, int sbmlLevel, int sbmlVersion, bool exportIncomplete, bool exportCOPASIMIRIAM=true)
void importSBMLFromStringFinished()
std::string mExportFormat
Definition: DataModelGUI.h:154
std::string mSBMLImportString
Definition: DataModelGUI.h:146
void miriamDownloadProgress(qint64 received, qint64 total)
size_t mUpdateItem
Definition: DataModelGUI.h:158
CQThread * mpThread
Definition: DataModelGUI.h:143
std::string mFileName
Definition: DataModelGUI.h:148
std::set< ListViews * > mListViews
Definition: DataModelGUI.h:138
void importSBMLFinished()
void miriamDownloadFinished(QNetworkReply *)
void loadModelFinished()
void exportSBMLFinished()
QApplication * mpApp
Definition: DataModelGUI.h:136
unsigned int mDownloadedBytes
Definition: DataModelGUI.h:156
void exportMathModelFinished()
void finished(bool success)
void saveFunctionDB(const std::string &fileName)
std::string * mpSBMLExportString
Definition: DataModelGUI.h:147
void notifyView(ListViews::ObjectType objectType, ListViews::Action action, std::string key="")
void setFramework(int framework)
void refreshInitialValues()
CProgressBar * mpProgressBar
Definition: DataModelGUI.h:144
void deregisterListView(ListViews *pListView)
void importSBMLRun()
bool createModel()
void loadModelRun()
void saveModel(const std::string &fileName, bool overwriteFile=false)
DataModelGUI(QObject *parent)
unsigned int mDownloadedTotalBytes
Definition: DataModelGUI.h:157
void exportSBMLToString(std::string &sbmlDocumentText)
void registerListView(ListViews *pListView)
void linkDataModelToGUI()
std::set< const CCopasiObject * > mChangedObjects
Definition: DataModelGUI.h:141
void importSBMLFromString(const std::string &sbmlDocumentText)
void exportMathModel(const std::string &fileName, const std::string &filter, bool overwriteFile=false)
void importCellDesigner()
void updateMIRIAMResourceContents()
void saveModelFinished()
bool mSBMLExportCOPASIMIRIAM
Definition: DataModelGUI.h:153
virtual ~DataModelGUI()