📄 scantodata.java
字号:
package net.aetherial.gis.jiaotongbu.output.tocheck;
import net.aetherial.gis.jiaotongbu.output.type.ScanAll;
import net.aetherial.gis.our.FrameOur;
import net.aetherial.gis.jiaotongbu.output.type.Qiaoliang;
import net.aetherial.gis.jiaotongbu.output.type.Dukou;
import net.aetherial.gis.jiaotongbu.output.type.Suidao;
import net.aetherial.gis.jiaotongbu.output.type.Jianzhicun;
import net.aetherial.gis.surface.ItemValue;
import org.w3c.dom.Node;
import net.aetherial.gis.jiaotongbu.output.type.WptToJTB;
import net.aetherial.gis.dataType.WptType;
import net.aetherial.gis.jiaotongbu.output.tocheck.read.ReadQlToArray;
import java.io.File;
import net.aetherial.gis.jiaotongbu.output.tocheck.type.ReQiaoliang;
import net.aetherial.gis.jiaotongbu.output.tocheck.type.GljQIaoliang;
import net.aetherial.gis.jiaotongbu.output.tocheck.read.ReadGljQiaoliang;
import net.aetherial.gis.jiaotongbu.input.analyse.OpenDirect;
/**
* <p>Title: </p>
*
* <p>Description: </p>
*
* <p>Copyright: Copyright (c) 2004</p>
*
* <p>Company: </p>
*
* @author not attributable
* @version 1.0
*/
public class ScanToData
extends ScanAll {
public ScanToData(FrameOur fo) {
super(fo);
// this.setOnlyOpenXianXiang();
}
public void scanAllFile(String inputPath) {
OpenDirect od = new OpenDirect();
od.setGradeStr("县道|乡道");
this.input = od.getAllGPSFiles(inputPath);
if (this.input != null) {
new ReadQlToArray(inputPath);
for (int i = 0; i < this.input.length; i++) {
this.open(this.input[i]);
this.reRelateWaypointToTrack();
this.getArray();
this.output();
this.setMemoryReset();
}
this.outpath = this.getWithSplash(this.output.getAbsolutePath());
this.scanGLJQiangliang();
this.saveQiaoliang();
// this.saveDukou();
this.saveSuidao();
// this.openQiaoliang();
}
else {
System.out.println("没有发现任何文件!");
try {
Thread.sleep(5000);
}
catch (InterruptedException ex) {
}
}
// System.out.println("out path:" + this.output.getAbsolutePath());
}
protected void getArray() {
this.qiaoliang = null;
this.suidao = null;
this.dukou = null;
Node[] wpts = ItemValue.getWaypoint();
// WptToJTB dk = null;
if (wpts == null) {
return;
}
WptToJTB wtj = null;
for (int i = 0; i < wpts.length; i++) {
if (ItemValue.getWaypointKP(wpts[i]).equals(WptType.W6DuKou)) {
wtj = new Dukou(wpts[i]);
wtj.setValue();
this.dukou = this.addWTJ(wtj, this.dukou);
}
else if (ItemValue.getWaypointKP(wpts[i]).equals(WptType.W3QiaoLiang)) {
wtj = new ReQiaoliang(wpts[i]);
wtj.setValue();
this.qiaoliang = this.addWTJ(wtj, this.qiaoliang);
}
else if (ItemValue.getWaypointKP(wpts[i]).equals(WptType.W4SuiDao)) {
wtj = new Suidao(wpts[i]);
wtj.setValue();
this.suidao = this.addWTJ(wtj, this.suidao);
}
}
}
public void output() {
this.qiaoliang = this.deleteRepeateWTJ(this.qiaoliang);
this.suidao = this.deleteRepeateWTJ(this.suidao);
this.dukou = this.deleteRepeateWTJ(this.dukou);
// this.jianzhicun = this.deleteRepeateWTJ(this.jianzhicun);
// this.scanMinzheng();
// int shunxu = 1;
// if (this.jianzhicun_canFind != null) {
// for (int i = 0; i < this.jianzhicun_canFind.length; i++) {
// try {
// this.njzc = this.njzc + "\"" + (shunxu++) + "\"," +
// ( (Jianzhicun)this.jianzhicun_canFind[i]).getValue() + "\r\n";
// }
// catch (Exception ex2) {
// System.err.println(ex2.getMessage() + " in output() this.jianzhicun_canFind class ScanAll");
// }
// }
// }
//
// if (this.jianzhicun_canNotFind != null) {
// for (int i = 0; i < this.jianzhicun_canNotFind.length; i++) {
// try {
// this.njzc = this.njzc + "\"" + (shunxu++) + "\"," +
// ( (Jianzhicun)this.jianzhicun_canNotFind[i]).getValue() + "\r\n";
// }
// catch (Exception ex2) {
// System.err.println(ex2.getMessage() + " in output() this.jianzhicun_canNotFind class ScanAll");
// }
// }
// }
// if (this.jianzhicun_array != null) {
// for (int i = 0; i < this.jianzhicun_array.length; i++) {
// try {
// this.njzc = this.njzc + "\"" + (shunxu++) + "\"," +
// ( (Jianzhicun)this.jianzhicun_array[i]).getValue() + "\r\n";
// }
// catch (Exception ex2) {
// System.err.println(ex2.getMessage() + " in output() this.jianzhicun_array class ScanAll");
// }
// }
// }
if (this.dukou != null) {
for (int i = 0; i < this.dukou.length; i++) {
try {
this.ndk = this.ndk + ( (Dukou)this.dukou[i]).getValue() + "\r\n";
}
catch (Exception ex2) {
}
}
}
if (this.suidao != null) {
for (int i = 0; i < this.suidao.length; i++) {
try {
this.nsd = this.nsd + ( (Suidao)this.suidao[i]).getValue() + "\r\n";
}
catch (Exception ex1) {
}
}
}
if (this.qiaoliang != null) {
for (int i = 0; i < this.qiaoliang.length; i++) {
try {
this.nql = this.nql +
( (ReQiaoliang)this.qiaoliang[i]).getQiaoliangValue() + "\r\n";
}
catch (Exception ex) {
// System.err.println(ex.getMessage());
// ex.printStackTrace();
}
}
// System.out.println("********" + this.qiaoliang.length);
}
}
private void scanGLJQiangliang() {
ReadGljQiaoliang gljql = new ReadGljQiaoliang(null);
gljql.read();
if (PermanenceBubao.gljQiaoliang.size() == 0) {
System.out.println("没有发现该县区桥梁数据,查找市区桥梁.");
gljql.setShiQu();
gljql.read();
System.out.println("市区桥梁找到:" + PermanenceBubao.gljQiaoliang.size() + "个.");
}
for (int i = 0; i < PermanenceBubao.gljQiaoliang.size(); i++) {
this.nql += (GljQIaoliang) PermanenceBubao.gljQiaoliang.get(i) +
"\r\n";
}
}
protected void saveDukou() {
this.Save(this.outpath + "4_渡口比较信息.txt", this.ndk);
}
protected void saveQiaoliang() {
this.Save(this.outpath + "2_桥梁比较信息.txt", this.nql);
}
protected void saveSuidao() {
this.Save(this.outpath + "3_隧道比较信息.txt", this.nsd);
}
protected void openFile(String file){
try {
Runtime.getRuntime().exec("cmd /c notepad " + file);
}
catch (Exception ex) {
ex.printStackTrace();
}
}
void openQiaoliang(){
if (!this.nql.trim().equals("")) {
this.openFile(this.outpath + "核对_桥梁.txt");
}
}
void openSuidao(){
if (!this.nsd.trim().equals("")) {
this.openFile(this.outpath + "核对_隧道.txt");
}
}
void openDukou(){
if (!this.ndk.trim().equals("")) {
this.openFile(this.outpath + "核对_渡口.txt");
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -