Exemplo n.º 1
0
 def setUp(self):
     self.Settings = OctolapseSettings(NamedTemporaryFile().name)
     self.Settings.current_printer().auto_detect_position = False
     self.Settings.current_printer().origin_x = 0
     self.Settings.current_printer().origin_y = 0
     self.Settings.current_printer().origin_z = 0
     self.OctoprintPrinterProfile = self.create_octoprint_printer_profile()
Exemplo n.º 2
0
def migrate_pre_0_3_3_rc3_dev(current_version, settings_dict, log_file_path,
                              default_settings_path):
    # versions prior to or equal to 0.3.3rc3.dev0 need to have the snapshot profiles reset to the defaults

    # get the default settings
    new_settings = OctolapseSettings(
        log_file_path, get_default_settings(default_settings_path),
        current_version)

    # remove the existing renderings
    settings_dict["snapshots"] = []

    for key, snapshot in new_settings.snapshots.items():
        settings_dict["snapshots"].append(snapshot.to_dict())

    # set the default snapshot profile guid so that it is selected by default
    settings_dict[
        "current_snapshot_profile_guid"] = new_settings.current_snapshot_profile_guid

    # migrate the camera settings so that if there is no enabled column
    if (len(settings_dict["cameras"]) > 0
            and "enabled" not in settings_dict["cameras"][0]):
        # we need to migrate the cameras and enable only the current camera
        for camera in settings_dict["cameras"]:
            if camera["guid"] == settings_dict["current_camera_profile_guid"]:
                camera["enabled"] = True
            else:
                camera["enabled"] = False

    # update the version
    settings_dict["version"] = current_version
    # return the dict
    return settings_dict
Exemplo n.º 3
0
 def setUp(self):
     self.Settings = OctolapseSettings(NamedTemporaryFile().name)
     self.OctoprintPrinterProfile = self.create_octoprint_printer_profile()
     printer = get_printer_profile()
     self.Settings.printers.update({printer["guid"]: Printer(printer=printer)})
     self.Settings.profiles.current_printer_profile_guid = printer["guid"]
     self.Extruder = Extruder(self.Settings)
     self.Position = Position(self.Settings, self.OctoprintPrinterProfile, False)
Exemplo n.º 4
0
 def setUp(self):
     self.Settings = OctolapseSettings(NamedTemporaryFile().name)
     self.Settings.current_printer().e_axis_default_mode = 'relative'
     self.Settings.current_printer().xyz_axes_default_mode = 'absolute'
     self.Settings.current_printer().auto_detect_position = False
     self.Settings.current_printer().origin_x = 0
     self.Settings.current_printer().origin_y = 0
     self.Settings.current_printer().origin_z = 0
     self.OctoprintPrinterProfile = self.create_octoprint_printer_profile()
Exemplo n.º 5
0
    def setUp(self):
        self.Commands = Commands()
        self.Settings = OctolapseSettings(NamedTemporaryFile().name)
        # in the general test case we want auto_detect_position to be false
        # else we'll have to simulate a position update (m114 return) after
        # a home (g28) command
        self.Settings.current_printer().auto_detect_position = False
        # since we've set auto_detect_position to false, we need to set
        # an origin, else X,Y and Z will still be None after a home command
        self.Settings.current_printer().origin_x = 0
        self.Settings.current_printer().origin_y = 0
        self.Settings.current_printer().origin_z = 0

        self.OctoprintPrinterProfile = self.create_octolapse_printer_profile()
Exemplo n.º 6
0
    def setUp(self):
        self.octolapse_settings = OctolapseSettings(NamedTemporaryFile().name)
        self.rendering_job_id = "job_id"

        self.print_name = "print_name"
        self.print_start_time = 0
        self.print_end_time = 100

        # Create fake snapshots.
        self.capture_template = get_snapshot_filename(self.print_name,
                                                      SnapshotNumberFormat)
        self.data_directory = mkdtemp()
        self.octoprint_timelapse_folder = mkdtemp()

        self.ffmpeg_path = "ffmpeg"
        self.render_task_queue = Queue(maxsize=1)
        self.render_task_queue.put(self.rendering_job_id)
Exemplo n.º 7
0
 def setUp(self):
     self.Settings = OctolapseSettings(NamedTemporaryFile().name)
Exemplo n.º 8
0
 def setUp(self):
     self.Settings = OctolapseSettings(NamedTemporaryFile().name)
     self.PrinterTolerance = 0.0
Exemplo n.º 9
0
 def setUp(self):
     self.Commands = Commands()
     self.Settings = OctolapseSettings("c:\\temp\\octolapse.log")
     self.OctoprintPrinterProfile = self.CreateOctoprintPrinterProfile()
Exemplo n.º 10
0
 def setUp(self):
     self.Settings = OctolapseSettings("c:\\temp\\octolapse.log")
     self.Extruder = Extruder(self.Settings)
Exemplo n.º 11
0
 def setUp(self):
     self.Settings = OctolapseSettings(NamedTemporaryFile().name)
     self.Extruder = Extruder(self.Settings)
     # set the retraction distance
     self.Extruder.Printerretraction_length = 4
Exemplo n.º 12
0
 def setUp(self):
     self.Settings = OctolapseSettings("c:\\test\\")
     self.OctoprintPrinterProfile = self.CreateOctoprintPrinterProfile()
Exemplo n.º 13
0
 def setUp(self):
     self.Settings = OctolapseSettings(NamedTemporaryFile().name)
     self.Extruder = Extruder(self.Settings)