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 Pointoutwaringbaidu {
|
|
public static void is_out_fence_baidu(String tagid, String gps_weidu, String gps_jingdu, double h) {
|
Vector<TbFence> vc = Fences.getOutfence_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[1]), Double.parseDouble(wj[0]));
|
// Èç¹ûÇøÓò´æÔÚ
|
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)) {
|
// ÅжÏID×ø±êÊÇ·ñÔÚΧÀ¸ÇøÓòÄÚ
|
boolean isin = IsPtInPoly.inPoly(point, tbfenc.getPts());
|
if (!isin) {
|
Control_urt.say_voice(tagid, " ²»ÔÚΧÀ¸ÄÚ", 0, 10);
|
}
|
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 && h < gao) {
|
person.setP_fence("0");
|
person.setInbaiduoutwarning(0);
|
person.setOutwarning(false);
|
return;
|
}
|
}
|
|
person.setP_fence("2");
|
int zai = person.getInbaiduoutwarning();
|
if (zai != 1) {
|
String beizhu = gps_weidu + "," + gps_jingdu + "," + h;
|
Control_urt.say_voice(tagid, "²»ÔÚΧÀ¸ÄÚ", 0, 10);
|
InsertData.sosInsertTbWarning(tagid, "³öÇøÓò¸æ¾¯", "δ´¦Àí", beizhu);
|
}
|
person.setInbaiduoutwarning(1);
|
person.setOutwarning(true);
|
}
|
}
|
|
}
|
|
}
|