summaryrefslogtreecommitdiffstats
path: root/Project/FileHanding.h
diff options
context:
space:
mode:
authorThales Lima Oliveira <thaleslima.ufu@gmail.com>2017-04-24 17:39:03 -0300
committerGitHub <noreply@github.com>2017-04-24 17:39:03 -0300
commit7804c1bd2c0bd2a5f135c30b20991e8187581cc6 (patch)
tree725e524253d6fd714460402194b408cb33b80b3f /Project/FileHanding.h
parent69131a727782090ffd7cb467f449e8f26d3d2949 (diff)
parent9529a6ed44645842adc6f938478acc1dfa17a284 (diff)
downloadPSP.git-7804c1bd2c0bd2a5f135c30b20991e8187581cc6.tar.gz
PSP.git-7804c1bd2c0bd2a5f135c30b20991e8187581cc6.tar.xz
PSP.git-7804c1bd2c0bd2a5f135c30b20991e8187581cc6.zip
Merge pull request #28 from Thales1330/wip/generic-controllers
Wip generic controllers. Chart view implementation required, creating new branch....
Diffstat (limited to 'Project/FileHanding.h')
-rw-r--r--Project/FileHanding.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/Project/FileHanding.h b/Project/FileHanding.h
index 4546f15..c952824 100644
--- a/Project/FileHanding.h
+++ b/Project/FileHanding.h
@@ -6,6 +6,8 @@
#include <sstream>
#include "Workspace.h"
+#include "ControlEditor.h"
+#include "ControlElementContainer.h"
#include "ElectricCalculation.h"
#include "Text.h"
@@ -19,15 +21,24 @@ class FileHanding
public:
FileHanding();
FileHanding(Workspace* workspace);
+ FileHanding(ControlEditor* controlEditor);
~FileHanding();
void SetWorkspace(Workspace* workspace) { m_workspace = workspace; }
+ void SetControlEditor(ControlEditor* controlEditor) { m_controlEditor = controlEditor; }
void SaveProject(wxFileName path);
bool OpenProject(wxFileName path);
+
+ void SaveControl(wxFileName path);
+ bool OpenControl(wxFileName path, std::vector<ControlElement*>& ctrlElementList, std::vector<ConnectionLine*>& ctrlConnectionList);
+
+ void SaveControlElements(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* elementsNode, ControlElementContainer* ctrlContainer = NULL);
+ bool OpenControlElements(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* elementsNode, ControlElementContainer* ctrlContainer = NULL);
protected:
Workspace* m_workspace = NULL;
+ ControlEditor* m_controlEditor = NULL;
rapidxml::xml_node<>* AppendNode(rapidxml::xml_document<>& doc,
rapidxml::xml_node<>* parentNode,
@@ -42,6 +53,11 @@ protected:
double GetNodeValueDouble(rapidxml::xml_node<>* parent, const char* nodeName);
int GetNodeValueInt(rapidxml::xml_node<>* parent, const char* nodeName);
int GetAttributeValueInt(rapidxml::xml_node<>* parent, const char* nodeName, const char* atrName);
+ int GetAttributeValueInt(rapidxml::xml_node<>* node, const char* atrName);
+
+ void SaveControlNodes(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* nodesN, std::vector<Node*> nodeList);
+ ControlElement* GetControlElementFromID(std::vector<ControlElement*> elementList, int id);
+ bool OpenControlNodeList(rapidxml::xml_node<>* elementNode, std::vector<Node*>& nodeVector);
};
#endif // FILEHANDING_H