⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nianbaotogps.java

📁 基于Java的地图数据管理软件。使用MySQL数据库管理系统。
💻 JAVA
字号:
package net.aetherial.gis.jiaotongbu.input.analyse;

import net.aetherial.gis.jiaotongbu.input.analyse.OpenDirect;
import java.io.File;
import net.aetherial.gis.jiaotongbu.input.jxl.ReadQiaoliang;
import net.aetherial.gis.surface.ItemValue;
import net.aetherial.gis.our.FrameOur;
import net.aetherial.gis.surface.CreateFile;
import java.util.Vector;
import net.aetherial.gis.jiaotongbu.input.type.Luduan;
import net.aetherial.gis.jiaotongbu.input.type.Qiaoliang;
import org.w3c.dom.Node;
import net.aetherial.gis.dataType.WptType;
import java.text.DecimalFormat;
import net.aetherial.gis.jiaotongbu.input.publicuse.Permanence;
import net.aetherial.gis.cutAndLink.zhuanghao.Zhuanghao;
import net.aetherial.gis.cutAndLink.zhuanghao.CreateZhuanghao;
import net.aetherial.gis.jiaotongbu.input.publicuse.QiaoliangToGPS;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2004</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class NianbaoToGPS {
  Qiaoliang[] qls = null;
  Node hebingTrack = null;
  private AnalyseKuaxian analyse = null;
  public NianbaoToGPS() {

  }

//  private void readRefKuaXian() {
//    for (int i = 0; i < Permanence.kuaxian_lx.size(); i++) {
//
//    }
//  }

  public void addAll() {
    for (int i = 0; i < this.qls.length; i++) {
      this.createQiaoliang(this.qls[i]);
    }
  }

  private double getValidateWeizhi(Qiaoliang ql) {
    double zhuanghao;
    try {
      zhuanghao = Double.parseDouble(ql.getZhuanghao().trim());
    }
    catch (NumberFormatException ex) {
      zhuanghao = 0;
    }
//    是否跨县

    double weizhi = analyse.getCurrentWeizhi(zhuanghao);
    return weizhi;
  }

  private void createQiaoliang(Qiaoliang ql) {
    Zhuanghao zh = new Zhuanghao();
    CreateZhuanghao create = null;

    double enterData = getValidateWeizhi(ql);
    try {
      zh.setData(enterData);
      zh.setZhuanghaoName("");
    }
    catch (NumberFormatException ex) {
      return;
    }
    try {
      create = new CreateZhuanghao(zh, this.hebingTrack);
    }
    catch (Exception ex1) {
      System.out.println("[插入错误]\t年报桥梁:" + ql.getName() + "不能添加,原因为:" +
                         ex1.getMessage());
      Permanence.addLog("[插入错误]\t年报桥梁:" + ql.getName() + "不能添加,原因为:" +
                        ex1.getMessage() + "");
      ql.setBeizhu("桩号" + ex1.getMessage());
//      this.createErrorQiaoliang(ql);
      return;
    }
    Node ql_wpt = create.getZhuanghaoWaypoint();
    if (ql_wpt != null) {
      ItemValue.setWaypointKP(ql_wpt,WptType.W3QiaoLiang);
      QiaoliangToGPS.setWaypointQiaoliangValue(ql_wpt, ql);
      System.out.println("[添加成功]\t年报桥梁:" + ql.getName() + "添加成功!");
      Permanence.addLog("[添加成功]\t年报桥梁:" + ql.getName() + "添加成功!");
      Permanence.heduidata_QL.removeElement(ql);
    }
  }

  private void createErrorQiaoliang(Qiaoliang ql){
    Zhuanghao zh = new Zhuanghao();
    CreateZhuanghao create = null;

    try {
      zh.setData(0);
      zh.setZhuanghaoName("");
    }
    catch (NumberFormatException ex) {
      return;
    }
    try {
      create = new CreateZhuanghao(zh, this.hebingTrack);
    }
    catch (Exception ex1) {
      System.out.println("[插入错误]\t年报桥梁:" + ql.getName() + "不能添加,原因为:" +
                         ex1.getMessage());
      Permanence.addLog("[插入错误]\t年报桥梁:" + ql.getName() + "不能添加,原因为:" +
                        ex1.getMessage());
      return;
    }
    Node ql_wpt = create.getZhuanghaoWaypoint();
    if (ql_wpt != null) {
      ItemValue.setWaypointKP(ql_wpt,WptType.W3QiaoLiang);
      ItemValue.setWaypointX(ql_wpt,"0");
      ItemValue.setWaypointY(ql_wpt,"0");
      ItemValue.setWaypointZ(ql_wpt,"0");
      QiaoliangToGPS.setWaypointQiaoliangValue(ql_wpt, ql);
      System.out.println("[添加成功]\t年报桥梁:" + ql.getName() + "添加成功!");
      Permanence.addLog("[添加成功]\t年报桥梁:" + ql.getName() + "添加成功!");
      Permanence.heduidata_QL.removeElement(ql);
    }

  }


  public void setQls(Qiaoliang[] qls) {
    this.qls = qls;
  }

  public void setHebingTrack(Node hebingTrack) {
    this.hebingTrack = hebingTrack;
  }

  public void setAnalyse(AnalyseKuaxian analyse) {
    this.analyse = analyse;
  }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -