Пример #1
0
    def get_extruders(self):
        """
        Populate extruder list
        :return:
        """

        for i in range(len(self.extruder_name)):
            t = self.extruder_tool[i]
            name = self.extruder_name[i]
            ext = Extruder(t, name=name)
            ext.nozzle = self.extruder_diameter[i]
            if self.extruder_use_retract[i]:
                ext.retract = self.extruder_retract_dist[i]
                ext.retract_speed = self.extruder_retract_speed[i]
            ext.z_hop = self.extruder_zhop[i]
            if self.extruder_use_coasting[i]:
                ext.coasting = self.extruder_coasting[i]
            if self.extruder_use_wipe[i]:
                ext.wipe = self.extruder_wipe[i]
            ext.feed_rate_multiplier = self.extruder_multiplier[i]

            ext.temperature_nr = self.temperature_numbers[i]

            for j in range(self.temperature_setpoints[i]):
                index = self.temperature_setpoints[i] * i + j
                layer_nr = self.temperature_setpoint_layers[index]
                ext.temperature_setpoints[
                    layer_nr] = self.temperature_setpoint_temps[index]

            self.extruders[t] = ext
Пример #2
0
    def get_extruders(self):
        """
        Populate extruder list
        :return:
        """

        for i in range(len(self.extruder_name)):
            t = self.extruder_tool[i]
            name = self.extruder_name[i]
            ext = Extruder(t, name=name)
            ext.nozzle = self.extruder_diameter[i]
            if self.extruder_use_retract[i]:
                ext.retract = self.extruder_retract_dist[i]
                ext.retract_speed = self.extruder_retract_speed[i]
            ext.z_hop = self.extruder_zhop[i]
            if self.extruder_use_coasting[i]:
                ext.coasting = self.extruder_coasting[i]
            if self.extruder_use_wipe[i]:
                ext.wipe = self.extruder_wipe[i]
            ext.feed_rate_multiplier = self.extruder_multiplier[i]
            ext.extrusion_width = self.extruder_widths[i]
            self.extruders[t] = ext

        # go through the temperature names and try to assign them to extruders
        temp_setpoint_index = 0
        for i in range(len(self.temperature_names)):
            t = self.temperature_numbers[i]
            if self.temperature_heated_bed[i] == 0:
                ext = self.extruders[t]
                ext.temperature_nr = t
            else:
                ext = None

            # need to parse all setpoints to keep proper indexing even with bed
            for j in range(self.temperature_setpoints[i]):
                if ext:
                    layer_nr = self.temperature_setpoint_layers[temp_setpoint_index]
                    ext.temperature_setpoints[layer_nr] = self.temperature_setpoint_temps[temp_setpoint_index]
                temp_setpoint_index += 1

        # find proper setpoint temp
        last_setpoints = None
        for e in self.extruders:
            # setpoints
            if self.extruders[e].temperature_setpoints:
                last_setpoints = self.extruders[e].temperature_setpoints
                break

        # if not found, bad config
        if not last_setpoints:
            raise ValueError("Could not find valid temperature settings for extruder(s). Please check S3D profile")

        warning = False
        for e in self.extruders:
            if not self.extruders[e].temperature_setpoints:
                self.extruders[e].temperature_setpoints = last_setpoints
                warning = True

            # temp nr. Use tool number if not defined
            if self.extruders[e].temperature_nr is None:
                self.extruders[e].temperature_nr = self.extruders[e].tool

        # debug
        # for e in self.extruders:
        #    print(self.extruders[e].temperature_nr, self.extruders[e].temperature_setpoints)

        if warning:
            self.log.info("Not all extruders have valid temperature definitions, using previous extruder values. Please check profile temperature settings")