Skip to content

Commit

Permalink
DAP_CheckProc_Settings_PUser: Disable and stop manual pressure on use…
Browse files Browse the repository at this point in the history
…r access

This avoids a runtime assertion.
  • Loading branch information
t-b committed Jun 18, 2024
1 parent 9143134 commit 9f4bd85
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
12 changes: 11 additions & 1 deletion Packages/MIES/MIES_DAEphys.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -4459,14 +4459,24 @@ Function DAP_CheckProc_Settings_PUser(cba) : CheckBoxControl
device = cba.win
DAP_AbortIfUnlocked(device)
DAG_Update(device, cba.ctrlName, val = cba.checked)

WAVE pressureType = GetPressureTypeWv(device)

WAVE pressureDataWv = P_GetPressureDataWaveRef(device)
P_RunP_ControlIfTPOFF(device)
headstage = PressureDataWv[0][%UserSelectedHeadStage]

if(pressureType[headstage] == PRESSURE_TYPE_MANUAL)
PGC_SetAndActivateControl(device, "button_DataAcq_SSSetPressureMan")
endif

P_RunP_ControlIfTPOFF(device)
if(P_ValidatePressureSetHeadstage(device, headstage))
P_SetPressureValves(device, headstage, P_GetUserAccess(device, headstage, PressureDataWv[headstage][%Approach_Seal_BrkIn_Clear]))
endif
P_UpdatePressureType(device)

P_AdaptManualControlsForUserAccess(device, headstage)

break
endswitch

Expand Down
15 changes: 15 additions & 0 deletions Packages/MIES/MIES_PressureControl.ipf
Original file line number Diff line number Diff line change
Expand Up @@ -1826,6 +1826,21 @@ Function P_UpdatePressureModeTabs(device, headStage)
endif

PGC_SetAndActivateControl(device, "setvar_DataAcq_SSPressure", val = pressureWave[headStage][%ManSSPressure])

P_AdaptManualControlsForUserAccess(device, headStage)
End

Function P_AdaptManualControlsForUserAccess(string device, variable headstage)

string ctrlsDisableUserAccess = "button_DataAcq_SSSetPressureMan;setvar_DataAcq_SSPressure;button_DataAcq_PPSetPressureMan;setvar_DataAcq_PPPressure;setvar_DataAcq_PPDuration;check_DataAcq_ManPressureAll"

WAVE pressureType = GetPressureTypeWv(device)

if(pressureType[headstage] == PRESSURE_TYPE_USER)
DisableControls(device, ctrlsDisableUserAccess)
else
EnableControls(device, ctrlsDisableUserAccess)
endif
End

/// @brief Checks if all the pressure settings for a headStage are valid
Expand Down

0 comments on commit 9f4bd85

Please sign in to comment.