public void setPower(boolean power) { if (!car.getPhone().getOnCall()) { if (power) { if (currentStation == null) setNextStation(); startDate = new Date(); radioStartTime = System.currentTimeMillis(); } else { makeStationLog(); car.addRadioLog(new RadioLog(user.getUserName(), startDate, radioStartTime)); currentStation = null; startDate = null; radioStartTime = 0; } radioOn = power; } else { if (radioOn) { makeStationLog(); car.addRadioLog(new RadioLog(user.getUserName(), startDate, radioStartTime)); currentStation = null; startDate = null; radioStartTime = 0; } radioOn = false; } }
public void updateLocation() { location = car.getCurrentRoute().getLocation(); }