- working on data structures (offset, offset_value, job_type, shape) and on the Tools Database

This commit is contained in:
Marius Stanciu
2021-07-07 02:30:27 +03:00
committed by Marius
parent 4e46eac61c
commit 368413e6d2
7 changed files with 51 additions and 51 deletions

View File

@@ -444,7 +444,7 @@ class ToolMilling(AppTool, Excellon):
# Geometry properties
# "tools_mill_tooldia": self.ui.addtool_entry,
"tools_mill_offset_type": self.ui.offset_type_combo,
"tools_mill_offset": self.ui.offset_entry,
"tools_mill_offset_value": self.ui.offset_entry,
"tools_mill_tool_type": self.ui.tool_shape_combo,
"tools_mill_job_type": self.ui.job_type_combo,
@@ -496,7 +496,7 @@ class ToolMilling(AppTool, Excellon):
"milling_dia": "tools_mill_milling_dia",
"mill_offset_type": "tools_mill_offset_type",
"mill_offset": "tools_mill_offset",
"mill_offset": "tools_mill_offset_value",
"mill_tool_type": "tools_mill_tool_type",
"mill_job_type": "tools_mill_job_type",
@@ -586,7 +586,7 @@ class ToolMilling(AppTool, Excellon):
# "tools_mill_tooldia": 0.1,
#
# "tools_mill_offset_type": 0, # _("Path")
# "tools_mill_offset": 0.0,
# "tools_mill_offset_value": 0.0,
#
# "tools_mill_milling_type": "drills",
# "tools_mill_milling_dia": 0.04,
@@ -746,7 +746,7 @@ class ToolMilling(AppTool, Excellon):
tool_data = self.target_obj.tools[tool]['data']
tool_data['tools_mill_offset_type'] = 'Path'
tool_data['tools_mill_offset'] = 0.0
tool_data['tools_mill_offset_value'] = 0.0
tool_data['tools_mill_job_type'] = 'Rough'
tool_data['tools_mill_multidepth'] = False
@@ -811,7 +811,7 @@ class ToolMilling(AppTool, Excellon):
tool_data = self.target_obj.tools[tool]['data']
tool_data['tools_mill_offset_type'] = app_defaults['tools_mill_offset_type']
tool_data['tools_mill_offset'] = app_defaults['tools_mill_offset']
tool_data['tools_mill_offset_value'] = app_defaults['tools_mill_offset_value']
tool_data['tools_mill_job_type'] = app_defaults['tools_mill_job_type']
tool_data['tools_mill_multidepth'] = app_defaults['tools_mill_multidepth']
@@ -2895,11 +2895,11 @@ class ToolMilling(AppTool, Excellon):
def_optimization_type = self.target_obj.options["tools_mill_optimization_type"]
tools_dict[tooluid_key]['data']["tools_mill_optimization_type"] = def_optimization_type
if dia_cnc_dict['data']['tools_mill_offset'] == 1: # 'in'
if dia_cnc_dict['data']['tools_mill_offset_type'] == 1: # 'in'
tool_offset = -dia_cnc_dict['tools_mill_tooldia'] / 2
elif dia_cnc_dict['data']['tools_mill_offset'] == 2: # 'out'
elif dia_cnc_dict['data']['tools_mill_offset_type'] == 2: # 'out'
tool_offset = dia_cnc_dict['tools_mill_tooldia'] / 2
elif dia_cnc_dict['data']['tools_mill_offset'] == 3: # 'custom'
elif dia_cnc_dict['data']['tools_mill_offset_type'] == 3: # 'custom'
try:
offset_value = float(self.ui.offset_entry.get_value())
except ValueError:

View File

@@ -890,14 +890,12 @@ class ToolPaint(AppTool, Gerber):
offset = 'Path'
offset_val = 0.0
tool_type = 'V'
# look in database tools
if tools_db_dict:
for db_tool, db_tool_val in tools_db_dict.items():
offset = db_tool_val['data']['tools_mill_offset_type']
offset_val = db_tool_val['data']['tools_mill_offset']
tool_type = db_tool_val['tool_type']
offset_val = db_tool_val['data']['tools_mill_offset_value']
db_tooldia = db_tool_val['tooldia']
low_limit = float(db_tool_val['data']['tol_min'])
@@ -958,7 +956,6 @@ class ToolPaint(AppTool, Gerber):
'tooldia': new_tdia,
'offset': deepcopy(offset),
'offset_value': deepcopy(offset_val),
'tool_type': deepcopy(tool_type),
'data': deepcopy(new_tools_dict),
'solid_geometry': []
}