##// END OF EJS Templates
analog disco: Enabled filtering on acq and added analog out enable/disable functions
jeandet -
r13:669810a4267c default draft
parent child
Show More
@@ -1,446 +1,456
1 #!/usr/bin/env python
1 #!/usr/bin/env python
2 #-*- coding: utf-8 -*-
2 #-*- coding: utf-8 -*-
3 """Simple python library to drive the analog discovery module from www.digilentinc.com
3 """Simple python library to drive the analog discovery module from www.digilentinc.com
4 """
4 """
5
5
6 from ctypes import *
6 from ctypes import *
7 import time
7 import time
8 import sys
8 import sys
9 import os
9 import os
10 import matplotlib.pyplot as plt
10 import matplotlib.pyplot as plt
11 import numpy as np
11 import numpy as np
12
12
13 __author__ = "Alexis Jeandet"
13 __author__ = "Alexis Jeandet"
14 __copyright__ = "Copyright 2015, Laboratory of Plasma Physics"
14 __copyright__ = "Copyright 2015, Laboratory of Plasma Physics"
15 __credits__ = []
15 __credits__ = []
16 __license__ = "GPLv2"
16 __license__ = "GPLv2"
17 __version__ = "1.0.0"
17 __version__ = "1.0.0"
18 __maintainer__ = "Alexis Jeandet"
18 __maintainer__ = "Alexis Jeandet"
19 __email__ = "alexis.jeandet@member.fsf.org"
19 __email__ = "alexis.jeandet@member.fsf.org"
20 __status__ = "Production"
20 __status__ = "Production"
21
21
22
22
23 nodev = c_int(0)
23 nodev = c_int(0)
24
24
25 DwfStateReady = c_byte(0)
25 DwfStateReady = c_byte(0)
26 DwfStateConfig = c_byte(4)
26 DwfStateConfig = c_byte(4)
27 DwfStatePrefill = c_byte(5)
27 DwfStatePrefill = c_byte(5)
28 DwfStateArmed = c_byte(1)
28 DwfStateArmed = c_byte(1)
29 DwfStateWait = c_byte(7)
29 DwfStateWait = c_byte(7)
30 DwfStateTriggered = c_byte(3)
30 DwfStateTriggered = c_byte(3)
31 DwfStateRunning = c_byte(3)
31 DwfStateRunning = c_byte(3)
32 DwfStateDone = c_byte(2)
32 DwfStateDone = c_byte(2)
33
33
34 DwfStateDict={
34 DwfStateDict={
35 DwfStateReady.value:"Ready",
35 DwfStateReady.value:"Ready",
36 DwfStateConfig.value:"Config",
36 DwfStateConfig.value:"Config",
37 DwfStatePrefill.value:"Prefill",
37 DwfStatePrefill.value:"Prefill",
38 DwfStateArmed.value:"Armed",
38 DwfStateArmed.value:"Armed",
39 DwfStateWait.value:"Wait",
39 DwfStateWait.value:"Wait",
40 DwfStateTriggered.value:"Triggered",
40 DwfStateTriggered.value:"Triggered",
41 DwfStateRunning.value:"Running",
41 DwfStateRunning.value:"Running",
42 DwfStateDone.value:"Done"
42 DwfStateDone.value:"Done"
43 }
43 }
44
44
45 DECIAnalogInChannelCount = c_int(1)
45 DECIAnalogInChannelCount = c_int(1)
46 DECIAnalogOutChannelCount = c_int(2)
46 DECIAnalogOutChannelCount = c_int(2)
47 DECIAnalogIOChannelCount = c_int(3)
47 DECIAnalogIOChannelCount = c_int(3)
48 DECIDigitalInChannelCount = c_int(4)
48 DECIDigitalInChannelCount = c_int(4)
49 DECIDigitalOutChannelCount = c_int(5)
49 DECIDigitalOutChannelCount = c_int(5)
50 DECIDigitalIOChannelCount = c_int(6)
50 DECIDigitalIOChannelCount = c_int(6)
51 DECIAnalogInBufferSize = c_int(7)
51 DECIAnalogInBufferSize = c_int(7)
52 DECIAnalogOutBufferSize = c_int(8)
52 DECIAnalogOutBufferSize = c_int(8)
53 DECIDigitalInBufferSize = c_int(9)
53 DECIDigitalInBufferSize = c_int(9)
54 DECIDigitalOutBufferSize = c_int(10)
54 DECIDigitalOutBufferSize = c_int(10)
55
55
56 trigsrcNone = c_byte(0)
56 trigsrcNone = c_byte(0)
57 trigsrcPC = c_byte(1)
57 trigsrcPC = c_byte(1)
58 trigsrcDetectorAnalogIn = c_byte(2)
58 trigsrcDetectorAnalogIn = c_byte(2)
59 trigsrcDetectorDigitalIn = c_byte(3)
59 trigsrcDetectorDigitalIn = c_byte(3)
60 trigsrcAnalogIn = c_byte(4)
60 trigsrcAnalogIn = c_byte(4)
61 trigsrcDigitalIn = c_byte(5)
61 trigsrcDigitalIn = c_byte(5)
62 trigsrcDigitalOut = c_byte(6)
62 trigsrcDigitalOut = c_byte(6)
63 trigsrcAnalogOut1 = c_byte(7)
63 trigsrcAnalogOut1 = c_byte(7)
64 trigsrcAnalogOut2 = c_byte(8)
64 trigsrcAnalogOut2 = c_byte(8)
65 trigsrcAnalogOut3 = c_byte(9)
65 trigsrcAnalogOut3 = c_byte(9)
66 trigsrcAnalogOut4 = c_byte(10)
66 trigsrcAnalogOut4 = c_byte(10)
67 trigsrcExternal1 = c_byte(11)
67 trigsrcExternal1 = c_byte(11)
68 trigsrcExternal2 = c_byte(12)
68 trigsrcExternal2 = c_byte(12)
69 trigsrcExternal3 = c_byte(13)
69 trigsrcExternal3 = c_byte(13)
70 trigsrcExternal4 = c_byte(14)
70 trigsrcExternal4 = c_byte(14)
71 trigAuto = c_byte(254)
71 trigAuto = c_byte(254)
72 trigNormal = c_byte(255)
72 trigNormal = c_byte(255)
73
73
74 AnalogOutNodeCarrier = c_int(0)
74 AnalogOutNodeCarrier = c_int(0)
75 AnalogOutNodeFM = c_int(1)
75 AnalogOutNodeFM = c_int(1)
76 AnalogOutNodeAM = c_int(2)
76 AnalogOutNodeAM = c_int(2)
77
77
78 filterDecimate = c_int(0)
79 filterAverage = c_int(1)
80 filterMinMax = c_int(2)
81
78
82
79 shapes = {'DC' : 0,
83 shapes = {'DC' : 0,
80 'Sine' : 1,
84 'Sine' : 1,
81 'Square' : 2,
85 'Square' : 2,
82 'Triangle' : 3,
86 'Triangle' : 3,
83 'RampUp' : 4,
87 'RampUp' : 4,
84 'RampDown' : 5,
88 'RampDown' : 5,
85 'Noise' : 6,
89 'Noise' : 6,
86 'Custom' : 30,
90 'Custom' : 30,
87 'Play' :31, }
91 'Play' :31, }
88
92
89 closed=False
93 closed=False
90 opened=True
94 opened=True
91
95
92
96
93 class DiscoveryLimits(object):
97 class DiscoveryLimits(object):
94 class limitRange(object):
98 class limitRange(object):
95 def __init__(self,Min,Max,name="Unknow",unit=""):
99 def __init__(self,Min,Max,name="Unknow",unit=""):
96 self.Min = Min
100 self.Min = Min
97 self.Max = Max
101 self.Max = Max
98 self.name = name
102 self.name = name
99 self.unit = unit
103 self.unit = unit
100
104
101 def conform(self,value):
105 def conform(self,value):
102 if value<self.Min:
106 if value<self.Min:
103 raise UserWarning("Parameter "+self.name+" out of bound\nValue="+str(value)+"\nForce to "+str(self.Min))
107 raise UserWarning("Parameter "+self.name+" out of bound\nValue="+str(value)+"\nForce to "+str(self.Min))
104 return self.Min
108 return self.Min
105 if value>self.Max:
109 if value>self.Max:
106 raise UserWarning("Parameter "+self.name+" out of bound\nValue="+str(value)+"\nForce to "+str(self.Max))
110 raise UserWarning("Parameter "+self.name+" out of bound\nValue="+str(value)+"\nForce to "+str(self.Max))
107 return self.Max
111 return self.Max
108 return value
112 return value
109
113
110 def __str__(self):
114 def __str__(self):
111 return self.name + ":\n Min="+str(self.Min)+" "+self.unit+",Max="+str(self.Max)+" "+self.unit
115 return self.name + ":\n Min="+str(self.Min)+" "+self.unit+",Max="+str(self.Max)+" "+self.unit
112
116
113 errors = {0: RuntimeError("No card opened"),
117 errors = {0: RuntimeError("No card opened"),
114 1: UserWarning("Parameter out of bound"),
118 1: UserWarning("Parameter out of bound"),
115 }
119 }
116 def __init__(self,libdwf,hdwf):
120 def __init__(self,libdwf,hdwf):
117 self.limits=[]
121 self.limits=[]
118 self.ACQ_IN_RANGES=[0.0]
122 self.ACQ_IN_RANGES=[0.0]
119 if hdwf.value == nodev.value:
123 if hdwf.value == nodev.value:
120 return
124 return
121 self.__hdwf=hdwf
125 self.__hdwf=hdwf
122 self.__libdwf=libdwf
126 self.__libdwf=libdwf
123 Mind=c_double()
127 Mind=c_double()
124 Maxd=c_double()
128 Maxd=c_double()
125 Mini=c_int()
129 Mini=c_int()
126 Maxi=c_int()
130 Maxi=c_int()
127 StepsCount=c_int()
131 StepsCount=c_int()
128 Steps=(c_double*32)()
132 Steps=(c_double*32)()
129 self.__libdwf.FDwfAnalogInBufferSizeInfo(self.__hdwf, byref(Mini), byref(Maxi))
133 self.__libdwf.FDwfAnalogInBufferSizeInfo(self.__hdwf, byref(Mini), byref(Maxi))
130 self.ACQ_BUF=self.limitRange(Mini.value,Maxi.value,"ACQ Buffer Size","Sps")
134 self.ACQ_BUF=self.limitRange(Mini.value,Maxi.value,"ACQ Buffer Size","Sps")
131 self.limits.append(self.ACQ_BUF)
135 self.limits.append(self.ACQ_BUF)
132 self.__libdwf.FDwfAnalogInFrequencyInfo(self.__hdwf, byref(Mind), byref(Maxd))
136 self.__libdwf.FDwfAnalogInFrequencyInfo(self.__hdwf, byref(Mind), byref(Maxd))
133 self.ACQ_FREQ=self.limitRange(Mind.value,Maxd.value,"ACQ Frequency","Hz")
137 self.ACQ_FREQ=self.limitRange(Mind.value,Maxd.value,"ACQ Frequency","Hz")
134 self.limits.append(self.ACQ_FREQ)
138 self.limits.append(self.ACQ_FREQ)
135 self.__libdwf.FDwfAnalogInChannelRangeSteps(self.__hdwf, byref(Steps), byref(StepsCount))
139 self.__libdwf.FDwfAnalogInChannelRangeSteps(self.__hdwf, byref(Steps), byref(StepsCount))
136 self.ACQ_IN_RANGES=Steps[0:StepsCount.value]
140 self.ACQ_IN_RANGES=Steps[0:StepsCount.value]
137 self.__libdwf.FDwfAnalogOutNodeAmplitudeInfo(self.__hdwf,c_int(0), AnalogOutNodeCarrier,
141 self.__libdwf.FDwfAnalogOutNodeAmplitudeInfo(self.__hdwf,c_int(0), AnalogOutNodeCarrier,
138 byref(Mind), byref(Maxd))
142 byref(Mind), byref(Maxd))
139 self.GEN_AMPL=self.limitRange(Mind.value,Maxd.value,"GEN Amplitude","V")
143 self.GEN_AMPL=self.limitRange(Mind.value,Maxd.value,"GEN Amplitude","V")
140 self.limits.append(self.GEN_AMPL)
144 self.limits.append(self.GEN_AMPL)
141 self.__libdwf.FDwfAnalogOutNodeFrequencyInfo(self.__hdwf,c_int(0), AnalogOutNodeCarrier,
145 self.__libdwf.FDwfAnalogOutNodeFrequencyInfo(self.__hdwf,c_int(0), AnalogOutNodeCarrier,
142 byref(Mind), byref(Maxd))
146 byref(Mind), byref(Maxd))
143 self.GEN_FREQ=self.limitRange(Mind.value,Maxd.value,"GEN Frequency","Hz")
147 self.GEN_FREQ=self.limitRange(Mind.value,Maxd.value,"GEN Frequency","Hz")
144 self.limits.append(self.GEN_FREQ)
148 self.limits.append(self.GEN_FREQ)
145 self.__libdwf.FDwfAnalogOutNodeOffsetInfo(self.__hdwf,c_int(0), AnalogOutNodeCarrier,
149 self.__libdwf.FDwfAnalogOutNodeOffsetInfo(self.__hdwf,c_int(0), AnalogOutNodeCarrier,
146 byref(Mind), byref(Maxd))
150 byref(Mind), byref(Maxd))
147 self.GEN_OFFSET=self.limitRange(Mind.value,Maxd.value,"GEN Offset","V")
151 self.GEN_OFFSET=self.limitRange(Mind.value,Maxd.value,"GEN Offset","V")
148 self.limits.append(self.GEN_OFFSET)
152 self.limits.append(self.GEN_OFFSET)
149 self.__libdwf.FDwfAnalogOutNodeDataInfo(self.__hdwf,c_int(0), AnalogOutNodeCarrier,
153 self.__libdwf.FDwfAnalogOutNodeDataInfo(self.__hdwf,c_int(0), AnalogOutNodeCarrier,
150 byref(Mini), byref(Maxi))
154 byref(Mini), byref(Maxi))
151 self.GEN_BUFF=self.limitRange(Mini.value,Maxi.value,"GEN Buffer size","Sps")
155 self.GEN_BUFF=self.limitRange(Mini.value,Maxi.value,"GEN Buffer size","Sps")
152 self.limits.append(self.GEN_BUFF)
156 self.limits.append(self.GEN_BUFF)
153
157
154
158
155 def __conformParam(self,minVal,maxVal,val):
159 def __conformParam(self,minVal,maxVal,val):
156 if val<minVal:
160 if val<minVal:
157 raise self.errors.get(1)
161 raise self.errors.get(1)
158 print("Force to "+str(minVal))
162 print("Force to "+str(minVal))
159 return minVal
163 return minVal
160 if val>maxVal:
164 if val>maxVal:
161 raise self.errors.get(1)
165 raise self.errors.get(1)
162 print("Force to "+str(maxVal))
166 print("Force to "+str(maxVal))
163 return maxVal
167 return maxVal
164 return val
168 return val
165
169
166 def acqFreq(self, value):
170 def acqFreq(self, value):
167 return self.ACQ_FREQ.conform(value)
171 return self.ACQ_FREQ.conform(value)
168
172
169 def acqBufSize(self, value):
173 def acqBufSize(self, value):
170 return self.ACQ_BUF.conform(value)
174 return self.ACQ_BUF.conform(value)
171
175
172 def genFreq(self, value):
176 def genFreq(self, value):
173 return self.GEN_FREQ.conform(value)
177 return self.GEN_FREQ.conform(value)
174
178
175 def genAmplitude(self, value):
179 def genAmplitude(self, value):
176 return self.GEN_AMPL.conform(value)
180 return self.GEN_AMPL.conform(value)
177
181
178 def genOffset(self, value):
182 def genOffset(self, value):
179 return self.GEN_OFFSET.conform(value)
183 return self.GEN_OFFSET.conform(value)
180
184
181 def genBuffSize(self, value):
185 def genBuffSize(self, value):
182 return self.GEN_BUFF.conform(value)
186 return self.GEN_BUFF.conform(value)
183
187
184 def __str__(self):
188 def __str__(self):
185 res=str()
189 res=str()
186 for i in self.limits:
190 for i in self.limits:
187 res+=i.__str__()+"\n"
191 res+=i.__str__()+"\n"
188 res+="ACQ Input ranes: "+str(self.ACQ_IN_RANGES)
192 res+="ACQ Input ranes: "+str(self.ACQ_IN_RANGES)
189 return res
193 return res
190
194
191
195
192 class Discovery(object):
196 class Discovery(object):
193
197
194 errors = {0: RuntimeError("No card opened"),
198 errors = {0: RuntimeError("No card opened"),
195 1: UserWarning("Parameter out of bound"),
199 1: UserWarning("Parameter out of bound"),
196 }
200 }
197 def findDevice(self,device):
201 def findDevice(self,device):
198 if not self.__opened:
202 if not self.__opened:
199 raise self.errors.get(0)
203 raise self.errors.get(0)
200 nbDevices = c_int()
204 nbDevices = c_int()
201 self.__libdwf.FDwfEnum(c_int(0), byref(nbDevices))
205 self.__libdwf.FDwfEnum(c_int(0), byref(nbDevices))
202 SN = create_string_buffer(32)
206 SN = create_string_buffer(32)
203 for i in range(nbDevices.value):
207 for i in range(nbDevices.value):
204 self.__libdwf.FDwfEnumSN(c_int(i), SN)
208 self.__libdwf.FDwfEnumSN(c_int(i), SN)
205 if SN.value.decode("UTF-8") == device:
209 if SN.value.decode("UTF-8") == device:
206 return i
210 return i
207 return -1
211 return -1
208
212
209
213
210 def __init__(self,card=-1):
214 def __init__(self,card=-1):
211 if sys.platform.startswith("win"):
215 if sys.platform.startswith("win"):
212 self.__libdwf = cdll.dwf
216 self.__libdwf = cdll.dwf
213 elif sys.platform.startswith("darwin"):
217 elif sys.platform.startswith("darwin"):
214 self.__libdwf = cdll.LoadLibrary("libdwf.dylib")
218 self.__libdwf = cdll.LoadLibrary("libdwf.dylib")
215 else:
219 else:
216 self.__libdwf = cdll.LoadLibrary("libdwf.so")
220 self.__libdwf = cdll.LoadLibrary("libdwf.so")
217 self.__opened = True
221 self.__opened = True
218 self.__hdwf = c_int()
222 self.__hdwf = c_int()
219 if card != -1:
223 if card != -1:
220 SN=card
224 SN=card
221 card = self.findDevice(card)
225 card = self.findDevice(card)
222 if card == -1:
226 if card == -1:
223 raise RuntimeError( "Card not found "+ SN)
227 raise RuntimeError( "Card not found "+ SN)
224 self.__libdwf.FDwfDeviceOpen(c_int(card), byref(self.__hdwf))
228 self.__libdwf.FDwfDeviceOpen(c_int(card), byref(self.__hdwf))
225 if self.__hdwf.value == nodev.value:
229 if self.__hdwf.value == nodev.value:
226 szerr = create_string_buffer(512)
230 szerr = create_string_buffer(512)
227 self.__libdwf.FDwfGetLastErrorMsg(szerr)
231 self.__libdwf.FDwfGetLastErrorMsg(szerr)
228 print(szerr.value)
232 print(szerr.value)
229 print("failed to open device")
233 print("failed to open device")
230 self.__opened=False
234 self.__opened=False
231 self.__limits=DiscoveryLimits(self.__libdwf,self.__hdwf)
235 self.__limits=DiscoveryLimits(self.__libdwf,self.__hdwf)
232 print(self.__limits)
236 print(self.__limits)
233
237
234 @property
238 @property
235 def opened(self):
239 def opened(self):
236 return self.__opened
240 return self.__opened
237
241
238 @property
242 @property
239 def max_sampling_freq(self):
243 def max_sampling_freq(self):
240 return self.__limits.ACQ_FREQ.Max
244 return self.__limits.ACQ_FREQ.Max
241
245
242 @property
246 @property
243 def min_sampling_freq(self):
247 def min_sampling_freq(self):
244 return self.__limits.ACQ_FREQ.Min
248 return self.__limits.ACQ_FREQ.Min
245
249
246 @property
250 @property
247 def max_sampling_buffer(self):
251 def max_sampling_buffer(self):
248 return self.__limits.ACQ_BUF.Max
252 return self.__limits.ACQ_BUF.Max
249
253
250 #############################################################
254 #############################################################
251 # Power Supply
255 # Power Supply
252 #############################################################
256 #############################################################
253 def set_power(self,fiveVolt=1,minusFiveVolt=1,master=True):
257 def set_power(self,fiveVolt=1,minusFiveVolt=1,master=True):
254 if not self.__opened:
258 if not self.__opened:
255 raise self.errors.get(0)
259 raise self.errors.get(0)
256 # enable positive supply
260 # enable positive supply
257 self.__libdwf.FDwfAnalogIOChannelNodeSet(self.__hdwf, 0, 0, c_double(fiveVolt))
261 self.__libdwf.FDwfAnalogIOChannelNodeSet(self.__hdwf, 0, 0, c_double(fiveVolt))
258 # enable negative supply
262 # enable negative supply
259 self.__libdwf.FDwfAnalogIOChannelNodeSet(self.__hdwf, 1, 0, c_double(minusFiveVolt))
263 self.__libdwf.FDwfAnalogIOChannelNodeSet(self.__hdwf, 1, 0, c_double(minusFiveVolt))
260 # master enable
264 # master enable
261 return self.__libdwf.FDwfAnalogIOEnableSet(self.__hdwf, master)
265 return self.__libdwf.FDwfAnalogIOEnableSet(self.__hdwf, master)
262
266
263 def get_power(self):
267 def get_power(self):
264 if not self.__opened:
268 if not self.__opened:
265 raise self.errors.get(0)
269 raise self.errors.get(0)
266 supplyVoltage = c_double()
270 supplyVoltage = c_double()
267 supplyCurrent = c_double()
271 supplyCurrent = c_double()
268 IsEnabled = c_bool()
272 IsEnabled = c_bool()
269 self.__libdwf.FDwfAnalogIOStatus(self.__hdwf)
273 self.__libdwf.FDwfAnalogIOStatus(self.__hdwf)
270 self.__libdwf.FDwfAnalogIOChannelNodeStatus(self.__hdwf, c_int(3), c_int(0), byref(supplyVoltage))
274 self.__libdwf.FDwfAnalogIOChannelNodeStatus(self.__hdwf, c_int(3), c_int(0), byref(supplyVoltage))
271 self.__libdwf.FDwfAnalogIOChannelNodeStatus(self.__hdwf, c_int(3), c_int(1), byref(supplyCurrent))
275 self.__libdwf.FDwfAnalogIOChannelNodeStatus(self.__hdwf, c_int(3), c_int(1), byref(supplyCurrent))
272 self.__libdwf.FDwfAnalogIOEnableStatus(self.__hdwf, byref(IsEnabled))
276 self.__libdwf.FDwfAnalogIOEnableStatus(self.__hdwf, byref(IsEnabled))
273 return [IsEnabled.value,supplyVoltage.value,supplyCurrent.value]
277 return [IsEnabled.value,supplyVoltage.value,supplyCurrent.value]
274
278
275 #############################################################
279 #############################################################
276 # AnalogIn
280 # AnalogIn
277 #############################################################
281 #############################################################
278 def analog_in_read(self,ch1=True,ch2=True,frequency=100000000,samplesCount=100,ch1range=5.0,ch2range=5.0,trigger=trigsrcNone):
282 def analog_in_read(self,ch1=True,ch2=True,frequency=100000000,samplesCount=100,ch1range=5.0,ch2range=5.0,trigger=trigsrcNone):
279 if not self.__opened:
283 if not self.__opened:
280 raise self.errors.get(0)
284 raise self.errors.get(0)
281 cnt=self.__limits.acqBufSize(samplesCount)
285 cnt=self.__limits.acqBufSize(samplesCount)
282 self.__libdwf.FDwfAnalogInFrequencySet(self.__hdwf, c_double(self.__limits.acqFreq(frequency)))
286 self.__libdwf.FDwfAnalogInFrequencySet(self.__hdwf, c_double(self.__limits.acqFreq(frequency)))
283 f=c_double()
287 f=c_double()
284 self.__libdwf.FDwfAnalogInFrequencyGet(self.__hdwf, byref(f))
288 self.__libdwf.FDwfAnalogInFrequencyGet(self.__hdwf, byref(f))
285 frequency=f.value
289 frequency=f.value
286 self.__libdwf.FDwfAnalogInBufferSizeSet(self.__hdwf, c_int(cnt))
290 self.__libdwf.FDwfAnalogInBufferSizeSet(self.__hdwf, c_int(cnt))
287 self.__libdwf.FDwfAnalogInChannelEnableSet(self.__hdwf, c_int(0), c_bool(ch1))
291 for ch in (0,1):
288 self.__libdwf.FDwfAnalogInChannelRangeSet(self.__hdwf, c_int(0), c_double(ch1range))
292 self.__libdwf.FDwfAnalogInChannelEnableSet(self.__hdwf, c_int(ch), c_bool(ch2))
289 self.__libdwf.FDwfAnalogInChannelEnableSet(self.__hdwf, c_int(1), c_bool(ch2))
293 self.__libdwf.FDwfAnalogInChannelRangeSet(self.__hdwf, c_int(ch), c_double(ch2range))
290 self.__libdwf.FDwfAnalogInChannelRangeSet(self.__hdwf, c_int(1), c_double(ch2range))
294 self.__libdwf.FDwfAnalogInChannelFilterSet(self.__hdwf,c_int(ch),filterAverage)
291 self.set_analog_in_trigger(trigger)
295 self.set_analog_in_trigger(trigger)
292 self.__libdwf.FDwfAnalogInConfigure(self.__hdwf, c_bool(False), c_bool(True))
296 self.__libdwf.FDwfAnalogInConfigure(self.__hdwf, c_bool(False), c_bool(True))
293 status = c_byte()
297 status = c_byte()
294 while True:
298 while True:
295 self.__libdwf.FDwfAnalogInStatus(self.__hdwf, c_int(1), byref(status))
299 self.__libdwf.FDwfAnalogInStatus(self.__hdwf, c_int(1), byref(status))
296 if status.value == DwfStateDone.value :
300 if status.value == DwfStateDone.value :
297 break
301 break
298 time.sleep(0.1)
302 time.sleep(0.1)
299 if ch1:
303 if ch1:
300 ch1data = (c_double*cnt)()
304 ch1data = (c_double*cnt)()
301 self.__libdwf.FDwfAnalogInStatusData(self.__hdwf, 0, ch1data, cnt)
305 self.__libdwf.FDwfAnalogInStatusData(self.__hdwf, 0, ch1data, cnt)
302 if ch2:
306 if ch2:
303 ch2data = (c_double*cnt)()
307 ch2data = (c_double*cnt)()
304 self.__libdwf.FDwfAnalogInStatusData(self.__hdwf, 1, ch2data, cnt)
308 self.__libdwf.FDwfAnalogInStatusData(self.__hdwf, 1, ch2data, cnt)
305 return [np.array([ch1data,ch2data]),frequency]
309 return [np.array([ch1data,ch2data]),frequency]
306 else:
310 else:
307 return [np.array([ch1data]),frequency]
311 return [np.array([ch1data]),frequency]
308 if ch2:
312 if ch2:
309 ch2data = (c_double*cnt)()
313 ch2data = (c_double*cnt)()
310 self.__libdwf.FDwfAnalogInStatusData(self.__hdwf, 1, ch2data, cnt)
314 self.__libdwf.FDwfAnalogInStatusData(self.__hdwf, 1, ch2data, cnt)
311 return [np.array([ch2data]),frequency]
315 return [np.array([ch2data]),frequency]
312
316
313
317
314 def set_analog_in_trigger(self,trigger=trigAuto,autoTimeout=0.0):
318 def set_analog_in_trigger(self,trigger=trigAuto,autoTimeout=0.0):
315 if not self.__opened:
319 if not self.__opened:
316 raise self.errors.get(0)
320 raise self.errors.get(0)
317 if trigger == trigAuto:
321 if trigger == trigAuto:
318 self.__libdwf.FDwfAnalogInTriggerSourceSet(self.__hdwf,trigsrcDetectorAnalogIn)
322 self.__libdwf.FDwfAnalogInTriggerSourceSet(self.__hdwf,trigsrcDetectorAnalogIn)
319 self.__libdwf.FDwfAnalogInTriggerAutoTimeoutSet(self.__hdwf,c_double(autoTimeout))
323 self.__libdwf.FDwfAnalogInTriggerAutoTimeoutSet(self.__hdwf,c_double(autoTimeout))
320 return
324 return
321 if trigger == trigNormal:
325 if trigger == trigNormal:
322 self.__libdwf.FDwfAnalogInTriggerSourceSet(self.__hdwf,trigsrcDetectorAnalogIn)
326 self.__libdwf.FDwfAnalogInTriggerSourceSet(self.__hdwf,trigsrcDetectorAnalogIn)
323 self.__libdwf.FDwfAnalogInTriggerAutoTimeoutSet(self.__hdwf,c_double(0.0))
327 self.__libdwf.FDwfAnalogInTriggerAutoTimeoutSet(self.__hdwf,c_double(0.0))
324 return
328 return
325 self.__libdwf.FDwfAnalogInTriggerSourceSet(self.__hdwf,trigger)
329 self.__libdwf.FDwfAnalogInTriggerSourceSet(self.__hdwf,trigger)
326
330
327 #############################################################
331 #############################################################
328 # AnalogOut
332 # AnalogOut
329 #############################################################
333 #############################################################
334 def analog_out_enable(self,channel=0):
335 self.__libdwf.FDwfAnalogOutConfigure(self.__hdwf, c_int(channel), c_bool(True))
336
337 def analog_out_disable(self,channel=0):
338 self.__libdwf.FDwfAnalogOutConfigure(self.__hdwf, c_int(channel), c_bool(False))
339
330 def analog_out_gen(self,frequency=1000, symmetry=50.0, shape='Sine', channel=0, amplitude=1.0, offset=0.0,phase=0.0, syncOnTrigger=False, triggerFrq=1.0, wait=0.0, runDuration=None):
340 def analog_out_gen(self,frequency=1000, symmetry=50.0, shape='Sine', channel=0, amplitude=1.0, offset=0.0,phase=0.0, syncOnTrigger=False, triggerFrq=1.0, wait=0.0, runDuration=None):
331 self.__libdwf.FDwfAnalogOutConfigure(self.__hdwf, c_int(channel), c_bool(False))
341 self.__libdwf.FDwfAnalogOutConfigure(self.__hdwf, c_int(channel), c_bool(False))
332 self.__libdwf.FDwfAnalogOutNodeEnableSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_bool(True))
342 self.__libdwf.FDwfAnalogOutNodeEnableSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_bool(True))
333 self.__libdwf.FDwfAnalogOutNodeFunctionSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_int(shapes.get(shape)))
343 self.__libdwf.FDwfAnalogOutNodeFunctionSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_int(shapes.get(shape)))
334 self.__libdwf.FDwfAnalogOutNodeSymmetrySet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(symmetry))
344 self.__libdwf.FDwfAnalogOutNodeSymmetrySet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(symmetry))
335 if shape!="DC":
345 if shape!="DC":
336 self.__libdwf.FDwfAnalogOutNodeFrequencySet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(self.__limits.genFreq(frequency)))
346 self.__libdwf.FDwfAnalogOutNodeFrequencySet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(self.__limits.genFreq(frequency)))
337 self.__libdwf.FDwfAnalogOutNodeAmplitudeSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(self.__limits.genAmplitude(amplitude)))
347 self.__libdwf.FDwfAnalogOutNodeAmplitudeSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(self.__limits.genAmplitude(amplitude)))
338 self.__libdwf.FDwfAnalogOutNodeOffsetSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(self.__limits.genOffset(offset)))
348 self.__libdwf.FDwfAnalogOutNodeOffsetSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(self.__limits.genOffset(offset)))
339 self.__libdwf.FDwfAnalogOutNodePhaseSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(phase))
349 self.__libdwf.FDwfAnalogOutNodePhaseSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(phase))
340 if syncOnTrigger:
350 if syncOnTrigger:
341 self.analog_out_set_trigger(channel)
351 self.analog_out_set_trigger(channel)
342 self.__libdwf.FDwfAnalogOutRepeatSet(self.__hdwf, c_int(channel),c_int(0))
352 self.__libdwf.FDwfAnalogOutRepeatSet(self.__hdwf, c_int(channel),c_int(0))
343 if runDuration is None:
353 if runDuration is None:
344 runDuration = triggerFrq
354 runDuration = triggerFrq
345 self.__libdwf.FDwfAnalogOutRunSet(self.__hdwf, c_int(channel),c_double(runDuration))
355 self.__libdwf.FDwfAnalogOutRunSet(self.__hdwf, c_int(channel),c_double(runDuration))
346 self.__libdwf.FDwfAnalogOutWaitSet(self.__hdwf, c_int(channel), c_double(wait))
356 self.__libdwf.FDwfAnalogOutWaitSet(self.__hdwf, c_int(channel), c_double(wait))
347 self.__libdwf.FDwfAnalogOutConfigure(self.__hdwf, c_int(channel), c_bool(True))
357 self.__libdwf.FDwfAnalogOutConfigure(self.__hdwf, c_int(channel), c_bool(True))
348
358
349 def analog_out_gen_arbit(self,samplesBuffer ,repeatingFrequency=100, channel=0, amplitude=1.0, offset=0.0):
359 def analog_out_gen_arbit(self,samplesBuffer ,repeatingFrequency=100, channel=0, amplitude=1.0, offset=0.0):
350 self.__libdwf.FDwfAnalogOutConfigure(self.__hdwf, c_int(channel), c_bool(False))
360 self.__libdwf.FDwfAnalogOutConfigure(self.__hdwf, c_int(channel), c_bool(False))
351 cnt=self.__limits.genBuffSize(len(samplesBuffer))
361 cnt=self.__limits.genBuffSize(len(samplesBuffer))
352 buf=(c_double*cnt)()
362 buf=(c_double*cnt)()
353 buf[:]=samplesBuffer[0:cnt]
363 buf[:]=samplesBuffer[0:cnt]
354 #repeatingFrequency = self.__limits.genFreq(repeatingFrequency*cnt)/cnt
364 #repeatingFrequency = self.__limits.genFreq(repeatingFrequency*cnt)/cnt
355 self.__libdwf.FDwfAnalogOutNodeEnableSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_bool(True))
365 self.__libdwf.FDwfAnalogOutNodeEnableSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_bool(True))
356 self.__libdwf.FDwfAnalogOutNodeFunctionSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_int(shapes.get("Custom")))
366 self.__libdwf.FDwfAnalogOutNodeFunctionSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_int(shapes.get("Custom")))
357 self.__libdwf.FDwfAnalogOutNodeFrequencySet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(repeatingFrequency))
367 self.__libdwf.FDwfAnalogOutNodeFrequencySet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(repeatingFrequency))
358 self.__libdwf.FDwfAnalogOutNodeAmplitudeSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(self.__limits.genAmplitude(amplitude)))
368 self.__libdwf.FDwfAnalogOutNodeAmplitudeSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(self.__limits.genAmplitude(amplitude)))
359 self.__libdwf.FDwfAnalogOutNodeOffsetSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(self.__limits.genOffset(offset)))
369 self.__libdwf.FDwfAnalogOutNodeOffsetSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(self.__limits.genOffset(offset)))
360 self.__libdwf.FDwfAnalogOutNodeDataSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, buf, c_int(cnt))
370 self.__libdwf.FDwfAnalogOutNodeDataSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, buf, c_int(cnt))
361 self.__libdwf.FDwfAnalogOutConfigure(self.__hdwf, c_int(channel), c_bool(True))
371 self.__libdwf.FDwfAnalogOutConfigure(self.__hdwf, c_int(channel), c_bool(True))
362
372
363 def analog_out_set_trigger(self, channel=0, trigSrc=trigsrcExternal1, trigRepeat=True):
373 def analog_out_set_trigger(self, channel=0, trigSrc=trigsrcExternal1, trigRepeat=True):
364 self.__libdwf.FDwfAnalogOutTriggerSourceSet(self.__hdwf, c_int(channel), trigSrc)
374 self.__libdwf.FDwfAnalogOutTriggerSourceSet(self.__hdwf, c_int(channel), trigSrc)
365 self.__libdwf.FDwfAnalogOutRepeatTriggerSet(self.__hdwf, c_int(channel), c_bool(trigRepeat))
375 self.__libdwf.FDwfAnalogOutRepeatTriggerSet(self.__hdwf, c_int(channel), c_bool(trigRepeat))
366
376
367 def __del__(self):
377 def __del__(self):
368 if self.__opened:
378 if self.__opened:
369 self.__libdwf.FDwfDeviceClose(self.__hdwf)
379 self.__libdwf.FDwfDeviceClose(self.__hdwf)
370
380
371 def analog_out_status(self, channel=0):
381 def analog_out_status(self, channel=0):
372 status = c_byte(DwfStateDone.value)
382 status = c_byte(DwfStateDone.value)
373 self.__libdwf.FDwfAnalogOutStatus(self.__hdwf, c_int(channel), byref(status))
383 self.__libdwf.FDwfAnalogOutStatus(self.__hdwf, c_int(channel), byref(status))
374 return status
384 return status
375 # def analog_out_modulation(self, channel=0,
385 # def analog_out_modulation(self, channel=0,
376 # carrier_frequency=10, carrier_shape='Sine', carrier_amplitude=1.0, carrier_offset=0.0, carrier_phase=0.0, carrier_symmetry=0.5,
386 # carrier_frequency=10, carrier_shape='Sine', carrier_amplitude=1.0, carrier_offset=0.0, carrier_phase=0.0, carrier_symmetry=0.5,
377 # AM_frequency=0.2857, AM_shape='Square', AM_amplitude=100.0, AM_offset=0.0, AM_phase=0.0, AM_percentageSymmetry=0.2857,
387 # AM_frequency=0.2857, AM_shape='Square', AM_amplitude=100.0, AM_offset=0.0, AM_phase=0.0, AM_percentageSymmetry=0.2857,
378 # syncOnTrigger=trigsrcExternal1, triggerFrq=1.0, wait=0.0, runDuration=None):
388 # syncOnTrigger=trigsrcExternal1, triggerFrq=1.0, wait=0.0, runDuration=None):
379 # self.__libdwf.FDwfAnalogOutConfigure(self.__hdwf, c_int(channel), c_bool(False))
389 # self.__libdwf.FDwfAnalogOutConfigure(self.__hdwf, c_int(channel), c_bool(False))
380 # self.__libdwf.FDwfAnalogOutNodeEnableSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_bool(True))
390 # self.__libdwf.FDwfAnalogOutNodeEnableSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_bool(True))
381 #
391 #
382 # self.__libdwf.FDwfAnalogOutNodeFunctionSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_int(shapes.get(carrier_shape)))
392 # self.__libdwf.FDwfAnalogOutNodeFunctionSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_int(shapes.get(carrier_shape)))
383 # self.__libdwf.FDwfAnalogOutNodeFrequencySet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(self.__limits.genFreq(carrier_frequency)))
393 # self.__libdwf.FDwfAnalogOutNodeFrequencySet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(self.__limits.genFreq(carrier_frequency)))
384 # self.__libdwf.FDwfAnalogOutNodeAmplitudeSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(self.__limits.genAmplitude(carrier_amplitude)))
394 # self.__libdwf.FDwfAnalogOutNodeAmplitudeSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(self.__limits.genAmplitude(carrier_amplitude)))
385 # self.__libdwf.FDwfAnalogOutNodeOffsetSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(self.__limits.genOffset(carrier_offset)))
395 # self.__libdwf.FDwfAnalogOutNodeOffsetSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(self.__limits.genOffset(carrier_offset)))
386 # self.__libdwf.FDwfAnalogOutNodePhaseSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(carrier_phase))
396 # self.__libdwf.FDwfAnalogOutNodePhaseSet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(carrier_phase))
387 # self.__libdwf.FDwfAnalogOutNodeSymmetrySet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(carrier_percentageSymmetry))
397 # self.__libdwf.FDwfAnalogOutNodeSymmetrySet(self.__hdwf, c_int(channel), AnalogOutNodeCarrier, c_double(carrier_percentageSymmetry))
388 #
398 #
389 # self.__libdwf.FDwfAnalogOutNodeEnableSet(self.__hdwf, c_int(channel), AnalogOutNodeAM, c_bool(True))
399 # self.__libdwf.FDwfAnalogOutNodeEnableSet(self.__hdwf, c_int(channel), AnalogOutNodeAM, c_bool(True))
390 # self.__libdwf.FDwfAnalogOutNodeFunctionSet(self.__hdwf, c_int(channel), AnalogOutNodeAM, c_int(shapes.get(AM_shape)))
400 # self.__libdwf.FDwfAnalogOutNodeFunctionSet(self.__hdwf, c_int(channel), AnalogOutNodeAM, c_int(shapes.get(AM_shape)))
391 # self.__libdwf.FDwfAnalogOutNodeFrequencySet(self.__hdwf, c_int(channel), AnalogOutNodeAM, c_double(self.__limits.genFreqAM_frequency)))
401 # self.__libdwf.FDwfAnalogOutNodeFrequencySet(self.__hdwf, c_int(channel), AnalogOutNodeAM, c_double(self.__limits.genFreqAM_frequency)))
392 # self.__libdwf.FDwfAnalogOutNodeAmplitudeSet(self.__hdwf, c_int(channel), AnalogOutNodeAM, c_double(self.__limits.genAmplitude(AM_amplitude)))
402 # self.__libdwf.FDwfAnalogOutNodeAmplitudeSet(self.__hdwf, c_int(channel), AnalogOutNodeAM, c_double(self.__limits.genAmplitude(AM_amplitude)))
393 # self.__libdwf.FDwfAnalogOutNodeOffsetSet(self.__hdwf, c_int(channel), AnalogOutNodeAM, c_double(self.__limits.genOffset(AM_offset)))
403 # self.__libdwf.FDwfAnalogOutNodeOffsetSet(self.__hdwf, c_int(channel), AnalogOutNodeAM, c_double(self.__limits.genOffset(AM_offset)))
394 # self.__libdwf.FDwfAnalogOutNodePhaseSet(self.__hdwf, c_int(channel), AnalogOutNodeAM, c_double(AM_phase))
404 # self.__libdwf.FDwfAnalogOutNodePhaseSet(self.__hdwf, c_int(channel), AnalogOutNodeAM, c_double(AM_phase))
395 # self.__libdwf.FDwfAnalogOutNodeSymmetrySet(self.__hdwf, c_int(channel), AnalogOutNodeAM, c_double(AM_percentageSymmetry))
405 # self.__libdwf.FDwfAnalogOutNodeSymmetrySet(self.__hdwf, c_int(channel), AnalogOutNodeAM, c_double(AM_percentageSymmetry))
396 #
406 #
397 # if syncOnTrigger:
407 # if syncOnTrigger:
398 # self.analog_out_set_trigger(channel)
408 # self.analog_out_set_trigger(channel)
399 # self.__libdwf.FDwfAnalogOutRepeatSet(self.__hdwf, c_int(channel),c_int(0))
409 # self.__libdwf.FDwfAnalogOutRepeatSet(self.__hdwf, c_int(channel),c_int(0))
400 # if runDuration is None:
410 # if runDuration is None:
401 # runDuration = triggerFrq
411 # runDuration = triggerFrq
402 # self.__libdwf.FDwfAnalogOutRunSet(self.__hdwf, c_int(channel),c_double(runDuration))
412 # self.__libdwf.FDwfAnalogOutRunSet(self.__hdwf, c_int(channel),c_double(runDuration))
403 # self.__libdwf.FDwfAnalogOutWaitSet(self.__hdwf, c_int(channel), c_double(wait))
413 # self.__libdwf.FDwfAnalogOutWaitSet(self.__hdwf, c_int(channel), c_double(wait))
404 # self.__libdwf.FDwfAnalogOutConfigure(self.__hdwf, c_int(channel), c_bool(True))
414 # self.__libdwf.FDwfAnalogOutConfigure(self.__hdwf, c_int(channel), c_bool(True))
405
415
406 def digital_io_output_enable(self, value):
416 def digital_io_output_enable(self, value):
407 self.__libdwf.FDwfDigitalIOOutputEnableSet(self.__hdwf, c_int(value))
417 self.__libdwf.FDwfDigitalIOOutputEnableSet(self.__hdwf, c_int(value))
408
418
409 def digital_io_get(self):
419 def digital_io_get(self):
410 dwRead = c_uint32()
420 dwRead = c_uint32()
411 self.__libdwf.FDwfDigitalIOStatus (self.__hdwf)
421 self.__libdwf.FDwfDigitalIOStatus (self.__hdwf)
412 self.__libdwf.FDwfDigitalIOInputStatus(self.__hdwf, byref(dwRead))
422 self.__libdwf.FDwfDigitalIOInputStatus(self.__hdwf, byref(dwRead))
413 return dwRead.value
423 return dwRead.value
414
424
415 def digital_io_set(self,value):
425 def digital_io_set(self,value):
416 self.__libdwf.FDwfDigitalIOOutputSet(self.__hdwf, c_int(value))
426 self.__libdwf.FDwfDigitalIOOutputSet(self.__hdwf, c_int(value))
417
427
418 @property
428 @property
419 def digital_io(self):
429 def digital_io(self):
420 return self.digital_io_get()
430 return self.digital_io_get()
421
431
422 @digital_io.setter
432 @digital_io.setter
423 def digital_io(self,value):
433 def digital_io(self,value):
424 self.digital_io_set(value)
434 self.digital_io_set(value)
425
435
426 if __name__ == '__main__':
436 if __name__ == '__main__':
427 print("open first dev")
437 print("open first dev")
428 test = Discovery()
438 test = Discovery()
429 test.set_power()
439 test.set_power()
430 for i in range(2):
440 for i in range(2):
431 time.sleep(0.2)
441 time.sleep(0.2)
432 print(test.get_power())
442 print(test.get_power())
433 test.analog_out_gen()
443 test.analog_out_gen()
434 res=test.analog_in_read(frequency=1000000,samplesCount=1000)
444 res=test.analog_in_read(frequency=1000000,samplesCount=1000)
435 print(res)
445 print(res)
436 plt.plot(range(len(res[0][0])),res[0][0])
446 plt.plot(range(len(res[0][0])),res[0][0])
437 plt.plot(range(len(res[0][0])),res[0][1])
447 plt.plot(range(len(res[0][0])),res[0][1])
438 plt.show()
448 plt.show()
439 test.temp()
449 test.temp()
440 # del test
450 # del test
441 quit()
451 quit()
442
452
443
453
444
454
445
455
446
456
General Comments 0
You need to be logged in to leave comments. Login now