From cef9e14b989a3ba19321e4fe215ada2ee3998037 Mon Sep 17 00:00:00 2001 From: Thales Lima Oliveira Date: Wed, 3 Jan 2018 19:01:57 -0200 Subject: Some file hand. organization and generalization --- Project/Sum.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'Project/Sum.cpp') diff --git a/Project/Sum.cpp b/Project/Sum.cpp index 52fe66a..10d515f 100644 --- a/Project/Sum.cpp +++ b/Project/Sum.cpp @@ -15,9 +15,9 @@ * along with this program. If not, see . */ +#include "ConnectionLine.h" #include "Sum.h" #include "SumForm.h" -#include "ConnectionLine.h" Sum::Sum(int id) : ControlElement(id) { @@ -245,3 +245,26 @@ Element* Sum::GetCopy() *copy = *this; return copy; } + +void Sum::SaveElement(rapidxml::xml_document<>& doc, rapidxml::xml_node<>* elementListNode) {} + +bool Sum::OpenElement(rapidxml::xml_node<>* elementNode) +{ + if(!OpenCADProperties(elementNode)) return false; + if(!OpenControlNodes(elementNode)) return false; + + m_signalList.clear(); + auto signsNode = elementNode->first_node("Signs"); + auto sign = signsNode->first_node("Value"); + while(sign) { + long value; + wxString(sign->value()).ToCLong(&value); + m_signalList.push_back(static_cast(value)); + sign = sign->next_sibling("Value"); + } + + StartMove(m_position); + UpdatePoints(); + + return true; +} -- cgit