zsh_root
2024-01-02 7b595546af704983dbafcd0d385c8768ddacefc2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
package BaoWen;
import java.util.LinkedHashMap;
 
import Frame.Gps_data_hui_fang;
import Judge.JugeNumber;
import Method.BaoWenShow;
import Method.GetNowTime;
import PbuliClass.Systems;
import VectroData.ForwardDatas;
import engbs.BS_urt_add_fence;
import engbs.Bs_look_baowen;
import fence.Pointoutwaringbaidu;
import http.HTTP_Post;
import monitorGas.Dell_co;
import person.Person;
import person.person_Dell;
import rtkanchor.Dell_jizhan;
import rtkanchor.Jizhan;
import tag.Tag_Dell;
import tbDataModel.Tb_gps;
import tbDataModel_Dell.Dell_tb_suanfa2;
import urt.Control_urt;
import urt.Dell_gps;
import urt.GnssToXY;
import urt.HistoryGNGGA;
import urt.xytognss;
public class Dell_GNGGA {    
    //ÊÇ·ñ´æÔÚÊý¾Ýת·¢
    static int size=ForwardDatas.get_tb_forward_datas().size();
    static int[] xyhf=new int[4];
    static boolean weizhiok=true;//λÖùýÂ˶Ô
    static boolean urtmode1=false;//URTģʽϲÉÓõ¥µã¶¨Î»
    static String gps_utc_time;//×Ö¶Î1£ºUTC Ê±¼ä£¬hhmmss.sss£¬Ê±·ÖÃë¸ñʽ
    static String gps_weidu;//×Ö¶Î2£ºÎ³¶Èddmm.mmmm£¬¶È·Ö¸ñʽ£¨Ç°µ¼Î»Êý²»×ãÔò²¹0£©
    static String gps_NS;//×Ö¶Î3£ºÎ³¶ÈN£¨±±Î³£©»òS£¨ÄÏ㣩
    static String gsp_jingdu;//×Ö¶Î4£º¾­¶Èdddmm.mmmm£¬¶È·Ö¸ñʽ£¨Ç°µ¼Î»Êý²»×ãÔò²¹0£©
    static String gps_EW;//×Ö¶Î5£º¾­¶ÈE£¨¶«¾­£©»òW£¨Î÷¾­£©
    //×Ö¶Î6£º¶¨Î»ÖÊÁ¿GPS״̬£¬0³õʼ»¯£¬ 1µ¥µã¶¨Î»£¬ 2Âë²î·Ö£¬ 3ÎÞЧPPS£¬ 
    //4¹Ì¶¨½â£¬ 5¸¡µã½â£¬ 6ÕýÔÚ¹ÀËã 7£¬È˹¤ÊäÈë¹Ì¶¨Öµ£¬ 8Ä£Äâģʽ£¬ 9WAAS²î·Ö
    static String gps_state="0";
    static String state="³õʼ»¯";
    static String gps_num;//×Ö¶Î7£ºÕýÔÚʹÓõÄÎÀÐÇÊýÁ¿£¨00 - 12£©£¨Ç°µ¼Î»Êý²»×ãÔò²¹0£©
    static String gps_hdop;//×Ö¶Î8£ºHDOPˮƽ¾«¶ÈÒò×Ó£¨0.5 - 99.9£©
    static String gps_haiba_gao;//×Ö¶Î9£ºº£°Î¸ß¶È£¨-9999.9 - 99999.9£©
    static String gao_danwei;//¸ß¶Èµ¥Î»M±íʾÃ×
    static String gps_tuoqiu;//×Ö¶Î10£ºµØÇòÍÖÇòÃæÏà¶Ô´óµØË®×¼ÃæµÄ¸ß¶È
    static String gps_chafen_time;//×Ö¶Î11£º²î·Öʱ¼ä£¨´Ó×î½üÒ»´Î½ÓÊÕµ½²î·ÖÐźſªÊ¼µÄÃëÊý£¬Èç¹û²»ÊDzî·Ö¶¨Î»½«Îª¿Õ£©
    static String gps_chafen_id;//×Ö¶Î12£º²î·ÖÕ¾IDºÅ0000 - 1023£¨Ç°µ¼Î»Êý²»×ãÔò²¹0£¬Èç¹û²»ÊDzî·Ö¶¨Î»½«Îª¿Õ£©
    static String gps_jiaoyan;//×Ö¶Î13£ºÐ£ÑéÖµ
    static String tagid="0000";//É豸id
    static String power="-1";//É豸µçÁ¿
    static String gpsxinhao="0";//GPSÐźÅÇ¿¶È
    static String baoliu1="0";//±£Áô×Ö¶Î1£¬CO+URTµÄʱºòΪCOµÄŨ¶È
    static String baoliu2="0";//±£Áô×Ö¶Î2
    static String baoliu3="0";//±£Áô×Ö¶Î3
    static int dianliang;
    static Person person;
 
    /***
     *gps¾­Î³¶ÈÊý¾Ý
     *$GNGGA,[utc_time],[ weidu],[ NS],[ jingdu],[ EW],[state],[num],[hdop],[haiba_gao],
     *[gao_danwei],[tuoqiu],[chafen_time],[chafen_id],[jiaoyan],[tagid],[power],[ÐźÅÇ¿¶È],[±£Áô1],[±£Áô2],[±£Áô3]
     *ʾÁУº$GNGGA£¬043310.44,3951.73773,N,11615.40420,E,4,12,0.71,53.0,M,-8.9,M,1.4,1935*41,1234,2d
     *ʾÀýУº$GNGGA,045449.000,3951.764319,N,11615.386554,E,2,19,0.70,57.726,M,-9.89,M,11,0000*69,1872,2d,19,0,0,0
     *˵Ã÷£º
     *1.$GNGGA;//°üÍ·
     *2.utc_time;//×Ö¶Î1£ºUTC Ê±¼ä£¬hhmmss.sss£¬Ê±·ÖÃë¸ñʽ
     *3.weidu;//×Ö¶Î2£ºÎ³¶Èddmm.mmmm£¬¶È·Ö¸ñʽ£¨Ç°µ¼Î»Êý²»×ãÔò²¹0£©
     *4.NS;//×Ö¶Î3£ºÎ³¶ÈN£¨±±Î³£©»òS£¨ÄÏ㣩
     *5.jingdu;//×Ö¶Î4£º¾­¶Èdddmm.mmmm£¬¶È·Ö¸ñʽ£¨Ç°µ¼Î»Êý²»×ãÔò²¹0£©
     *6.EW;//×Ö¶Î5£º¾­¶ÈE£¨¶«¾­£©»òW£¨Î÷¾­£©
     *7.state;//×Ö¶Î6£º¶¨Î»ÖÊÁ¿GPS״̬£¬0³õʼ»¯£¬ 1µ¥µã¶¨Î»£¬ 2Âë²î·Ö£¬ 3ÎÞЧPPS£¬ 4¹Ì¶¨½â£¬ 5¸¡µã½â£¬ 6ÕýÔÚ¹ÀËã 7£¬È˹¤ÊäÈë¹Ì¶¨Öµ£¬ 8Ä£Äâģʽ£¬ 9WAAS²î·Ö
     *8.num;//×Ö¶Î7£ºÕýÔÚʹÓõÄÎÀÐÇÊýÁ¿£¨00 - 12£©£¨Ç°µ¼Î»Êý²»×ãÔò²¹0£©
     *9.hdop;//×Ö¶Î8£ºHDOPˮƽ¾«¶ÈÒò×Ó£¨0.5 - 99.9£©
     *10.haiba_gao;//×Ö¶Î9£ºÌìÏß¾àÀëº£Æ½Ãæ¸ß¶È£¨-9999.9 - 99999.9£©
     *11.gao_danwei;//×Ö¶Î10£º¸ß¶Èµ¥Î»M±íʾÃ×
     *12.tuoqiu;//×Ö¶Î11£ºµØÇòÍÖÇòÃæÏà¶Ô´óµØË®×¼ÃæµÄ¸ß¶È
     *13.chafen_time;//×Ö¶Î12£º²î·Öʱ¼ä£¨´Ó×î½üÒ»´Î½ÓÊÕµ½²î·ÖÐźſªÊ¼µÄÃëÊý£¬Èç¹û²»ÊDzî·Ö¶¨Î»½«Îª¿Õ£©
     *14.chafen_id;//×Ö¶Î13£º²î·ÖÕ¾IDºÅ0000 - 1023£¨Ç°µ¼Î»Êý²»×ãÔò²¹0£¬Èç¹û²»ÊDzî·Ö¶¨Î»½«Îª¿Õ£©
     *15.jiaoyan;//×Ö¶Î14£ºÐ£ÑéÖµ
     *16.tagid;//×Ö¶Î15,£ºÉ豸id,µÍλÔÚǰ¸ßλÔÚºóHEX¸ñʽ
     *17.power;//×Ö¶Î16£»µçÁ¿£¬HEX¸ñʽ£¬0~100
     *18.ÐźÅÇ¿¶È
     *19.±£Áô1
     *20. ±£Áô2
     *21.±£Áô3* */
    @SuppressWarnings("unused")
    public static void dell_GNGGA(String message0,String ip,int port) {
        hui_fu_ggaok(ip,port);
        String time=GetNowTime.now();
        String message=message0.replaceAll("\r\n", "");
        String[] gpgga=message.split(",");
        int lenth=gpgga.length;
        if(lenth==17 || lenth==18 || lenth>=21 ) {
            gps_utc_time=gpgga[1];//×Ö¶Î1£ºUTC Ê±¼ä£¬hhmmss.sss£¬Ê±·ÖÃë¸ñʽ
            gps_weidu=gpgga[2];//×Ö¶Î2£ºÎ³¶Èddmm.mmmm£¬¶È·Ö¸ñʽ£¨Ç°µ¼Î»Êý²»×ãÔò²¹0£©
            gps_NS=gpgga[3];//×Ö¶Î3£ºÎ³¶ÈN£¨±±Î³£©»òS£¨ÄÏ㣩
            gsp_jingdu=gpgga[4];//×Ö¶Î4£º¾­¶Èdddmm.mmmm£¬¶È·Ö¸ñʽ£¨Ç°µ¼Î»Êý²»×ãÔò²¹0£©
            gps_EW=gpgga[5];
            gps_state=gpgga[6];
            state=get_gps_state(gpgga[6],lenth);//ÎÀÐǶ¨Î»×´Ì¬ÎÄ×Ö
            gps_num=gpgga[7];//×Ö¶Î7£ºÕýÔÚʹÓõÄÎÀÐÇÊýÁ¿£¨00 - 12£©£¨Ç°µ¼Î»Êý²»×ãÔò²¹0£©
            gps_hdop=gpgga[8];//×Ö¶Î8£ºHDOPˮƽ¾«¶ÈÒò×Ó£¨0.5 - 99.9£©
            gps_haiba_gao=gpgga[9];//×Ö¶Î9£ºº£°Î¸ß¶È£¨-9999.9 - 99999.9£©
            gao_danwei=gpgga[10];//¸ß¶Èµ¥Î»M±íʾÃ×
            gps_tuoqiu=gpgga[11];//×Ö¶Î10£ºµØÇòÍÖÇòÃæÏà¶Ô´óµØË®×¼ÃæµÄ¸ß¶È
            gps_chafen_time=gpgga[12];//×Ö¶Î11£º²î·Öʱ¼ä£¨´Ó×î½üÒ»´Î½ÓÊÕµ½²î·ÖÐźſªÊ¼µÄÃëÊý£¬Èç¹û²»ÊDzî·Ö¶¨Î»½«Îª¿Õ£©
            gps_chafen_id=gpgga[13];//×Ö¶Î12£º²î·ÖÕ¾IDºÅ0000 - 1023£¨Ç°µ¼Î»Êý²»×ãÔò²¹0£¬Èç¹û²»ÊDzî·Ö¶¨Î»½«Îª¿Õ£©
            gps_jiaoyan=gpgga[14];//×Ö¶Î13£ºÐ£ÑéÖµ
            tagid=gettagid(gpgga[15]);//É豸id
            power=getpower(gpgga[16]);//É豸µçÁ¿
            gpsxinhao=get_gps_xinhao(gpgga[17],lenth);//GPSÐźÅÇ¿¶È
            baoliu1=get_gps_baoliu(gpgga[18],lenth);//±£Áô×Ö¶Î1£¬CO+URTµÄʱºòΪCOµÄŨ¶È
            baoliu2=get_gps_baoliu(gpgga[19],lenth);//±£Áô×Ö¶Î2
            baoliu3=get_gps_baoliu(gpgga[20],lenth);//±£Áô×Ö¶Î3            
            person=person_Dell.get_Person(tagid);    
            if(person==null) {
                Tag_Dell.add_tag(tagid,"×Ô¶¯Ìí¼Ó","150","1000","1",0,"ÈÚºÏÖÕ¶Ë",0);//×Ô¶¯Ìí¼Ó±êÇ©
                person_Dell.add_person(tagid, "ϵͳĬÈÏ", "×Ô¶¯Ìí¼Ó", "ÄÐ", " ","1000","ÈÚºÏÖÕ¶Ë");    
                return;
            }                    
            gps_dell_baoliu2(lenth);
            jingweidu_2_du();//¾­Î³¶ÈתΪ¶È¸ñʽÊä³ö
            weidu_is_ok_neeedo(ip,port,time);//¾­Î³¶ÈºÏ·¨ÐèÒª×öµÄÊÂÇé            
            zhuanfa_gngga(message,tagid);//ת·¢GNGGAÊý¾Ý            
        }
        BaoWenShow.show3(message, "GNSS", ip, String.valueOf(port),tagid);//ÏÔʾGNSSÊý¾Ý
        Bs_look_baowen.insert_all(message,tagid);//BS¶Ë²é¿´±¨ÎÄ
        gpgga=null;
    }
 
 
    /**20230711yang*/
    public static String gettagid(String tagid1) {
        String tagid2=tagid1;
        if(tagid1.length()==1) {
            tagid2="000"+tagid1;
        }
        return tagid2;
    }
 
    /**20230711yang*/
    public static String getpower(String aa2) {
        String dianl=aa2;
        dianliang=DellMessage.decodeHEX(aa2);//µçÁ¿HEXת10½øÖÆ
        if(dianliang>100) {
            dianliang=100;
        }
        dianl=String.valueOf(dianliang);
        return dianl;
    }
 
    /**20230711yang*/
    public static String get_gps_xinhao(String aa3,int lenth) {
        String nowstate="0";
        if(lenth==18){
            nowstate=aa3;//ÐźÅÇ¿¶È
            person_Dell.dell_tagtakeoff(nowstate, tagid);
        }
        return nowstate;
    }
 
 
    /**20230711yang*/
    public static String get_gps_state(String aa4,int lenth) {
        String state1="0";
        if(JugeNumber.isDigit(aa4)) {
            state1=Dell_gps.gnss_state(aa4);//ÎÀÐǶ¨Î»Êý¾Ý״̬
        }
        return state1;
    }
 
    /**20230711yang*/
    public static String get_gps_baoliu(String aa5,int lenth) {
        String baoliu="0";
        if(lenth==21){//Èç¹û³¤¶ÈµÈÓÚ21
            baoliu=aa5;
        }
        return baoliu;
    }
 
    /**20230711yang*/
    public static void gps_dell_baoliu2(int lenth) {        
        if(lenth==21){//Èç¹û³¤¶ÈµÈÓÚ21
            baoliu2(person,baoliu2);
        }
    }
 
    /**20230711yang*/
    public static void weidu_is_ok_neeedo(String ip,int port,String time) {        
        int gpsgood=gps_weidu.length();
        if(gpsgood>3) {
            person.setBaoliu5("3");//½«±êÇ©ÉèÖÃΪ´øgnss±êÇ©
            person.setBaoliu8(ip);//ÉèÖñêÇ©µÄIPµØÖ·
            person.setBaoliu9(port+"");//ÉèÖñêÇ©¶Ë¿Ú
            person_Dell.change_person_online(person,tagid);//¸Ä±äÈËÔ±ÔÚÏß״̬
            person.setJingdu(gsp_jingdu);
            person.setWeidu(gps_weidu);
            person.setGao(gps_haiba_gao);
            person.setGpsstate(state);
            int c1=Integer.parseInt(gps_state);
            person.setGngga_state(c1);
            person.setGpson_off(1);
            person.setXinhaotime(time);
            person.setReceive_gngga_time(time);//ÐÞ¸ÄÊÕµ½ºÏ·¨GNGGAÊý¾Ýʱ¼ä
            jwd_to_do(gps_weidu,gsp_jingdu);//¾­Î³¶Èת¶È¸ñʽ
            String type=person.getBaoliu19();
            Dell_co.alertco(type, baoliu1, tagid, person);
            urtstatedo(person,gps_state,tagid);//»ñµÃgps״̬×öµÄÊÂÇé,Ãâ²¼ÏßģʽÐèÒª×öµÄÊÂÇé
            dell_needbaseid(person,gsp_jingdu,gps_weidu);//¿ªÆô×Ô½¨²î·Ö»ù×¼Õ¾ÐèÒª×öµÄÊÂÇé
            Dell_gps.add_or_alert_gps(gps_utc_time,gps_weidu,gps_NS,gsp_jingdu, gps_EW, 
                    gps_state,gps_num, gps_hdop,gps_haiba_gao,gps_tuoqiu,gps_chafen_time, 
                    gps_chafen_id, gps_jiaoyan,tagid,power,"3");            
            Tb_gps gps=Dell_gps.get_tb_gps(tagid);    
            Dell_gps.alertjwd(tagid, gsp_jingdu, gps_weidu);
            double wd=Double.parseDouble(gps_weidu);
            double jd=Double.parseDouble(gsp_jingdu);
            double h=Double.parseDouble(gps_haiba_gao);
            person_Dell.have_ok_gnggan_alertperson(tagid);
            Pointoutwaringbaidu.is_out_fence_baidu(tagid,gps_weidu, gsp_jingdu,h);//ÅжÏÊÇ·ñÔڰٶȵØÍ¼³öÈ¥¸æ¾¯ÇøÓò
            if (Dell_tb_suanfa2.isGnss2xyopen()) {
                gnsstoxy_needdo(gps, person, tagid, wd, jd, gps_weidu, gsp_jingdu,
                        gps_haiba_gao, gps_state, power, gps_utc_time, gps_num, gps_hdop, gps_chafen_id, state, h);
            }
            Juge_indoor.data_from_gps(person, gps, gpsxinhao, tagid);
            person_Dell.alert_gpsonoff(tagid, 1);//±êÇ©GPS´¦ÓÚ¿ªÆô״̬
            Dell_gps.alert_ipport(tagid, ip, port);                
            if(BS_urt_add_fence.isDrawfence()) {//ͨ¹ýURT»æÖƵç×ÓΧÀ¸
                BS_urt_add_fence.addfence(tagid,jd, wd,gps_state,h);
            }
 
        }else {//Èç¹û¾­Î³¶È³¤¶È²»ºÏ·¨
            Dell_gps.alert(tagid, power,gps_state, ip, String.valueOf(port));
        }    
 
    }
 
    /**20230711yang¾­Î³¶ÈתΪ¶È¸ñʽÊä³ö*/
    public static void jingweidu_2_du() {
        if(Gps_data_hui_fang.isD2dd()) {//¾­Î³¶ÈתΪ¶È¸ñʽÊä³ö
            String mes=xytognss.jwdzd(gps_weidu,gsp_jingdu);
            BaoWenShow.show4("¶È¸ñʽ:"+mes,"GNSS",tagid);//ÏÔʾGNSSÊý¾Ý
        }
    }
 
    /**Èç¹û¿ªÆôURT×ö»ùվģʽͬʱ´¦Óڹ̶¨½âģʽ*/
    public static void open_urt_to_jizhan() {                            
        if(Systems.isUrtopen()) {
            Dell_gps.urt_moshi(tagid, gsp_jingdu, gps_weidu, gps_state, gps_haiba_gao, gps_num, power);
            urtdo(gps_weidu,gps_state,tagid,gsp_jingdu);
        }
    }
 
    /**λÖùýÂËËã·¨*/
    public static void weizhiok(Tb_gps gps,int xnow,int ynow ) {
        //Èç¹û¿ªÆôλÖùýÂË
        //ÉÏÒ»¸ö×ø±ê
        int x=gps.getGpslastx();
        int y=gps.getGpslasty();
 
        //µ±Ç°×ø±ê
        int x1=xnow;
        int y1=ynow;
        if(x==0 && y==0) {//Èç¹û´¦ÓÚ³õʼ»¯
            gps.setGpslastx(x1);
            gps.setGpslasty(y1);
        }else {
            double a3=(x1-x)*(x1-x)+(y1-y)*(y1-y);
            double a4=Math.sqrt(a3);
            if(a4<Dell_tb_suanfa2.getWeizhiguolvzhi()) {
                weizhiok=true;
 
            }else {
                weizhiok=false;
            }
            gps.setGpslastx(x1);
            gps.setGpslasty(y1);
        }
    }
 
 
    /**λÖùýÂËËã·¨*/
    public static boolean weizhiok2(Tb_gps gps,int xnow,int ynow ) {
        boolean flag=false;
        //Èç¹û¿ªÆôλÖùýÂË
        //ÉÏÒ»¸ö×ø±ê
        int x=gps.getGpslastx();
        int y=gps.getGpslasty();
 
        //µ±Ç°×ø±ê
        int x1=xnow;
        int y1=ynow;
        if(x==0 && y==0) {//Èç¹û´¦ÓÚ³õʼ»¯
            gps.setGpslastx(x1);
            gps.setGpslasty(y1);
            flag=true;
        }else {
            double a3=(x1-x)*(x1-x)+(y1-y)*(y1-y);
            double a4=Math.sqrt(a3);
            if(a4<300) {
                flag=true;
                gps.setGpslastx(x1);
                gps.setGpslasty(y1);
            }else {
                flag=false;
            }
 
 
        }
        return flag;
    }
 
 
    /**Èç¹û¿ªÆôGNSSתXYÐèÒª×öµÄÊÂÇé*/
    public static void gnsstoxy_needdo(
            Tb_gps gps,
            Person person,
            String tagid,
            double wd,
            double jd,
            String gps_weidu,
            String gsp_jingdu,
            String gps_haiba_gao,
            String gps_state,
            String power,
            String gps_utc_time,
            String gps_num,
            String gps_hdop,
            String gps_chafen_time,
            String state,
            double h) {
        xyhf=GnssToXY.run_gps2xy(tagid,wd,jd);
        if(Dell_tb_suanfa2.isGnss2xyopen()) {//Èç¹û¿ªÆôgnssתΪxy×ø±ê
            if(xyhf==null){
                return;
            }
            person.setGps_x(xyhf[0]);
            person.setGps_y(xyhf[1]);
            person.setGps_floor(xyhf[3]);
            person.setGps_z(h);
            if(Dell_tb_suanfa2.getWeizhiguolvzhi()>10) {//¿ªÆôλÖùýÂ˹¦ÄÜ£¬Í¨¹ý¾­Î³¶ÈתΪXY±È½Ï2µãλÖÃÌ«´ó¾ÍÂ˵ô
                weizhiok(gps,xyhf[0],xyhf[1]);
            }                    
        }
        boolean b = weizhiok2(gps, xyhf[0], xyhf[1]);
        if (b) {
            HistoryGNGGA.putInHistory(gps, gps_utc_time, gps_weidu, gsp_jingdu,
                    gps_num, gps_haiba_gao, tagid, power, "1", state, gps_hdop,
                    gps_chafen_time,//²î·Öʱ¼ä
                    GetNowTime.timestamp2()
                    );
        }
    }
 
 
    /**URTģʽÏÂÐèÒª×öµÄÊÂÇé*/
    public static void urtdo(String gps_weidu,String gps_state,String tagid,String gsp_jingdu) {
        if(gps_weidu.length()>4) {
            if( gps_state.equals("4") || gps_state.equals("5") ||urtmode1) {
                GnssToXY.gps2xyurt(tagid,gps_weidu,gsp_jingdu,gps_state);
            }
        }
    }
 
 
    public static boolean isUrtmode1() {
        return urtmode1;
    }
 
 
    public static void setUrtmode1(boolean urtmode1) {
        Dell_GNGGA.urtmode1 = urtmode1;
    }
 
    /**±êǩijÖÖ״̬ÏÂ×öµÄÊÂÇé*/
    //0.³õʼ»¯,1.µ¥µã¶¨Î»,2.Âë²î·Ö,3.ÎÞЧPPS,4.¹Ì¶¨½â,5.¸¡µã½â, 6.ÕýÔÚ¹ÀËã, 7.È˹¤ÊäÈë¹Ì¶¨Öµ,8.Ä£Äâģʽ,9.WAAS²î·Ö
    public static void urtstatedo(Person person,String state,String tagid) {
        if(Systems.isWuxian()) {//Èç¹û¿ªÆôÎÞÏßģʽ
            if(Dell_tb_suanfa2.closeuwb(state)) {
                wuxiando(person,tagid,"0");//¹Ø±ÕUWB
            }else {
                wuxiando(person,tagid,"1");//¿ªÆôUWB
            }            
        }
    }
 
    /**Ãâ²¼Ïßģʽ×öµÄÊÂÇé*/
    public static void wuxiando(Person person,String tagid,String enable) {
        String uwbisopen=String.valueOf(person.getUwbopen());
        if(!uwbisopen.equals(enable)) {
            Control_urt.open_or_close_uwb(person,tagid, enable);
        }
    }
    /*´¦Àí±£Áô2Êý¾Ý*/
    public static void baoliu2(Person person,String bl2){
        if(person==null) {
            return;
        }
        String ac=DellMessage.bytes2BinaryStr(DellMessage.HexStringToBinary(bl2));//°´¼ü
        if(ac.length()<3) {
            return;
        }
        //String sos=String.valueOf(ac.charAt(7));//°´¼üSOS״̬
        String jingzhi=String.valueOf(ac.charAt(6));//»ñÈ¡±êÇ©¾²Ö¹×´Ì¬
        String xm=String.valueOf(ac.charAt(5));//»ñÈ¡±êÇ©ÐÝÃß״̬
        String zhendong=String.valueOf(ac.charAt(2));//»ñÈ¡±êÇ©Õ𶯷äÃù״̬
        String uwb=String.valueOf(ac.charAt(1));//uwb¿ª¹Ø
        int uwb1 = Integer.parseInt(uwb);
        int zd1 = Integer.parseInt(zhendong);
        person.setJingzhi(jingzhi);
        person.setXiumian(xm);
        person.setUwbopen(uwb1);
        person.setNowzhendong(zd1);
    }
 
    /**ת·¢GNGGAÊý¾Ý*/
    public static void zhuanfa_gngga(String message,String tagid) {
        if(Systems.isGps2000()) {//Èç¹û¿ªÆôxyתgnss    
            return;
        }
        if(weizhiok) {//λÖùýÂËûÎÊÌâ            
            Udp_Out.GNGGA_udptcp_out(message, tagid);                                
            if(ForwardDatas.have_http("GNGGA")) {//HTTPת·¢Î»ÖÃÊý¾Ý    
                LinkedHashMap<String, Object> display=new LinkedHashMap<String, Object>();
                display.put("positionmsg", message);
                HTTP_Post.gngga("", "", display);
            }
        }
    }
 
    /**×Ô½¨²î·Ö»ùÕ¾µÄʱºò¼ÆËã±êÇ©ÐèÒªµÄ²î·Ö»ùÕ¾*/
    public static void dell_needbaseid(Person person,String jd0,String wd0) {
        if(!Systems.isBiandianzhan()) {//Èç¹ûÊÇ×Ô½¨²î·Ö»ù׼վģʽ
            return;        
        }
 
        int size=Dell_jizhan.getJizhan_vector().size();//»ñÈ¡²î·Ö»ù×¼Õ¾µÄÊýÁ¿
        if(size>1) {
            for(int i=0;i<size;i++){//±éÀúËùÓеĻù×¼Õ¾
                Jizhan jizhan=Dell_jizhan.getJizhan_vector().get(i);
                String jd1=jizhan.getJingdu();
                String wd1=jizhan.getWeidu();
                int distance=GnssToXY.distance(jd0,wd0,jd1,wd1);//¼ÆËãµ±Ç°×ø±êºÍ»ù×¼Õ¾µÄ¾àÀë
                String actagid=jizhan.getAcid();
                int fugai_dis=Integer.parseInt(jizhan.getDistance())*100;//ÀåÃ×
                if(distance<fugai_dis) {//Èç¹û¾àÀëСÓÚ¸²¸Ç·¶Î§
                    person.setNeedbaseid(actagid);
                    return;
                }
            }
        }
    }
 
    /**20230724yang¾­Î³¶È¶È·Ö¸ñʽת¶È¸ñʽ*/
    public static void jwd_to_do(String gps_weidu,String gsp_jingdu) {
        if(!Systems.isGps2000()) {//Èç¹û¿ªÆôxyתgnss    
            String[] aa0=xytognss.dd2d(gps_weidu, gsp_jingdu);            
            person.setBaoliu2(aa0[0]);
            person.setBaoliu3(aa0[1]);
        }
    }
 
    /**20230724»Ø¸´ÊÕµ½GGAÐÄÌø°ü*/
    public static void hui_fu_ggaok(String ip,int port) {
        String xtbok="$ggaok";
        byte[] bytes = xtbok.getBytes();
        Urt_7000_port.outlora(bytes,bytes.length,ip,port,xtbok);
        String message=GetNowTime.now()+","+ip+":"+port+",»Ø¸´ÐÄÌø°ü$ggaok";
        BaoWenShow.show2(message, "debug", ip, port);//ÏÔʾURT¶Ë¿ÚÊý¾Ý
    }
}