Hiding some advanced, not ready for prime time features unless EnableExperimentalFeatures is set and true in the preferences.
This commit is contained in:
committed by
Yorik van Havre
parent
a84a0ce431
commit
cd1a4e8b4c
@@ -28,8 +28,3 @@ ParGrp = App.ParamGet("System parameter:Modules").GetGroup("Path")
|
||||
ParGrp.SetString("HelpIndex", "Path/Help/index.html")
|
||||
ParGrp.SetString("WorkBenchName", "Path")
|
||||
ParGrp.SetString("WorkBenchModule", "PathWorkbench.py")
|
||||
|
||||
# Setup global default values
|
||||
import Path
|
||||
from PathScripts.PathPreferences import PathPreferences
|
||||
Path.Area.setDefaultParams(Accuracy = PathPreferences.defaultLibAreaCurveAccuracy())
|
||||
|
||||
@@ -35,6 +35,9 @@ class PathWorkbench (Workbench):
|
||||
FreeCADGui.addPreferencePage(PathPreferencesPathJob.JobPreferencesPage, "Path")
|
||||
FreeCADGui.addPreferencePage(PathPreferencesPathDressup.DressupPreferencesPage, "Path")
|
||||
|
||||
# Check enablement of experimental features
|
||||
from PathScripts.PathPreferences import PathPreferences
|
||||
|
||||
# load the builtin modules
|
||||
import Path
|
||||
import PathScripts
|
||||
@@ -77,14 +80,14 @@ class PathWorkbench (Workbench):
|
||||
import PathCommands
|
||||
|
||||
# build commands list
|
||||
projcmdlist = ["Path_Job", "Path_Post", "Path_Inspect", "Path_Sanity", "Path_Simulator"]
|
||||
projcmdlist = ["Path_Job", "Path_Post", "Path_Inspect", "Path_Simulator"]
|
||||
toolcmdlist = ["Path_ToolLibraryEdit"]
|
||||
prepcmdlist = ["Path_Plane", "Path_Fixture", "Path_ToolLenOffset", "Path_Comment", "Path_Stop", "Path_Custom", "Path_Shape"]
|
||||
twodopcmdlist = ["Path_Contour", "Path_Profile_Faces", "Path_Profile_Edges", "Path_Pocket_Shape", "Path_Drilling", "Path_Engrave", "Path_MillFace", "Path_Helix"]
|
||||
threedopcmdlist = ["Path_Pocket_3D", "Path_Surface"]
|
||||
threedopcmdlist = ["Path_Pocket_3D"]
|
||||
modcmdlist = ["Path_OperationCopy", "Path_Array", "Path_SimpleCopy" ]
|
||||
dressupcmdlist = ["PathDressup_Dogbone", "PathDressup_DragKnife", "PathDressup_Tag", "PathDressup_RampEntry"]
|
||||
extracmdlist = ["Path_SelectLoop", "Path_Shape", "Path_Area", "Path_Area_Workplane"]
|
||||
extracmdlist = ["Path_SelectLoop"]
|
||||
#modcmdmore = ["Path_Hop",]
|
||||
#remotecmdlist = ["Path_Remote"]
|
||||
|
||||
@@ -107,12 +110,19 @@ class PathWorkbench (Workbench):
|
||||
return True
|
||||
return False
|
||||
|
||||
FreeCADGui.addCommand('Path_3dTools', ThreeDCommandGroup())
|
||||
if PathPreferences.experimentalFeaturesEnabled():
|
||||
projcmdlist.append("Path_Sanity")
|
||||
threedopcmdlist.append("Path_Surface")
|
||||
extracmdlist.extend(["Path_Shape", "Path_Area", "Path_Area_Workplane"])
|
||||
FreeCADGui.addCommand('Path_3dTools', ThreeDCommandGroup())
|
||||
threedcmdgroup = ['Path_3dTools']
|
||||
else:
|
||||
threedcmdgroup = threedopcmdlist
|
||||
|
||||
self.appendToolbar(QT_TRANSLATE_NOOP("Path", "Project Setup"), projcmdlist)
|
||||
self.appendToolbar(QT_TRANSLATE_NOOP("Path", "Tool Commands"), toolcmdlist)
|
||||
#self.appendToolbar(QT_TRANSLATE_NOOP("Path", "Partial Commands"), prepcmdlist)
|
||||
self.appendToolbar(QT_TRANSLATE_NOOP("Path", "New Operations"), twodopcmdlist+['Path_3dTools'])
|
||||
self.appendToolbar(QT_TRANSLATE_NOOP("Path", "New Operations"), twodopcmdlist+threedcmdgroup)
|
||||
self.appendToolbar(QT_TRANSLATE_NOOP("Path", "Path Modification"), modcmdlist)
|
||||
self.appendToolbar(QT_TRANSLATE_NOOP("Path", "Helpful Tools"), extracmdlist)
|
||||
|
||||
@@ -135,6 +145,8 @@ class PathWorkbench (Workbench):
|
||||
|
||||
self.dressupcmds = dressupcmdlist
|
||||
|
||||
Path.Area.setDefaultParams(Accuracy = PathPreferences.defaultLibAreaCurveAccuracy())
|
||||
|
||||
Log('Loading Path workbench... done\n')
|
||||
|
||||
def GetClassName(self):
|
||||
@@ -176,3 +188,4 @@ FreeCAD.addImportType(
|
||||
"GCode (*.nc *.gc *.ncc *.ngc *.cnc *.tap *.gcode)", "PathGui")
|
||||
FreeCAD.addExportType(
|
||||
"GCode (*.nc *.gc *.ncc *.ngc *.cnc *.tap *.gcode)", "PathGui")
|
||||
|
||||
|
||||
@@ -45,6 +45,9 @@ class PathPreferences:
|
||||
GeometryTolerance = "GeometryTolerance"
|
||||
LibAreaCurveAccuracy = "LibAreaCurveAccuarcy"
|
||||
|
||||
EnableExperimentalFeatures = "EnableExperimentalFeatures"
|
||||
|
||||
|
||||
@classmethod
|
||||
def preferences(cls):
|
||||
return FreeCAD.ParamGet("User parameter:BaseApp/Preferences/Mod/Path")
|
||||
@@ -177,3 +180,8 @@ class PathPreferences:
|
||||
def setDefaultStockTemplate(cls, template):
|
||||
cls.preferences().SetString(cls.DefaultStockTemplate, template)
|
||||
|
||||
|
||||
@classmethod
|
||||
def experimentalFeaturesEnabled(cls):
|
||||
return cls.preferences().GetBool(cls.EnableExperimentalFeatures, False)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user