Exemple #1
0
    def _onPrintTimeMaterialEstimates(self, message: Arcus.PythonMessage) -> None:
        material_amounts = []
        for index in range(message.repeatedMessageCount("materialEstimates")):
            material_amounts.append(message.getRepeatedMessage("materialEstimates", index).material_amount)

        times = self._parseMessagePrintTimes(message)
        self.printDurationMessage.emit(self._start_slice_job_build_plate, times, material_amounts)
    def _onPrintTimeMaterialEstimates(self, message: Arcus.PythonMessage) -> None:
        material_amounts = []
        for index in range(message.repeatedMessageCount("materialEstimates")):
            material_amounts.append(message.getRepeatedMessage("materialEstimates", index).material_amount)
        if len(self._material_amounts) > 0:
            zipped_amounts = zip(self._material_amounts, material_amounts)
            # sum items in two lists
            self._material_amounts = [x + y for (x, y) in zipped_amounts]
        else:
            self._material_amounts = material_amounts

        self._times = self._parseMessagePrintTimes(message)
        self.printDurationMessage.emit(self._start_slice_job_build_plate, self._times, self._material_amounts)
Exemple #3
0
    def _onPrintTimeMaterialEstimates(self, message: Arcus.PythonMessage) -> None:
        """Called when a print time message is received from the engine.

        :param message: The protobuf message containing the print time per feature and
            material amount per extruder
        """

        material_amounts = []
        for index in range(message.repeatedMessageCount("materialEstimates")):
            material_amounts.append(message.getRepeatedMessage("materialEstimates", index).material_amount)

        times = self._parseMessagePrintTimes(message)
        self.printDurationMessage.emit(self._start_slice_job_build_plate, times, material_amounts)