Ejemplo n.º 1
0
  public void writePersistence() {
    StringBuffer sb = new StringBuffer();
    if (!m_minSWVersion.equalsIgnoreCase("0.0")) {
      sb.append("ReqSWVersion " + m_minSWVersion + NL);
    }
    sb.append("Steps/rev " + m_stepsPerRev + NL);
    if (m_indexDirection != 0) {
      sb.append("IndexDirection " + m_indexDirection + NL);
    }
    if (m_indexDistance != 0) {
      sb.append("IndexDistance " + m_indexDistance + NL);
    }
    sb.append("Limit " + m_minLimit + " " + m_maxLimit + NL);
    sb.append("Backlash " + getBacklash() + NL);

    if (!Double.isNaN(m_minBacklash)) {
      sb.append("BacklashLimits " + (int) m_minBacklash);
      if (!Double.isNaN(m_maxBacklash)) {
        sb.append(" " + (int) m_maxBacklash);
      }
      sb.append(NL);
    }

    sb.append("Odom " + m_odometerCW + " " + m_odometerCCW + NL);
    if (m_minCalStep != 0) {
      sb.append("MinCalStep " + m_minCalStep + NL);
    }

    String path = getPersistenceFilePath(false);
    TuneUtilities.writeFile(path, sb.toString());
  }