mcu: Rename output_file_mode variable to is_fileoutput

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2016-11-23 16:18:08 -05:00
parent 72c4f353e6
commit ceb60ffcc6
2 changed files with 6 additions and 4 deletions

View File

@ -51,7 +51,7 @@ class PrinterHeater:
control_algo = self.config.get('control', 'watermark') control_algo = self.config.get('control', 'watermark')
algos = {'watermark': ControlBangBang, 'pid': ControlPID} algos = {'watermark': ControlBangBang, 'pid': ControlPID}
self.control = algos[control_algo](self, self.config) self.control = algos[control_algo](self, self.config)
if self.printer.mcu.output_file_mode: if self.printer.mcu.is_fileoutput():
self.can_extrude = True self.can_extrude = True
def set_pwm(self, read_time, value): def set_pwm(self, read_time, value):
if value: if value:

View File

@ -149,7 +149,7 @@ class MCU_endstop:
self._last_state = params self._last_state = params
def check_busy(self, eventtime): def check_busy(self, eventtime):
# Check if need to send an end_stop_query command # Check if need to send an end_stop_query command
if self._mcu.output_file_mode: if self._mcu.is_fileoutput():
return False return False
last_sent_time = self._last_state.get('#sent_time', -1.) last_sent_time = self._last_state.get('#sent_time', -1.)
if last_sent_time >= self._min_query_time: if last_sent_time >= self._min_query_time:
@ -302,7 +302,7 @@ class MCU:
serialport = config.get('serial', '/dev/ttyS0') serialport = config.get('serial', '/dev/ttyS0')
self.serial = serialhdl.SerialReader(printer.reactor, serialport, baud) self.serial = serialhdl.SerialReader(printer.reactor, serialport, baud)
self.is_shutdown = False self.is_shutdown = False
self.output_file_mode = False self._is_fileoutput = False
# Config building # Config building
self._emergency_stop_cmd = None self._emergency_stop_cmd = None
self._num_oids = 0 self._num_oids = 0
@ -355,7 +355,7 @@ class MCU:
self.register_msg(self.handle_shutdown, 'is_shutdown') self.register_msg(self.handle_shutdown, 'is_shutdown')
self.register_msg(self.handle_mcu_stats, 'stats') self.register_msg(self.handle_mcu_stats, 'stats')
def connect_file(self, debugoutput, dictionary, pace=False): def connect_file(self, debugoutput, dictionary, pace=False):
self.output_file_mode = True self._is_fileoutput = True
self.serial.connect_file(debugoutput, dictionary) self.serial.connect_file(debugoutput, dictionary)
self._mcu_freq = float(self.serial.msgparser.config['CLOCK_FREQ']) self._mcu_freq = float(self.serial.msgparser.config['CLOCK_FREQ'])
def dummy_send_config(): def dummy_send_config():
@ -386,6 +386,8 @@ class MCU:
return stats return stats
def force_shutdown(self): def force_shutdown(self):
self.send(self._emergency_stop_cmd.encode()) self.send(self._emergency_stop_cmd.encode())
def is_fileoutput(self):
return self._is_fileoutput
# Configuration phase # Configuration phase
def _add_custom(self): def _add_custom(self):
data = self._config.get('custom', '') data = self._config.get('custom', '')