From 622dd1f3199548ccf96dc2e25204210f4ae37c7d Mon Sep 17 00:00:00 2001 From: "J.A. de Jong - Redu-Sone B.V., ASCEE V.O.F" Date: Fri, 16 Oct 2020 21:12:31 +0200 Subject: [PATCH] Added possibility to get index of qty --- lasp/lasp_common.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lasp/lasp_common.py b/lasp/lasp_common.py index 2bb9e74..421c9dd 100644 --- a/lasp/lasp_common.py +++ b/lasp/lasp_common.py @@ -96,6 +96,13 @@ class SIQtys: def getCurrent(cb): return SIQtys.types[cb.currentIndex()] + @staticmethod + def getIndex(qty): + for i, qtyi in enumerate(SIQtys.types): + if qtyi == qty: + return i + return -1 + @dataclass class CalSetting: name: str