Example #1
0
bool Atlantis_SRB::Ignite ()
{
	if (GetPropellantMass (ph_main) == SRB_MAX_PROPELLANT_MASS) {
		SetThrusterLevel (th_main, 1.0);
		t0 = oapiGetSimTime();
		bMainEngine = true;
		if (launchelev) {
			SetTouchdownPoints (tdvtx, ntdvtx); // reset touchdown  points
			SetSize (23.0);
		}
		return true;
	}
	return false;
}
Example #2
0
void G422::simEngines(double &dT, APU &eng)
{

	if (eng.state == APU::ENG_INOP) return;
	//


	if (eng.feed & APU::FUEL_PUMP) // simulate fuel line pressure from pumps
	{
		if (eng.fuelPrs < 1.0) {
			double deltaPrs = .22 * dT;
			eng.fuelPrs = min(eng.fuelPrs + deltaPrs, 1.0);
		}
	} else
	{
		if (eng.fuelPrs >  0.0) {
			double deltaPrs = -.12 * (1.0 - eng.pwrPct * .5) * dT;
			eng.fuelPrs = max(eng.fuelPrs + deltaPrs, 0.0);
		}
	}

	double fuelLvl = GetPropellantMass(fuel_sys);

	if (fuelLvl < .001) 
	{
		eng.fuelPrs = 0.0;
		return cueEngines(eng, APU::ENG_STOP);
	}


	switch(eng.state)
	{
	case APU::ENG_RUN:
		//
		// ?? whatever apu does... (just noise for now...)
		PlayVesselWave3(SFXID, SFX_APU_RUN, NOLOOP);
		SetPropellantMass(fuel_sys, fuelLvl - APU_FUEL_RATE * dT);


		return;

	case APU::ENG_START:
		//
		eng.pwrPct += 0.28 * dT;
		if (eng.pwrPct >= 1.0)
		{
			eng.pwrPct = 1.0;
			cueEngines(apu, APU::ENG_RUN);
		}
		return;

	case APU::ENG_STOP:
		eng.pwrPct -= 0.12 * dT;
		if (eng.pwrPct <= 0.0)
		{
			eng.pwrPct = 0.0;
			cueEngines(apu, APU::ENG_INOP);
		}
		return;

	}

}