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

📄 countall.java

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

import net.aetherial.gis.our.FrameOur;
import net.aetherial.gis.our.auto.Auto;
import java.io.File;
import net.aetherial.gis.surface.ItemValue;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
import net.aetherial.gis.surface.CreateFile;

/**
 * <p>Title: </p>
 *
 * <p>Description: </p>
 *
 * <p>Copyright: Copyright (c) 2004</p>
 *
 * <p>Company: </p>
 *
 * @author not attributable
 * @version 1.0
 */
public class CountAll
    extends Auto {
  private String n = "";
  private String error = "";
  private String directory = "";
  private long trksNum = 0, trksPointsNum = 0, wptsNum = 0;
  private double dis = 0.0;
  public CountAll(FrameOur fo) {
    this.setFrameOur(fo);
  }

  public void getAllFile() {
    if (super.input == null) {
      System.out.println("super.input == null");
      return;
    }
    for (int i = 0; i < this.input.length; i++) {
//      if (!(this.input[i].getName().equals("desktop.ini"))) {
      this.open(this.input[i]);
      this.getCount(this.input[i]);
      this.setMemoryReset();
//      }


    }
    this.printN();
    this.createLog();
    this.setMemoryReset();
    this.msg("文件生成在:\n" + directory + "下");
  }

  public void setSavedDirectory(String path) {
    this.directory = path;
  }

  private void printN() {
    this.n = n + "航迹条数,航迹点数,航点个数,里程\r\n";
    this.n = n + trksNum + ","; //航迹条数
    this.n = n + trksPointsNum + ","; //航迹点的数目
    this.n = n + wptsNum + ","; //航点的数目
    this.n = n + ItemValue.getRound(dis / 1000, 3) + "\r\n"; //里程
    System.err.println(this.error);
  }

  public void getCount(File f) {
//    this.n = n +"航迹条数,航迹点数,航点个数,里程\r\n";
    Node[] trks = ItemValue.getTracks();
//    this.n = n  + trks.length + ",";//航迹条数

    NodeList nl = null;
    long count = 0;
    double licheng = 0.0, temp = 0.0;
    if (trks != null) {

      trksNum = trksNum + trks.length;
      for (int i = 0; i < trks.length; i++) {
        nl = trks[i].getChildNodes();
        if (nl != null) {
          count = count + nl.getLength();
        }
      }

      for (int i = 0; i < trks.length; i++) {
        temp = ItemValue.getTracksDistance(trks[i]);
        if (temp > 100000000) {
          error = error + f.getAbsolutePath() + ",里程过长:" + ItemValue.getTracksName(trks[i]) + "里程:" + temp + "\r\n";
          error = error + this.printTrk(trks[i]);
//          System.exit(0);
        }

        licheng = licheng + temp;
      }
    }
    this.trksPointsNum = this.trksPointsNum + count;
    this.dis = this.dis + licheng;
//    this.n = n  + count + ",";//航迹点的数目
    Node[] wpts = ItemValue.getWaypoint();
//    this.n = n + wpts.length + ",";//航点的数目
    if (wpts != null) {
      this.wptsNum = wptsNum + wpts.length;
    }

//    this.n = n + ItemValue.getRound(licheng/1000,3) + "\r\n";//里程
  }
  private String printTrk(Node trk){
    String ntemp = "";
    NodeList nl = ItemValue.getTracksPoint(trk);
    for (int i = 0; i < nl.getLength(); i++) {
      ntemp = ntemp + ItemValue.getTracksPointX(nl.item(i)) + "," + ItemValue.getTracksPointY(nl.item(i)) + "," + ItemValue.getTracksPointZ(nl.item(i)) + "\r\n";
    }
    return ntemp;
  }
  private void createLog() {
    CreateFile cf = new CreateFile(new File(directory + "统计.txt"));
    cf.setEncode("GB2312");
    cf.memoryToFile(this.n);
  }
}

⌨️ 快捷键说明

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