轮胎外观检测添加思谋语义分割模型检测工具
C3204
15 小时以前 9f977a3c2d872b18eb69199b7b1ec18da485dc4e
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
using LB_VisionControls;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
 
namespace LB_VisionProcesses.Processes
{
    public partial class RecordControl : UserControl
    {
        ProcessCollections<object> Inputs = new ProcessCollections<object>();
        public RecordControl(int index = 0, UserRecord record = null, ProcessCollections<object> Inputs = null)
        {
            InitializeComponent();
 
            if (Inputs == null)
                this.Inputs = new ProcessCollections<object>();
 
            if (record == null)
                record = new UserRecord();
 
            lblIndex.Text = index.ToString();
            txtMsg.Text = record.MsgMap;
            txtShape.Text = record.ShapeMap;
            txtResult.Text = record.ResultMap;
            txtX.Text = record.XMap;
            txtY.Text = record.YMap;
 
            //cmbText.MouseClick += MouseClick;
            //cmbShape.MouseClick += MouseClick;
            //cmbResult.MouseClick += MouseClick;
            //cmbX.MouseClick += MouseClick;
            //cmbY.MouseClick += MouseClick;
        }
 
        public UserRecord GetUserRecord()
        {
            UserRecord record = new UserRecord();
            record.MsgMap = txtMsg.Text;
            record.ShapeMap = txtShape.Text;
            record.ResultMap = txtResult.Text;
            record.XMap = txtX.Text;
            record.YMap = txtY.Text;
            return record;
        }
 
        //private void MouseClick(object sender, EventArgs e)
        //{
        //    switch ((sender as ComboBox).Name)
        //    {
        //        case "cmbText":
        //            cmbText.Items.Clear();
        //            foreach (var input in Inputs)
        //            {
        //                if (string.IsNullOrEmpty(input.Value?.ToString()))
        //                    continue;
        //                cmbText.Items.Add($"{{{input.Name}}}");
        //            }
        //            break;
        //        case "cmbShape":
        //            cmbShape.Items.Clear();
        //            foreach (var input in Inputs)
        //            {
        //                if (input.Value == null || !(input.Value is ROI))
        //                    continue;
        //                cmbShape.Items.Add($"{{{input.Name}}}");
        //            }
        //            break;
        //        case "cmbResult":
        //            cmbResult.Items.Clear();
        //            foreach (var input in Inputs)
        //            {
        //                if (input.Value == null || !(bool.TryParse(input.Value?.ToString(), out _)))
        //                    continue;
        //                cmbResult.Items.Add($"{{{input.Name}}}");
        //            }
        //            break;
        //        case "cmbX":
        //            cmbX.Items.Clear();
        //            foreach (var input in Inputs)
        //            {
        //                if (input.Value == null || !(double.TryParse(input.Value?.ToString(), out _)))
        //                    continue;
        //                cmbX.Items.Add($"{{{input.Name}}}");
        //            }
        //            break;
        //        case "cmbY":
        //            cmbY.Items.Clear();
        //            foreach (var input in Inputs)
        //            {
        //                if (input.Value == null || !(double.TryParse(input.Value?.ToString(), out _)))
        //                    continue;
        //                cmbY.Items.Add($"{{{input.Name}}}");
        //            }
        //            break;
        //        default:
        //            break;
        //    }
        //}
    }
}