fallbackExerciseMode function
- GeneratorDetails details
Returns the fallback exercise mode for the device represented by the given generator details.
Implementation
ExerciseMode fallbackExerciseMode(GeneratorDetails details) {
if (supportsEcoCycleMode(details.modelNumber)) {
// Newer generators should fallback to eco cycle
return ExerciseMode.ecoCycle;
}
if (supportsUnloadedExerciseModes(details.modelNumber)) {
return ExerciseMode.unloaded;
}
/// Models which don't support unloaded exercises, such as VSG models,
/// should fallback to loaded full speed exercises, as this is
/// the only supported exercise mode.
return ExerciseMode.loadedFullSpeed;
}