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);
|
}
|
|
|
|
}
|