Skip to content

Commit

Permalink
set dictionary circuit components (#4330)
Browse files Browse the repository at this point in the history
Co-authored-by: maxcapodi78 <Shark78>
Co-authored-by: Kathy Pippert <[email protected]>
  • Loading branch information
gmalinve and PipKat authored Mar 7, 2024
1 parent 75b75a7 commit 8730a2b
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions pyaedt/modeler/circuits/object3dcircuit.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,10 +304,7 @@ class ComponentParameters(dict):
"""Manages component parameters."""

def __setitem__(self, key, value):
try:
self._component._oeditor.SetPropertyValue(self._tab, self._component.composed_name, key, str(value))
dict.__setitem__(self, key, value)
except:
if not isinstance(value, (int, float)):
try:
self._component._oeditor.ChangeProperty(
[
Expand All @@ -322,6 +319,27 @@ def __setitem__(self, key, value):
],
]
)
if (
self._component._oeditor.GetPropertyValue("PassedParameterTab", self._component.composed_name, key)
!= value
):
try:
self._component._oeditor.SetPropertyValue(
self._tab, self._component.composed_name, key, str(value)
)
dict.__setitem__(self, key, value)
except:
self._component._circuit_components.logger.warning(
"Property %s has not been edited.Check if readonly", key
)
dict.__setitem__(self, key, value)
except:
self._component._circuit_components.logger.warning(
"Property %s has not been edited. Check if read-only.", key
)
else:
try:
self._component._oeditor.SetPropertyValue(self._tab, self._component.composed_name, key, str(value))
dict.__setitem__(self, key, value)
except:
self._component._circuit_components.logger.warning(
Expand Down

0 comments on commit 8730a2b

Please sign in to comment.