diff options
author | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2018-04-09 17:59:49 -0300 |
---|---|---|
committer | Thales Lima Oliveira <thaleslima.ufu@gmail.com> | 2018-04-09 17:59:49 -0300 |
commit | 586ff94d4bffcaf256e4ca7150b926c1babecada (patch) | |
tree | 671e6b6484d8dd3805500aba65b45469432ea2bf | |
parent | 4e1e884a21a767f13278e32463b5417569db3534 (diff) | |
download | PSP.git-586ff94d4bffcaf256e4ca7150b926c1babecada.tar.gz PSP.git-586ff94d4bffcaf256e4ca7150b926c1babecada.tar.xz PSP.git-586ff94d4bffcaf256e4ca7150b926c1babecada.zip |
More bugfixes
-rw-r--r-- | Project/ConnectionLine.cpp | 16 | ||||
-rw-r--r-- | Project/ConnectionLine.h | 1 | ||||
-rw-r--r-- | Project/MathExpression.cpp | 5 | ||||
-rw-r--r-- | Project/Project.mk | 2 | ||||
-rw-r--r-- | Project/Sum.cpp | 5 |
5 files changed, 14 insertions, 15 deletions
diff --git a/Project/ConnectionLine.cpp b/Project/ConnectionLine.cpp index 672c6e8..80752da 100644 --- a/Project/ConnectionLine.cpp +++ b/Project/ConnectionLine.cpp @@ -22,9 +22,7 @@ ConnectionLine::ConnectionLine(Node* firstNode, int id) : ControlElement(id) { wxPoint2DDouble pt = firstNode->GetPosition(); m_tmpSndPt = pt; - for(int i = 0; i < 6; i++) { - m_pointList.push_back(pt); - } + for(int i = 0; i < 6; i++) { m_pointList.push_back(pt); } m_nodeList.push_back(firstNode); firstNode->SetConnected(); } @@ -52,9 +50,7 @@ void ConnectionLine::Draw(wxPoint2DDouble translation, double scale) const bool ConnectionLine::Contains(wxPoint2DDouble position) const { - if(PointToLineDistance(position) < 5.0) { - return true; - } + if(PointToLineDistance(position) < 5.0) { return true; } return false; } @@ -202,3 +198,11 @@ Element* ConnectionLine::GetCopy() *copy = *this; return copy; } + +bool ConnectionLine::Initialize() +{ + m_solved = false; + m_output = 0.0; + m_value = 0.0; + return true; +} diff --git a/Project/ConnectionLine.h b/Project/ConnectionLine.h index 768ef9f..92154d2 100644 --- a/Project/ConnectionLine.h +++ b/Project/ConnectionLine.h @@ -43,6 +43,7 @@ class ConnectionLine : public ControlElement virtual void Move(wxPoint2DDouble position); virtual bool AppendNode(Node* node, ControlElement* parent); virtual void UpdatePoints(); + virtual bool Initialize(); virtual void SetTemporarySecondPoint(wxPoint2DDouble point) { m_tmpSndPt = point; } virtual wxPoint2DDouble GetMidPoint() const; virtual double GetOffset() const { return m_lineOffset; } diff --git a/Project/MathExpression.cpp b/Project/MathExpression.cpp index 0577c32..1657880 100644 --- a/Project/MathExpression.cpp +++ b/Project/MathExpression.cpp @@ -175,10 +175,7 @@ bool MathExpression::Solve(double* input, double timeStep) for(auto itCN = nodeList.begin(), itCNEnd = nodeList.end(); itCN != itCNEnd; ++itCN) { Node* childNode = *itCN; if(childNode == node) { - if(!cLine->IsSolved()) - m_inputValues[i] = 0.0; - else - m_inputValues[i] = cLine->GetValue(); + m_inputValues[i] = cLine->GetValue(); break; } } diff --git a/Project/Project.mk b/Project/Project.mk index aa8162c..e92b10e 100644 --- a/Project/Project.mk +++ b/Project/Project.mk @@ -13,7 +13,7 @@ CurrentFileName := CurrentFilePath := CurrentFileFullPath := User :=NDSE-69 -Date :=07/04/2018 +Date :=09/04/2018 CodeLitePath :="C:/Program Files/CodeLite" LinkerName :=C:/TDM-GCC-64/bin/g++.exe SharedObjectLinkerName :=C:/TDM-GCC-64/bin/g++.exe -shared -fPIC diff --git a/Project/Sum.cpp b/Project/Sum.cpp index 6d15e7f..9908497 100644 --- a/Project/Sum.cpp +++ b/Project/Sum.cpp @@ -218,10 +218,7 @@ bool Sum::Solve(double* input, double timeStep) for(auto itCN = nodeList.begin(), itCNEnd = nodeList.end(); itCN != itCNEnd; ++itCN) { Node* childNode = *itCN; if(childNode == node) { - if(!cLine->IsSolved()) - inputVector.push_back(0.0); - else - inputVector.push_back(cLine->GetValue()); + inputVector.push_back(cLine->GetValue()); break; } } |