package urt;
|
import java.util.Vector;
|
import BaoWen.Urt_7000_port;
|
import JNADell.Dell_usetaganchor;
|
import Judge.JugeNumber;
|
import Method.GetNowTime;
|
import PbuliClass.Shi_jian_cha_sss;
|
import PbuliClass.ShowMessage;
|
import person.Person;
|
import person.person_Dell;
|
import tbDataModel.Tb_gps;
|
public class Control_urt {
|
/**4gģʽÏ¿ØÖÆURT·äÃù
|
* @param tagid±êÇ©±àºÅ
|
* @param time·äÃùʱ¼äµ¥Î»Ãë*/
|
public static void beeper(String ip,String port,String tagid,String time,int datafrom) {
|
String data="$control,"+tagid+",beeper,"+time;
|
int size=data.getBytes().length;
|
if(port !=null) {
|
if(size !=0 && JugeNumber.isDigit(port)) {
|
Urt_7000_port.udp_out(data.getBytes(),size, ip, port,tagid,data);
|
if(datafrom==1) {
|
ShowMessage.zidingyi(tagid+","+ip+":"+port+"·äÃù¿ØÖÆÐÅÏ¢ÒÑÏ·¢");
|
}
|
}
|
}
|
|
}
|
|
/**55BBģʽÏ¿ØÖƱêÇ©·äÃù*/
|
public static void beeper(String tagid,int time) {
|
if(!tagid.equals("ËùÓбêÇ©")) {
|
Tb_gps tg=Dell_gps.get_tb_gps(tagid);
|
if(tg !=null) {
|
String port=tg.getPort();
|
if(port !=null) {
|
String ip=tg.getIp();
|
String data="$control,"+tagid+",beeper,"+time;
|
int size=data.getBytes().length;
|
if(size !=0 && JugeNumber.isDigit(port)) {
|
Urt_7000_port.udp_out(data.getBytes(),size, ip, port,tagid,data);
|
}
|
}
|
}
|
}else {
|
int size=Dell_gps.getGps_vector().size();
|
for(int i=0;i<size;i++) {
|
Tb_gps tg=Dell_gps.getGps_vector().get(i);
|
String port=tg.getPort();
|
if(port!=null) {
|
String ip1=tg.getIp();
|
String data="$control,"+tagid+",beeper,"+time;
|
int size1=data.getBytes().length;
|
if(size1 !=0 && JugeNumber.isDigit(port)) {
|
Urt_7000_port.udp_out(data.getBytes(),size1, ip1, port,tagid,data);
|
}
|
}
|
}
|
}
|
|
}
|
|
|
public static void all_beeiper(String time) {
|
int size=Dell_gps.getGps_vector().size();
|
for(int i=0;i<size;i++) {
|
Tb_gps tg=Dell_gps.getGps_vector().get(i);
|
String ip=tg.getIp();
|
String port=tg.getPort();
|
if(port!=null) {
|
String tagid=tg.getTagid();
|
beeper(ip,port,tagid,time,1);
|
}
|
}
|
}
|
|
|
/**ͨ¹ý4G¿ª¹ØUWB¹¦ÄÜ,1ÊÇ¿ªÆô0ÊǹرÕ
|
* $control,1872,uwb_enable,1*/
|
public static void open_or_close_uwb(Person person,String tagid,String enable) {
|
if(person==null) {
|
return;
|
}else {
|
String ip=person.getBaoliu8();
|
String port=person.getBaoliu9();
|
if(port.length()>2) {
|
String data="$control,"+tagid+",uwb_enable,"+enable;
|
int size=data.getBytes().length;
|
Urt_7000_port.udp_out(data.getBytes(),size, ip, port,tagid,data);
|
}
|
}
|
}
|
|
/**¿ª±ÕËùʹÓÃÉ豸UWB*/
|
public static void all_open_or_close_uwb(String enable) {
|
int size=Dell_gps.getGps_vector().size();
|
for(int i=0;i<size;i++) {
|
Tb_gps tg=Dell_gps.getGps_vector().get(i);
|
String ip=tg.getIp();
|
String port=tg.getPort();
|
if(port!=null) {
|
String tagid=tg.getTagid();
|
String data="$control,"+tagid+",uwb_enable,"+enable;
|
int size2=data.getBytes().length;
|
Urt_7000_port.udp_out(data.getBytes(),size2, ip, port,tagid,data);
|
Urt_read.read_tag(tagid,"01","33",1);
|
}
|
}
|
}
|
|
/**ÎÞÏßģʽÏÂÐÞ¸ÄÉ豸²ÎÊý
|
* $setpara,É豸ID,µØÖ·,Êý¾Ý*/
|
/**´¦Àí4G¶ÁÈ¡µÄ±êÇ©ÅäÖÃ
|
* $replypara,2011,299,8209,500,10,0,65505,1,0,0,9999,end
|
* 1¡¢°æ±¾ºÅ£¨2Byte£©
|
* 2¡¢Ä£¿éID£¨2Byte£©
|
* 3¡¢±êǩͨѶ¼ä¸ô£¨2Byte£©
|
* 4¡¢µ¥´ÎͨѶ»ùÕ¾ÊýÁ¿ÉÏÏÞ£¨2Byte£©
|
* 5¡¢µ¥´ÎͨѶ»ùÕ¾ÊýÁ¿ÏÂÏÞ£¨2Byte£©
|
* 6¡¢¾àÀëУ׼ֵ£¨2Byte£©
|
* 7¡¢Ä£¿éÀàÐÍ£¨2Byte£©
|
* 8¡¢Õð¶¯Ê±³¤
|
* 9¡¢±¨¾¯É豸
|
* 10¡¢¾²Ö¹Åж¨Ê±³¤,IMU¾²Ö¹Ê±¼ä
|
* 11¡¢ÆøÑ¹¼Æ²Î¿¼»ùÕ¾ID
|
* 12¡¢ÍâÉè¿ØÖÆ1´ò¿ªRTK£» 2¹Ø±ÕRTK
|
* 13¡¢Åä¶ÔID
|
* 14¡¢ UWB¿ª¹Ø×´Ì¬
|
* 27¡¢¹¦ÂÊ
|
* 28¡¢¼ÓËÙ¼ÆãÐÖµ
|
* 29¡¢¾²Ö¹ÐÝÃßʱ¼ä,IMU¾¹ýÕâ¸öʱ¼ä²»¶¯É豸¾Í½øÈëÐÝÃß״̬
|
* 30¡¢Õñ¶¯Ê¹ÄÜ
|
* 31¡¢¼ÓËÙ¼ÆÊ¹ÄÜ*/
|
public static void alrt_urt_canshu(String tagid,int adress0,int value0,int datafrom) {
|
if(tagid.equals("ËùÓбêÇ©")) {
|
Vector<Person> pers=person_Dell.getPerson_vector();
|
int size=pers.size();
|
for(int i=0;i<size;i++) {
|
String tagids=pers.get(i).getP_tagid();
|
alert_onetag(tagids,adress0,value0,0);
|
}
|
ShowMessage.zidingyi("È«²¿Êý¾ÝÒÑÏ·¢");
|
}else {
|
alert_onetag(tagid,adress0,value0,1);
|
}
|
}
|
|
/**
|
* @param String tagid,±êÇ©ID
|
* @param int adress,µØÖ·
|
* @param int value,ÊýÖµ
|
* @param int datafrom£¬Êý¾ÝÀ´Ô´*/
|
public static void alert_onetag(String tagid,int adress, int value,int datafrom) {
|
Person person=person_Dell.get_Person(tagid);
|
if(person==null) {
|
return;
|
}
|
String ip=person.getBaoliu8();
|
String port=person.getBaoliu9();
|
if(port.length()>2) {
|
String data="$setpara,"+tagid+","+adress+","+value;
|
int size=data.getBytes().length;
|
Urt_7000_port.udp_out(data.getBytes(),size, ip, port,tagid,data);
|
if(datafrom==1) {
|
ShowMessage.zidingyi("ÐÞ¸ÄÊý¾ÝÒÑÏ·¢£º"+data);
|
}
|
}
|
}
|
|
/**²¥·ÅÓïÒô
|
* Ï·¢ÓïÒô£º
|
* Ö¸Á$control,±êÇ©ID,TTS,"ÓïÒôÄÚÈÝ"
|
* ʾÀý£º$control,3442,TTS,"ÄãºÃ"
|
* @param jiangeÓïÒô·¢ËÍʱ¼ä¼ä¸ôµ¥Î»Ãë
|
* @param int datafromsÊý¾ÝÀ´Ô´
|
* */
|
public static void say_voice(String tagid,String message,int datafrom,int jiange) {
|
|
Person person=person_Dell.get_Person(tagid);
|
if(person==null) {
|
return;
|
}
|
String type=person.getBaoliu19();
|
if(!type.equals("URT+CO") && !type.equals("ÈÚºÏÖÕ¶Ë")) {
|
return;
|
}
|
|
String time=person.getSendvoicetime();
|
if(time !=null) {
|
int a= Shi_jian_cha_sss.get_time_cha_s(GetNowTime.now(),time);
|
if(a>jiange) {
|
String ip=person.getBaoliu8();
|
String port=person.getBaoliu9();
|
if(port.length()>2) {
|
String data="$control,"+tagid+",TTS,"+message+" ";
|
int size=data.getBytes().length;
|
Urt_7000_port.udp_out(data.getBytes(),size, ip, port,tagid,data);
|
if(datafrom==1) {
|
ShowMessage.zidingyi("ÓïÒôÊý¾ÝÒÑÏ·¢£º"+message);
|
}
|
Dell_usetaganchor.sendmessagejilu_intodata(tagid,message,"ϵͳĬÈÏ");
|
}
|
person.setSendvoicetime(GetNowTime.now());
|
}
|
}
|
}
|
|
/**·äÃùÓïÒô*/
|
public static void say_fengming(String tagid) {
|
|
Person person=person_Dell.get_Person(tagid);
|
if(person==null) {
|
return;
|
}
|
String type=person.getBaoliu19();
|
if(!type.equals("URT+CO") && !type.equals("ÈÚºÏÖÕ¶Ë")) {
|
return;
|
}
|
|
String ip=person.getBaoliu8();
|
String port=person.getBaoliu9();
|
if(port.length()>2) {//$settone,6666,2600,200,0,3000
|
String data="$settone,"+tagid+",2600,200,0,10000";
|
int size=data.getBytes().length;
|
Urt_7000_port.udp_out(data.getBytes(),size, ip, port,tagid,data);
|
ShowMessage.zidingyi("·äÃùÓïÒôÊý¾ÝÒÑÏ·¢"+data);
|
}
|
}
|
|
|
}
|