-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtestClient.py
More file actions
55 lines (36 loc) · 815 Bytes
/
testClient.py
File metadata and controls
55 lines (36 loc) · 815 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
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
import Client
import sys
#import matplotlib.pyplot as plt
wlm = Client.wlmClient()
wlm.connect(ip = str(sys.argv[1]), port = int(sys.argv[2]))
wlm.getWavelength(7)
# mode 0 for single mode and 1 for switch mode
wlm.setSwitchMode(0)
switch_mode = wlm.getSwitchMode()
print(switch_mode)
# mode 0 for manual expo and 1 for auto axpo
wlm.setExpoAuto(1)
exp = wlm.getExpoAuto()
print(exp)
#wlm.setExpUp(10)
#expup = wlm.getExpUp()
#print(expup)
#wlm.setExpDown(10)
#expdown = wlm.getExpDown()
#print(expdown)
# number of digits (precision of wavemeter)
wlm.setPrec(4)
# channel
wavel = wlm.getWavelength(7)
print(wavel)
# channel
freq = wlm.getFrequency(5)
print(freq)
# channel
spec = wlm.getSpectrum(7)
#plt.plot(spec)
#plt.show()
# channel
#all = wlm.getAll(7)
#print(all["freq"])
wlm.disconnect()