Skip to content

Commit

Permalink
SplitSweepIntoComponents: Make backup creation optional
Browse files Browse the repository at this point in the history
  • Loading branch information
t-b committed Oct 19, 2023
1 parent 3d1600c commit fba95a6
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Packages/MIES/MIES_MiesUtilities.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -5839,9 +5839,10 @@ End
/// @param configWave DAQConfigWave
/// @param targetDFR [optional, defaults to the sweep wave DFR] datafolder where to put the waves, can be a free datafolder
/// @param rescale One of @ref TTLRescalingOptions
threadsafe Function SplitSweepIntoComponents(numericalValues, sweep, sweepWave, configWave, rescale, [targetDFR])
/// @param createBackup [optional, defaults to true] allows to tune the creation of backup waves
threadsafe Function SplitSweepIntoComponents(numericalValues, sweep, sweepWave, configWave, rescale, [targetDFR, createBackup])
WAVE numericalValues, sweepWave, configWave
variable sweep, rescale
variable sweep, rescale, createBackup
DFREF targetDFR

variable numRows, i, channelNumber, ttlBits
Expand All @@ -5851,6 +5852,12 @@ threadsafe Function SplitSweepIntoComponents(numericalValues, sweep, sweepWave,
DFREF targetDFR = GetWavesDataFolderDFR(sweepWave)
endif

if(ParamIsDefault(createBackup))
createBackup = 1
else
createBackup = !!createBackup
endif

ASSERT_TS(IsFinite(sweep), "Sweep number must be finite")
ASSERT_TS(IsValidSweepAndConfig(sweepWave, configWave, configVersion = 0), "Sweep and config waves are not compatible")

Expand All @@ -5877,7 +5884,9 @@ threadsafe Function SplitSweepIntoComponents(numericalValues, sweep, sweepWave,

string/G targetDFR:note = note(sweepWave)

CreateBackupWavesForAll(targetDFR)
if(createBackup)
CreateBackupWavesForAll(targetDFR)
endif
End

/// @brief Add user data "panelVersion" to the panel
Expand Down

0 comments on commit fba95a6

Please sign in to comment.