This commit is contained in:
2026-02-15 20:23:52 +01:00
parent 4476afc1a2
commit 111df89033
10 changed files with 552 additions and 75 deletions

View File

@@ -39,9 +39,11 @@ class PVPlantWorkbench(Workbench):
ToolTip = "Workbench for PV design"
Icon = str(os.path.join(DirIcons, "icon.svg"))
def __init__(self):
''' init '''
def Initialize(self):
#sys.path.append(r"C:\Users\javie\AppData\Roaming\FreeCAD\Mod")
sys.path.append(os.path.join(FreeCAD.getUserAppDataDir(), 'Mod'))
import PVPlantTools, reload
@@ -144,7 +146,10 @@ class PVPlantWorkbench(Workbench):
from widgets import CountSelection
def Activated(self):
"This function is executed when the workbench is activated"
"""This function is executed when the workbench is activated"""
FreeCAD.Console.PrintLog("Road workbench activated.\n")
import SelectionObserver
import FreeCADGui
@@ -153,7 +158,9 @@ class PVPlantWorkbench(Workbench):
return
def Deactivated(self):
"This function is executed when the workbench is deactivated"
"""This function is executed when the workbench is deactivated"""
FreeCAD.Console.PrintLog("Road workbench deactivated.\n")
#FreeCADGui.Selection.removeObserver(self.observer)
return
@@ -201,4 +208,4 @@ class PVPlantWorkbench(Workbench):
return "Gui::PythonWorkbench"
Gui.addWorkbench(PVPlantWorkbench())
FreeCADGui.addWorkbench(PVPlantWorkbench())