From d46e2b5703eefd4ff4540f85b2e1c7aaf83d350b Mon Sep 17 00:00:00 2001 From: Marius Stanciu Date: Sun, 6 Dec 2020 17:07:59 +0200 Subject: [PATCH] - Milling Tool - working on the data structure - wip --- appTools/ToolMilling.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/appTools/ToolMilling.py b/appTools/ToolMilling.py index afe1647f..5bf825c9 100644 --- a/appTools/ToolMilling.py +++ b/appTools/ToolMilling.py @@ -1361,12 +1361,24 @@ class ToolMilling(AppTool, Excellon): :rtype: """ + # we get the current row in the (geo) tools table for the form fields found in the table + if self.ui.target_radio.get_value() == 'geo': + t_table = self.ui.geo_tools_table + else: + t_table = self.ui.tools_table + self.current_row = t_table.currentRow() + for storage_key in dict_storage: if storage_key in list(self.form_fields.keys()) and storage_key not in \ ["toolchange", "toolchangez", "endxy", "endz", "ppname_g", "area_exclusion", "area_shape", "area_strategy", "area_overz"]: try: - self.form_fields[storage_key].set_value(dict_storage[storage_key]) + # widgets in the tools table + if storage_key == 'tool_type': + form_val = self.ui.geo_tools_table.cellWidget(self.current_row, 2) + form_val.set_value(dict_storage[storage_key]) + else: + self.form_fields[storage_key].set_value(dict_storage[storage_key]) except Exception as e: self.app.log.debug("ToolDrilling.storage_to_form() --> %s" % str(e)) pass