Skip to content

Commit

Permalink
DC: Evaluate if the recreated stimset had an error condition
Browse files Browse the repository at this point in the history
- Use workaround to calculate setLength from the stimset wave only if
  the stimset recreation was good
  • Loading branch information
MichaelHuth committed Apr 4, 2024
1 parent e0472f7 commit e4e82b7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions Packages/MIES/MIES_DataConfigurator.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit e4e82b7

Please sign in to comment.