klippy: Store printer startup parameters in new "start_args" dictionary

Store pertinent information from the software startup in a dictionary
that the various printer components can access instead of in
individual variables in the Printer() class.  This makes it easier to
add future command-line options.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-08-21 17:19:43 -04:00
parent b80c488d36
commit 268834e4ae
6 changed files with 64 additions and 71 deletions

View file

@ -112,8 +112,8 @@ class PrinterHeater:
self.min_extrude_temp = config.getfloat(
'min_extrude_temp', 170., minval=self.min_temp, maxval=self.max_temp)
self.max_power = config.getfloat('max_power', 1., above=0., maxval=1.)
self.can_extrude = (self.min_extrude_temp <= 0.
or printer.mcu.is_fileoutput())
is_fileoutput = printer.get_start_args().get('debugoutput') is not None
self.can_extrude = self.min_extrude_temp <= 0. or is_fileoutput
self.lock = threading.Lock()
self.last_temp = 0.
self.last_temp_time = 0.