@@ -5513,11 +5513,47 @@ static Function/S DAP_TPControlToLabel(string ctrl)
55135513 endswitch
55145514End
55155515
5516+ /// @brief Get the physical unit for the control name
5517+ static Function/S DAP_TPControlToUnit ( string ctrl)
5518+
5519+ strswitch ( ctrl)
5520+ case "SetVar_DataAcq_TPDuration" :
5521+ return "ms"
5522+ case "SetVar_DataAcq_TPBaselinePerc" :
5523+ return "%"
5524+ case "SetVar_DataAcq_TPAmplitude" :
5525+ return "pA"
5526+ case "SetVar_DataAcq_TPAmplitudeIC" :
5527+ return "mV"
5528+ case "setvar_Settings_TPBuffer" :
5529+ return "a.u."
5530+ case "setvar_Settings_TP_RTolerance" :
5531+ return "MΩ"
5532+ case "check_DataAcq_AutoTP" :
5533+ return "On/Off"
5534+ case "setvar_DataAcq_IinjMax" :
5535+ return "pA"
5536+ case "setvar_DataAcq_targetVoltage" :
5537+ return "mV"
5538+ case "setvar_DataAcq_targetVoltageRange" :
5539+ return "mV"
5540+ case "Check_TP_SendToAllHS" :
5541+ return "On/Off"
5542+ case "setvar_Settings_autoTP_perc" :
5543+ return "%"
5544+ case "setvar_Settings_autoTP_int" :
5545+ return "s"
5546+ default :
5547+ ASSERT ( 0, "invalid control" )
5548+ break
5549+ endswitch
5550+ End
5551+
55165552/// @brief Write a new TP setting value to the wave
55175553static Function DAP_TPGUISettingToWave ( string device, string ctrl, variable val)
55185554
5519- string lbl, entry
5520- variable first, last, TPState, needsTPRestart
5555+ string lbl, entry, unit
5556+ variable first, last, TPState, needsTPRestart, headstage , i
55215557
55225558 needsTPRestart = WhichListItem ( ctrl, DAEPHYS_TP_CONTROLS_NO_RESTART) == -1
55235559
@@ -5546,6 +5582,12 @@ static Function DAP_TPGUISettingToWave(string device, string ctrl, variable val)
55465582
55475583 TPSettings[ %$ lbl][ first, last] = val
55485584
5585+ unit = DAP_TPControlToUnit ( ctrl)
5586+ for ( i = first; i <= last; i += 1 )
5587+ headstage = IsValidHeadstage ( i ) ? i : NaN
5588+ PUB_TPSettingChange ( device, headstage, lbl, val, unit)
5589+ endfor
5590+
55495591 if ( ! cmpstr ( lbl, "autoTPEnable" ))
55505592 TP_AutoTPGenerateNewCycleID ( device, first = first, last = last)
55515593 DAP_AdaptAutoTPColorAndDependent ( device)
0 commit comments