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
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
package Frame;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import java.io.IOException;
import java.util.Vector;
import javax.swing.ButtonGroup;
import javax.swing.ImageIcon;
import javax.swing.JCheckBox;
import javax.swing.JFileChooser;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JRadioButton;
import javax.swing.JScrollPane;
import javax.swing.JTextArea;
import javax.swing.JTextField;
import javax.swing.event.InternalFrameEvent;
import javax.swing.event.InternalFrameListener;
import javax.swing.filechooser.FileNameExtensionFilter;
import BaoWen.Dell_55AA03;
import BaoWen.Udp_Receive;
import ColorAndFont.UIColor;
import Method.GetDeskPath;
import Method.GetNowTime;
import Method.JComboBoxModel;
import PbuliClass.JButtonModel;
import PbuliClass.JlableModel;
import PbuliClass.ShowMessage;
import PbuliClass.Systems;
import PbuliClass.jinternalFrame;
import anchor.Anchor;
import anchor.Anchor_Dell;
import anchor.Write_peizhi;
import tbDataModel_Dell.Dell_Ip;
import tbDataModel_Dell.Read_Write_Anchor_Message;
import tbDataModel_Dell.Tools;
import ymodem.Update;
 
/**»ùÕ¾ÉèÖÃÒ³Ãæ*/
public class AnchorSet extends jinternalFrame {
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    JPanel mb=null;
    JlableModel jl_choose_anchor= new JlableModel("Ñ¡Ôñ»ùÕ¾:");    
    JlableModel jl_nearanchor= new JlableModel("ͬ²½»ùÕ¾/ÀàÐÍ");    
    JlableModel jl_nearanchornum= new JlableModel("ÁÙ½ü»ùÕ¾ÊýÁ¿:");
    JlableModel jl_anchorid= new JlableModel("É豸±àºÅ:");    
    JlableModel jl_gonglv= new JlableModel("·¢É书ÂÊ:");    
    JlableModel jl_wucha= new JlableModel("Îó²îУ׼:");    
    JlableModel jl_lvbo= new JlableModel("Â˲¨²ÎÊý:");
    JlableModel jl_tongxuzu= new JlableModel("ͨѶС×é:");
    JlableModel jl_shangxian= new JlableModel("ͨѶÉÏÏÞ:");
    JlableModel jl_hz= new JlableModel("ͨѶƵÂÊ:");
    JlableModel jl_banben= new JlableModel("¹Ì¼þ°æ±¾:");
    JlableModel jl_moshi=new JlableModel("É豸ģʽ:");
    JlableModel jl_qiehuan=new JlableModel("Çл»¾àÀë:");
    JlableModel jl_gaojiaohzun=new JlableModel("¸ß¶ÈУ׼:");
    JlableModel jl_fastdis=new JlableModel("×î´ó²â¾à/cm:");
    JlableModel jl_allout=new JlableModel("Êý¾ÝÈ«²¿Êä³ö:");
    public static boolean is=false;
    static boolean readpeizhi=false;
    static int isok=0;
    JTextField jtf_ip=null;//»ùÕ¾ipµØÖ·
    static public JTextField jf_anchorid=null;
    static public JTextField jf_gonglv=null;
    static public JTextField jf_wucha=null;
    static public JTextField jf_lvbo=null;
    static public JTextField jf_tongxuzu=null;
    static public JTextField jf_banben=null;
    static public JTextField jf_shangxian=null;
    static public JTextField jf_hz=null;
    static public JTextField jf_nearancnum=new JTextField();
    static public JTextField jf_near1=new JTextField();
    static public JTextField jf_near2=new JTextField();
    static public JTextField jf_near3=new JTextField();
    static public JTextField jf_near4=new JTextField();
    static public JTextField jf_near5=new JTextField();
    static public JTextField jf_near6=new JTextField();
    static public JTextField jf_near7=new JTextField();
    static public JTextField jf_near8=new JTextField();
    static public JTextField jf_near9=new JTextField();
    static public JTextField jf_near10=new JTextField();
    static public JTextField jf_qiehuan=new JTextField();
    static public JTextField jf_allout=new JTextField();
    JTextField  jt_shengji=new JTextField();
    JButtonModel jbt_xunze=null;//Ñ¡ÔñÎļþ
    static JButtonModel jbt_shengji=null;//Éý¼¶
    static JButtonModel jbt_write=null;//дÈë
    static JButtonModel uwbUp=null;//½øÈëuwbÉý¼¶Ä£Ê½
    static JButtonModel exitUwbUp=null;//Í˳öuwbÉý¼¶Ä£Ê½
 
 
    static public JTextField jf_rootanchor=new JTextField();//ͬ²½»ùÕ¾
    //¸ß¶ÈУ׼
    static public JTextField jc_gaojiaohzun=new JTextField();
    //×îÔ¶²â¾à¾àÀë
    static public JTextField jf_fastdis=new JTextField();
    String cejuip=null;//²â¾à»ùÕ¾IP
    static String xuhao="0";
    JTextField jf_bin=null;
    ButtonGroup btgroup=null;//ÉêÃ÷°´Å¥×é
    static public JRadioButton anchor=null;
    static public JRadioButton tag=null;
    static public JCheckBox jc_initiative=null;//Ö÷¶¯²â¾à
    static public JCheckBox jc_heart=null;//ÐÄÌø°ü¹¦ÄÜÄØ
    JScrollPane gd=null;
    JButtonModel jbt_read_peizhi=null;
    JButtonModel jbt_reboot;//ÖØÆô
    JButtonModel jbt_reset;//»Ö¸´³ö³§
    JButtonModel jbt_save;//±£´æÅäÖÃ
    JButtonModel jbt_bin;//Ñ¡ÔñbinÎļþ
    JButtonModel jbt_grade;//Éý¼¶¹Ì¼þ
    JButtonModel jbt_alertall;//ÐÞ¸ÄËùÓлùÕ¾
    JButtonModel jbt_zanting;//ÐÞ¸ÄËùÓлùÕ¾
    JButtonModel jbt_clear;//Çå¿Õ
    static public JTextArea jt_area=new JTextArea();
    JComboBoxModel box_anchorid=null;//»ùÕ¾µÄ¼¯ºÏ
    static JComboBoxModel box_anchortype=null;//»ùÕ¾ÀàÐÍ
    JProgressBar progressBar;
    String anchorid=null;
    String anchorip=null;    
    int x0=30;
    int y0=20;
    int height=25;
    static boolean isopen=false;//µ±Ç°´°¿ÚÊÇ·ñ´¦ÓÚ¿ªÆô״̬
    static String ischooseanchor=null;//µ±Ç°Ñ¡ÖеĻùÕ¾ID
    static String ischooseip="192.168.0.1";//µ±Ç°Ñ¡ÖеĻùÕ¾IP
    String path;
    static boolean shengjimoshi=false;
    static boolean write=false;
    static boolean zanting=true;
    public AnchorSet() {
        String title="»ùÕ¾ÅäÖÃ";
        if(Systems.sys().getLanguage().equals("English")) {
            title="Anchor Site";
        }
        this.setTitle(title);
        Container rq=getContentPane();//»ñÈ¡ÈÝÆ÷
        rq.setLayout(new BorderLayout());
        rq.add(getMb(),BorderLayout.CENTER);
        this.addInternalFrameListener(new InternalFrameListener() {
            public void internalFrameOpened(InternalFrameEvent e) {    
            }
            public void internalFrameIconified(InternalFrameEvent e) {
                isopen=false;
            }
            public void internalFrameDeiconified(InternalFrameEvent e) {
                isopen=true;
            }
 
            public void internalFrameDeactivated(InternalFrameEvent e) {
                isopen=false;
            }
            public void internalFrameClosing(InternalFrameEvent e) {
                isopen=false;
                readpeizhi=false;
                ischooseanchor=null;
                shengjimoshi=false;
                write=false;
                if(is) {
                    byte[] byt=Read_Write_Anchor_Message.WriteData((byte)0x10,(byte)0x2,0);                        
                    if(Dell_Ip.get_ipanchor(cejuip)!=null) {
                        String a=jf_anchorid.getText().trim();
                        Anchor anchor=Anchor_Dell.get_anchor(a);
                        if(anchor==null) {
                            ShowMessage.zidingyi(a+"²»´æÔÚ...");
                            return;
                        }
                        Udp_Receive.out(byt,byt.length,anchor,"»ùÕ¾ÉèÖÃ");
                    }
                    is=false;
                }
                jt_area.setText("");
            }
            public void internalFrameClosed(InternalFrameEvent e) {
 
            }
 
            public void internalFrameActivated(InternalFrameEvent e) {
                isopen=true;
            }
        });
        this.setBounds(175, 0, 980, 585);
        this.setFrameIcon(new ImageIcon("image/icon/setanchor.png"));//ÉèÖô°Ìåͼ±ê
        getBtgroup();
 
 
    }
 
    public JPanel getMb() {
        if(mb==null) {
            mb=new JPanel();
            mb.setLayout(null);
            mb.setBackground(UIColor.getNorth_color());
            mb.add(getJbt_xunze());
            mb.add(getJbt_shengji());
            mb.add(jt_shengji);
            mb.add(getJbt_write());
            mb.add(getUwbUp());
            mb.add(getExitUwbUp());
 
            //Ñ¡Ôñ»ùÕ¾
            jl_choose_anchor.setBounds(x0, y0,75, height);
            mb.add(jl_choose_anchor);
 
            //»ùÕ¾idÏÂÀ­¿ò
            mb.add(getBox_anchorid());
            box_anchorid.setBounds(x0+75, y0, 100, height);
 
            //»ùÕ¾ipµØÖ·
            mb.add(getJtf_ip());
            jtf_ip.setBounds(x0+185, y0, 130, height);
 
            //¶ÁÈ¡ÅäÖð´Å¥
            mb.add(getJbt_read_peizhi());
            jbt_read_peizhi.setBounds(x0+340, y0,80, height);
 
            //É豸ģʽ
            jl_moshi.setBounds(x0, y0+40,75, height);
            getAnchor().setBounds(x0+75, y0+40,70, height);
            getTag().setBounds(x0+160, y0+40,70, height);
            mb.add(jl_moshi);
            mb.add(anchor);
            mb.add(tag);
 
 
            //»ùÕ¾»¥²â¾à
 
            getJc_initiative().setBounds(x0+245, y0+40,90, height);
            mb.add(jc_initiative);
 
            //ÐÄÌø°ü
            getJc_heart().setBounds(x0+350, y0+40,100, height);
            mb.add(jc_heart);
 
            //»ùÕ¾id
            jl_anchorid.setBounds(x0, y0+80,75, height);
            getJf_anchorid().setBounds(x0+75, y0+80,100, height);
            mb.add(jl_anchorid);
            mb.add(jf_anchorid);
 
            //É豸¹¦ÂÊ
            jl_gonglv.setBounds(x0+240, y0+80,75, height);
            getJf_gonglv().setBounds(x0+315, y0+80,100, height);
            mb.add(jl_gonglv);
            mb.add(jf_gonglv);
 
            //Îó²îУ׼
            jl_wucha.setBounds(x0, y0+120,75, height);
            getJf_wucha().setBounds(x0+75, y0+120,100, height);
            mb.add(jl_wucha);
            mb.add(jf_wucha);
 
            //Â˲¨²ÎÊý
            jl_lvbo.setBounds(x0+240, y0+120,75, height);
            getJf_lvbo().setBounds(x0+315, y0+120,100, height);
            mb.add(jl_lvbo);
            mb.add(jf_lvbo);
 
 
            //ͨѶ·Ö×é
            jl_tongxuzu.setBounds(x0, y0+160,75, height);
            getJf_tongxuzu().setBounds(x0+75, y0+160,100, height);
            mb.add(jl_tongxuzu);
            mb.add(jf_tongxuzu);
 
            //²â¾àƵÂÊ
            jl_hz.setBounds(x0+240, y0+160,75, height);
            getJf_hz().setBounds(x0+315, y0+160,100, height);
            mb.add(jl_hz);
            mb.add(jf_hz);
 
            //ͨѶÉÏÏÞ
            jl_shangxian.setBounds(x0, y0+200,75, height);
            getJf_shangxian().setBounds(x0+75, y0+200,100, height);
            mb.add(jl_shangxian);
            mb.add(jf_shangxian);    
 
 
            //¹Ì¼þ°æ±¾
            jl_banben.setBounds(x0+240, y0+200,75, height);
            getJf_banben().setBounds(x0+315, y0+200,100, height);
            mb.add(jl_banben);
            mb.add(jf_banben);
 
            //ÁÙ½ü»ùÕ¾ÊýÁ¿
            jl_nearanchornum.setBounds(x0+240, y0+240,110, height);
            jf_nearancnum.setBounds(x0+350, y0+240,65, height);
            mb.add(jl_nearanchornum);
            mb.add(jf_nearancnum);
 
            //ͬ²½»ùÕ¾ÀàÐÍ
            jl_nearanchor.setBounds(x0, y0+240,100, height);
            jf_rootanchor.setBounds(x0+100, y0+240,50, height);
            getBox_anchortype().setBounds(x0+155, y0+240,60, height);
            mb.add(jl_nearanchor);
            mb.add(jf_rootanchor);
            mb.add(box_anchortype);
 
            //ÁÙ½ü»ùÕ¾1
            jf_near1.setBounds(x0, y0+280,80, height);
            jf_near2.setBounds(x0+90, y0+280,80, height);
            jf_near3.setBounds(x0+180, y0+280,80, height);
            jf_near4.setBounds(x0+270, y0+280,80, height);
            jf_near5.setBounds(x0+360, y0+280,80, height);
            jf_near6.setBounds(x0, y0+320,80, height);
            jf_near7.setBounds(x0+90, y0+320,80, height);
            jf_near8.setBounds(x0+180, y0+320,80, height);
            jf_near9.setBounds(x0+270, y0+320,80, height);
            jf_near10.setBounds(x0+360, y0+320,80, height);
 
            //Çл»¾àÀë
            jl_qiehuan.setBounds(x0, y0+360,80, height);
            jf_qiehuan.setBounds(x0+80, y0+360,95, height);
 
            //×îÔ¶²â¾à¾àÀ뵥λÀåÃ×
            int y11=y0+360+40;
            jl_fastdis.setBounds(x0, y11,140, height);
            jf_fastdis.setBounds(x0+95, y11,80, height);
            mb.add(jl_fastdis);
            mb.add(jf_fastdis);
 
            //ËùÓÃÊý¾ÝÊä³ö    
            mb.add(jl_allout);
            mb.add(jf_allout);
            jl_allout.setToolTipText("×÷ΪÖ÷»úÕ¾µÄʱºò¿ªÆô½ÓÊÕËùÓûùÕ¾Êý¾Ýģʽ1¿ªÆô0¹Ø±Õ");
            jl_allout.setBounds(x0+240, y11,100, height);
            jf_allout.setBounds(x0+340, y11,90, height);
 
            //¸ß¶ÈУ׼
            jl_gaojiaohzun.setBounds(x0+240, y0+360,80, height);
            jc_gaojiaohzun.setBounds(x0+320, y0+360,110, height);
            mb.add(jl_gaojiaohzun);
            mb.add(jc_gaojiaohzun);
 
 
 
            mb.add(jf_near1);
            mb.add(jf_near2);
            mb.add(jf_near3);
            mb.add(jf_near4);
            mb.add(jf_near5);
            mb.add(jf_near6);
            mb.add(jf_near7);
            mb.add(jf_near8);
            mb.add(jf_near9);
            mb.add(jf_near10);
            mb.add(jl_qiehuan);
            mb.add(jf_qiehuan);
 
 
 
 
            getUwbUp().setBounds(x0, y0+460,150, height);//½øÈëuwbÉý¼¶Ä£Ê½
            getExitUwbUp().setBounds(x0+280, y0+460,150, height);//Í˳öuwbÉý¼¶Ä£Ê½
 
            getJbt_save().setBounds(x0, y0+500,80, height);//±£´æÅäÖÃ
            mb.add(jbt_save);
 
            getJbt_reboot().setBounds(x0+170, y0+500,80, height);//ÖØÆô
            mb.add(jbt_reboot);
 
            //ÐÞ¸ÄÈ«²¿»ùÕ¾
            getJbt_alertall().setBounds(x0+350, y0+500,80, height);
            mb.add(jbt_alertall);
 
            //ÔÝÍ£
            getJbt_zanting().setBounds(x0+790, y0,60, height);//ÔÝÍ£
            mb.add(jbt_zanting);
 
            //Çå¿Õ
            getJbt_clear().setBounds(x0+870, y0,60, height);
            mb.add(jbt_clear);
 
            //Îı¾ÏÔÊ¾ÇøÓò
            getGd().setBounds(x0+480, y0+30,450, 450);
            mb.add(gd);
 
            //Éý¼¶
            jbt_xunze.setBounds(x0+480, y0+500,90, height);
            jt_shengji.setBounds(x0+480+92,y0+500,170, 25);
            jbt_shengji.setBounds(x0+480+92+185,y0+500,80, 25);
            jbt_write.setBounds(x0+480+92+280,y0+500,80, 25);
 
 
        }
        return mb;
    }
 
    /**»ñÈ¡»ùÕ¾µÄipµØÖ·Îı¾¿ò*/
    public JTextField getJtf_ip() {
        if( jtf_ip==null) {
            jtf_ip=new JTextField();
        }
        return jtf_ip;
    }
 
    /**»ñÈ¡»ùÕ¾µÄÅäÖð´Å¥*/
    public JButtonModel getJbt_read_peizhi() {
        if( jbt_read_peizhi==null) {
            jbt_read_peizhi=new JButtonModel("¶ÁÈ¡ÅäÖÃ");
            jbt_read_peizhi.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    String a=(String) box_anchorid.getSelectedItem();
                    if(a.equals("Ñ¡Ôñ»ùÕ¾") || a.equals("ËùÓлùÕ¾") ) {
                        ShowMessage.zidingyi("ÇëÑ¡ÔñÐèÒª¶ÁÈ¡ÅäÖõĻùÕ¾");
                        return;
                    }
                    Anchor anchor=Anchor_Dell.get_anchor(a);    
                    String ip=getip();
                    int port=getport();
                    readpeizhi=true;
                    byte[] byt=Read_Write_Anchor_Message.ReadData((byte)0x2,(byte)0x50);
                    if(byt==null) {
                        return;
                    }
                    if(Systems.isAncshengjimoshi()) {
                        Update.chushihua();
                        Update.fasongdata(byt,ip,port);
                    }else {
                        if(port !=0) {
                            Udp_Receive.out(byt,byt.length,anchor,"»ùÕ¾ÉèÖÃ");
                            addmesg(ip+":"+port+"¶ÁÈ¡ÐÅÏ¢ÒÑ·¢ËÍ...");
                        }
                    }
                }
            });
        }
        return jbt_read_peizhi;
    }
 
    /**»ñÈ¡»ùÕ¾µÄÅäÖð´Å¥*/
    public JButtonModel getJbt_() {
        if( jbt_read_peizhi==null) {
            jbt_read_peizhi=new JButtonModel("¶ÁÈ¡ÅäÖÃ");
            jbt_read_peizhi.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    String a=(String) box_anchorid.getSelectedItem();
                    if(a.equals("Ñ¡Ôñ»ùÕ¾") || a.equals("ËùÓлùÕ¾") ) {
                        ShowMessage.zidingyi("ÇëÑ¡ÔñÐèÒª¶ÁÈ¡ÅäÖõĻùÕ¾");
                        return;
                    }
                    Anchor anchor=Anchor_Dell.get_anchor(a);
                    String ip=getip();
                    int port=getport();
                    readpeizhi=true;
                    byte[] byt=Read_Write_Anchor_Message.ReadData((byte)0x2,(byte)0x50);
                    if(byt==null) {
                        return;
                    }
                    if(Systems.isAncshengjimoshi()) {
                        Update.chushihua();
                        Update.fasongdata(byt,ip,port);
                    }else {
                        if(port !=0) {
                            Udp_Receive.out(byt,byt.length,anchor,"»ùÕ¾ÉèÖÃ");
                            addmesg(ip+":"+port+"¶ÁÈ¡ÐÅÏ¢ÒÑ·¢ËÍ...");
                        }
                    }
                }
            });
        }
        return jbt_read_peizhi;
    }
 
 
    /**»ñÈ¡»ùÕ¾µÄIDÏÂÀ­¿ò*/
    public JComboBoxModel getBox_anchorid() {
        if( box_anchorid==null) {
            box_anchorid=new JComboBoxModel(Anchor_Dell.get_anchorid());
            box_anchorid.setFont(new Font("΢ÈíÑźÚ", Font.PLAIN, 12));//ÉèÖÃ×ÖÌå
            box_anchorid.setEnabled(true);
            //ÏÂÀ­¿ò¿ÉÒÔÊäÈë
            box_anchorid.setEditable(true);
            box_anchorid.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    anchorid=(String) box_anchorid.getSelectedItem();
                    ischooseanchor=anchorid;
                    if(anchorid.equals("Ñ¡Ôñ»ùÕ¾")) {
                        jtf_ip.setText("");
                        isok=0;
                    }else if(anchorid.equals("ËùÓлùÕ¾")){    
                        isok=1;
                        jtf_ip.setText("ËùÓлùÕ¾½«»á±»Ð޸ģ¡");
                        jf_anchorid.setText("ÎÞЧ");
                        jf_gonglv.setText("67");
                        jf_wucha.setText("-60");
                        jf_lvbo.setText("2");
                        jf_tongxuzu.setText("0");
                        jf_hz.setText("1000");
                        jf_shangxian.setText("10");
                        box_anchortype.setSelectedIndex(0);
                        jf_rootanchor.setText("FFFF");
                    }else {
                        isok=2;
                        //2023.07.14 zsh ÅжϻùÕ¾ÊÇ·ñΪ¿Õ
                        Anchor anchor = Anchor_Dell.get_anchor(anchorid);
                        if (anchor==null){
                            return;
                        }
                        anchorip=anchor.getAnc_ip();
                        if(anchorip==null) {
                            anchorip="";
                        }
                        ischooseip=anchorip;
                        int port=Anchor_Dell.get_anchor(anchorid).getPort();
                        jtf_ip.setText(anchorip+":"+port);
                        if(port==0) {
                            isok=0;
                        }
                    }
                }
            });
        }
        return box_anchorid;
    }
 
    public JButtonModel getJbt_save() {
        if(jbt_save==null) {
            jbt_save=new JButtonModel("±£´æÅäÖÃ");
            jbt_save.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    if(Systems.isAncshengjimoshi()) {
                        peimesage();
                    }else {
                        if(isok==0) {
                            ShowMessage.zidingyi("ûÓÐʶ±ðµ½»ùÕ¾¶Ë¿ÚºÅ£¬¶Áȡʧ°Ü...");
                            return;
                        }else if(isok==2) {
                            peimesage();
                        }else if(isok==1){
                            ShowMessage.zidingyi("±£´æÅäÖÃʧ°Ü£¬ÇëÑ¡ÔñÈ«²¿Ð޸İ´¼ü...");
                        }
                    }
 
                }
            });
 
        }
        return jbt_save;
    }
 
 
    public JButtonModel getJbt_reboot() {
        if(jbt_reboot==null) {
            jbt_reboot=new JButtonModel("ÖØÆôÉ豸");
            jbt_reboot.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    if(Dell_55AA03.readpeizhi_succ) {
                        if(isok==2) {
                            ShowMessage.zidingyi("ûÓÐʶ±ðµ½»ùÕ¾¶Ë¿ÚºÅ£¬¶Áȡʧ°Ü...");
                            return;
                        }
                        addmesg(" ÖØÆôÉ豸...");
                        byte[] byt=Read_Write_Anchor_Message.WriteData((byte)0x60,(byte)0x2,1);    
                        String a=(String) box_anchorid.getSelectedItem();
                        Anchor anchor=Anchor_Dell.get_anchor(a);
                        if(anchor==null) {
                            ShowMessage.zidingyi(a+"null...");
                            return;
                        }                        
                        Udp_Receive.out(byt,byt.length,anchor,"»ùÕ¾ÉèÖÃ");
                        String datas=Tools.Bytes2HexString(byt);
                        addmesg(" ÖØÆôÐÅÏ¢ÒÑÏ·¢,"+datas);
                    }else {
                        addmesg(" ÖØÆôÉ豸ÇëÏȶÁÈ¡ÅäÖóɹ¦...");
                    }
                }
            });
        }
        return jbt_reboot;
    }
 
    public JButtonModel getJbt_reset() {
        if(jbt_reset==null) {
            jbt_reset=new JButtonModel("»Ö¸´³ö³§");
            jbt_reset.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    if(Dell_55AA03.readpeizhi_succ) {
                        if(isok==2) {
                            ShowMessage.zidingyi("ûÓÐʶ±ðµ½»ùÕ¾¶Ë¿ÚºÅ£¬¶Áȡʧ°Ü...");
                            return;
                        }
                        addmesg(" »Ö¸´³ö³§ÉèÖÃ...");
                        byte[] byt=Read_Write_Anchor_Message.WriteData((byte)0x62,(byte)0x2,1);    
                        int l=byt.length;
                        String a=(String) box_anchorid.getSelectedItem();
                        Anchor anchor=Anchor_Dell.get_anchor(a);
                        if(anchor==null) {
                            ShowMessage.zidingyi(a+"null...");
                            return;
                        }
                        Udp_Receive.out(byt,l,anchor,"»ùÕ¾ÉèÖÃ");
                        addmesg(" »Ö¸´³ö³§³É¹¦...");
                    }else {
                        addmesg("»Ö¸´³ö³§ÇëÏȶÁÈ¡ÅäÖóɹ¦...");
                    }
                }
            });
        }
        return jbt_reset;
    }
 
    public JTextField getJf_gonglv() {
        if(jf_gonglv==null) {
            jf_gonglv=new JTextField();
        }
        return jf_gonglv;
    }
 
    public JTextField getJf_anchorid() {
        if(jf_anchorid==null) {
            jf_anchorid=new JTextField();
        }
        return jf_anchorid;
    }
 
    public JTextField getJf_wucha() {
        if(jf_wucha==null) {
            jf_wucha=new JTextField();
        }
        return jf_wucha;
    }
 
    public JTextField getJf_lvbo() {
        if(jf_lvbo==null) {
            jf_lvbo=new JTextField();
        }
        return jf_lvbo;
    }
 
    public JTextField getJf_tongxuzu() {
        if(jf_tongxuzu==null) {
            jf_tongxuzu=new JTextField();
        }
        return jf_tongxuzu;
    }
 
    public JTextField getJf_banben() {
        if(jf_banben==null) {
            jf_banben=new JTextField();
            jf_banben.setForeground(Color.red);
            jf_banben.setEditable(false);
        }
        return jf_banben;
    }
 
 
 
 
    public JTextField getJf_bin() {
        if(jf_bin==null) {
            jf_bin=new JTextField();
        }
        return jf_bin;
    }
 
    public JButtonModel getJbt_bin() {
        if(jbt_bin==null) {
            jbt_bin=new JButtonModel("Ñ¡ÔñBinÎļþ");
        }
        return jbt_bin;
    }
 
    public JButtonModel getJbt_grade() {
        if(jbt_grade==null) {
            jbt_grade=new JButtonModel("Éý¼¶¹Ì¼þ");
        }
        return jbt_grade;
    }
 
    public JProgressBar getProgressBar() {
        if(progressBar==null) {
            progressBar=new JProgressBar ();
            progressBar.setStringPainted(true);
            progressBar.setPreferredSize(new Dimension(300, 30));
            progressBar.setFont(new Font("΢ÈíÑźÚ", Font.PLAIN, 16));
 
        }
        return progressBar;
    }
 
    public JScrollPane getGd() {
        if(gd==null) {
            jt_area.setBackground(UIColor.getNorth_color());
            jt_area.setForeground(UIColor.getGrenn());
            gd=new JScrollPane(jt_area);
        }
        return gd;
    }
 
 
 
    public static JTextField getJf_shangxian() {
        if(jf_shangxian==null) {
            jf_shangxian=new JTextField();
        }
        return jf_shangxian;
    }
 
    public static JTextField getJf_hz() {
        if(jf_hz==null) {
            jf_hz=new JTextField();
        }
        return jf_hz;
    }
 
    public ButtonGroup getBtgroup() {
        if(btgroup==null) {
            btgroup=new ButtonGroup();
            btgroup.add(getAnchor());
            btgroup.add(getTag());
        }
        return btgroup;
    }
 
    public JRadioButton getTag() {
        if(tag==null) {
            tag=new JRadioButton("±êÇ©");
            tag.setBackground(null);
            tag.setFont(new Font("΢ÈíÑźÚ",Font.PLAIN,15));
        }
        return tag;
    }
 
    public JRadioButton getAnchor() {
        if(anchor==null) {
            anchor=new JRadioButton("»ùÕ¾");
            anchor.setBackground(null);
            anchor.setFont(new Font("΢ÈíÑźÚ",Font.PLAIN,15));
            anchor.setSelected(true);
        }
        return anchor;
    }
 
    /**ÐÞ¸ÄËùÓлùÕ¾*/
    public JButtonModel getJbt_alertall() {
        if(jbt_alertall==null) {
            jbt_alertall=new JButtonModel("È«²¿ÐÞ¸Ä");
            jbt_alertall.addActionListener(new ActionListener() {
                @Override
                public void actionPerformed(ActionEvent e) {
                    if(isok==1) {
                        String gonglv=jf_gonglv.getText().trim();
                        String wucha=jf_wucha.getText().trim();
                        String lvbo=jf_lvbo.getText().trim(); 
                        String zu=jf_tongxuzu.getText().trim();
                        String hz=jf_hz.getText().trim();
                        String shangxian=jf_shangxian.getText().trim();
                        String rootanc=jf_rootanchor.getText().trim();
                        if(rootanc.equals("FFFF")) {
                            rootanc="0";
                        }
                        String heart="0";
                        if(jc_heart.isSelected()) {
                            heart="1";
                        }
 
 
                        int[] value= new int[35];                            
                        value[0]=Integer.parseInt(hz);//±êǩͨѶ¼ä¸ô 0x6                            
                        value[1]=Integer.parseInt(shangxian);//µ¥´ÎͨѶ»ùÕ¾ÊýÁ¿ÉÏÏÞ
                        value[2]=Integer.parseInt(zu);//0xA    Í¨Ñ¶×éID£¨2Byte£©                            
                        value[3]=Integer.parseInt(wucha);//0xC    ¾àÀëУ׼ֵ£¨2Byte£©
                        value[4]=0;//0xE    Ä£¿éÀàÐÍ£¨2Byte£©
                        value[5]=0;//0x10    »ùÕ¾Ö÷¶¯²â¾à£¨2Byte£©                        
                        value[6]=0;//0x12    ±¨¾¯É豸£¨2Byte£©                    
                        value[7]=0;//0x14    ±¨¾¯¾àÀë1£¨2Byte£©
                        value[8]=0;//0x16    ±¨¾¯¾àÀë2£¨2Byte£©                     
                        value[9]=0;//0x18    ±¨¾¯¾àÀë3£¨2Byte£©                    
                        value[10]=0;//0x1A    Åä¶ÔIDÎÞ×÷Óã¨2Byte£© 
                        value[11]=Integer.parseInt(heart);//0x1C    ÐÄÌø°ü£¨2Byte£©
                        value[12]=0;//0x1E    Modbusģʽ£¨2Byte£©
                        value[13]=0;
                        value[14]=0;
                        value[15]=0;
                        value[16]=0;
                        value[17]=0;
                        value[18]=0;
                        value[19]=0;
                        value[20]=0;
                        value[21]=0;
                        value[22]=0;
                        value[23]=0;                    
                        value[24]=Integer.parseInt(gonglv);//·¢É书ÂÊ
                        value[25]=2;//¼ÓËÙ¶ÈÁéÃô¶È
                        value[26]=120;//ÐÝÃßʱ¼ä
                        value[27]=0;//Õñ¶¯Ê¹ÄÜ                    
                        value[28]=0;//¼ÓËÙ¶ÈʹÄÜ                    
                        value[29]=Integer.parseInt(lvbo);//±êǩϷ¢ÅäÖÃ״̬                    
                        value[30]=0;//±êǩϷ¢ÅäÖÃID 0x42                    
                        value[31]=Integer.parseInt(rootanc);//ͬ²½»ùÕ¾µØÖ· 0x44                    
                        value[32]=Integer.parseInt(xuhao);//ͬ²½ÀàÐÍ0/1/2(0ÆÕͨ»ùÕ¾£¬1Ö÷»úÕ¾£¬2ÊÇ´Ó»ùÕ¾)46                    
                        value[33]=0;//µØÖ·48
                        value[34]=0;//µØÖ·50,ÆøÑ¹¼Æ¸ß¶ÈУ׼ֵ
                        byte[] byt=Write_peizhi.write((byte)0x6,(byte)0x46, value);
                        Dell_Ip.alert_all_ip(byt,"AnchorSet");
 
                    }else {
                        jt_area.setText(GetNowTime.now2()+" ÇëÏÈÑ¡ÔñËùÓлùÕ¾...");
                    }
                }
            });
        }
        return jbt_alertall;
    }
 
 
 
 
    public static JCheckBox getJc_initiative() {
        if(jc_initiative==null) {
            jc_initiative=new JCheckBox("Ö÷¶¯²â¾à");
            jc_initiative.setFont(new Font("΢ÈíÑźÚ",Font.PLAIN,15));
            jc_initiative.setBackground(null);
        }
 
        return jc_initiative;
    }
 
    public static JCheckBox getJc_heart() {
        if(jc_heart==null) {
            jc_heart=new JCheckBox("¿ªÆôÐÄÌø");
            jc_heart.setFont(new Font("΢ÈíÑźÚ",Font.PLAIN,15));
            jc_heart.setBackground(null);
        }
        return jc_heart;
    }
 
    public static boolean isReadpeizhi() {
        return readpeizhi;
    }
 
    public static JComboBoxModel getBox_anchortype() {
        if(box_anchortype==null) {
            String[] type={"ÎÞ","Ö÷","´Ó"};
            box_anchortype=new JComboBoxModel(type);
            box_anchortype.addActionListener(new ActionListener() {
 
                @Override
                public void actionPerformed(ActionEvent e) {
                    int xu=box_anchortype.getSelectedIndex();
                    if(xu==1) {
                        xuhao="1";
                        jf_rootanchor.setText("0");
                    }else if(xu==2) {
                        xuhao="2";
                    }else {
                        xuhao="0";
                    }
 
                }
            });
        }
        return box_anchortype;
    }
 
    public static boolean isIsopen() {
        return isopen;
    }
 
    public static void setIsopen(boolean isopen) {
        AnchorSet.isopen = isopen;
    }
 
    public static String getIschooseanchor() {
        return ischooseanchor;
    }
 
    public static void setIschooseanchor(String ischooseanchor) {
        AnchorSet.ischooseanchor = ischooseanchor;
    }
 
    public JButtonModel getJbt_xunze() {
        if(jbt_xunze==null) {
            jbt_xunze=new JButtonModel("Ñ¡Ôñ¹Ì¼þ:");
            jbt_xunze.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    if(!Systems.isAncshengjimoshi()) {
                        ShowMessage.zidingyi("ÇëÏÈÔÚϵͳ¹ÜÀí´¦ÉèÖÃΪÉý¼¶Ä£Ê½");
                        return;
                    }
                    JFileChooser fileChooser=new JFileChooser(GetDeskPath.path());//ÎļþÑ¡ÔñÆ÷                    
                    FileNameExtensionFilter filter=new FileNameExtensionFilter("bin", "bin");//Îļþ¹ýÂËÆ÷
                    fileChooser.setFileFilter(filter);//Ìí¼ÓÎļþ¹ýÂËÆ÷
                    int i=fileChooser.showOpenDialog(mb);//ÏÔʾѡÔñÎļþ¶Ô»°¿ò
                    if(i==JFileChooser.APPROVE_OPTION) {//Èç¹ûÓû§Ñ¡ÔñµÄÊÇ¡°´ò¿ª¡±°´Å¥
                        File file=fileChooser.getSelectedFile();//»ñȡѡÖеÄÎļþ                
                        path=file.getPath();//ÎļþÃû³Æ
                        jt_shengji.setText(path);
                    }
                    else {
                        return;
                    }                    
                }
            });
        }
        return jbt_xunze;
    }
 
 
    public JButtonModel getJbt_shengji() {
        if(jbt_shengji==null) {
            jbt_shengji=new JButtonModel("µã»÷Éý¼¶");
            jbt_shengji.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    if(!shengjimoshi) {                        
                        if(path==null ||path.length()<10) {
                            ShowMessage.zidingyi("¹Ì¼þ²»¶ÔÇëÑ¡ÔñÕýÈ·µÄ¹Ì¼þ");
                            return;
                        }
                        shengjimoshi=true;
                        shengjizhiling(anchorid);//·¢ËÍÉý¼¶Ö¸Áî
                        jbt_shengji.setText("Éý¼¶ÖÐ...");
                    }else {
                        shengjimoshi=false;
                        jbt_shengji.setText("µã»÷Éý¼¶");
                    }
 
                }
            });
        }
        return jbt_shengji;
    }
 
    public JButtonModel getJbt_write() {
        if(jbt_write==null) {
            jbt_write=new JButtonModel("дÈëÎļþ");
            jbt_write.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    if(!write) {
                        if(path==null ||path.length()<10) {
                            ShowMessage.zidingyi("¹Ì¼þ²»¶ÔÇëÑ¡ÔñÕýÈ·µÄ¹Ì¼þ");
                            return;
                        }
                        write=true;
                        writeCode(anchorid);//·¢ËÍдÈëÎļþÖ¸Áî
                        jbt_write.setText("дÈëÖÐ...");
                    }else {
                        write=false;
                        jbt_write.setText("µã»÷дÈë");
                    }
 
                }
            });
        }
        return jbt_write;
    }
 
    public JButtonModel getUwbUp() {
        if(uwbUp==null) {
            uwbUp=new JButtonModel("½øÈëuwbÉý¼¶Ä£Ê½");
            uwbUp.addActionListener(e -> {
                if(Dell_55AA03.readpeizhi_succ) {
                    if (isok == 2) {
                        ShowMessage.zidingyi("ûÓÐʶ±ðµ½»ùÕ¾¶Ë¿ÚºÅ,·¢ËÍʧ°Ü...");
                        return;
                    }
                    addmesg(" ½øÈë'ÓÃuwb¸ø±êÇ©Éý¼¶Ä£Ê½'...");
                    byte[] byt = Read_Write_Anchor_Message.toAnchor((byte)0x3);
                    String datas = Tools.Bytes2HexString(byt);
                System.out.println(datas);
                    String a = (String) box_anchorid.getSelectedItem();
                    Anchor anchor = Anchor_Dell.get_anchor(a);
                    if (anchor == null) {
                        ShowMessage.zidingyi(a + "null...");
                        return;
                    }
                    Udp_Receive.out(byt, byt.length, anchor, "»ùÕ¾ÉèÖÃ");
 
                    addmesg(" ÐÅÏ¢ÒÑÏ·¢," + datas);
                }
            });
        }
        return uwbUp;
    }
 
 
    public JButtonModel getExitUwbUp() {
        if(exitUwbUp==null) {
            exitUwbUp=new JButtonModel("Í˳öuwbÉý¼¶Ä£Ê½");
            exitUwbUp.addActionListener(e -> {
                if(Dell_55AA03.readpeizhi_succ) {
                    if (isok == 2) {
                        ShowMessage.zidingyi("ûÓÐʶ±ðµ½»ùÕ¾¶Ë¿ÚºÅ,·¢ËÍʧ°Ü...");
                        return;
                    }
                    addmesg(" Í˳ö'ÓÃuwb¸ø±êÇ©Éý¼¶Ä£Ê½'...");
                    byte[] byt = Read_Write_Anchor_Message.toAnchor((byte)0x4);
                    String a = (String) box_anchorid.getSelectedItem();
                    Anchor anchor = Anchor_Dell.get_anchor(a);
                    if (anchor == null) {
                        ShowMessage.zidingyi(a + "null...");
                        return;
                    }
                    Udp_Receive.out(byt, byt.length, anchor, "»ùÕ¾ÉèÖÃ");
                    String datas = Tools.Bytes2HexString(byt);
                    addmesg(" ÐÅÏ¢ÒÑÏ·¢," + datas);
                }
            });
        }
        return exitUwbUp;
    }
 
 
    /**·¢ËÍÉý¼¶Ö¸Áî*/
    public void shengjizhiling(String anchorid) {
        byte[] byt=Read_Write_Anchor_Message.WriteData((byte)0x64,(byte)0x2,1);    
        String ip=getip();
        int port=getport();
        if (ip.equals("127.0.0.1")||port==0){
            return;
        }
        try {
            Update.shengji(ip, port, path,byt);
        } catch (IOException e) {
            e.printStackTrace();
        }
 
    }
 
    /**·¢ËÍдÈëÎļþÖ¸Áî*/
    public void writeCode(String anchorid) {
        byte[] byt = Read_Write_Anchor_Message.toAnchor((byte)0x2);
        String ip=getip();
        int port=getport();
        if (ip.equals("127.0.0.1")||port==0){
            return;
        }
        try {
            Update.shengji(ip, port, path,byt);
        } catch (IOException e) {
            e.printStackTrace();
        }
 
    }
 
    /**Ìí¼ÓÎı¾*/
    public static void addmesg(String message) {
        if(zanting) {
            jt_area.append(GetNowTime.HH_MM_SS()+":"+message+"\n");
            jt_area.setCaretPosition(jt_area.getText().length());
        }
    }
 
    public static String getIschooseip() {
        return ischooseip;
    }
 
    public static void setIschooseip(String ischooseip) {
        AnchorSet.ischooseip = ischooseip;
    }
 
    public static boolean isShengjimoshi() {
        return shengjimoshi;
    }
 
    public static void setShengjimoshi(boolean shengjimoshi) {
        if(!shengjimoshi) {
            jbt_shengji.setText("µã»÷Éý¼¶");
        }
        AnchorSet.shengjimoshi = shengjimoshi;
    }
 
    public JButtonModel getJbt_zanting() {
        if(jbt_zanting==null) {
            jbt_zanting=new JButtonModel("ÔÝÍ£");
            jbt_zanting.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    if(zanting) {
                        zanting=false;
                        jbt_zanting.setText("ÔÝÍ£");
                    }else {
                        zanting=true;
                        jbt_zanting.setText("¿ªÊ¼");
                    }
 
                }
            });
 
        }
        return jbt_zanting;
    }
 
    public static boolean isZanting() {
        return zanting;
    }
 
    public static void setZanting(boolean zanting) {
        AnchorSet.zanting = zanting;
    }
 
    public JButtonModel getJbt_clear() {
        if(jbt_clear==null) {
            jbt_clear=new JButtonModel("Çå¿Õ");
            jbt_clear.addActionListener(new ActionListener() {
                public void actionPerformed(ActionEvent e) {
                    jt_area.setText("");
                }
            });
        }
        return jbt_clear;
    }
 
 
    /**ÅäÖÃÐÅÏ¢*/
    public  void  peimesage() {        
        Vector<String> vc=new Vector<String>();
        String anchorid=jf_anchorid.getText().trim();
        String gonglv=jf_gonglv.getText().trim();
        String wucha=jf_wucha.getText().trim();
        String lvbo=jf_lvbo.getText().trim(); 
        String zu=jf_tongxuzu.getText().trim();
        String hz=jf_hz.getText().trim();
        String shangxian=jf_shangxian.getText().trim();
        String type="0";
        String nearnum=jf_nearancnum.getText().trim();
 
        //»ùÕ¾Ö÷¶¯²â¾à
        String initiative="0";
        if(jc_initiative.isSelected()) {
            initiative="1";
        }
        String heart="0";
        if(jc_heart.isSelected()) {
            heart="1";
        }
        String near1=jf_near1.getText().trim();    
        if(near1.length()==4) {
            vc.add(near1);
        }else {
            near1="0000";
        }
 
        String near2=jf_near2.getText().trim();                        
        if(near2.length()==4) {
            vc.add(near2);
        }else {
            near2="0000";
        }
 
        String near3=jf_near3.getText().trim();
        if(near3.length()==4) {
            vc.add(near3);
        }else {
            near3="0000";
        }
 
        String near4=jf_near4.getText().trim();
        if(near4.length()==4) {
            vc.add(near4);
        }else {
            near4="0000";
        }
 
 
        String near5=jf_near5.getText().trim();
        if(near5.length()==4) {
            vc.add(near5);
        }else {
            near5="0000";
        }
 
 
        String near6=jf_near6.getText().trim();
        if(near6.length()==4) {
            vc.add(near6);
        }else {
            near6="0000";
        }
 
 
        String near7=jf_near7.getText().trim();
        if(near7.length()==4) {
            vc.add(near7);
        }else {
            near7="0000";
        }
 
        String near8=jf_near8.getText().trim();
        if(near8.length()==4) {
            vc.add(near8);
        }else {
            near8="0000";
        }
 
        String near9=jf_near9.getText().trim();
        if(near9.length()==4) {
            vc.add(near9);
        }else {
            near9="0000";
        }
 
 
        String near10=jf_near10.getText().trim();
        if(near10.length()==4) {
            vc.add(near10);
        }else {
            near10="0000";
        }
 
        int nearnumint=Integer.parseInt(nearnum);
 
        if(nearnumint !=vc.size()) {
            ShowMessage.zidingyi_24(nearnumint+"ÁÙ½ü»ùÕ¾Êý×ÖºÍÁÙ½ü»ùÕ¾¸öÊý²»Æ¥Åä...");
            return;                        
        }
 
        String qiehuan=jf_qiehuan.getText().trim();//Çл»¾àÀë                        
        String fasdis=jf_fastdis.getText().trim();//×îÔ¶²â¾à¾àÀë
        String allout=jf_allout.getText().trim();//Êä³öËùÓÐÊý¾Ý                        
        String rootanchor=jf_rootanchor.getText().trim();//ͬ²½»ùÕ¾                        
        String gaodujiaozhun=jc_gaojiaohzun.getText().trim();//¸ß¶ÈУ׼ֵ
        if(!anchor.isSelected()) {
            type="1";
        }
 
        int[] value= new int[36];
        value[0]=Write_peizhi.covert(anchorid);//É豸id 0x4                            
        value[1]=Integer.parseInt(hz);//±êǩͨѶ¼ä¸ô 0x6                            
        value[2]=Integer.parseInt(shangxian);//µ¥´ÎͨѶ»ùÕ¾ÊýÁ¿ÉÏÏÞ
        value[3]=Integer.parseInt(zu);//0xA    Í¨Ñ¶×éID£¨2Byte£©                            
        value[4]=Integer.parseInt(wucha);//0xC    ¾àÀëУ׼ֵ£¨2Byte£©
        value[5]=1;//0xE    Ä£¿éÀàÐÍ£¨2Byte£©
        if(type.equals("0")) {
            value[5]=0;
        }                    
        value[6]=0;//0x10    »ùÕ¾Ö÷¶¯²â¾à£¨2Byte£©
        if(initiative.equals("1")) {
            value[6]=1;    
        }
 
        value[7]=0;//0x12    ±¨¾¯É豸£¨2Byte£©                    
        value[8]=Integer.parseInt(qiehuan);//0x14    Çл»¾àÀ루2Byte£©
        value[9]=Integer.parseInt(fasdis);//0x16    ×îÔ¶²â¾à¾àÀ루2Byte£©                     
        value[10]=Integer.parseInt(allout);//0x18    Êä³öËùÓÐÊý¾Ý×öÖ÷»úվʱºò£¨2Byte£©                    
        value[11]=0;//0x1A    Åä¶ÔIDÎÞ×÷Óã¨2Byte£© 
        value[12]=0;//0x1C    ÐÄÌø°ü£¨2Byte£© 
        if(heart.equals("1")) {
            value[12]=1;    
        }
        value[13]=0;//0x1E    Modbusģʽ£¨2Byte£©
        value[14]=Integer.parseInt(nearnum);
        value[15]=Write_peizhi.covert(near1);
        value[16]=Write_peizhi.covert(near2);
        value[17]=Write_peizhi.covert(near3);
        value[18]=Write_peizhi.covert(near4);
        value[19]=Write_peizhi.covert(near5);
        value[20]=Write_peizhi.covert(near6);
        value[21]=Write_peizhi.covert(near7);
        value[22]=Write_peizhi.covert(near8);
        value[23]=Write_peizhi.covert(near9);
        value[24]=Write_peizhi.covert(near10);                    
        value[25]=Integer.parseInt(gonglv);//·¢É书ÂÊ
        value[26]=2;//¼ÓËÙ¶ÈÁéÃô¶È
        value[27]=120;//ÐÝÃßʱ¼ä
        value[28]=0;//Õñ¶¯Ê¹ÄÜ                    
        value[29]=0;//¼ÓËÙ¶ÈʹÄÜ                    
        value[30]=Integer.parseInt(lvbo);//±êǩϷ¢ÅäÖÃ״̬                    
        value[31]=0;//±êǩϷ¢ÅäÖÃID 0x42                    
        value[32]=Write_peizhi.covert(rootanchor);//ͬ²½»ùÕ¾µØÖ· 0x44                    
        value[33]=Integer.parseInt(xuhao);//ͬ²½ÀàÐÍ0/1/2(0ÆÕͨ»ùÕ¾£¬1Ö÷»úÕ¾£¬2ÊÇ´Ó»ùÕ¾)46                    
        value[34]=0;//µØÖ·48
        value[35]=Integer.parseInt(gaodujiaozhun);//µØÖ·50,ÆøÑ¹¼Æ¸ß¶ÈУ׼ֵ
        byte[] data=Write_peizhi.write((byte)0x4,(byte)0x48, value);
        String datas=Tools.Bytes2HexString(data);
        if(data !=null) {                            
            String a=(String) box_anchorid.getSelectedItem();
            if(!Systems.isAncshengjimoshi()) {
                Anchor anchor=Anchor_Dell.get_anchor(a);
                if(anchor==null) {
                    ShowMessage.zidingyi(a+"±£´æÅäÖûùÕ¾²»´æÔÚ...");
                    return;
                }
                Udp_Receive.out(data,data.length,anchor,"»ùÕ¾ÉèÖÃ");
            }else{
                String ip=getip();
                int port=getport();
                Update.fasongdata(data, ip, port);
            }
            addmesg("·¢£º"+datas+","+GetNowTime.now2());
            ShowMessage.zidingyi(a+"±£´æÅäÖÃÐÅÏ¢ÒÑÏ·¢...");
        }    
    }
 
    public String getip() {
        String b=jtf_ip.getText().trim();
        String[] as=b.split(":");                    
        String ip=as[0];
        if(ip.length()<10) {
            ShowMessage.zidingyi("É豸IPµØÖ·²»ÕýÈ·"+ip);
            ip="127.0.0.1";
        }
        return ip;
    }
    public int getport() {
        int port=8233;
        String b=jtf_ip.getText().trim();
        String[] as=b.split(":");
        if(as.length>1) {
            port = Integer.parseInt(as[1]);
            if (port < 10) {
                port = 8233;
            }
        }
        return port;
    }
 
}