Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions Assets/Scripts/UI/States/AutomationStackState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ public class AutomationStackState : ResettingScriptableObject
private static bool IsPitchValid =>
ProbeManager.ActiveProbeManager
&& ProbeManager.ActiveProbeManager.ProbeController.Insertion.Pitch > 30;

/// <summary>
/// Visibility of the pitch warning.
/// </summary>
/// <returns>Flex when the pitch is invalid, none otherwise.</returns>
/// <see cref="IsPitchValid"/>
/// <see cref="IsPitchValid" />
[CreateProperty]
public DisplayStyle PitchWarningDisplayStyle =>
!IsPitchValid ? DisplayStyle.Flex : DisplayStyle.None;
Expand Down Expand Up @@ -93,7 +93,7 @@ public float ReferenceCoordinateCalibrationX
/// </summary>
/// <exception cref="InvalidOperationException">Automation is not enabled for the active probe manager.</exception>
[CreateProperty]
public float BregmaCalibrationY
public float ReferenceCoordinateCalibrationY
{
get => IsEnabled ? ActiveManipulatorBehaviorController.ReferenceCoordinateOffset.y : 0;
set
Expand All @@ -117,7 +117,7 @@ public float BregmaCalibrationY
/// </summary>
/// <exception cref="InvalidOperationException">Automation is not enabled for the active probe manager.</exception>
[CreateProperty]
public float BregmaCalibrationZ
public float ReferenceCoordinateCalibrationZ
{
get => IsEnabled ? ActiveManipulatorBehaviorController.ReferenceCoordinateOffset.z : 0;
set
Expand All @@ -141,7 +141,7 @@ public float BregmaCalibrationZ
/// </summary>
/// <exception cref="InvalidOperationException">Automation is not enabled for the active probe manager.</exception>
[CreateProperty]
public float BregmaCalibrationDepth
public float ReferenceCoordinateCalibrationDepth
{
get => IsEnabled ? ActiveManipulatorBehaviorController.ReferenceCoordinateOffset.w : 0;
set
Expand Down Expand Up @@ -173,6 +173,18 @@ private readonly Dictionary<
ProbeManager
> _manipulatorProbeManagerToSelectedTargetInsertionProbeManager = new();

/// <summary>
/// Is the target insertion radio button group enabled.
/// </summary>
/// <returns>
/// True if the probe is enabled and has not started driving into the brain yet, false otherwise.
/// </returns>
[CreateProperty]
public bool IsTargetInsertionRadioButtonGroupEnabled =>
IsEnabled
&& ActiveProbeAutomationStateManager.ProbeAutomationState
< ProbeAutomationState.DrivingToNearTarget;

/// <summary>
/// Selected target insertion option index.
/// Property accessor for the selected target insertion index.
Expand Down Expand Up @@ -378,7 +390,8 @@ private static string SurfaceCoordinateToString(
/// Is the drive to selected target entry coordinate button enabled.<br />
/// </summary>
/// <returns>
/// Returns true if the active probe manager is Ephys Link controlled, calibrated to reference coordinate, and has a selected target.
/// Returns true if the active probe manager is Ephys Link controlled, calibrated to reference coordinate, and has a
/// selected target.
/// </returns>
[CreateProperty]
public bool IsDriveToTargetEntryCoordinateButtonEnabled =>
Expand Down
9 changes: 5 additions & 4 deletions Assets/UI/Components/AutomationStack.uxml
Original file line number Diff line number Diff line change
Expand Up @@ -13,31 +13,31 @@
<engine:Label text="X" style="-unity-text-align: upper-center;" />
<engine:FloatField>
<Bindings>
<engine:DataBinding property="value" data-source-path="BregmaCalibrationX" binding-mode="ToTarget" />
<engine:DataBinding property="value" data-source-path="ReferenceCoordinateCalibrationX" binding-mode="ToTarget" />
</Bindings>
</engine:FloatField>
</engine:VisualElement>
<engine:VisualElement style="flex-grow: 1;">
<engine:Label text="Y" style="-unity-text-align: upper-center;" />
<engine:FloatField>
<Bindings>
<engine:DataBinding property="value" data-source-path="BregmaCalibrationY" binding-mode="TwoWay" />
<engine:DataBinding property="value" data-source-path="ReferenceCoordinateCalibrationY" binding-mode="TwoWay" />
</Bindings>
</engine:FloatField>
</engine:VisualElement>
<engine:VisualElement style="flex-grow: 1;">
<engine:Label text="Z" style="-unity-text-align: upper-center;" />
<engine:FloatField>
<Bindings>
<engine:DataBinding property="value" data-source-path="BregmaCalibrationZ" binding-mode="TwoWay" />
<engine:DataBinding property="value" data-source-path="ReferenceCoordinateCalibrationZ" binding-mode="TwoWay" />
</Bindings>
</engine:FloatField>
</engine:VisualElement>
<engine:VisualElement style="flex-grow: 1;">
<engine:Label text="Depth" style="-unity-text-align: upper-center;" />
<engine:FloatField>
<Bindings>
<engine:DataBinding property="value" data-source-path="BregmaCalibrationDepth" binding-mode="TwoWay" />
<engine:DataBinding property="value" data-source-path="ReferenceCoordinateCalibrationDepth" binding-mode="TwoWay" />
</Bindings>
</engine:FloatField>
</engine:VisualElement>
Expand All @@ -50,6 +50,7 @@
<Bindings>
<engine:DataBinding property="choices" data-source-path="TargetInsertionOptions" binding-mode="ToTarget" />
<engine:DataBinding property="value" data-source-path="SelectedTargetInsertionIndex" binding-mode="TwoWay" />
<engine:DataBinding property="enabledSelf" data-source-path="IsTargetInsertionRadioButtonGroupEnabled" binding-mode="ToTarget" />
</Bindings>
</engine:RadioButtonGroup>
<engine:Button text="Drive to Target Entry Coordinate" parse-escape-sequences="true" display-tooltip-when-elided="true" name="drive-to-target-entry-coordinate-button">
Expand Down