Archived
SUPPORT:
1. be able to calculate the sat pos of BDS & Galileo 2. be able to Single postiting by GPS & Galileo
This commit is contained in:
1 parent
f29614d834
commit
aba6c009ab
13 files changed
+1830
-947
No files matched your search
+77
-28
@@ -5,12 +5,11 @@
|
||||
#include<stdio.h>
|
||||
|
||||
#include"public.h"
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/// @brief 将观测值类型转换为PUBLIC.H中定义的数字代码
|
||||
/// @param i 读取循环中传入的循环次数
|
||||
/// @param buff 传入的观测值类型
|
||||
/// @return 返回观测值代码
|
||||
/// @brief converts the observation type to the numeric code defined in PUBLIC.H
|
||||
/// @param i reads the number of incoming loops in the loop
|
||||
/// @param buff type of incoming observation
|
||||
/// @return Returns the obs code
|
||||
/* -------------------------------------------------------------------------- */
|
||||
int Type2Code(int i, char buff[1000])
|
||||
{
|
||||
@@ -18,41 +17,91 @@ int Type2Code(int i, char buff[1000])
|
||||
char code_contrast[4];
|
||||
char code_original[4];
|
||||
|
||||
for(int j = 0; j < 19; j++)
|
||||
{
|
||||
memset(code_contrast,0,sizeof(code_contrast));
|
||||
const char L1codeindex[] = "C1CC1SC1LC1XC1PC1WC1YC1MC1AC1BC1Z";//obs type of different frequency
|
||||
const char L2codeindex[] = "C2CC2SC2LC2XC2PC2WC2YC2MC2IC2QC2X";
|
||||
const char L5codeindex[] = "C5IC5QC5X";
|
||||
const char L6codeindex[] = "C6AC6BC6CC6XC6Z";
|
||||
const char L7codeindex[] = "C7IC7QC7XC7DC7PC7Z";
|
||||
const char L8codeindex[] = "C8JC8QC8X";
|
||||
|
||||
for(int j = 0; j < (strlen(L1codeindex)/3); j++)
|
||||
{ memset(code_contrast,0,sizeof(code_contrast));
|
||||
memset(code_original,0,sizeof(code_original));
|
||||
const char codeindex[]="C1CC1SC1LC1XC1PC1WC1YC1M"
|
||||
"C2CC2SC2LC2XC2PC2WC2YC2M"
|
||||
"C5IC5QC5X";
|
||||
strncpy(code_contrast, codeindex + 0 + j * 3 , 3);
|
||||
strncpy(code_contrast, L1codeindex + 0 + j * 3 , 3);
|
||||
strncpy(code_original, buff + 7 + 4 * i , 3);
|
||||
if(strcmp(code_contrast,code_original) == 0)
|
||||
{
|
||||
code_return = j + 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
{ code_return = j + 100;
|
||||
return code_return;
|
||||
break;}}
|
||||
|
||||
for (int j = 0; j < (strlen(L2codeindex) / 3); j++)
|
||||
{ memset(code_contrast, 0, sizeof(code_contrast));
|
||||
memset(code_original, 0, sizeof(code_original));
|
||||
strncpy(code_contrast, L2codeindex + 0 + j * 3, 3);
|
||||
strncpy(code_original, buff + 7 + 4 * i, 3);
|
||||
if (strcmp(code_contrast, code_original) == 0)
|
||||
{ code_return = j + 200;
|
||||
return code_return;
|
||||
break;}}
|
||||
|
||||
for (int j = 0; j < (strlen(L5codeindex) / 3); j++)
|
||||
{ memset(code_contrast, 0, sizeof(code_contrast));
|
||||
memset(code_original, 0, sizeof(code_original));
|
||||
strncpy(code_contrast, L5codeindex + 0 + j * 3, 3);
|
||||
strncpy(code_original, buff + 7 + 4 * i, 3);
|
||||
if (strcmp(code_contrast, code_original) == 0)
|
||||
{ code_return = j + 500;
|
||||
return code_return;
|
||||
break;}}
|
||||
|
||||
for (int j = 0; j < (strlen(L6codeindex) / 3); j++)
|
||||
{ memset(code_contrast, 0, sizeof(code_contrast));
|
||||
memset(code_original, 0, sizeof(code_original));
|
||||
strncpy(code_contrast, L6codeindex + 0 + j * 3, 3);
|
||||
strncpy(code_original, buff + 7 + 4 * i, 3);
|
||||
if (strcmp(code_contrast, code_original) == 0)
|
||||
{ code_return = j + 600;
|
||||
return code_return;
|
||||
break;}}
|
||||
|
||||
for (int j = 0; j < (strlen(L7codeindex) / 3); j++)
|
||||
{ memset(code_contrast, 0, sizeof(code_contrast));
|
||||
memset(code_original, 0, sizeof(code_original));
|
||||
strncpy(code_contrast, L7codeindex + 0 + j * 3, 3);
|
||||
strncpy(code_original, buff + 7 + 4 * i, 3);
|
||||
if (strcmp(code_contrast, code_original) == 0)
|
||||
{ code_return = j + 700;
|
||||
return code_return;
|
||||
break;}}
|
||||
|
||||
for (int j = 0; j < (strlen(L8codeindex) / 3); j++)
|
||||
{ memset(code_contrast, 0, sizeof(code_contrast));
|
||||
memset(code_original, 0, sizeof(code_original));
|
||||
strncpy(code_contrast, L8codeindex + 0 + j * 3, 3);
|
||||
strncpy(code_original, buff + 7 + 4 * i, 3);
|
||||
if (strcmp(code_contrast, code_original) == 0)
|
||||
{ code_return = j + 800;
|
||||
return code_return;
|
||||
break;}}
|
||||
|
||||
return code_return;
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/// @brief 将读取的观测值类型匹配类型代码存储数组
|
||||
/// @param typecode 希望匹配的观测值
|
||||
/// @param typenum 观测值类型总数量
|
||||
/// @param typearr 类型代码存储数组
|
||||
/// @return 返回对应的观测值类型代码的数组位置
|
||||
/// @brief the type of the obs value read matches the type code stored in an array
|
||||
/// @param typecode obs type that you want to match
|
||||
/// @param typenum the total number of obs types
|
||||
/// @param typearr type codes store arrays
|
||||
/// @return returns the array position of the corresponding obs type code
|
||||
/* -------------------------------------------------------------------------- */
|
||||
int Code2Type(int typecode, int typenum, int typearr[36])
|
||||
{
|
||||
int pos;
|
||||
for (pos = 0; pos < typenum; pos++)
|
||||
{
|
||||
if (typearr[pos] == typecode)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
{ if (typearr[pos] == typecode)
|
||||
{ break;
|
||||
return pos;}}
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user