diff options
author | David Crocker <dcrocker@eschertech.com> | 2020-11-10 17:08:49 +0300 |
---|---|---|
committer | David Crocker <dcrocker@eschertech.com> | 2020-11-10 17:08:49 +0300 |
commit | 3648af1fb778a6e553ae75d579873121978214d0 (patch) | |
tree | 6515e16e71c75ad42cc8c1eb176a0cf39979d531 /src/Heating | |
parent | 77d8cf2f9c02b91a0518f3a469f932d2c0be6874 (diff) |
Corrected display of tuning phase
Diffstat (limited to 'src/Heating')
-rw-r--r-- | src/Heating/LocalHeater.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Heating/LocalHeater.cpp b/src/Heating/LocalHeater.cpp index 81e29a2a..71934e94 100644 --- a/src/Heating/LocalHeater.cpp +++ b/src/Heating/LocalHeater.cpp @@ -576,10 +576,13 @@ void LocalHeater::GetAutoTuneStatus(const StringRef& reply) const noexcept { if (mode >= HeaterMode::tuning0) { - reply.printf("Heater %u is being tuned, phase %u of %u", - GetHeaterNumber(), - (unsigned int)mode - (unsigned int)HeaterMode::tuning0 + 1, - (unsigned int)HeaterMode::lastTuningMode - (unsigned int)HeaterMode::tuning0 + 1); + // Phases are: 1 = stabilising, 2 = heating, 3 = settling, 4 = cycling with fan off, 5 = cycling with fan on + const unsigned int numPhases = (tuningFans.IsEmpty()) ? 5 : 4; + const unsigned int currentPhase = (mode < HeaterMode::tuning2) ? (unsigned int)mode - (unsigned int)HeaterMode::tuning0 + 1 + : (!collecting) ? 3 + : (fanOn) ? 5 + : 4; + reply.printf("Heater %u is being tuned, phase %u of %u", GetHeaterNumber(), currentPhase, numPhases); } else if (tuned) { |