#ifndef __GPS_COMMON_H #define __GPS_COMMON_H #define IS_LITTLE_ENDIAN 1 #include "SylphideProcessor.h" #include "GPS.h" template struct EphemerisConverter : public SylphideProcessor::G_Observer_t::ephemeris_t { typedef typename SylphideProcessor::G_Observer_t::ephemeris_t super_t; const int cycles; EphemerisConverter( const super_t &orig, const int cycle_NO = 0) : super_t(orig), cycles(cycle_NO) {} ~EphemerisConverter(){} operator typename GPS_SpaceNode::Satellite::Ephemeris() const { typename GPS_SpaceNode::Satellite::Ephemeris res; #define CONVERT(item1, item2) res.item1 = super_t::item2; CONVERT (svid, sv_number); // 衛星番号 // Subframe.1 CONVERT (WN, wn); // 週番号 res.WN += 1024 * cycles; CONVERT (URA, ura); // 測距精度 CONVERT (SV_health, sv_health); // 衛星健康状態 CONVERT (iodc, iodc); // クロック情報番号 CONVERT (t_GD, t_gd); // 郡遅延 (s) CONVERT (t_oc, t_oc); // エポック時刻 CONVERT (a_f2, a_f2); // クロック補正係数 (s/s^2) CONVERT (a_f1, a_f1); // クロック補正係数 (s/s) CONVERT (a_f0, a_f0); // クロック補正係数 (s) // Subframe.2 CONVERT (iode, iode); // 軌道情報番号 CONVERT (c_rs, c_rs); // 軌道補正係数 (m) CONVERT (delta_n, delta_n); // (rad/s) CONVERT (m0, m_0); // 平均近点角 (rad) CONVERT (c_uc, c_uc); // 軌道補正係数 (rad) CONVERT (e, e); // 離心率 CONVERT (c_us, c_us); // 軌道補正係数 (rad) CONVERT (sqrt_A, root_a); // 軌道半径 (sqrt(m)) CONVERT (t_oe, t_oe); // エポック時間 (s) // Subframe.3 CONVERT (c_ic, c_ic); // 軌道補正係数 (rad) CONVERT (Omega0, omega_0); // 昇交点赤経 (rad) CONVERT (c_is, c_is); // 軌道補正係数 (rad) CONVERT (i0, i_0); // 軌道傾斜角 (rad) CONVERT (c_rc, c_rc); // 軌道補正係数 (m) CONVERT (omega, omega); // 近地点引数 (rad) CONVERT (dot_Omega0, omega_0_dot);// Omega0変化率 (rad/s) CONVERT (dot_i0, i_0_dot); // i0変化率 (rad/s) // フィット間隔 (ICD:20.3.4.4) if(super_t::fit == false){ // normal operation res.fit_interval = 4 * 60 * 60; }else{ // short/long-trem extended operation if(res.iodc >= 240 && res.iodc <= 247){ res.fit_interval = 8 * 60 * 60; }else if((res.iodc >= 248 && res.iodc <= 255) || (res.iodc == 496)){ res.fit_interval = 14 * 60 * 60; }else if(res.iodc >= 497 && res.iodc <= 503){ res.fit_interval = 26 * 60 * 60; }else if(res.iodc >= 504 && res.iodc <= 510){ res.fit_interval = 50 * 60 * 60; }else if((res.iodc == 511) || (res.iodc >= 752 && res.iodc <= 756)){ res.fit_interval = 74 * 60 * 60; }else if(res.iodc >= 757 && res.iodc <= 763){ res.fit_interval = 98 * 60 * 60; }else if((res.iodc >= 764 && res.iodc <= 767) || (res.iodc >= 1008 && res.iodc <= 1010)){ res.fit_interval = 122 * 60 * 60; }else if(res.iodc >= 1011 && res.iodc <= 1020){ res.fit_interval = 146 * 60 * 60; }else{ res.fit_interval = 6 * 60 * 60; } } #undef CONVERT return res; } }; #endif /* __GPS_COMMON_H */