本文整理汇总了Python中ToolsPage.Plugin类的典型用法代码示例。如果您正苦于以下问题:Python Plugin类的具体用法?Python Plugin怎么用?Python Plugin使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Plugin类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, master):
Plugin.__init__(self, master,"Helical")
#Helical_Descent: is the name of the plugin show in the tool ribbon button
self.icon = "helical" #<<< This is the name of file used as icon for the ribbon button. It will be search in the "icons" subfolder
self.group = "CAM" #<<< This is the name of group that plugin belongs
#Here we are creating the widgets presented to the user inside the plugin
#Name, Type , Default value, Description
self.variables = [ #<<< Define a list of components for the GUI
("name" , "db" , "", _("Name")), #used to store plugin settings in the internal database
("Sel_Blocks", "bool" , "False", _("Selected Block")),
("X", "mm" , 0.00, _("X Initial")),
("Y", "mm" , 0.00, _("Y Initial")),
("Z", "mm" , 0.00, _("Z Initial")),
("CutDiam" ,"float", 1.50, _("Diameter Cut")),
("endmill", "db" , "", _("End Mill")),
# ("RadioHelix", "mm" , 0.80, _("Helicoid Radius")), #a variable that will be converted in mm/inch based on bCNC settting
("Pitch" , "mm" , 0.10, _("Drop by lap")), #an integer variable
("Depth" , "mm" , 3.00, _("Final Depth")), #a float value variable
("Mult_Feed_Z", "float" ,1.0, _("Z Feed Multiplier")),
("HelicalCut" , "Helical Cut,Internal Right Thread,Internal Left Thread,External Right Thread,External Left Thread", "Helical Cut",_("Helical Type")),
("Entry" ,"Center,Edge" , "Center", _("Entry and Exit")),
("ClearanceEntry" ,"float", 0.2, _("Entry Edge Clearance")),
("ClearanceExit" ,"float", 0.2, _("Exit Edge Clearance")),
("ReturnToSafeZ" ,"bool" , "True", _("Returns to safe Z")),
# ("Text" , "text" , "Free Text", _("Text description")), #a text input box
# ("CheckBox", "bool" , False, _("CheckBox description")), #a true/false check box
# ("OpenFile", "file" , "", _("OpenFile description")), #a file chooser widget
# ("ComboBox", "Item1,Item2,Item3" , "Item1", _("ComboBox description")) #a multiple choice combo box
]
self.buttons.append("exe") #<<< This is the button added at bottom to call the execute method below
示例2: __init__
def __init__(self, master):
Plugin.__init__(self, master)
self.name = "Midi2CNC"
self.icon = "midi2cnc"
self.group = "Artistic"
self.axes_dict = dict( {
'X':[0], 'Y':[1], 'Z':[2],
'XY':[0,1], 'YX':[1,0], 'XZ':[0,2],
'ZX':[2,0], 'YZ':[1,2], 'ZY':[2,1],
'XYZ':[0,1,2], 'XZY':[0,2,1],
'YXZ':[1,0,2], 'YZX':[1,2,0],
'ZXY':[2,0,1], 'ZYX':[2,1,0]
})
self.variables = [
("name", "db" , "", _("Name")),
("ppu_X" , "float" , 200.0, _("Pulse per unit for X")),
("ppu_Y" , "float" , 200.0, _("Pulse per unit for Y")),
("ppu_Z" , "float" , 200.0, _("Pulse per unit for Z")),
("max_X" , "int" , 50, _("Maximum X travel")),
("max_Y" , "int" , 50, _("Maximum Y travel")),
("max_Z" , "int" , 20, _("Maximum Z travel")),
("AxisUsed", ",".join(self.axes_dict.keys()), "XYZ", _("Axis to be used")),
("File" , "file" , "", _("Midi to process")),
]
self.buttons.append("exe")
示例3: __init__
def __init__(self, master):
Plugin.__init__(self, master, "Hilbert")
self.icon = "hilbert"
self.group = "Artistic"
self.variables = [
("name", "db" , "", _("Name")),
("Size" , "mm" , 50.0, _("Size")),
("Order" , "int" , 2, _("Order")),
("Depth" , "int" , 0, _("Depth"))
]
self.buttons.append("exe")
示例4: __init__
def __init__(self, master):
Plugin.__init__(self, master)
self.name = "Bowl"
self.icon = "bowl"
self.variables = [
("name", "db", "", _("Name")),
("D", "mm", 30.0, _("Diameter")),
("res", "float", 10.0, _("Resolution (degrees)")),
("pocket", "bool", 1, _("Progressive"))
]
self.buttons.append("exe")
示例5: __init__
def __init__(self, master):
Plugin.__init__(self, master)
self.name = "Gear"
self.icon = "gear"
self.variables = [
("name", "db", "", "Name"),
("n", "int", 10, "No of teeth"),
("phi", "float", 17.0, "Pressure angle"),
("pc", "mm", 5.0, "Circular Pitch")
]
self.buttons.append("exe")
示例6: __init__
def __init__(self, master):
Plugin.__init__(self, master)
self.name = "Tile"
self.icon = "tile"
self.variables = [
("name", "db", "", _("Name")),
("nx", "int", 3, "Nx"),
("ny", "int", 3, "Ny"),
("dx", "mm", 50.0, "Dx"),
("dy", "mm", 50.0, "Dy")
]
self.buttons.append("exe")
示例7: __init__
def __init__(self, master):
Plugin.__init__(self, master,"Intersection")
#Helical_Descent: is the name of the plugin show in the tool ribbon button
self.icon = "intersection" #<<< This is the name of png file used as icon for the ribbon button. It will be search in the "icons" subfolder
self.group = "Development" #<<< This is the name of group that plugin belongs
self.oneshot = True
#Here we are creating the widgets presented to the user inside the plugin
#Name, Type , Default value, Description
self.variables = [ #<<< Define a list of components for the GUI
("name" , "db" , "", _("Name")), #used to store plugin settings in the internal database
]
self.buttons.append("exe") #<<< This is the button added at bottom to call the execute method below
示例8: __init__
def __init__(self, master):
Plugin.__init__(self, master)
self.name = "Spirograph"
self.icon = "spirograph"
self.variables = [
("name", "db" , "", _("Name")),
("RadiusExternal" , "mm" , 50.0, _("External Radius")),
("RadiusInternal" , "mm" , 33.0, _("Internal Radius")),
("RadiusOffset" , "mm" , 13.0, _("Offset radius")),
("Depth" , "mm" , 0, _("Target Depth"))
]
self.buttons.append("exe")
示例9: __init__
def __init__(self, master):
Plugin.__init__(self, master)
self.name = "Driller"
self.icon = "driller"
self.variables = [
("name", "db", "", _("Name")),
("HolesDistance", "mm", 10.0, _("Distance between holes")),
("TargetDepth", "mm", 0.0, _("Target Depth")),
("Peck", "mm", 0.0, _("Peck, 0 meas None")),
("Dwell", "float", 0.0, _("Dwell time, 0 means None")),
]
self.buttons.append("exe")
示例10: __init__
def __init__(self, master):
Plugin.__init__(self, master)
self.name = "Text"
self.icon = "text"
self.variables = [("name", "db" , "", _("Name")),
("Text", "text", "Write this!", _("Text to generate")),
("Depth", "mm", 0.0, _("Working Depth")),
("FontSize", "mm", 10.0, _("Font size")),
("FontFile", "file", "", _("Font file")),
("ImageToAscii","file", "", _("Image to Ascii")),
("CharsWidth", "int", 80, _("Image chars width"))]
self.buttons.append("exe")
示例11: __init__
def __init__(self, master):
Plugin.__init__(self, master, "Trochoidal 3D")
self.icon = "trochoidal"
self.group = "CAM"
self.variables = [
("name", "db", "", _("Name")),
("diam" ,"float", "", _("Trochoid Cut Diameter")),
("endmill", "db" , "", _("End Mill"), "If Empty chooses, End Mill loaded"),
("ae", "mm", 0.30, _("Trochoids Advance")),
("TypeSplice","Warpedarc,Splices,Circular one side rectified,Circular both sides rectified,Straight,Cut",\
"Warpedarc", _("Type of Splice"),"Currently Splices works very slow"),
("direction","inside,outside,on (3d Path)" , "inside", _("Direction")),
("offset", "float", 0.0, _("Additional offset distance"), " Only for In or On direction"),
("adaptative", "bool", 1, _("Adaptative"), "Generate path for adaptative trochoids in the corners. Only for In or On direction"),
("overcut", "bool", 0, _("Overcut"), " Only for In or On direction"),
("targetDepth", "mm", -1, _("Target Depth"), " Only for In or On direction"),
("depthIncrement", "mm", 1, _("Depth Increment"), " Only for In or On direction"),
("cw" , "bool" , True, _("Clockwise")),
# ("helicalangle", "int" , 25, _("Helical descent angle")),
("rpm", "int" , 12000, _("RPM")),
("feed" , "int", 1200 , _("Feed")),
("zfeed" , "int", "" , _("Plunge Feed")),
("splicesteps", "int", 12 , _("splice steps every 360 degrees"), "Only for Splices Type of Splice"),
# ("tabsnumber", "mm", 1, _("Number of Tabs 0 = Not Tabs")),
# ("tabsWidth", "mm", 1, _("Tabs Diameter")),
# ("tabsHeight", "mm", 1, _("Tabs Height")),
# ("VerticalResolution" , "mm" , 0.15, _("Resolution or Vertical Step")),
# ("variableRPM" , "bool",True , _("Variable RPM")),
# ("S_z", "int", "", _("RPM For Descent Cut")),
# ("S_xy", "int", "", _("RPM Trochoidal Cutting")),
# ("variableFeed" , "bool",True , _("Variable Feed")),
# ("K_Z" , "float", 1.00, _("Feed rate Multiplier Z")),
# ("K_XY" , "float", 1.00, _("Feed rate Multiplier XY")),
# ("TargetDepth", "mm", 0.0, _("Target Depth")),
# ("_3D" , "bool",False , _("Cut accord 3D Path")),
# ("VerticalClimbing" , "bool",False , _("Vertical Climbing Trochoid")),
# ("AllowSurface" , "bool",False , _("Trochoid on Z Surface")),
# ("MinTrochDiam", "float", 6.0 , _("Minimal trochoid in % tool")),
# ("OnlyGline" , "bool",False , _("Only go to Trochoid Center")),
# ("FirstPoint" , "bool",False , _("First Point Problem")),
# ("Dwell", "float", 0.0, _("Dwell time, 0 means None")),
# ("Peck", "mm", 0.0, _("Peck, 0 meas None")),
# ("manualsetting", "bool", False , _("----- Manual setting ------")),
# ("helicalDiam" ,"float", 7.0, _("Helical Descent Diameter")),
# ("minimfeed", "int" , "", _("Minimum Adaptative Feed")),
]
self.buttons.append("exe")
self.help= '''It generates the trochoidal cutting mode on the selected block, even at different heights.
示例12: __init__
def __init__(self, master):
Plugin.__init__(self, master, "Zig-Zag")
self.icon = "zigzag"
self.group = "Artistic"
self.variables = [
("name", "db", "", _("Name")),
("Nlines", "int", 34, _("Number of lines")),
("LineLen", "mm", 33., _("Line length")),
("StartEndLen", "mm", 5., _("Additional length at start/end")),
("Step", "mm", 1., _("Step distance")),
("CornerRes", "int", 5, _("Corner resolution")),
("Depth", "mm", -0.1, _("Depth"))
]
self.buttons.append("exe")
示例13: __init__
def __init__(self, master):
Plugin.__init__(self, master, "Jigsaw")
self.icon = "jigsaw"
self.group = "Generator"
self.variables = [
("name", "db", "", _("Name")),
("width", "mm", 1000.0, _("Board width")),
("height", "mm", 800.0, _("Board height")),
("piece_count", "int", 100, _("Piece count")),
("random_seed", "int", 1, _("Random seed")),
("threshold", "float", 1.2, _("Difference between pieces")),
("tap_shape", 'basic,heart,anchor', 'basic', _("Shape of the tap"))
]
self.buttons.append("exe")
示例14: __init__
def __init__(self, master):
Plugin.__init__(self, master, "Driller")
self.icon = "driller"
self.group = "CAM"
self.variables = [
("name", "db", "", _("Name")),
("HolesDistance", "mm", 10.0, _("Distance between holes")),
("TargetDepth", "mm", 0.0, _("Target Depth")),
("Peck", "mm", 0.0, _("Peck, 0 meas None")),
("Dwell", "float", 0.0, _("Dwell time, 0 means None")),
("useAnchor", "bool", False, _("Use anchor")),
("File" , "file" , "", _("Excellon-File")),
]
self.buttons.append("exe")
示例15: __init__
def __init__(self, master):
Plugin.__init__(self, master, "Scaling")
self.icon = "scale"
self.group = "CAM"
self.variables = [
("name", "db", "", _("Name")),
("xscale" ,"float", "", _("X Scale")),
("yscale" ,"float", "", _("Y Scale")),
("zscale" ,"float", "", _("Z Scale")),
("feed" , "int", 1200 , _("Feed")),
("zfeed" , "int", "" , _("Plunge Feed")),
("rpm", "int" , 12000, _("RPM"))
]
self.buttons.append("exe")