kopia lustrzana https://github.com/vilemduha/blendercam
Aync Op Mixin __init__ update
rodzic
4dfed898c8
commit
157fb6df2b
|
@ -16,7 +16,7 @@ class AsyncCancelledException(Exception):
|
|||
|
||||
|
||||
class AsyncOperatorMixin:
|
||||
def __init__(self):
|
||||
def __init__(self, *args, **kwargs):
|
||||
self.timer = None
|
||||
self.coroutine = None
|
||||
self._is_cancelled = False
|
||||
|
|
|
@ -246,6 +246,11 @@ class CalculatePath(Operator, AsyncOperatorMixin):
|
|||
bl_label = "Calculate CAM Paths"
|
||||
bl_options = {"REGISTER", "UNDO", "BLOCKING"}
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
Operator.__init__(self, *args, **kwargs)
|
||||
AsyncOperatorMixin.__init__(self, *args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
"""Check if the current CAM operation is valid.
|
||||
|
@ -346,6 +351,11 @@ class PathsChain(Operator, AsyncOperatorMixin):
|
|||
bl_label = "Calculate CAM Paths in Current Chain and Export Chain G-code"
|
||||
bl_options = {"REGISTER", "UNDO", "BLOCKING"}
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
Operator.__init__(self, *args, **kwargs)
|
||||
AsyncOperatorMixin.__init__(self, *args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
"""Check the validity of the active CAM chain in the given context.
|
||||
|
|
|
@ -41,6 +41,11 @@ class CAMSimulate(Operator, AsyncOperatorMixin):
|
|||
default="Operation",
|
||||
)
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
Operator.__init__(self, *args, **kwargs)
|
||||
AsyncOperatorMixin.__init__(self, *args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
async def execute_async(self, context):
|
||||
"""Execute an asynchronous simulation operation based on the active CAM
|
||||
operation.
|
||||
|
@ -100,6 +105,11 @@ class CAMSimulateChain(Operator, AsyncOperatorMixin):
|
|||
bl_label = "CAM Simulation"
|
||||
bl_options = {"REGISTER", "UNDO", "BLOCKING"}
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
Operator.__init__(self, *args, **kwargs)
|
||||
AsyncOperatorMixin.__init__(self, *args, **kwargs)
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
@classmethod
|
||||
def poll(cls, context):
|
||||
"""Check the validity of the active CAM chain in the scene.
|
||||
|
|
Ładowanie…
Reference in New Issue