From e4e82b7264233a2225c264eb426b1ca17fd0cbed Mon Sep 17 00:00:00 2001 From: Michael Huth Date: Fri, 8 Mar 2024 20:12:57 +0100 Subject: [PATCH] DC: Evaluate if the recreated stimset had an error condition - Use workaround to calculate setLength from the stimset wave only if the stimset recreation was good --- Packages/MIES/MIES_DataConfigurator.ipf | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Packages/MIES/MIES_DataConfigurator.ipf b/Packages/MIES/MIES_DataConfigurator.ipf index 0a1578ad81..22c4d9beb8 100644 --- a/Packages/MIES/MIES_DataConfigurator.ipf +++ b/Packages/MIES/MIES_DataConfigurator.ipf @@ -2410,7 +2410,7 @@ End static Function [WAVE/D daGains] DC_RecreateDataConfigurationResultFromLNB_DAC(STRUCT DataConfigurationResult &s, WAVE numericalValues, WAVE/T textualValues, variable sweepNo) - variable index, i, idx, clampMode, wbOodDAQOffset, postFeaturePoints + variable index, i, idx, clampMode, wbOodDAQOffset, postFeaturePoints, stimsetError string key Make/FREE/N=(NUM_DA_TTL_CHANNELS) s.DACList @@ -2499,7 +2499,12 @@ static Function [WAVE/D daGains] DC_RecreateDataConfigurationResultFromLNB_DAC(S if(WaveExists(settings)) s.setLength[i] = settings[index] elseif(WaveExists(s.stimSet[i])) - s.setLength[i] = DC_CalculateGeneratedDataSizeDAQMode(DimSize(s.stimSet[i], ROWS), s.decimationFactor) + stimsetError = WB_GetWaveNoteEntryAsNumber(note(s.stimSet[i]), STIMSET_ENTRY, key = STIMSET_ERROR_KEY) + if(!stimsetError) + s.setLength[i] = DC_CalculateGeneratedDataSizeDAQMode(DimSize(s.stimSet[i], ROWS), s.decimationFactor) + else + s.setLength[i] = NaN + endif endif if(daqChannelType[i] == DAQ_CHANNEL_TYPE_DAQ)