package BaoWen;
|
import Frame.TcpIpManage;
|
import Method.BaoWenShow;
|
import Method.GetNowTime;
|
import Method.StringToHex;
|
import PbuliClass.Systems;
|
import anchor.Anchor;
|
import anchor.Anchor_Dell;
|
import home.ChuShiHua;
|
import tbDataModel_Dell.Dell_TongbuAnchor;
|
|
/**´¦ÀíÐÄÌøÊý¾Ý*/
|
public class Dell_55AA02 {
|
static int ok=0;
|
static boolean sanwei=Systems.sys().getWeidu().equals("1");
|
static String ip;
|
static int port;
|
static String anchorid;
|
|
/**´¦Àí»ùÕ¾ÐÄÌøÊý¾Ý
|
* 2¡¢Ö¸ÁîÀàÐÍ£¨1byte£©
|
* 3¡¢Êý¾Ý³¤¶È£¨1byte£©
|
* 4¡¢»ùÕ¾ID£¨2byte£©
|
* 6¡¢»ùվͬ²½×´Ì¬£¨1byte£©
|
* 7¡¢»ùÕ¾ÆøÑ¹¼Æ¸ß¶È£¨4byte£©µ¥Î»ÀåÃ×
|
* 11¡¢±£Áô£¨4BYTE£©*/
|
public static void dellrgs(String infom,String ip1,int port1) {
|
ip=ip1;
|
port=port1;
|
String[] hex=StringToHex.hex(infom);
|
anchorid=hex[5]+hex[4];
|
String tongbustate=get_anchor_tongbu_state(hex[6]);//»ùվͬ²½×´Ì¬
|
baowenshow(infom);//ÏÔʾ±¨ÎÄ
|
Anchor_Dell.alert_anchor_tonbu_state(anchorid,tongbustate);//Ð޸ĻùÕ¾¼¯ºÏͬ²½×´Ì¬
|
Dell_TongbuAnchor.alert_rootanchor(anchorid,tongbustate);//ÐÞ¸Äͬ²½»ùÕ¾¼¯ºÏͬ²½×´Ì¬
|
get_anchorid_do();//»ñÈ¡µ½É豸IDÓ¦¸Ã×öµÄÊÂÇé
|
zhuanFa_xintiaobao();//ת·¢ÐÄÌø°ü
|
}
|
|
/**20230723yang*/
|
public static void baowenshow(String infom) {
|
String need_guo_lv_tag = TcpIpManage.getNeed_guo_lv_tag();
|
if (need_guo_lv_tag.equals(anchorid)||need_guo_lv_tag.equals("ËùÓлùÕ¾")) {
|
BaoWenShow.ok("2", "55AA02", "ÐÄÌø°ü:»ùÕ¾" + anchorid + "," + infom, ip, "´¦ÀíÔʼ±¨ÎÄ");
|
return;
|
}
|
}
|
|
/**20230723yang*/
|
public static String get_anchor_tongbu_state(String hex) {
|
int tongbu=Integer.parseInt(hex,16);//»ùվͬ²½×´Ì¬
|
String tongbustate=String.valueOf(tongbu) ;
|
return tongbustate;
|
}
|
|
/**20230723yang*/
|
public static void get_anchorid_do() {
|
Anchor anchor=Anchor_Dell.get_anchor(anchorid);
|
if(anchor !=null ) {
|
Anchor_Dell.set_anchor_mode(anchor,anchorid,ip, port);//Ð޸ĻùÕ¾ÔÚÏß״̬
|
if(anchor.getNearok()==0) {
|
ChuShiHua.write_anchor_near(anchor);
|
}
|
int a1=anchor.getGetversionok();//»ñÈ¡»ùÕ¾°æ±¾ºÅ
|
int a2=anchor.getAnchorheart();
|
if(a1==0 && a2==1) {
|
ChuShiHua.get_anchor_version(anchor);
|
anchor.setGetversionok(1);//ÊÇ·ñÒѾ»ñÈ¡¹ý»ùÕ¾µÄ°æ±¾ÉèÖÃΪ1»ñÈ¡ÁË
|
}
|
if(a2 !=3) {
|
anchor.setAnchorheart(a2+1);
|
}
|
}
|
}
|
|
/**20230723yang
|
* ±¨Îĸñʽ£º
|
* anchor_heart,ancid,ip,timestamp,mark
|
* ±¨ÎÄ˵Ã÷£º
|
* 1. anchor_heart:»ùÕ¾ÐÄÌø°ü
|
* 2. ancid:»ùÕ¾±àºÅ£¬Î¨Ò»Ê¶±ð±àÂë
|
* 3. ip:»ùÕ¾µÄIPµØÖ·
|
* 4. timestamp:ʱ¼ä´Á
|
* 5. mark: ±ê־λ£¬Çø±ð´ÓÄĸöÒýÇæÉÏ´«Êý¾Ý£¬ÊÊÓÃÓÚ¶à¸öÏîÄ¿´«ÈëÒ»¸öƽ̨£¬Ä¬ÈÏΪ0*/
|
public static void zhuanFa_xintiaobao() {
|
String message="anchor_heart,"+anchorid+","+ip+","+ GetNowTime.now()+","+Systems.sys().getBiaozhi();
|
Udp_Out.alldata_udptcp_out(message);
|
}
|
|
}
|