summaryrefslogtreecommitdiffstats
path: root/Project/FileHanding.h
diff options
context:
space:
mode:
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