From 9782d9e65a92f7e8e233c2907f8da79b19122d13 Mon Sep 17 00:00:00 2001 From: Bertrand Coconnier Date: Sun, 17 Nov 2019 17:51:19 +0100 Subject: [PATCH] [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. --- src/FDM/JSBSim/models/flight_control/FGFCSComponent.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/FDM/JSBSim/models/flight_control/FGFCSComponent.cpp b/src/FDM/JSBSim/models/flight_control/FGFCSComponent.cpp index 16d6a59cc..b2f76096b 100644 --- a/src/FDM/JSBSim/models/flight_control/FGFCSComponent.cpp +++ b/src/FDM/JSBSim/models/flight_control/FGFCSComponent.cpp @@ -130,11 +130,13 @@ FGFCSComponent::FGFCSComponent(FGFCS* _fcs, Element* element) : fcs(_fcs) while (out_elem) { string output_node_name = out_elem->GetDataLine(); FGPropertyNode* OutputNode = PropertyManager->GetNode( output_node_name, true ); - OutputNodes.push_back(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")); } + OutputNodes.push_back(OutputNode); + OutputNode->setDoubleValue(Output); // Initialize the output node to a sensible value out_elem = element->FindNextElement("output"); }