Skip to content

Commit

Permalink
convrnx: reinitialize the raw state between passes
Browse files Browse the repository at this point in the history
  • Loading branch information
ourairquality committed Sep 4, 2024
1 parent 2aaf692 commit 7c0544e
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions src/convrnx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1306,6 +1306,45 @@ static int convrnx_s(int sess, int format, rnxopt_t *opt, const char *file,
}
str->time=str->tstart;

// Reinitialize the input state. Don't want decoding state from the
// end of the scanning pass to affect the start of the next pass.
if (str->format == STRFMT_RTCM2 || str->format == STRFMT_RTCM3) {
free_rtcm(&str->rtcm);
if (!init_rtcm(&str->rtcm)) {
showmsg("init rtcm error");
for (int i = 0; i < MAXEXFILE; i++) free(epath[i]);
free_strfile(str);
return 0;
}
strcpy(str->rtcm.opt, opt->rcvopt);
} else if (str->format <= MAXRCVFMT) {
free_raw(&str->raw);
if (!init_raw(&str->raw, str->format)) {
showmsg("reinit raw error");
for (int i = 0; i < MAXEXFILE; i++) free(epath[i]);
free_strfile(str);
return 0;
}
strcpy(str->raw.opt, opt->rcvopt);
} else if (format == STRFMT_RINEX) {
free_rnxctr(&str->rnx);
if (!init_rnxctr(&str->rnx)) {
showmsg("reinit rnx error");
for (int i = 0; i < MAXEXFILE; i++) free(epath[i]);
free_strfile(str);
return 0;
}
strcpy(str->rnx.opt, opt->rcvopt);
}

// Don't want saved slips from the scanning pass to be flagged at
// the start of the next pass. But do want to retain the halfc data.
for (int i = 0; i < MAXSAT; i++) {
for (int j = 0; j < NFREQ + NEXOBS; j++) {
str->slips[i][j] = 0;
}
}

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

Expand Down

0 comments on commit 7c0544e

Please sign in to comment.