modify the GUI experience
This commit is contained in:
KenanZhu111 committed 2024-10-06 11:38:58 +08:00
1 parent f9951695c8
commit 3908c51c9f
2 files changed
+112 -96

No files matched your search

+70 -59
View File
@@ -66,11 +66,11 @@ pobs_head obs_h = NULL;
pobs_epoch obs_e = NULL; pobs_epoch obs_e = NULL;
pobs_body obs_b = NULL; pobs_body obs_b = NULL;
/*INITIAL CONST*/
int o_epochnum = 0; int o_epochnum = 0;
int gps_satnum = 0; int gps_satnum = 0;
int bds_satnum = 0; int bds_satnum = 0;
/*INITIAL SETTINGS*/ /*INITIAL SETTINGS*/
static int ionoption = 0; static int ionoption = 0;
static int trooption = 0; static int trooption = 0;
@@ -78,6 +78,25 @@ static int trooption = 0;
char obs_f[MAX_PATH] = { 0 }; char obs_f[MAX_PATH] = { 0 };
char nav_f[MAX_PATH] = { 0 }; char nav_f[MAX_PATH] = { 0 };
char path[MAX_PATH];
const wchar_t wpath[MAX_PATH];//PROGRAM'S FOLDER
static void ProgressBar(HWND hwnd, int msec)
{
PBRANGE range;
SendMessage(hwnd, PBM_SETRANGE, (WPARAM)FALSE, (LPARAM)(MAKELPARAM(0, 100)));
SendMessage(hwnd, PBM_GETRANGE, (WPARAM)TRUE, (LPARAM)&range);
SendMessage(hwnd, PBM_SETPOS, (WPARAM)range.iLow, (LPARAM)0);
while (TRUE) {
SendMessage(hwnd, PBM_DELTAPOS, (WPARAM)((range.iHigh - range.iLow) / 20), (LPARAM)0); Sleep(msec);
if (SendMessage(hwnd, PBM_GETPOS, (WPARAM)0, (LPARAM)0) == range.iHigh)
{
break;
}
}
SendMessage(hwnd, PBM_SETPOS, (WPARAM)range.iHigh, (LPARAM)0);
}
static int FileSelobsDialog(const wchar_t* path)//FILEDIALOG FOR OBS static int FileSelobsDialog(const wchar_t* path)//FILEDIALOG FOR OBS
{ {
OPENFILENAME ofn; OPENFILENAME ofn;
@@ -118,7 +137,7 @@ static int FileSaveDialog(const wchar_t* path)//FILEDIALOG FOR SAVE
return GetSaveFileName(&ofn); return GetSaveFileName(&ofn);
} }
DWORD WINAPI PBThreadProc(LPVOID lpParameter);//PROGRESS BAR WINDOW //DWORD WINAPI PBThreadProc(LPVOID lpParameter);//PROGRESS BAR WINDOW
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);//MAIN WINDOW LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);//MAIN WINDOW
LRESULT CALLBACK OptWndProc(HWND, UINT, WPARAM, LPARAM);//OPTION WINDOW LRESULT CALLBACK OptWndProc(HWND, UINT, WPARAM, LPARAM);//OPTION WINDOW
@@ -211,9 +230,6 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam){
char nav_file[MAX_PATH] = { 0 }; char nav_file[MAX_PATH] = { 0 };
char res_file[MAX_PATH] = { 0 };//BE COMPATIBLE WITH MSVC char res_file[MAX_PATH] = { 0 };//BE COMPATIBLE WITH MSVC
char path[MAX_PATH];
getcwd(path, sizeof(path));//GET THE PROGRAM'S FOLDER
RECT rect; RECT rect;
TCHAR* SATSYS[5] = { TEXT("GPS"),TEXT("GLO"),TEXT("BeiDou"),TEXT("Galileo"),TEXT("SBAS") }; TCHAR* SATSYS[5] = { TEXT("GPS"),TEXT("GLO"),TEXT("BeiDou"),TEXT("Galileo"),TEXT("SBAS") };
static HWND hwndPB; static HWND hwndPB;
@@ -222,65 +238,70 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam){
switch (msg) { switch (msg) {
case WM_CREATE: case WM_CREATE:
{
getcwd(path, sizeof(path));//GET THE PROGRAM'S FOLDER
const char plot[] = "SPP_plot.exe";
sprintf(path, "%s\\%s", path, plot);
cxchar = LOWORD(GetDialogBaseUnits()); cxchar = LOWORD(GetDialogBaseUnits());
cychar = HIWORD(GetDialogBaseUnits());//GET THE SYS FONT SIZE cychar = HIWORD(GetDialogBaseUnits());//GET THE SYS FONT SIZE
MoveWindow(hwnd, (GetSystemMetrics(SM_CXSCREEN) - 50 * cxchar) / 2, (GetSystemMetrics(SM_CYSCREEN) - 16 * cychar) / 2, 50 * cxchar, 16 * cychar, TRUE);//REPAINT THE MAIN WINDOW MoveWindow(hwnd, (GetSystemMetrics(SM_CXSCREEN) - 50 * cxchar) / 2, (GetSystemMetrics(SM_CYSCREEN) - 16 * cychar) / 2, 50 * cxchar, 16 * cychar, TRUE);//REPAINT THE MAIN WINDOW
InitCommonControls(); InitCommonControls();
hwndPB = CreateWindowEx(0, PROGRESS_CLASS, NULL, WS_CHILD | WS_VISIBLE, hwndPB = CreateWindowEx(0, PROGRESS_CLASS, NULL, WS_CHILD | WS_VISIBLE,
0,12 * cychar, 0.5 * cxchar, 12.25 * cychar,
50 * cxchar, 1 * cychar, 47 * cxchar, 1 * cychar,
hwnd, (HMENU)PROGRESS,((LPCREATESTRUCT)lParam)->hInstance, NULL); hwnd, (HMENU)PROGRESS, ((LPCREATESTRUCT)lParam)->hInstance, NULL);
//CREATE THE BUTTONS //CREATE THE BUTTONS
hwndb[0] = CreateWindow(TEXT("Button"), TEXT("Open Obs Data"), WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON, hwndb[0] = CreateWindow(TEXT("Button"), TEXT("Open Obs Data"), WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON,
cxchar, 5 * cychar, cxchar, 5 * cychar,
14 * cxchar, 2 * cychar, 14 * cxchar, 2 * cychar,
hwnd, (HMENU)OBSBUTTON, ((LPCREATESTRUCT)lParam)->hInstance, NULL); hwnd, (HMENU)OBSBUTTON, ((LPCREATESTRUCT)lParam)->hInstance, NULL);
hwndb[1] = CreateWindow(TEXT("Button"), TEXT("Open Nav Data"), WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON, hwndb[1] = CreateWindow(TEXT("Button"), TEXT("Open Nav Data"), WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON,
17 * cxchar, 5 * cychar, 17 * cxchar, 5 * cychar,
14 * cxchar, 2 * cychar, 14 * cxchar, 2 * cychar,
hwnd, (HMENU)NAVBUTTON, ((LPCREATESTRUCT)lParam)->hInstance, NULL); hwnd, (HMENU)NAVBUTTON, ((LPCREATESTRUCT)lParam)->hInstance, NULL);
hwndb[2] = CreateWindow(TEXT("Button"), TEXT("Sat-Position Calculate"), WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON, hwndb[2] = CreateWindow(TEXT("Button"), TEXT("Sat-Position Calculate"), WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON,
cxchar, 7 * cychar, cxchar, 7 * cychar,
32 * cxchar, 2 * cychar, 32 * cxchar, 2 * cychar,
hwnd, (HMENU)CALBUTTON, ((LPCREATESTRUCT)lParam)->hInstance, NULL); hwnd, (HMENU)CALBUTTON, ((LPCREATESTRUCT)lParam)->hInstance, NULL);
hwndb[3] = CreateWindow(TEXT("Button"), TEXT("Options..."), WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON, hwndb[3] = CreateWindow(TEXT("Button"), TEXT("Options..."), WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON,
36 * cxchar, 7 * cychar, 36 * cxchar, 7 * cychar,
10 * cxchar, 2 * cychar, 10 * cxchar, 2 * cychar,
hwnd, (HMENU)OPTBUTTON, ((LPCREATESTRUCT)lParam)->hInstance, NULL); hwnd, (HMENU)OPTBUTTON, ((LPCREATESTRUCT)lParam)->hInstance, NULL);
hwndb[4] = CreateWindow(TEXT("Button"), TEXT("Plot"), WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON, hwndb[4] = CreateWindow(TEXT("Button"), TEXT("Plot"), WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON,
36 * cxchar, 5 * cychar, 36 * cxchar, 5 * cychar,
10 * cxchar, 2 * cychar, 10 * cxchar, 2 * cychar,
hwnd, (HMENU)PLOBUTTON, ((LPCREATESTRUCT)lParam)->hInstance, NULL); hwnd, (HMENU)PLOBUTTON, ((LPCREATESTRUCT)lParam)->hInstance, NULL);
for (int i = 0; i < 5; i++) for (int i = 0; i < 5; i++)
{ {
hwndb[i + 5] = CreateWindow(TEXT("Button"), SATSYS[i], WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX, hwndb[i + 5] = CreateWindow(TEXT("Button"), SATSYS[i], WS_VISIBLE | WS_CHILD | BS_AUTOCHECKBOX,
(2 + 7 * i) * cxchar, 21 * cychar/2, (2 + 7 * i) * cxchar, 21 * cychar / 2,
7 * cxchar, 5 * cychar/3, 7 * cxchar, 5 * cychar / 3,
hwnd, (HMENU)(5500 + i), ((LPCREATESTRUCT)lParam)->hInstance, NULL); hwnd, (HMENU)(5500 + i), ((LPCREATESTRUCT)lParam)->hInstance, NULL);
} }
hwndb[10] = CreateWindow(TEXT("Button"), TEXT("Satellite System"), WS_VISIBLE | WS_CHILD | BS_GROUPBOX, hwndb[10] = CreateWindow(TEXT("Button"), TEXT("Satellite System"), WS_VISIBLE | WS_CHILD | BS_GROUPBOX,
1 * cxchar/2, 19 * cychar/2, 1 * cxchar / 2, 19 * cychar / 2,
47 * cxchar, 6 * cychar/2, 47 * cxchar, 6 * cychar / 2,
hwnd, (HMENU)SYSGROUP, ((LPCREATESTRUCT)lParam)->hInstance, NULL); hwnd, (HMENU)SYSGROUP, ((LPCREATESTRUCT)lParam)->hInstance, NULL);
hwndb[11] = CreateWindow(TEXT("Button"), NULL, WS_VISIBLE | WS_CHILD | BS_ICON | BS_PUSHBUTTON, hwndb[11] = CreateWindow(TEXT("Button"), NULL, WS_VISIBLE | WS_CHILD | BS_ICON | BS_PUSHBUTTON,
15 * cxchar, 5 * cychar, 15 * cxchar, 5 * cychar,
2 * cxchar, 1 * cychar, 2 * cxchar, 1 * cychar,
hwnd, (HMENU)OBSCLEAR, ((LPCREATESTRUCT)lParam)->hInstance, NULL); hwnd, (HMENU)OBSCLEAR, ((LPCREATESTRUCT)lParam)->hInstance, NULL);
hwndb[12] = CreateWindow(TEXT("Button"), NULL, WS_VISIBLE | WS_CHILD | BS_ICON | BS_PUSHBUTTON, hwndb[12] = CreateWindow(TEXT("Button"), NULL, WS_VISIBLE | WS_CHILD | BS_ICON | BS_PUSHBUTTON,
15 * cxchar, 6 * cychar, 15 * cxchar, 6 * cychar,
2 * cxchar, 1 * cychar, 2 * cxchar, 1 * cychar,
hwnd, (HMENU)OBSRELOD, ((LPCREATESTRUCT)lParam)->hInstance, NULL); hwnd, (HMENU)OBSRELOD, ((LPCREATESTRUCT)lParam)->hInstance, NULL);
hwndb[13] = CreateWindow(TEXT("Button"), NULL, WS_VISIBLE | WS_CHILD | BS_ICON | BS_PUSHBUTTON, hwndb[13] = CreateWindow(TEXT("Button"), NULL, WS_VISIBLE | WS_CHILD | BS_ICON | BS_PUSHBUTTON,
@@ -293,8 +314,9 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam){
2 * cxchar, 1 * cychar, 2 * cxchar, 1 * cychar,
hwnd, (HMENU)NAVRELOD, ((LPCREATESTRUCT)lParam)->hInstance, NULL); hwnd, (HMENU)NAVRELOD, ((LPCREATESTRUCT)lParam)->hInstance, NULL);
return 0; return 0;
}
case WM_COMMAND: case WM_COMMAND:
switch(LOWORD(wParam)) switch(LOWORD(wParam))
{ {
@@ -319,6 +341,9 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam){
read_o_b(fp_obs, obs_e, obs_b, obs_h->obstypenum_gps, obs_h->obstypenum_bds); read_o_b(fp_obs, obs_e, obs_b, obs_h->obstypenum_gps, obs_h->obstypenum_bds);
} }
fclose(fp_obs); fclose(fp_obs);
ProgressBar(hwndPB, 50);
if (o_epochnum > 0) if (o_epochnum > 0)
{ {
MessageBox(hwnd, TEXT("File of Obs load complete!"), TEXT("NOTICE"), MB_ICONASTERISK | MB_OK); MessageBox(hwnd, TEXT("File of Obs load complete!"), TEXT("NOTICE"), MB_ICONASTERISK | MB_OK);
@@ -353,6 +378,9 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam){
read_n_b(fp_nav, nav_b); read_n_b(fp_nav, nav_b);
} }
fclose(fp_nav); fclose(fp_nav);
ProgressBar(hwndPB, 20);
if (gps_satnum > 0) if (gps_satnum > 0)
{ {
MessageBox(hwnd, TEXT("File of Nav load complete !"), TEXT("NOTICE"), MB_ICONASTERISK | MB_OK); MessageBox(hwnd, TEXT("File of Nav load complete !"), TEXT("NOTICE"), MB_ICONASTERISK | MB_OK);
@@ -456,9 +484,15 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam){
{ {
if (SendMessage(hwndb[5], BM_GETCHECK, wParam, lParam) == BST_CHECKED) if (SendMessage(hwndb[5], BM_GETCHECK, wParam, lParam) == BST_CHECKED)
{ {
CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)PBThreadProc, hwndPB, 0, 0);
sat_gps_pos_clac(result_file, nav_b, obs_e, obs_b, obs_h, o_epochnum, gps_satnum, res_file, obs_f, nav_f, ionoption, trooption); sat_gps_pos_clac(result_file, hwndPB,
nav_b, obs_e, obs_b, obs_h,
o_epochnum, gps_satnum,
res_file, obs_f, nav_f,
ionoption, trooption);
} }
} }
free(obs_h); free(obs_e); free(obs_b); free(nav_h); free(nav_b); free(obs_h); free(obs_e); free(obs_b); free(nav_h); free(nav_b);
fp_nav = NULL; fp_obs = NULL; result_file = NULL; fp_nav = NULL; fp_obs = NULL; result_file = NULL;
@@ -493,9 +527,6 @@ LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam){
/* ------------------------------- PLOT BUTTON ------------------------------ */ /* ------------------------------- PLOT BUTTON ------------------------------ */
case PLOBUTTON: { case PLOBUTTON: {
const char plot[] = "SPP_plot.exe";
const wchar_t wpath[MAX_PATH];
sprintf(path, "%s\\%s", path, plot);
mbstowcs(wpath, path, MAX_PATH); mbstowcs(wpath, path, MAX_PATH);
if (ShellExecute(NULL, TEXT("open"), wpath, NULL, NULL, SW_SHOW) <= 32) if (ShellExecute(NULL, TEXT("open"), wpath, NULL, NULL, SW_SHOW) <= 32)
@@ -578,24 +609,4 @@ LRESULT CALLBACK OptWndProc(HWND hwndopt, UINT msg, WPARAM wParam, LPARAM lParam
return DefWindowProc(hwndopt, msg, wParam, lParam); return DefWindowProc(hwndopt, msg, wParam, lParam);
} }
return 0; return 0;
}
DWORD WINAPI PBThreadProc(LPVOID lpParameter) {
HWND hwndPB = (HWND)lpParameter;
PBRANGE range;
SendMessage(hwndPB, PBM_SETRANGE, (WPARAM)FALSE, (LPARAM)(MAKELPARAM(0, 100)));
SendMessage(hwndPB, PBM_GETRANGE, (WPARAM)TRUE, (LPARAM)&range);
while (TRUE)
{
SendMessage(hwndPB, PBM_DELTAPOS, (WPARAM)((range.iHigh - range.iLow) / 20), (LPARAM)0);
if (SendMessage(hwndPB, PBM_GETPOS, (WPARAM)0, (LPARAM)0) == range.iHigh)
{
break;
}
Sleep(100);
}
Sleep(2000);
SendMessage(hwndPB, PBM_SETPOS, (WPARAM)range.iLow, (LPARAM)0);
} }
+42 -37
View File
@@ -2,6 +2,7 @@
#define _CAL_MOD_H_ #define _CAL_MOD_H_
#include<stdio.h> #include<stdio.h>
#include<stdlib.h> #include<stdlib.h>
#include<Windows.h>
#include<math.h> #include<math.h>
#include<time.h> #include<time.h>
@@ -66,13 +67,16 @@ pos_ts gps_pos(int sPRN, int best_epoch, double GPSsec,
/* ------------------------------- GPS卫星位置计算&输出 ------------------------------ */ /* ------------------------------- GPS卫星位置计算&输出 ------------------------------ */
void sat_gps_pos_clac(FILE * result_file, void sat_gps_pos_clac(FILE* result_file,HWND hwndPB,
pnav_body nav_b, pobs_epoch obs_e, pobs_body obs_b, pnav_body nav_b, pobs_epoch obs_e, pobs_body obs_b,pobs_head obs_h,
pobs_head obs_h, int o_epochnum, int gps_satnum,
int o_epochnum, int gps_satnum, char res_file[MAX_PATH], char obs_file[MAX_PATH], char nav_file[MAX_PATH],
char res_file[MAX_PATH], char obs_file[MAX_PATH], char nav_file[MAX_PATH], int ionoption, int trooption)
int ionosopt, int tropoopt) {
{ PBRANGE range;
SendMessage(hwndPB, PBM_SETRANGE, (WPARAM)FALSE, (LPARAM)(MAKELPARAM(0, 100)));
SendMessage(hwndPB, PBM_GETRANGE, (WPARAM)TRUE, (LPARAM)&range);
time_t gen_time; time_t gen_time;
time(&gen_time); time(&gen_time);
stations station = { 0 }; stations station = { 0 };
@@ -85,30 +89,30 @@ void sat_gps_pos_clac(FILE * result_file,
fclose(result_file); fclose(result_file);
result_file = fopen(res_file, "a+"); result_file = fopen(res_file, "a+");
fprintf(result_file, "@ GENERATE PROGRAM : SPP Calculate v0.4.7\n"); fprintf(result_file, "@ GENERATE PROGRAM : SPP Calculate v0.4.7\n");
fprintf(result_file, "@ GENERATE TYPE : Satellite Position\n" ); fprintf(result_file, "@ GENERATE TYPE : Satellite Position\n");
fprintf(result_file, "@ GENERATE TIME : %s", ctime(&gen_time)); fprintf(result_file, "@ GENERATE TIME : %s", ctime(&gen_time));
fprintf(result_file, "@ OBS FILE PATH : %s\n", obs_file); fprintf(result_file, "@ OBS FILE PATH : %s\n", obs_file);
fprintf(result_file, "@ NAV FILE PATH : %s\n", nav_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" 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 , obs_h->apX, obs_h->apY, obs_h->apZ
,station.B ,station.L,station.H); , station.B, station.L, station.H);
if (ionosopt == 0) { fprintf(result_file, "@ IONOS OPT : NULL\n"); } if (ionoption == 0) { fprintf(result_file, "@ IONOS OPT : NULL\n"); }
if (ionosopt == 1) { fprintf(result_file, "@ IONOS OPT : DEFAULT\n"); } if (ionoption == 1) { fprintf(result_file, "@ IONOS OPT : DEFAULT\n"); }
if (tropoopt == 0) { fprintf(result_file, "@ TROPO OPT : NULL\n@\n\n"); } if (trooption == 0) { fprintf(result_file, "@ TROPO OPT : NULL\n@\n\n"); }
if (tropoopt == 1) { fprintf(result_file, "@ TROPO OPT : DEFAULT\n@\n\n"); } if (trooption == 1) { fprintf(result_file, "@ TROPO OPT : DEFAULT\n@\n\n"); }
fclose(result_file); fclose(result_file);
for (int i = 0; i < o_epochnum; i++)//第i个历元
for (int i = 0; i < o_epochnum; i++)
{ {
result_file = fopen(res_file, "a+"); result_file = fopen(res_file, "a+");
fprintf(result_file, "\n>%04d %04d %02d %02d %02d %02d %07.04f",i + 1 ,obs_e[i].y ,obs_e[i].m ,obs_e[i].d ,obs_e[i].h ,obs_e[i].min ,obs_e[i].sec); fprintf(result_file, "\n>%04d %04d %02d %02d %02d %02d %07.04f", i + 1, obs_e[i].y, obs_e[i].m, obs_e[i].d, obs_e[i].h, obs_e[i].min, obs_e[i].sec);
fclose(result_file); fclose(result_file);
int y = obs_e[i].y; int y = obs_e[i].y;
int m = obs_e[i].m; int m = obs_e[i].m;
int d = obs_e[i].d; int d = obs_e[i].d;
double h = obs_e[i].h; double h = obs_e[i].h;
int min = obs_e[i].min; int min = obs_e[i].min;
double sec = obs_e[i].sec; double sec = obs_e[i].sec;
xyz2blh tem1 = { 0 }; xyz2blh tem1 = { 0 };
@@ -130,23 +134,23 @@ void sat_gps_pos_clac(FILE * result_file,
//计算近似的信号传播时间,接收机钟差已初始化为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.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;//判断收敛 pos_t.deltat[sPRN] = 0.0;//判断收敛
while (fabs(pos_t.delta_t[sPRN] - pos_t.deltat[sPRN]) > 1.0e-9){ while (fabs(pos_t.delta_t[sPRN] - pos_t.deltat[sPRN]) > 1.0e-9) {
pos_t = gps_pos(sPRN, best_epoch, GPSsec, nav_b, obs_h, pos_t); pos_t = gps_pos(sPRN, best_epoch, GPSsec, nav_b, obs_h, pos_t);
} }
/* ----------------------------- 地固坐标系转经纬大地高坐标系 ----------------------------- */ /* ----------------------------- 地固坐标系转经纬大地高坐标系 ----------------------------- */
tem1 = XYZ2BLH( tem1, pos_t.X[sPRN], pos_t.Y[sPRN], pos_t.Z[sPRN]); tem1 = XYZ2BLH(tem1, pos_t.X[sPRN], pos_t.Y[sPRN], pos_t.Z[sPRN]);
blh.B = rad2deg(tem1.B); blh.B = rad2deg(tem1.B);
blh.L = rad2deg(tem1.L); blh.L = rad2deg(tem1.L);
blh.H = tem1.H; blh.H = tem1.H;
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
/* ----------------------------- 经纬大地高坐标系转站心坐标系 ----------------------------- */ /* ----------------------------- 经纬大地高坐标系转站心坐标系 ----------------------------- */
double deltax = pos_t.X[sPRN] - obs_h->apX; double deltax = pos_t.X[sPRN] - obs_h->apX;
double deltay = pos_t.Y[sPRN] - obs_h->apY; double deltay = pos_t.Y[sPRN] - obs_h->apY;
double deltaz = pos_t.Z[sPRN] - obs_h->apZ; double deltaz = pos_t.Z[sPRN] - obs_h->apZ;
tem3 = BLH2ENU(tem3, station.B, station.L, deltax, deltay, deltaz); tem3 = BLH2ENU(tem3, station.B, station.L, deltax, deltay, deltaz);
enu.E = tem3.E; enu.E = tem3.E;
enu.N = tem3.N; enu.N = tem3.N;
@@ -159,12 +163,12 @@ void sat_gps_pos_clac(FILE * result_file,
rah.A = rad2deg(tem4.A); rah.A = rad2deg(tem4.A);
rah.H = rad2deg(tem4.H); rah.H = rad2deg(tem4.H);
/* -------------------------------------------------------------------------- */ /* -------------------------------------------------------------------------- */
if (blh.H < 0 || rah.H < 10 ||nav_b[best_epoch].sHEA != 0) if (blh.H < 0 || rah.H < 10 || nav_b[best_epoch].sHEA != 0)
{ {
continue; continue;
} }
else else
{ {
temb = DEG2DMS(temb, blh.B); temb = DEG2DMS(temb, blh.B);
blh.B_d = temb.D; blh.B_d = temb.D;
blh.B_m = temb.M; blh.B_m = temb.M;
@@ -177,21 +181,22 @@ void sat_gps_pos_clac(FILE * result_file,
result_file = fopen(res_file, "a+"); result_file = fopen(res_file, "a+");
fprintf(result_file, "\nG%02d | %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] , 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(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)] , obs_b[i].obs_gps[j][Code2Type(C2L, obs_h->obstypenum_gps, obs_h->obscode_gps)]
,rah.H, nav_b[best_epoch].TGD, pos_t.delta_clk[sPRN]); , rah.H, nav_b[best_epoch].TGD, pos_t.delta_clk[sPRN]);
fclose(result_file); fclose(result_file);
} }
} }
result_file = fopen(res_file, "a+"); result_file = fopen(res_file, "a+");
fprintf(result_file, "\n"); fprintf(result_file, "\n");
fclose(result_file); fclose(result_file);
SendMessage(hwndPB, PBM_SETPOS, (WPARAM)((int)(i * 100 / o_epochnum)), (LPARAM)0);
} }
result_file = fopen(res_file, "a+"); result_file = fopen(res_file, "a+");
fprintf(result_file, "\nEND"); fprintf(result_file, "\nEND");
fclose(result_file); fclose(result_file);
} SendMessage(hwndPB, PBM_SETPOS, (WPARAM)range.iHigh, (LPARAM)0);
}
#endif #endif