- added a new TclCommand named PlotObjects which will plot a list of FlatCAM objects

- made that after opening an object in FlatCAM it is not automatically plotted. If the user wants to plot it can use the TclCommands PlotAll or PlotObjects
- modified the TclCommands that open files to not plot the opened files automatically
This commit is contained in:
Marius Stanciu
2019-09-16 00:47:15 +03:00
committed by Marius
parent c06317374e
commit 2f553c9005
10 changed files with 122 additions and 51 deletions

View File

@@ -163,35 +163,36 @@ class TclCommand(object):
@staticmethod
def parse_arguments(args):
"""
Pre-processes arguments to detect '-keyword value' pairs into dictionary
and standalone parameters into list.
"""
Pre-processes arguments to detect '-keyword value' pairs into dictionary
and standalone parameters into list.
This is copy from FlatCAMApp.setup_shell().h() just for accessibility,
original should be removed after all commands will be converted
This is copy from FlatCAMApp.setup_shell().h() just for accessibility,
original should be removed after all commands will be converted
:param args: arguments from tcl to parse
:return: arguments, options
"""
:param args: arguments from tcl to parse
:return: arguments, options
"""
options = {}
arguments = []
n = len(args)
name = None
for i in range(n):
match = re.search(r'^-([a-zA-Z].*)', args[i])
if match:
assert name is None
name = match.group(1)
continue
options = {}
arguments = []
n = len(args)
if name is None:
arguments.append(args[i])
else:
options[name] = args[i]
name = None
name = None
for i in range(n):
match = re.search(r'^-([a-zA-Z].*)', args[i])
if match:
assert name is None
name = match.group(1)
continue
return arguments, options
if name is None:
arguments.append(args[i])
else:
options[name] = args[i]
name = None
return arguments, options
def check_args(self, args):
"""
@@ -274,7 +275,6 @@ class TclCommand(object):
"""
# self.worker_task.emit({'fcn': self.exec_command_test, 'params': [text, False]})
try:
self.log.debug("TCL command '%s' executed." % str(self.__class__))
self.original_args = args