Skip to content

Commit

Permalink
RPM info in torque curve.
Browse files Browse the repository at this point in the history
  • Loading branch information
albertus82 committed Sep 25, 2014
1 parent dccac8c commit 9ca5095
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/it/albertus/cycles/engine/CyclesMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,10 @@ private void writeDefaultBikesCfg() throws Exception {
properties.append( "# " ).append( Torque.class.getSimpleName() ).append( " #" );
properties.append( lineSeparator );
for ( int index = 0; index < bike.getTorque().getCurve().length; index++ ) {
if ( index > 0 && index % 10 == 0 ) {
properties.append( "# " + Torque.getRpm( index ) + " RPM");
properties.append( lineSeparator );
}
properties.append( prefix ).append( '.' ).append( Introspector.decapitalize( Torque.class.getSimpleName() ) ).append( '.' ).append( index );
properties.append( '=' );
properties.append( bike.getTorque().getCurve()[ index ] );
Expand Down
4 changes: 4 additions & 0 deletions src/it/albertus/cycles/model/Torque.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,8 @@ public short[] getCurve() {
return curve;
}

public static int getRpm( int index ) {
return 700 + 130 * index;
}

}

0 comments on commit 9ca5095

Please sign in to comment.