HUGE UPDATES:

1. Realize the full gui program
2. Complete the plot function
This commit is contained in:
KenanZhu111 committed 2024-10-05 18:20:41 +08:00
1 parent 37473233c2
commit b013a7fa02
16 files changed
+249 -307657

No files matched your search

+30 -10
View File
@@ -3,6 +3,7 @@
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<time.h>
#include"public.h"
@@ -68,8 +69,35 @@ pos_ts gps_pos(int sPRN, int best_epoch, double GPSsec,
void sat_gps_pos_clac(FILE * result_file,
pnav_body nav_b, pobs_epoch obs_e, pobs_body obs_b,
pobs_head obs_h,
int o_epochnum, int gps_satnum, char res_file[MAX_PATH])
int o_epochnum, int gps_satnum,
char res_file[MAX_PATH], char obs_file[MAX_PATH], char nav_file[MAX_PATH],
int ionosopt, int tropoopt)
{
time_t gen_time;
time(&gen_time);
stations station = { 0 };
xyz2blh tem2 = { 0 };
tem2 = XYZ2BLH(tem2, obs_h->apX, obs_h->apY, obs_h->apZ);
station.B = tem2.B;
station.L = tem2.L;
station.H = tem2.H;
result_file = fopen(res_file, "w");
fclose(result_file);
result_file = fopen(res_file, "a+");
fprintf(result_file, "@ GENERATE PROGRAM : SPP Calculate v0.4.7\n");
fprintf(result_file, "@ GENERATE TYPE : Satellite Position\n" );
fprintf(result_file, "@ GENERATE TIME : %s", ctime(&gen_time));
fprintf(result_file, "@ OBS FILE PATH : %s\n", obs_file);
fprintf(result_file, "@ NAV FILE PATH : %s\n", nav_file);
fprintf(result_file, "@ APPROX POSITION XYZ: %13.04f%13.04f%13.04f\n@ APPROX POSITION BLH: %12.07f %12.07f %12.07f\n"
,obs_h->apX ,obs_h->apY ,obs_h->apZ
,station.B ,station.L,station.H);
if (ionosopt == 0) { fprintf(result_file, "@ IONOS OPT : NULL\n"); }
if (ionosopt == 1) { fprintf(result_file, "@ IONOS OPT : DEFAULT\n"); }
if (tropoopt == 0) { fprintf(result_file, "@ TROPO OPT : NULL\n@\n\n"); }
if (tropoopt == 1) { fprintf(result_file, "@ TROPO OPT : DEFAULT\n@\n\n"); }
fclose(result_file);
for (int i = 0; i < o_epochnum; i++)//第i个历元
{
result_file = fopen(res_file, "a+");
@@ -84,7 +112,6 @@ void sat_gps_pos_clac(FILE * result_file,
double sec = obs_e[i].sec;
xyz2blh tem1 = { 0 };
xyz2blh tem2 = { 0 };
blh2enu tem3 = { 0 };
rahcal tem4 = { 0 };
deg2dms temb = { 0 };
@@ -94,14 +121,12 @@ void sat_gps_pos_clac(FILE * result_file,
enus enu = { 0 };
rahs rah = { 0 };
pos_ts pos_t = { 0 };
stations station = { 0 };
for (int j = 0; j < obs_e[i].gps_num; j++)//第j颗GPS卫星
{
double GPSsec = Time2GPSsec(y, m, d, h, min, sec);//转换为GPS周内秒
int sPRN = obs_e[i].sPRN_GPS[j];
int best_epoch = select_epoch(GPSsec, sPRN, nav_b, gps_satnum); //遍历N文件GPS卫星数据块,寻找最佳历元
double detat_toc = GPSsec - nav_b[best_epoch].TOE;//观测时刻 - 参考时刻
station.delta_TR == 0.0;
//计算近似的信号传播时间,接收机钟差已初始化为0(伪距/光速-接收机钟差+卫星钟差)
pos_t.delta_t[sPRN] = (obs_b[i].obs_gps[j][Code2Type(C1C, obs_h->obstypenum_gps, obs_h->obscode_gps)] / C_V) - station.delta_TR + nav_b[best_epoch].sa0 + nav_b[best_epoch].sa1 * detat_toc + nav_b[best_epoch].sa2 * pow(detat_toc, 2);
pos_t.deltat[sPRN] = 0.0;//判断收敛
@@ -115,11 +140,6 @@ void sat_gps_pos_clac(FILE * result_file,
blh.B = rad2deg(tem1.B);
blh.L = rad2deg(tem1.L);
blh.H = tem1.H;
tem2 = XYZ2BLH( tem2, obs_h->apX, obs_h->apY, obs_h->apZ);
station.B = tem2.B;
station.L = tem2.L;
station.H = tem2.H;
/* -------------------------------------------------------------------------- */
/* ----------------------------- 经纬大地高坐标系转站心坐标系 ----------------------------- */
@@ -156,7 +176,7 @@ void sat_gps_pos_clac(FILE * result_file,
blh.L_s = teml.S;
result_file = fopen(res_file, "a+");
fprintf(result_file, "\nG%02d[sPRN] %15.05f %15.05f %15.05f %15.05f %15.05f %15.05f %15.12f %16.13f"
fprintf(result_file, "\nG%02d | %15.05f %15.05f %15.05f %15.05f %15.05f %15.05f %15.12f %16.13f"
,sPRN, pos_t.X[sPRN], pos_t.Y[sPRN], pos_t.Z[sPRN]
,obs_b[i].obs_gps[j][Code2Type(C1C, obs_h->obstypenum_gps, obs_h->obscode_gps)]
,obs_b[i].obs_gps[j][Code2Type(C2L, obs_h->obstypenum_gps, obs_h->obscode_gps)]