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
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
package JNADell;
import java.math.BigInteger;
import java.util.Arrays;
import java.util.Iterator;
import java.util.Vector;
import BaoWen.HaveOkPosDo;
import BaoWen.Udp_Out;
import Frame.DebugManage;
import Frame.TcpIpManage;
import Method.BaoWenShow;
import Method.GetNowTime;
import Method.JugeHaveZimu;
import PbuliClass.Systems;
import Tag_Ceju.Ceju;
import VectroData.ForwardDatas;
import anchor.Anchor_Dell;
import circle.Dell_ResultYuang;
import circle.Dell_yuang;
import circle.Yuang;
import person.person_Dell;
import tag.Tag_Dell;
import tbDataModel_Dell.Dell_AnchorAndDistance;
import tbDataModel_Dell.ReadPeizhiMessage;
import tcp.TcpClientOneToMany;
 
public class DataToJnaDell {
    static int jianzhi=0;
    public static void  do_dell_JAN(Vector<Ceju> vccj, int lenth,String baoxu) {        
        int[] an_x=new int[lenth];
        int[] an_y=new int[lenth];
        int[] an_z=new int[lenth];
        int[] distance =new int[lenth];
        int[] anchorid=new int[lenth];
        int[] anchordistance=new int[lenth];
        //»ùվά¶È
        int[] dimension=new int[lenth];
        //»ùÕ¾ËùÔÚµÄ×é
        int[] zu=new int[lenth];
        int i=0;
        String layer="0";
 
        int baoxuint=Integer.parseInt(baoxu);
 
        //±êÇ©µÄ¸ß¶È
        int tag_heigh=0;
 
        String tagidstr="0000";
 
        int tagid=0;    
        @SuppressWarnings("unused")
        String tag_heighstr="";
 
        //ÐźÅÇ¿¶È
        int signal_power=0;
 
        //µçÁ¿
        String batarry="0";
 
        //ËÙ¶ÈÏÞÖÆ
        int tagspeed_limit=0;
 
        //±êÇ©¾²Ö¹×´Ì¬
        int stationary_flag=0;
 
        //ʱ¼ä´Á
        int timestamp=GetNowTime.timestamp();
 
        //±êǩƵÂÊ
        int taghz=0;
 
        //µÚ1·ÐźÅÇ¿¶È
        int[] power=new int[lenth];
 
        //µÚ2·ÐźÅÇ¿¶È
        int[] power_diff=new int[lenth];
 
        String sos="0";
 
        Iterator<Ceju> it=vccj.iterator();
 
        while(it.hasNext()) {
 
            Ceju tag_raw=it.next();    
 
            //±êÇ©id
            tagidstr=tag_raw.getCe_tagid();
 
            //ÅжϱêÇ©idÖÐÊÇ·ñº¬ÓÐ×Öĸ
            if(JugeHaveZimu.haszimu(tag_raw.getCe_tagid())) {
 
                tagid=ReadPeizhiMessage.decodeHEX(tag_raw.getCe_tagid());
            }else {
                tagid=Integer.parseInt(tag_raw.getCe_tagid());
            }
 
            //±êǩƵÂÊ
            taghz=tag_raw.getCe_taghz();
 
 
            //±êÇ©µçÁ¿
            batarry=tag_raw.getCe_battery();
 
            //»ùÕ¾id
            String anchoid=tag_raw.getCe_anchorid();
 
            //»ùÕ¾x×ø±ê
            an_x[i]=Integer.parseInt(Anchor_Dell.get_anchor(anchoid).getAnc_x());
 
            //»ùÕ¾y×ø±ê
            an_y[i]=Integer.parseInt(Anchor_Dell.get_anchor(anchoid).getAnc_y());
 
            //»ùÕ¾z×ø±ê
            an_z[i]=Integer.parseInt(Anchor_Dell.get_anchor(anchoid).getAnc_z());
 
            //»ùÕ¾µÄÁ¿³Ì
            String liangcheng=Anchor_Dell.get_anchor(anchoid).getAnc_distance();
            if(liangcheng.equals("ÎÞÏÞÖÆ")) {
                liangcheng="1000000";
            }
 
            anchordistance[i]=Integer.parseInt(tag_raw.getCe_distance());
 
            //ÅжϻùÕ¾idÖÐÊÇ·ñº¬ÓÐ×Öĸ
 
            int inanchorid=0;
            if(JugeHaveZimu.haszimu(anchoid)) {
 
                inanchorid=ReadPeizhiMessage.decodeHEX(anchoid);
            }else {
                inanchorid=Integer.parseInt(anchoid);
            }
 
            //»ùÕ¾µÄid
            anchorid[i]=inanchorid;
 
            //»ùÕ¾ºÍ±êÇ©µÄ¾àÀë
            distance[i]=Integer.parseInt(tag_raw.getCe_distance());
 
 
 
            //»ùÕ¾ËùÔÚµÄ×é
            zu[i]=Integer.parseInt(Anchor_Dell.get_anchor(anchoid).getAnc_zu());
 
            //±êÇ©¸ß¶È
            tag_heigh=Integer.parseInt(Tag_Dell.get_tag(tagidstr).getTag_pos_z());
 
            //±êÇ©¾²Ö¹×´Ì¬
            stationary_flag=Integer.parseInt(tag_raw.getCe_jingzhi());
 
            //±êÇ©¸ß¶È×Ö·û´®
            tag_heighstr=String.valueOf(tag_heigh);
 
            //±êÇ©ËÙ¶ÈÏÞÖÆ
 
            if(Tag_Dell.get_tag(tagidstr).getTag_sulv().equals("ÎÞ")) {
                tagspeed_limit=100000;
            }else {                    
                tagspeed_limit=Integer.parseInt(Tag_Dell.get_tag(tagidstr).getTag_sulv());
            }
 
            //sos
            sos=tag_raw.getCe_button();
 
            //²ã
            layer=Tag_Dell.get_tag(tagidstr).getTag_floor();
 
            //µÚһ·ÐźÅÇ¿¶È
            power[i]=Integer.parseInt(tag_raw.getCe_power());
 
            //µÚ¶þ·ÐźÅÇ¿¶È
            power_diff[i]=Integer.parseInt(tag_raw.getCe_power_diff());
 
            i++;
        }
 
 
 
        //¾²Ö¹Ê±Êä³ö¹Ì¶¨×ø±êÈç¹ûû¹´Ñ¡
        if(Systems.sys().getQuiet().equals("0")) {
            stationary_flag=0;            
        }
 
 
        /**°üÐò,ʱ¼ä´Á,(»ùÕ¾X×ø±ê¼¯ºÏ)£¬(»ùÕ¾Y×ø±ê¼¯ºÏ)£¬(»ùÕ¾z×ø±ê¼¯ºÏ)£¬(»ùÕ¾±êÇ©¾àÀë)£¬»ùÕ¾ÊýÁ¿£¬(»ùÕ¾ID)£¬±êÇ©ID£¬±êÇ©¸ß¶È£¬
         * ÐźÅÇ¿¶È£¬±êÇ©ËÙ¶ÈÏÞÖÆ£¬(»ùÕ¾Á¿³Ì)£¬(»ùվά¶È)£¬±êÇ©¾²Ö¹×´Ì¬£¬(µÚһ·ÐźÅÇ¿¶È)£¬(µÚ¶þ·ÐźÅÇ¿¶È),±êǩƵÂÊ**/
        /**Èç¹ûµ÷ÊÔģʽ¿ªÆô*/
        if(TcpIpManage.getStar() && TcpIpManage.getDatatypeis().equals("µ÷ÊÔÊý¾Ý")) {
            StringBuffer text_str=new StringBuffer();
            text_str.append("  "+
                    baoxu+","//°üÐò
                    +timestamp+","//ʱ¼ä´Á
                    +getbuf(an_x)+","//»ùÕ¾X×ø±ê
                    +getbuf(an_y)+","//»ùÕ¾Y×ø±ê
                    +getbuf(an_z)+","//»ùÕ¾Z×ø±ê
                    +getbuf(distance)+","//»ùÕ¾ºÍ±êÇ©¾àÀë
                    +lenth+","//»ùÕ¾ÊýÁ¿
                    +getbuf(anchorid)+","//»ùÕ¾ID
                    +tagidstr+","//±êÇ©ID
                    +tag_heigh+","//±êÇ©¸ß¶È
                    +taghz+","//±êǩƵÂÊ
                    +tagspeed_limit+","//ËÙ¶ÈÏÞÖÆ100000´ú±íÎÞÏÞÖÆ
                    +getbuf(anchordistance)+","//»ùÕ¾Á¿³ÌÏÞÖÆ100000´ú±í²»ÏÞÖÆ£¨³¬³öÁ¿³Ì²»²ÎÓë¼ÆË㣩
                    +getbuf(dimension)+","//»ùÕ¾µÄά¶È
                    +stationary_flag+","//±êÇ©¾²Ö¹×´Ì¬£¬1´ú±í¾²Ö¹£¬0´ú±íû¾²Ö¹
                    +getbuf(power)+","//µÚһ·ÐźÅÇ¿¶È
                    +getbuf(power_diff)+","//µÚ¶þ·ÐźÅÇ¿¶È
                    +taghz+","//±êÇ©µÄƵÂÊ
                    +getbuf(zu)+","//»ùÕ¾ËùÔÚµÄ×é
                    +getbuf(Anchor_Dell.anchor_floor(anchorid))+","//»ùÕ¾ËùÔڵIJã
                    +"0"//ÆøÑ¹¼Æ¸ß¶È
                    );
 
            TcpIpManage.get_text_area().append(text_str+"\n");
            TcpIpManage.get_text_area().setCaretPosition(TcpIpManage.get_text_area().getText().length());
            text_str=new StringBuffer();
        }
 
        int[] pos= {0,0,0,0};
 
        /**½«Êý¾Ý¸øµ½¶¯Ì¬¿âJNA´¦Àí
         * @param baoxu°üÐò
         * @param timestampʱ¼ä´Á £¨Ð¡Ê±*3600+·ÖÖÓ*60£©*1000 
         * @param an_x[]»ùÕ¾X×ø±ê
         * @param an_y[]»ùÕ¾y×ø±ê
         * @param an_z[]»ùÕ¾z×ø±ê
         * @param dis[] ±êÇ©µ½»ùÕ¾¾àÀë
         * @param  anchor_num »ùÕ¾ÊýÁ¿
         * @param  anchor_id»ùÕ¾id
         * @param  tag_id ±êÇ©id
         * @param  tag_heigt ±êÇ©¸ß¶È s
         * @param  tag_hz±êǩƵÂÊ
         * @param  tagspeed_limitËÙ¶ÈÏÞÖÆ
         * @param  anchour_distance[]»ùÕ¾µÄÁ¿³Ì
         * @param  dimension[] Ë㷨ѡÔñ1ÊÇ1ά2ÊǶþά
         * @param  stationary_flag¾²Ö¹×´Ì¬
         * @param  tag_pos ·µ»ØµÄ±êÇ©×ø±ê
         * @param  power[]µÚһ·¾¶ÐźÅÇ¿¶È¼¯ºÏ
         * @param  power_diff[]µÚ¶þ·ÐźÅÇ¿¶È¼¯ºÏ
         * @param  zu[]»ùÕ¾ËùÔÚµÄ×é
         * @param foor[]»ùÕ¾ËùÔڵIJã
         * @param qiya±êÇ©ÆøÑ¹¼ÆÖµ*/        
        pos=DellJAN.get_tag_pos(                
                baoxuint, // °üÐò
                timestamp, // Ê±¼ä´Á
                tagid, // ±êÇ©id
                tag_heigh, // ±êÇ©¸ß¶È
                taghz, // ±êǩƵÂÊ
                tagspeed_limit, // ±êÇ©×î´óËÙ¶È
                stationary_flag, // ±êÇ©¾²Ö¹×´Ì¬flag
                0, // ÆøÑ¹¸ß¶È, Ô­À´µÄ¸ß¶ÈÐÅÏ¢Ïȱ£Áô²»¶¯
                lenth, // »ùÕ¾ÊýÄ¿
                anchorid, // »ùÕ¾id, Óëannum¶ÔÓ¦
                anchordistance, // ²â¾à, Óëannum¶ÔÓ¦
                power, // ÐźÅÇ¿¶È, Óëannum¶ÔÓ¦
                power_diff // ÐźÅÇ¿¶È²î, Óëannum¶ÔÓ¦                 
                );
 
        //Èç¹û¿ªÆô»­È¦Ä£Ê½
        if(DebugManage.isStart_test()) {
            StringBuffer text=null;
            String choosetag=DebugManage.getTagid_str();
            if(choosetag.equals("Ñ¡Ôñ±êÇ©") || choosetag.equals(tagidstr)) {
                int size=anchorid.length;
                for(int k=0;k<size;k++) {
                    Yuang circle=new Yuang();
                    circle.setJianzhi(jianzhi);
                    circle.setTagid(tagidstr.toString());
                    circle.setAnchorid(String.valueOf(anchorid[k]));
                    circle.setFloor(Anchor_Dell.anchor_floor(anchorid)[k]);
                    circle.setX(an_x[k]);
                    circle.setY(an_y[k]);
                    circle.setAnchor_h(an_z[k]);
                    circle.setTag_h(tag_heigh);
                    circle.setWidth(distance[k]);
                    circle.setTagid(tagidstr);
                    Dell_yuang.add_ayvc(jianzhi, String.valueOf(Anchor_Dell.anchor_floor(anchorid)[k]), circle,baoxu,pos);
                }
 
                text=new StringBuffer(GetNowTime.timestamp2()+", tagid:"
                        +tagidstr+", seq: "
                        +baoxu+", anchorid: "
                        +getbuf(anchorid)+", distance: "
                        +getbuf(distance)+", posx: "
                        +getbuf(an_x)+", posy: "
                        +getbuf(an_y)+", posz: "
                        +getbuf(an_z)+", tagheight: "                        
                        +String.valueOf(tag_heigh)+", signal_power: "
                        +String.valueOf(signal_power)+", tagspeed_limit: "
                        +String.valueOf(tagspeed_limit)+", dimension: "
                        +getbuf(dimension)+", anchordistance: "
                        +getbuf(anchordistance)+", power:"
                        +getbuf(power)+", power_diff:"
                        +getbuf(power_diff)+", taghz:"
                        +taghz+", zu:"
                        +getbuf(zu)
                        );
 
            }
            if(text !=null) {
                Dell_ResultYuang.add_resty(pos[0],pos[1],pos[2],pos[3], jianzhi,text.toString(),baoxu);
                jianzhi++;
            }
 
        }
 
        //Èç¹ûÊÇÓÐЧµÄλÖÃÐÅÏ¢
        if(!(DellJAN.getYouxiao()<0)) {            
            int x=pos[0];
            int y=pos[1];
            String floor=String.valueOf(pos[3]);
            String zz=String.valueOf(tag_heigh);
            String time=GetNowTime.now();
            HaveOkPosDo.do_something(
                    tagidstr, 
                    baoxu, 
                    x, 
                    y,
                    pos[2],
                    floor, 
                    zz,
                    batarry
                    );
            person_Dell.alert_person_UWBxyfpo(tagidstr, x, y,zz,floor,time);
 
            //UDPת·¢Î»Öñ¨ÎÄ
 
            /**
             * UWB±êÇ©ÉÏ´«µÄλÖñ¨ÎÄ
             * display,[lenth],[tagid],[baoxu],[timestamp],[layer],[x],[y],[z], [vbat],[state],[sos],[mark]
             * Ê¾Àý£º
             * display,64,2012,70,2020-12-14 13:08:33.479,0,648,367,150,32,0,0,1
             * ËµÃ÷£º
             * 1    display:°üÍ·
             * 2    [length]£º±¨Îij¤¶È
             * 3    [tagid] £º±êÇ©µÄIDºÅ£¬Î¨Ò»±àºÅ
             * 4    [baoxu] £º°üÐò£¨0~255Ñ­»·£©
             * 5    [timestamp] £ºÊ±¼ä´Á£¨ÕâÌõ±¨ÎÄ·¢³öµÄʱ¼ä£©
             * 6    [layer] £º±êÇ©ËùÔڵIJã
             * 7    [x] £º±êÇ©µÄX×ø±ê£¬µ¥Î»ÀåÃ×
             * 8    [y] £º±êÇ©µÄY×ø±ê£¬µ¥Î»ÀåÃ×
             * 9    [z] £º±êÇ©µÄZ×ø±ê£¬µ¥Î»ÀåÃ×
             * 10    [vbat] £º±êÇ©µÄµçÁ¿ÐÅÏ¢£¬£¨0~100£©
             * 11    [state] £º±êÇ©µÄ״̬£¬¾²Ö¹Îª1£¬Ô˶¯Îª0
             * 12    [sos] £º±êÇ©µÄSOS°´¼ü״̬£¬°´ÏÂΪ1£¬Ã»Óа´ÏÂΪ0
             * 13    [mark] £º±ê־λ£¬Çø±ð´ÓÄĸöÒýÇæÉÏ´«Êý¾Ý£¬ÊÊÓÃÓÚ¶à¸öÏîÄ¿´«ÈëÒ»¸öƽ̨£¬Ä¬ÈÏΪ0**/            
 
            String baotou=Systems.sys().getBaowentou()+"display,";
            int len=0;        
            StringBuffer addtime=new StringBuffer(GetNowTime.timestamp2());
            StringBuffer display0=new StringBuffer(baotou
                    +len+","
                    +tagidstr+","
                    +baoxu+","
                    +addtime+","
                    +layer+","
                    +pos[0]+","
                    +pos[1]+","
                    +tag_heigh+","
                    +batarry+","
                    +stationary_flag+","
                    +sos+","
                    +Systems.sys().getBiaozhi()
                    );
 
            len=display0.length()+1;
 
 
 
            StringBuffer display=new StringBuffer(baotou
                    +len+","
                    +tagidstr+","
                    +baoxu+","
                    +addtime+","
                    +layer+","
                    +pos[0]+","
                    +pos[1]+","
                    +tag_heigh+","
                    +batarry+","
                    +stationary_flag+","
                    +sos+","
                    +Systems.sys().getBiaozhi()
                    );
 
 
            /**Èç¹û´æÔÚÐèÒªUDP/TCPת·¢Î»ÖÃÐÅÏ¢**/
            Udp_Out.udp_tcp_out_display(display.toString(), tagidstr);
            addtime.setLength(0);
            display0.setLength(0);
            display.setLength(0);
 
            //Èç¹ûûÓмÆËãµÃµ½Î»ÖÃÖ´ÐÐÏÂÃæµÄ²Ù×÷
        }else {
 
            //status2: [LEN],[tagid],[SEQ],[TimeStamp],[ANCHORID],[distance]
            /**£º¸Ã À౨ÎĽöÔÚÎÞ·¨¼ÆËã³öλÖÃÇÒÆôÓøÃ״̬ÉϹ¦ÄÜʱ£¬
             *  ÔÚλÖÃÊý¾ÝÀàÐÍÖÐÊä³ö ÔÚλÖÃÊý¾ÝÀàÐÍÖÐÊä³ö £¡
             *  ÉÏÊöʾÀýÖбíD345 ±êÇ©Óë 69A6»ùÕ¾×î½ü£¬ÇÒ¾àÀëֵΪ 437cm¡£**/
 
            if(distance.length>0) {
 
 
 
                int size1=anchorid.length;
                for(int h=0;i<size1;i++) {
                    Dell_AnchorAndDistance.insert_anc_dis(distance[h], String.valueOf(anchorid[h]));
                }
 
                //ʵÏÖÊý×é´Ó´óµ½Ð¡ÅÅÐò
                Arrays.sort(distance);
 
                int distances=distance[distance.length-1];
                String anchoid=Dell_AnchorAndDistance.get_anchorid(distances);
 
                int len=0;
                String status="status2: "+len+","+tagidstr+","+baoxu+","+GetNowTime.timestamp2()+","+anchoid+","+distances;
 
                len=status.length()+1;
 
                String status2="status2: "+len+","+tagidstr+","+baoxu+","+GetNowTime.timestamp2()+","+anchoid+","+distances;
 
                int length1=status2.toString().getBytes().length;
 
                if((ForwardDatas.have_udp("λÖÃÊý¾Ý") || ForwardDatas.have_udp("È«²¿Êý¾Ý") ) && length1>20) {
 
                    if(ForwardDatas.have_udp("λÖÃÊý¾Ý")) {
                        Udp_Out.udp_out(status2.toString().getBytes(), length1,"λÖÃÊý¾Ý");
                    }else {
                        Udp_Out.udp_out(status2.toString().getBytes(), length1,"È«²¿Êý¾Ý");
                    }
 
                    //ÏÔʾUDPת·¢µÄÊý¾Ý
                    if(TcpIpManage.getStar()&& TcpIpManage.getDatatypeis().equals("UDPת·¢")) {
 
                        //ÏÔʾUDPת·¢µÄÊý¾Ý
                        BaoWenShow.show(status2.toString(), "UDPת·¢","Ñ¡Ôñ±êÇ©");
                    }
 
                }
 
                /**Èç¹û´æÔÚÐèÒªTCPת·¢Î»ÖÃÐÅÏ¢**/
                if((ForwardDatas.have_tcp("λÖÃÊý¾Ý") || ForwardDatas.have_tcp("È«²¿Êý¾Ý") )&& length1>20) {
                    TcpClientOneToMany.send(status2.toString());
                }
 
            }
 
            tagidstr=null;
 
            Dell_AnchorAndDistance.delete_all();
        }
    }
 
 
    /*16½øÖÆ×ªÎª10½øÖÆ*/
    public static int decodeHEX(String hexs){
        BigInteger bigint=new BigInteger(hexs, 16);
        int numb=bigint.intValue();
        return numb;
    }
 
    /**´Ëº¯ÊýÓÃÓÚÊä³öÕûÐÎÊý×éÖеÄÖµ*/
    public static StringBuffer getbuf(int[] mes) {
        StringBuffer strbuf=new StringBuffer();
        int size=mes.length;
 
        if(size>2) {
            for(int h=0;h<size;h++) {
                if(h==0) {
                    strbuf.append("("+mes[h]+",");
                }else if(h !=0 && h !=mes.length-1) {
                    strbuf.append(mes[h]+",");    
                }else {
                    strbuf.append(mes[h]+")");    
                }
            }
        }
 
        if(size==2) {
            for(int h=0;h<size;h++) {
                if(h==0) {
                    strbuf.append("("+mes[h]+",");
                }else {
                    strbuf.append(mes[h]+")");    
                }
            }
        }
 
        if(size==1) {
            for(int h=0;h<size;h++) {
                if(h==0) {
                    strbuf.append("("+mes[h]+")");
                }
            }
        }        
 
        return strbuf;
    }
 
    
    /**´Ëº¯ÊýÓÃÓÚÊä³öÕûÐÎÊý×éÖеÄÖµ*/
    public static StringBuffer getbufString(String[] mes) {
        StringBuffer strbuf=new StringBuffer();
        int size=mes.length;
 
        if(size>2) {
            for(int h=0;h<size;h++) {
                if(h==0) {
                    strbuf.append("("+mes[h]+",");
                }else if(h !=0 && h !=mes.length-1) {
                    strbuf.append(mes[h]+",");    
                }else {
                    strbuf.append(mes[h]+")");    
                }
            }
        }
 
        if(size==2) {
            for(int h=0;h<size;h++) {
                if(h==0) {
                    strbuf.append("("+mes[h]+",");
                }else {
                    strbuf.append(mes[h]+")");    
                }
            }
        }
 
        if(size==1) {
            for(int h=0;h<size;h++) {
                if(h==0) {
                    strbuf.append("("+mes[h]+")");
                }
            }
        }        
 
        return strbuf;
    }
    
 
    public static int getJianzhi() {
        return jianzhi;
    }
 
 
    public static void setJianzhi(int jianzhi) {
        DataToJnaDell.jianzhi = jianzhi;
    }
 
 
 
 
 
}