GearCmd = GearPos = 1; // default to gear down
LeftBrake = RightBrake = CenterBrake = 0.0;
- if (debug_lvl & 2) cout << "Instantiated: " << Name << endl;
+ Debug(0);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ThrottlePos.clear();
MixtureCmd.clear();
MixturePos.clear();
- PropPitchCmd.clear();
- PropPitchPos.clear();
+ PropAdvanceCmd.clear();
+ PropAdvance.clear();
unsigned int i;
for (i=0;i<Components.size();i++) delete Components[i];
- if (debug_lvl & 2) cout << "Destroyed: FGFCS" << endl;
+ Debug(1);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if (!FGModel::Run()) {
for (i=0; i<ThrottlePos.size(); i++) ThrottlePos[i] = ThrottleCmd[i];
for (i=0; i<MixturePos.size(); i++) MixturePos[i] = MixtureCmd[i];
- for (i=0; i<PropPitchPos.size(); i++) PropPitchPos[i] = PropPitchCmd[i];
+ for (i=0; i<PropAdvance.size(); i++) PropAdvance[i] = PropAdvanceCmd[i];
for (i=0; i<Components.size(); i++) Components[i]->Run();
} else {
}
} else {
cerr << "Throttle " << engineNum << " does not exist! " << ThrottleCmd.size()
<< " engines exist, but throttle setting for engine " << engineNum
- << " is selected" << endl;
+ << " is selected" << endl;
}
return 0.0;
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-void FGFCS::SetPropPitchCmd(int engineNum, double setting)
+void FGFCS::SetPropAdvanceCmd(int engineNum, double setting)
{
unsigned int ctr;
if (engineNum < (int)ThrottlePos.size()) {
if (engineNum < 0) {
- for (ctr=0;ctr<PropPitchCmd.size();ctr++) PropPitchCmd[ctr] = setting;
+ for (ctr=0;ctr<PropAdvanceCmd.size();ctr++) PropAdvanceCmd[ctr] = setting;
} else {
- PropPitchCmd[engineNum] = setting;
+ PropAdvanceCmd[engineNum] = setting;
}
}
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-void FGFCS::SetPropPitchPos(int engineNum, double setting)
+void FGFCS::SetPropAdvance(int engineNum, double setting)
{
unsigned int ctr;
if (engineNum < (int)ThrottlePos.size()) {
if (engineNum < 0) {
- for (ctr=0;ctr<=PropPitchCmd.size();ctr++) PropPitchPos[ctr] = PropPitchCmd[ctr];
+ for (ctr=0;ctr<=PropAdvanceCmd.size();ctr++) PropAdvance[ctr] = PropAdvanceCmd[ctr];
} else {
- PropPitchPos[engineNum] = setting;
+ PropAdvance[engineNum] = setting;
}
}
}
token = AC_cfg->GetValue("TYPE");
if (debug_lvl > 0) cout << " Loading Component \""
<< AC_cfg->GetValue("NAME")
- << "\" of type: " << token << endl;
+ << "\" of type: " << token << endl;
if ((token == "LAG_FILTER") ||
(token == "LEAD_LAG_FILTER") ||
(token == "SECOND_ORDER_FILTER") ||
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-double FGFCS::GetBrake(FGLGear::BrakeGroup bg) {
+double FGFCS::GetBrake(FGLGear::BrakeGroup bg)
+{
switch (bg) {
case FGLGear::bgLeft:
return LeftBrake;
string FGFCS::GetComponentStrings(void)
{
unsigned int comp;
-
string CompStrings = "";
bool firstime = true;
string FGFCS::GetComponentValues(void)
{
unsigned int comp;
-
string CompValues = "";
char buffer[10];
bool firstime = true;
{
ThrottleCmd.push_back(0.0);
ThrottlePos.push_back(0.0);
- MixtureCmd.push_back(0.0); // assume throttle and mixture are coupled
+ MixtureCmd.push_back(0.0); // assume throttle and mixture are coupled
MixturePos.push_back(0.0);
- PropPitchCmd.push_back(0.0); // assume throttle and prop pitch are coupled
- PropPitchPos.push_back(0.0);
+ PropAdvanceCmd.push_back(0.0); // assume throttle and prop pitch are coupled
+ PropAdvance.push_back(0.0);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-void FGFCS::Debug(void)
+// The bitmasked value choices are as follows:
+// unset: In this case (the default) JSBSim would only print
+// out the normally expected messages, essentially echoing
+// the config files as they are read. If the environment
+// variable is not set, debug_lvl is set to 1 internally
+// 0: This requests JSBSim not to output any messages
+// whatsoever.
+// 1: This value explicity requests the normal JSBSim
+// startup messages
+// 2: This value asks for a message to be printed out when
+// a class is instantiated
+// 4: When this value is set, a message is displayed when a
+// FGModel object executes its Run() method
+// 8: When this value is set, various runtime state variables
+// are printed out periodically
+// 16: When set various parameters are sanity checked and
+// a message is printed out when they go out of bounds
+
+void FGFCS::Debug(int from)
{
- //TODO: Add your source code here
-}
+ if (debug_lvl <= 0) return;
+
+ if (debug_lvl & 1) { // Standard console startup message output
+ if (from == 0) { // Constructor
+ }
+ }
+ if (debug_lvl & 2 ) { // Instantiation/Destruction notification
+ if (from == 0) cout << "Instantiated: FGFCS" << endl;
+ if (from == 1) cout << "Destroyed: FGFCS" << endl;
+ }
+ if (debug_lvl & 4 ) { // Run() method entry print for FGModel-derived objects
+ }
+ if (debug_lvl & 8 ) { // Runtime state variables
+ }
+ if (debug_lvl & 16) { // Sanity checking
+ }
+}