I think we can use 0.0F here instead of NEARLY_ZERO. I see no reason or benefit to using NEARLY_ZERO.
Based on this code, I am assuming pump is not or cannot be run in reverse (target speed never negative). If this is not correct, this function needs to handle negative target speeds.
We appear to need a delay from AC's return to the first alarm check. We have natural times at CPLD, Alarm clear, and the end of the alarm block interval. The alarm block timer currently clears 10 seconds after CPLD; the alarm is clear at a random interval from milliseconds to minutes after CPLD. I have modified the calls for consistent use of CPLD or of isACPowerLost.
What if .data is zero but .ovdata is > 0? Why aren't we using the get function to access the data anymore? Looks like we're still using the get function inside the if to initialize the control.
Looks like we are doing a lot of the dialysate temp control in Gen Dialysate mode. Do we not do any heating in PreGen mode? Even if all dialysate heating is done in this mode, should we consider creating a service controller (like BC controller) to manage this complex temperature control?