@@ -125,8 +125,7 @@ static Function SI_CompressWave(wv)
125
125
126
126
variable i , j
127
127
128
- ReplaceWaveWithBackup ( wv, nonExistingBackupIsFatal=0 )
129
- CreateBackupWave ( wv)
128
+ CreateBackupWave ( wv, forceCreation = 1 )
130
129
SI_SortWave ( wv)
131
130
132
131
for ( i = 0; i < DimSize ( wv, ROWS) ; i += 1 )
@@ -224,6 +223,18 @@ static Function/WAVE SI_LoadMinSampIntFromDisk(deviceType)
224
223
return wv
225
224
End
226
225
226
+ /// @brief Store the lookup wave on disc
227
+ Function /WAVE SI_StoreMinSampIntOnDisk ( wv, deviceType)
228
+ WAVE wv
229
+ string deviceType
230
+
231
+ Duplicate wv, $ ( "SampInt_" + deviceType) /WAVE = storedWave
232
+
233
+ string path = GetFolder ( FunctionPath ( "" )) + "SampInt_" + deviceType + ".itx"
234
+ Save / O/ T/ M= "\n " storedWave as path
235
+ KillWaves / Z storedWave
236
+ End
237
+
227
238
/// @brief Query the DA_EPhys panel for the active channels and
228
239
/// fill it in the passed structure
229
240
///
@@ -276,6 +287,9 @@ Function SI_CreateLookupWave(panelTitle, [ignoreChannelOrder])
276
287
ignoreChannelOrder = !! ignoreChannelOrder
277
288
endif
278
289
290
+ NVAR raCycleID = $ GetRepeatedAcquisitionCycleID ( panelTitle)
291
+ raCycleID = 1
292
+
279
293
DC_ConfigureDataForITC ( panelTitle, DATA_ACQUISITION_MODE)
280
294
281
295
WAVE ITCDataWave = GetITCDataWave ( panelTitle)
@@ -286,7 +300,7 @@ Function SI_CreateLookupWave(panelTitle, [ignoreChannelOrder])
286
300
ret = ParseDeviceString ( panelTitle, deviceType, deviceNumber)
287
301
ASSERT ( ret, "Could not parse panelTitle" )
288
302
289
- if ( ! cmpstr ( deviceType, "ITC18USB" ))
303
+ if ( ! cmpstr ( deviceType, "ITC18USB" ) || ! cmpstr ( deviceType , "ITC16USB" ) || ! cmpstr ( deviceType , "ITC16" ) )
290
304
totalNumDA = 4
291
305
totalNumAD = 8
292
306
totalNumTTL = 4
@@ -415,23 +429,21 @@ Function SI_CreateLookupWave(panelTitle, [ignoreChannelOrder])
415
429
ITCConfigChannelReset2
416
430
417
431
SI_CompressWave ( results)
432
+ SI_StoreMinSampIntOnDisk ( results, deviceType)
418
433
End
419
434
420
435
/// @brief Test the preset sampling interval
421
436
static Function SI_TestSampInt ( panelTitle)
422
437
string panelTitle
423
438
424
- variable i , sampInt, ret , sampIntRead, numChannels, sampIntRef, iLast
439
+ variable i , sampInt, sampIntRead, numChannels, sampIntRef, iLast
425
440
variable numConsecutive = -1
426
441
variable numTries = 1001
427
442
428
443
WAVE ITCDataWave = GetITCDataWave ( panelTitle)
429
444
WAVE ITCChanConfigWave = GetITCChanConfigWave ( panelTitle)
430
445
numChannels = DimSize ( ITCChanConfigWave, ROWS)
431
446
432
- Make / I / FREE/ N= ( 2, numChannels) ReqWave
433
- ReqWave[ 0 ][] = ITCChanConfigWave[ q][ 0 ]
434
- ReqWave[ 1 ][] = ITCChanConfigWave[ q][ 1 ]
435
447
Make / D/ FREE/ N= ( 20, numChannels) ResultWave
436
448
437
449
for ( i =1; i < numTries; i += 1 )
@@ -442,15 +454,17 @@ static Function SI_TestSampInt(panelTitle)
442
454
endif
443
455
444
456
ITCChanConfigWave[][ 2 ] = sampInt
445
- ITCConfigAllChannels2 / Z ITCChanConfigWave, ITCDataWave
446
457
447
- if ( ! ret)
458
+ WAVE config_t = HW_ITC_TransposeAndToDouble ( ITCChanConfigWave)
459
+ ITCConfigAllChannels2 / Z config_t, ITCDataWave
460
+
461
+ if ( ! V_ITCError)
448
462
// we could set the sampling interval
449
463
// so we try to read it back and check if it is the same
450
464
ITCConfigChannelUpload2
451
465
HW_ITC_HandleReturnValues ( HARDWARE_ABORT_ON_ERROR, V_ITCError, V_ITCXOPError)
452
466
453
- ITCGetAllChannelsConfig2 / O ReqWave , ResultWave
467
+ ITCGetAllChannelsConfig2 / O config_t , ResultWave
454
468
HW_ITC_HandleReturnValues ( HARDWARE_ABORT_ON_ERROR, V_ITCError, V_ITCXOPError)
455
469
456
470
WaveStats / Q/ R= [ 12,12 ] ResultWave
@@ -477,7 +491,7 @@ static Function SI_TestSampInt(panelTitle)
477
491
endif
478
492
endfor
479
493
480
- return NaN
494
+ return -1
481
495
End
482
496
483
497
#else
@@ -557,6 +571,16 @@ static Function/WAVE SI_GetMinSampIntWave(panelTitle)
557
571
return SI_LoadMinSampIntFromDisk ( "ITC18USB" )
558
572
endif
559
573
574
+ return wv
575
+ break
576
+ case "ITC16USB" :
577
+ case "ITC16" :
578
+ WAVE /SDFR= dfr/ Z wv = SampInt_ITC16 USB
579
+
580
+ if ( ! WaveExists ( wv))
581
+ return SI_LoadMinSampIntFromDisk ( "ITC16USB" )
582
+ endif
583
+
560
584
return wv
561
585
break
562
586
case "ITC1600" :
0 commit comments