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
package BaoWen;
import Frame.DebugManage;
import JNADell.DataToJnaDell;
import JNADell.DellJAN;
import Method.GetNowTime;
import PbuliClass.Systems;
import circle.Dell_ResultYuang;
import circle.Dell_yuang;
import circle.Yuang;
import person.Person;
import person.person_Dell;
import tbDataModel.tb_baoxuid;
import tbDataModel_Dell.Dell_tb_suanfa2;
public class AA0CToJNA {
    static int jianzhi=0;
    static int[] pos= {0,0,0,0};
    static int port=Integer.parseInt(Systems.sys().getCs_udp());
    static boolean openjna=true;
    static int x;
    static int y;
    static int z;
    static int c;
    public static void ToJNA(
            Person person,
            String tagid,
            String intime,//²åÈëʱ¼ä
            String baoxu,//°üÐò
            int baoxuint,//°üÐòÕûÊý
            String batarry,//µç³ØµçÁ¿
            String sos,//SOS¸æ¾¯
            int timestamp,// Ê±¼ä´Á
            int[] an_x,// »ùÕ¾x×ø±ê¼¯ºÏ
            int[] an_y,// »ùÕ¾Y×ø±ê¼¯ºÏ
            int[] an_z,//»ùÕ¾z×ø±ê¼¯ºÏ
            int[] dis,// ¾àÀëµÄ¼¯ºÏ
            int anchor_num,// »ùÕ¾ÊýÁ¿
            int[] anchor_id,//»ùÕ¾id
            int tag_id,// ±êÇ©ID
            int tag_height,// ±êÇ©¸ß¶È
            int tag_hz,//±êǩƵÂÊ
            int tagspeed_limit,// ±êÇ©ËÙ¶ÈÏÞÖÆ
            int[] anchour_distance, //»ùÕ¾¾àÀë
            int stationary_flag,//±êÇ©¾²Ö¹×´Ì¬
            int[] power,//µÚ1·ÐźÅÇ¿¶È
            int[] power_diff,//µÚ2·ÐźÅÇ¿¶È
            int[] floor,//»ùÕ¾ËùÔڵIJã
            int qiya,//ÆøÑ¹¼ÆÖµ
            String[] anchorid//»ùÕ¾ID¼¯ºÏ
            ) {
        //Èç¹û¿ªÆô¾²Ö¹Êä³ö¹Ì¶¨×ø±ê
        /**½«Êý¾Ý¸øµ½¶¯Ì¬¿âJNA´¦Àí*/        
        if(openjna) {
            pos=DellJAN.get_tag_pos(
                    baoxuint, // °üÐò
                    timestamp, // Ê±¼ä´Á
                    tag_id, // ±êÇ©id
                    tag_height, // ±êÇ©¸ß¶È
                    tag_hz, // ±êǩƵÂÊ
                    tagspeed_limit, // ±êÇ©×î´óËÙ¶È
                    stationary_flag, // ±êÇ©¾²Ö¹×´Ì¬flag
                    qiya, // ÆøÑ¹¸ß¶È, Ô­À´µÄ¸ß¶ÈÐÅÏ¢Ïȱ£Áô²»¶¯
                    anchor_num, // »ùÕ¾ÊýÄ¿
                    anchor_id, // int[]»ùÕ¾id, Óëannum¶ÔÓ¦
                    anchour_distance, // int[]²â¾à, Óëannum¶ÔÓ¦
                    power, // int[]ÐźÅÇ¿¶È, Óëannum¶ÔÓ¦
                    power_diff// int[]ÐźÅÇ¿¶È²î, Óëannum¶ÔÓ¦
                    );
            /*if (stationary_flag==1){
                ShowMessage.zidingyi(tagid+"±êÇ©¾²Ö¹");
            }*/
 
            int time_s=Systems.getWeizhipinghua();
            if(time_s!=0) {//Èç¹û¿ªÆôλÖÃÆ½»¬Ëã·¨
                pos=DellJAN.GetSmoothPosition(tag_id, time_s);
            }
        }
 
        //ÏÔʾµ÷ÊÔÊý¾Ý
        Dell_55AA0C.show_debugmessage(
                baoxuint, // °üÐò
                timestamp, // Ê±¼ä´Á
                tagid, // ±êÇ©id
                tag_height, // ±êÇ©¸ß¶È
                tag_hz, // ±êǩƵÂÊ
                tagspeed_limit, // ±êÇ©×î´óËÙ¶È
                stationary_flag, // ±êÇ©¾²Ö¹×´Ì¬flag
                qiya, // ÆøÑ¹¸ß¶È, Ô­À´µÄ¸ß¶ÈÐÅÏ¢Ïȱ£Áô²»¶¯
                anchor_num, // »ùÕ¾ÊýÄ¿
                anchorid, // int[]»ùÕ¾id, Óëannum¶ÔÓ¦
                anchour_distance, // int[]²â¾à, Óëannum¶ÔÓ¦
                power, // int[]ÐźÅÇ¿¶È, Óëannum¶ÔÓ¦
                power_diff,// int[]ÐźÅÇ¿¶È²î, Óëannum¶ÔÓ¦
                pos
                );
        //»­È¦Ä£Ê½
        huaquan(baoxu,batarry,sos,timestamp,an_x, an_y, an_z,dis, 
                anchor_num,anchorid,tagid,tag_height,tag_hz,tagspeed_limit, 
                anchour_distance, stationary_flag,power,power_diff,floor,qiya,pos);
        if(!(DellJAN.getYouxiao()<0) ) {//Èç¹ûλÖÃÐÅÏ¢ÓÐЧ
            x = pos[0];
            y = pos[1];
            z = pos[2];
            c = pos[3];
            dell_xyz(person,baoxu, tagid, intime, batarry, sos, tag_hz, x, y, z, c, stationary_flag, tag_height);
        }else {
            if(Dell_tb_suanfa2.isIs_open_mohujisuan()) {
                x =person.getMohux();
                y =person.getMohuy();
                z =person.getP_z();
                c =person.getMohufloor();
                dell_xyz(person,baoxu, tagid, intime, batarry, sos, tag_hz, x, y, z, c, stationary_flag, tag_height);
            }
        }
        
    }
 
 
 
    /**¿ªÆô»­È¦Ä£Ê½*/
    public static void huaquan(
            String baoxu,
            String batarry,
            String sos,
            int timestamp, 
            int[] an_x, 
            int[] an_y, 
            int[] an_z,
            int[] dis, 
            int anchor_num, 
            String[] anchor_id, 
            String tag_id, 
            int tag_height, 
            int tag_hz,
            int tagspeed_limit, 
            int[] anchour_distance,
            int stationary_flag,
            int[] power,
            int[] power_diff,
            int[] floor,
            int qiya,
            int[] pos) {
        //Èç¹û¿ªÆô»­È¦Ä£Ê½
        if(DebugManage.isStart_test()) {
            String tagidstr=String.valueOf(tag_id);
            StringBuffer text=new StringBuffer();            
            String choosetagid=DebugManage.getTagid_str();
            if(choosetagid.equals("Ñ¡Ôñ±êÇ©") || choosetagid.equals(tagidstr) ) {
                for(int k=0;k<anchor_num;k++) {
                    Yuang circle=new Yuang();
                    circle.setJianzhi(jianzhi);
                    circle.setTagid(String.valueOf(tag_id));
                    circle.setAnchorid(String.valueOf(anchor_id[k]));
                    circle.setFloor(floor[k]);
                    circle.setX(an_x[k]);
                    circle.setY(an_y[k]);
                    circle.setAnchor_h(an_z[k]);
                    circle.setTag_h(tag_height);
                    circle.setWidth(dis[k]);
                    circle.setTagid(tagidstr);
                    Dell_yuang.add_ayvc(jianzhi, String.valueOf(floor[k]), circle,baoxu,pos);
                }
 
                text.append("tagid:"+tag_id
                        +", seq: "+baoxu
                        +", anchorid: "+DataToJnaDell.getbufString(anchor_id)
                        +", distance: "+DataToJnaDell.getbuf(dis)
                        +", posx: "+DataToJnaDell.getbuf(an_x)
                        +", posy: "+DataToJnaDell.getbuf(an_y)
                        +", posz: "+DataToJnaDell.getbuf(an_z)
                        +", tagheight: "+String.valueOf(tag_height)
                        +", signal_power: "+DataToJnaDell.getbuf(power)
                        +", tagspeed_limit: "+String.valueOf(tagspeed_limit)
                        +", anchordistance: "+DataToJnaDell.getbuf(anchour_distance)
                        +", power:"+DataToJnaDell.getbuf(power)
                        +", power_diff:"+DataToJnaDell.getbuf(power_diff)
                        +", taghz:"+tag_hz
                        +", foor:"+DataToJnaDell.getbuf(floor)
                        +", bro:"+qiya
                        );
            }
 
 
            if(text.length()>10) {
                Dell_ResultYuang.add_resty(pos[0],pos[1],pos[2],pos[3], jianzhi,text.toString(),baoxu);
                jianzhi++;
                text.setLength(0);
            }
 
        }
    }
 
    public static void setOpenjna(boolean openjna) {
        AA0CToJNA.openjna = openjna;
    }
 
    public static boolean isOpenjna() {
        return openjna;
    }
 
 
 
    /**´¦ÀíXYZ×ø±ê*/
    public static void dell_xyz(
            Person person,
            String baoxu,//°üÐò
            String tagid,
            String intime,//²åÈëʱ¼ä            
            String batarry,//µç³ØµçÁ¿
            String sos,//SOS¸æ¾¯
            int tag_hz,
            int x,
            int y,
            int z,
            int c,
            int stationary_flag,//±êÇ©¾²Ö¹×´Ì¬
            int tag_height) {
        String time=GetNowTime.now();            
        person.setP_addtiem(time);//×îÐÂλÖøüÐÂʱ¼ä
        person.setP_online("1");
        person.setHz(tag_hz);        
        if(x==0 && y==0 ) {//yangÔ­µã¹ýÂË
            return;
        }
        person.setReceive_uwbpos_time(time);//ÉèÖÃUWBÊý¾Ý¸üÐÂʱ¼ä
        int tag_id=Integer.parseInt(tagid,16);
        if(Systems.isJingzhizbguding()) {//Èç¹û¿ªÆô¾²Ö¹×ø±ê¹Ì¶¨
            if(stationary_flag==0) {
                BaoxuID.alert_xyzlast(tag_id,x,y,z,c);
            }else {        
                tb_baoxuid a=BaoxuID.get_bxid(tag_id);
                if(a !=null) {    
                    int sz=a.getZuobiao();
                    if( sz!=1) {
                        BaoxuID.alert_xyzlast(tag_id,x,y,z,c);
                    }else {
                        x=a.getX();
                        y=a.getY();
                        z=a.getZ();
                        c=a.getFloor();
                    }
                }
            }
        }
        String ceng=String.valueOf(c);
        String gao=String.valueOf(tag_height);
        String zz=gao;
        if(Systems.isIssanwei()) {
            zz=String.valueOf(z);
        }
        person_Dell.alert_person_UWBxyfpo(tagid, x, y,zz,ceng,time);//ÐÞ¸ÄÈËÔ±UWBµÄXYZ×ø±ê        
        Juge_indoor.data_from_uwb(person, baoxu, intime);
    }
 
 
 
}