zsh_root
2024-01-02 7b595546af704983dbafcd0d385c8768ddacefc2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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¸æ¾¯Î´´¦Àí
            }
        }
        
    }
}