Skip to content

Commit 045c028

Browse files
committed
Attempt to #72
1 parent d334676 commit 045c028

File tree

2 files changed

+14
-28
lines changed

2 files changed

+14
-28
lines changed

application.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -954,14 +954,14 @@ def experiment(self):
954954

955955
n_c = 1
956956
self._bnc.run()
957-
self.avh.startAll(p_N_c)
957+
tp_scopes = None
958958

959959
while n_c <= p_N_c and self.experiment_on:
960960

961961
self.processing_text["text"] = "Processing experiment :\n"\
962962
+ "\tAverage : {}/{}\n".format(n_c, p_N_c)\
963963
+ "\tDelay : {}/{}".format(n_d, p_N_d)
964-
964+
self.avh.startAll(1)
965965
self._bnc.sendtrig()
966966
self.after(int(p_T_tot))
967967
self.update()
@@ -973,7 +973,13 @@ def experiment(self):
973973
p_N_c,
974974
n_d,
975975
p_N_d))
976-
self.avh.waitAll()
976+
self.avh.waitAll()
977+
if tp_scopes is None:
978+
tp_scopes = self.avh.getScopes()
979+
else:
980+
to_add = self.avh.getScopes()
981+
for key in tp_scopes:
982+
tp_scopes[key] += to_add[key]
977983
self._bnc.stop()
978984
n_d += 1
979985

@@ -983,7 +989,7 @@ def experiment(self):
983989
float(pulse.experimentTuple[BNC.DELAY].get()) \
984990
+ n_d * \
985991
float(pulse.experimentTuple[BNC.dPHASE].get())
986-
tp_scopes = self.avh.getScopes()
992+
# tp_scopes = self.avh.getScopes()
987993
self.avh.stopAll()
988994
self.spectra_storage.putSpectra(raw_timestamp, n_d, tp_scopes)
989995
self.liveDisplay.putSpectrasAndUpdate(

spectro.py

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ def Callbackfunc(self, Avh_Pointer, int_pointer):
408408

409409
tp_spectrum = Spectrum(list(lambdaList), list(spect))
410410
print(max(list(spect)))
411-
self.put((Avh_val, tp_spectrum))
411+
self.put(tp_spectrum)
412412

413413
else:
414414
raise c_AVA_Exceptions(int_val)
@@ -622,7 +622,7 @@ def prepareMeasure(self, device, intTime=10, triggerred=False,
622622
Meas.m_SaturationDetection = int(triggerred)
623623

624624
# Trigger configuration.
625-
Meas.m_Trigger.m_Mode = ctypes.c_ubyte(1 if triggerred else 0)
625+
Meas.m_Trigger.m_Mode = ctypes.c_ubyte(0)
626626
Meas.m_Trigger.m_Source = ctypes.c_ubyte(0)
627627
Meas.m_Trigger.m_SourceType = ctypes.c_ubyte(0)
628628

@@ -692,29 +692,9 @@ def getScope(self, device):
692692

693693
logger_ASH.debug("Gathering {} scopes.".format(device))
694694

695-
# Get the number of pixels.
696-
numPix = ctypes.c_short()
697-
AVS_DLL.AVS_GetNumPixels(device, ctypes.byref(numPix))
698-
699-
# Prepare data structures and get pixel values.
700-
spect = (ctypes.c_double * numPix.value)()
701-
timeStamp = ctypes.c_uint()
702-
AVS_DLL.AVS_GetScopeData(
703-
device,
704-
ctypes.byref(timeStamp),
705-
ctypes.byref(spect)
706-
)
707-
708-
# Get lambdas for all pixels.
709-
lambdaList = (ctypes.c_double * numPix.value)()
710-
AVS_DLL.AVS_GetLambda(device, ctypes.byref(lambdaList))
711-
712-
logger_ASH.debug("{} scopes gathered.".format(device))
713-
714-
# Clear Callback_Measurment for further observations
715-
self.devList[device][1].clear()
695+
id, callback = self.devList[device]
716696

717-
return self.devList[device][0], Spectrum(list(lambdaList), list(spect))
697+
return id, callback.get()
718698

719699
def stopMeasure(self, device):
720700
"""

0 commit comments

Comments
 (0)