// [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; }
private void setGroupID(String v) { this.setFieldValue(FLD_groupID, StringTools.trim(v)); }
public String getGroupID() { String v = (String) this.getFieldValue(FLD_groupID); return StringTools.trim(v); }
public void setIconName(String v) { this.setFieldValue(FLD_iconName, StringTools.trim(v)); }
public String getIconName() { String v = (String) this.getFieldValue(FLD_iconName); return StringTools.trim(v); }
public void setIconSelector(String v) { this.setFieldValue(FLD_iconSelector, StringTools.trim(v)); }
public String getIconSelector() { String v = (String) this.getFieldValue(FLD_iconSelector); return StringTools.trim(v); }
public void setStatusName(String v) { this.setFieldValue(FLD_statusName, StringTools.trim(v)); }
public String getStatusName() { String v = (String) this.getFieldValue(FLD_statusName); return StringTools.trim(v); }
private void setAclID(String v) { this.setFieldValue(FLD_aclID, StringTools.trim(v)); }
public String getAclID() { String v = (String) this.getFieldValue(FLD_aclID); return StringTools.trim(v); }