Added interface selector

pull/248/head
migo101 2023-06-12 20:17:39 +02:00
rodzic c269a6a4eb
commit e72639c0bd
6 zmienionych plików z 36 dodań i 6 usunięć

Wyświetl plik

@ -466,12 +466,12 @@ def getStrategyList(scene, context):
class camOperation(bpy.types.PropertyGroup):
interface: bpy.props.PointerProperty(type=CAM_INTERFACE_Properties)
material: bpy.props.PointerProperty(type=CAM_MATERIAL_Properties)
info: bpy.props.PointerProperty(type=CAM_INFO_Properties)
optimisation: bpy.props.PointerProperty(type=CAM_OPTIMISATION_Properties)
movement: bpy.props.PointerProperty(type=CAM_MOVEMENT_Properties)
name: bpy.props.StringProperty(name="Operation Name", default="Operation", update=updateRest)
filename: bpy.props.StringProperty(name="File name", default="Operation", update=updateRest)
auto_export: bpy.props.BoolProperty(name="Auto export",
@ -1143,6 +1143,7 @@ def get_panels(): # convenience function for bot register and unregister functi
machineSettings,
CamAddonPreferences,
ui.CAM_INTERFACE_Panel,
ui.CAM_CHAINS_Panel,
ui.CAM_OPERATIONS_Panel,
ui.CAM_INFO_Panel,
@ -1345,6 +1346,8 @@ classes = [
CamAddonPreferences,
import_settings,
ui.CAM_INTERFACE_Panel,
ui.CAM_INTERFACE_Properties,
ui.CAM_CHAINS_Panel,
ui.CAM_OPERATIONS_Panel,
ui.CAM_INFO_Properties,

Wyświetl plik

@ -35,6 +35,7 @@ from cam import gcodeimportparser, simple
from cam.simple import *
from cam.ui_panels.buttons_panel import CAMButtonsPanel
from cam.ui_panels.interface import *
from cam.ui_panels.info import *
from cam.ui_panels.operations import *
from cam.ui_panels.cutter import *

Wyświetl plik

@ -6,6 +6,7 @@ class CAMButtonsPanel:
bl_region_type = 'WINDOW'
bl_context = "render"
always_show_panel = False
COMPAT_ENGINES = {'BLENDERCAM_RENDER'}
# COMPAT_ENGINES must be defined in each subclass, external engines can add themselves here

Wyświetl plik

@ -0,0 +1,30 @@
import bpy
import math
from cam.ui_panels.buttons_panel import CAMButtonsPanel
import cam.utils
import cam.constants
class CAM_INTERFACE_Properties(bpy.types.PropertyGroup):
interface_level: bpy.props.EnumProperty(
name="Interface",
description="Choose the interface details",
items=[('0', "Basic", "Basic interface"),
('1', "Advanced", "Advanced interface"),
('2', "Complete", "Complete interface")],
default='0',
)
class CAM_INTERFACE_Panel(CAMButtonsPanel, bpy.types.Panel):
bl_label = "CAM interface"
bl_idname = "WORLD_PT_CAM_INTERFACE"
always_show_panel = True
def draw_interface_level(self):
self.layout.prop(self.op.interface, 'interface_level')
def draw(self, context):
self.context = context
scene = bpy.context.scene
self.draw_interface_level()

Wyświetl plik

@ -109,8 +109,6 @@ class CAM_MOVEMENT_Panel(CAMButtonsPanel, bpy.types.Panel):
bl_label = "CAM movement"
bl_idname = "WORLD_PT_CAM_MOVEMENT"
COMPAT_ENGINES = {'BLENDERCAM_RENDER'}
def draw_cut_type(self):
self.layout.prop(self.op.movement, 'type')
if self.op.movement.type in ['BLOCK', 'SPIRAL', 'CIRCLES']:

Wyświetl plik

@ -11,15 +11,12 @@ from cam.ui_panels.buttons_panel import CAMButtonsPanel
#
# For each operation, generate the corresponding gcode and export the gcode file
class CAM_OPERATIONS_Panel(CAMButtonsPanel, bpy.types.Panel):
"""CAM operations panel"""
bl_label = "CAM operations"
bl_idname = "WORLD_PT_CAM_OPERATIONS"
always_show_panel = True
COMPAT_ENGINES = {'BLENDERCAM_RENDER'}
# Main draw function
def draw(self, context):
self.draw_operations_list()