autotune-core.js 734 B

1234567891011121314151617181920212223
  1. var console = {
  2. log: function(...args) { _consoleLog(args); },
  3. error: function(...args) { _consoleLog(args); }
  4. };
  5. function generate(prepped_glucose_data,previous_autotune_data,pumpprofile_data){
  6. if (!pumpprofile_data.useCustomPeakTime) {
  7. previous_autotune_data.dia = pumpprofile_data.dia;
  8. previous_autotune_data.insulinPeakTime = pumpprofile_data.insulinPeakTime;
  9. }
  10. // Always keep the curve value up to date with what's in the user preferences
  11. previous_autotune_data.curve = pumpprofile_data.curve;
  12. inputs = {
  13. preppedGlucose: prepped_glucose_data
  14. , previousAutotune: previous_autotune_data
  15. , pumpProfile: pumpprofile_data
  16. };
  17. return freeaps_autotuneCore(inputs);
  18. }