Esempio n. 1
0
  // [System][Manufacturer][SubSystem][Problem] eg. "P0071" Powertrain
  // References:
  //   http://www.obd-codes.com/trouble_codes/
  //   http://obdcon.sourceforge.net/2010/06/obd-ii-pids/
  public static long EncodeFault_OBDII(String dtcStr) {
    long faultCode = TYPE_OBDII;

    /* trim */
    dtcStr = StringTools.trim(dtcStr);
    if (dtcStr.indexOf(",") >= 0) {
      dtcStr = dtcStr.substring(0, dtcStr.indexOf(",")).trim();
    }
    if (dtcStr.equals("")) {
      return faultCode;
    }

    /* check length */
    if (dtcStr.length() == 4) {
      dtcStr = "U" + dtcStr; // unknown
    } else if (dtcStr.length() != 5) {
      return faultCode;
    }

    /* active */
    faultCode |= EncodeActive(true); // [ACTIVE_MASK]    0x0100000000000000

    /* encode system cjaracter (ie. "Powertrain") */
    faultCode |= EncodeSystem(dtcStr.charAt(0)); // [MID_MASK]       0x00FFFFFF00000000

    /* encode manufacturer specific and subsystem */
    int mfgCode = StringTools.parseInt(dtcStr.substring(1, 2), 0);
    int spid = (mfgCode != 0) ? 0x8000 : 0;
    int subSys = StringTools.parseInt(dtcStr.substring(2, 5), 0);
    spid |= (subSys & 0xFFF);
    faultCode |= EncodeSPID(spid); // [SPID_MASK]      0x00000000FFFF0000

    /* return fault code */
    return faultCode;
  }
Esempio n. 2
0
 private void setGroupID(String v) {
   this.setFieldValue(FLD_groupID, StringTools.trim(v));
 }
Esempio n. 3
0
 public String getGroupID() {
   String v = (String) this.getFieldValue(FLD_groupID);
   return StringTools.trim(v);
 }
Esempio n. 4
0
 public void setIconName(String v) {
   this.setFieldValue(FLD_iconName, StringTools.trim(v));
 }
Esempio n. 5
0
 public String getIconName() {
   String v = (String) this.getFieldValue(FLD_iconName);
   return StringTools.trim(v);
 }
Esempio n. 6
0
 public void setIconSelector(String v) {
   this.setFieldValue(FLD_iconSelector, StringTools.trim(v));
 }
Esempio n. 7
0
 public String getIconSelector() {
   String v = (String) this.getFieldValue(FLD_iconSelector);
   return StringTools.trim(v);
 }
Esempio n. 8
0
 public void setStatusName(String v) {
   this.setFieldValue(FLD_statusName, StringTools.trim(v));
 }
Esempio n. 9
0
 public String getStatusName() {
   String v = (String) this.getFieldValue(FLD_statusName);
   return StringTools.trim(v);
 }
Esempio n. 10
0
 private void setAclID(String v) {
   this.setFieldValue(FLD_aclID, StringTools.trim(v));
 }
Esempio n. 11
0
 public String getAclID() {
   String v = (String) this.getFieldValue(FLD_aclID);
   return StringTools.trim(v);
 }