package BaoWen;
|
import Method.GetNowTime;
|
import Method.InsertData;
|
import PbuliClass.Music;
|
import PbuliClass.Shi_jian_cha_sss;
|
import PbuliClass.ShowMessage;
|
import person.Person;
|
import person.person_Dell;
|
import tbDataModel_Dell.Tb_Warnig_Dell;
|
|
/**Èç¹ûÓвâ¾àÐÅÏ¢µ÷ÓÃÏÂÃæµÄ·½·¨*/
|
public class Have_ceju_message_do {
|
/**Èç¹ûÓвâ¾àÐÅÏ¢×öЩÏÂÃæµÄÊÂÇé*/
|
public static void dosometing(
|
String receive_tagid,
|
String battery,
|
String ip,
|
String sos,
|
String[] anchorids,
|
String tagoff,
|
int[] distance,
|
String xiumian,
|
String jizhi,
|
Person person
|
) {
|
if(anchorids.length>0) {
|
String anchorid="0";
|
for(int i=0;i<anchorids.length;i++) {
|
int dis=distance[i];
|
if(dis !=0 && dis !=131071) {
|
//Anchor_Dell.set_anchor_mode2(anchorids[i]);//µÈÐ޸ĻùÕ¾¶Ïµç²â¾àÖµ¸Ä±äÎÊÌâ¼ÓÉÏ
|
if(anchorid!=null && anchorid.equals("0")) {
|
anchorid=anchorids[i];
|
}
|
}else {
|
Dell_55AA12.dell_anchordistance_err(anchorids[i] ,dis);//´¦Àí²â¾àÒì³£
|
}
|
Dell_55AA0C.anchor_onlie_record(anchorids[i]);//»ùÕ¾ÉÏÏ߼Ǽ
|
}
|
alert_person(receive_tagid,battery,sos,tagoff,anchorid,xiumian,jizhi,person);
|
}
|
}
|
|
|
/**ÓкϷ¨²â¾àÐÅÏ¢ÐÞ¸ÄÈËÔ±Ïà¹ØÐÅÏ¢*/
|
public static void alert_person(
|
String tagid,
|
String battery,
|
String sos,
|
String tagoff,
|
String anchorid,
|
String xiumian,
|
String jingzhi,
|
Person person
|
) {
|
if (person!= null) {
|
person.setP_sos(sos);
|
person.setXiumian(xiumian);
|
String beforejingzhi=person.getJingzhi();
|
if(!beforejingzhi.equals(jingzhi)) {
|
person_Dell.autor_alert_hz(person);
|
}
|
person.setJingzhi(jingzhi);
|
//Èç¹ûsosΪ1ÐèÒª´¥·¢ÓïÒô²¢¼Ç¼µ½¸æ¾¯Êý¾Ý¿âÖÐ
|
if(sos.equals("1")) {
|
String time=person.getSostime();
|
int shicha=Shi_jian_cha_sss.get_time_cha_s(GetNowTime.now(), time);
|
if(shicha>3) {//Èç¹ûʱ¼ä²îСÓÚ1ÃëÔò²»·¢Éù
|
new Music("systemFiles/voice/sos.wav").start();//µ÷ÓÃÒôƵÎļþ
|
}
|
person.setSostime(GetNowTime.now());
|
String sosstate=person.getSos_state();
|
if(sosstate.equals("0")) {
|
String xy=person.getP_x()+","+person.getP_y()+","+person.getP_floor();
|
InsertData.sosInsertTbWarning(tagid,"SOS", "δ´¦Àí",xy);//½«¸æ¾¯¼Ç¼³öÈëµ½Êý¾Ý¿â
|
person.setSos_state("1");//SOS¸æ¾¯Î´´¦Àí
|
}
|
}
|
|
//±êÇ©±»²ð³ý
|
String tagoffstate=person.getTagoff();
|
if(tagoff.equals("0") && tagoffstate.equals("1")) {
|
ShowMessage.zidingyi(tagid+"±»²ð³ý");
|
person.setTagoff("0");
|
InsertData.sosInsertTbWarning(tagid,"±»²ð³ý", "δ´¦Àí", GetNowTime.now());//½«¸æ¾¯¼Ç¼³öÈëµ½Êý¾Ý¿â
|
Tb_Warnig_Dell.add_tb_warning("±»²ð³ý", tagid, "δ´¦Àí",GetNowTime.now());
|
}else if(tagoff.equals("1")) {
|
person.setTagoff(tagoff);
|
}
|
|
person.setP_power(battery);
|
}
|
}
|
|
|
|
|
}
|