using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using CoreUnit.Control.UserControl.Canvas; using VisionCommon; using VisionUI; using VisionUI.Camera; using WeldingCommon.Utils; using WeldingCommon.Views; namespace ILSOS_PrismaticGun.Views { /// /// Interaction logic for UCMainAutoRun.xaml /// public partial class UCMainAutoRun : UserControl { private UCMainAutoRunViewModel _ViewModel; public UCMainAutoRun(UCMainAutoRunViewModel viewModel) { InitializeComponent(); CreateAutoRunCameraView(); _ViewModel = viewModel; DataContext = _ViewModel; } private void CreateAutoRunCameraView() { if (AutoRunCamView.Children.Count == 0) { var fovInfo = VisionRecipeManager.GetFovInfos().ElementAtOrDefault(0); if (fovInfo != null) { var cameraView = IpViewManager.CreateCameraView(fovInfo, eDisplayType.Machine_A); AutoRunCamView.Children.Add(cameraView); } } //if (gridCommonAutoRunCameraView2.Children.Count == 0) { // var fovInfo = VisionRecipeManager.GetFovInfos().ElementAtOrDefault(1); // if (fovInfo != null) { // var cameraView = IpViewManager.CreateCameraView(fovInfo, eDisplayType.Machine_B); // gridCommonAutoRunCameraView2.Children.Add(cameraView); // } //} } private void uc_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) { bool isVisible = (bool)e.NewValue; if (isVisible == true) { // Camera Live //CameraUcManager.Instance.StartLiveAll(eDisplayType.Machine_A); //CameraUcManager.Instance.StartLiveAll(eDisplayType.Machine_B); } else { //CameraUcManager.Instance.StopLiveAll(); } } } }