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
2 changes: 1 addition & 1 deletion Assets/Prefabs/UI/SettingsMenu/Menus/EphysLinkMenu.prefab
Original file line number Diff line number Diff line change
Expand Up @@ -2565,7 +2565,7 @@ MonoBehaviour:
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_Interactable: 0
m_TargetGraphic: {fileID: 6487466997665187127}
toggleTransition: 1
graphic: {fileID: 2477337667047670143}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,13 +246,21 @@ public void UpdateTargetInsertionOptions()
.Select(probeManager => (probeManager.OverrideName ?? probeManager.name) + ": " +
SurfaceCoordinateToString(probeManager.GetSurfaceCoordinateT())).ToList());

// Return early if no manipulator ID
if (ProbeManager.ManipulatorBehaviorController.ManipulatorID == null) return;

// Restore selection (if possible)
var selectedProbeManager = ManipulatorIDToSelectedTargetProbeManager.GetValueOrDefault(
ProbeManager.ManipulatorBehaviorController.ManipulatorID, null);
_targetInsertionDropdown.SetValueWithoutNotify(
_targetProbeManagerOptions.ToList()
.IndexOf(selectedProbeManager) + 1
);
if (selectedProbeManager == null)
// Select none if no previous selection.
_targetInsertionDropdown.SetValueWithoutNotify(0);
else
_targetInsertionDropdown.SetValueWithoutNotify(
_targetProbeManagerOptions.ToList()
.IndexOf(selectedProbeManager) + 1
);


// Color dropdown to match probe color
if (!selectedProbeManager) return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,11 @@ private void UpdateConnectionPanel()
private void UpdateManipulatorPanels()
{
// Default Copilot to be disabled unless the right manipulator type is found
_copilotToggle.interactable = false;

if (CommunicationManager.Instance.IsConnected)
{
CommunicationManager.Instance.GetManipulators((availableIDs, numAxes, _) =>
{
// Enable Copilot button if using Sensapex or New Scale
_copilotToggle.interactable = numAxes > 0;

// Keep track of handled manipulator panels
var handledManipulatorIds = new HashSet<string>();

Expand Down Expand Up @@ -232,6 +228,9 @@ public void ToggleCopilotPanel(bool isEnabled)
public void InvokeShouldUpdateProbesListEvent()
{
ShouldUpdateProbesListEvent.Invoke();

// Enable/Disable Copilot toggle based on if there are any probes that can be controlled by it.
_copilotToggle.interactable = LinkedProbes.Count > 0;
}

#endregion
Expand Down