轮胎外观检测添加思谋语义分割模型检测工具
C3204
10 小时以前 98c0775fe3b61a37d90dd5756287f385a311adf0
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
using LB_VisionProcesses.Communicators;
using System.Collections;
using System.Collections.Concurrent;
using System.Diagnostics;
 
namespace LB_VisionProcesses.Processes
{
    class CheckCraftTool : BaseProcess
    {
        public CheckCraftTool()
        {
            strProcessName = "工序检查工具";
            strProcessClass = "LB_VisionProcesses.Processes.CheckCraftTool";
 
            Params.Inputs.Add("产品SN", "");
            Params.Inputs.Add("工序码", "36");
        }
 
        string SN = string.Empty;
 
        public override bool Run()
        {
            try
            {
                InitRunParams();
 
                SN = Params.Inputs["产品SN"]?.ToString();
                string CraftCode = Params.Inputs["工序码"].ToString();
 
                if (string.IsNullOrEmpty(SN))
                {
                    Msg = $"产品SN为空";
                    Result = false;
                    return false;
                }
                else
                    this.SN = SN;
 
                if ("Erro" == GetWebServer.GetTVInfo("http://10.222.16.22:9006/api/PE", "GetTVInfo", SN))
                {
                    Msg = $"{SN}的GetTVInfo结果为Erro";
                    Result = false;
                    return false;
                }
 
                string nowCraftCode = GetWebServer.GetNextProcessCode("http://10.222.16.22:9006/api/PE", "GetNextProcessCode", SN);
                if (CraftCode != nowCraftCode)
                {
                    Msg = $"{SN}工序码为{nowCraftCode},不为设置的{CraftCode}";
                    Result = false;
                    return false;
                }
            }
            catch (Exception ex)
            {
                Msg = $"运行出现异常,原因是:{ex.Message}【{ex.StackTrace}】";
                Result = false;
            }
            return Result;
        }
 
        public override bool Load(string fullPath = null)
        {
            bool res = base.Load(fullPath);
            if (res)
                this.SN = Params.Inputs["SN"]?.ToString();
 
            return res;
        }
    }
}