]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/FGFactorGroup.cpp
Updated to match changes in radiostack.[ch]xx
[flightgear.git] / src / FDM / JSBSim / FGFactorGroup.cpp
index 5b3e0b9a07510fbf18d5b349d0c44e4326eddd0e..9d96439eacb57bac824d5a36e3756d83607f465c 100644 (file)
@@ -70,7 +70,7 @@ CLASS IMPLEMENTATION
 FGFactorGroup::FGFactorGroup( FGFDMExec* fdmex ) : FGCoefficient( fdmex)
 {
   FDMExec = fdmex;
-
+  totalValue = 0;
   Debug(0);
 }  
 
@@ -115,16 +115,42 @@ bool FGFactorGroup::Load(FGConfigFile *AC_cfg)
 double FGFactorGroup::TotalValue(void)
 {
   unsigned int i;
-  double totalsum = 0;
   SDtotal = 0.0;
+  totalValue = 0.0;
   for (i=0; i<sum.size(); i++) {
-     totalsum += sum[i]->TotalValue();
+     totalValue += sum[i]->TotalValue();
      SDtotal += sum[i]->GetSD();
   }
-  totalsum *= FGCoefficient::TotalValue();
+  totalValue *= FGCoefficient::TotalValue();
   SDtotal *= FGCoefficient::GetSD();
   Debug(2);
-  return totalsum;
+  return totalValue;
+}
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+
+void FGFactorGroup::bind(FGPropertyManager* parent)
+{
+  unsigned i;
+  node=parent->GetNode(name,true);
+  node->SetString("description",description);
+  FGCoefficient::bind(node);
+  for (i=0; i < sum.size(); i++) { 
+    sum[i]->bind(node);
+  } 
+  node=(FGPropertyManager*)node->getParent();                                         
+
+}
+
+/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
+  
+void FGFactorGroup::unbind(void)
+{
+  unsigned i;
+  FGCoefficient::unbind();
+  for (i=0; i < sum.size(); i++) { 
+    sum[i]->unbind();
+  } 
 }
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
@@ -166,4 +192,11 @@ void FGFactorGroup::Debug(int from)
   }
   if (debug_lvl & 16) { // Sanity checking
   }
+  if (debug_lvl & 64) {
+    if (from == 0) { // Constructor
+      cout << IdSrc << endl;
+      cout << IdHdr << endl;
+    }
+  }
 }
+