1
0
Fork 0

Synced with latest JSBSim.

This commit is contained in:
curt 2001-07-13 16:41:23 +00:00
parent dae9b63a14
commit 26d12e4b69
3 changed files with 28 additions and 22 deletions

View file

@ -109,7 +109,7 @@ public:
/** Loads this model. /** Loads this model.
@param Config a pointer to the config file instance @param Config a pointer to the config file instance
@return true if model is successfully loaded*/ @return true if model is successfully loaded*/
virtual bool Load(FGConfigFile* Config) {} virtual bool Load(FGConfigFile* Config) {return true;}
FGModel* NextModel; FGModel* NextModel;
string Name; string Name;

View file

@ -35,6 +35,13 @@ HISTORY
INCLUDES INCLUDES
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#ifdef FGFS
# include <simgear/compiler.h>
# include STL_ALGORITHM
#else
# include <algorithm>
#endif
#include "FGNozzle.h" #include "FGNozzle.h"
static const char *IdSrc = "$Id$"; static const char *IdSrc = "$Id$";
@ -90,7 +97,7 @@ FGNozzle::~FGNozzle()
float FGNozzle::Calculate(float CfPc) float FGNozzle::Calculate(float CfPc)
{ {
float pAtm = fdmex->GetAtmosphere()->GetPressure(); float pAtm = fdmex->GetAtmosphere()->GetPressure();
Thrust = (CfPc * AreaT + (PE - pAtm)*Area2) * nzlEff; Thrust = max((float)0.0, (CfPc * AreaT + (PE - pAtm)*Area2) * nzlEff);
vFn(1) = Thrust; vFn(1) = Thrust;
return Thrust; return Thrust;

View file

@ -137,7 +137,7 @@ void FGTrim::TrimStats() {
cout << " Sub-iterations:" << endl; cout << " Sub-iterations:" << endl;
for(current_axis=0; current_axis<TrimAxes.size(); current_axis++) { for(current_axis=0; current_axis<TrimAxes.size(); current_axis++) {
run_sum+=TrimAxes[current_axis]->GetRunCount(); run_sum+=TrimAxes[current_axis]->GetRunCount();
sprintf(out," %5s: %3.0f average: %5.2f successful: %3.0f stability: %5.2f\n", snprintf(out,80," %5s: %3.0f average: %5.2f successful: %3.0f stability: %5.2f\n",
TrimAxes[current_axis]->GetStateName().c_str(), TrimAxes[current_axis]->GetStateName().c_str(),
sub_iterations[current_axis], sub_iterations[current_axis],
sub_iterations[current_axis]/float(total_its), sub_iterations[current_axis]/float(total_its),
@ -164,65 +164,64 @@ void FGTrim::ReportState(void) {
char out[80], flap[10], gear[10]; char out[80], flap[10], gear[10];
cout << endl << " JSBSim State" << endl; cout << endl << " JSBSim State" << endl;
sprintf(out," Weight: %7.0f lbs. CG: %5.1f, %5.1f, %5.1f inches\n", snprintf(out,80," Weight: %7.0f lbs. CG: %5.1f, %5.1f, %5.1f inches\n",
fdmex->GetMassBalance()->GetWeight(), fdmex->GetMassBalance()->GetWeight(),
fdmex->GetMassBalance()->GetXYZcg(1), fdmex->GetMassBalance()->GetXYZcg(1),
fdmex->GetMassBalance()->GetXYZcg(2), fdmex->GetMassBalance()->GetXYZcg(2),
fdmex->GetMassBalance()->GetXYZcg(3)); fdmex->GetMassBalance()->GetXYZcg(3));
cout << out; cout << out;
if( fdmex->GetFCS()->GetDfPos() <= 0.01) if( fdmex->GetFCS()->GetDfPos() <= 0.01)
sprintf(flap,"Up"); snprintf(flap,10,"Up");
else else
sprintf(flap,"%2.0f",fdmex->GetFCS()->GetDfPos()); snprintf(flap,10,"%2.0f",fdmex->GetFCS()->GetDfPos());
if(fdmex->GetAircraft()->GetGearUp() == true) if(fdmex->GetAircraft()->GetGearUp() == true)
sprintf(gear,"Up"); snprintf(gear,10,"Up");
else else
sprintf(gear,"Down"); snprintf(gear,10,"Down");
sprintf(out, " Flaps: %3s Gear: %4s\n",flap,gear); snprintf(out,80, " Flaps: %3s Gear: %4s\n",flap,gear);
cout << out; cout << out;
sprintf(out, " Speed: %4.0f KCAS Mach: %5.2f\n", snprintf(out,80, " Speed: %4.0f KCAS Mach: %5.2f\n",
fdmex->GetAuxiliary()->GetVcalibratedKTS(), fdmex->GetAuxiliary()->GetVcalibratedKTS(),
fdmex->GetState()->GetParameter(FG_MACH), fdmex->GetState()->GetParameter(FG_MACH) );
fdmex->GetPosition()->Geth() );
cout << out; cout << out;
sprintf(out, " Altitude: %7.0f ft. AGL Altitude: %7.0f ft.\n", snprintf(out,80, " Altitude: %7.0f ft. AGL Altitude: %7.0f ft.\n",
fdmex->GetPosition()->Geth(), fdmex->GetPosition()->Geth(),
fdmex->GetPosition()->GetDistanceAGL() ); fdmex->GetPosition()->GetDistanceAGL() );
cout << out; cout << out;
sprintf(out, " Angle of Attack: %6.2f deg Pitch Angle: %6.2f deg\n", snprintf(out,80, " Angle of Attack: %6.2f deg Pitch Angle: %6.2f deg\n",
fdmex->GetState()->GetParameter(FG_ALPHA)*RADTODEG, fdmex->GetState()->GetParameter(FG_ALPHA)*RADTODEG,
fdmex->GetRotation()->Gettht()*RADTODEG ); fdmex->GetRotation()->Gettht()*RADTODEG );
cout << out; cout << out;
sprintf(out, " Flight Path Angle: %6.2f deg Climb Rate: %5.0f ft/min\n", snprintf(out,80, " Flight Path Angle: %6.2f deg Climb Rate: %5.0f ft/min\n",
fdmex->GetPosition()->GetGamma()*RADTODEG, fdmex->GetPosition()->GetGamma()*RADTODEG,
fdmex->GetPosition()->Gethdot()*60 ); fdmex->GetPosition()->Gethdot()*60 );
cout << out; cout << out;
sprintf(out, " Normal Load Factor: %4.2f g's Pitch Rate: %5.2f deg/s\n", snprintf(out,80, " Normal Load Factor: %4.2f g's Pitch Rate: %5.2f deg/s\n",
fdmex->GetAerodynamics()->GetNlf(), fdmex->GetAerodynamics()->GetNlf(),
fdmex->GetState()->GetParameter(FG_PITCHRATE)*RADTODEG ); fdmex->GetState()->GetParameter(FG_PITCHRATE)*RADTODEG );
cout << out; cout << out;
sprintf(out, " Heading: %3.0f deg true Sideslip: %5.2f deg\n", snprintf(out,80, " Heading: %3.0f deg true Sideslip: %5.2f deg\n",
fdmex->GetRotation()->Getpsi()*RADTODEG, fdmex->GetRotation()->Getpsi()*RADTODEG,
fdmex->GetState()->GetParameter(FG_BETA)*RADTODEG ); fdmex->GetState()->GetParameter(FG_BETA)*RADTODEG );
cout << out; cout << out;
sprintf(out, " Bank Angle: %5.2f deg\n", snprintf(out,80, " Bank Angle: %5.2f deg\n",
fdmex->GetRotation()->Getphi()*RADTODEG ); fdmex->GetRotation()->Getphi()*RADTODEG );
cout << out; cout << out;
sprintf(out, " Elevator: %5.2f deg Left Aileron: %5.2f deg Rudder: %5.2f deg\n", snprintf(out,80, " Elevator: %5.2f deg Left Aileron: %5.2f deg Rudder: %5.2f deg\n",
fdmex->GetState()->GetParameter(FG_ELEVATOR_POS)*RADTODEG, fdmex->GetState()->GetParameter(FG_ELEVATOR_POS)*RADTODEG,
fdmex->GetState()->GetParameter(FG_AILERON_POS)*RADTODEG, fdmex->GetState()->GetParameter(FG_AILERON_POS)*RADTODEG,
fdmex->GetState()->GetParameter(FG_RUDDER_POS)*RADTODEG ); fdmex->GetState()->GetParameter(FG_RUDDER_POS)*RADTODEG );
cout << out; cout << out;
sprintf(out, " Throttle: %5.2f%c\n", snprintf(out,80, " Throttle: %5.2f%c\n",
fdmex->GetFCS()->GetThrottlePos(0),'%' ); fdmex->GetFCS()->GetThrottlePos(0),'%' );
cout << out; cout << out;
sprintf(out, " Wind Components: %5.2f kts head wind, %5.2f kts cross wind\n", snprintf(out,80, " Wind Components: %5.2f kts head wind, %5.2f kts cross wind\n",
fdmex->GetAuxiliary()->GetHeadWind()*jsbFPSTOKTS, fdmex->GetAuxiliary()->GetHeadWind()*jsbFPSTOKTS,
fdmex->GetAuxiliary()->GetCrossWind()*jsbFPSTOKTS ); fdmex->GetAuxiliary()->GetCrossWind()*jsbFPSTOKTS );
cout << out; cout << out;
sprintf(out, " Ground Speed: %4.0f knots , Ground Track: %3.0f deg true\n", snprintf(out,80, " Ground Speed: %4.0f knots , Ground Track: %3.0f deg true\n",
fdmex->GetPosition()->GetVground()*jsbFPSTOKTS, fdmex->GetPosition()->GetVground()*jsbFPSTOKTS,
fdmex->GetPosition()->GetGroundTrack()*RADTODEG ); fdmex->GetPosition()->GetGroundTrack()*RADTODEG );
cout << out; cout << out;