package JNADell;
|
import java.util.Vector;
|
import BaoWen.Stac;
|
import PbuliClass.ShowMessage;
|
import PbuliClass.Systems;
|
import anchor.Anchor;
|
import anchor.Anchor_Dell;
|
import anchor.Anchor_nerby_dell;
|
import anchor.Dell_cengao;
|
import home.Open_soft_dialog;
|
import tbDataModel.*;
|
import tbDataModel_Dell.*;
|
|
public class Chushisuanfa {
|
public static void suanfa_chushi() {
|
//Ëã·¨¿â»ù´¡²ÎÊýÉèÖÃ
|
//Ëã·¨³õʼ»¯»ñÈ¡Ëã·¨µÄ°æ±¾ºÅ
|
String jnalog=Dell_tb_suanfa2.getSuanfa2().getJnalog();
|
if(jnalog==null) {
|
ShowMessage.zidingyi("Ëã·¨³õʼ»¯Ê§°Ü¼ì²étb_suanfa2±íid×Ö¶Î");
|
return;
|
}
|
int jnaout=Integer.parseInt(jnalog);
|
DellJAN.suanfa_chushi(jnaout);
|
int en=0;
|
if(Stac.isJingzhi()) {
|
en=1;
|
}
|
int mode=Integer.parseInt(Dell_tb_suanfa2.getSuanfa2().getShi_xi_fen_pei());
|
int range=Integer.parseInt(Dell_tb_suanfa2.getSuanfa2().getJing_zhi_lv_zhi());
|
int width=150;
|
int filter=0;
|
String a=Dell_tb_suanfa2.getSuanfa2().getLv_bo_fang_shi();
|
if(a.equals("1")) {
|
filter=1;
|
}
|
DellJAN.SetParaFakePosEnable(en);// ÊÇ·ñ¿ªÆôλÖÃËæ¼ÓËٶȼƾ²Ö¹¶ø·¶Î§²¨¶¯, 1¿ªÆô
|
DellJAN.SetParaFakePosRange(range);// Ëæ¼Ó¼Æ²¨¶¯·¶Î§
|
DellJAN.SetParaSolver1dwidth(width);// Ò»¶þά½áºÏ, һά¿í¶ÈÓ°Ï췶Χ
|
DellJAN.SetParaSlotMode(mode);// ʱ¼äƬ·ÖÅ䷽ʽ0=GAP1, 1=MIX
|
DellJAN.SetParaFilterType(filter);//**ÉèÖÃÂ˲¨·½Ê½½á¹ûÂ˲¨·½Ê½0=Ò»½×µÍͨ, 1=»¬¶¯Æ½¾ù
|
}
|
|
/**¸æËßËã·¨¿â»ùÕ¾µÄÏà¹ØÐÅÏ¢*/
|
public static void anchor_register() {
|
Vector<Anchor> anchorvc=Anchor_Dell.getAnchor_vector();
|
int size=anchorvc.size();
|
if( size!=0) {
|
for(int i=0;i<size;i++) {
|
Anchor anchor=anchorvc.get(i);
|
String anchorid=anchor.getAnc_id();
|
int ancoidhex=Integer.parseInt(anchorid,16);
|
String axs=anchor.getAnc_x();
|
String ays=anchor.getAnc_y();
|
String azs=anchor.getAnc_z();
|
String floor0=anchor.getAnc_floor();
|
double axd = Double.valueOf(axs);
|
double ayd = Double.valueOf(ays);
|
double azd = Double.valueOf(azs);
|
int an_px=(int) axd;
|
int an_py=(int) ayd;
|
int an_pz=(int) azd;
|
int floor=Integer.parseInt(floor0);
|
int[] group=Anchor_Dell.anchor_zu(anchorid); //int[]»ùÕ¾ËùÊôµÄ×é
|
int config_num=group.length;//»ùÕ¾ÔÚ¼¸¸ö×éÄÚ
|
int[] range=Anchor_Dell.anchor_lc(anchorid); //int[]»ùÕ¾µÄÁ¿³Ì
|
int[] dimension=Dell_tbcengzu.weidu(floor, group);//int[]»ùÕ¾µÄά¶È
|
int[] nearby_anchor_id_list=Anchor_nerby_dell.get_nearanhorhex(anchor.getAnc_id());//int[]idÊý×é
|
if(nearby_anchor_id_list !=null) {
|
int nearby_anchor_number=nearby_anchor_id_list.length; // ÁÙ½ü»ùÕ¾idÊýÄ¿
|
//»ùÕ¾ÊÇ·ñÊÇÈýά²Î¿¼»ùÕ¾
|
DellJAN.anchor_register(
|
ancoidhex,
|
an_px,
|
an_py,
|
an_pz,
|
floor,
|
config_num,//»ùÕ¾ÔÚ¼¸¸ö×éÄÚ
|
group, //int[]»ùÕ¾ËùÊôµÄ×é
|
range, //int[]»ùÕ¾µÄÁ¿³Ì
|
dimension,//int[]»ùÕ¾µÄά¶È
|
nearby_anchor_number, // ÁÙ½ü»ùÕ¾idÊýÄ¿
|
nearby_anchor_id_list//int[]idÊý×é
|
);
|
}
|
}
|
getgasanchor_vector();
|
}
|
}
|
|
/**¸øËã·¨¿âÌí¼ÓÇøÓòÐÅÏ¢*/
|
public static void add_area() {
|
int size1=Dell_Fenceinout.getFinout_vec().size() ;
|
if(size1 !=0) {
|
for(int i=0;i<size1;i++) {
|
|
Tb_fence_inout tb=Dell_Fenceinout.getFinout_vec().get(i);
|
|
int id=tb.getId();
|
int floor=Integer.parseInt(tb.getFloor());
|
int Spm=tb.getGoroup();
|
String name=tb.getName();
|
|
int num=Integer.parseInt(tb.getBianshu());
|
|
int[] px=Dell_Fenceinout.px(name);
|
|
int[] py=Dell_Fenceinout.py(name);
|
|
int[] entrance=Dell_Fenceinout.entrance(name);
|
|
int[] exit=Dell_Fenceinout.exit(name);
|
|
if (tb.getBaoliu1().equals("1")) {
|
for (TbMap tbMap : Map_Dell.getMap_vector()) {
|
String floor1 = tbMap.getFloor();
|
DellJAN.add_area(id,Integer.parseInt(floor1),Spm, num, px, py, entrance, exit);
|
}
|
}else {
|
DellJAN.add_area(id, floor, Spm, num, px, py, entrance, exit);
|
}
|
}
|
}
|
}
|
|
/**¸øËã·¨¿âÌí¼ÓһάÏß*/
|
public static void add_line() {
|
int vnum2=2;
|
int[] px2=null;
|
int[] py2=null;
|
int size1= Dell_tbline.getLine_vector().size() ;
|
if(size1 !=0) {
|
for(int i=0;i<size1;i++) {
|
tb_line line = Dell_tbline.getLine_vector().get(i);
|
int id=Integer.parseInt(line.getId());
|
int floor=Integer.parseInt(line.getFlr());
|
int group=Integer.parseInt(line.getGrp());
|
int vnum = Integer.parseInt(line.getVnum());
|
int[] px1 = line.getPx();
|
int[] py1 = line.getPy();
|
if (line.getBaoliu1().equals("1")) {
|
for (TbMap tbMap : Map_Dell.getMap_vector()) {
|
String floor1 = tbMap.getFloor();
|
DellJAN.add_line(id,Integer.parseInt(floor1),group,vnum,px1,py1);
|
}
|
}else {
|
DellJAN.add_line(id, floor, group, vnum, px1, py1);
|
}
|
}
|
}
|
Vector<Tb_cengzu > line_vector = Dell_tbcengzu.getLine_vector();
|
if (line_vector.size()>0){
|
for (int i=0;i<line_vector.size();i++){
|
px2=new int[2];
|
py2=new int[2];
|
Tb_cengzu tb_suanfa = line_vector.get(i);
|
String zu = tb_suanfa.getZu();
|
String floor = tb_suanfa.getFloor();
|
int i1 = Integer.parseInt(zu);
|
int i2 = Integer.parseInt(floor);
|
if (DellJAN.get_group_line(i1, i2, vnum2, px2, py2) == 0) {
|
Dell_tbline.add(floor, zu, String.valueOf(vnum2), px2, py2,"0");
|
}
|
}
|
|
}
|
}
|
|
/**¿ç²ã×鏿ËßJNAËã·¨
|
* // idÏàͬµ«ÊDz㲻ͬµÄ×éÁ¬½Ó³Éͬһ¸ö×é, µ±Ç°Ö»Ö§³Ö1ά×é*/
|
public static void link_group() {
|
Vector<Tb_cengzu > zkdc_vector=Dell_tbcengzu.getZkdc_vector();
|
int size=zkdc_vector.size();
|
if(size !=0) {
|
for(int i=0;i<size;i++) {
|
String zu=zkdc_vector.get(i).getZu();
|
int groupid=Integer.parseInt(zu); // ×éid
|
String ceng=zkdc_vector.get(i).getBaoliu4();
|
String[] cengs=ceng.split(",");
|
int floornum=cengs.length;// ²ãÊýÁ¿, µ±Ç°Ö»Ö§³Ö2²ã
|
int[] floorids=new int[floornum]; // ÒªÁ¬½ÓµÄ²ãid
|
for(int j=0;j<floornum;j++) {
|
floorids[j]=Integer.parseInt(cengs[j]);
|
}
|
DellJAN.link_group(groupid, floornum, floorids);
|
}
|
}
|
}
|
|
|
/**ÉèÖÃij¸ö¿ç²ã»ùÕ¾ÔÚ¶à²ã×éÄڵĸ߶È*/
|
public static void set_height_in_group() {
|
Vector<Anchor> kczcnchor_vector=Anchor_Dell.getKczcnchor_vector();
|
int size=kczcnchor_vector.size();
|
if(size !=0) {
|
for(int i=0;i<size;i++) {
|
Anchor ac=kczcnchor_vector.get(i);
|
int anchoridint=Integer.parseInt(ac.getAnc_id(),16);
|
int groupidint=Integer.parseInt(ac.getBaoliu2());
|
int heightint=Integer.parseInt(ac.getBaoliu3());
|
DellJAN.set_height_in_group(anchoridint, groupidint, heightint);
|
}
|
}
|
}
|
|
/**ÐÞ¸ÄJNAµÄ²ã¸ßÐÅÏ¢*/
|
public static void alert_jnacenggao() {
|
Vector<tb_cengao> cenggao_vector=Dell_cengao.getCenggao_vector();
|
int size=cenggao_vector.size();
|
if(size !=0) {
|
for(int i=0;i<size;i++) {
|
int id=cenggao_vector.get(i).getId();
|
int buttom=Integer.parseInt(cenggao_vector.get(i).getButtom());
|
int top=Integer.parseInt(cenggao_vector.get(i).getTop());
|
DellJAN.cenggao(id,buttom,top);
|
}}
|
}
|
|
/**ÉèÖÃÄÄЩ×éÊÇÊÒÍâ×é*/
|
public static void SetOutdoorGroup() {
|
Vector<Tb_cengzu > outzu_vector=Dell_tbcengzu.getOutzu_vector();
|
int size=outzu_vector.size();
|
if(size !=0) {
|
int[] group_id=new int[size];
|
int[] floor_id=new int[size];
|
for(int i=0;i<size;i++) {
|
group_id[i]=Integer.parseInt(outzu_vector.get(i).getZu());
|
floor_id[i]=Integer.parseInt(outzu_vector.get(i).getFloor());
|
}
|
DellJAN.SetOutdoorGroup(size, group_id, floor_id);
|
}
|
}
|
|
|
/**ÉèÖÃÄÄЩÊDZؾ×é*/
|
public static void SetMustpassGroup(){
|
Vector<Tb_cengzu > bjz_vector=Dell_tbcengzu.getBjz_vector();
|
int size=bjz_vector.size();
|
if(size !=0) {
|
int[] group_id=new int[size];
|
int[] floor_id=new int[size];
|
for(int i=0;i<size;i++) {
|
group_id[i]=Integer.parseInt(bjz_vector.get(i).getZu());
|
floor_id[i]=Integer.parseInt(bjz_vector.get(i).getFloor());
|
}
|
|
DellJAN.SetMustpassGroup(size, group_id, floor_id);
|
}
|
}
|
|
/**½«fid²ãµÄgid×éÉèÖÃΪ±Ø¾×é, ±Ø¾¾àÀëdis, ·µ»ØÖµÎª¸º´ú±íÉèÖÃʧ°Ü*/
|
public static void setGroupMustpuss(){
|
Vector<Tb_cengzu > bjz_vector=Dell_tbcengzu.getBjz_vector();
|
int size=bjz_vector.size();
|
if(size !=0) {
|
int[] group_id=new int[size];
|
int[] floor_id=new int[size];
|
String[] dis=new String[size];
|
for(int i=0;i<size;i++) {
|
group_id[i]=Integer.parseInt(bjz_vector.get(i).getZu());
|
floor_id[i]=Integer.parseInt(bjz_vector.get(i).getFloor());
|
dis[i] = bjz_vector.get(i).getBaoliu4();
|
if (dis[i]==null){
|
dis[i]="0";
|
}
|
int i1 = Integer.parseInt(dis[i]);
|
DellJAN.set_group_mustpuss(group_id[i], floor_id[i],i1);
|
}
|
}
|
}
|
/**½«fid²ãµÄgid×éÉèÖÃΪ±Ø¾×é, ±Ø¾¾àÀëdis, ·µ»ØÖµÎª¸º´ú±íÉèÖÃʧ°Ü*/
|
public static void setAnchorMustpussDistance(){
|
Vector<Anchor> bjjl_vector=Anchor_Dell.getAnchor_vector();
|
int size=bjjl_vector.size();
|
if(size !=0) {
|
for(int i=0;i<size;i++) {
|
Anchor acr=bjjl_vector.get(i);
|
String id=acr.getAnc_id();
|
int an_id=Integer.parseInt(id,16);
|
String baoliu4 = acr.getBaoliu4();
|
if ("".equals(baoliu4)){
|
baoliu4="0";
|
}
|
int andis=Integer.parseInt(baoliu4);
|
if(andis !=0) {//Óбؾ¾àÀëʱºò²Åµ÷ÓñؾËã·¨
|
DellJAN.set_anchor_mustpuss_distance(an_id, andis);
|
}
|
}
|
}
|
}
|
|
|
/**Ϊ»ùÕ¾µ¥¶ÀÉèÖñؾ¾àÀë(3D¾àÀë²»ÊÇÆ½Ãæ¾àÀë)*/
|
public static void SetAnchorMustpassDis() {
|
Vector<Anchor> bjjl_vector=Anchor_Dell.getBjjl_vector();
|
int size=bjjl_vector.size();
|
if(size !=0) {
|
for(int i=0;i<size;i++) {
|
Anchor acr=bjjl_vector.get(i);
|
String id=acr.getAnc_id();
|
int an_id=Integer.parseInt(id,16);
|
int andis=Integer.parseInt(acr.getBaoliu4());
|
DellJAN.SetAnchorMustpassDis(an_id, andis);
|
}
|
}
|
}
|
|
/**³õʼ»¯¿í¶ÈÔ¼Êø×éµÄ¼¯ºÏ*/
|
public static void SetGroupDisErrorRange() {
|
Vector<Tb_cengzu > sf=Dell_tbcengzu.getZkdc_vector();
|
int size=sf.size();
|
if(size !=0) {
|
int[] group_id=new int[size];
|
int[] floor_id=new int[size];
|
int[] edis=new int[size];
|
for(int i=0;i<size;i++) {
|
group_id[i]=Integer.parseInt(sf.get(i).getZu());
|
floor_id[i]=Integer.parseInt(sf.get(i).getFloor());
|
edis[i]=Integer.parseInt(sf.get(i).getZu_kuang_du());
|
}
|
DellJAN.SetGroupDisErrorRange(size,group_id,floor_id,edis);
|
}
|
}
|
|
/**Ìí¼ÓΧÀ¸*/
|
public static void add_fence() {
|
for (PolygonNew polygonNew : Dell_Polygon.getPolyVec()) {
|
int length = polygonNew.getX().length;
|
double[] x = polygonNew.getX();
|
double[] y = polygonNew.getY();
|
if (polygonNew.getId() == null) {
|
return;
|
}
|
int id = Integer.parseInt(polygonNew.getId());
|
int num = length;
|
int[] px = new int[length];
|
int[] py = new int[length];
|
for (int i = 0; i < length; i++) {
|
px[i] = (int) x[i];
|
py[i] = (int) y[i];
|
}
|
if (polygonNew.gettype().equals("Î§Ç½ÇøÓò")) {
|
DellJAN.add_fence(id, num, px, py);
|
}
|
}
|
|
}
|
|
/**»ñÈ¡»ùÕ¾µÄ¼¯ºÏ*/
|
public static void getgasanchor_vector(){
|
if(Systems.isIssanwei()) {
|
Vector<Tb_gas_anchor> gas_anchorvc=Dell_tb_gas_anchor.getGas_anchorvc();
|
int size=gas_anchorvc.size();
|
for(int i=0;i<size;i++) {
|
String anchorid=gas_anchorvc.get(i).getAnchorid();
|
String x=gas_anchorvc.get(i).getAnchorx();
|
String y=gas_anchorvc.get(i).getAnchorx();
|
String z=gas_anchorvc.get(i).getAnchorx();
|
int ancoidhex=Integer.parseInt(anchorid,16);
|
String axs=x;
|
String ays=y;
|
String azs=z;
|
String floor0="0";
|
double axd = Double.valueOf(axs);
|
double ayd = Double.valueOf(ays);
|
double azd = Double.valueOf(azs);
|
int an_px=(int) axd;
|
int an_py=(int) ayd;
|
int an_pz=(int) azd;
|
int floor=Integer.parseInt(floor0);
|
int[] group= {0}; //int[]»ùÕ¾ËùÊôµÄ×é
|
int config_num=group.length;//»ùÕ¾ÔÚ¼¸¸ö×éÄÚ
|
int[] range= {10000}; //int[]»ùÕ¾µÄÁ¿³Ì
|
int[] dimension= {3};//int[]»ùÕ¾µÄά¶È
|
int[] nearby_anchor_id_list= {0};//int[]idÊý×é
|
int nearby_anchor_number=1; // ÁÙ½ü»ùÕ¾idÊýÄ¿
|
DellJAN.anchor_register(
|
ancoidhex,
|
an_px,
|
an_py,
|
an_pz,
|
floor,
|
config_num,//»ùÕ¾ÔÚ¼¸¸ö×éÄÚ
|
group, //int[]»ùÕ¾ËùÊôµÄ×é
|
range, //int[]»ùÕ¾µÄÁ¿³Ì
|
dimension,//int[]»ùÕ¾µÄά¶È
|
nearby_anchor_number, // ÁÙ½ü»ùÕ¾idÊýÄ¿
|
nearby_anchor_id_list//int[]idÊý×é
|
);
|
}
|
}
|
}
|
|
|
public static void TOJNA() {
|
Open_soft_dialog.addara("³õʼ»¯Ëã·¨");
|
suanfa_chushi();
|
anchor_register();
|
add_area();
|
add_line();
|
link_group();
|
set_height_in_group();
|
alert_jnacenggao();
|
SetOutdoorGroup();
|
SetMustpassGroup();
|
setGroupMustpuss();
|
SetAnchorMustpassDis();
|
SetGroupDisErrorRange();
|
setAnchorMustpussDistance();
|
add_fence();
|
}
|
|
}
|