Moved remaing files out of PathScripts

This commit is contained in:
Markus Lampert
2022-09-01 18:57:49 -07:00
parent 68238ccdff
commit 6b55f34abe
28 changed files with 92 additions and 61 deletions

View File

@@ -58,7 +58,7 @@ SET(PathPythonBaseGui_SRCS
SET(PathPythonDressup_SRCS
Path/Dressup/__init__.py
Path/Dressup/Utils.py
Path/Dressup/PathBoundary.py
Path/Dressup/Boundary.py
Path/Dressup/Tags.py
)
@@ -68,7 +68,7 @@ SET(PathPythonDressupGui_SRCS
Path/Dressup/Gui/Dogbone.py
Path/Dressup/Gui/Dragknife.py
Path/Dressup/Gui/LeadInOut.py
Path/Dressup/Gui/PathBoundary.py
Path/Dressup/Gui/Boundary.py
Path/Dressup/Gui/Preferences.py
Path/Dressup/Gui/RampEntry.py
Path/Dressup/Gui/Tags.py
@@ -76,6 +76,25 @@ SET(PathPythonDressupGui_SRCS
Path/Dressup/Gui/ZCorrect.py
)
SET(PathPythonMain_SRCS
Path/Main/__init__.py
Path/Main/Job.py
Path/Main/Stock.py
)
SET(PathPythonMainGui_SRCS
Path/Main/Gui/__init__.py
Path/Main/Gui/Camotics.py
Path/Main/Gui/Fixture.py
Path/Main/Gui/Inspect.py
Path/Main/Gui/Job.py
Path/Main/Gui/JobCmd.py
Path/Main/Gui/JobDlg.py
Path/Main/Gui/PreferencesJob.py
Path/Main/Gui/Sanity.py
Path/Main/Gui/Simulator.py
)
SET(PathPythonTools_SRCS
Path/Tool/__init__.py
Path/Tool/Bit.py
@@ -195,17 +214,6 @@ SET(PathPythonOpGui_SRCS
)
SET(PathScripts_SRCS
PathScripts/PathCamoticsGui.py
PathScripts/PathFixture.py
PathScripts/PathInspect.py
PathScripts/PathJob.py
PathScripts/PathJobCmd.py
PathScripts/PathJobDlg.py
PathScripts/PathJobGui.py
PathScripts/PathPreferencesPathJob.py
PathScripts/PathSanity.py
PathScripts/PathSimulatorGui.py
PathScripts/PathStock.py
PathScripts/PathUtils.py
PathScripts/PathUtilsGui.py
PathScripts/__init__.py
@@ -347,6 +355,8 @@ SET(all_files
${PathPythonBaseGenerator_SRCS}
${PathPythonDressup_SRCS}
${PathPythonDressupGui_SRCS}
${PathPythonMain_SRCS}
${PathPythonMainGui_SRCS}
${PathPythonOp_SRCS}
${PathPythonOpGui_SRCS}
${PathPythonPost_SRCS}
@@ -427,6 +437,19 @@ INSTALL(
Mod/Path/Path/Dressup/Gui
)
INSTALL(
FILES
${PathPythonMain_SRCS}
DESTINATION
Mod/Path/Path/Main
)
INSTALL(
FILES
${PathPythonMainGui_SRCS}
DESTINATION
Mod/Path/Path/Main/Gui
)
INSTALL(
FILES
${PathPythonOp_SRCS}

View File

@@ -59,8 +59,8 @@ class PathWorkbench(Workbench):
global PathCommandGroup
# Add preferences pages - before loading PathGui to properly order pages of Path group
from PathScripts import PathPreferencesPathJob
import Path.Dressup.Gui.Preferences as PathPreferencesPathDressup
import Path.Main.Gui.PreferencesJob as PathPreferencesPathJob
translate = FreeCAD.Qt.translate
@@ -78,8 +78,8 @@ class PathWorkbench(Workbench):
FreeCADGui.addLanguagePath(":/translations")
FreeCADGui.addIconPath(":/icons")
import Path.GuiInit
from PathScripts import PathJobCmd
from Path.Main.Gui import JobCmd as PathJobCmd
from Path.Tool.Gui import BitCmd as PathToolBitCmd
from Path.Tool.Gui import BitLibraryCmd as PathToolBitLibraryCmd

View File

@@ -25,7 +25,7 @@ import FreeCAD
import Path
import Path.Base.Util as PathUtil
import Path.Dressup.Utils as PathDressup
import PathScripts.PathStock as PathStock
import Path.Main.Stock as PathStock
import PathScripts.PathUtils as PathUtils
if False:

View File

@@ -25,7 +25,7 @@ from PySide.QtCore import QT_TRANSLATE_NOOP
import FreeCAD
import FreeCADGui
import Path
import Path.Dressup.PathBoundary as PathDressupPathBoundary
import Path.Dressup.Boundary as PathDressupPathBoundary
import PathGui
if False:
@@ -112,8 +112,8 @@ class TaskPanel(object):
self.setClean()
def updateStockEditor(self, index, force=False):
import PathScripts.PathJobGui as PathJobGui
import PathScripts.PathStock as PathStock
import Path.Main.Gui.Job as PathJobGui
import Path.Main.Stock as PathStock
def setupFromBaseEdit():
Path.Log.track(index, force)
@@ -289,9 +289,9 @@ class CommandPathDressupPathBoundary:
# everything ok!
FreeCAD.ActiveDocument.openTransaction("Create Path Boundary Dress-up")
FreeCADGui.addModule("Path.Dressup.Gui.PathBoundary")
FreeCADGui.addModule("Path.Dressup.Gui.Boundary")
FreeCADGui.doCommand(
"Path.Dressup.Gui.PathBoundary.Create(App.ActiveDocument.%s)"
"Path.Dressup.Gui.Boundary.Create(App.ActiveDocument.%s)"
% baseObject.Name
)
# FreeCAD.ActiveDocument.commitTransaction() # Final `commitTransaction()` called via TaskPanel.accept()

View File

@@ -21,7 +21,7 @@
# ***************************************************************************
import FreeCAD
import PathScripts.PathJob as PathJob
import Path.Main.Job as PathJob
def selection():

View File

@@ -44,10 +44,16 @@ def Startup():
from Path.Dressup.Gui import Dogbone
from Path.Dressup.Gui import Dragknife
from Path.Dressup.Gui import LeadInOut
from Path.Dressup.Gui import PathBoundary
from Path.Dressup.Gui import Boundary
from Path.Dressup.Gui import RampEntry
from Path.Dressup.Gui import Tags
from Path.Dressup.Gui import ZCorrect
from Path.Main.Gui import Fixture
from Path.Main.Gui import Inspect
from Path.Main.Gui import Sanity
from Path.Main.Gui import Simulator
from Path.Op.Gui import Adaptive
from Path.Op.Gui import Array
from Path.Op.Gui import Comment
@@ -71,10 +77,6 @@ def Startup():
from Path.Tool import Controller
from Path.Tool.Gui import Controller
from PathScripts import PathFixture
from PathScripts import PathInspect
from PathScripts import PathSanity
from PathScripts import PathSimulatorGui
from PathScripts import PathUtilsGui
from packaging.version import Version, parse
@@ -91,7 +93,7 @@ def Startup():
v = parse(r.decode("utf-8"))
if v >= Version("1.2.2"):
from PathScripts import PathCamoticsGui
from Path.Main.Gui import Camotics
except (FileNotFoundError, ModuleNotFoundError):
pass

View File

@@ -322,7 +322,7 @@ class CommandCamoticsSimulate:
return False
try:
job = FreeCADGui.Selection.getSelectionEx()[0].Object
return isinstance(job.Proxy, PathScripts.PathJob.ObjectJob)
return isinstance(job.Proxy, Path.Main.Job.ObjectJob)
except:
return False

View File

@@ -165,16 +165,16 @@ class CommandPathFixture:
def Activated(self):
FreeCAD.ActiveDocument.openTransaction("Create a Fixture Offset")
FreeCADGui.addModule("PathScripts.PathFixture")
FreeCADGui.addModule("Path.Main.Gui.Fixture")
snippet = """
import Path
import PathScripts
from PathScripts import PathUtils
prjexists = False
obj = FreeCAD.ActiveDocument.addObject("Path::FeaturePython","Fixture")
PathScripts.PathFixture.Fixture(obj)
Path.Main.Gui.Fixture.Fixture(obj)
obj.Active = True
PathScripts.PathFixture._ViewProviderFixture(obj.ViewObject)
Path.Main.Gui.Fixture._ViewProviderFixture(obj.ViewObject)
PathUtils.addToJob(obj)

View File

@@ -285,9 +285,9 @@ class CommandPathInspect:
return
# if everything is ok, execute
FreeCADGui.addModule("PathScripts.PathInspect")
FreeCADGui.addModule("Path.Main.Gui.Inspect")
FreeCADGui.doCommand(
"PathScripts.PathInspect.show(FreeCAD.ActiveDocument."
"Path.Main.Gui.Inspect.show(FreeCAD.ActiveDocument."
+ selection[0].Name
+ ")"
)

View File

@@ -31,12 +31,12 @@ import Path
import Path.Base.Gui.SetupSheet as PathSetupSheetGui
import Path.Base.Util as PathUtil
import Path.GuiInit as PathGuiInit
import Path.Main.Gui.JobCmd as PathJobCmd
import Path.Main.Gui.JobDlg as PathJobDlg
import Path.Main.Job as PathJob
import Path.Main.Stock as PathStock
import Path.Tool.Gui.Bit as PathToolBitGui
import Path.Tool.Gui.Controller as PathToolControllerGui
import PathScripts.PathJob as PathJob
import PathScripts.PathJobCmd as PathJobCmd
import PathScripts.PathJobDlg as PathJobDlg
import PathScripts.PathStock as PathStock
import PathScripts.PathUtils as PathUtils
import json
import math
@@ -1627,7 +1627,7 @@ class TaskPanel:
def Create(base, template=None, openTaskPanel=True):
"""Create(base, template) ... creates a job instance for the given base object
using template to configure it."""
FreeCADGui.addModule("PathScripts.PathJob")
FreeCADGui.addModule("Path.Main.Job")
FreeCAD.ActiveDocument.openTransaction("Create Job")
try:
obj = PathJob.Create("Job", base, template)

View File

@@ -26,9 +26,9 @@ import FreeCAD
import FreeCADGui
import Path
import Path.Base.Util as PathUtil
import PathScripts.PathJob as PathJob
import PathScripts.PathJobDlg as PathJobDlg
import PathScripts.PathStock as PathStock
import Path.Main.Gui.JobDlg as PathJobDlg
import Path.Main.Job as PathJob
import Path.Main.Stock as PathStock
import json
import os
@@ -75,13 +75,13 @@ class CommandJobCreate:
@classmethod
def Execute(cls, base, template):
FreeCADGui.addModule("PathScripts.PathJobGui")
FreeCADGui.addModule("Path.Main.Gui.Job")
if template:
template = "'%s'" % template
else:
template = "None"
FreeCADGui.doCommand(
"PathScripts.PathJobGui.Create(%s, %s)" % ([o.Name for o in base], template)
"Path.Main.Gui.Job.Create(%s, %s)" % ([o.Name for o in base], template)
)

View File

@@ -26,8 +26,8 @@ import FreeCAD
import FreeCADGui
import Path
import Path.Base.Util as PathUtil
import PathScripts.PathJob as PathJob
import PathScripts.PathStock as PathStock
import Path.Main.Job as PathJob
import Path.Main.Stock as PathStock
import glob
import os

View File

@@ -22,8 +22,8 @@
import FreeCAD
import Path
import Path.Main.Stock as PathStock
import Path.Post.Processor as PostProcessor
import PathScripts.PathStock as PathStock
import json
from FreeCAD import Units

View File

@@ -110,7 +110,7 @@ class CommandPathSanity:
def IsActive(self):
obj = FreeCADGui.Selection.getSelectionEx()[0].Object
return isinstance(obj.Proxy, PathScripts.PathJob.ObjectJob)
return isinstance(obj.Proxy, Path.Main.Job.ObjectJob)
def Activated(self):
# if everything is ok, execute
@@ -551,7 +551,7 @@ class CommandPathSanity:
m = 0
for i in obj.Document.Objects:
if hasattr(i, "Proxy"):
if isinstance(i.Proxy, PathScripts.PathJob.ObjectJob):
if isinstance(i.Proxy, Path.Main.Job.ObjectJob):
m += 1
if i is obj:
n = m

View File

@@ -24,8 +24,8 @@ import FreeCAD
import Path
import Path.Base.Util as PathUtil
import Path.Dressup.Utils as PathDressup
import Path.Main.Job as PathJob
import PathGui
import PathScripts.PathJob as PathJob
import PathSimulator
import math
import os

View File

View File

@@ -20,15 +20,15 @@
# * *
# ***************************************************************************
from Path.Post.Processor import PostProcessor
from PySide import QtCore
from PySide.QtCore import QT_TRANSLATE_NOOP
import FreeCAD
import Path
import Path.Base.SetupSheet as PathSetupSheet
import Path.Base.Util as PathUtil
from Path.Post.Processor import PostProcessor
import Path.Main.Stock as PathStock
import Path.Tool.Controller as PathToolController
import PathScripts.PathStock as PathStock
import json
import time

View File

View File

@@ -27,10 +27,10 @@ import Path.Base.Gui.GetPoint as PathGetPoint
import Path.Base.Gui.Util as PathGuiUtil
import Path.Base.SetupSheet as PathSetupSheet
import Path.Base.Util as PathUtil
import Path.Main.Job as PathJob
import Path.Op.Base as PathOp
import Path.Op.Gui.Selection as PathSelection
import PathGui
import PathScripts.PathJob as PathJob
import PathScripts.PathUtils as PathUtils
import importlib
from PySide.QtCore import QT_TRANSLATE_NOOP

View File

@@ -28,7 +28,7 @@ import FreeCAD
import FreeCADGui
import Path
import Path.Base.Util as PathUtil
import PathScripts.PathJob as PathJob
import Path.Main.Job as PathJob
import PathScripts.PathUtils as PathUtils
import os
import re

View File

@@ -25,7 +25,7 @@ import FreeCAD
from FreeCAD import Vector
from PySide import QtCore
import Path
import PathScripts.PathJob as PathJob
import Path.Main.Job as PathJob
import math
from numpy import linspace

View File

@@ -23,9 +23,9 @@
import FreeCADGui
import FreeCAD
import Path
import Path.Main.Gui.JobCmd as PathJobCmd
import Path.Tool.Controller as PathToolController
import PathGui
import PathScripts.PathJobCmd as PathJobCmd
import PathScripts.PathUtils as PathUtils
from PySide import QtGui

View File

@@ -1,3 +1,9 @@
This is a legacy directory. The remaining files in here should either get refactored so
they can move into the new structure or removed.
The PropertyBag diversion files are here in order to keep existing ToolBit files working.
They might get removed in future versions.
### Assigned Accel Keys:
* `P,I` ... Launch Path Inspector
* `P,J` ... Create Job

View File

@@ -25,12 +25,12 @@
import FreeCAD
import Part
import Path.Op.Adaptive as PathAdaptive
import PathScripts.PathJob as PathJob
import Path.Main.Job as PathJob
from PathTests.PathTestUtils import PathTestBase
if FreeCAD.GuiUp:
import Path.Main.gui.Job as PathJobGui
import Path.Op.Gui.Adaptive as PathAdaptiveGui
import PathScripts.PathJobGui as PathJobGui
class TestPathAdaptive(PathTestBase):

View File

@@ -23,7 +23,7 @@
import FreeCAD
import Path
import Path.Dressup.Gui.Dogbone as PathDressupDogbone
import PathScripts.PathJob as PathJob
import Path.Main.Job as PathJob
import Path.Op.Profile as PathProfile
from PathTests.PathTestUtils import PathTestBase

View File

@@ -23,8 +23,8 @@
import Draft
import FreeCAD
import Path
import Path.Main.Job as PathJob
import Path.Op.Helix as PathHelix
import PathScripts.PathJob as PathJob
import PathTests.PathTestUtils as PathTestUtils
Path.Log.setLevel(Path.Log.Level.INFO, Path.Log.thisModule())

View File

@@ -21,7 +21,7 @@
# ***************************************************************************
import FreeCAD
import PathScripts.PathStock as PathStock
import Path.Main.Stock as PathStock
from PathTests.PathTestUtils import PathTestBase