summaryrefslogtreecommitdiffstats
path: root/Project/Sum.cpp
diff options
context:
space:
mode:
authorThales Lima Oliveira <thaleslima.ufu@gmail.com>2018-01-03 19:01:57 -0200
committerThales Lima Oliveira <thaleslima.ufu@gmail.com>2018-01-03 19:01:57 -0200
commitcef9e14b989a3ba19321e4fe215ada2ee3998037 (patch)
tree245a63164fcd4131c48ebd1883615d112b0b59e9 /Project/Sum.cpp
parent0c0280cfcf540f943fd2dbfdf7ac0304ea96a465 (diff)
downloadPSP.git-cef9e14b989a3ba19321e4fe215ada2ee3998037.tar.gz
PSP.git-cef9e14b989a3ba19321e4fe215ada2ee3998037.tar.xz
PSP.git-cef9e14b989a3ba19321e4fe215ada2ee3998037.zip
Some file hand. organization and generalization
Diffstat (limited to 'Project/Sum.cpp')
-rw-r--r--Project/Sum.cpp25
1 files changed, 24 insertions, 1 deletions
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 <https://www.gnu.org/licenses/>.
*/
+#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<Sum::Signal>(value));
+ sign = sign->next_sibling("Value");
+ }
+
+ StartMove(m_position);
+ UpdatePoints();
+
+ return true;
+}