コード例 #1
0
 def test_parse_m104(self):
     gcode_parser = GCodeParser()
     gcode_line = "M104 S150"
     command = gcode_parser.parse(gcode_line)
     self.assertEquals(
         command,
         SetVariableTarget(variable="temperature", target_value=150.0))
コード例 #2
0
 def test_parse_m103(self):
     gcode_parser = GCodeParser()
     gcode_line = "M103"
     command = gcode_parser.parse(gcode_line)
     self.assertEquals(
         command,
         EnableDisableComponents(component_category="actuator",
                                 component_type="extruder",
                                 component_on=False))
コード例 #3
0
 def test_parse_m17(self):
     gcode_parser = GCodeParser()
     gcode_line = "M17"
     command = gcode_parser.parse(gcode_line)
     self.assertEquals(
         command,
         EnableDisableComponents(component_category="actuator",
                                 component_type="stepper",
                                 component_on=True))
コード例 #4
0
    def __init__(self, parent=None, name="Print Task", description="A Print task, for repraps & co", target=None, file_name=None, file_type="gcode"):
        Task.__init__(self, parent, name, description, target)
        self.file_type = file_type
        self.print_file_name = file_name
        self.print_file_path = file_name
        self.print_file = None

        self.line = ""
        self.line_index = 0
        self.line_count = -1
        self.curent_line = None
        self.file_parser = None
        self.start_time = 0

        if file_type == "gcode":
            self.file_parser = GCodeParser()
        self.deferred = None
        self.current_loop_deferred = None
        self._is_processing = True
コード例 #5
0
 def test_position_gcode(self):
     gcode_parser = GCodeParser()
     gcode_line = "G0 X1"
     command = gcode_parser.parse(gcode_line)
     self.assertEquals(command, "")