예제 #1
0
파일: Hsystems.cpp 프로젝트: dseagrav/NASSP
void h_Tank::Save(FILEHANDLE scn) {

	char text[100];

	/*int Compare(char* ln, char* trg);
	if (Compare(name, "TESTPIPE")) {	// TSCH Test
		int test = 0;
	}*/

	sprintf(text," %s %lf %i %i %i %i %.8f %.8f %.8f %.8f", 
		    name, space.Volume, 
		    IN_valve.open, OUT_valve.open, OUT2_valve.open, LEAK_valve.open, 
			IN_valve.size, OUT_valve.size, OUT2_valve.size, LEAK_valve.size);
	oapiWriteScenario_string(scn, "   <TANK>", text);

	for (int i=0;i<MAX_SUB;i++)
		if (space.composition[i].mass) {
			sprintf(text,"   %i %.12lf %.12lf %.12lf",
				space.composition[i].subst_type,
				space.composition[i].mass,
				space.composition[i].vapor_mass,
				space.composition[i].Q);
			oapiWriteScenario_string(scn, "      CHM", text);
		}
	oapiWriteScenario_string(scn, "   </TANK>","");
}
예제 #2
0
void AscentAP::SaveState (FILEHANDLE scn)
{
	char cbuf[256];
	sprintf (cbuf, "%0.3f %0.3f %0.3f %0.3f",
		met, met_meco, met_oms_start, met_oms_end);
	oapiWriteScenario_string (scn, "MET", cbuf);
	sprintf (cbuf, "%d %d %0.0f %0.4f %0.5f %0.5f",
		(int)active, (int)met_active, tgt_alt, launch_azimuth, launch_lng, launch_lat);
	oapiWriteScenario_string (scn, "ASCENTAP", cbuf);
}
예제 #3
0
// --------------------------------------------------------------
// Save status to scenario file
// --------------------------------------------------------------
void HST::clbkSaveState (FILEHANDLE scn)
{
	char cbuf[256];
	SaveDefaultState (scn);
	sprintf (cbuf, "%d %0.4f", ant_status, ant_proc);
	oapiWriteScenario_string (scn, "ANT", cbuf);
	sprintf (cbuf, "%d %0.4f", hatch_status, hatch_proc);
	oapiWriteScenario_string (scn, "HATCH", cbuf);
	sprintf (cbuf, "%d %0.4f", array_status, array_proc);
	oapiWriteScenario_string (scn, "FOLD", cbuf);
}
예제 #4
0
파일: Panel.cpp 프로젝트: dseagrav/NASSP
void Panel::Save(FILEHANDLE scn)
{ instrument_list *runner=instruments;
  char cbuf[80];
//  int int_sv[10];
  int index=0;
sprintf(cbuf,"%i",idx);

  oapiWriteScenario_string (scn, "<PANEL>", cbuf);
  oapiWriteScenario_int(scn,"<TEXT>",text_logic);
  oapiWriteScenario_int(scn,"<LIGHT>",panel_logic);
  oapiWriteScenario_string (scn, "</PANEL>", cbuf);
}
예제 #5
0
파일: Hsystems.cpp 프로젝트: dseagrav/NASSP
void H_system::Save(FILEHANDLE scn) { 
	
	ship_object *runner;
	runner = List.next;

	oapiWriteScenario_string(scn, "<HYDRAULIC>","");
	while (runner) { 
		runner->Save(scn);
		runner = runner->next;
	}
	oapiWriteScenario_string(scn, "</HYDRAULIC>","");
}
예제 #6
0
파일: PanelSDK.cpp 프로젝트: dseagrav/NASSP
void PanelSDK::Save(FILEHANDLE scn) {

	oapiWriteScenario_string(scn, "<INTERNALS>","");
	oapiWriteScenario_string(scn, "<VERSION>", PANELSDK_VERSION);
	
	HYDRAULIC->Save(scn);
	ELECTRIC->Save(scn);
	for (int i=0;i<NumPanels;i++)
		panels[i]->Save(scn);
	
	oapiWriteScenario_string (scn, "</INTERNALS>","");
}
예제 #7
0
DLLCLBK void opcSaveState (FILEHANDLE scn)
{
	char filename[255];
	sprintf(filename,"Scenarios/UMMUFA/CurrentState.cfg");
	if (g_UFA.SpecialSave==TRUE)
	{
		oapiWriteScenario_string (scn, "CFG", g_UFA.SpecialSaveBuffer);
		g_UFA.save();
		return;
	}
	oapiWriteScenario_string (scn, "CFG", filename);
	sprintf(g_UFA.cfg,"%s", filename);
	g_UFA.save();
}
예제 #8
0
파일: ecs.cpp 프로젝트: dseagrav/NASSP
void CabinPressureRegulator::SaveState(FILEHANDLE scn) {

	char buffer[256];

	sprintf(buffer, "%i %lf", (closed ? 1 : 0), press);
	oapiWriteScenario_string(scn, "CABINPRESSUREREGULATOR", buffer);
}
예제 #9
0
파일: Hsystems.cpp 프로젝트: dseagrav/NASSP
void h_HeatExchanger::Save(FILEHANDLE scn) {

	char text[100];

	sprintf(text," %s %i %f %f %f %i",name, h_pump, tempMin, tempMax, length, bypassed);
	oapiWriteScenario_string(scn, "   <HEATEXCHANGER>", text);
}
예제 #10
0
파일: Hsystems.cpp 프로젝트: dseagrav/NASSP
void h_Radiator::Save(FILEHANDLE scn) {

	char text[100];

	sprintf(text," %s %f %f",name, Temp, rad);
	oapiWriteScenario_string(scn, "   <RADIATOR>", text);
}
예제 #11
0
파일: Hsystems.cpp 프로젝트: dseagrav/NASSP
void h_crew::Save(FILEHANDLE scn) {

	char text[100];

	sprintf(text," %s %i", name, number);
	oapiWriteScenario_string(scn, "   <CREW>", text);
}
예제 #12
0
파일: Hsystems.cpp 프로젝트: dseagrav/NASSP
void h_MixingPipe::Save(FILEHANDLE scn) {

	char text[100];

	sprintf(text," %s %i %lf",name, h_pump, ratio);
	oapiWriteScenario_string(scn, "   <MIXINGPIPE>", text);
}
예제 #13
0
파일: Hsystems.cpp 프로젝트: dseagrav/NASSP
void h_Evaporator::Save(FILEHANDLE scn) {

	char text[100];

	sprintf(text," %s %i %i %lf",name, h_pump, h_valve, throttle);
	oapiWriteScenario_string(scn, "   <EVAPORATOR>", text);
}
예제 #14
0
파일: ecs.cpp 프로젝트: dseagrav/NASSP
void O2DemandRegulator::SaveState(FILEHANDLE scn) {

	char buffer[100];

	sprintf(buffer, "%i %i", (closed ? 1 : 0), (suitReliefValveOpen ? 1 : 0)); 
	oapiWriteScenario_string(scn, "O2DEMANDREGULATOR", buffer);
}
예제 #15
0
파일: ecs.cpp 프로젝트: dseagrav/NASSP
void SaturnSideHatch::SaveState(FILEHANDLE scn) {

	char buffer[100];

	sprintf(buffer, "%i %i", (open ? 1 : 0), toggle); 
	oapiWriteScenario_string(scn, "SIDEHATCH", buffer);
}
예제 #16
0
파일: ecs.cpp 프로젝트: dseagrav/NASSP
void CrewStatus::SaveState(FILEHANDLE scn) {

	char buffer[1000];

	sprintf(buffer, "%d %lf %lf %lf %lf %lf %lf", status, suitPressureLowTime, suitPressureHighTime, suitTemperatureTime,
		                                          suitCO2Time, accelerationTime, lastVerticalVelocity); 
	oapiWriteScenario_string(scn, "CREWSTATUS", buffer);
}
예제 #17
0
void Dragonfly::SaveState (FILEHANDLE scn)
{
	char cbuf[256];

	// custom parameters
	sprintf (cbuf, "%f %f %i %i %i", UP_pos ,UY_pos,UP_handle, UY_handle,UAnt_handle);
	oapiWriteScenario_string (scn, "UPPERANT", cbuf);
	sprintf (cbuf, "%f %f %i %i %i", LP_pos ,LY_pos,LP_handle, LY_handle,LAnt_handle);
	oapiWriteScenario_string (scn, "LOWERANT", cbuf);
    sprintf(cbuf,"%f %i",dock_latched,latch_handle);
    oapiWriteScenario_string (scn, "HATCH", cbuf);
	//char *name;
	if (Dock_target_object) {
		 oapiGetObjectName(Dock_target_object,cbuf,256);
		 oapiWriteScenario_string (scn, "ANTTRG", cbuf);
	}
}
예제 #18
0
파일: Hsystems.cpp 프로젝트: dseagrav/NASSP
void h_Pipe::Save(FILEHANDLE scn) {

	char text[100];

	if (*name != '\0') {
		sprintf(text," %s %lf %lf %lf", name, P_max, P_min, flowMax);
		oapiWriteScenario_string(scn, "   <PIPE>", text);
	}
}
예제 #19
0
파일: Sync.cpp 프로젝트: ADSWNJ/BaseSyncMFD
// ==============================================================================================================================================
//
void SyncMFD::Write(FILEHANDLE scn)
{
	unsigned int i;
	char save_Target[32];
	char save_Reference[32];
	strncpy(save_Target,trgt->name,31);
	strncpy(save_Reference,trgt->ref,31);

	for (i=0;i<strlen(save_Target);i++) if (save_Target[i]==' ') save_Target[i]='_';
	for (i=0;i<strlen(save_Reference);i++) if (save_Reference[i]==' ') save_Reference[i]='_';

	oapiWriteScenario_string (scn, "Target", save_Target);
	oapiWriteScenario_string (scn, "Reference", save_Reference);

	sprintf(LineBuffer,"%lg %lg %d %d %lg %d",trgt->lon, trgt->lat, mode.dir?2:1, mode.enc, sync_line, sync_num);

	oapiWriteScenario_string (scn, "Data",LineBuffer);
}
예제 #20
0
void ShipInternal::Save(FILEHANDLE scn)
{	
	char cbuf[50];
	strcpy(cbuf,"v1.0.0B");
   	oapiWriteScenario_string (scn, "INTERNAL:", cbuf);
	cbuf[0]=0;
		oapiWriteScenario_string (scn, "  HYDRAULICS:", cbuf);
	H_systems.Save(scn);
		oapiWriteScenario_string (scn, "  ELECTRICAL:", cbuf);
	E_systems.Save(scn);
	 	oapiWriteScenario_string (scn, "  PANEL     :", cbuf);
	PanelList[0].Save(scn);
		PanelList[1].Save(scn);
			PanelList[2].Save(scn);
				PanelList[3].Save(scn);
				  PanelList[4].Save(scn);
	oapiWriteScenario_string (scn, " END INTERNAL", cbuf);
};
예제 #21
0
파일: ecs.cpp 프로젝트: dseagrav/NASSP
void O2SMSupply::SaveState(FILEHANDLE scn) {

	char buffer[100];

	sprintf(buffer, "%i %i %i %i %8.4f %8.4f %8.4f %i %8.4f %8.4f %8.4f", (closed ? 1 : 0), (o2SMSupplyVoid ? 1 : 0), (o2MainRegulatorVoid ? 1 : 0),
		o2SMSupplyO2.subst_type, o2SMSupplyO2.mass , o2SMSupplyO2.vapor_mass, o2SMSupplyO2.Q,
		o2MainRegulatorO2.subst_type, o2MainRegulatorO2.mass , o2MainRegulatorO2.vapor_mass, o2MainRegulatorO2.Q); 
	oapiWriteScenario_string(scn, "O2SMSUPPLY", buffer);
}
예제 #22
0
void BatteryCharger::Save(FILEHANDLE scn)

{
	char cbuf[1000];

	int bat;

	bat = 0;
	if (currentBattery == battery1) bat = 1;
	if (currentBattery == battery2) bat = 2;
	if (currentBattery == battery3) bat = 3;

	sprintf (cbuf, "%s %i", name, bat);
	oapiWriteScenario_string (scn, "    <BATTERYCHARGER> ", cbuf);
}
예제 #23
0
void DCBusController::Save(FILEHANDLE scn)

{
	char cbuf[1000];
	sprintf (cbuf, "%s %i %i %i %i %i %i %i %i %i", name, IsFuelCellConnected(1) ? 1 : 0, 
								  		                  IsFuelCellConnected(2) ? 1 : 0, 
										                  IsFuelCellConnected(3) ? 1 : 0,												 
														  tieState, gseState,
												          tieAuto ? 1 : 0,
												          fcDisconnectAlarm[1] ? 1 : 0,
												          fcDisconnectAlarm[2] ? 1 : 0,
												          fcDisconnectAlarm[3] ? 1 : 0);

	oapiWriteScenario_string (scn, "    <DCBUSCONTROLLER> ", cbuf);
}
예제 #24
0
파일: dsky.cpp 프로젝트: dseagrav/NASSP
void DSKY::SaveState(FILEHANDLE scn, char *start_str, char *end_str)

{
	oapiWriteLine(scn, start_str);
	oapiWriteScenario_string (scn, "PROG", Prog);
	oapiWriteScenario_string (scn, "VERB", Verb);
	oapiWriteScenario_string (scn, "NOUN", Noun);
	oapiWriteScenario_string (scn, "R1", R1);
	oapiWriteScenario_string (scn, "R2", R2);
	oapiWriteScenario_string (scn, "R3", R3);

	//
	// Copy internal state to the structure.
	//

	DSKYState state;

	state.word = 0;
	state.u.VerbFlashing = VerbFlashing;
	state.u.NounFlashing = NounFlashing;

	state.u.CompActy = CompActy;
	state.u.UplinkLight = UplinkLight;
	state.u.NoAttLight = NoAttLight;
	state.u.StbyLight = StbyLight;
	state.u.KbRelLight = KbRelLight;
	state.u.OprErrLight = OprErrLight;
	state.u.TempLight = TempLight;
	state.u.GimbalLockLight = GimbalLockLight;
	state.u.ProgLight = ProgLight;
	state.u.RestartLight = RestartLight;
	state.u.TrackerLight = TrackerLight;
	state.u.AltLight = AltLight;
	state.u.VelLight = VelLight;

	oapiWriteScenario_int (scn, "STATE", state.word);

	oapiWriteLine(scn, end_str);
}
예제 #25
0
void FCell::Save(FILEHANDLE scn)
{   char cbuf[50];
	sprintf (cbuf, "%i %0.4f ",status, clogg);
	oapiWriteScenario_string (scn, "    FCELL ", cbuf);
}
예제 #26
0
void Battery::Save(FILEHANDLE scn)
{   char cbuf[50];
	sprintf (cbuf, "%0.0f %0.4f %i",loading, power,c_breaker);
	oapiWriteScenario_string (scn, "    BATTERY ", cbuf);
}
예제 #27
0
void ACbus::Save(FILEHANDLE scn)
{   char cbuf[50];
	sprintf (cbuf, "%0.4f ",branch_amps);
	oapiWriteScenario_string (scn, "    AC ", cbuf);
}
예제 #28
0
void Fan::Save(FILEHANDLE scn)
{   char cbuf[20];
	sprintf (cbuf, "%i ",on);
	oapiWriteScenario_string (scn, "    FAN ", cbuf);
}
예제 #29
0
void Socket::Save(FILEHANDLE scn)
{   char cbuf[50];
	sprintf (cbuf, "%i",curent);
	oapiWriteScenario_string (scn, "    SOCKET ", cbuf);
}
예제 #30
0
파일: shiplist.cpp 프로젝트: Veterok/TransK
void shipptrs::savecurrent(FILEHANDLE scn)
{
	oapiWriteScenario_string(scn,"Ship ",shipname);
	state->savecurrent(scn);
}