- updated the Tcl commands PlotAll and PlotObjects to have a parameter that control if the objects are to be plotted or not on canvas; it serve as a disable/enable

This commit is contained in:
Marius Stanciu
2020-04-13 20:28:39 +03:00
committed by Marius
parent 1b14e9d451
commit 742180d6e3
5 changed files with 54 additions and 19 deletions

View File

@@ -23,6 +23,7 @@ class TclCommandPlotAll(TclCommandSignaled):
# Dictionary of types from Tcl command, needs to be ordered , this is for options like -optionname value
option_types = collections.OrderedDict([
('plot_status', str),
('use_thread', str)
])
@@ -33,9 +34,10 @@ class TclCommandPlotAll(TclCommandSignaled):
help = {
'main': "Plots all objects on GUI.",
'args': collections.OrderedDict([
('plot_status', 'If to display or not the objects: True (1) or False (0).'),
('use_thread', 'If to use multithreading: True (1) or False (0).')
]),
'examples': ['plot_all']
'examples': ['plot_all', 'plot_all -plot_status False']
}
def execute(self, args, unnamed_args):
@@ -51,5 +53,16 @@ class TclCommandPlotAll(TclCommandSignaled):
else:
threaded = False
if 'plot_status' in args:
if args['plot_status'] is None:
plot_status = True
else:
plot_status = bool(eval(args['plot_status']))
else:
plot_status = True
for obj in self.app.collection.get_list():
obj.options["plot"] = True if plot_status is True else False
if self.app.cmd_line_headless != 1:
self.app.plot_all(use_thread=threaded)