Skip to content

Commit

Permalink
- Support half-cycle correction option for u-blox receivers
Browse files Browse the repository at this point in the history
- Reset obs structure before reuse during conversion to rinex
- Fix bug in RTKPOST makefile
  • Loading branch information
rtklibexplorer committed Mar 21, 2023
1 parent d95376c commit e213f65
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 17 deletions.
2 changes: 1 addition & 1 deletion app/winapp/rtkpost/postmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ void __fastcall TMainForm::FormCreate(TObject *Sender)
{
AnsiString s;

Caption=s.sprintf("%s ver.%s %s",PRGNAME,VER_RTKLIB,PATCH_LEVEL);
Caption=s.sprintf("%s %s %s",PRGNAME,VER_RTKLIB,PATCH_LEVEL);

::DragAcceptFiles(Handle,true);
}
Expand Down
2 changes: 1 addition & 1 deletion app/winapp/rtkpost/rtkpost.cbproj
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<DCC_UnitSearchPath>..\..\..\rtklib_extlex;..\..\extlex;..\..\extion;..\..\src\qzsext;..\appcmn;..\..\src\rcv;..\src;..\..\src;K:\proj\rtklib_1.1\util\gui;C:\Documents and Settings\TTAKA\My Documents\Borland Studio Projects;$(BDS)\lib;$(BDS)\lib\obj;$(DCC_UnitSearchPath)</DCC_UnitSearchPath>
<DCC_ResourcePath>..\..\..\rtklib_extlex;..\..\extlex;..\..\extion;..\..\src\qzsext;..\appcmn;..\..\src\rcv;..\src;..\..\src;K:\proj\rtklib_1.1\util\gui;$(DCC_ResourcePath)</DCC_ResourcePath>
<DCC_CBuilderOutput>JPHNE</DCC_CBuilderOutput>
<BCC_Defines>WIN32;TRACE;ENAGLO;ENAGAL;ENAQZS;ENACMP;ENAIRN;NFREQ=3;EXOBS=3;$(BCC_Defines)</BCC_Defines>
<BCC_Defines>WIN32;TRACE;ENAGLO;ENAGAL;ENAQZS;ENACMP;ENAIRN;NFREQ=3;NEXOBS=3;$(BCC_Defines)</BCC_Defines>
</PropertyGroup>
<PropertyGroup Condition="'$(Base_Win32)'!=''">
<AppEnableRuntimeThemes>true</AppEnableRuntimeThemes>
Expand Down
35 changes: 23 additions & 12 deletions src/convrnx.c
Original file line number Diff line number Diff line change
Expand Up @@ -642,30 +642,35 @@ static void update_halfc(strfile_t *str, obsd_t *obs)

for (i=0;i<NFREQ+NEXOBS;i++) {
if (obs->L[i]==0.0) continue;


/* if no list, start list */
if (!str->halfc[sat-1][i]) {
if (!add_halfc(str,sat,i,obs->time)) continue;
}
if (obs->LLI[i]&LLI_SLIP) {
/* reset list if true cycle slip */
if ((obs->LLI[i]&LLI_SLIP)&&!(obs->LLI[i]&(LLI_HALFA|LLI_HALFS))) {
str->halfc[sat-1][i]->stat=0;
}
if (obs->LLI[i]&LLI_HALFC) { /* halfcyc unknown */
if (obs->LLI[i]&LLI_HALFC) { /* halfcyc unresolved */
/* if new list, set unresolved start epoch */
if (str->halfc[sat-1][i]->stat==0) {
str->halfc[sat-1][i]->ts=obs->time;
}
/* update unresolved end epoch and set status to active */
str->halfc[sat-1][i]->te=obs->time;
str->halfc[sat-1][i]->stat=1; /* unresolved */
}
else if (str->halfc[sat-1][i]->stat==1) { /* halfcyc unknown -> known */
str->halfc[sat-1][i]->stat=1;
} /* else if resolved, update status */
else if (str->halfc[sat-1][i]->stat==1) {
if (obs->LLI[i]&LLI_HALFA) {
str->halfc[sat-1][i]->stat=2; /* resolved with added */
str->halfc[sat-1][i]->stat=2; /* resolved with add */
}
else if (obs->LLI[i]&LLI_HALFS) {
str->halfc[sat-1][i]->stat=3; /* resolved with subtracted */
str->halfc[sat-1][i]->stat=3; /* resolved with subtract */
}
else {
str->halfc[sat-1][i]->stat=4; /* resolved with none */
str->halfc[sat-1][i]->stat=4; /* resolved with no adjust */
}
/* create new list entry */
if (!add_halfc(str,sat,i,obs->time)) continue;
}
}
Expand Down Expand Up @@ -705,7 +710,7 @@ static void resolve_halfc(const strfile_t *str, obsd_t *data, int n)
if (p->stat<=1) continue; /* unresolved half cycle */
if (timediff(data[i].time,p->ts)<-DTTOL||
timediff(data[i].time,p->te)> DTTOL) continue;

if (p->stat==2) { /* add half cycle */
data[i].L[j]+=0.5;
}
Expand Down Expand Up @@ -1042,7 +1047,7 @@ static void convobs(FILE **ofp, rnxopt_t *opt, strfile_t *str, int *n,

n[0]++;
}
/* convert navigattion data --------------------------------------------------*/
/* convert navigation data --------------------------------------------------*/
static void convnav(FILE **ofp, rnxopt_t *opt, strfile_t *str, int *n)
{
gtime_t ts;
Expand Down Expand Up @@ -1300,14 +1305,20 @@ static int convrnx_s(int sess, int format, rnxopt_t *opt, const char *file,
free_strfile(str);
return 0;
}
/* reset obs structure before reusing */
if (!(str=gen_strfile(format,opt->rcvopt))) {
for (i=0;i<MAXEXFILE;i++) free(epath[i]);
free_strfile(str);
return 0;
}
str->time=str->tstart;

for (i=0;i<nf&&!abort;i++) {
if (!mask[i]) continue;

/* open stream file */
if (!open_strfile(str,epath[i])) continue;

/* input message */
for (j=0;(type=input_strfile(str))>=-1;j++) {

Expand Down
8 changes: 5 additions & 3 deletions src/rcv/ublox.c
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,12 @@ static int decode_rxmrawx(raw_t *raw)
if (slip) raw->lockflag[sat-1][idx]=slip;
raw->lockt[sat-1][idx]=lockt*1E-3;
raw->halfc[sat-1][idx]=halfc;
/* LLI: bit1=slip,bit2=half-cycle-invalid ??? */
/* LLI: bit0=slip,bit1=half-cycle-unresolved */
LLI=!halfv&&L!=0.0?LLI_HALFC:0;
/* set cycle slip if half cycle bit changed state */
LLI|=halfc!=raw->halfc[sat-1][idx]?1:0;
/* half cycle adjusted */
LLI|=halfc?LLI_HALFA:0;
/* set cycle slip if half cycle subtract bit changed state */
LLI|=halfc!=raw->halfc[sat-1][idx]?LLI_SLIP:0;
/* set cycle slip flag if first valid phase since slip */
if (L!=0.0) LLI|=raw->lockflag[sat-1][idx]>0.0?LLI_SLIP:0;

Expand Down

0 comments on commit e213f65

Please sign in to comment.