Skip to content
Permalink
Browse files

Resume times

Enable Autorunning with resume time past midnight
Resume time check method updated

Update Table to show resume time as status rather than "Ready"
  • Loading branch information...
icklesteve committed Jun 10, 2019
1 parent cf5a057 commit 10a53b145a828d4d6b87974edaff0ee9d2eff2ff
@@ -1096,6 +1096,9 @@ protected void setRestart() {
int minutes = getRestartDelay() % 60;
restartHr = nowHours + hours + ((nowMinutes + minutes) / 60);
restartMin = ((nowMinutes + minutes) % 60);
if (restartHr>23){
restartHr=restartHr-24;
}
}
InstanceManager.getDefault(DispatcherFrame.class).addDelayedTrain(this);
}
@@ -1504,6 +1504,7 @@ protected void addDelayedTrain(ActiveTrain at) {
at.initializeRestartSensor();
}
}
activeTrainsTableModel.fireTableDataChanged();
}

/**
@@ -2249,19 +2250,18 @@ protected void newFastClockMinute() {
}

/**
* This method tests time assuming both times are on the same day (ignoring
* midnight).
* This method tests time
*
* @param hr the hour to test against (0-23)
* @param min the minute to test against (0-59)
* @return true if fast clock time and tested time are in same day
* @return true if fast clock time and tested time are the same
*/
protected boolean isFastClockTimeGE(int hr, int min) {
Calendar now = Calendar.getInstance();
now.setTime(fastClock.getTime());
int nowHours = now.get(Calendar.HOUR_OF_DAY);
int nowMinutes = now.get(Calendar.MINUTE);
return ((nowHours * 60) + nowMinutes) >= ((hr * 60) + min);
return ((nowHours * 60) + nowMinutes) == ((hr * 60) + min);
}

// option access methods

0 comments on commit 10a53b1

Please sign in to comment.
You can’t perform that action at this time.