From f19803bc64885bcfaef15cfd7a8139c28d3dd506 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Sat, 8 Apr 2017 16:31:25 -0300 Subject: Control editor export under implementation File handling --- Project/FileHanding.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'Project/FileHanding.h') diff --git a/Project/FileHanding.h b/Project/FileHanding.h index 4546f15..1954876 100644 --- a/Project/FileHanding.h +++ b/Project/FileHanding.h @@ -6,6 +6,8 @@ #include #include "Workspace.h" +#include "ControlEditor.h" +#include "ControlElementContainer.h" #include "ElectricCalculation.h" #include "Text.h" @@ -19,15 +21,21 @@ 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); protected: Workspace* m_workspace = NULL; + ControlEditor* m_controlEditor = NULL; rapidxml::xml_node<>* AppendNode(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* parentNode, @@ -42,6 +50,8 @@ 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); + + void SaveControlElements(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* elementsNode); }; #endif // FILEHANDING_H -- cgit From d2aa79321df798c297334dbcf4e56320b84400ba Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Mon, 10 Apr 2017 19:31:17 -0300 Subject: Control import implementation start --- Project/FileHanding.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'Project/FileHanding.h') diff --git a/Project/FileHanding.h b/Project/FileHanding.h index 1954876..a00d929 100644 --- a/Project/FileHanding.h +++ b/Project/FileHanding.h @@ -52,6 +52,8 @@ protected: int GetAttributeValueInt(rapidxml::xml_node<>* parent, const char* nodeName, const char* atrName); void SaveControlElements(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* elementsNode); + void SaveControlNodes(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* nodesN, std::vector nodeList); + void SaveControlChildren(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* childrenNode, std::vector childList); }; #endif // FILEHANDING_H -- cgit From 52931022eb25080e33f2362c3b0bd4361f0cdb0b Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Wed, 12 Apr 2017 18:57:10 -0300 Subject: Open control implementation --- Project/FileHanding.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Project/FileHanding.h') diff --git a/Project/FileHanding.h b/Project/FileHanding.h index a00d929..8783070 100644 --- a/Project/FileHanding.h +++ b/Project/FileHanding.h @@ -50,10 +50,12 @@ 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 SaveControlElements(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* elementsNode); void SaveControlNodes(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* nodesN, std::vector nodeList); - void SaveControlChildren(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* childrenNode, std::vector childList); + //void SaveControlChildren(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* childrenNode, std::vector childList); + ControlElement* GetControlElementFromID(std::vector elementList, int id); }; #endif // FILEHANDING_H -- cgit From 0ec05e0cb396a9ef153d29f605d4a0bbeb0dc7c1 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Mon, 17 Apr 2017 20:25:10 -0300 Subject: Connection line import under implementation Parent line not implemented yet --- Project/FileHanding.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'Project/FileHanding.h') diff --git a/Project/FileHanding.h b/Project/FileHanding.h index 8783070..28efa83 100644 --- a/Project/FileHanding.h +++ b/Project/FileHanding.h @@ -31,7 +31,7 @@ public: bool OpenProject(wxFileName path); void SaveControl(wxFileName path); - bool OpenControl(wxFileName path); + bool OpenControl(wxFileName path, std::vector& ctrlElementList, std::vector& ctrlConnectionList); protected: Workspace* m_workspace = NULL; @@ -54,7 +54,6 @@ protected: void SaveControlElements(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* elementsNode); void SaveControlNodes(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* nodesN, std::vector nodeList); - //void SaveControlChildren(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* childrenNode, std::vector childList); ControlElement* GetControlElementFromID(std::vector elementList, int id); }; -- cgit From b43f89144d6122b3100efb3971c8fa32a3001888 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Tue, 18 Apr 2017 19:05:35 -0300 Subject: Some bugfixes and generalization --- Project/FileHanding.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'Project/FileHanding.h') diff --git a/Project/FileHanding.h b/Project/FileHanding.h index 28efa83..e072cbf 100644 --- a/Project/FileHanding.h +++ b/Project/FileHanding.h @@ -32,6 +32,9 @@ public: void SaveControl(wxFileName path); bool OpenControl(wxFileName path, std::vector& ctrlElementList, std::vector& 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; @@ -52,7 +55,6 @@ protected: int GetAttributeValueInt(rapidxml::xml_node<>* parent, const char* nodeName, const char* atrName); int GetAttributeValueInt(rapidxml::xml_node<>* node, const char* atrName); - void SaveControlElements(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* elementsNode); void SaveControlNodes(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* nodesN, std::vector nodeList); ControlElement* GetControlElementFromID(std::vector elementList, int id); }; -- cgit From 341b4a77d2b4c69a99370065af166d92071c9207 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Thu, 20 Apr 2017 18:41:00 -0300 Subject: Export/Import implemented --- Project/FileHanding.h | 1 + 1 file changed, 1 insertion(+) (limited to 'Project/FileHanding.h') diff --git a/Project/FileHanding.h b/Project/FileHanding.h index e072cbf..c952824 100644 --- a/Project/FileHanding.h +++ b/Project/FileHanding.h @@ -57,6 +57,7 @@ protected: void SaveControlNodes(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* nodesN, std::vector nodeList); ControlElement* GetControlElementFromID(std::vector elementList, int id); + bool OpenControlNodeList(rapidxml::xml_node<>* elementNode, std::vector& nodeVector); }; #endif // FILEHANDING_H -- cgit