- some fixes in the NCC Tcl command (using the bool() method on some params)

This commit is contained in:
Marius Stanciu 2019-12-30 23:33:22 +02:00 committed by Marius
parent cfa4f7ee7d
commit 258bd529d2
4 changed files with 13 additions and 8 deletions

View File

@ -19,6 +19,7 @@ CAD program, and create G-Code for Isolation routing.
- fixed Tcl commands that use the overlap parameter to switch from fraction to percentage - fixed Tcl commands that use the overlap parameter to switch from fraction to percentage
- in Transform Tool mae sure that the buffer sub-tool parameters are better explained in tooltips - in Transform Tool mae sure that the buffer sub-tool parameters are better explained in tooltips
- attempt to make TclCommand quit_flatcam work under Linux - attempt to make TclCommand quit_flatcam work under Linux
- some fixes in the NCC Tcl command (using the bool() method on some params)
29.12.2019 29.12.2019

View File

@ -55,7 +55,8 @@ class TclCommandCopperClear(TclCommand):
('name', 'Name of the source Geometry object. String.'), ('name', 'Name of the source Geometry object. String.'),
('tooldia', 'Diameter of the tool to be used. Can be a comma separated list of diameters. No space is ' ('tooldia', 'Diameter of the tool to be used. Can be a comma separated list of diameters. No space is '
'allowed between tool diameters. E.g: correct: 0.5,1 / incorrect: 0.5, 1'), 'allowed between tool diameters. E.g: correct: 0.5,1 / incorrect: 0.5, 1'),
('overlap', 'Percentage of the tool diameter to overlap cuts. Float number, [0%, 99.9999%]'), ('overlap', 'Percentage of tool diameter to overlap current pass over previous pass. Float [0, 99.9999]\n'
'E.g: for a 25% from tool diameter overlap use -overlap 25'),
('margin', 'Bounding box margin. Float number.'), ('margin', 'Bounding box margin. Float number.'),
('order', 'Can have the values: "no", "fwd" and "rev". String.' ('order', 'Can have the values: "no", "fwd" and "rev". String.'
'It is useful when there are multiple tools in tooldia parameter.' 'It is useful when there are multiple tools in tooldia parameter.'
@ -68,13 +69,13 @@ class TclCommandCopperClear(TclCommand):
('rest', 'Use rest-machining. True or False'), ('rest', 'Use rest-machining. True or False'),
('has_offset', 'The offset will used only if this is set True or present in args. True or False.'), ('has_offset', 'The offset will used only if this is set True or present in args. True or False.'),
('offset', 'The copper clearing will finish to a distance from copper features. Float number.'), ('offset', 'The copper clearing will finish to a distance from copper features. Float number.'),
('all', 'Will copper clear the whole object. 1 = enabled, anything else = disabled'), ('all', 'Will copper clear the whole object. 1 or True = enabled, anything else = disabled'),
('ref', 'Will clear of extra copper all polygons within a specified object with the name in "box" ' ('ref', 'Will clear of extra copper all polygons within a specified object with the name in "box" '
'parameter. 1 = enabled, anything else = disabled'), 'parameter. 1 or True = enabled, anything else = disabled'),
('box', 'Name of the object to be used as reference. Required when selecting "ref" = 1. String.'), ('box', 'Name of the object to be used as reference. Required when selecting "ref" = 1. String.'),
('outname', 'Name of the resulting Geometry object. String.'), ('outname', 'Name of the resulting Geometry object. String.'),
]), ]),
'examples': [] 'examples': ["ncc obj_name -tooldia 0.3,1 -overlap 10 -margin 1.0 -method 'lines' -all True"]
} }
def execute(self, args, unnamed_args): def execute(self, args, unnamed_args):
@ -217,7 +218,7 @@ class TclCommandCopperClear(TclCommand):
outname = name + "_ncc_rm" outname = name + "_ncc_rm"
# Non-Copper clear all polygons in the non-copper clear object # Non-Copper clear all polygons in the non-copper clear object
if 'all' in args and args['all'] == 1: if 'all' in args and bool(args['all']):
self.app.ncclear_tool.clear_copper(ncc_obj=obj, self.app.ncclear_tool.clear_copper(ncc_obj=obj,
select_method='itself', select_method='itself',
ncctooldia=tooldia, ncctooldia=tooldia,
@ -237,7 +238,7 @@ class TclCommandCopperClear(TclCommand):
return return
# Non-Copper clear all polygons found within the box object from the the non_copper cleared object # Non-Copper clear all polygons found within the box object from the the non_copper cleared object
elif 'ref' in args and args['ref'] == 1: elif 'ref' in args and bool(args['ref']):
if 'box' not in args: if 'box' not in args:
self.raise_tcl_error('%s' % _("Expected -box <value>.")) self.raise_tcl_error('%s' % _("Expected -box <value>."))
else: else:

View File

@ -3,6 +3,7 @@ from FlatCAMObj import FlatCAMGerber
import collections import collections
class TclCommandIsolate(TclCommandSignaled): class TclCommandIsolate(TclCommandSignaled):
""" """
Tcl shell command to Creates isolation routing geometry for the given Gerber. Tcl shell command to Creates isolation routing geometry for the given Gerber.
@ -45,7 +46,8 @@ class TclCommandIsolate(TclCommandSignaled):
('name', 'Name of the source object.'), ('name', 'Name of the source object.'),
('dia', 'Tool diameter.'), ('dia', 'Tool diameter.'),
('passes', 'Passes of tool width.'), ('passes', 'Passes of tool width.'),
('overlap', 'Percentage of tool diameter to overlap passes. [0%, 99.9999%'), ('overlap', 'Percentage of tool diameter to overlap current pass over previous pass. Float [0, 99.9999]\n'
'E.g: for a 25% from tool diameter overlap use -overlap 25'),
('combine', 'Combine all passes into one geometry.'), ('combine', 'Combine all passes into one geometry.'),
('outname', 'Name of the resulting Geometry object.'), ('outname', 'Name of the resulting Geometry object.'),
('follow', 'Create a Geometry that follows the Gerber path.'), ('follow', 'Create a Geometry that follows the Gerber path.'),

View File

@ -56,7 +56,8 @@ class TclCommandPaint(TclCommand):
('name', 'Name of the source Geometry object. String.'), ('name', 'Name of the source Geometry object. String.'),
('tooldia', 'Diameter of the tool to be used. Can be a comma separated list of diameters. No space is ' ('tooldia', 'Diameter of the tool to be used. Can be a comma separated list of diameters. No space is '
'allowed between tool diameters. E.g: correct: 0.5,1 / incorrect: 0.5, 1'), 'allowed between tool diameters. E.g: correct: 0.5,1 / incorrect: 0.5, 1'),
('overlap', 'Percentage of the tool diameter to overlap cuts. Float number, [0%, 99.9999%]'), ('overlap', 'Percentage of tool diameter to overlap current pass over previous pass. Float [0, 99.9999]\n'
'E.g: for a 25% from tool diameter overlap use -overlap 25'),
('margin', 'Bounding box margin. Float number.'), ('margin', 'Bounding box margin. Float number.'),
('order', 'Can have the values: "no", "fwd" and "rev". String.' ('order', 'Can have the values: "no", "fwd" and "rev". String.'
'It is useful when there are multiple tools in tooldia parameter.' 'It is useful when there are multiple tools in tooldia parameter.'