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);
|
}
|
}
|
|
}
|
|
}
|