Changeset 471 in tmcsimulator for trunk/src/tmcsim
- Timestamp:
- 07/29/2019 01:36:40 PM (7 years ago)
- Location:
- trunk/src/tmcsim
- Files:
-
- 2 edited
-
application.properties (modified) (1 diff)
-
cadsimulator/Coordinator.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/tmcsim/application.properties
r469 r471 1 # Sat, 27 Jul 2019 22:04:01-07001 #Mon, 29 Jul 2019 14:47:09 -0700 2 2 3 Application.revision=4 673 Application.revision=470 4 4 5 Application.buildnumber=17 65 Application.buildnumber=177 -
trunk/src/tmcsim/cadsimulator/Coordinator.java
r466 r471 837 837 public int compare(String o1, String o2) 838 838 { 839 return extractInt(o1) - extractInt(o2); 839 // extract just the timestamp from the strings and convert them to int 840 // fixes #181 841 return extractInt(o1.substring(0,8)) - extractInt(o2.substring(0,8)); 840 842 } 841 843 // extract an integer from a String … … 843 845 { // remove all non-digits 844 846 String num = s.replaceAll("\\D", ""); 845 // return 0 if no digits found, else return the number 846 return num.isEmpty() ? 0 : Integer.parseInt(num); 847 try 848 { 849 // return 0 if no digits found, else return the number 850 return num.isEmpty() ? 0 : Integer.parseInt(num); 851 } catch (NumberFormatException ex) 852 { 853 System.out.println("Can't convert "+s+" to integer in writeToCAD. " + 854 ex.getMessage()); 855 return 0; 856 } 847 857 } 848 858 });
Note: See TracChangeset
for help on using the changeset viewer.
