schangxiang@126.com
2025-11-04 f5ed29dc26c7cd952d56ec5721a2efc43cd25992
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
using DataEntity.Share;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Data;
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.Shapes;
using System.Xml;
using XCommon.Log;
using XHandler.Class;
using XHandler.Class.DataEx;
using XHandler.View.ManualCoating;
using XHandler.View.ManualPick;
 
 
namespace XHandler.View.ElectroCutGum
{
 
    /// <summary>
    /// ChoiceConfirmNext.xaml 的交互逻辑
    /// </summary>
    public partial class ChoiceConfirmNext : Window
    {
        public event EventHandler closeEvent;
        public event EventHandler okEvent;
        public ManualPickGum manualPickGum = null;
        public RunWnd launchView;
        public XmlNode methodNode;
        public DataTable dtChoiceParams;
        public bool cancelFlg = false;
        public ObservableCollection<BacteriaCoordinateEx> dgBacteriaCoordinates = null;
 
        public ChoiceConfirmNext()
        {
            InitializeComponent();
            this.Owner = (Window)Shared.Main;
        }
 
        private void Window_Load(object sender, RoutedEventArgs e)
        {
            // 1:人工挑选菌落;0:成像系统自动挑选菌落
            string choicemode = dtChoiceParams==null?"1":dtChoiceParams.Rows[9]["属性值"].ToString();
            if (choicemode.Equals("0"))
            {
                btnConfirm_Click(null, null);
            }
        }
 
        private void btnConfirm_Click(object sender, RoutedEventArgs e)
        {
            if (radiobtnDoNext.IsChecked == true)
            {
                ConfirmNext_okEvent();
            }
            else if (radiobtnCancel.IsChecked == true)
            {
                cancelFlg = true;
            }
            this.Close();
        }
 
        /// <summary>
        /// 执行下一个命令
        /// </summary>
        public void ConfirmNext_okEvent()
        {
            try
            {
                if (manualPickGum != null)
                {
                    this.Close();
                    CutSetting cutSetting = new CutSetting();
                    cutSetting.Height = this.ActualHeight;
                    cutSetting.Width = this.ActualWidth;
                    cutSetting.launchView = launchView;
                    cutSetting.methodNode = methodNode;
                    cutSetting.dtChoiceParams = dtChoiceParams;
                    SolidColorBrush mybtn1_Brush = new SolidColorBrush(System.Windows.Media.Color.FromArgb(0, 0, 0, 0));
                    cutSetting.Background = (System.Windows.Media.Brush)mybtn1_Brush;
                    cutSetting.dgBacteriaCoordinates = dgBacteriaCoordinates;
                    cutSetting.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                LoggerHelper.ErrorLog("ERROR:", ex);
            }
        }
 
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            if (EventResponseController.Instance.CanExecute() == false)
                return;
            cancelFlg = true;
            closeEvent?.Invoke(this, EventArgs.Empty);
        }
    }
}