using AZTECHWB.Core; using AZTECHWB.Management; using AZTECHWB.UI; using UVC.UI.Commands; namespace AZTECHWB.Command { public class SelectedMachineCommand : ICommand { private bool isSimulation; Machine machine; public SelectedMachineCommand(Machine machine, bool isSimulation) { this.machine = machine; this.isSimulation = isSimulation; } public async void Execute(object? parameter = null) { if (isSimulation) { var aiSimulationManager = AZTECHSceneMain.Instance.GetManager(); var data = await aiSimulationManager.SetSimulationResult(machine); var popupCanvas = AZTECHSceneMain.Instance.GetManager().GetCanvas(); popupCanvas.OpenPanel(CanvasPanelOpenMode.Single); var InfoPanel = popupCanvas.GetPanel(); InfoPanel.SetDataInfo(data); } else { var controller = AZTECHAppMain.Instance.cameraController; if (controller.viewMode != ViewMode.PerspectiveView) { controller.SetViewMode(ViewMode.PerspectiveView); } var centerPos = machine.centerPos; controller.currentAzimuth = machine.focusAzimuth; controller.currentElevation = machine.focusElevation; controller.currentDistance = machine.focusDistance; controller.SetTargetPos(centerPos); } } } }