-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstrumentbase.py
More file actions
27 lines (20 loc) · 817 Bytes
/
Copy pathinstrumentbase.py
File metadata and controls
27 lines (20 loc) · 817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
from common import common
# Available instrument types... -------------------------------
import instruments
import pkgutil
known_inst = [name for finder, name, ispkg in pkgutil.iter_modules(instruments.__path__) if not name.startswith('_')]
# -------------------------------------------------------------
# High level instrument class for properties shared across instrument types
class Instrument:
def __init__(self):
pass
def select_proc(self):
while True:
header = ''.join(("\n", "-" * 17, " INSTRUMENT MENU: %s " % self.name.upper().ljust(7), "-" * 18))
proclist = [proc.upper() for proc in self.proctypes]
try:
proc_id = int(common.dynamicmenu_get("Select a procedure", proclist, header=header))
except TypeError:
break
else:
getattr(self, self.proctypes[proc_id])()