diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-01-19 22:22:17 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-01-28 12:19:26 -0500 |
commit | 81013ba5c8638dd42932bd893e1b3115b1b98041 (patch) | |
tree | 3e0d60c2d084f808f2788a4645579093abdc8739 /klippy/heater.py | |
parent | f0a754e496ca989bc355555e2c798c362299abc3 (diff) | |
download | kutter-81013ba5c8638dd42932bd893e1b3115b1b98041.tar.gz kutter-81013ba5c8638dd42932bd893e1b3115b1b98041.tar.xz kutter-81013ba5c8638dd42932bd893e1b3115b1b98041.zip |
klippy: Add access methods and avoid peeking into the printer classes
Add get_reactor(), lookup_object(), lookup_module_objects(), and
set_rollover_info() to the main Printer class so that callers do not
need to peek into the class' members. Similarly, add get_printer()
and get_name() methods to the ConfigWrapper class.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/heater.py')
-rw-r--r-- | klippy/heater.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/klippy/heater.py b/klippy/heater.py index e3bbe78e..8dff7dbc 100644 --- a/klippy/heater.py +++ b/klippy/heater.py @@ -1,6 +1,6 @@ # Printer heater support # -# Copyright (C) 2016,2017 Kevin O'Connor <kevin@koconnor.net> +# Copyright (C) 2016-2018 Kevin O'Connor <kevin@koconnor.net> # # This file may be distributed under the terms of the GNU GPLv3 license. import math, logging, threading @@ -106,7 +106,7 @@ class PrinterHeater: error = error def __init__(self, printer, config): self.printer = printer - self.name = config.section + self.name = config.get_name() sensor_params = config.getchoice('sensor_type', Sensors) self.sensor = sensor_params['class'](config, sensor_params) self.min_temp = config.getfloat('min_temp', minval=0.) @@ -326,7 +326,7 @@ class ControlAutoTune: midpoint_pos = sorted(cycle_times)[len(cycle_times)/2][1] Kp, Ki, Kd = self.calc_pid(midpoint_pos) logging.info("Autotune: final: Kp=%f Ki=%f Kd=%f", Kp, Ki, Kd) - gcode = self.heater.printer.objects['gcode'] + gcode = self.heater.printer.lookup_object('gcode') gcode.respond_info( "PID parameters: pid_Kp=%.3f pid_Ki=%.3f pid_Kd=%.3f\n" "To use these parameters, update the printer config file with\n" |