|
MRTKLIB 0.7.14
Modernized GNSS Positioning Library
|
#include "mrtklib/mrtk_options.h"#include <ctype.h>#include <stdio.h>#include <stdlib.h>#include <string.h>#include "mrtklib/mrtk_coords.h"#include "mrtklib/mrtk_nav.h"#include "mrtklib/mrtk_obs.h"#include "mrtklib/mrtk_toml.h"#include "mrtklib/mrtk_trace.h"Go to the source code of this file.
Macros | |
| #define | D2R (3.1415926535897932384626433832795 / 180.0) |
| #define | R2D (180.0 / 3.1415926535897932384626433832795) |
| #define | SWTOPT "0:off,1:on" |
| #define | ISBOPT "0:off,1:table,1:on" |
| #define | SEEDOPT "0:off,1:cn0+tdcp,2:cn0+tdcp+robust" |
| #define | MODOPT |
| #define | FRQOPT "1:l1,2:l1+2,2:l1+l2,3:l1+2+3,3:l1+l2+l5,4:l1+2+3+4,4:l1+l2+l5+l6,5:l1+2+3+4+5,5:l1+l2+l5+l6+l7" |
| #define | FRQOPT2 "1:l1,2:l1+l2,3:l1+l5,4:l1+l2+l5,5:l1+l5(l2)" |
| #define | TYPOPT "0:forward,1:backward,2:combined" |
| #define | IONOPT "0:off,1:brdc,2:sbas,3:dual-freq,4:est-stec,5:ionex-tec,6:qzs-brdc,9:est-adaptive" |
| #define | TRPOPT "0:off,1:saas,2:sbas,3:est-ztd,4:est-ztdgrad" |
| #define | EPHOPT "0:brdc,1:precise,2:brdc+sbas,3:brdc+ssrapc,4:brdc+ssrcom" |
| #define | ROBOPT "0:off,1:igg3" |
| #define | NAVOPT "1:gps+2:sbas+4:glo+8:gal+16:qzs+32:bds+64:navic" |
| #define | GAROPT "0:off,1:on" |
| #define | SOLOPT "0:llh,1:xyz,2:enu,3:nmea" |
| #define | TSYOPT "0:gpst,1:utc,2:jst" |
| #define | TFTOPT "0:tow,1:hms" |
| #define | DFTOPT "0:deg,1:dms" |
| #define | HGTOPT "0:ellipsoidal,1:geodetic" |
| #define | GEOOPT "0:internal,1:egm96,2:egm08_2.5,3:egm08_1,4:gsi2000" |
| #define | STAOPT "0:all,1:single" |
| #define | STSOPT "0:off,1:state,2:residual" |
| #define | ARMOPT "0:off,1:continuous,2:instantaneous,3:fix-and-hold" |
| #define | POSOPT "0:llh,1:xyz,2:single,3:posfile,4:rinexhead,5:rtcm,6:raw" |
| #define | TIDEOPT "0:off,1:on,2:otl,3:solid+otl-clasgrid+pole" |
| #define | PHWOPT "0:off,1:on,2:precise" |
| #define | SIGOPT1 "0:L1/L2,1:L1/L5,2:L1/L2/L5" |
| #define | SIGOPT2 "0:L1/L5,1:L1/L2,2:L1/L5/L2" |
| #define | SIGOPT3 "0:E1/E5a,1:E1/E5b,2:E1/E6,3:E1/E5a/E5b/E6,4:E1/E5a/E6/E5b" |
| #define | SIGOPT4 "0:B1I/B3I,1:B1I/B2I,2:B1I/B3I/B2I" |
| #define | SIGOPT5 "0:B1I/B3I,1:B1I/B2a,2:B1I/B3I/B2a" |
| #define | COMOPT "0:off,1:ssr,2:meas" |
| #define | ARALPHAOPT "0:0.1%,1:0.5%,2:1%,3:5%,4:10%,5:20%" |
| #define | PSHFTOPT "0:off,1:table" |
| #define | DOPOPT "0:zd,1:sd" |
| #define | SATCB "0:auto,1:ssr,2:bia,3:dcb" |
| #define | SATPB "0:auto,1:ssr,2:bia,3:fcb" |
| #define | CORROPT "-1:auto,0:none,1:igs,2:igs-rts,3:qzs-madoca,4:gal-has,5:bds-b2b,6:qzs-clas" |
| #define | BDS2OPT "satid(C01-C18),.. BDS-2 in PRN 1-18 (\"\":no BDS-2)" |
| #define | IGSOOPT "satid,.. BDS-3 IGSO (\"\":C06-C08)" |
Functions | |
| static void | chop (char *str) |
| static int | enum2str (char *s, const char *comment, int val) |
| static int | str2enum (const char *str, const char *comment, int *val) |
| opt_t * | searchopt (const char *name, const opt_t *opts) |
| Search option record. | |
| int | str2opt (opt_t *opt, const char *str) |
| Convert string to option value. | |
| int | opt2str (const opt_t *opt, char *str) |
| Convert option value to string. | |
| int | opt2buf (const opt_t *opt, char *buff) |
| Convert option to string (keyword=value # comment). | |
| int | loadopts (const char *file, opt_t *opts) |
| Load options from file. | |
| int | saveopts (const char *file, const char *mode, const char *comment, const opt_t *opts) |
| Save options to file. | |
| static void | buff2sysopts (void) |
| static void | sysopts2buff (void) |
| void | resetsysopts (void) |
| Reset system options to default. | |
| void | getsysopts (prcopt_t *popt, solopt_t *sopt, filopt_t *fopt) |
| Get system options. | |
| void | setsysopts (const prcopt_t *prcopt, const solopt_t *solopt, const filopt_t *filopt) |
| Set system options. | |
Variables | |
| static prcopt_t | prcopt_ |
| static solopt_t | solopt_ |
| static filopt_t | filopt_ |
| static int | antpostype_ [2] |
| static double | elmask_ |
| static double | elmaskar_ |
| static double | elmaskhold_ |
| static double | antpos_ [2][3] |
| static char | exsats_ [1024] |
| static char | snrmask_ [5][1024] |
| static char | signals_ [1024] |
| static int | bds2prn_given_ |
| opt_t | sysopts [] |
| System options table. | |
| #define ARALPHAOPT "0:0.1%,1:0.5%,2:1%,3:5%,4:10%,5:20%" |
Definition at line 82 of file mrtk_options.c.
| #define ARMOPT "0:off,1:continuous,2:instantaneous,3:fix-and-hold" |
Definition at line 72 of file mrtk_options.c.
| #define BDS2OPT "satid(C01-C18),.. BDS-2 in PRN 1-18 (\"\":no BDS-2)" |
Definition at line 88 of file mrtk_options.c.
| #define COMOPT "0:off,1:ssr,2:meas" |
Definition at line 81 of file mrtk_options.c.
| #define CORROPT "-1:auto,0:none,1:igs,2:igs-rts,3:qzs-madoca,4:gal-has,5:bds-b2b,6:qzs-clas" |
Definition at line 87 of file mrtk_options.c.
| #define D2R (3.1415926535897932384626433832795 / 180.0) |
Definition at line 31 of file mrtk_options.c.
| #define DFTOPT "0:deg,1:dms" |
Definition at line 67 of file mrtk_options.c.
| #define DOPOPT "0:zd,1:sd" |
Definition at line 84 of file mrtk_options.c.
| #define EPHOPT "0:brdc,1:precise,2:brdc+sbas,3:brdc+ssrapc,4:brdc+ssrcom" |
Definition at line 60 of file mrtk_options.c.
| #define FRQOPT "1:l1,2:l1+2,2:l1+l2,3:l1+2+3,3:l1+l2+l5,4:l1+2+3+4,4:l1+l2+l5+l6,5:l1+2+3+4+5,5:l1+l2+l5+l6+l7" |
Definition at line 55 of file mrtk_options.c.
| #define FRQOPT2 "1:l1,2:l1+l2,3:l1+l5,4:l1+l2+l5,5:l1+l5(l2)" |
Definition at line 56 of file mrtk_options.c.
| #define GAROPT "0:off,1:on" |
Definition at line 63 of file mrtk_options.c.
| #define GEOOPT "0:internal,1:egm96,2:egm08_2.5,3:egm08_1,4:gsi2000" |
Definition at line 69 of file mrtk_options.c.
| #define HGTOPT "0:ellipsoidal,1:geodetic" |
Definition at line 68 of file mrtk_options.c.
| #define IGSOOPT "satid,.. BDS-3 IGSO (\"\":C06-C08)" |
Definition at line 89 of file mrtk_options.c.
| #define IONOPT "0:off,1:brdc,2:sbas,3:dual-freq,4:est-stec,5:ionex-tec,6:qzs-brdc,9:est-adaptive" |
Definition at line 58 of file mrtk_options.c.
| #define ISBOPT "0:off,1:table,1:on" |
Definition at line 50 of file mrtk_options.c.
| #define MODOPT |
Definition at line 52 of file mrtk_options.c.
| #define NAVOPT "1:gps+2:sbas+4:glo+8:gal+16:qzs+32:bds+64:navic" |
Definition at line 62 of file mrtk_options.c.
| #define PHWOPT "0:off,1:on,2:precise" |
Definition at line 75 of file mrtk_options.c.
| #define POSOPT "0:llh,1:xyz,2:single,3:posfile,4:rinexhead,5:rtcm,6:raw" |
Definition at line 73 of file mrtk_options.c.
| #define PSHFTOPT "0:off,1:table" |
Definition at line 83 of file mrtk_options.c.
| #define R2D (180.0 / 3.1415926535897932384626433832795) |
Definition at line 32 of file mrtk_options.c.
| #define ROBOPT "0:off,1:igg3" |
Definition at line 61 of file mrtk_options.c.
| #define SATCB "0:auto,1:ssr,2:bia,3:dcb" |
Definition at line 85 of file mrtk_options.c.
| #define SATPB "0:auto,1:ssr,2:bia,3:fcb" |
Definition at line 86 of file mrtk_options.c.
| #define SEEDOPT "0:off,1:cn0+tdcp,2:cn0+tdcp+robust" |
Definition at line 51 of file mrtk_options.c.
| #define SIGOPT1 "0:L1/L2,1:L1/L5,2:L1/L2/L5" |
Definition at line 76 of file mrtk_options.c.
| #define SIGOPT2 "0:L1/L5,1:L1/L2,2:L1/L5/L2" |
Definition at line 77 of file mrtk_options.c.
| #define SIGOPT3 "0:E1/E5a,1:E1/E5b,2:E1/E6,3:E1/E5a/E5b/E6,4:E1/E5a/E6/E5b" |
Definition at line 78 of file mrtk_options.c.
| #define SIGOPT4 "0:B1I/B3I,1:B1I/B2I,2:B1I/B3I/B2I" |
Definition at line 79 of file mrtk_options.c.
| #define SIGOPT5 "0:B1I/B3I,1:B1I/B2a,2:B1I/B3I/B2a" |
Definition at line 80 of file mrtk_options.c.
| #define SOLOPT "0:llh,1:xyz,2:enu,3:nmea" |
Definition at line 64 of file mrtk_options.c.
| #define STAOPT "0:all,1:single" |
Definition at line 70 of file mrtk_options.c.
| #define STSOPT "0:off,1:state,2:residual" |
Definition at line 71 of file mrtk_options.c.
| #define SWTOPT "0:off,1:on" |
Definition at line 49 of file mrtk_options.c.
| #define TFTOPT "0:tow,1:hms" |
Definition at line 66 of file mrtk_options.c.
| #define TIDEOPT "0:off,1:on,2:otl,3:solid+otl-clasgrid+pole" |
Definition at line 74 of file mrtk_options.c.
| #define TRPOPT "0:off,1:saas,2:sbas,3:est-ztd,4:est-ztdgrad" |
Definition at line 59 of file mrtk_options.c.
| #define TSYOPT "0:gpst,1:utc,2:jst" |
Definition at line 65 of file mrtk_options.c.
| #define TYPOPT "0:forward,1:backward,2:combined" |
Definition at line 57 of file mrtk_options.c.
|
static |
Definition at line 559 of file mrtk_options.c.
References antpos_, antpostype_, bds2prn_given_, D2R, elmask_, elmaskar_, elmaskhold_, exsats_, MAXSAT, mrtk_sigcfg_from_signals(), mrtk_sigcfg_to_obsdef(), pos2ecef(), prcopt_, satid2no(), signals_, snrmask_, and trace().
Referenced by getsysopts().
|
static |
Definition at line 304 of file mrtk_options.c.
Referenced by loadopts().
|
static |
Definition at line 314 of file mrtk_options.c.
Referenced by opt2str().
Get system options.
| [out] | popt | Processing options (NULL: no output) |
| [out] | sopt | Solution options (NULL: no output) |
| [out] | fopt | File options (NULL: no output) |
Definition at line 738 of file mrtk_options.c.
References buff2sysopts(), filopt_, prcopt_, solopt_, and trace().
|
extern |
Load options from file.
| [in] | file | Options file |
| [in,out] | opts | Options table (terminated with name="") |
Definition at line 464 of file mrtk_options.c.
References chop(), loadopts_toml(), searchopt(), str2opt(), and trace().
|
extern |
Convert option to string (keyword=value # comment).
| [in] | opt | Option |
| [out] | buff | Option string |
Definition at line 441 of file mrtk_options.c.
References opt_t::comment, opt_t::name, opt2str(), and trace().
Referenced by saveopts().
|
extern |
Convert option value to string.
| [in] | opt | Option |
| [out] | str | Option value string |
Definition at line 414 of file mrtk_options.c.
References opt_t::comment, enum2str(), opt_t::format, opt_t::name, trace(), and opt_t::var.
Referenced by opt2buf(), and saveopts_toml().
|
extern |
Reset system options to default.
Definition at line 700 of file mrtk_options.c.
References antpos_, antpostype_, bds2prn_given_, elmask_, elmaskar_, elmaskhold_, exsats_, filopt_, prcopt_, prcopt_default, signals_, solopt_, solopt_default, and trace().
Referenced by setsysopts().
|
extern |
Save options to file.
| [in] | file | Options file |
| [in] | mode | Write mode ("w":overwrite, "a":append; append is not supported for a .toml file and returns 0) |
| [in] | comment | Header comment (NULL: no comment) |
| [in] | opts | Options table (terminated with name="") |
Definition at line 523 of file mrtk_options.c.
References opt_t::name, opt2buf(), saveopts_toml(), and trace().
Search option record.
| [in] | name | Option name |
| [in] | opts | Options table (terminated with name="") |
Definition at line 364 of file mrtk_options.c.
References opt_t::name, and trace().
Referenced by loadopts(), loadopts_toml(), and saveopts_toml().
|
extern |
Set system options.
| [in] | prcopt | Processing options (NULL: default) |
| [in] | solopt | Solution options (NULL: default) |
| [in] | filopt | File options (NULL: default) |
Definition at line 760 of file mrtk_options.c.
References filopt_, prcopt_, resetsysopts(), solopt_, sysopts2buff(), and trace().
|
static |
Definition at line 331 of file mrtk_options.c.
Referenced by str2opt().
|
extern |
Convert string to option value.
| [out] | opt | Option |
| [in] | str | Option value string |
Definition at line 382 of file mrtk_options.c.
References bds2prn_given_, opt_t::comment, opt_t::format, prcopt_, str2enum(), and opt_t::var.
Referenced by loadopts(), and loadopts_toml().
|
static |
Definition at line 653 of file mrtk_options.c.
References antpos_, antpostype_, bds2prn_given_, ecef2pos(), elmask_, elmaskar_, elmaskhold_, exsats_, MAXSAT, prcopt_, R2D, satno2id(), and snrmask_.
Referenced by setsysopts().
|
static |
Definition at line 42 of file mrtk_options.c.
Referenced by buff2sysopts(), resetsysopts(), and sysopts2buff().
|
static |
Definition at line 40 of file mrtk_options.c.
Referenced by buff2sysopts(), resetsysopts(), and sysopts2buff().
|
static |
Definition at line 46 of file mrtk_options.c.
Referenced by buff2sysopts(), resetsysopts(), str2opt(), and sysopts2buff().
|
static |
Definition at line 41 of file mrtk_options.c.
Referenced by buff2sysopts(), resetsysopts(), and sysopts2buff().
|
static |
Definition at line 41 of file mrtk_options.c.
Referenced by buff2sysopts(), resetsysopts(), and sysopts2buff().
|
static |
Definition at line 41 of file mrtk_options.c.
Referenced by buff2sysopts(), resetsysopts(), and sysopts2buff().
|
static |
Definition at line 43 of file mrtk_options.c.
Referenced by buff2sysopts(), resetsysopts(), and sysopts2buff().
|
static |
Definition at line 39 of file mrtk_options.c.
Referenced by getsysopts(), resetsysopts(), and setsysopts().
|
static |
Definition at line 37 of file mrtk_options.c.
Referenced by buff2sysopts(), getsysopts(), resetsysopts(), setsysopts(), str2opt(), and sysopts2buff().
|
static |
Definition at line 45 of file mrtk_options.c.
Referenced by buff2sysopts(), and resetsysopts().
|
static |
Definition at line 44 of file mrtk_options.c.
Referenced by buff2sysopts(), and sysopts2buff().
|
static |
Definition at line 38 of file mrtk_options.c.
Referenced by getsysopts(), resetsysopts(), and setsysopts().
| opt_t sysopts[] |
System options table.
Definition at line 90 of file mrtk_options.c.