void depsSetCWD(const char *cwd) { if (!inState(DEPS_STATE_INIT)) { setErr(DEPS_ERROR_NOT_INIT); return; } setErr(0); path_setcwd(cwd); }
void depsSearchStart(void) { if (!inState(DEPS_STATE_INIT)) { setErr(DEPS_ERROR_NOT_INIT); return; } search_init(); g_state |= DEPS_STATE_SEARCH; setErr(0); }
void depsStart(void) { if (inState(DEPS_STATE_INIT)) { setErr(DEPS_ERROR_ALREADY_INIT); return; } setErr(0); memset((char *) &g_stats, 0, sizeof(g_stats)); g_state |= DEPS_STATE_INIT; }
void depsGetStats(struct depsStats *stats) { if (!inState(DEPS_STATE_INIT)) { setErr(DEPS_ERROR_NOT_INIT); return; } setErr(0); *stats = g_stats; }
void UmlActivityObject::write_in_state(FileOut & out) { QCString s = inState(); if (!s.isEmpty()) { UmlState * st = UmlState::find(s); if (st != 0) out.ref(st, "inState"); else { // not legal but ... out << " inState=\""; out.quote(s); out << '"'; } } }
void depsTimeStamp(const char *path, time_t *time) { PATHSPLIT f; char buf[MAXJPATH]; if (!inState(DEPS_STATE_INIT)) { setErr(DEPS_ERROR_NOT_INIT); return; } setErr(0); path_split(path, &f); path_normalize(&f, NULL); path_tostring(&f, buf); timestamp(buf, time); }
void depsDone(void) { if (!inState(DEPS_STATE_INIT)) { setErr(DEPS_ERROR_NOT_INIT); return; } setErr(0); donestamps(); donestr(); donelist(); donehdrs(); donesearch(); donepath(); #ifdef USE_CACHE donecache(); #endif g_state = DEPS_STATE_DONE; }
RealArray PhysicalMeasurement::IonosphereCorrection(Real freq, Rvector3 r1, Rvector3 r2, Real epoch) { RealArray ionoCorrection; if (ionosphere != NULL) { // 1. Set wave length: Real wavelength = GmatPhysicalConstants::SPEED_OF_LIGHT_VACUUM / (freq*1.0e6); // unit: meter ionosphere->SetWaveLength(wavelength); // 2. Set time: ionosphere->SetTime(epoch); // unit: Julian day // 3. Set station and spacecraft positions: GroundstationInterface* gs = (GroundstationInterface*)participants[0]; CoordinateSystem* cs = gs->GetBodyFixedCoordinateSystem(); Rvector inState(6, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0); Rvector outState(6, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0); // Rvector bogusOut = cs->FromMJ2000Eq(epoch, bogusIn, true); // Rmatrix33 R_g_j2k = cs->GetLastRotationMatrix().Transpose(); CoordinateConverter* cv = new CoordinateConverter(); A1Mjd time(epoch); CoordinateSystem* fk5cs = Moderator::Instance()->GetCoordinateSystem("EarthMJ2000Eq"); cv->Convert(time, inState, cs, outState, fk5cs); // convert EarthFK5 coordinate system to EarthBodyFixed coordinate system Rmatrix33 R_g_j2k = cv->GetLastRotationMatrix().Transpose(); // MessageInterface::ShowMessage("[ %f %f %f\n", R_g_j2k.GetElement(0,0), R_g_j2k.GetElement(0,1), R_g_j2k.GetElement(0,2)); // MessageInterface::ShowMessage(" %f %f %f\n", R_g_j2k.GetElement(1,0), R_g_j2k.GetElement(1,1), R_g_j2k.GetElement(1,2)); // MessageInterface::ShowMessage(" %f %f %f]\n", R_g_j2k.GetElement(2,0), R_g_j2k.GetElement(2,1), R_g_j2k.GetElement(2,2)); ionosphere->SetStationPosition(R_g_j2k*r1); // unit: km ionosphere->SetSpacecraftPosition(R_g_j2k*r2); // unit: km // 4. Set earth radius: SpacePoint* earth = (SpacePoint*)gs->GetRefObject(Gmat::SPACE_POINT, "Earth"); Real earthRadius = earth->GetRealParameter("EquatorialRadius"); ionosphere->SetEarthRadius(earthRadius); // unit: km #ifdef DEBUG_IONOSPHERE_MEDIA_CORRECTION MessageInterface::ShowMessage(" *Run Ionosphere media correction for:\n"); MessageInterface::ShowMessage(" +Earth radius = %lf km\n", earthRadius); MessageInterface::ShowMessage(" +Wave length = %.12lf m\n", wavelength); MessageInterface::ShowMessage(" +Time = %.12lf\n", epoch); MessageInterface::ShowMessage(" +Station location in Earth body fixed coordinate system (km):\n" " (%s)", (R_g_j2k*r1).ToString().c_str()); MessageInterface::ShowMessage(" +Spacecraft location in Earth body fixed coordinate system (km):\n" " (%s)", (R_g_j2k*r2).ToString().c_str()); #endif // 5. Run ionosphere correction: ionoCorrection = ionosphere->Correction(); Real rangeCorrection = ionoCorrection[0]*GmatMathConstants::M_TO_KM; // unit: meter #ifdef DEBUG_IONOSPHERE_MEDIA_CORRECTION MessageInterface::ShowMessage(" *Ionosphere media correction result:\n"); MessageInterface::ShowMessage(" +Range correction = %.12lf m\n", rangeCorrection*GmatMathConstants::KM_TO_M); #endif } else { ionoCorrection.push_back(0.0); ionoCorrection.push_back(0.0); ionoCorrection.push_back(0.0); } return ionoCorrection; }