Skip to content

Commit

Permalink
Arch: Parse window opening modes with more than one digit
Browse files Browse the repository at this point in the history
Signed-off-by: Łukasz Stelmach <stlman@poczta.fm>
  • Loading branch information
steelman authored and chennes committed Sep 30, 2021
1 parent d292788 commit 7622933
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/Mod/Arch/ArchWindow.py
Expand Up @@ -632,7 +632,10 @@ def buildShapes(self,obj):
elif "Edge" in s:
hinge = int(s[4:])-1
elif "Mode" in s:
omode = int(s[-1])
omode = int(s[4:])
if omode >= len(WindowOpeningModes):
# Ignore modes not listed in WindowOpeningModes
omode = None
if wires:
max_length = 0
for w in wires:
Expand Down Expand Up @@ -1506,7 +1509,11 @@ def editElement(self):
elif "Edge" in l:
self.field6.setText(l)
elif "Mode" in l:
self.field7.setCurrentIndex(int(l[-1]))
if int(l[4:]) < len(WindowOpeningModes):
self.field7.setCurrentIndex(int(l[4:]))
else:
# Ignore modes not listed in WindowOpeningModes
self.field7.setCurrentIndex(0)
if wires:
f.setText(",".join(wires))

Expand Down

0 comments on commit 7622933

Please sign in to comment.