/** {@inheritDoc} */ @Override public String getFormattedResult() { return String.format("%.2f%s", maf, getResultUnit()); }
/** {@inheritDoc} */ @Override public String getFormattedResult() { return String.format("%d%s", rpm, getResultUnit()); }
private void updateTripStatistic(final ObdCommandJob job, final String cmdID) { if (currentTrip != null) { if (cmdID.equals(AvailableCommandNames.SPEED.toString())) { SpeedCommand command = (SpeedCommand) job.getCommand(); currentTrip.setSpeedMax(command.getMetricSpeed()); } else if (cmdID.equals(AvailableCommandNames.ENGINE_RPM.toString())) { RPMCommand command = (RPMCommand) job.getCommand(); currentTrip.setEngineRpmMax(command.getRPM()); } else if (cmdID.endsWith(AvailableCommandNames.ENGINE_RUNTIME.toString())) { RuntimeCommand command = (RuntimeCommand) job.getCommand(); currentTrip.setEngineRuntime(command.getFormattedResult()); } } }
cmds.add(new LoadCommand()); cmds.add(new RPMCommand()); cmds.add(new RuntimeCommand()); cmds.add(new MassAirFlowCommand()); cmds.add(new ThrottlePositionCommand()); cmds.add(new AirFuelRatioCommand()); cmds.add(new WidebandAirFuelRatioCommand()); cmds.add(new OilTempCommand());