Skip to content

Commit

Permalink
- Use current date to plot solution streams without date info (restor…
Browse files Browse the repository at this point in the history
…ed from b33)
  • Loading branch information
rtklibexplorer committed Jun 5, 2021
1 parent 33210e0 commit b99d1ef
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions app/winapp/rtkplot/plotdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,13 @@ static const char *XMLNS="http://www.topografix.com/GPX/1/1";
// read solutions -----------------------------------------------------------
void __fastcall TPlot::ReadSol(TStrings *files, int sel)
{
FILETIME tc,ta,tw;
SYSTEMTIME st;
HANDLE h;
solbuf_t sol={0};
AnsiString s;
gtime_t ts,te;
double tint;
double tint,ep[6];
int i,n=0;
char *paths[MAXNFILE];

Expand All @@ -33,7 +36,24 @@ void __fastcall TPlot::ReadSol(TStrings *files, int sel)
if (files->Count<=0) return;

ReadWaitStart();

/* Set default to current date in case no date info in solution (e.g. GGA msgs)*/
s=files->Strings[0];

if ((h=CreateFile(s.c_str(),GENERIC_READ,0,NULL,OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,0))==INVALID_HANDLE_VALUE) {
return;
}
GetFileTime(h,&tc,&ta,&tw);
CloseHandle(h);
FileTimeToSystemTime(&tc,&st); // file create time
ep[0]=st.wYear;
ep[1]=st.wMonth;
ep[2]=st.wDay;
ep[3]=st.wHour;
ep[4]=st.wMinute;
ep[5]=st.wSecond;
sol.time=utc2gpst(epoch2time(ep));

for (i=0;i<files->Count&&n<MAXNFILE;i++) {
strcpy(paths[n++],U2A(files->Strings[i]).c_str());
}
Expand Down Expand Up @@ -924,7 +944,7 @@ void __fastcall TPlot::ReadStaPos(const char *file, const char *sta,
break;
}
}
fclose(fp);
fclose(fp);
}
// save dop -----------------------------------------------------------------
void __fastcall TPlot::SaveDop(AnsiString file)
Expand Down

0 comments on commit b99d1ef

Please sign in to comment.