当前位置: 首页>>代码示例>>Python>>正文


Python ContainerStack.getAllKeys方法代码示例

本文整理汇总了Python中UM.Settings.ContainerStack.ContainerStack.getAllKeys方法的典型用法代码示例。如果您正苦于以下问题:Python ContainerStack.getAllKeys方法的具体用法?Python ContainerStack.getAllKeys怎么用?Python ContainerStack.getAllKeys使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在UM.Settings.ContainerStack.ContainerStack的用法示例。


在下文中一共展示了ContainerStack.getAllKeys方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: _buildGlobalInheritsStackMessage

# 需要导入模块: from UM.Settings.ContainerStack import ContainerStack [as 别名]
# 或者: from UM.Settings.ContainerStack.ContainerStack import getAllKeys [as 别名]
 def _buildGlobalInheritsStackMessage(self, stack: ContainerStack) -> None:
     for key in stack.getAllKeys():
         extruder_position = int(round(float(stack.getProperty(key, "limit_to_extruder"))))
         if extruder_position >= 0:  # Set to a specific extruder.
             setting_extruder = self._slice_message.addRepeatedMessage("limit_to_extruder")
             setting_extruder.name = key
             setting_extruder.extruder = extruder_position
         Job.yieldThread()
开发者ID:Ultimaker,项目名称:Cura,代码行数:10,代码来源:StartSliceJob.py

示例2: _checkStackForErrors

# 需要导入模块: from UM.Settings.ContainerStack import ContainerStack [as 别名]
# 或者: from UM.Settings.ContainerStack.ContainerStack import getAllKeys [as 别名]
    def _checkStackForErrors(self, stack: ContainerStack) -> bool:
        if stack is None:
            return False

        for key in stack.getAllKeys():
            validation_state = stack.getProperty(key, "validationState")
            if validation_state in (ValidatorState.Exception, ValidatorState.MaximumError, ValidatorState.MinimumError, ValidatorState.Invalid):
                Logger.log("w", "Setting %s is not valid, but %s. Aborting slicing.", key, validation_state)
                return True
            Job.yieldThread()
        return False
开发者ID:Ultimaker,项目名称:Cura,代码行数:13,代码来源:StartSliceJob.py

示例3: _buildReplacementTokens

# 需要导入模块: from UM.Settings.ContainerStack import ContainerStack [as 别名]
# 或者: from UM.Settings.ContainerStack.ContainerStack import getAllKeys [as 别名]
    def _buildReplacementTokens(self, stack: ContainerStack) -> Dict[str, Any]:
        result = {}
        for key in stack.getAllKeys():
            value = stack.getProperty(key, "value")
            result[key] = value
            Job.yieldThread()

        result["print_bed_temperature"] = result["material_bed_temperature"] # Renamed settings.
        result["print_temperature"] = result["material_print_temperature"]
        result["travel_speed"] = result["speed_travel"]
        result["time"] = time.strftime("%H:%M:%S") #Some extra settings.
        result["date"] = time.strftime("%d-%m-%Y")
        result["day"] = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"][int(time.strftime("%w"))]

        initial_extruder_stack = CuraApplication.getInstance().getExtruderManager().getUsedExtruderStacks()[0]
        initial_extruder_nr = initial_extruder_stack.getProperty("extruder_nr", "value")
        result["initial_extruder_nr"] = initial_extruder_nr

        return result
开发者ID:Ultimaker,项目名称:Cura,代码行数:21,代码来源:StartSliceJob.py


注:本文中的UM.Settings.ContainerStack.ContainerStack.getAllKeys方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。