File MIES_Downsample.ipf

Panel for downsampling acquired data.

Folders and waves managed by code in this file

Object type

Name

Purpose

Function

DFREF

$dataPath

location of all the GUI and temporary data

GetDownsampleDataFolder()

Wave

$dataPath:dataRef

Holds wave references to all waves currently displayed in the list box

GetDownsampleDataRefWave()

Wave

$dataPath:rateWave

Holds all rates in kHz for each wave.

GetDownsampleRateWave()

Wave

$dataPath:sweepProperties

Used by the list box to show the properties of each sweep

GetDownsampleListWave()

Functions

static dfref GetDownsampleDataFolder()
static wave GetDownsampleDataRefWave()
static wave GetDownsampleRateWave()
static wave GetDownsampleListWave()
string GetPopupMenuDeviceListWithData()

Create a list of all devices with acquired data.

Returns:

list of all devices with data in the format ITC18USB_Dev_1;ITC1600_Dev_1

static variable AppendEntries(WaveText list, WaveRefWave dataRef, wave rate, variable startIndex, string deviceType, string deviceNumber)

Searches for sweep waves from all devices.

Parameters:
  • list – ListBox wave, see GetDownsampleListWave() for the format

  • dataRef – wave with wave references to all data waves

  • rate – wave with the sampling rates in kHz of all data waves

  • startIndex – first unused index into the passed waves

  • deviceType – device type

  • deviceNumber – device number

Returns:

index of the last valid entry into the passed waves

static variable UpdateDataWaves(string deviceType, string deviceNumber)

Updates all waves holding acquired data info.

static variable UpdateCurrentSize(string win)
static variable GetTargetRate(string win)
static variable UpdateEstimatedSizeAfterwards(string win)
static variable ApplyConstantRateChanges(string win)

Disable the equalize checkbox if all data waves have the same rate.

static string ExpandRateToList(string win, variable var, variable constantRates = defaultValue)

Returns a list of values 1/k*var with k = {1..10} or k = {2..10} if constantRates == 1.

Parameters:
  • win – panel name

  • var – variable to expand

  • constantRates – boolean switch, defaults to false

string GetPopupMenuRates()

Returns a list of all possible equalize/downsampling rates.

static variable GetDecimationMethod(string win)
static variable UpdateCheckBoxes(string win, string control, variable state)
static variable UpdatePopupMenuWindowFunction(string win, variable decimationMethod = defaultValue)
variable CreateDownsamplePanel()
variable DownsampleWindowHook(WMWinHookStruct *s)
variable CheckBoxInterpolation(WMCheckboxAction *cba)
variable PopupMenuTargetRate(WMPopupAction *pa)
variable ButtonRestoreBackup(WMButtonAction *ba)
variable ButtonDoIt(WMButtonAction *ba)
static variable UpdatePopupMenuTargetRate(string win)
static variable UpdatePanel(string win, string deviceSelectionString = defaultValue)
variable PopupMenuDeviceSelection(WMPopupAction *pa)
variable PopupMenuDecimationMethod(WMPopupAction *pa)
variable CheckBoxEqualizeDown(WMCheckboxAction *cba)

Variables

static const string checkbox_equalize = "checkbox_equalize_id"
static const string checkbox_downsample = "checkbox_downsample_id"
static const string popup_targetrate = "popup_targetrate_id"
static const string checkbox_interpolation = "checkbox_interpolation_id"
static const string popup_windowfunction = "popup_windowfunction_id"
static const string popup_decimationmethod = "popup_decimationmethod_id"
static const string popup_deviceselection = "popup_deviceselection_id"
static const string checkbox_backupwaves = "checkbox_backupwaves_id"
static const string valdisp_estimatedsize = "valdisp_estimatedsize_id"
static const string valdisp_currentsize = "valdisp_currentsize_id"
static const string listbox_waves = "listbox_waves_id"
static const string button_doit = "button_doit_id"
static const string button_restorebackup = "button_restorebackup_id"
static const string dataPath = "root:MIES:postExperimentProcedures:downsample:"
static const string panel = "Downsampling"