// ============================================================================================================================================== // void Orbit::SetTime(double t) { if (Defined()) { timeto=0; time=oapiGetSimMJD()+(t/86400); } }
void ShipInternal::Refresh(double dt) { H_systems.Refresh(dt); E_systems.Refresh(dt); if (mjd_d==1) { double mjd=oapiGetSimMJD(); mjd=mjd-(int)mjd; if (mjd<0) mjd+=1; mjd*=3600*24; int hh=(int)(mjd/3600); if (hh*3600>mjd) hh--; if (hh>23) while (hh>23) hh-=24; int mm=((mjd-hh*3600)/60); int ss=(mjd-hh*3600-mm*60); sprintf(Clk->time,"%2i:%2i:%2i",hh,mm,ss); }; //2 crew members use 0.075 grams of O2/sec float Lungs=Tanks[10]->Flow(0.075,dt); Tanks[12]->PutMass(Lungs*dt,Tanks[10]->Temp); //cabin related stuff float temp_press; Cabin_temp=(Tanks[10]->Temp+Tanks[12]->Temp+Tanks[11]->Temp)/3-273.3; temp_press=(Tanks[10]->Press+Tanks[12]->Press+Tanks[11]->Press); Cabin_dp=(Cabin_press-temp_press)/dt;Cabin_press=temp_press; //docking hatch related Dock_temp=(Tanks[13]->Temp+Tanks[14]->Temp+Tanks[15]->Temp)/3-273.3; temp_press=(Tanks[13]->Press+Tanks[14]->Press+Tanks[15]->Press); Dock_dp=(Dock_press-temp_press)/dt;Dock_press=temp_press; Fan_dp=Tanks[16]->Press-Tanks[12]->Press; // oapi };
// ============================================================================================================================================== // double Orbit::GetTime() { if (Defined()) { if (timeto>0) return timeto; timeto=(time-oapiGetSimMJD())*86400; if (timeto<0) timeto=0; return timeto; } else return 0; }