📄 ch_frame.lst
字号:
119 3 year=0;
120 3 year=*point++;
121 3 year=year<<8;
122 3 year|=*point++; //年
123 3 month=*point++; //月
124 3 day=*point; //日
125 3 }
126 2 }
127 1
128 1
129 1 /****$ B D L P S , 2 0 2 F A 0 A 2 4 C 8 ,235958,30,06,2015*7C
130 1 0 1 2 3 4 5 6 7 8 9
131 1 */
132 1
133 1 else if(sdata[3]=='L'&&sdata[4]=='P'&&sdata[5]=='S')//$BDLPS帧
134 1 {
135 2 //lps_cnt++;
136 2 if (sdata[7]=='0'||sdata[7]=='1'||sdata[7]=='2') //提取BD与UTC的差值
137 2 {
138 3 UTC_sec = asc_to_char(sdata[8],sdata[9],1);//BD1与UTC相差秒值、当前闰秒值整数部分
139 3 for(i=10;i<17;i=i+2)
140 3 {
141 4 UTC_ns=UTC_ns<<8;
142 4 temp=fromasc(sdata[i])<<4;
143 4 temp|=fromasc(sdata[i+1]);
144 4 UTC_ns|=temp;///////////////...
145 4 //UTC_ns=temp|fromasc(sdata[i+1]);
146 4 }
147 3 }
148 2 if (sdata[7]=='0')//无闰秒
149 2 {
150 3 fur_lp_sec =0;
151 3 cur_lp_sec =0;
152 3 lp_hour=0; lp_min=0;
153 3 lp_sec=0; lp_day=0;
154 3 lp_month=0; lp_year=0;
155 3 }
156 2 else if (sdata[7]=='1'||sdata[7]=='2')//有闰秒状态
157 2 {
158 3 //提取未来闰秒值
159 3 if (sdata[7]=='1')
160 3 {
161 4 cur_lp_sec=UTC_sec; //当前闰秒
162 4 fur_lp_sec=UTC_sec +1;//未来闰秒
163 4 }
164 3 else if(sdata[7]=='2')
165 3 {
166 4 cur_lp_sec=UTC_sec;
167 4 fur_lp_sec=UTC_sec -1;
168 4 }
169 3 //闰秒发生时
170 3 lp_hour =asc_to_char(sdata[19],sdata[20],0);//(sdata[19]-0x30)*10+(sdata[20]-0x300);
171 3 //闰秒发生分
172 3 lp_min =asc_to_char(sdata[21],sdata[22],0);//(sdata[21]-0x30)*10+(sdata[22]-0x300);
173 3 //闰秒发生秒
174 3 lp_sec =asc_to_char(sdata[23],sdata[24],0);//(sdata[23]-0x30)*10+(sdata[24]-0x300);
175 3 //闰秒发生日
176 3 lp_day=asc_to_char(sdata[26],sdata[27],0);
177 3 //闰秒发生月
178 3 lp_month=asc_to_char(sdata[29],sdata[30],0);
C51 COMPILER V7.06 CH_FRAME 11/20/2006 17:07:19 PAGE 4
179 3 //闰秒发生年
180 3 lp_year =(sdata[32]-0x30)*1000+(sdata[33]-0x30)*100+(sdata[34]-0x30)*10+sdata[35]-0x30;
181 3
182 3 if (channel_sta_2&0x40==0x40)
183 3 {
184 4 p = tosec(lp_hour,lp_min,lp_sec,lp_day,lp_month,lp_year); //BD时间秒值
185 4
186 4 /* if (UTC_mode_fg==1)//UTC模式
187 4 {
188 4 if ((cur_lp_sec==0&&fur_lp_sec==0)||(fur_lp_sec-cur_lp_sec==1))//有正闰秒或无闰秒
189 4 cur_time_sec=p+UTC_sec;
190 4 else
191 4 cur_time_sec=p-UTC_sec;
192 4 }
193 4 else //GPS模式
194 4 {*/
195 4 tmp=gmth*3600+gmtm*60;
196 4
197 4 if ((cur_lp_sec==0&&fur_lp_sec==0)||(fur_lp_sec-cur_lp_sec==1)) //有正闰秒或无闰秒
198 4 {
199 5 if (gmts==0x00)//GMT符号为正
200 5 lp_sec_tmp=p+tmp; //cur_time = (gps0+gmt=bds-13-pp-8*3600)+gmt = bds-pp+gmt-28813
201 5 else if(gmts==0xff)//GMT符号为负
202 5 lp_sec_tmp=p-tmp;
203 5 lp_sec_tmp -=28800;
204 5 if (UTC_mode_fg==0)//GPS
205 5 {
206 6 lp_sec_tmp = lp_sec_tmp + UTC_sec -13;
207 6 }
208 5 }
209 4 else if(cur_lp_sec !=0&&(fur_lp_sec-cur_lp_sec==-1))//有负闰秒
210 4 {
211 5 if (gmts==0x00)
212 5 lp_sec_tmp=p+tmp; //cur_time = (gps0+gmt=bds-13-pp-8*3600)+gmt = bds-pp+gmt-28813
213 5 else if(gmts==0xff)
214 5 lp_sec_tmp=p-tmp;
215 5 lp_sec_tmp -=28800;
216 5 if (UTC_mode_fg==0)
217 5 {
218 6 cur_time_sec = cur_time_sec - UTC_sec -13;//28813
219 6 }
220 5 }
221 4
222 4 // }
223 4 /******************************************************************/
224 4 //重新得到年月日时分秒
225 4 /*******************************************************************/
226 4 point=sectodata(lp_sec_tmp);
227 4 lp_hour =*point++; //时
228 4 lp_min =*point++; //分
229 4 lp_sec =*point++; //秒
230 4 lp_year=0;
231 4 lp_year=*point++;
232 4 lp_year=lp_year<<8;
233 4 lp_year|=*point++; //年
234 4 lp_month=*point++; //月
235 4 lp_day=*point; //日
236 4 }
237 3 }
238 2 }
239 1
240 1 /*$ B D L L A , 3 4 4 4 . 2 6 7 8 8 , N, 11337.35114, E, 119.53*64
C51 COMPILER V7.06 CH_FRAME 11/20/2006 17:07:19 PAGE 5
241 1
242 1 */
243 1 else if (sdata[3]=='L'&&sdata[4]=='L'&&sdata[5]=='A')//$BDLLA帧
244 1 {
245 2 //lla_cnt++;
246 2 if (sdata[7]==lat_asc[0]&&sdata[8]==lat_asc[1]&&sdata[9]==lat_asc[2]&&sdata[10]==lat_asc[3]&&//判断纬
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -