|
|
|
|
import FreeCAD as App
|
|
|
|
|
import FreeCADGui as Gui
|
|
|
|
|
from freecad.LaserCladdingWorkbench import lc_resource
|
|
|
|
|
|
|
|
|
|
from freecad.LaserCladdingWorkbench import commands
|
|
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
class LaserCladding (Gui.Workbench):
|
|
|
|
|
MenuText = "Laser Cladding"
|
|
|
|
|
ToolTip = "Create Simple Paths on workpieces for Laser Cladding"
|
|
|
|
|
Icon = os.path.join(App.getUserAppDataDir(),
|
|
|
|
|
"Mod", "fc_lasercladding_wb","freecad", "LaserCladdingWorkbench",
|
|
|
|
|
"Resources", "icons", "LaserWorkbench.svg")
|
|
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
|
def Initialize(self):
|
|
|
|
|
"""This function is executed when the workbench is first activated.
|
|
|
|
|
It is executed once in a FreeCAD session followed by the Activated function.
|
|
|
|
|
"""
|
|
|
|
|
import freecad.LaserCladdingWorkbench
|
|
|
|
|
self.appendMenu("LaserCladding",
|
|
|
|
|
["LCCreateProgram",
|
|
|
|
|
"LCSelectBaseReference",
|
|
|
|
|
"LCCreatePad",
|
|
|
|
|
"LCRecompute",
|
|
|
|
|
"LCSaveProg"
|
|
|
|
|
]
|
|
|
|
|
) # creates a new menu
|
|
|
|
|
|
|
|
|
|
self.appendToolbar("LaserCladding",
|
|
|
|
|
["LCCreateProgram",
|
|
|
|
|
"LCSelectBaseReference",
|
|
|
|
|
"LCCreatePad",
|
|
|
|
|
"LCRecompute",
|
|
|
|
|
"LCSaveProg"
|
|
|
|
|
]
|
|
|
|
|
) # creates a new toolbar
|
|
|
|
|
|
|
|
|
|
def Activated(self):
|
|
|
|
|
"""This function is executed whenever the workbench is activated"""
|
|
|
|
|
import freecad.LaserCladdingWorkbench
|
|
|
|
|
from importlib import reload
|
|
|
|
|
reload(freecad.LaserCladdingWorkbench)
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
def Deactivated(self):
|
|
|
|
|
"""This function is executed whenever the workbench is deactivated"""
|
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
def ContextMenu(self, recipient):
|
|
|
|
|
"""This function is executed whenever the user right-clicks on screen"""
|
|
|
|
|
# "recipient" will be either "view" or "tree"
|
|
|
|
|
self.appendContextMenu("Laser Cladding",[]) # add commands to the context menu
|
|
|
|
|
|
|
|
|
|
def GetClassName(self):
|
|
|
|
|
# This function is mandatory if this is a full Python workbench
|
|
|
|
|
# This is not a template, the returned string should be exactly "Gui::PythonWorkbench"
|
|
|
|
|
return "Gui::PythonWorkbench"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Gui.addWorkbench(LaserCladding())
|