1
0
Fork 0

[JSBSim] Tentative fix for initialization issues reported in the ML.

Nodes might be uninitialized when a channel is initailly disabled. To work around that issue, the initialization of the output nodes is forced at creation.
This commit is contained in:
Bertrand Coconnier 2019-11-17 17:51:19 +01:00
parent 88ca381e83
commit 9782d9e65a

View file

@ -130,11 +130,13 @@ FGFCSComponent::FGFCSComponent(FGFCS* _fcs, Element* element) : fcs(_fcs)
while (out_elem) { while (out_elem) {
string output_node_name = out_elem->GetDataLine(); string output_node_name = out_elem->GetDataLine();
FGPropertyNode* OutputNode = PropertyManager->GetNode( output_node_name, true ); FGPropertyNode* OutputNode = PropertyManager->GetNode( output_node_name, true );
OutputNodes.push_back(OutputNode);
if (!OutputNode) { if (!OutputNode) {
cerr << endl << " Unable to process property: " << output_node_name << endl; cerr << out_elem->ReadFrom() << " Unable to process property: "
<< output_node_name << endl;
throw(string("Invalid output property name in flight control definition")); throw(string("Invalid output property name in flight control definition"));
} }
OutputNodes.push_back(OutputNode);
OutputNode->setDoubleValue(Output); // Initialize the output node to a sensible value
out_elem = element->FindNextElement("output"); out_elem = element->FindNextElement("output");
} }