forked from Apex-technologies/PyApex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path__init__.py
101 lines (82 loc) · 2.92 KB
/
__init__.py
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
'''
Python 3 package for controlling Apex Technologies equipments
PyApex.AP1000 allows to control an AP1000 mainframe via Ethernet protocol
"help(PyApex.AP1000)" for more details
PyApex.AP2XXX allows to control an AP2XXX OSA or OCSA via Ethernet protocol
"help(PyApex.AP2XXX)" for more details
PyApex.Terminal allows to send and receive data from an AP2XXX or an AP1000
directly.
PyApex.AB3510 allows to control a board AB3510 quad photodetectors via USB 2.0 protocol
this class requires PyUSB module installed
"help(PyApex.AB3510)" for more details
PyApex.AB3380 allows to control a board AB3380 dual filters via USB 2.0 protocol
this class requires PyUSB module installed
"help(PyApex.AB3380)" for more details
PyApex.Etuve allows to control a XU Thermal Etuve via RS232 protocol
this class requires PySerial module installed
"help(PyApex.Etuve)" for more details
'''
from PyApex.AP1000 import AP1000
from PyApex.AP2XXX import AP2XXX
from PyApex.Console import Terminal
try:
from PyApex.AB3510 import AB3510
from PyApex.AB3380 import AB3380
__UsbModule = True
except ImportError:
__UsbModule = False
try:
from PyApex.Etuve import Etuve
__SerialModule = True
except ImportError:
__SerialModule = False
from PyApex.Constantes import Celerity
__Version = 1.01
__PythonVersion = 3.4
__ExpertMode = True
def version():
'''
Gets the version of the PyApex Package
'''
return __Version
def python():
'''
Gets the python version needed for the PyApex Package
'''
return __PythonVersion
def SetExpertMode(Mode):
'''
!!! NOT YET IMPLEMENTED !!!
Sets the using mode of this package.
Mode is a boolean:
- False: User mode, only instructions present in
the user manual are enabled
- True: Expert mode, all instructions including
calibration instructions are enabled
'''
if isinstance(Mode, bool):
__ExpertMode = Mode
def GetExpertMode():
'''
Gets the using mode of this package.
This function returns a boolean:
- False: User mode, only instructions present in
the user manual are enabled
- True: Expert mode, all instructions including
calibration instructions are enabled
'''
return __ExpertMode
def GetModule(ModName):
'''
Gets the installed modules.
ModName is a string:
- "usb": returns True if the usb module has been
imported, False otherwise
- "serial" : returns True if the serial module has been
imported, False otherwise
'''
if isinstance(ModName, str):
if ModName.lower() == "usb":
return __UsbModule
elif ModName.lower() == "serial":
return __SerialModule