diff options
Diffstat (limited to 'Project/Sum.cpp')
-rw-r--r-- | Project/Sum.cpp | 25 |
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; +} |