Commit 0544c30d authored by sumpfralle's avatar sumpfralle

added categories to all plugins


git-svn-id: https://pycam.svn.sourceforge.net/svnroot/pycam/trunk@1160 bbaffbd6-741e-11dd-a85d-61de82d9cad9
parent dcfc6c0f
......@@ -33,6 +33,7 @@ class Bounds(pycam.Plugins.ListPluginBase):
UI_FILE = "bounds.ui"
DEPENDS = ["Models"]
CATEGORIES = ["Bounds"]
COLUMN_REF, COLUMN_NAME = range(2)
LIST_ATTRIBUTE_MAP = {"ref": COLUMN_REF, "name": COLUMN_NAME}
......
......@@ -40,6 +40,7 @@ class Clipboard(pycam.Plugins.PluginBase):
UI_FILE = "clipboard.ui"
DEPENDS = ["Models"]
CATEGORIES = ["System"]
def setup(self):
if self.gui:
......
......@@ -36,6 +36,7 @@ class Fonts(pycam.Plugins.PluginBase):
UI_FILE = "fonts.ui"
DEPENDS = ["Clipboard"]
CATEGORIES = ["Fonts"]
def setup(self):
self._fonts_cache = pycam.Utils.FontCache.FontCache(get_font_dir(),
......
......@@ -31,6 +31,7 @@ class Log(pycam.Plugins.PluginBase):
UI_FILE = "log.ui"
DEPENDS = ["Clipboard"]
CATEGORIES = ["System"]
def setup(self):
if self.gui:
......
......@@ -38,6 +38,7 @@ class ModelExtrusion(pycam.Plugins.PluginBase):
UI_FILE = "model_extrusion.ui"
DEPENDS = ["Models"]
CATEGORIES = ["Model"]
def setup(self):
if self.gui:
......
......@@ -28,6 +28,7 @@ class ModelPlaneMirror(pycam.Plugins.PluginBase):
UI_FILE = "model_plane_mirror.ui"
DEPENDS = ["Models"]
CATEGORIES = ["Model"]
def setup(self):
if self.gui:
......
......@@ -28,6 +28,7 @@ class ModelPolygons(pycam.Plugins.PluginBase):
UI_FILE = "model_polygons.ui"
DEPENDS = ["Models"]
CATEGORIES = ["Model"]
def setup(self):
if self.gui:
......
......@@ -28,6 +28,7 @@ class ModelPosition(pycam.Plugins.PluginBase):
UI_FILE = "model_position.ui"
DEPENDS = ["Models"]
CATEGORIES = ["Model"]
def setup(self):
if self.gui:
......
......@@ -30,6 +30,7 @@ class ModelProjection(pycam.Plugins.PluginBase):
UI_FILE = "model_projection.ui"
DEPENDS = ["Models"]
CATEGORIES = ["Model"]
def setup(self):
if self.gui:
......
......@@ -29,6 +29,7 @@ class ModelRotation(pycam.Plugins.PluginBase):
UI_FILE = "model_rotation.ui"
DEPENDS = ["Models"]
CATEGORIES = ["Model"]
def setup(self):
if self.gui:
......
......@@ -28,6 +28,7 @@ class ModelScaling(pycam.Plugins.PluginBase):
UI_FILE = "model_scaling.ui"
DEPENDS = ["Models"]
CATEGORIES = ["Model"]
def setup(self):
if self.gui:
......
......@@ -28,6 +28,7 @@ class ModelSupport(pycam.Plugins.PluginBase):
UI_FILE = "model_support.ui"
DEPENDS = ["Models"]
CATEGORIES = ["Model", "Support bridges"]
def setup(self):
if self.gui:
......
......@@ -28,6 +28,7 @@ class ModelSupportDistributed(pycam.Plugins.PluginBase):
UI_FILE = "model_support_distributed.ui"
DEPENDS = ["Models", "ModelSupport"]
CATEGORIES = ["Model", "Support bridges"]
def setup(self):
if self.gui:
......
......@@ -30,6 +30,7 @@ class ModelSupportGrid(pycam.Plugins.PluginBase):
UI_FILE = "model_support_grid.ui"
DEPENDS = ["Models", "ModelSupport"]
CATEGORIES = ["Model", "Support bridges"]
def setup(self):
if self.gui:
......
......@@ -28,6 +28,7 @@ class ModelSwapAxes(pycam.Plugins.PluginBase):
UI_FILE = "model_swap_axes.ui"
DEPENDS = ["Models"]
CATEGORIES = ["Model"]
def setup(self):
if self.gui:
......
......@@ -31,6 +31,7 @@ _GTK_COLOR_MAX = 65535.0
class Models(pycam.Plugins.ListPluginBase):
UI_FILE = "models.ui"
CATEGORIES = ["Model"]
COLUMN_REF, COLUMN_NAME, COLUMN_VISIBLE, COLUMN_COLOR, COLUMN_ALPHA = range(5)
LIST_ATTRIBUTE_MAP = {"name": COLUMN_NAME, "visible": COLUMN_VISIBLE,
"color": COLUMN_COLOR, "alpha": COLUMN_ALPHA}
......
......@@ -27,6 +27,7 @@ from pycam.Geometry.utils import number
class OpenGLViewAxes(pycam.Plugins.PluginBase):
DEPENDS = ["OpenGLWindow"]
CATEGORIES = ["Visualization", "OpenGL"]
def setup(self):
import OpenGL.GL
......
......@@ -26,6 +26,7 @@ import pycam.Plugins
class OpenGLViewBounds(pycam.Plugins.PluginBase):
DEPENDS = ["OpenGLWindow", "Bounds"]
CATEGORIES = ["Bounds", "Visualization", "OpenGL"]
def setup(self):
import OpenGL.GL
......
......@@ -30,6 +30,7 @@ GTK_COLOR_MAX = 65535.0
class OpenGLViewModel(pycam.Plugins.PluginBase):
DEPENDS = ["OpenGLWindow", "Models"]
CATEGORIES = ["Model", "Visualization", "OpenGL"]
def setup(self):
import gtk
......@@ -96,6 +97,7 @@ class OpenGLViewModel(pycam.Plugins.PluginBase):
class OpenGLViewModelTriangle(pycam.Plugins.PluginBase):
DEPENDS = ["OpenGLViewModel"]
CATEGORIES = ["Model", "Visualization", "OpenGL"]
def setup(self):
import OpenGL.GL
......@@ -150,6 +152,7 @@ class OpenGLViewModelTriangle(pycam.Plugins.PluginBase):
class OpenGLViewModelGeneric(pycam.Plugins.PluginBase):
DEPENDS = ["OpenGLViewModel"]
CATEGORIES = ["Model", "Visualization", "OpenGL"]
def setup(self):
self.core.register_chain("draw_models", self.draw_generic_model, 100)
......
......@@ -26,6 +26,7 @@ import pycam.Plugins
class OpenGLViewToolpath(pycam.Plugins.PluginBase):
DEPENDS = ["OpenGLWindow", "Toolpaths"]
CATEGORIES = ["Toolpath", "Visualization", "OpenGL"]
def setup(self):
import OpenGL.GL
......
......@@ -73,6 +73,7 @@ class OpenGLWindow(pycam.Plugins.PluginBase):
UI_FILE = "opengl.ui"
# TODO: drop the dependecy on "Models" as soon as the calls for get("models") are gone
DEPENDS = ["Models"]
CATEGORIES = ["Visualization", "OpenGL"]
def setup(self):
if not GL_ENABLED:
......
......@@ -31,6 +31,7 @@ import pycam.Plugins
class ParallelProcessing(pycam.Plugins.PluginBase):
UI_FILE = "parallel_processing.ui"
CATEGORIES = ["System"]
def setup(self):
if self.gui:
......
......@@ -26,6 +26,8 @@ import pycam.Plugins
class ParameterGroupManager(pycam.Plugins.PluginBase):
CATEGORIES = ["Plugins"]
def setup(self):
self._groups = {}
self.core.set("get_parameters", self.get_parameters)
......
......@@ -29,6 +29,7 @@ import pycam.Toolpath.MotionGrid
class PathParamOverlap(pycam.Plugins.PluginBase):
DEPENDS = ["Processes"]
CATEGORIES = ["Process", "Parameter"]
def setup(self):
# configure the input/output converter
......@@ -50,6 +51,7 @@ class PathParamOverlap(pycam.Plugins.PluginBase):
class PathParamStepDown(pycam.Plugins.PluginBase):
DEPENDS = ["Processes"]
CATEGORIES = ["Process", "Parameter"]
def setup(self):
widget = pycam.Gui.ControlsGTK.InputNumber(lower=0.01, upper=1000,
......@@ -67,6 +69,7 @@ class PathParamStepDown(pycam.Plugins.PluginBase):
class PathParamMaterialAllowance(pycam.Plugins.PluginBase):
DEPENDS = ["Processes"]
CATEGORIES = ["Process", "Parameter"]
def setup(self):
widget = pycam.Gui.ControlsGTK.InputNumber(start=0, lower=0, upper=100,
......@@ -84,6 +87,7 @@ class PathParamMaterialAllowance(pycam.Plugins.PluginBase):
class PathParamMillingStyle(pycam.Plugins.PluginBase):
DEPENDS = ["Processes"]
CATEGORIES = ["Process", "Parameter"]
def setup(self):
input_control = pycam.Gui.ControlsGTK.InputChoice(
......@@ -104,6 +108,7 @@ class PathParamMillingStyle(pycam.Plugins.PluginBase):
class PathParamGridDirection(pycam.Plugins.PluginBase):
DEPENDS = ["Processes"]
CATEGORIES = ["Process", "Parameter"]
def setup(self):
input_control = pycam.Gui.ControlsGTK.InputChoice(
......@@ -124,6 +129,7 @@ class PathParamGridDirection(pycam.Plugins.PluginBase):
class PathParamRadiusCompensation(pycam.Plugins.PluginBase):
DEPENDS = ["Processes"]
CATEGORIES = ["Process", "Parameter"]
def setup(self):
widget = pycam.Gui.ControlsGTK.InputCheckBox(
......@@ -141,6 +147,7 @@ class PathParamRadiusCompensation(pycam.Plugins.PluginBase):
class PathParamTraceModel(pycam.Plugins.PluginBase):
DEPENDS = ["Processes", "Models"]
CATEGORIES = ["Process", "Parameter"]
def setup(self):
self.input_control = pycam.Gui.ControlsGTK.InputTable([],
......
......@@ -30,7 +30,7 @@ import pycam.Plugins
class PluginSelector(pycam.Plugins.PluginBase):
UI_FILE = "plugin_selector.ui"
CATEGORIES = ["Plugins"]
COLUMN_NAME, COLUMN_DESCRIPTION, COLUMN_ENABLED, COLUMN_DEPENDS, \
COLUMN_DEPENDS_OK, COLUMN_SOURCE = range(6)
......
......@@ -27,6 +27,7 @@ from pycam.Exporters.GCodeExporter import GCodeGenerator
class PostprocessorEMC2(pycam.Plugins.PluginBase):
DEPENDS = ["ToolpathExport"]
CATEGORIES = ["Postprocessor"]
def setup(self):
self.core.get("register_postprocessor")("emc2", "EMC2", GCodeGenerator)
......
......@@ -32,6 +32,7 @@ class ProcessStrategySlicing(pycam.Plugins.PluginBase):
DEPENDS = ["ParameterGroupManager", "PathParamOverlap",
"PathParamStepDown", "PathParamMaterialAllowance",
"PathParamMillingStyle", "PathParamGridDirection"]
CATEGORIES = ["Process"]
def setup(self):
parameters = {"overlap": 0.1,
......@@ -69,6 +70,7 @@ class ProcessStrategyContour(pycam.Plugins.PluginBase):
DEPENDS = ["Processes", "PathParamStepDown",
"PathParamMaterialAllowance", "PathParamMillingStyle"]
CATEGORIES = ["Process"]
def setup(self):
parameters = {"step_down": 1.0,
......@@ -92,6 +94,7 @@ class ProcessStrategySurfacing(pycam.Plugins.PluginBase):
DEPENDS = ["ParameterGroupManager", "PathParamOverlap",
"PathParamMaterialAllowance", "PathParamMillingStyle",
"PathParamGridDirection"]
CATEGORIES = ["Process"]
def setup(self):
parameters = {"overlap": 0.6,
......@@ -130,6 +133,7 @@ class ProcessStrategyEngraving(pycam.Plugins.PluginBase):
DEPENDS = ["ParameterGroupManager", "PathParamStepDown",
"PathParamMillingStyle", "PathParamRadiusCompensation",
"PathParamTraceModel"]
CATEGORIES = ["Process"]
def setup(self):
parameters = {"step_down": 1.0,
......
......@@ -26,7 +26,7 @@ import pycam.Plugins
class Processes(pycam.Plugins.ListPluginBase):
DEPENDS = ["ParameterGroupManager"]
CATEGORIES = ["Process"]
UI_FILE = "processes.ui"
COLUMN_REF, COLUMN_NAME = range(2)
LIST_ATTRIBUTE_MAP = {"ref": COLUMN_REF, "name": COLUMN_NAME}
......
......@@ -30,6 +30,7 @@ import pycam.Plugins
class ProgressBar(pycam.Plugins.PluginBase):
UI_FILE = "progress_bar.ui"
CATEGORIES = ["System"]
def setup(self):
if self.gui:
......
......@@ -28,6 +28,7 @@ import pycam.Gui.ControlsGTK
class TaskParamCollisionModels(pycam.Plugins.PluginBase):
DEPENDS = ["Models", "Tasks"]
CATEGORIES = ["Model", "Task", "Parameter"]
def setup(self):
self.input_control = pycam.Gui.ControlsGTK.InputTable([],
......@@ -69,6 +70,7 @@ class TaskParamCollisionModels(pycam.Plugins.PluginBase):
class TaskParamTool(pycam.Plugins.PluginBase):
DEPENDS = ["Tools", "Tasks"]
CATEGORIES = ["Tool", "Task", "Parameter"]
def setup(self):
self.input_control = pycam.Gui.ControlsGTK.InputChoice([],
......@@ -96,6 +98,7 @@ class TaskParamTool(pycam.Plugins.PluginBase):
class TaskParamProcess(pycam.Plugins.PluginBase):
DEPENDS = ["Processes", "Tasks"]
CATEGORIES = ["Process", "Task", "Parameter"]
def setup(self):
self.input_control = pycam.Gui.ControlsGTK.InputChoice([],
......@@ -123,6 +126,7 @@ class TaskParamProcess(pycam.Plugins.PluginBase):
class TaskParamBounds(pycam.Plugins.PluginBase):
DEPENDS = ["Bounds", "Tasks"]
CATEGORIES = ["Bounds", "Task", "Parameter"]
def setup(self):
self.input_control = pycam.Gui.ControlsGTK.InputChoice([],
......
......@@ -28,6 +28,7 @@ class TaskTypeMilling(pycam.Plugins.PluginBase):
DEPENDS = ["Tasks", "TaskParamCollisionModels", "TaskParamTool",
"TaskParamProcess", "TaskParamBounds"]
CATEGORIES = ["Task"]
def setup(self):
parameters = {"collision_models": [],
......
......@@ -30,6 +30,7 @@ from pycam.Exporters.GCodeExporter import GCodeGenerator
class Tasks(pycam.Plugins.ListPluginBase):
UI_FILE = "tasks.ui"
CATEGORIES = ["Task"]
COLUMN_REF, COLUMN_NAME = range(2)
LIST_ATTRIBUTE_MAP = {"id": COLUMN_REF, "name": COLUMN_NAME}
DEPENDS = ["Models", "Tools", "Processes", "Bounds", "Toolpaths"]
......
......@@ -28,6 +28,7 @@ import pycam.Gui.ControlsGTK
class ToolParamRadius(pycam.Plugins.PluginBase):
DEPENDS = ["Tools"]
CATEGORIES = ["Tool", "Parameter"]
def setup(self):
control = pycam.Gui.ControlsGTK.InputNumber(lower=0, upper=99, digits=0,
......@@ -55,6 +56,7 @@ class ToolParamRadius(pycam.Plugins.PluginBase):
class ToolParamTorusRadius(pycam.Plugins.PluginBase):
DEPENDS = ["Tools"]
CATEGORIES = ["Tool", "Parameter"]
def setup(self):
control = pycam.Gui.ControlsGTK.InputNumber(lower=0, upper=99, digits=0,
......@@ -71,6 +73,7 @@ class ToolParamTorusRadius(pycam.Plugins.PluginBase):
class ToolParamFeedrate(pycam.Plugins.PluginBase):
DEPENDS = ["Tools"]
CATEGORIES = ["Tool", "Parameter"]
def setup(self):
control = pycam.Gui.ControlsGTK.InputNumber(lower=0, upper=10000,
......@@ -95,6 +98,7 @@ class ToolParamFeedrate(pycam.Plugins.PluginBase):
class ToolParamSpindleSpeed(pycam.Plugins.PluginBase):
DEPENDS = ["Tools"]
CATEGORIES = ["Tool", "Parameter"]
def setup(self):
control = pycam.Gui.ControlsGTK.InputNumber(lower=0, upper=100000,
......
......@@ -30,6 +30,7 @@ import pycam.Cutters.CylindricalCutter
class ToolTypeBallNose(pycam.Plugins.PluginBase):
DEPENDS = ["Tools", "ToolParamRadius", "ToolParamFeedrate"]
CATEGORIES = ["Tool", "Parameter"]
def setup(self):
parameters = {"radius": 1.0,
......@@ -52,6 +53,7 @@ class ToolTypeBullNose(pycam.Plugins.PluginBase):
DEPENDS = ["Tools", "ToolParamRadius", "ToolParamTorusRadius",
"ToolParamFeedrate"]
CATEGORIES = ["Tool", "Parameter"]
def setup(self):
parameters = {"radius": 1.0,
......@@ -76,6 +78,7 @@ class ToolTypeBullNose(pycam.Plugins.PluginBase):
class ToolTypeFlat(pycam.Plugins.PluginBase):
DEPENDS = ["Tools", "ToolParamRadius", "ToolParamFeedrate"]
CATEGORIES = ["Tool", "Parameter"]
def setup(self):
parameters = {"radius": 1.0,
......
......@@ -27,17 +27,11 @@ from pycam.Geometry.Plane import Plane
import pycam.Gui.ControlsGTK
"""
TODO:
- get the currently selected toolpath (from the table)
- update the current crop-polygons instantly (3D)
- update the ToolpathCropInfoLabel content if no polygons are found
"""
class ToolpathCrop(pycam.Plugins.PluginBase):
UI_FILE = "toolpath_crop.ui"
DEPENDS = ["Toolpaths"]
CATEGORIES = ["Toolpath"]
def setup(self):
if self.gui:
......
......@@ -34,6 +34,7 @@ class ToolpathExport(pycam.Plugins.PluginBase):
UI_FILE = "toolpath_export.ui"
DEPENDS = ["Toolpaths"]
CATEGORIES = ["Toolpath", "Export"]
def setup(self):
self._postprocessors = {}
......
......@@ -29,6 +29,7 @@ class ToolpathGrid(pycam.Plugins.PluginBase):
UI_FILE = "toolpath_grid.ui"
DEPENDS = ["Toolpaths"]
CATEGORIES = ["Toolpath"]
def setup(self):
if self.gui:
......
......@@ -29,6 +29,7 @@ import pycam.Plugins
class ToolpathSimulation(pycam.Plugins.PluginBase):
UI_FILE = "toolpath_simulation.ui"
CATEGORIES = ["Toolpath"]
def setup(self):
if self.gui:
......
......@@ -26,6 +26,7 @@ import pycam.Plugins
class Toolpaths(pycam.Plugins.ListPluginBase):
UI_FILE = "toolpaths.ui"
CATEGORIES = ["Toolpath"]
COLUMN_REF, COLUMN_NAME, COLUMN_VISIBLE = range(3)
LIST_ATTRIBUTE_MAP = {"name": COLUMN_NAME, "visible": COLUMN_VISIBLE}
ICONS = {"visible": "visible.svg", "hidden": "visible_off.svg"}
......
......@@ -29,6 +29,7 @@ from pycam.Cutters.ToroidalCutter import ToroidalCutter
class Tools(pycam.Plugins.ListPluginBase):
DEPENDS = ["ParameterGroupManager"]
CATEGORIES = ["Tool"]
UI_FILE = "tools.ui"
COLUMN_REF, COLUMN_TOOL_ID, COLUMN_NAME = range(3)
LIST_ATTRIBUTE_MAP = {"id": COLUMN_TOOL_ID, "name": COLUMN_NAME}
......
......@@ -26,6 +26,7 @@ import pycam.Plugins
class Units(pycam.Plugins.PluginBase):
UI_FILE = "units.ui"
CATEGORIES = ["System"]
def setup(self):
if self.gui:
......
......@@ -38,6 +38,7 @@ class PluginBase(object):
UI_FILE = None
DEPENDS = []
CATEGORIES = []
ICONS = {}
ICON_SIZE = 23
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment