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
64
65
66
67
68
69
70
71
package fence;
 
import java.awt.geom.Point2D;
import java.util.Vector;
 
import Frame.TcpIpManage;
import Method.BaoWenShow;
import Method.InsertData;
import PbuliClass.IsPtInPoly;
import person.Person;
import person.person_Dell;
import tbDataModel.TbFence;
import urt.Control_urt;
import urt.xytognss;
 
/**
 * °Ù¶ÈµØÍ¼³öÈ¥Ô¤¾¯
 */
public class PointinWaringbaidu {
 
    public static void is_in_fence_baidu(String tagid, String gps_weidu, String gps_jingdu, double h) {
        Vector<TbFence> vc = Fences.getInfence_baidu();
        int snsize = vc.size();
        if (snsize != 0) {
            Person person = person_Dell.get_Person(tagid);
            if (person == null) {
                return;
            }
            String[] wj = xytognss.dd2d(gps_weidu, gps_jingdu);
            Point2D.Double point = new Point2D.Double(Double.parseDouble(wj[0]), Double.parseDouble(wj[1]));
            // Èç¹ûÇøÓò´æÔÚ
            for (int i = 0; i < snsize; i++) {
                TbFence tbfenc = vc.get(i);
                String fencename = tbfenc.getName();
                double gao = tbfenc.getHeight();
                String bumen = tbfenc.getBumen();
                String bumen1 = person.getP_department();
                // Èç¹û²¿ÃÅÏàͬ²Å×öÅжÏ
                if (bumen.equals(bumen1)&&tbfenc.getBaoliu7().equals("1")) {
                    // ÅжÏID×ø±êÊÇ·ñÔÚΧÀ¸ÇøÓòÄÚ
                    boolean isin = IsPtInPoly.inPoly(point, tbfenc.getPts());
                    if (isin) {
                        Control_urt.say_voice(tagid, " ±êÇ©ÔÚ¸æ¾¯ÇøÓòÄÚ", 0, 5);
                        System.out.println(tagid+"ÔÚ"+fencename+"ÄÚ,"+wj[0]+";"+wj[1]);
                    }
                    if (TcpIpManage.getStar()) {
                        String hex = tagid + "," + isin + "," + fencename + "," + gps_jingdu + "," + gps_weidu + "," + h;
                        BaoWenShow.ok_tagid("2", "debug", hex, "127.0.0.1", tagid);
                    }
                    if (!isin && gao < h) {
                        person.setP_fence("0");
                        person.setInbaiduoutwarning(1);
                        return;
                    }
                }
 
                person.setP_fence("2");
                int zai = person.getInbaiduinwarning();
                if (zai == 1) {
                    String beizhu = gps_weidu + "," + gps_jingdu + "," + h;
                    Control_urt.say_voice(tagid, " ±êÇ©ÔÚ¸æ¾¯ÇøÓòÄÚ", 0, 5);
                    InsertData.sosInsertTbWarning(tagid, "½øÈë¸æ¾¯", "δ´¦Àí", beizhu);
                }
                person.setInbaiduinwarning(0);
                person.setOutwarning(true);
            }
        }
 
    }
 
}