package urt;
|
|
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;
|
|
/**±êǩ״̬
|
* $status£¬É豸ID£¬±ê־λ£¬×´Ì¬
|
*/
|
public class Dell_status {
|
//1 ¾²Ö¹×´Ì¬;2½øÈëÐÝÃß;3Óû§°´¼ü
|
//0Í˳ö¾²Ö¹, 1¾²Ö¹ ;1½øÈë;1°´¼ü´¥·¢
|
public static void dell_status(String message) {
|
String[] mes=message.split(",");
|
int size=mes.length;
|
if(size !=4) {
|
return;
|
}
|
String tagid=mes[1];
|
String biaozhi=mes[2];
|
String status=mes[3];
|
Person person=person_Dell.get_Person(tagid);
|
if(person==null) {
|
return;
|
}
|
switch(biaozhi){
|
case "1" :
|
person.setJingzhi(status);
|
break;
|
case "2" :
|
person.setXiumian(status);
|
break;
|
case "3" :
|
dell_sos( person,status,tagid);
|
break;
|
|
}
|
}
|
|
public static void dell_sos(Person person,String status,String tagid) {
|
if(status.equals("1")) {
|
ShowMessage.zidingyi(tagid+"°´ÏÂSOS°´¼ü");
|
person.setP_sos("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¸æ¾¯Î´´¦Àí
|
}
|
}
|
|
}
|
}
|