예제 #1
0
void ICPClass::FlarePGM(void)
{
	//Line1
	FillDEDMatrix(0,6,"CMDS  FLARE  PGM");
	ShowFlareIndex(0,22);
	//Line2
	FillDEDMatrix(1,10,"BQ");
	if(BQ)
	{
		PossibleInputs = 2;
		ScratchPad(1,13,16);
	}
	else
	{
		if(iFLARE_BQ[FPI] <= 0)
			sprintf(tempstr," 0");
		else
			sprintf(tempstr,"%2.0d",iFLARE_BQ[FPI]);
		FillDEDMatrix(1,14,tempstr);
	}
	//Line3
	FillDEDMatrix(2,10,"BI");
	if(BI)
	{
		PossibleInputs = 5;
		ScratchPad(2,13,20);
	}
	else
	{
		sprintf(tempstr,"%1.3f",fFLARE_BI[FPI]);
		FillDEDMatrix(2,15,tempstr);
	}
	//Line4
	FillDEDMatrix(3,10,"SQ");
	if(SQ)
	{
		PossibleInputs = 2;
		ScratchPad(3,13,16);
	}
	else
	{
		if(iFLARE_SQ[FPI] <= 0)
			sprintf(tempstr," 0");
		else
			sprintf(tempstr,"%2.0d",iFLARE_SQ[FPI]);
		FillDEDMatrix(3,14,tempstr);
	}
	//Line5
	FillDEDMatrix(4,10,"SI");
	if(SI)
	{
		PossibleInputs = 5;
		ScratchPad(4,13,19);
	}
	else
	{
		sprintf(tempstr,"%1.2f",fFLARE_SI[FPI]);
		FillDEDMatrix(4,15,tempstr);
	}
}
예제 #2
0
void ICPClass::ExecEWSMode(void)
{
	//Line1
	FillDEDMatrix(0,6,"EWS  CONTROL");
	AddSTPT(0,22);
	//Line2
	FillDEDMatrix(1,2,"CH");
	PossibleInputs = 2;
	if(IsICPSet(ICPClass::CHAFF_BINGO))
		ScratchPad(1,7,10);
	else
	{
		sprintf(tempstr,"%d",ChaffBingo);
		FillDEDMatrix(1,(10-strlen(tempstr)), tempstr);
	} 
	FillDEDMatrix(1,13,"REQJAM");
	if(IsICPSet(ICPClass::EDIT_JAMMER))
	{
		FillDEDMatrix(1,20,"\x02",2);
		FillDEDMatrix(1,24,"\x02",2);
	}
	if(EWS_JAMMER_ON)
		FillDEDMatrix(1,21," ON");
	else
		FillDEDMatrix(1,21,"OFF");
	//Line3
	FillDEDMatrix(2,2,"FL");
	if(IsICPSet(ICPClass::FLARE_BINGO))
		ScratchPad(2,7,10);
	else
	{ 
		sprintf(tempstr,"%d",FlareBingo);
		FillDEDMatrix(2,(10-strlen(tempstr)),tempstr);
	} 
	FillDEDMatrix(2,13,"FDBK"); //JPG 12 Jun 04 - Ideally, it would be nice to turn this & REQCTR on/off to coincide w/
	FillDEDMatrix(2,21," ON");   //the Betty words, but it's more trouble than it's worth.
	//Line4
	FillDEDMatrix(3,2,"O1");
	FillDEDMatrix(3,9,"0");
	FillDEDMatrix(3,12,"REQCTR");
	FillDEDMatrix(3,21," ON");
	//Line5
	FillDEDMatrix(4,2,"O2");
	FillDEDMatrix(4,9,"0");
	FillDEDMatrix(4,13,"BINGO");
	if(IsICPSet(ICPClass::EWS_EDIT_BINGO))
	{
		FillDEDMatrix(4,20,"\x02",2);
		FillDEDMatrix(4,24,"\x02",2);	
	}
	if(EWS_BINGO_ON)
		FillDEDMatrix(4,21," ON");
	else
		FillDEDMatrix(4,21,"OFF");
}
예제 #3
0
void ICPClass::ExecMODEMode(void)
{
	//Line1
	FillDEDMatrix(0,10,"MODE");
	ScratchPad(0,15,19);
	AddSTPT(0,22);
}
예제 #4
0
void ICPClass::ExecVRPMode(void)
{
	//Line1
	FillDEDMatrix(0,9,"TGT-TO-VRP");
	//Line2
	FillDEDMatrix(1,8,"TGT   9 \x01");
	//Line3
	FillDEDMatrix(2,8,"TBRG");
	if(VRP_BRG)
	{
		PossibleInputs = 4;
		ScratchPad(2,13,20);
	}
	else
	{
		sprintf(tempstr,"%3.1f'",fVRP_BRG);
		FillDEDMatrix(2,20-strlen(tempstr),tempstr);
	}
	//Line4
	FillDEDMatrix(3,9,"RNG");
	if(VRP_RNG)
	{
		PossibleInputs = 6;
		ScratchPad(3,13,22);
	}
	else
	{
		sprintf(tempstr,"%dFT", iVRP_RNG);
		FillDEDMatrix(3,22-strlen(tempstr),tempstr);
	}
	//Line5
	FillDEDMatrix(4,8,"ELEV");
	if(VRP_ALT)
	{
		PossibleInputs = 5;
		ScratchPad(4,13,21);
	}
	else
	{
		sprintf(tempstr,"%dFT", iVRP_ALT);
		FillDEDMatrix(4,(21-strlen(tempstr)),tempstr);
	}
}
예제 #5
0
void ICPClass::ExecOA2Mode(void)
{
	//Line1
	FillDEDMatrix(0,4,"DEST  OA2");
	AddSTPT(0,17);
	//Line3
	FillDEDMatrix(2,5,"RNG");
	if(OA_RNG)
	{
		PossibleInputs = 6;
		ScratchPad(2,9,18);
	}
	else
	{
		sprintf(tempstr,"%dFT", iOA_RNG2);
		FillDEDMatrix(2,18-strlen(tempstr),tempstr);
	}
	//Line4
	FillDEDMatrix(3,5,"BRG");
	if(OA_BRG)
	{
		PossibleInputs = 4;
		ScratchPad(3,9,16);
	}
	else
	{
		sprintf(tempstr,"%3.1f'",fOA_BRG2);
		FillDEDMatrix(3,16-strlen(tempstr),tempstr);
	}
	//Line5
	FillDEDMatrix(4,4,"ELEV");
	if(OA_ALT)
	{
		PossibleInputs = 6;
		ScratchPad(4,9,18);
	}
	else
	{
		sprintf(tempstr,"%dFT", iOA_ALT2);
		FillDEDMatrix(4,(18-strlen(tempstr)),tempstr);
	}
}
예제 #6
0
void ICPClass::ExecMANMode(void)
{
	//Line 1
	FillDEDMatrix(0,10,"MAN");
	AddSTPT(0,22);
	//Line 2
	FillDEDMatrix(1,6,"WSPAN");
	PossibleInputs = 3;
	ScratchPad(1,12,18);
	//Line 3
	FillDEDMatrix(2,10,"MBAL");
	//Line 4 
	FillDEDMatrix(3,5,"RNG");
	FillDEDMatrix(3,17,"0FT");
	//Line5
	FillDEDMatrix(4,6,"TOF");
	FillDEDMatrix(4,14,"0.0SEC");
}
예제 #7
0
void ICPClass::ExecBingo(void)
{
	//Line1
	AircraftClass *playerAC = SimDriver.GetPlayerAircraft();
	FillDEDMatrix(0,10,"BINGO");
	AddSTPT(0,22);
	//Get our current FOB
	total = 0;
	if (playerAC)
		total = (long)((AircraftClass*)(playerAC))->GetTotalFuel();
	//Line3
	PossibleInputs = 5;
	FillDEDMatrix(2,5,"SET");
	ScratchPad(2,10,19);
	//Line4
	FillDEDMatrix(3,3,"TOTAL");
	sprintf(tempstr,"%dLBS", total);
	FillDEDMatrix(3,11,tempstr);
}
예제 #8
0
void LogRaw( LogLevel level, const char* message )
{
	assert(message);
	
	int last = 0;
	int i = 0;
	for(; message[i] != '\0'; ++i)
	{
		if(message[i] != '\n')
			continue;
		
		int length = i-last;
		char* line = ScratchPad(length+1);
		memcpy(line, &message[last], length);
		line[length] = '\0';
		LogRawLine(level, line);
		
		last = i+1;
	}
	
	if(i-last > 0)
		LogRawLine(level, &message[last]);
}
예제 #9
0
void ICPClass::ExecINTGMode(void)
{
	AircraftClass *playerAC = SimDriver.GetPlayerAircraft();
	if(!g_bIFF)
	{
		//Line1
		FillDEDMatrix(0,1,"INTG ON");
		FillDEDMatrix(0,18,"CPL");
		AddSTPT(0,22);
		//Line3
		FillDEDMatrix(2,2,"M1",2);
		FillDEDMatrix(2,5,"13");
		FillDEDMatrix(2,10,"MC",2);
		FillDEDMatrix(2,14,"(5)");
		FillDEDMatrix(2,18,"\x02",2);
		FillDEDMatrix(2,24,"\x02",2);
		//Line4
		FillDEDMatrix(3,2,"M2");
		FillDEDMatrix(3,5,"1234");
		FillDEDMatrix(3,10,"M4");
		FillDEDMatrix(3,13,"A(6)");
		//Line5
		FillDEDMatrix(4,2,"M3",2);
		FillDEDMatrix(4,5,"4000");
		FillDEDMatrix(4,17,"RST  (7)");
		return;
	}
	//Line1
	if(playerAC && !playerAC->HasPower(AircraftClass::IFFPower))
		FillDEDMatrix(0,1,"INTG OFF");
	else
		FillDEDMatrix(0,1,"INTG ON");
	FillDEDMatrix(0,18,"CPL");
	AddSTPT(0,22);
	//Line3
	if(IsIFFSet(ICPClass::MODE_1))
		FillDEDMatrix(2,2,"M1",2);
	else
		FillDEDMatrix(2,2,"M1");

	sprintf(tempstr, "%d", Mode1Code);
	FillDEDMatrix(2,5, tempstr);
	if(IsIFFSet(ICPClass::MODE_C))
		FillDEDMatrix(2,10,"MC",2);
	else
		FillDEDMatrix(2,10,"MC");

	FillDEDMatrix(2,14,"(5)");
	ScratchPad(2,18,24);
	PossibleInputs = 5;
	//Line4
	if(IsIFFSet(ICPClass::MODE_2))
		FillDEDMatrix(3,2,"M2",2);
	else
		FillDEDMatrix(3,2,"M2");

	sprintf(tempstr,"%d", Mode2Code);
	FillDEDMatrix(3,5,tempstr);
	if(IsIFFSet(ICPClass::MODE_4))
		FillDEDMatrix(3,10,"M4",2);
	else
		FillDEDMatrix(3,10,"M4");

	if(IsIFFSet(ICPClass::MODE_4B))
		FillDEDMatrix(3,13,"B(6)");
	else
		FillDEDMatrix(3,13,"A(6)");
	//Line5
	if(IsIFFSet(ICPClass::MODE_3))
		FillDEDMatrix(4,2,"M3",2);
	else
		FillDEDMatrix(4,2,"M3");

	sprintf(tempstr, "%d", Mode3Code);
	FillDEDMatrix(4,5,tempstr);
	FillDEDMatrix(4,17,"RST  (7)");
}
예제 #10
0
void ICPClass::ExecDESTMode(void)
{
	//Line1
	FillDEDMatrix(0,4,"DEST  DIR");
	AddSTPT(0,22);
		
	//Get the current waypoint location
	xCurr = yCurr = zCurr = 0;
	AircraftClass *playerAC = SimDriver.GetPlayerAircraft();
	if (playerAC && playerAC->curWaypoint)
		playerAC->curWaypoint->GetLocation(&xCurr, &yCurr, &zCurr);
		
	latitude	= (FALCON_ORIGIN_LAT * FT_PER_DEGREE + xCurr) / EARTH_RADIUS_FT;
	cosLatitude = (float)cos(latitude);
	longitude	= ((FALCON_ORIGIN_LONG * DTR * EARTH_RADIUS_FT * cosLatitude) + yCurr) / (EARTH_RADIUS_FT * cosLatitude);
		
	latitude	*= RTD;
	longitude	*= RTD;
	
	longDeg		= FloatToInt32(longitude);
	longMin		= (float)fabs(longitude - longDeg) * DEG_TO_MIN;

	latDeg		= FloatToInt32(latitude);
	latMin		= (float)fabs(latitude - latDeg) * DEG_TO_MIN;

	// format lat/long here
	if(latMin < 10.0F) 
		sprintf(latStr, "%3d*0%2.2f\'", latDeg, latMin);
	else 
		sprintf(latStr, "%3d*%2.2f\'", latDeg, latMin);
	if(longMin < 10.0F) 
		sprintf(longStr, "%3d*0%2.2f\'", longDeg, longMin);
	else 
		sprintf(longStr, "%3d*%2.2f\'", longDeg, longMin);

	//Line2
	if(IsICPSet(ICPClass::EDIT_LAT) && Manual_Input)
	{
		FillDEDMatrix(1,5,"LAT  N");
		PossibleInputs = 6;
		ScratchPad(1,13,24);
	}
	else
	{
		if(IsICPSet(ICPClass::EDIT_LAT))
		{
			FillDEDMatrix(1,13,"\x02",2);
			FillDEDMatrix(1,24,"\x02",2);
		}
		else
		{
			FillDEDMatrix(1,13," ");
			FillDEDMatrix(1,24," ");
		}
		FillDEDMatrix(1,5,"LAT  N");
		sprintf(tempstr,"%s", latStr);
		FillDEDMatrix(1,14,tempstr);
		
	}
	//Line3
	if(IsICPSet(ICPClass::EDIT_LONG) && Manual_Input)
	{
		FillDEDMatrix(2,5,"LNG  E");
		PossibleInputs = 7;
		ScratchPad(2,13,24);
	}
	else
	{	
		if(IsICPSet(ICPClass::EDIT_LONG))
		{
			FillDEDMatrix(2,13,"\x02",2);
			FillDEDMatrix(2,24,"\x02",2);
		}
		else
		{
			FillDEDMatrix(2,13," ");
			FillDEDMatrix(2,24," ");
		}
		FillDEDMatrix(2,5,"LNG  E");
		sprintf(tempstr, "%s", longStr);
		FillDEDMatrix(2,14,tempstr);
	}
	//Line4
	FillDEDMatrix(3,4,"ELEV");
	sprintf(tempstr,"%4.0fFT",-zCurr);
	FillDEDMatrix(3,13,tempstr);
	//Line5
	if(playerAC)
	{
		VU_TIME ETA = SimLibElapsedTime / SEC_TO_MSEC + FloatToInt32(Distance(
		playerAC->XPos(), playerAC->YPos(), xCurr, yCurr) 
		/ playerAC->af->vt);
		FormatTime(ETA, tempstr);
	}
	FillDEDMatrix(4,5,"TOS");
	FillDEDMatrix(4,13,tempstr);
}
예제 #11
0
void ICPClass::ExecINSMode(void)
{
	AircraftClass *playerAC = SimDriver.GetPlayerAircraft();
	//Line1
	if(g_bINS)
	{
		GetINSInfo();					//Wombat778 10-17-2003  Update the INS info.  Was static before.
		FillDEDMatrix(0,5,"INS");
		AddSTPT(0,22);
		char tempstr1[10] = "";
		char tempstr2[10] = "";
		if(playerAC)
		{
			INSTime = playerAC->INSAlignmentTimer;
			int State = playerAC->INSStatus;
			
			INSTime /= 60;
			sprintf(tempstr2,"%d", State);
			sprintf(tempstr1,"%2.1f/", INSTime);
			FillDEDMatrix(0,9,tempstr1);
			FillDEDMatrix(0,14, tempstr2);
			if(!playerAC->HasAligned && 
				playerAC->INSState(AircraftClass::INS_Nav))
			{
				FillDEDMatrix(0,14,"00");
			}
			else if(!playerAC->INSState(AircraftClass::INS_Aligned))
			{
				if(State <= 70)
					FillDEDMatrix(0,17,"RDY");
				else
					FillDEDMatrix(0,17,"   ");
			}
			else if(playerAC->INSState(AircraftClass::INS_AlignNorm) &&
				playerAC->INSState(AircraftClass::INS_Aligned))
			{
				if(vuxRealTime & 0x200)
					FillDEDMatrix(0,17,"RDY");
				else
					FillDEDMatrix(0,17,"   ");
			}

			//coords stuff
			FillDEDMatrix(1,5,"LAT  N");
			FillDEDMatrix(2,5,"LNG  E");
			FillDEDMatrix(3,4,"SALT");
			FillDEDMatrix(4,3,"THDG");
			if(INSLine == 0 && Manual_Input)
			{
				//LAT line
				PossibleInputs = 6;
				ScratchPad(1,12,23);
			}
			else
			{
				if(playerAC->INSState(AircraftClass::INS_HUD_FPM)) //28 Jul 04 - If INS off/failed, we lose all cruise info
					{
						FillDEDMatrix(1, 13, INSLat);
					}
				if(INSLine == 0)
				{
					FillDEDMatrix(1,12,"\x02",2);
					FillDEDMatrix(1,23,"\x02",2);
				}
				else
				{
						FillDEDMatrix(1,12," ");
						FillDEDMatrix(1,23," ");
				}
			}
			if(INSLine == 1 && Manual_Input)
			{
				//LONG line
				PossibleInputs = 7;
				ScratchPad(2,12,23);
			}
			else
			{
				if(playerAC->INSState(AircraftClass::INS_HUD_FPM)) //28 Jul 04 - If INS off/failed, we lose all cruise info
				{
					FillDEDMatrix(2,13, INSLong);
				}
				if(INSLine == 1)
				{
					FillDEDMatrix(2,12,"\x02",2);
					FillDEDMatrix(2,23,"\x02",2);
				}
				else
				{
						FillDEDMatrix(2,12," ");
						FillDEDMatrix(2,23," ");
				}
			}
			if(INSLine == 2 && Manual_Input)
			{
				//ALT line
				PossibleInputs = 5;
				ScratchPad(3,14,22);
			}
			else
			{
				if(playerAC->INSState(AircraftClass::INS_HUD_FPM)) //28 Jul 04 - If INS off/failed, we lose all cruise info
				{
						FillDEDMatrix(3,21-(strlen(altStr)), " ");	//Wombat778 10-17-2003 make sure that old digit doesnt show below 10000ft
					FillDEDMatrix(3,22-(strlen(altStr)), altStr);
				}
				if(INSLine == 2)
				{
					FillDEDMatrix(3,14,"\x02",2);
					FillDEDMatrix(3,22,"\x02",2);
				}
				else
				{
					if(playerAC->INSState(AircraftClass::INS_HUD_FPM)) //28 Jul 04 - If INS off/failed, we lose all cruise info
					{
						FillDEDMatrix(3,14," ");
						FillDEDMatrix(3,22," ");
					}
				}
			}
			if(INSLine == 3 && Manual_Input)
			{
				//THDG line
				PossibleInputs = 4;
				ScratchPad(4,8,15);

				int GroundSpeed = FloatToInt32((float)sqrt(cockpitFlightData.xDot*cockpitFlightData.xDot + 
					cockpitFlightData.yDot*cockpitFlightData.yDot) * FTPSEC_TO_KNOTS);
				GroundSpeed = max(GroundSpeed, 999);
				sprintf(tempstr,"%d",GroundSpeed);
				FillDEDMatrix(4,17,"G/S");
				FillDEDMatrix(4,(25-strlen(tempstr)),tempstr);
			}
			else
			{
				if(playerAC->INSState(AircraftClass::INS_HUD_FPM)) //28 Jul 04 - If INS off/failed, we lose all cruise info
				{
					FillDEDMatrix(4,15-(strlen(INSHead)), INSHead);
				}
				if(INSLine == 3)
				{
					FillDEDMatrix(4,8,"\x02",2);
					FillDEDMatrix(4,15,"\x02",2);
				}
				else
				{
					FillDEDMatrix(4,8," ");
					FillDEDMatrix(4,15," ");

				}
				int GroundSpeed = FloatToInt32((float)sqrt(cockpitFlightData.xDot*cockpitFlightData.xDot + 
					cockpitFlightData.yDot*cockpitFlightData.yDot) * FTPSEC_TO_KNOTS);
				FillDEDMatrix(4,20, "     ");
				sprintf(tempstr,"%d",GroundSpeed);
				FillDEDMatrix(4,17,"G/S");
				if(playerAC->INSState(AircraftClass::INS_HUD_FPM)) //28 Jul 04 - If INS off/failed, we lose all cruise info
					{
					FillDEDMatrix(4,(25-strlen(tempstr)),tempstr);
					}
			}
		}
	}
	else
	{
		FillDEDMatrix(0,5,"INS 08.0/10");
		AddSTPT(0,22);
		//Display some bogus INS info here, along with the current
		//coords of the plane
		latitude	= (FALCON_ORIGIN_LAT * FT_PER_DEGREE + cockpitFlightData.x) / EARTH_RADIUS_FT;
		cosLatitude = (float)cos(latitude);
		longitude	= ((FALCON_ORIGIN_LONG * DTR * EARTH_RADIUS_FT * cosLatitude) + cockpitFlightData.y) / (EARTH_RADIUS_FT * cosLatitude);
		
		latitude	*= RTD;
		longitude	*= RTD;
		
		longDeg		= FloatToInt32(longitude);
		longMin		= (float)fabs(longitude - longDeg) * DEG_TO_MIN;

		latDeg		= FloatToInt32(latitude);
		latMin		= (float)fabs(latitude - latDeg) * DEG_TO_MIN;

		// format lat/long here
		if(latMin < 10.0F) 
			sprintf(latStr, "LAT  N %3d* 0%2.2f\'\n", latDeg, latMin);
		else 
			sprintf(latStr, "LAT  N %3d* %2.2f\'\n", latDeg, latMin);
		if(longMin < 10.0F) 
			sprintf(longStr, "LNG  E %3d* 0%2.2f\'\n", longDeg, longMin);
		else 
			sprintf(longStr, "LNG  E %3d* %2.2f\'\n", longDeg, longMin);
		//Line 2
		FillDEDMatrix(1,5,latStr);
		//Line3
		FillDEDMatrix(2,5,longStr);
		
		//Line4
		FillDEDMatrix(3,4,"SALT");
		sprintf(tempstr,  "%dFT", (long)-cockpitFlightData.z);
		FillDEDMatrix(3,15,tempstr);
		//Line5
		FillDEDMatrix(4,3,"THDG  228.2*");
		int GroundSpeed = FloatToInt32((float)sqrt(cockpitFlightData.xDot*cockpitFlightData.xDot + 
			cockpitFlightData.yDot*cockpitFlightData.yDot) * FTPSEC_TO_KNOTS);
		sprintf(tempstr,"%d",GroundSpeed);
		FillDEDMatrix(4,16,"G/S");
		FillDEDMatrix(4,(24-strlen(tempstr)),tempstr);
	}
}	
예제 #12
0
void ICPClass::ExecCOMM1Mode(void)
{

	//change our active radio
	WhichRadio = 0;
	if(VM)
	{
		if(VM->radiofilter[0] == rcfOff)
			CommChannel = 0;
		else if(VM->radiofilter[0] == rcfFlight1)
			CommChannel = 1;
		else if(VM->radiofilter[0] == rcfFlight2)
			CommChannel = 2;
		else if(VM->radiofilter[0] == rcfFlight3)
			CommChannel = 3;
		else if(VM->radiofilter[0] == rcfFlight4)
			CommChannel = 4;
		else if(VM->radiofilter[0] == rcfFlight5)
			CommChannel = 5;
		else if(VM->radiofilter[0] == rcfPackage1)
			CommChannel = 6;
		else if(VM->radiofilter[0] == rcfPackage2)
			CommChannel = 7;
		else if(VM->radiofilter[0] == rcfPackage3)
			CommChannel = 8;
		else if(VM->radiofilter[0] == rcfPackage4)
			CommChannel = 9;
		else if(VM->radiofilter[0] == rcfPackage5)
			CommChannel = 10;
		else if(VM->radiofilter[0] == rcfFromPackage)
			CommChannel = 11;
		else if(VM->radiofilter[0] == rcfProx)
			CommChannel = 12;
		else if(VM->radiofilter[0] == rcfTeam)
			CommChannel = 13;
		else if(VM->radiofilter[0] == rcfAll)
			CommChannel = 14;
		else if(VM->radiofilter[0] == rcfTower)
			CommChannel = 15;
	}
	else
		CommChannel = 8;

	if(PREUHF == 1)
		UHFChann = 125.32;
	else if(PREUHF == 2)
		UHFChann = 106.95;
	else if(PREUHF == 3)
		UHFChann = 140.75;
	else if(PREUHF == 4)
		UHFChann = 123.62;
	else if(PREUHF == 5)
		UHFChann = 142.02;
	else if(PREUHF == 6)
		UHFChann = 185.62;
	else if(PREUHF == 7)
		UHFChann = 262.80;
	else if(PREUHF == 8)
		UHFChann = 142.80;
	else if(PREUHF == 9)
		UHFChann = 322.70;
	else if(PREUHF == 10)
		UHFChann = 362.60;
	else if(PREUHF == 11)
		UHFChann = 322.20;
	else if(PREUHF == 12)
		UHFChann = 362.40;
	else if(PREUHF == 13)
		UHFChann = 222.80;
	else if(PREUHF == 14)
		UHFChann = 263.80;
	else if(PREUHF == 15)//Cobra TJL 10/31/04
		UHFChann = 308.80;
		

	if(gNavigationSys->GetControlSrc() == NavigationSystem::AUXCOMM)
		UHFBackup();
	else
	{
		//Line1
		FillDEDMatrix(0,10,"UHF  BOTH");  // MD -- 20031121: oops, fixed UFH typo
		//Line2
		sprintf(tempstr,"%d",CommChannel);
		FillDEDMatrix(1,9,tempstr);
		//Line3
		PossibleInputs = 5;
		ScratchPad(2,15,22);
		//Line4
		FillDEDMatrix(3,2,"PRE");
		sprintf(tempstr, "%1.0f", PREUHF);
		FillDEDMatrix(3,10,tempstr);
		FillDEDMatrix(3,13,"\x01");
		FillDEDMatrix(3,19, "TOD");
		//Line5
		sprintf(tempstr,"%3.2f",UHFChann);
		FillDEDMatrix(4,6,tempstr);
		FillDEDMatrix(4,20,"NB");
	}
}
예제 #13
0
void ICPClass::ExecCOMM2Mode(void)
{
	//change our active radio
	WhichRadio = 1;
	if(VM)
	{
		if(VM->radiofilter[1] == rcfOff)
			CommChannel = 0;
		else if(VM->radiofilter[1] == rcfFlight1)
		{
			VHFChann = 145.27;
			CommChannel = 1;
		}
		else if(VM->radiofilter[1] == rcfFlight2)
		{
			VHFChann = 145.27;
			CommChannel = 2;
		}
		else if(VM->radiofilter[1] == rcfFlight3)
		{
			VHFChann = 145.27;
			CommChannel = 3;
		}
		else if(VM->radiofilter[1] == rcfFlight4)
		{
			VHFChann = 145.27;
			CommChannel = 4;
		}
		else if(VM->radiofilter[1] == rcfFlight5)
		{
			VHFChann = 145.27;
			CommChannel = 5;
		}
		else if(VM->radiofilter[1] == rcfPackage1)
		{
			VHFChann = 222.10;
			CommChannel = 6;
		}
		else if(VM->radiofilter[1] == rcfPackage2)
		{
			VHFChann = 222.10;
			CommChannel = 7;
		}
		else if(VM->radiofilter[1] == rcfPackage3)
		{
			VHFChann = 222.10;
			CommChannel = 8;
		}
		else if(VM->radiofilter[1] == rcfPackage4)
		{
			VHFChann = 222.10;
			CommChannel = 9;
		}
		else if(VM->radiofilter[1] == rcfPackage5)
		{
			VHFChann = 222.10;
			CommChannel = 10;
		}
		else if(VM->radiofilter[1] == rcfFromPackage)
		{
			VHFChann = 147.25;
			CommChannel = 3;
		}
		else if(VM->radiofilter[1] == rcfProx)
		{
			VHFChann = 256.32;
			CommChannel = 11;
		}
		else if(VM->radiofilter[1] == rcfTeam)
		{
			VHFChann = 186.35;
			CommChannel = 12;
		}
		else if(VM->radiofilter[1] == rcfAll)
		{
			VHFChann = 198.97;
			CommChannel = 13;
		}
		else if(VM->radiofilter[1] == rcfTower)
		{
			VHFChann = 176.35;
			CommChannel = 14;
		}
	}
	else
		CommChannel = 8;

	if(PREVHF == 1)
		VHFChann = 40.39;
	else if(PREVHF == 2)
		VHFChann = 36.72;
	else if(PREVHF == 3)
		VHFChann = 29.05;
	else if(PREVHF == 4)
		VHFChann = 45.62;
	else if(PREVHF == 5)
		VHFChann = 27.02;
	else if(PREVHF == 6)
		VHFChann = 53.62;
	else if(PREVHF == 7)
		VHFChann = 58.80;
	else if(PREVHF == 8)
		VHFChann = 36.72;
	else if(PREVHF == 9)
		VHFChann = 29.05;
	else if(PREVHF == 10)
		VHFChann = 45.62;
	else if(PREVHF == 11)
		VHFChann = 27.02;
	else if(PREVHF == 12)
		VHFChann = 53.62;
	else if(PREVHF == 13)
		VHFChann = 58.80;
	else if(PREVHF == 14)
		VHFChann = 58.80;
	else if(PREVHF == 15)
  		VHFChann = 122.10;//Cobra 10/31/04 TJL
	if(gNavigationSys->GetControlSrc() == NavigationSystem::AUXCOMM)
		VHFBackup();
	else
	{
		//Line1
		FillDEDMatrix(0,10,"VHF  ON");
		//Line2
		FillDEDMatrix(1,3,"512.26");
		//Line3
		PossibleInputs = 5;
		ScratchPad(2,15,22);
		//Line4
		FillDEDMatrix(3,2,"PRE");
		sprintf(tempstr, "%1.0f", PREVHF);
		FillDEDMatrix(3,10,tempstr);
		FillDEDMatrix(3,13,"\x01");
		//Line5
		sprintf(tempstr, "%3.2f", VHFChann);
		FillDEDMatrix(4,6,tempstr);
		FillDEDMatrix(4,20,"WB");
	}
}
예제 #14
0
void ICPClass::ExecILSMode(void) 
{
	if(!g_bRealisticAvionics)
	{
		//MI Original code
		VU_ID							id;
		VU_ID							homeid;
		VU_ID							ilsid;
		BOOL							isValidILS;
		BOOL							isValidRWY;
		int							channel;
		char							rwyNum[4] = "";
		TacanList::StationSet	set;
		char							setchar;
		char							p_signaltype[10] = "";
		NavigationSystem::Type	type;
		static int					frame = 0;


		if(mUpdateFlags & ILS_UPDATE) 
		{
			mUpdateFlags &= ~ILS_UPDATE;

			if (gNavigationSys)
			{
				gNavigationSys->GetTacanVUID(NavigationSystem::ICP, &id);
			}
			else
			{
				id == FalconNullId;
			}

			if(id == FalconNullId) 
			{
				sprintf(mpLine1, "NO MISSION PRESETS");
				sprintf(mpLine2, "");
				sprintf(mpLine3, "");
			}
			else 
			{
				
				type = gNavigationSys->GetType();

				// Line #1
				sprintf(mpLine1, "");

				// Line #2
				if(type == NavigationSystem::AIRBASE) 
				{
					gNavigationSys->GetHomeID(&homeid);

					isValidILS = gNavigationSys->GetILSAttribute(NavigationSystem::AIRBASE_ID, &ilsid);
					isValidRWY = gNavigationSys->GetILSAttribute(NavigationSystem::RWY_NUM, (char*)rwyNum);
			
					if(id == homeid) 
					{
						sprintf(mpLine2, "HOME RUNWAY ");
					}
					else 
					{
						sprintf(mpLine2, "ALTERNATE RUNWAY ");
					}

					if(id == ilsid && isValidILS && isValidRWY) 
					{
						strcat(mpLine2, rwyNum);
					}
				}	
				else if(type == NavigationSystem::TANKER) 
				{
					sprintf(mpLine2, "TANKER");
				}
				else if(type == NavigationSystem::CARRIER) 
				{
					if(id == homeid) 
					{
						sprintf(mpLine2, "HOME CARRIER");
					}
					else 
					{
						sprintf(mpLine2, "ALTERNATE CARRIER");
					}
				}

				// Line #3
				gNavigationSys->GetTacanChannel(NavigationSystem::ICP, &channel, &set);

				if(set == TacanList::X) {
					setchar = 'X';
				}
				else {
					setchar = 'Y';
				}

				if(type == NavigationSystem::TANKER) {
					strcpy(p_signaltype, "AA-TR");			
				}		
				else {
					strcpy(p_signaltype, "TR");
				}

				sprintf(mpLine3, "TCN %-3d%c %s", channel, setchar, p_signaltype);
			}
		}
		else if (frame == 9) 
		{

			if (gNavigationSys)
			{
				gNavigationSys->GetTacanVUID(NavigationSystem::ICP, &id);
				type = gNavigationSys->GetType();
				if(type == NavigationSystem::AIRBASE) 
				{
					gNavigationSys->GetHomeID(&homeid);

					isValidILS = gNavigationSys->GetILSAttribute(NavigationSystem::AIRBASE_ID, &ilsid);
					isValidRWY = gNavigationSys->GetILSAttribute(NavigationSystem::RWY_NUM, (char*)rwyNum);
			
					if(id == homeid) {
						sprintf(mpLine2, "HOME RUNWAY ");
					}
					else {
						sprintf(mpLine2, "ALTERNATE RUNWAY ");
					}

					if(id == ilsid && isValidILS && isValidRWY) 
					{
						strcat(mpLine2, rwyNum);
					}
				}
			}
			else
			{
				id == FalconNullId;
			}

			frame = 0;
		}
		else 
		{

			frame++;
		}
	}
	else
	{
		ClearStrings();
		//MI modified for ICP stuff
		VU_ID							id;
		VU_ID							homeid;
		VU_ID							ilsid;
		char							rwyNum[4] = "";
		char							p_signaltype[10] = "";
		static int						frame = 0;

		HSICourse = static_cast<int>
			(OTWDriver.pCockpitManager->mpHsi->GetValue(CPHsi::HSI_VAL_DESIRED_CRS));

		if(gNavigationSys->GetControlSrc() == NavigationSystem::AUXCOMM)
			ILSBackup();
		else
		{
			if(gNavigationSys->GetTacanBand(NavigationSystem::ICP) == TacanList::X)
				TacanBand = 'X';
			else
				TacanBand = 'Y';
			if (gNavigationSys)
				gNavigationSys->GetTacanVUID(NavigationSystem::ICP, &id);
			else
				id == FalconNullId;

			if(id == FalconNullId) 
				ILSOn = 0;
			else 
			{
				//We SHOULD only have ILS when our Tacanband is == X
				if(TacanBand == 'X')
					ILSOn = 1;
				else 
					ILSOn = 0;
			}
			if(gNavigationSys->GetDomain(NavigationSystem::ICP) == TacanList::AA)
			{
				//Line1
				FillDEDMatrix(0,1,"TCN A/A TR");

				if(ILSOn ==1)
					FillDEDMatrix(0,18,"ILS ON");
				else
					FillDEDMatrix(0,18,"ILS OFF");
			}
			else
			{
				//Line1
				FillDEDMatrix(0,1,"TCN TR");
				if(ILSOn ==1)
					FillDEDMatrix(0,18,"ILS ON");
				else
					FillDEDMatrix(0,18,"ILS OFF");
			}			

			Digit1 = gNavigationSys->GetTacanChannel(NavigationSystem::ICP, 2);
			Digit2 = gNavigationSys->GetTacanChannel(NavigationSystem::ICP, 1);
			Digit3 = gNavigationSys->GetTacanChannel(NavigationSystem::ICP, 0);
			TacanChannel = (Digit1 * 100 + Digit2 * 10 + Digit3);
			
			//FakeILSFreq();
			sprintf(Freq, "%3.2f", gNavigationSys->GetCurTCNILS());
			//BEGIN LINE 3
			PossibleInputs = 3;
			if(ILSPageSel == 0)
				ScratchPad(2,8,12);
			else if(ILSPageSel == 1)
				ScratchPad(2,16,25);

			if(GetCMDSTR())
				FillDEDMatrix(2,17,"CMD STRG", 2);
			else
				FillDEDMatrix(2,17,"CMD STRG");
			//END LINE 3

			//BEGIN LINE 4
			FillDEDMatrix(3,1,"CHAN");
			ClearString();
			sprintf(tempstr,"%3.0d",TacanChannel);
			FillDEDMatrix(3,9,tempstr);
			FillDEDMatrix(3,14,"FREQ");
			FillDEDMatrix(3,19,Freq);
			//END LINE 4

			//BEGIN LINE 5
			FillDEDMatrix(4,1,"BAND");
			sprintf(tempstr,"%c(0)",TacanBand);
			FillDEDMatrix(4,9,tempstr);
			FillDEDMatrix(4,14,"CRS");
			sprintf(tempstr,"%d*",HSICourse);
			FillDEDMatrix(4,18,tempstr);
			//END LINE 5
		}
	}
}