轮胎外观检测添加思谋语义分割模型检测工具
C3204
7 天以前 8826196fc78ceb9c327d3abf7f2f2cf06dabb5df
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
using LB_VisionProcesses;
using OpenVinoSharp;
using System;
using System.Collections.Concurrent;
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;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
 
namespace LB_SmartVision.Forms.Pages.ProcessPage
{
    public partial class ProcessOutputsSelectForm : Form
    {
        public string SelectedOutput = string.Empty;
 
        public ProcessOutputsSelectForm()
        {
            InitializeComponent();
        }
 
 
        public ProcessOutputsSelectForm(ConcurrentDictionary<string, List<Tuple<string, string>>> dicInputsMapping, ConcurrentDictionary<string, List<string>> dicOutputsMapping, string ProcessName = "")
        {
            InitializeComponent();
            treeViewOutputs.Nodes.Clear();
            // 创建父节点
            TreeNode nullNode = new TreeNode("无");
            treeViewOutputs.Nodes.Add(nullNode);
 
            // 创建父节点
            TreeNode globalNode = new TreeNode("全局变量");
            foreach (var name in IProcess.dicGlobalVars.Keys)
            {
                // 创建子节点
                TreeNode childNode1 = new TreeNode(name);
                globalNode.Nodes.Add(childNode1);
            }
            treeViewOutputs.Nodes.Add(globalNode);
 
            foreach (var item in dicOutputsMapping)
            {
                if (ProcessName != item.Key)
                {
                    // 创建父节点
                    TreeNode parentNode = new TreeNode(item.Key);
 
                    // 添加输入节点
                    TreeNode InputsNode = new TreeNode("Inputs");
                    List<Tuple<string, string>> listInputs = dicInputsMapping[item.Key];
                    foreach (var inputs in listInputs)
                    {
                        // 创建子节点
                        TreeNode childNode1 = new TreeNode(inputs.Item1);
                        InputsNode.Nodes.Add(childNode1);
                    }
 
                    // 添加输出节点
                    TreeNode OutputsNode = new TreeNode("Outputs");
                    List<string> listOutputs = item.Value;
                    foreach (var output in listOutputs)
                    {
                        // 创建子节点
                        TreeNode childNode1 = new TreeNode(output);
                        OutputsNode.Nodes.Add(childNode1);
                    }
 
                    // 将父节点添加到 TreeView
                    parentNode.Nodes.Add(InputsNode);
                    parentNode.Nodes.Add(OutputsNode);
                    treeViewOutputs.Nodes.Add(parentNode);
                }
            }
        }
 
        private void uiButtonOK_Click(object sender, EventArgs e)
        {
            if (this.treeViewOutputs.SelectedNode == null)
                return;
            if (this.treeViewOutputs.SelectedNode.Text == "无")
            {
                SelectedOutput = string.Empty;
                this.Close();
            }
 
            if (this.treeViewOutputs.SelectedNode.Parent != null)
            {
                SelectedOutput = this.treeViewOutputs.SelectedNode.Text;
                this.Close();
            }
        }
 
        private void uiButtonCancel_Click(object sender, EventArgs e)
        {
            SelectedOutput = string.Empty;
            this.Close();
        }
    }
}