@@ -5513,11 +5513,47 @@ static Function/S DAP_TPControlToLabel(string ctrl)
5513
5513
endswitch
5514
5514
End
5515
5515
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
+
5516
5552
/// @brief Write a new TP setting value to the wave
5517
5553
static Function DAP_TPGUISettingToWave ( string device, string ctrl, variable val)
5518
5554
5519
- string lbl, entry
5520
- variable first, last, TPState, needsTPRestart
5555
+ string lbl, entry, unit
5556
+ variable first, last, TPState, needsTPRestart, headstage , i
5521
5557
5522
5558
needsTPRestart = WhichListItem ( ctrl, DAEPHYS_TP_CONTROLS_NO_RESTART) == -1
5523
5559
@@ -5546,6 +5582,12 @@ static Function DAP_TPGUISettingToWave(string device, string ctrl, variable val)
5546
5582
5547
5583
TPSettings[ %$ lbl][ first, last] = val
5548
5584
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
+
5549
5591
if ( ! cmpstr ( lbl, "autoTPEnable" ))
5550
5592
TP_AutoTPGenerateNewCycleID ( device, first = first, last = last)
5551
5593
DAP_AdaptAutoTPColorAndDependent ( device)
0 commit comments