summaryrefslogtreecommitdiffstats
path: root/Project/FileHanding.cpp
diff options
context:
space:
mode:
authorThales Lima Oliveira <thaleslima.ufu@gmail.com>2017-09-04 20:05:30 -0300
committerGitHub <noreply@github.com>2017-09-04 20:05:30 -0300
commit926af7f34aaf5aebdbac0cbc550ed75647874258 (patch)
tree4df26f8c631aeeeed6e5c9e8aab87c4c663bd30f /Project/FileHanding.cpp
parent17d1dd82ec065eff08546ef1fd2a188ce77471b2 (diff)
parent6f3421c4150e49af026432a2a2be0171d741ad03 (diff)
downloadPSP.git-926af7f34aaf5aebdbac0cbc550ed75647874258.tar.gz
PSP.git-926af7f34aaf5aebdbac0cbc550ed75647874258.tar.xz
PSP.git-926af7f34aaf5aebdbac0cbc550ed75647874258.zip
Merge pull request #33 from Thales1330/wip/electromechanical-calc
Wip electromechanical calc
Diffstat (limited to 'Project/FileHanding.cpp')
-rw-r--r--Project/FileHanding.cpp174
1 files changed, 105 insertions, 69 deletions
diff --git a/Project/FileHanding.cpp b/Project/FileHanding.cpp
index beb9b81..f5b881d 100644
--- a/Project/FileHanding.cpp
+++ b/Project/FileHanding.cpp
@@ -54,7 +54,7 @@ void FileHanding::SaveProject(wxFileName path)
auto angle = AppendNode(doc, cadProp, "Angle");
SetNodeValue(doc, angle, bus->GetAngle());
- BusElectricalData data = bus->GetEletricalData();
+ BusElectricalData data = bus->GetElectricalData();
auto electricalProp = AppendNode(doc, busNode, "ElectricalProperties");
auto name = AppendNode(doc, electricalProp, "Name");
SetNodeValue(doc, name, data.name);
@@ -126,7 +126,7 @@ void FileHanding::SaveProject(wxFileName path)
SetNodeValue(doc, nodePosY, capacitor->GetPointList()[0].m_y);
auto parentID = AppendNode(doc, cadProp, "ParentID");
Bus* parent = static_cast<Bus*>(capacitor->GetParentList()[0]);
- if(parent) SetNodeValue(doc, parentID, parent->GetEletricalData().number);
+ if(parent) SetNodeValue(doc, parentID, parent->GetElectricalData().number);
CapacitorElectricalData data = capacitor->GetElectricalData();
auto electricalProp = AppendNode(doc, capacitorNode, "ElectricalProperties");
@@ -177,7 +177,7 @@ void FileHanding::SaveProject(wxFileName path)
SetNodeValue(doc, nodePosY, indMotor->GetPointList()[0].m_y);
auto parentID = AppendNode(doc, cadProp, "ParentID");
Bus* parent = static_cast<Bus*>(indMotor->GetParentList()[0]);
- if(parent) SetNodeValue(doc, parentID, parent->GetEletricalData().number);
+ if(parent) SetNodeValue(doc, parentID, parent->GetElectricalData().number);
IndMotorElectricalData data = indMotor->GetElectricalData();
auto electricalProp = AppendNode(doc, indMotorNode, "ElectricalProperties");
@@ -220,7 +220,7 @@ void FileHanding::SaveProject(wxFileName path)
SetNodeValue(doc, nodePosY, inductor->GetPointList()[0].m_y);
auto parentID = AppendNode(doc, cadProp, "ParentID");
Bus* parent = static_cast<Bus*>(inductor->GetParentList()[0]);
- if(parent) SetNodeValue(doc, parentID, parent->GetEletricalData().number);
+ if(parent) SetNodeValue(doc, parentID, parent->GetElectricalData().number);
InductorElectricalData data = inductor->GetElectricalData();
auto electricalProp = AppendNode(doc, inductorNode, "ElectricalProperties");
@@ -273,7 +273,7 @@ void FileHanding::SaveProject(wxFileName path)
if(parent) {
auto parentID = AppendNode(doc, parentIDList, "ParentID");
SetNodeAttribute(doc, parentID, "ID", j);
- SetNodeValue(doc, parentID, parent->GetEletricalData().number);
+ SetNodeValue(doc, parentID, parent->GetElectricalData().number);
}
}
@@ -350,7 +350,7 @@ void FileHanding::SaveProject(wxFileName path)
SetNodeValue(doc, nodePosY, load->GetPointList()[0].m_y);
auto parentID = AppendNode(doc, cadProp, "ParentID");
Bus* parent = static_cast<Bus*>(load->GetParentList()[0]);
- if(parent) SetNodeValue(doc, parentID, parent->GetEletricalData().number);
+ if(parent) SetNodeValue(doc, parentID, parent->GetElectricalData().number);
LoadElectricalData data = load->GetElectricalData();
auto electricalProp = AppendNode(doc, loadNode, "ElectricalProperties");
@@ -406,7 +406,7 @@ void FileHanding::SaveProject(wxFileName path)
SetNodeValue(doc, nodePosY, syncGenerator->GetPointList()[0].m_y);
auto parentID = AppendNode(doc, cadProp, "ParentID");
Bus* parent = static_cast<Bus*>(syncGenerator->GetParentList()[0]);
- if(parent) SetNodeValue(doc, parentID, parent->GetEletricalData().number);
+ if(parent) SetNodeValue(doc, parentID, parent->GetElectricalData().number);
SyncGeneratorElectricalData data = syncGenerator->GetElectricalData();
auto electricalProp = AppendNode(doc, syncGeneratorNode, "ElectricalProperties");
@@ -497,6 +497,12 @@ void FileHanding::SaveProject(wxFileName path)
auto subTq0 = AppendNode(doc, stability, "SubTq0");
SetNodeValue(doc, subTq0, data.subTq0);
+ auto avr = AppendNode(doc, stability, "AVR");
+ if(data.avr) SaveControlElements(doc, avr, data.avr);
+
+ auto speedGov = AppendNode(doc, stability, "SpeedGovernor");
+ if(data.speedGov) SaveControlElements(doc, speedGov, data.speedGov);
+
auto switchingList = AppendNode(doc, electricalProp, "SwitchingList");
SwitchingData swData = syncGenerator->GetSwitchingData();
for(int j = 0; j < (int)swData.swType.size(); j++) {
@@ -536,7 +542,7 @@ void FileHanding::SaveProject(wxFileName path)
SetNodeValue(doc, nodePosY, syncMotor->GetPointList()[0].m_y);
auto parentID = AppendNode(doc, cadProp, "ParentID");
Bus* parent = static_cast<Bus*>(syncMotor->GetParentList()[0]);
- if(parent) SetNodeValue(doc, parentID, parent->GetEletricalData().number);
+ if(parent) SetNodeValue(doc, parentID, parent->GetElectricalData().number);
SyncMotorElectricalData data = syncMotor->GetElectricalData();
auto electricalProp = AppendNode(doc, syncMotorNode, "ElectricalProperties");
@@ -678,7 +684,7 @@ void FileHanding::SaveProject(wxFileName path)
if(parent) {
auto parentID = AppendNode(doc, parentIDList, "ParentID");
SetNodeAttribute(doc, parentID, "ID", j);
- SetNodeValue(doc, parentID, parent->GetEletricalData().number);
+ SetNodeValue(doc, parentID, parent->GetElectricalData().number);
}
}
@@ -836,7 +842,7 @@ bool FileHanding::OpenProject(wxFileName path)
}
for(int i = 0; i < numRot; i++) bus->Rotate(clockwise);
- BusElectricalData data = bus->GetEletricalData();
+ BusElectricalData data = bus->GetElectricalData();
auto electricalProp = busNode->first_node("ElectricalProperties");
if(!electricalProp) return false;
@@ -862,6 +868,9 @@ bool FileHanding::OpenProject(wxFileName path)
data.stabFaultReactance = GetNodeValueDouble(stability, "FaultReactance");
bus->SetElectricalData(data);
+
+ if(data.stabHasFault) bus->SetDynamicEvent(true);
+
elementList.push_back(bus);
busList.push_back(bus);
busNode = busNode->next_sibling("Bus");
@@ -934,6 +943,9 @@ bool FileHanding::OpenProject(wxFileName path)
capacitor->SetSwitchingData(swData);
capacitor->SetElectricalData(data);
+
+ if(swData.swTime.size() != 0) capacitor->SetDynamicEvent(true);
+
elementList.push_back(capacitor);
capacitorList.push_back(capacitor);
capacitorNode = capacitorNode->next_sibling("Capacitor");
@@ -1069,6 +1081,9 @@ bool FileHanding::OpenProject(wxFileName path)
inductor->SetSwitchingData(swData);
inductor->SetElectricalData(data);
+
+ if(swData.swTime.size() != 0) inductor->SetDynamicEvent(true);
+
elementList.push_back(inductor);
inductorList.push_back(inductor);
inductorNode = inductorNode->next_sibling("Inductor");
@@ -1177,6 +1192,9 @@ bool FileHanding::OpenProject(wxFileName path)
line->SetSwitchingData(swData);
line->SetElectricalData(data);
+
+ if(swData.swTime.size() != 0) line->SetDynamicEvent(true);
+
elementList.push_back(line);
lineList.push_back(line);
lineNode = lineNode->next_sibling("Line");
@@ -1252,6 +1270,9 @@ bool FileHanding::OpenProject(wxFileName path)
load->SetSwitchingData(swData);
load->SetElectricalData(data);
+
+ if(swData.swTime.size() != 0) load->SetDynamicEvent(true);
+
elementList.push_back(load);
loadList.push_back(load);
loadNode = loadNode->next_sibling("Load");
@@ -1358,6 +1379,14 @@ bool FileHanding::OpenProject(wxFileName path)
data.subTd0 = GetNodeValueDouble(stability, "SubTd0");
data.subTq0 = GetNodeValueDouble(stability, "SubTq0");
+ auto avr = stability->first_node("AVR");
+ if(!avr) return false;
+ if(!OpenControlElements(doc, avr, data.avr)) return false;
+
+ auto speedGov = stability->first_node("SpeedGovernor");
+ if(!speedGov) return false;
+ if(!OpenControlElements(doc, speedGov, data.speedGov)) return false;
+
SwitchingData swData;
auto switchingList = electricalProp->first_node("SwitchingList");
if(!switchingList) return false;
@@ -1370,6 +1399,9 @@ bool FileHanding::OpenProject(wxFileName path)
syncGenerator->SetSwitchingData(swData);
syncGenerator->SetElectricalData(data);
+
+ if(swData.swTime.size() != 0) syncGenerator->SetDynamicEvent(true);
+
elementList.push_back(syncGenerator);
syncGeneratorList.push_back(syncGenerator);
syncGeneratorNode = syncGeneratorNode->next_sibling("SyncGenerator");
@@ -1597,6 +1629,9 @@ bool FileHanding::OpenProject(wxFileName path)
transformer->SetSwitchingData(swData);
transformer->SetElectricaData(data);
+
+ if(swData.swTime.size() != 0) transformer->SetDynamicEvent(true);
+
elementList.push_back(transformer);
transformerList.push_back(transformer);
transfomerNode = transfomerNode->next_sibling("Transfomer");
@@ -1852,7 +1887,7 @@ void FileHanding::SaveControlElements(rapidxml::xml_document<>& doc,
auto value = AppendNode(doc, gainNode, "Value");
SetNodeValue(doc, value, gain->GetValue());
} //}
-
+
//{ IO
auto iosNode = AppendNode(doc, elementsNode, "IOList");
auto ioList = ctrlContainer->GetIOControlList();
@@ -1883,8 +1918,8 @@ void FileHanding::SaveControlElements(rapidxml::xml_document<>& doc,
SetNodeValue(doc, value, io->GetValue());
auto ioFlags = AppendNode(doc, ioNode, "IOFlags");
SetNodeValue(doc, ioFlags, io->GetIOFlags());
- }//}
-
+ } //}
+
//{ Limiter
auto limitersNode = AppendNode(doc, elementsNode, "LimiterList");
auto limiterList = ctrlContainer->GetLimiterList();
@@ -1915,8 +1950,8 @@ void FileHanding::SaveControlElements(rapidxml::xml_document<>& doc,
SetNodeValue(doc, upLimit, limiter->GetUpLimit());
auto lowLimit = AppendNode(doc, limiterNode, "LowerLimit");
SetNodeValue(doc, lowLimit, limiter->GetLowLimit());
- }//}
-
+ } //}
+
//{ Multiplier
auto multipliersNode = AppendNode(doc, elementsNode, "MultiplierList");
auto multiplierList = ctrlContainer->GetMultiplierList();
@@ -1941,8 +1976,8 @@ void FileHanding::SaveControlElements(rapidxml::xml_document<>& doc,
// Nodes
auto nodeList = AppendNode(doc, multiplierNode, "NodeList");
SaveControlNodes(doc, nodeList, multiplier->GetNodeList());
- } //}
-
+ } //}
+
//{ Rate limiter
auto rateLimitersNode = AppendNode(doc, elementsNode, "RateLimiterList");
auto rateLimiterList = ctrlContainer->GetRateLimiterList();
@@ -1973,8 +2008,8 @@ void FileHanding::SaveControlElements(rapidxml::xml_document<>& doc,
SetNodeValue(doc, upLimit, rateLimiter->GetUpLimit());
auto lowLimit = AppendNode(doc, rateLimiterNode, "LowerLimit");
SetNodeValue(doc, lowLimit, rateLimiter->GetLowLimit());
- } //}
-
+ } //}
+
//{ Sum
auto sumsNode = AppendNode(doc, elementsNode, "SumList");
auto sumList = ctrlContainer->GetSumList();
@@ -1999,17 +2034,17 @@ void FileHanding::SaveControlElements(rapidxml::xml_document<>& doc,
// Nodes
auto nodeList = AppendNode(doc, sumNode, "NodeList");
SaveControlNodes(doc, nodeList, sum->GetNodeList());
-
- //Control properties
+
+ // Control properties
auto signsNode = AppendNode(doc, sumNode, "Signs");
auto signs = sum->GetSignalList();
for(int i = 0; i < (int)signs.size(); ++i) {
auto value = AppendNode(doc, signsNode, "Value");
SetNodeValue(doc, value, static_cast<int>(signs[i]));
}
-
- } //}
-
+
+ } //}
+
//{ Transfer function
auto tfsNode = AppendNode(doc, elementsNode, "TransferFunctionList");
auto tfList = ctrlContainer->GetTFList();
@@ -2034,8 +2069,8 @@ void FileHanding::SaveControlElements(rapidxml::xml_document<>& doc,
// Nodes
auto nodeList = AppendNode(doc, tfNode, "NodeList");
SaveControlNodes(doc, nodeList, tf->GetNodeList());
-
- //Control properties
+
+ // Control properties
auto numeratorNode = AppendNode(doc, tfNode, "Numerator");
auto numerator = tf->GetNumerator();
for(int i = 0; i < (int)numerator.size(); ++i) {
@@ -2048,7 +2083,7 @@ void FileHanding::SaveControlElements(rapidxml::xml_document<>& doc,
auto value = AppendNode(doc, denominatorNode, "Value");
SetNodeValue(doc, value, denominator[i]);
}
- } //}
+ } //}
//{ Connection line
auto cLinesNode = AppendNode(doc, elementsNode, "ConnectionList");
@@ -2093,7 +2128,7 @@ bool FileHanding::OpenControlElements(rapidxml::xml_document<>& doc,
{
std::vector<ControlElement*> elementList;
std::vector<ConnectionLine*> connectionList;
-
+
//{ Constant
auto constListNode = elementsNode->first_node("ConstantList");
if(!constListNode) return false;
@@ -2112,27 +2147,27 @@ bool FileHanding::OpenControlElements(rapidxml::xml_document<>& doc,
double width = GetNodeValueDouble(size, "Width");
double height = GetNodeValueDouble(size, "Height");
double angle = GetNodeValueDouble(cadPropNode, "Angle");
-
+
double value = GetNodeValueDouble(constNode, "Value");
-
+
constant->SetWidth(width);
constant->SetHeight(height);
constant->SetAngle(angle);
constant->SetPosition(wxPoint2DDouble(posX, posY));
constant->StartMove(constant->GetPosition());
-
+
constant->SetValue(value);
std::vector<Node*> nodeVector;
if(!OpenControlNodeList(constNode, nodeVector)) return false;
-
+
constant->SetNodeList(nodeVector);
constant->UpdatePoints();
elementList.push_back(constant);
constNode = constNode->next_sibling("Constant");
- } //}
-
+ } //}
+
//{ Exponential
auto expListNode = elementsNode->first_node("ExponentialList");
if(!expListNode) return false;
@@ -2151,7 +2186,7 @@ bool FileHanding::OpenControlElements(rapidxml::xml_document<>& doc,
double width = GetNodeValueDouble(size, "Width");
double height = GetNodeValueDouble(size, "Height");
double angle = GetNodeValueDouble(cadPropNode, "Angle");
-
+
auto value = expNode->first_node("Value");
double a = GetNodeValueDouble(value, "A");
double b = GetNodeValueDouble(value, "B");
@@ -2161,19 +2196,19 @@ bool FileHanding::OpenControlElements(rapidxml::xml_document<>& doc,
exponential->SetAngle(angle);
exponential->SetPosition(wxPoint2DDouble(posX, posY));
exponential->StartMove(exponential->GetPosition());
-
+
exponential->SetValues(a, b);
std::vector<Node*> nodeVector;
if(!OpenControlNodeList(expNode, nodeVector)) return false;
-
+
exponential->SetNodeList(nodeVector);
exponential->UpdatePoints();
elementList.push_back(exponential);
expNode = expNode->next_sibling("Exponential");
- } //}
-
+ } //}
+
//{ Gain
auto gainListNode = elementsNode->first_node("GainList");
if(!gainListNode) return false;
@@ -2192,7 +2227,7 @@ bool FileHanding::OpenControlElements(rapidxml::xml_document<>& doc,
double width = GetNodeValueDouble(size, "Width");
double height = GetNodeValueDouble(size, "Height");
double angle = GetNodeValueDouble(cadPropNode, "Angle");
-
+
double value = GetNodeValueDouble(gainNode, "Value");
gain->SetWidth(width);
@@ -2204,7 +2239,7 @@ bool FileHanding::OpenControlElements(rapidxml::xml_document<>& doc,
std::vector<Node*> nodeVector;
if(!OpenControlNodeList(gainNode, nodeVector)) return false;
-
+
gain->SetNodeList(nodeVector);
gain->UpdatePoints();
elementList.push_back(gain);
@@ -2212,7 +2247,7 @@ bool FileHanding::OpenControlElements(rapidxml::xml_document<>& doc,
gainNode = gainNode->next_sibling("Gain");
}
//}
-
+
//{ IO
auto ioListNode = elementsNode->first_node("IOList");
if(!ioListNode) return false;
@@ -2233,12 +2268,12 @@ bool FileHanding::OpenControlElements(rapidxml::xml_document<>& doc,
std::vector<Node*> nodeVector;
if(!OpenControlNodeList(ioNode, nodeVector)) return false;
-
+
IOControl::IOFlags value = static_cast<IOControl::IOFlags>(GetNodeValueInt(ioNode, "Value"));
int ioFlags = GetNodeValueInt(ioNode, "IOFlags");
-
+
IOControl* io = new IOControl(ioFlags, id);
-
+
io->SetWidth(width);
io->SetHeight(height);
io->SetAngle(angle);
@@ -2252,7 +2287,7 @@ bool FileHanding::OpenControlElements(rapidxml::xml_document<>& doc,
ioNode = ioNode->next_sibling("IO");
}
//}
-
+
//{ Limiter
auto limiterListNode = elementsNode->first_node("LimiterList");
if(!limiterListNode) return false;
@@ -2271,20 +2306,20 @@ bool FileHanding::OpenControlElements(rapidxml::xml_document<>& doc,
double width = GetNodeValueDouble(size, "Width");
double height = GetNodeValueDouble(size, "Height");
double angle = GetNodeValueDouble(cadPropNode, "Angle");
-
+
double upLimit = GetNodeValueDouble(limiterNode, "UpperLimit");
double lowLimit = GetNodeValueDouble(limiterNode, "LowerLimit");
std::vector<Node*> nodeVector;
if(!OpenControlNodeList(limiterNode, nodeVector)) return false;
-
+
limiter->SetWidth(width);
limiter->SetHeight(height);
limiter->SetAngle(angle);
limiter->SetPosition(wxPoint2DDouble(posX, posY));
limiter->SetUpLimit(upLimit);
limiter->SetLowLimit(lowLimit);
-
+
limiter->StartMove(limiter->GetPosition());
limiter->SetNodeList(nodeVector);
limiter->UpdatePoints();
@@ -2293,7 +2328,7 @@ bool FileHanding::OpenControlElements(rapidxml::xml_document<>& doc,
limiterNode = limiterNode->next_sibling("Limiter");
}
//}
-
+
//{ Multiplier
auto multiplierListNode = elementsNode->first_node("MultiplierList");
if(!multiplierListNode) return false;
@@ -2315,12 +2350,12 @@ bool FileHanding::OpenControlElements(rapidxml::xml_document<>& doc,
std::vector<Node*> nodeVector;
if(!OpenControlNodeList(multiplierNode, nodeVector)) return false;
-
+
multiplier->SetWidth(width);
multiplier->SetHeight(height);
multiplier->SetAngle(angle);
multiplier->SetPosition(wxPoint2DDouble(posX, posY));
-
+
multiplier->StartMove(multiplier->GetPosition());
multiplier->SetNodeList(nodeVector);
multiplier->UpdatePoints();
@@ -2329,7 +2364,7 @@ bool FileHanding::OpenControlElements(rapidxml::xml_document<>& doc,
multiplierNode = multiplierNode->next_sibling("Multiplier");
}
//}
-
+
//{ Rate limiter
auto rateLimiterListNode = elementsNode->first_node("RateLimiterList");
if(!rateLimiterListNode) return false;
@@ -2348,20 +2383,20 @@ bool FileHanding::OpenControlElements(rapidxml::xml_document<>& doc,
double width = GetNodeValueDouble(size, "Width");
double height = GetNodeValueDouble(size, "Height");
double angle = GetNodeValueDouble(cadPropNode, "Angle");
-
+
double upLimit = GetNodeValueDouble(rateLimiterNode, "UpperLimit");
double lowLimit = GetNodeValueDouble(rateLimiterNode, "LowerLimit");
std::vector<Node*> nodeVector;
if(!OpenControlNodeList(rateLimiterNode, nodeVector)) return false;
-
+
limiter->SetWidth(width);
limiter->SetHeight(height);
limiter->SetAngle(angle);
limiter->SetPosition(wxPoint2DDouble(posX, posY));
limiter->SetUpLimit(upLimit);
limiter->SetLowLimit(lowLimit);
-
+
limiter->StartMove(limiter->GetPosition());
limiter->SetNodeList(nodeVector);
limiter->UpdatePoints();
@@ -2370,7 +2405,7 @@ bool FileHanding::OpenControlElements(rapidxml::xml_document<>& doc,
rateLimiterNode = rateLimiterNode->next_sibling("RateLimiter");
}
//}
-
+
//{ Sum
auto sumListNode = elementsNode->first_node("SumList");
if(!sumListNode) return false;
@@ -2389,7 +2424,7 @@ bool FileHanding::OpenControlElements(rapidxml::xml_document<>& doc,
double width = GetNodeValueDouble(size, "Width");
double height = GetNodeValueDouble(size, "Height");
double angle = GetNodeValueDouble(cadPropNode, "Angle");
-
+
std::vector<Sum::Signal> signs;
auto signsNode = sumNode->first_node("Signs");
auto sign = signsNode->first_node("Value");
@@ -2403,12 +2438,12 @@ bool FileHanding::OpenControlElements(rapidxml::xml_document<>& doc,
std::vector<Node*> nodeVector;
if(!OpenControlNodeList(sumNode, nodeVector)) return false;
-
+
sum->SetWidth(width);
sum->SetHeight(height);
sum->SetAngle(angle);
sum->SetPosition(wxPoint2DDouble(posX, posY));
-
+
sum->StartMove(sum->GetPosition());
sum->SetNodeList(nodeVector);
sum->UpdatePoints();
@@ -2417,7 +2452,7 @@ bool FileHanding::OpenControlElements(rapidxml::xml_document<>& doc,
sumNode = sumNode->next_sibling("Sum");
}
//}
-
+
//{ Transfer function
auto tfListNode = elementsNode->first_node("TransferFunctionList");
if(!tfListNode) return false;
@@ -2436,7 +2471,7 @@ bool FileHanding::OpenControlElements(rapidxml::xml_document<>& doc,
double width = GetNodeValueDouble(size, "Width");
double height = GetNodeValueDouble(size, "Height");
double angle = GetNodeValueDouble(cadPropNode, "Angle");
-
+
std::vector<double> numerator, denominator;
auto numeratorNode = tfNode->first_node("Numerator");
auto nValue = numeratorNode->first_node("Value");
@@ -2453,24 +2488,24 @@ bool FileHanding::OpenControlElements(rapidxml::xml_document<>& doc,
wxString(dValue->value()).ToCDouble(&value);
denominator.push_back(value);
dValue = dValue->next_sibling("Value");
- }
+ }
std::vector<Node*> nodeVector;
if(!OpenControlNodeList(tfNode, nodeVector)) return false;
-
+
tf->SetWidth(width);
tf->SetHeight(height);
tf->SetAngle(angle);
tf->SetPosition(wxPoint2DDouble(posX, posY));
-
+
tf->SetNumerator(numerator);
tf->SetDenominator(denominator);
-
+
tf->StartMove(tf->GetPosition());
tf->SetNodeList(nodeVector);
-
+
tf->UpdateTFText();
-
+
elementList.push_back(tf);
tfNode = tfNode->next_sibling("TransferFunction");
@@ -2621,7 +2656,8 @@ void FileHanding::SetNodeAttribute(rapidxml::xml_document<>& doc,
const char* atrName,
int value)
{
- node->append_attribute(doc.allocate_attribute(atrName, doc.allocate_string(wxString::Format("%d", value).mb_str())));
+ node->append_attribute(
+ doc.allocate_attribute(atrName, doc.allocate_string(wxString::Format("%d", value).mb_str())));
}
void FileHanding::SetNodeAttribute(rapidxml::xml_document<>& doc,