package fence;
|
import java.awt.geom.Point2D;
|
import java.text.DecimalFormat;
|
|
import Method.ControTag;
|
import Method.InsertData;
|
import PbuliClass.IsPtInPoly;
|
import PbuliClass.Music;
|
import anchor.Anchor_Dell;
|
import person.Person;
|
import tbDataModel.TbFence;
|
|
/**³ö±äµçÕ¾ÇøÓò¸æ¾¯*/
|
public class Point_outbiandianz {
|
static DecimalFormat df = new DecimalFormat("0.00");
|
static int jishu=0;
|
public static void is_out_bdz(
|
String ip,
|
Person person,
|
String tagid,
|
double gps_jingdu,
|
double gps_weidu,
|
double h) {
|
String fence_name=person.getPerson_fence();//Èç¹ûÈËԱûÓаó¶¨Î§À¸
|
if(fence_name==null) {
|
return;
|
}
|
TbFence tbfenc=Fences.get_fence(fence_name);//ÈËÔ±°ó¶¨µÄΧÀ¸
|
boolean open=tbfenc.getBaoliu7().equals("1");//ΧÀ¸ÆôÓÃ
|
if( tbfenc !=null && open) {//Èç¹ûÇøÓò´æÔÚͬʱΧÀ¸¿ªÆô
|
Point2D.Double point=new Point2D.Double(gps_jingdu,gps_weidu);
|
boolean isin=IsPtInPoly.inPoly(point, tbfenc.getPts());//ÅжÏID×ø±êÊÇ·ñÔÚΧÀ¸ÇøÓòÄÚ
|
double gao=tbfenc.getHeight();//ΧÀ¸¸ß¶È
|
double anchorh0=Anchor_Dell.getAnchorh0();
|
double startgao=Anchor_Dell.getAnchorhr();
|
double xiangduigao=h-startgao-anchorh0;//º£°ÎʵʱÏà¶Ô¸ß¶È
|
person.setBaoliu10(df.format(xiangduigao));//ÉèÖÃÏà¶Ô¸ß¶È
|
String beizhu=gps_jingdu+";"+gps_weidu+";"+h;
|
if(!isin) {
|
outfencedo("³öÇøÓò¸æ¾¯",person,beizhu,tagid,ip);
|
}else if(xiangduigao>gao) {
|
outfencedo("³¬¸ß¸æ¾¯",person,beizhu,tagid,ip);
|
}
|
person.setP_fence("0");
|
}
|
}
|
|
/**³öÇøÓòÐèÒª×öµÄÊÂÇé*/
|
public static void outfencedo(String type,Person person,String beizhu,String tagid,String ip) {
|
String zai=person.getP_fence();
|
if(zai.equals("0")) {
|
InsertData.sosInsertTbWarning(person.getP_tagid(),type, "δ´¦Àí",beizhu);
|
new Music("systemFiles/voice/outwarning1.wav").start();//µ÷ÓÃÒôƵÎļþ
|
ControTag.fengming_biandianzhan(10, tagid, ip);
|
}
|
person.setP_fence("2");
|
}
|
|
}
|