📄 goutong.java
字号:
package net.aetherial.gis.test.tongji;
import java.io.File;
import net.aetherial.gis.output.toLd.OpenDirectory;
import net.aetherial.gis.our.FrameOur;
import net.aetherial.gis.table.WuWei;
import java.util.Vector;
import org.w3c.dom.Node;
import net.aetherial.gis.surface.ItemValue;
import net.aetherial.gis.dataType.TrackType;
import net.aetherial.gis.publicuse.WptTrackDistance;
import net.aetherial.gis.our.auto.check.repeattrk.TrackRectangle;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2004</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class Goutong {
private FrameOur fo = null;
private File[] ganxians = null;
private File xiangzhenFile = null;
private Vector xingzhencuns = new Vector();
private Vector shuini_xingzhencun = new Vector();
private Vector youlu_xingzhencun = new Vector();
public Goutong() {
}
public void countFiles(){
for (int i = 0;ganxians != null && i < ganxians.length; i++) {
this.fo.openFile(ganxians[i]);
}
this.fo.openFile(xiangzhenFile);
Node[] xzcs = this.getXingzhencunNodes(),trks = ItemValue.getTracks();
for (int i = 0; i < xzcs.length; i++) {
this.scanToGetGoutong(xzcs[i],trks);
}
this.fo.reset();
}
private Node[] getXingzhencunNodes(){
Node[] xzcs = ItemValue.getXingZCInWaypoint(ItemValue.getWaypoint());
Vector myxzcs = new Vector();
for (int i = 0; xzcs != null && i < xzcs.length; i++) {
if (isXingzhengcunInArray(xzcs[i])) {
myxzcs.add(xzcs[i]);
}
}
Node[] temp = new Node[myxzcs.size()];
myxzcs.copyInto(temp);
return temp;
}
private String getXingzhengcunName(Node xzc){
String wptName = ItemValue.getWaypointName(xzc);
try {
wptName = wptName.substring(0, 2);
}
catch (Exception ex) {
}
String temp = "";
for (int i = 0; i < xingzhencuns.size(); i++) {
temp = xingzhencuns.get(i)+"";
if (temp.indexOf(wptName) != -1 || wptName.indexOf(temp) != -1) {
return temp;
}
}
return wptName;
}
private void addToXZCVector(String xzc,Vector ve){
String temp = "";
for (int i = 0; i < this.shuini_xingzhencun.size(); i++) {
temp = this.shuini_xingzhencun.get(i)+"";
if (temp.equals(xzc)) {
return;
}
}
for (int i = 0; i < this.youlu_xingzhencun.size(); i++) {
temp = this.youlu_xingzhencun.get(i)+"";
if (temp.equals(xzc)) {
return;
}
}
ve.add(xzc);
}
private void scanToGetGoutong(Node xzc,Node[] trks){
String type = "",name = "",number;
for (int i = 0; trks != null && i < trks.length; i++) {
type = ItemValue.getTracksType(trks[i]);
name = ItemValue.getTracksName(trks[i]);
number = ItemValue.getTracksNumber(trks[i]);
if (type.equals(TrackType.RS_A_good) && this.isNear(xzc,trks[i])) {
// addToXZCVector(getXingzhengcunName(xzc) + "[" + name +"]["+ type + "]["+number+"]",this.shuini_xingzhencun);
addToXZCVector(getXingzhengcunName(xzc),this.shuini_xingzhencun);
// this.shuini_xingzhencun.add(getXingzhengcunName(xzc));
}else if(type.equals(TrackType.RS_B_good) && this.isNear(xzc,trks[i])){
// addToXZCVector(getXingzhengcunName(xzc) + "[" + name +"]["+ type + "]["+number+"]",this.youlu_xingzhencun);
addToXZCVector(getXingzhengcunName(xzc),this.youlu_xingzhencun);
// this.youlu_xingzhencun.add(getXingzhengcunName(xzc));
}
}
}
private boolean isNear(Node xzc,Node trk){
double dis = WptTrackDistance.getWptToTrackDis(xzc,trk);
if (dis < TrackRectangle.NEAR_DISTANCE * 5) {
return true;
}else{
return false;
}
}
private boolean isXingzhengcunInArray(Node xzcWpt){
String wptName = ItemValue.getWaypointName(xzcWpt);
try {
wptName = wptName.substring(0, 2);
}
catch (Exception ex) {
}
String temp = "";
for (int i = 0; i < xingzhencuns.size(); i++) {
temp = xingzhencuns.get(i)+"";
if (temp.indexOf(wptName) != -1 || wptName.indexOf(temp) != -1) {
return true;
}
}
return false;
}
public void setFo(FrameOur fo) {
this.fo = fo;
}
public void addXingzhencun(String xingzhencun){
this.xingzhencuns.add(xingzhencun);
}
public void setXiangzhenFile(File xiangzhenFile) {
this.xiangzhenFile = xiangzhenFile;
}
public void setGanxians(File[] ganxians) {
this.ganxians = ganxians;
}
public Vector getYoulu_xingzhencun() {
return youlu_xingzhencun;
}
public Vector getShuini_xingzhencun() {
return shuini_xingzhencun;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -