namespace JSBSim {
-static const char *IdSrc = "$Id: FGFDMExec.cpp,v 1.114 2011/09/11 11:36:04 bcoconni Exp $";
+static const char *IdSrc = "$Id: FGFDMExec.cpp,v 1.115 2011/09/25 11:56:00 bcoconni Exp $";
static const char *IdHdr = ID_FDMEXEC;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
LoadInputs(eAtmosphere);
Atmosphere->Run(false);
Winds->SetWindNED( FGIC->GetWindNFpsIC(),
- FGIC->GetWindEFpsIC(),
- FGIC->GetWindDFpsIC() );
+ FGIC->GetWindEFpsIC(),
+ FGIC->GetWindDFpsIC() );
Auxiliary->Run(false);
}
result = Output->Load(0);
if (result) {
+ Output->Run(holding);
Outputs.push_back(Output);
typedef double (FGOutput::*iOPMF)(void) const;
string outputProp = CreateIndexedPropertyName("simulation/output",Outputs.size()-1);
instance->Tie(outputProp+"/log_rate_hz", Output, (iOPMF)0, &FGOutput::SetRate, false);
}
+ else
+ delete Output;
return result;
}
namespace JSBSim {
-static const char *IdSrc = "$Id: FGFCS.cpp,v 1.76 2011/08/14 20:15:56 jberndt Exp $";
+static const char *IdSrc = "$Id: FGFCS.cpp,v 1.77 2011/09/25 14:05:40 bcoconni Exp $";
static const char *IdHdr = ID_FCS;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
channel_element = document->FindNextElement("channel");
}
+ PostLoad(document, PropertyManager);
+
ResetParser();
return true;
namespace JSBSim {
-static const char *IdSrc = "$Id: FGOutput.cpp,v 1.60 2011/09/11 11:36:04 bcoconni Exp $";
+static const char *IdSrc = "$Id: FGOutput.cpp,v 1.62 2011/09/25 15:38:30 bcoconni Exp $";
static const char *IdHdr = ID_OUTPUT;
// (stolen from FGFS native_fdm.cxx)
if (!document) return false;
- name = FDMExec->GetRootDir() + document->GetAttributeValue("name");
SetType(document->GetAttributeValue("type"));
+
+ name = document->GetAttributeValue("name");
+ if (((Type == otCSV) || (Type == otTab)) && (name != "cout") && (name !="COUT"))
+ name = FDMExec->GetRootDir() + name;
+
Port = document->GetAttributeValue("port");
if (!Port.empty() && (Type == otSocket || Type == otFlightGear)) {
port = atoi(Port.c_str());
namespace JSBSim {
-static const char *IdSrc = "$Id: FGStandardAtmosphere.cpp,v 1.19 2011/09/11 11:36:04 bcoconni Exp $";
+static const char *IdSrc = "$Id: FGStandardAtmosphere.cpp,v 1.20 2011/09/18 12:06:21 bcoconni Exp $";
static const char *IdHdr = ID_STANDARDATMOSPHERE;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
(PMF)&FGStandardAtmosphere::SetTemperatureBias);
PropertyManager->Tie("atmosphere/SL-graded-delta-T", this, eRankine,
(PMFi)&FGStandardAtmosphere::GetTemperatureDeltaGradient,
- (PMF)&FGStandardAtmosphere::SetSLTemperatureGradedDelta);
+ (PMF)&FGStandardAtmosphere::SetSLTemperatureGradedDelta);
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DEFINITIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#define ID_STANDARDATMOSPHERE "$Id: FGStandardAtmosphere.h,v 1.15 2011/08/17 23:56:01 jberndt Exp $"
+#define ID_STANDARDATMOSPHERE "$Id: FGStandardAtmosphere.h,v 1.16 2011/09/18 12:06:21 bcoconni Exp $"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
@author Jon Berndt
@see "U.S. Standard Atmosphere, 1976", NASA TM-X-74335
- @version $Id: FGStandardAtmosphere.h,v 1.15 2011/08/17 23:56:01 jberndt Exp $
+ @version $Id: FGStandardAtmosphere.h,v 1.16 2011/09/18 12:06:21 bcoconni Exp $
*/
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
virtual double GetStdTemperatureRatio(double h) const { return GetStdTemperature(h)*rSLtemperature; }
/// Returns the temperature bias over the sea level value in degrees Rankine.
- virtual double GetTemperatureBias(eTemperature to) const {return TemperatureBias;}
+ virtual double GetTemperatureBias(eTemperature to) const
+ { if (to == eCelsius || to == eKelvin) return TemperatureBias/1.80; else return TemperatureBias; }
/// Returns the temperature gradient to be applied on top of the standard
/// temperature gradient.
- virtual double GetTemperatureDeltaGradient() { return TemperatureDeltaGradient;}
+ virtual double GetTemperatureDeltaGradient(eTemperature to)
+ { if (to == eCelsius || to == eKelvin) return TemperatureDeltaGradient/1.80; else return TemperatureDeltaGradient; }
/// Sets the Sea Level temperature, if it is to be different than the standard.
/// This function will calculate a bias - a difference - from the standard
double
T_V = in.totalDeltaT, // for compatibility of nomenclature
sig_p = 1.9/sqrt(L_w*b_w)*sig_w, // Yeager1998, eq. (8)
+<<<<<<< FGWinds.cpp
+// sig_q = sqrt(M_PI/2/L_w/b_w), // eq. (14)
+/// sig_r = sqrt(2*M_PI/3/L_w/b_w), // eq. (17)
+=======
//sig_q = sqrt(M_PI/2/L_w/b_w), // eq. (14)
//sig_r = sqrt(2*M_PI/3/L_w/b_w), // eq. (17)
+>>>>>>> 1.5
L_p = sqrt(L_w*b_w)/2.6, // eq. (10)
tau_u = L_u/in.V, // eq. (6)
tau_w = L_w/in.V, // eq. (3)
namespace JSBSim {
-static const char *IdSrc = "$Id: FGPiston.cpp,v 1.65 2011/09/11 12:06:54 bcoconni Exp $";
+static const char *IdSrc = "$Id: FGPiston.cpp,v 1.67 2011/09/25 23:56:11 jentron Exp $";
static const char *IdHdr = ID_PISTON;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
PropertyManager->Tie(property_name, &BoostSpeed);
property_name = base_property_name + "/cht-degF";
PropertyManager->Tie(property_name, this, &FGPiston::getCylinderHeadTemp_degF);
- property_name = base_property_name + "/engine-rpm";
- PropertyManager->Tie(property_name, this, &FGPiston::getRPM);
property_name = base_property_name + "/oil-temperature-degF";
PropertyManager->Tie(property_name, this, &FGPiston::getOilTemp_degF);
property_name = base_property_name + "/oil-pressure-psi";
RunPreFunctions();
- RPM = Thruster->GetRPM() * Thruster->GetGearRatio();
+/* The thruster controls the engine RPM because it encapsulates the gear ratio and other transmission variables */
+ RPM = Thruster->GetEngineRPM();
+
MeanPistonSpeed_fps = ( RPM * Stroke) / (360); // AKA 2 * (RPM/60) * ( Stroke / 12) or 2NS
IAS = in.Vc;
double FGPiston::CalcFuelNeed(void)
{
FuelExpended = FuelFlowRate * in.TotalDeltaT;
+ if (!Starved) FuelUsedLbs += FuelExpended;
return FuelExpended;
}
namespace JSBSim {
-static const char *IdSrc = "$Id: FGPropeller.cpp,v 1.37 2011/09/11 12:06:54 bcoconni Exp $";
+static const char *IdSrc = "$Id: FGPropeller.cpp,v 1.38 2011/09/24 14:26:46 jentron Exp $";
static const char *IdHdr = ID_PROPELLER;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
string property_name, base_property_name;
base_property_name = CreateIndexedPropertyName("propulsion/engine", EngineNum);
+ property_name = base_property_name + "/engine-rpm";
+ PropertyManager->Tie( property_name.c_str(), this, &FGPropeller::GetEngineRPM );
property_name = base_property_name + "/advance-ratio";
PropertyManager->Tie( property_name.c_str(), &J );
property_name = base_property_name + "/blade-angle";
DEFINITIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#define ID_PROPELLER "$Id: FGPropeller.h,v 1.18 2011/06/06 22:39:52 jentron Exp $"
+#define ID_PROPELLER "$Id: FGPropeller.h,v 1.19 2011/09/24 14:26:46 jentron Exp $"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
<li>Various NACA Technical Notes and Reports</li>
</ul>
@author Jon S. Berndt
- @version $Id: FGPropeller.h,v 1.18 2011/06/06 22:39:52 jentron Exp $
+ @version $Id: FGPropeller.h,v 1.19 2011/09/24 14:26:46 jentron Exp $
@see FGEngine
@see FGThruster
*/
@param rpm the rotational velocity of the propeller */
void SetRPM(double rpm) {RPM = rpm;}
+ /** Sets the Revolutions Per Minute for the propeller using the engine gear ratio **/
+ void SetEngineRPM(double rpm) {RPM = rpm/GearRatio;}
+
/// Returns true of this propeller is variable pitch
bool IsVPitch(void) {return MaxPitch != MinPitch;}
/// Retrieves the RPMs of the propeller
double GetRPM(void) const { return RPM; }
+ /// Calculates the RPMs of the engine based on gear ratio
+ double GetEngineRPM(void) const { return RPM * GearRatio; }
+
/// Retrieves the propeller moment of inertia
double GetIxx(void) { return Ixx; }
namespace JSBSim {
-static const char *IdSrc = "$Id: FGRotor.cpp,v 1.16 2011/09/17 16:39:19 bcoconni Exp $";
+static const char *IdSrc = "$Id: FGRotor.cpp,v 1.17 2011/09/24 14:26:46 jentron Exp $";
static const char *IdHdr = ID_ROTOR;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
property_name = base_property_name + "/rotor-rpm";
PropertyManager->Tie( property_name.c_str(), this, &FGRotor::GetRPM );
- property_name = base_property_name + "/x-engine-rpm"; // used for RPM eXchange
+ property_name = base_property_name + "/engine-rpm";
PropertyManager->Tie( property_name.c_str(), this, &FGRotor::GetEngineRPM );
property_name = base_property_name + "/rotor-thrust-lbs"; // might be redundant - check!
ExtRPMsource = PropertyManager->GetNode(property_name, true);
} else if (RPMdefinition >= 0 && RPMdefinition != EngineNum) {
string ipn = CreateIndexedPropertyName("propulsion/engine", RPMdefinition);
- property_name = ipn + "/x-engine-rpm";
+ property_name = ipn + "/engine-rpm";
ExtRPMsource = PropertyManager->GetNode(property_name, false);
if (! ExtRPMsource) {
cerr << "# Warning: Engine number " << EngineNum << "." << endl;
- cerr << "# No 'x-engine-rpm' property found for engine " << RPMdefinition << "." << endl;
+ cerr << "# No 'engine-rpm' property found for engine " << RPMdefinition << "." << endl;
cerr << "# Please check order of engine definitons." << endl;
}
} else {
DEFINITIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#define ID_ROTOR "$Id: FGRotor.h,v 1.10 2011/09/17 16:39:19 bcoconni Exp $"
+#define ID_ROTOR "$Id: FGRotor.h,v 1.11 2011/09/24 14:26:46 jentron Exp $"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
</dl>
@author Thomas Kreitler
- @version $Id: FGRotor.h,v 1.10 2011/09/17 16:39:19 bcoconni Exp $
+ @version $Id: FGRotor.h,v 1.11 2011/09/24 14:26:46 jentron Exp $
*/
/// Retrieves the RPMs of the rotor.
double GetRPM(void) const { return RPM; }
-
- // void SetRPM(double rpm) { RPM = rpm; }
+ void SetRPM(double rpm) { RPM = rpm; }
/// Retrieves the RPMs of the Engine, as seen from this rotor.
double GetEngineRPM(void) const { return GearRatio*RPM; } // bit of a hack.
+ void SetEngineRPM(double rpm) { RPM = rpm/GearRatio; } // bit of a hack.
/// Tells the rotor's gear ratio, usually the engine asks for this.
double GetGearRatio(void) { return GearRatio; }
/// Retrieves the thrust of the rotor.
namespace JSBSim {
-static const char *IdSrc = "$Id: FGTank.cpp,v 1.31 2011/08/03 03:21:06 jberndt Exp $";
+static const char *IdSrc = "$Id: FGTank.cpp,v 1.32 2011/09/18 13:04:34 bcoconni Exp $";
static const char *IdHdr = ID_TANK;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-const double FGTank::GetXYZ(int idx)
+double FGTank::GetXYZ(int idx)
{
return vXYZ_drain(idx) + (Contents/Capacity)*(vXYZ(idx)-vXYZ_drain(idx));
}
DEFINITIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#define ID_TANK "$Id: FGTank.h,v 1.24 2011/08/03 03:21:06 jberndt Exp $"
+#define ID_TANK "$Id: FGTank.h,v 1.25 2011/09/18 13:04:34 bcoconni Exp $"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
void SetExternalFlow(double f) { ExternalFlow = f; }
const FGColumnVector3 GetXYZ(void);
- const double GetXYZ(int idx);
+ double GetXYZ(int idx);
const GrainType GetGrainType(void) {return grainType;}
DEFINITIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#define ID_THRUSTER "$Id: FGThruster.h,v 1.17 2011/08/03 03:21:06 jberndt Exp $"
+#define ID_THRUSTER "$Id: FGThruster.h,v 1.18 2011/09/24 14:26:46 jentron Exp $"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
1.57 (pi/2) results in no thrust at all.
@author Jon Berndt
- @version $Id: FGThruster.h,v 1.17 2011/08/03 03:21:06 jberndt Exp $
+ @version $Id: FGThruster.h,v 1.18 2011/09/24 14:26:46 jentron Exp $
*/
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
}
void SetName(string name) {Name = name;}
virtual void SetRPM(double rpm) {};
+ virtual void SetEngineRPM(double rpm) {};
virtual double GetPowerRequired(void) {return 0.0;}
virtual void SetdeltaT(double dt) {deltaT = dt;}
double GetThrust(void) const {return Thrust;}
double GetClutchCtrl(void) const { return ClutchCtrlNorm; }
void SetClutchCtrl(double c) { ClutchCtrlNorm = c; }
virtual double GetRPM(void) const { return 0.0; };
+ virtual double GetEngineRPM(void) const { return 0.0; };
double GetGearRatio(void) {return GearRatio; }
virtual string GetThrusterLabels(int id, string delimeter);
virtual string GetThrusterValues(int id, string delimeter);
namespace JSBSim {
-static const char *IdSrc = "$Id: FGTurbine.cpp,v 1.35 2011/08/04 13:45:42 jberndt Exp $";
+static const char *IdSrc = "$Id: FGTurbine.cpp,v 1.36 2011/09/25 23:56:11 jentron Exp $";
static const char *IdHdr = ID_TURBINE;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
{
FuelFlowRate = FuelFlow_pph / 3600.0; // Calculates flow in lbs/sec from lbs/hr
FuelExpended = FuelFlowRate * in.TotalDeltaT; // Calculates fuel expended in this time step
+ if (!Starved) FuelUsedLbs += FuelExpended;
return FuelExpended;
}
namespace JSBSim {
-static const char *IdSrc = "$Id: FGTurboProp.cpp,v 1.22 2011/08/04 13:45:42 jberndt Exp $";
+static const char *IdSrc = "$Id: FGTurboProp.cpp,v 1.24 2011/09/25 23:56:11 jentron Exp $";
static const char *IdHdr = ID_TURBOPROP;
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ThrottlePos = in.ThrottlePos[EngineNumber];
- RPM = Thruster->GetRPM() * Thruster->GetGearRatio();
+/* The thruster controls the engine RPM because it encapsulates the gear ratio and other transmission variables */
+ RPM = Thruster->GetEngineRPM();
if (thrusterType == FGThruster::ttPropeller) {
((FGPropeller*)Thruster)->SetAdvance(in.PropAdvance[EngineNumber]);
((FGPropeller*)Thruster)->SetFeather(in.PropFeather[EngineNumber]);
{
FuelFlowRate = FuelFlow_pph / 3600.0;
FuelExpended = FuelFlowRate * in.TotalDeltaT;
+ if (!Starved) FuelUsedLbs += FuelExpended;
return FuelExpended;
}