Skip to content

Commit

Permalink
eds-editor display bug fixes and patch version bump
Browse files Browse the repository at this point in the history
- add missing eds-autofix command
- fixed incorrect indexes displayed in PDO pages
- treeview names update as parameter names are changed
- fixed storage location not being set when adding new subindex
  • Loading branch information
ryanpdx committed Feb 19, 2023
1 parent d76d310 commit fcad0b8
Showing 5 changed files with 21 additions and 4 deletions.
2 changes: 1 addition & 1 deletion eds_utils/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '0.2.0'
__version__ = '0.2.1'
4 changes: 3 additions & 1 deletion eds_utils/core/file_io/read_eds.py
Original file line number Diff line number Diff line change
@@ -126,7 +126,9 @@ def read_eds(file_path: str) -> (EDS, list):

# set subindex 0's storage_location
sl = eds[index].storage_location
eds[index][0].storage_location = sl
if eds[index][0].storage_location == '':
eds[index][0].storage_location = sl

if sl not in eds.storage_locations:
eds.add_storage_location(sl)

16 changes: 15 additions & 1 deletion eds_utils/eds_editor/pages/object_dictionary_page.py
Original file line number Diff line number Diff line change
@@ -199,8 +199,22 @@ def __init__(self, eds: EDS, parent_window: Gtk.Window):

def _on_parametere_name_changed(self, entry: Gtk.Entry):
if self._selected_obj and self._selected_obj.parameter_name != entry.get_text():
self._selected_obj.parameter_name = entry.get_text()
name = entry.get_text()
self._selected_obj.parameter_name = name
self.eds_changed()
for i in self._indexes_store:
if self._selected_index != str2int(i[0]):
continue

if self._selected_subindex is None:
self._indexes_store.set_value(i.iter, 1, name)
else:
for j in i.iterchildren():
if self._selected_subindex != str2int(j[0]):
continue
self._indexes_store.set_value(j.iter, 1, name)
break
break

def _on_obj_denotation_changed(self, entry: Gtk.Entry):
if self._selected_obj and self._selected_obj.denotation != entry.get_text():
2 changes: 1 addition & 1 deletion eds_utils/eds_editor/pages/pdo_page.py
Original file line number Diff line number Diff line change
@@ -200,7 +200,7 @@ def refresh(self):

obj = self._eds[obj_index]
if isinstance(obj, Variable):
name = f'{obj.parameter_name} - {i:X}'
name = f'{obj.parameter_name} - {obj_index:4X}'
else:
name = f'{obj.parameter_name} - {obj[obj_subindex].parameter_name} - ' \
f'{obj_index:4X}sub{obj_subindex:02X}'
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -37,3 +37,4 @@ console_scripts =
eds2dcf = eds_utils.eds2dcf:eds2dcf
eds2md = eds_utils.eds2md:eds2md
eds2rst = eds_utils.eds2rstf:eds2rst
eds-autofix = eds_utils.eds_validate:eds_autofix

0 comments on commit fcad0b8

Please sign in to comment.