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 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 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;k0) { int size1=anchorid.length; for(int h=0;i20) { 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;h2) { for(int h=0;h