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


Python Tools.load_default方法代码示例

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


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

示例1: Program

# 需要导入模块: from Tools import Tools [as 别名]
# 或者: from Tools.Tools import load_default [as 别名]
class Program(Object):
    def __init__(self):
        Object.__init__(self)
        config = CNCConfig()
        self.units = config.ReadFloat("ProgramUnits", 1.0)  # set to 25.4 for inches
        self.alternative_machines_file = config.Read("ProgramAlternativeMachinesFile", "")
        self.raw_material = RawMaterial()  # // for material hardness - to determine feeds and speeds.
        machine_name = config.Read("ProgramMachine", "emc2b")
        self.machine = self.GetMachine(machine_name)
        import wx

        default_output_file = (wx.StandardPaths.Get().GetTempDir() + "/test.tap").replace("\\", "/")
        self.output_file = config.Read(
            "ProgramOutputFile", default_output_file
        )  #  // NOTE: Only relevant if the filename does NOT follow the data file's name.
        self.output_file_name_follows_data_file_name = config.ReadBool(
            "OutputFileNameFollowsDataFileName", True
        )  #    // Just change the extension to determine the NC file name
        self.python_program = ""
        self.path_control_mode = config.ReadInt("ProgramPathControlMode", PATH_CONTROL_UNDEFINED)
        self.motion_blending_tolerance = config.ReadFloat(
            "ProgramMotionBlendingTolerance", 0.0
        )  # Only valid if m_path_control_mode == eBestPossibleSpeed
        self.naive_cam_tolerance = config.ReadFloat(
            "ProgramNaiveCamTolerance", 0.0
        )  # Only valid if m_path_control_mode == eBestPossibleSpeed

    def TypeName(self):
        return "Program"

    def icon(self):
        # the name of the PNG file in the HeeksCNC icons folder
        return "program"

    def CanBeDeleted(self):
        return False

    def add_initial_children(self):
        # add tools, operations, etc.
        self.children = []
        self.tools = Tools()
        self.tools.load_default()
        self.Add(self.tools)
        self.operations = Operations()
        self.Add(self.operations)
        self.nccode = NCCode()
        self.Add(self.nccode)

    def LanguageCorrection(self):
        """
        // Language and Windows codepage detection and correction
        #ifndef WIN32
            python << _T("# coding=UTF8\n");
            python << _T("# No troubled Microsoft Windows detected\n");
        #else
            switch((wxLocale::GetSystemLanguage()))
            {
                case wxLANGUAGE_SLOVAK :
                    python << _T("# coding=CP1250\n");
                    python << _T("# Slovak language detected in Microsoft Windows\n");
                    break;
                case wxLANGUAGE_GERMAN:
                case wxLANGUAGE_GERMAN_AUSTRIAN:
                case wxLANGUAGE_GERMAN_BELGIUM:
                case wxLANGUAGE_GERMAN_LIECHTENSTEIN:
                case wxLANGUAGE_GERMAN_LUXEMBOURG:
                case wxLANGUAGE_GERMAN_SWISS  :
                    python << _T("# coding=CP1252\n");
                    python << _T("# German language or it's variant detected in Microsoft Windows\n");
                    break;
                case wxLANGUAGE_FRENCH:
                case wxLANGUAGE_FRENCH_BELGIAN:
                case wxLANGUAGE_FRENCH_CANADIAN:
                case wxLANGUAGE_FRENCH_LUXEMBOURG:
                case wxLANGUAGE_FRENCH_MONACO:
                case wxLANGUAGE_FRENCH_SWISS:
                    python << _T("# coding=CP1252\n");
                    python << _T("# French language or it's variant detected in Microsoft Windows\n");
                    break;
                case wxLANGUAGE_ITALIAN:
                case wxLANGUAGE_ITALIAN_SWISS :
                    python << _T("# coding=CP1252\n");
                    python << _T("#Italian language or it's variant detected in Microsoft Windows\n");
                    break;
                case wxLANGUAGE_ENGLISH:
                case wxLANGUAGE_ENGLISH_UK:
                case wxLANGUAGE_ENGLISH_US:
                case wxLANGUAGE_ENGLISH_AUSTRALIA:
                case wxLANGUAGE_ENGLISH_BELIZE:
                case wxLANGUAGE_ENGLISH_BOTSWANA:
                case wxLANGUAGE_ENGLISH_CANADA:
                case wxLANGUAGE_ENGLISH_CARIBBEAN:
                case wxLANGUAGE_ENGLISH_DENMARK:
                case wxLANGUAGE_ENGLISH_EIRE:
                case wxLANGUAGE_ENGLISH_JAMAICA:
                case wxLANGUAGE_ENGLISH_NEW_ZEALAND:
                case wxLANGUAGE_ENGLISH_PHILIPPINES:
                case wxLANGUAGE_ENGLISH_SOUTH_AFRICA:
                case wxLANGUAGE_ENGLISH_TRINIDAD:
                case wxLANGUAGE_ENGLISH_ZIMBABWE:
#.........这里部分代码省略.........
开发者ID:cyplo,项目名称:heekscnc,代码行数:103,代码来源:Program.py


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