def test_run_big_input_parallel_x4(self):
        self._write_big_input_gcode_file()
        target_device_one = MockReprapDevice(command_delay=0)
        target_device_two = MockReprapDevice(command_delay=0)
        target_device_three = MockReprapDevice(command_delay=0)
        target_device_four = MockReprapDevice(command_delay=0)

        rep_print_task_one = ReprapPrintTask(target=target_device_one,
                                             file_name=self._gcode_input_file)
        rep_print_task_two = ReprapPrintTask(target=target_device_two,
                                             file_name=self._gcode_input_file)
        rep_print_task_three = ReprapPrintTask(
            target=target_device_three, file_name=self._gcode_input_file)
        rep_print_task_four = ReprapPrintTask(target=target_device_four,
                                              file_name=self._gcode_input_file)

        d1 = rep_print_task_one.start()
        d2 = rep_print_task_two.start()
        d3 = rep_print_task_three.start()
        d4 = rep_print_task_four.start()
        yield defer.DeferredList([d1, d2, d3, d4])

        exp_progress = 100.0
        obs_progress = rep_print_task_one.status.progress
        self.assertEquals(obs_progress, exp_progress)

        obs_progress = rep_print_task_two.status.progress
        self.assertEquals(obs_progress, exp_progress)

        obs_progress = rep_print_task_three.status.progress
        self.assertEquals(obs_progress, exp_progress)

        obs_progress = rep_print_task_four.status.progress
        self.assertEquals(obs_progress, exp_progress)
Ejemplo n.º 2
0
 def test_stop(self):
     target_device = MockReprapDevice(command_delay=10)
     rep_print_task = ReprapPrintTask(target=target_device,
                                      file_name=self._gcode_input_file)
     deferred = rep_print_task.start()
     rep_print_task.stop()
     self.assertFalse(rep_print_task.status.is_started)
Ejemplo n.º 3
0
 def test_command_delay(self):
     target_device = MockReprapDevice(command_delay=4)
     rep_print_task = ReprapPrintTask(target=target_device, file_name=self._gcode_input_file)
     yield rep_print_task.start()
     exp_progress = 100.0
     obs_progress = rep_print_task.status.progress
     self.assertEquals(obs_progress,exp_progress)
Ejemplo n.º 4
0
 def test_run_simple(self):
     target_device = MockReprapDevice()
     rep_print_task = ReprapPrintTask(target=target_device,
                                      file_name=self._gcode_input_file)
     yield rep_print_task.start()
     exp_progress = 100.0
     obs_progress = rep_print_task.status.progress
     self.assertEquals(obs_progress, exp_progress)
 def test_run_big_input(self):
     self._write_big_input_gcode_file()
     target_device = MockReprapDevice(command_delay=0)
     rep_print_task = ReprapPrintTask(target=target_device,
                                      file_name=self._gcode_input_file)
     yield rep_print_task.start()
     exp_progress = 100.0
     obs_progress = rep_print_task.status.progress
     self.assertEquals(obs_progress, exp_progress)
Ejemplo n.º 6
0
    def test_pause_at_start(self):
        target_device = MockReprapDevice(command_delay=2)
        rep_print_task = ReprapPrintTask(target=target_device, file_name=self._gcode_input_file)

        deferred = rep_print_task.start()
        rep_print_task.pause()
        self.assertTrue(rep_print_task.status.is_paused)
        self.assertEquals(rep_print_task.curent_line, None)
        rep_print_task.stop()
        return deferred
Ejemplo n.º 7
0
    def test_pause_at_start(self):
        target_device = MockReprapDevice(command_delay=2)
        rep_print_task = ReprapPrintTask(target=target_device,
                                         file_name=self._gcode_input_file)

        deferred = rep_print_task.start()
        rep_print_task.pause()
        self.assertTrue(rep_print_task.status.is_paused)
        self.assertEquals(rep_print_task.curent_line, None)
        rep_print_task.stop()
        return deferred
Ejemplo n.º 8
0
    def test_pause_simple(self):
        target_device = MockReprapDevice(command_delay=2)
        rep_print_task = ReprapPrintTask(target=target_device, file_name=self._gcode_input_file)

        def pause_and_check():
            rep_print_task.pause()
            self.assertTrue(rep_print_task.status.is_paused)
            self.assertEquals(rep_print_task.curent_line, "G1 X0.25 Y105\n")
            rep_print_task.stop()

        def_1 = deferLater(reactor, 2.1, pause_and_check)
        def_2 = rep_print_task.start()
        return  defer.DeferredList([def_1, def_2])
Ejemplo n.º 9
0
    def test_pause_simple(self):
        target_device = MockReprapDevice(command_delay=2)
        rep_print_task = ReprapPrintTask(target=target_device,
                                         file_name=self._gcode_input_file)

        def pause_and_check():
            rep_print_task.pause()
            self.assertTrue(rep_print_task.status.is_paused)
            self.assertEquals(rep_print_task.curent_line, "G1 X0.25 Y105\n")
            rep_print_task.stop()

        def_1 = deferLater(reactor, 2.1, pause_and_check)
        def_2 = rep_print_task.start()
        return defer.DeferredList([def_1, def_2])
    def test_run_big_input_parallel_x8(self):
        self._write_big_input_gcode_file()
        parrallel_prints = 8
        rep_print_tasks = []
        deffereds = []
        for i in range(parrallel_prints):
            device = MockReprapDevice(command_delay=0)
            task = ReprapPrintTask(target=device,
                                   file_name=self._gcode_input_file)
            rep_print_tasks.append(task)
            deffereds.append(task.start())

        yield defer.DeferredList(deffereds)

        exp_progress = 100.0
        for i in range(parrallel_prints):
            task = rep_print_tasks[i]
            obs_progress = task.status.progress
            self.assertEquals(obs_progress, exp_progress)
Ejemplo n.º 11
0
 def test_run_simple_bad_gcode_file(self):
     target_device = MockReprapDevice()
     rep_print_task = ReprapPrintTask(target=target_device, file_name="")
     deferred = rep_print_task.start()
     return self.assertFailure(deferred, InvalidFile)
Ejemplo n.º 12
0
 def test_stop(self):
     target_device = MockReprapDevice(command_delay=10)
     rep_print_task = ReprapPrintTask(target=target_device, file_name=self._gcode_input_file)
     deferred = rep_print_task.start()
     rep_print_task.stop()
     self.assertFalse(rep_print_task.status.is_started)
Ejemplo n.º 13
0
 def test_run_simple_bad_gcode_file(self):
     target_device = MockReprapDevice()
     rep_print_task = ReprapPrintTask(target=target_device, file_name="")
     deferred = rep_print_task.start()
     return self.assertFailure(deferred, InvalidFile)