|
@@ -73,10 +73,24 @@ class DefaultEngine:
|
|
|
ret = self.sync_interface.upload(str(settings.BASE_DIR) + '\\bin\\Sync.exe',
|
|
|
self.measure.info.isync.file,
|
|
|
self.measure.info.isync.port)
|
|
|
+
|
|
|
+ if(ret != 0):
|
|
|
+ self.measure.state.grax.status = 'CONFIG ERROR'
|
|
|
+ self.measure.state.grax.code = -1
|
|
|
+ self.measure.state.status = 'SYNC ERROR'
|
|
|
+ self.measure.state.code = -1
|
|
|
+ self.lock.acquire()
|
|
|
+ self.measure.state.grax.save()
|
|
|
+ self.measure.state.save()
|
|
|
+ self.measure.save()
|
|
|
+ self.lock.release()
|
|
|
+ return -1
|
|
|
|
|
|
# Final configuration: set the status to configured for sync and overall.
|
|
|
self.measure.state.sync.status = 'CONFIGURED'
|
|
|
self.measure.state.sync.code = 1
|
|
|
+ self.measure.state.status = 'SYNC CONFIGURED'
|
|
|
+ self.measure.state.code = 1
|
|
|
|
|
|
self.lock.acquire()
|
|
|
self.measure.state.sync.save()
|
|
@@ -101,6 +115,8 @@ class DefaultEngine:
|
|
|
return -1
|
|
|
self.measure.state.sync.status = 'WAIT FOR TRIGGER'
|
|
|
self.measure.state.sync.code = 2
|
|
|
+ self.measure.state.status = 'SYNC WAIT'
|
|
|
+ self.measure.state.code = 2
|
|
|
print('SENDED')
|
|
|
return 0
|
|
|
|
|
@@ -277,12 +293,224 @@ class DefaultEngine:
|
|
|
|
|
|
self.measure.state.graz.code = 1
|
|
|
self.measure.state.graz.status = 'CONFIGURED'
|
|
|
+ self.measure.state.status = 'GRA CONFIGURED'
|
|
|
+ self.measure.state.code = 2
|
|
|
+
|
|
|
self.lock.acquire()
|
|
|
self.measure.state.graz.save()
|
|
|
self.measure.state.save()
|
|
|
self.measure.save()
|
|
|
self.lock.release()
|
|
|
+ return 0
|
|
|
+
|
|
|
+ def adcUp(self):
|
|
|
+ try:
|
|
|
+ self.adc_interface.connect()
|
|
|
+ except:
|
|
|
+ self.measure.state.adc.status = 'CONN ERROR'
|
|
|
+ self.measure.state.adc.code = -1
|
|
|
+ self.measure.state.status = 'ADC ERROR'
|
|
|
+ self.measure.state.code = -3
|
|
|
+ self.lock.acquire()
|
|
|
+ self.measure.state.adc.save()
|
|
|
+ self.measure.state.save()
|
|
|
+ self.measure.save()
|
|
|
+ self.lock.release()
|
|
|
+ self.adc_interface.client_socket.close()
|
|
|
+ return -1
|
|
|
|
|
|
+ ret = self.adc_interface.open()
|
|
|
+ if(ret[0] == 0xFF):
|
|
|
+ self.measure.state.adc.status = 'OPEN ERROR'
|
|
|
+ self.measure.state.adc.code = -2
|
|
|
+ self.measure.state.status = 'ADC ERROR'
|
|
|
+ self.measure.state.code = -3
|
|
|
+ self.lock.acquire()
|
|
|
+ self.measure.state.adc.save()
|
|
|
+ self.measure.state.save()
|
|
|
+ self.measure.save()
|
|
|
+ self.lock.release()
|
|
|
+ self.adc_interface.client_socket.close()
|
|
|
+ return ret
|
|
|
+ self.measure.state.adc.status = 'OPENED'
|
|
|
+ self.measure.state.adc.code = 1
|
|
|
+ self.measure.state.status = 'ADC OPENED'
|
|
|
+ self.measure.state.code = 3
|
|
|
+ self.lock.acquire()
|
|
|
+ self.measure.state.sync.save()
|
|
|
+ self.measure.state.save()
|
|
|
+ self.measure.save()
|
|
|
+ self.lock.release()
|
|
|
+ print('UPDATED')
|
|
|
+ return 0
|
|
|
+
|
|
|
+ def adcConfig(self):
|
|
|
+ rate = self.measure.info.iadc.srate
|
|
|
+ ret = self.adc_interface.set_rate(rate)
|
|
|
+ if(ret[0] == 0xFF):
|
|
|
+ self.measure.state.adc.status = 'RATE ERROR'
|
|
|
+ self.measure.state.adc.code = -3
|
|
|
+ self.measure.state.status = 'ADC ERROR'
|
|
|
+ self.measure.state.code = -3
|
|
|
+ self.lock.acquire()
|
|
|
+ self.measure.state.adc.save()
|
|
|
+ self.measure.state.save()
|
|
|
+ self.measure.save()
|
|
|
+ self.lock.release()
|
|
|
+ self.adc_interface.client_socket.close()
|
|
|
+ return ret
|
|
|
+
|
|
|
+ points = self.measure.info.iadc.points
|
|
|
+ ret = self.adc_interface.set_points(points)
|
|
|
+ if(ret[0] == 0xFF):
|
|
|
+ self.measure.state.adc.status = 'POINTS ERROR'
|
|
|
+ self.measure.state.adc.code = -4
|
|
|
+ self.measure.state.status = 'ADC ERROR'
|
|
|
+ self.measure.state.code = -3
|
|
|
+ self.lock.acquire()
|
|
|
+ self.measure.state.adc.save()
|
|
|
+ self.measure.state.save()
|
|
|
+ self.measure.save()
|
|
|
+ self.lock.release()
|
|
|
+ self.adc_interface.client_socket.close()
|
|
|
+ return ret
|
|
|
+
|
|
|
+ ret = self.adc_interface.config_channels(self.measure.info.iadc.n_channels,
|
|
|
+ self.measure.info.iadc.channel_ranges,
|
|
|
+ self.measure.info.iadc.trigger_channel,
|
|
|
+ self.measure.info.iadc.trig_direction,
|
|
|
+ self.measure.info.iadc.threshold,
|
|
|
+ self.measure.info.iadc.auto_measure_time)
|
|
|
+ if(ret[0] == 0xFF):
|
|
|
+ self.measure.state.adc.status = 'TRIGGER CONFIG ERROR'
|
|
|
+ self.measure.state.adc.code = -5
|
|
|
+ self.measure.state.status = 'ADC ERROR'
|
|
|
+ self.measure.state.code = -3
|
|
|
+ self.lock.acquire()
|
|
|
+ self.measure.state.adc.save()
|
|
|
+ self.measure.state.save()
|
|
|
+ self.measure.save()
|
|
|
+ self.lock.release()
|
|
|
+ self.adc_interface.client_socket.close()
|
|
|
+ return ret
|
|
|
+
|
|
|
+ ret = self.adc_interface.set_premeasure(0)
|
|
|
+ if(ret[0] == 0xFF):
|
|
|
+ self.measure.state.adc.status = 'SET PREMEASURE ERROR'
|
|
|
+ self.measure.state.adc.code = -6
|
|
|
+ self.measure.state.status = 'ADC ERROR'
|
|
|
+ self.measure.state.code = -3
|
|
|
+ self.lock.acquire()
|
|
|
+ self.measure.state.adc.save()
|
|
|
+ self.measure.state.save()
|
|
|
+ self.measure.save()
|
|
|
+ self.lock.release()
|
|
|
+ self.adc_interface.client_socket.close()
|
|
|
+ return ret
|
|
|
+
|
|
|
+ ret = self.adc_interface.set_trignum(self.measure.info.iadc.n_triggers)
|
|
|
+ if(ret[0] == 0xFF):
|
|
|
+ self.measure.state.adc.status = 'SET PREMEASURE ERROR'
|
|
|
+ self.measure.state.adc.code = -6
|
|
|
+ self.measure.state.status = 'ADC ERROR'
|
|
|
+ self.measure.state.code = -3
|
|
|
+ self.lock.acquire()
|
|
|
+ self.measure.state.adc.save()
|
|
|
+ self.measure.state.save()
|
|
|
+ self.measure.save()
|
|
|
+ self.lock.release()
|
|
|
+ self.adc_interface.client_socket.close()
|
|
|
+ return ret
|
|
|
+ self.measure.state.adc.status = 'CONFIGURED'
|
|
|
+ self.measure.state.adc.code = 2
|
|
|
+ self.measure.state.status = 'ADC CONFIGURED'
|
|
|
+ self.measure.state.code = 3
|
|
|
+ self.lock.acquire()
|
|
|
+ self.measure.state.sync.save()
|
|
|
+ self.measure.state.save()
|
|
|
+ self.measure.save()
|
|
|
+ self.lock.release()
|
|
|
+ print('UPDATED')
|
|
|
+ return 0
|
|
|
+
|
|
|
+ def sdrUp(self, thr):
|
|
|
+ ret = self.sdr_interface.transf(str(settings.BASE_DIR) + '\\bin\\hackrftrans00.exe',
|
|
|
+ self.measure.info.isdr.file,
|
|
|
+ self.measure.info.isdr.freq,
|
|
|
+ self.measure.info.isdr.srate,
|
|
|
+ int(self.measure.info.isdr.ampl),
|
|
|
+ self.measure.info.isdr.gain)
|
|
|
+ if(ret[0] == 0xFF):
|
|
|
+ self.measure.state.sdr.status = 'SDR ERROR (WAIT FOR STOPING ADC!)'
|
|
|
+ self.measure.state.sdr.code = -1
|
|
|
+ self.measure.state.status = 'SDR ERROR'
|
|
|
+ self.measure.state.code = -3
|
|
|
+ self.lock.acquire()
|
|
|
+ self.measure.state.sdr.save()
|
|
|
+ self.measure.state.save()
|
|
|
+ self.measure.save()
|
|
|
+ self.lock.release()
|
|
|
+ if(thr != None):
|
|
|
+ thr.join()
|
|
|
+ self.measure.state.sdr.status = 'SDR ERROR'
|
|
|
+ self.measure.state.sdr.code = -2
|
|
|
+ self.lock.acquire()
|
|
|
+ self.measure.state.sdr.save()
|
|
|
+ self.measure.state.save()
|
|
|
+ self.measure.save()
|
|
|
+ self.lock.release()
|
|
|
+ self.adc_interface.client_socket.close()
|
|
|
+ return ret
|
|
|
+ self.measure.state.sdr.status = 'STARTED'
|
|
|
+ self.measure.state.sdr.code = 1
|
|
|
+ self.measure.state.status = 'SDR START'
|
|
|
+ self.measure.state.code = 4
|
|
|
+ self.lock.acquire()
|
|
|
+ self.measure.state.sdr.save()
|
|
|
+ self.measure.state.save()
|
|
|
+ self.measure.save()
|
|
|
+ self.lock.release()
|
|
|
+ return 0
|
|
|
+
|
|
|
+ def adcWrite(self, k):
|
|
|
+ self.lock.acquire()
|
|
|
+ for i in range(len(self.adc_interface.ndata)):
|
|
|
+ data = models.measurement_data.objects.create(data_num=i, averaging_num=k, measurement=self.measure)
|
|
|
+ for j in range(len(self.adc_interface.ndata[i])):
|
|
|
+ cdata = data.channel_data.create(channel_num=j,
|
|
|
+ measurement_data=data,
|
|
|
+ channel_data=base64.b64encode(self.adc_interface.ndata[i][j]).decode('utf-8'))
|
|
|
+ cdata.save()
|
|
|
+ data.save()
|
|
|
+ self.measure.save()
|
|
|
+ self.lock.release()
|
|
|
+ self.adc_interface.clear_ndata()
|
|
|
+ tm.sleep(1)
|
|
|
+ return 0
|
|
|
+
|
|
|
+ def close(self):
|
|
|
+ ret = self.sync_interface.serial_close()
|
|
|
+ if(self.measure.info.iadc.enabled):
|
|
|
+ self.adc_interface.client_socket.close()
|
|
|
+
|
|
|
+ self.measure.state.adc.status = 'MEASURE COMPLETED'
|
|
|
+ self.measure.state.data_ready = True
|
|
|
+ self.measure.state.adc.code = 1
|
|
|
+ self.measure.state.status = 'MEASURE COMPLETED'
|
|
|
+ self.measure.state.code = 1
|
|
|
+
|
|
|
+ self.lock.acquire()
|
|
|
+ self.measure.state.grax.save()
|
|
|
+ self.measure.state.gray.save()
|
|
|
+ self.measure.state.graz.save()
|
|
|
+ self.measure.state.sync.save()
|
|
|
+ self.measure.state.sdr.save()
|
|
|
+ self.measure.state.adc.save()
|
|
|
+ self.measure.state.save()
|
|
|
+ self.measure.save()
|
|
|
+ self.lock.release()
|
|
|
+ return 0
|
|
|
+
|
|
|
def run(self):
|
|
|
# Connect to the sync product first
|
|
|
# Open the sync product, check for errors if any returned with status byte 0xFF
|
|
@@ -292,8 +520,6 @@ class DefaultEngine:
|
|
|
self.sync_interface.serial_open(self.measure.info.isync.port)
|
|
|
|
|
|
if(self.measure.info.iadc.enabled == True):
|
|
|
- print('try to connect')
|
|
|
-
|
|
|
for k in range(0, self.measure.info.iadc.averaging):
|
|
|
print('SENDING TRIGGER')
|
|
|
|
|
@@ -302,110 +528,12 @@ class DefaultEngine:
|
|
|
if(ret != 0):
|
|
|
return ret
|
|
|
|
|
|
- try:
|
|
|
- self.adc_interface.connect()
|
|
|
- except:
|
|
|
- self.measure.state.adc.status = 'CONN ERROR'
|
|
|
- self.measure.state.adc.code = -1
|
|
|
- self.measure.state.status = 'ADC ERROR'
|
|
|
- self.measure.state.code = -3
|
|
|
- self.lock.acquire()
|
|
|
- self.measure.state.adc.save()
|
|
|
- self.measure.state.save()
|
|
|
- self.measure.save()
|
|
|
- self.lock.release()
|
|
|
- self.adc_interface.client_socket.close()
|
|
|
- return -1
|
|
|
-
|
|
|
- ret = self.adc_interface.open()
|
|
|
- if(ret[0] == 0xFF):
|
|
|
- self.measure.state.adc.status = 'OPEN ERROR'
|
|
|
- self.measure.state.adc.code = -2
|
|
|
- self.measure.state.status = 'ADC ERROR'
|
|
|
- self.measure.state.code = -3
|
|
|
- self.lock.acquire()
|
|
|
- self.measure.state.adc.save()
|
|
|
- self.measure.state.save()
|
|
|
- self.measure.save()
|
|
|
- self.lock.release()
|
|
|
- self.adc_interface.client_socket.close()
|
|
|
- return ret
|
|
|
-
|
|
|
- rate = self.measure.info.iadc.srate
|
|
|
- ret = self.adc_interface.set_rate(rate)
|
|
|
- if(ret[0] == 0xFF):
|
|
|
- self.measure.state.adc.status = 'RATE ERROR'
|
|
|
- self.measure.state.adc.code = -3
|
|
|
- self.measure.state.status = 'ADC ERROR'
|
|
|
- self.measure.state.code = -3
|
|
|
- self.lock.acquire()
|
|
|
- self.measure.state.adc.save()
|
|
|
- self.measure.state.save()
|
|
|
- self.measure.save()
|
|
|
- self.lock.release()
|
|
|
- self.adc_interface.client_socket.close()
|
|
|
- return ret
|
|
|
-
|
|
|
- points = self.measure.info.iadc.points
|
|
|
- ret = self.adc_interface.set_points(points)
|
|
|
- if(ret[0] == 0xFF):
|
|
|
- self.measure.state.adc.status = 'POINTS ERROR'
|
|
|
- self.measure.state.adc.code = -4
|
|
|
- self.measure.state.status = 'ADC ERROR'
|
|
|
- self.measure.state.code = -3
|
|
|
- self.lock.acquire()
|
|
|
- self.measure.state.adc.save()
|
|
|
- self.measure.state.save()
|
|
|
- self.measure.save()
|
|
|
- self.lock.release()
|
|
|
- self.adc_interface.client_socket.close()
|
|
|
- return ret
|
|
|
-
|
|
|
- ret = self.adc_interface.config_channels(self.measure.info.iadc.n_channels,
|
|
|
- self.measure.info.iadc.channel_ranges,
|
|
|
- self.measure.info.iadc.trigger_channel,
|
|
|
- self.measure.info.iadc.trig_direction,
|
|
|
- self.measure.info.iadc.threshold,
|
|
|
- self.measure.info.iadc.auto_measure_time)
|
|
|
- if(ret[0] == 0xFF):
|
|
|
- self.measure.state.adc.status = 'TRIGGER CONFIG ERROR'
|
|
|
- self.measure.state.adc.code = -5
|
|
|
- self.measure.state.status = 'ADC ERROR'
|
|
|
- self.measure.state.code = -3
|
|
|
- self.lock.acquire()
|
|
|
- self.measure.state.adc.save()
|
|
|
- self.measure.state.save()
|
|
|
- self.measure.save()
|
|
|
- self.lock.release()
|
|
|
- self.adc_interface.client_socket.close()
|
|
|
- return ret
|
|
|
-
|
|
|
- ret = self.adc_interface.set_premeasure(0)
|
|
|
- if(ret[0] == 0xFF):
|
|
|
- self.measure.state.adc.status = 'SET PREMEASURE ERROR'
|
|
|
- self.measure.state.adc.code = -6
|
|
|
- self.measure.state.status = 'ADC ERROR'
|
|
|
- self.measure.state.code = -3
|
|
|
- self.lock.acquire()
|
|
|
- self.measure.state.adc.save()
|
|
|
- self.measure.state.save()
|
|
|
- self.measure.save()
|
|
|
- self.lock.release()
|
|
|
- self.adc_interface.client_socket.close()
|
|
|
+ ret = self.adcUp()
|
|
|
+ if(ret != 0):
|
|
|
return ret
|
|
|
|
|
|
- ret = self.adc_interface.set_trignum(self.measure.info.iadc.n_triggers)
|
|
|
- if(ret[0] == 0xFF):
|
|
|
- self.measure.state.adc.status = 'SET PREMEASURE ERROR'
|
|
|
- self.measure.state.adc.code = -6
|
|
|
- self.measure.state.status = 'ADC ERROR'
|
|
|
- self.measure.state.code = -3
|
|
|
- self.lock.acquire()
|
|
|
- self.measure.state.adc.save()
|
|
|
- self.measure.state.save()
|
|
|
- self.measure.save()
|
|
|
- self.lock.release()
|
|
|
- self.adc_interface.client_socket.close()
|
|
|
+ ret = self.adcConfig()
|
|
|
+ if(ret != 0):
|
|
|
return ret
|
|
|
|
|
|
t = NewThread(target=self.adc_interface.start)
|
|
@@ -413,35 +541,10 @@ class DefaultEngine:
|
|
|
|
|
|
tm.sleep(1)
|
|
|
|
|
|
- ret = self.sdr_interface.transf(str(settings.BASE_DIR) + '\\bin\\hackrftrans00.exe',
|
|
|
- self.measure.info.isdr.file,
|
|
|
- self.measure.info.isdr.freq,
|
|
|
- self.measure.info.isdr.srate,
|
|
|
- int(self.measure.info.isdr.ampl),
|
|
|
- self.measure.info.isdr.gain)
|
|
|
- if(ret[0] == 0xFF):
|
|
|
- self.measure.state.sdr.status = 'SDR ERROR'
|
|
|
- self.measure.state.sdr.code = -8
|
|
|
- self.measure.state.status = 'SDR ERROR (WAIT FOR STOPING ADC!)'
|
|
|
- self.measure.state.code = -3
|
|
|
- self.lock.acquire()
|
|
|
- self.measure.state.sdr.save()
|
|
|
- self.measure.state.save()
|
|
|
- self.measure.save()
|
|
|
- self.lock.release()
|
|
|
- t.join()
|
|
|
- self.adc_interface.client_socket.close()
|
|
|
- return ret
|
|
|
-
|
|
|
- self.measure.state.sdr.status = 'CONFIGURED'
|
|
|
- self.measure.state.sdr.code = 1
|
|
|
- self.lock.acquire()
|
|
|
- self.measure.state.sdr.save()
|
|
|
- self.measure.state.save()
|
|
|
- self.measure.save()
|
|
|
- self.lock.release()
|
|
|
+ ret = self.sdrUp(t)
|
|
|
|
|
|
t.join()
|
|
|
+
|
|
|
ret = self.adc_interface.measure_code
|
|
|
if(ret[0] == 0xFF):
|
|
|
self.measure.state.adc.status = 'MEASURE ERROR'
|
|
@@ -455,99 +558,25 @@ class DefaultEngine:
|
|
|
self.lock.release()
|
|
|
self.adc_interface.client_socket.close()
|
|
|
return ret
|
|
|
-
|
|
|
- #ret = self.adc_interface.stop()
|
|
|
- #if(ret == 0xFF):
|
|
|
- # self.measure.state.adc.status = 'CLOSE ERROR'
|
|
|
- # self.measure.state.adc.code = -8
|
|
|
- # self.measure.state.status = 'ADC ERROR'
|
|
|
- # self.measure.state.code = -3
|
|
|
- # self.lock.acquire()
|
|
|
- # self.measure.state.adc.save()
|
|
|
- # self.measure.state.save()
|
|
|
- # self.measure.save()
|
|
|
- # self.lock.release()
|
|
|
- # return ret
|
|
|
|
|
|
- self.lock.acquire()
|
|
|
- for i in range(len(self.adc_interface.ndata)):
|
|
|
- data = models.measurement_data.objects.create(data_num=i, averaging_num=k, measurement=self.measure)
|
|
|
- for j in range(len(self.adc_interface.ndata[i])):
|
|
|
- cdata = data.channel_data.create(channel_num=j,
|
|
|
- measurement_data=data,
|
|
|
- channel_data=base64.b64encode(self.adc_interface.ndata[i][j]).decode('utf-8'))
|
|
|
- cdata.save()
|
|
|
- data.save()
|
|
|
- self.measure.save()
|
|
|
- self.lock.release()
|
|
|
- self.adc_interface.clear_ndata()
|
|
|
- tm.sleep(1)
|
|
|
+ self.adcWrite(k)
|
|
|
else:
|
|
|
- print('STARTING')
|
|
|
print('SENDING TRIGGER')
|
|
|
# Set trigger wait, check for errors
|
|
|
- ret = self.sync_interface.trig_wait(self.measure.info.isync.port)
|
|
|
- if(ret[0] == 0xFF):
|
|
|
- self.measure.state.sync.status = 'TRIG SET ERROR'
|
|
|
- self.measure.state.sync.code = -4
|
|
|
- self.measure.state.status = 'SYNC ERROR'
|
|
|
- self.measure.state.code = -1
|
|
|
- self.lock.acquire()
|
|
|
- self.measure.state.sync.save()
|
|
|
- self.measure.state.save()
|
|
|
- self.measure.save()
|
|
|
- self.lock.release()
|
|
|
+ ret = self.syncWait()
|
|
|
+ if(ret != 0):
|
|
|
return ret
|
|
|
|
|
|
- ret = self.sdr_interface.transf(str(settings.BASE_DIR) + '\\bin\\hackrftrans00.exe',
|
|
|
- self.measure.info.isdr.file,
|
|
|
- self.measure.info.isdr.freq,
|
|
|
- self.measure.info.isdr.srate,
|
|
|
- int(self.measure.info.isdr.ampl),
|
|
|
- self.measure.info.isdr.gain)
|
|
|
- if(ret[0] == 0xFF):
|
|
|
- self.measure.state.sdr.status = 'SDR ERROR'
|
|
|
- self.measure.state.sdr.code = -8
|
|
|
- self.measure.state.status = 'SDR ERROR'
|
|
|
- self.measure.state.code = -3
|
|
|
- self.lock.acquire()
|
|
|
- self.measure.state.sdr.save()
|
|
|
- self.measure.state.save()
|
|
|
- self.measure.save()
|
|
|
- self.lock.release()
|
|
|
+ ret = self.sdrUp(None)
|
|
|
+ if(ret[0] != 0):
|
|
|
return ret
|
|
|
|
|
|
- self.measure.state.sdr.status = 'CONFIGURED'
|
|
|
- self.measure.state.sdr.code = 1
|
|
|
- self.lock.acquire()
|
|
|
- self.measure.state.sdr.save()
|
|
|
- self.measure.state.save()
|
|
|
- self.measure.save()
|
|
|
- self.lock.release()
|
|
|
-
|
|
|
-
|
|
|
- ret = self.sync_interface.serial_close()
|
|
|
- if(self.measure.info.iadc.enabled):
|
|
|
- self.adc_interface.client_socket.close()
|
|
|
-
|
|
|
- self.measure.state.adc.status = 'MEASURE COMPLETED'
|
|
|
- self.measure.state.data_ready = True
|
|
|
- self.measure.state.adc.code = 1
|
|
|
- self.measure.state.status = 'MEASURE COMPLETED'
|
|
|
- self.measure.state.code = 1
|
|
|
|
|
|
- self.lock.acquire()
|
|
|
- self.measure.state.grax.save()
|
|
|
- self.measure.state.gray.save()
|
|
|
- self.measure.state.graz.save()
|
|
|
- self.measure.state.sync.save()
|
|
|
- self.measure.state.sdr.save()
|
|
|
- self.measure.state.adc.save()
|
|
|
- self.measure.state.save()
|
|
|
- self.measure.save()
|
|
|
- self.lock.release()
|
|
|
+ ret = self.close()
|
|
|
+ if(ret != 0):
|
|
|
+ return ret
|
|
|
|
|
|
- return (0x00, 0)
|
|
|
+ return 0
|
|
|
|
|
|
EngineDict = {
|
|
|
'DefaultEngine': DefaultEngine
|