Skip to content

Commit

Permalink
Fix issue with parsing int with latest firmware on ecos
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-dickerson committed Feb 1, 2016
1 parent 4d636d5 commit fc33d02
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion java/src/jmri/jmrix/ecos/EcosLocoAddressManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -632,8 +632,9 @@ void decodeLocoDetails(EcosLocoAddress tmploco, String line, boolean addToRoster
}
if (line.contains("cv")) {
String cv = EcosReply.getContentDetails(line, "cv");
cv = cv.replaceAll("\\s",""); //remove all white spaces, as 4.1.0 version removed the space after the ,
int cvnum = Integer.parseInt(cv.substring(0, cv.indexOf(",")));
int cvval = Integer.parseInt(cv.substring(cv.indexOf(", ") + 2, cv.length()));
int cvval = Integer.parseInt(cv.substring(cv.indexOf(",") + 1, cv.length()));
tmploco.setCV(cvnum, cvval);
if (cvnum == 8 && processLocoToRosterQueue) {
locoToRoster.processQueue();
Expand Down

0 comments on commit fc33d02

Please sign in to comment.