轮胎外观检测添加思谋语义分割模型检测工具
C3204
7 小时以前 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
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
using LB_SmartVision.Forms.Pages.LEDLightSourceControlPage;
using LB_SmartVision.Forms.Pages.MotionControlPage;
using LB_SmartVision.Forms.Pages.SettingPage;
using LB_SmartVision.ProcessRun;
using LB_SmartVision.Tool;
using LB_SmartVisionCameraDevice.PHM6000;
using LB_VisionProcesses.BarcodeReaders;
using LB_VisionProcesses.Cameras;
using LB_VisionProcesses.Communicators;
using System.Collections.Concurrent;
 
namespace LB_SmartVision
{
    public enum LogInfoType { INFO, WARN, PASS, ERROR, NOSHOW }
 
    public enum ProtocolType { Error, Normal, ProductChange, GetVersion, NpointCaltab, CenterCaltab }
 
    public class GlobalVar
    {
        static GlobalVar()
        {
            strApplicationPath = Application.StartupPath;
 
            strPathLog = Application.StartupPath + "生产日志\\" + DateTime.Now.ToString("yyyyMMdd");
 
            strPathCsv = Application.StartupPath + "生产数据\\" + DateTime.Now.ToString("yyyyMMdd");
 
            strStartTime = DateTime.Now.ToString("yyyyMMdd_HHmm");
        }
 
        /// <summary>
        /// 读码器集合(Key:设备SN,Value:读码器句柄)
        /// </summary>
        public static ObservableConcurrentDictionary<string, BarcodeReaderBase> dicBarcodeReaders { get; set; } = new ObservableConcurrentDictionary<string, BarcodeReaderBase>();
 
 
        /// <summary>
        /// 光源控制配置
        /// </summary>
        public static Dictionary<string, LEDControlParams> dicSerialPort { get; set; } = new Dictionary<string, LEDControlParams>();
 
        #region 读码器
        public static ConcurrentDictionary<string, string> allBarcodeReadersConnectionString = new ConcurrentDictionary<string, string>();
        public static string allBarcodeReadersConnectionStringPath
            => GlobalVar.strApplicationPath + "所有产品\\" + GlobalVar.strProductName + "\\A_BarcodeReaderConnections.json";
 
        #endregion
 
        public static string AllSerialPortPath
        => GlobalVar.strApplicationPath + "所有产品\\" + GlobalVar.strProductName + "\\A_SerialPort.json";
 
 
        /// <summary>
        /// 流程集合(Key:流程名,Value:运行步骤集合)
        /// </summary>
        public static ObservableConcurrentDictionary<string, ProcessRunBll> dicProcesses { get; set; } = new ObservableConcurrentDictionary<string, ProcessRunBll>();
 
        /// <summary>
        /// 相机集合(Key:相机SN,Value:相机句柄)
        /// </summary>
        public static ObservableConcurrentDictionary<string, BaseCamera> dicCameras { get; set; } = new ObservableConcurrentDictionary<string, BaseCamera>();
 
        /// <summary>
        /// 通讯集合(Key:通讯名,Value:通讯句柄)
        /// </summary>
        public static ObservableConcurrentDictionary<string, BaseCommunicator> dicCommunicators { get; set; } = new ObservableConcurrentDictionary<string, BaseCommunicator>();
 
        /// <summary>
        /// 触发流程设置集合
        /// </summary>
        public static ConcurrentDictionary<int, ConcurrentDictionary<string, string>> dicProcessSetting { get; set; } = new ConcurrentDictionary<int, ConcurrentDictionary<string, string>>();
 
 
        /// <summary>
        /// 运动控数据制集合 Key:产品名称,Value: SN,RecordMotionControlData
        /// </summary>
        public static Dictionary<string, Dictionary<string, PlcDataItem>> dicMPlcData { get; set; } = new Dictionary<string, Dictionary<string, PlcDataItem>>();
 
        public static string allMPlcDataPath
            => GlobalVar.strApplicationPath + "所有产品\\" + GlobalVar.strProductName + "\\A_MPlcDatas.json";
 
 
        /// <summary>
        /// 运动控数据制集合 Key:产品名称,Value: SN,RecordMotionControlData
        /// </summary>
        public static Dictionary<string, Dictionary<string, RecordMotionControlData>> dicMotionControlData { get; set; } = new Dictionary<string, Dictionary<string, RecordMotionControlData>>();
 
        public static string allMotionControlDataPath
            => GlobalVar.strApplicationPath + "所有产品\\" + GlobalVar.strProductName + "\\A_MotionControlDatas.json";
 
 
        /// <summary>
        /// 布局集合
        /// </summary>
        public static ConcurrentDictionary<int, Layout> dicLayout { get; set; } = new ConcurrentDictionary<int, Layout>();
 
        /// <summary>
        /// 表格集合
        /// </summary>
        public static ConcurrentDictionary<string, CsvSetting> dicCsvSetting { get; set; } = new ConcurrentDictionary<string, CsvSetting>();
 
        public static string allProcessConnectionStringPath
            => GlobalVar.strApplicationPath + "所有产品\\" + GlobalVar.strProductName + "\\A_ProcessConnections.json";
 
        #region 相机
        public static ConcurrentDictionary<string, string> allCamerasConnectionString = new ConcurrentDictionary<string, string>();
        public static string allCamerasConnectionStringPath
            => GlobalVar.strApplicationPath + "所有产品\\" + GlobalVar.strProductName + "\\A_CameraConnections.json";
        #endregion
 
        #region 通讯口
        public static ConcurrentDictionary<string, string> allCommunicatorsConnectionString = new ConcurrentDictionary<string, string>();
        public static string allCommunicatorsConnectionStringPath
            => GlobalVar.strApplicationPath + "所有产品\\" + GlobalVar.strProductName + "\\A_CommunicatorConnections.json";
 
        #endregion
 
        #region 流程
        public static Dictionary<string, object> ControlStates { get; set; } = new Dictionary<string, object>();
 
        public static string allProcessPath
            => GlobalVar.strApplicationPath + "所有产品\\" + GlobalVar.strProductName + "\\";
 
        public static string allProcessSettingStringPath
            => GlobalVar.strApplicationPath + "所有产品\\" + GlobalVar.strProductName + "\\A_ProcessSettings.json";
 
        public static string allRunSettingStringPath
            => GlobalVar.strApplicationPath + "所有产品\\" + GlobalVar.strProductName + "\\A_RunSettings.json";
 
        public static string allProcessVarsPath
            => GlobalVar.strApplicationPath + "所有产品\\" + GlobalVar.strProductName + "\\A_ProcessVars.json";
 
        public static string allLayoutPath
             => GlobalVar.strApplicationPath + "所有产品\\" + GlobalVar.strProductName + "\\A_AllLayout.json";
 
        public static string allCsvPath
            => GlobalVar.strApplicationPath + "所有产品\\" + GlobalVar.strProductName + "\\A_AllCsv.json";
        #endregion
 
        public static ConcurrentDictionary<string, PHM6000SensorConfig> allLBCameras = new ConcurrentDictionary<string, PHM6000SensorConfig>();
 
        public static string allCamerasLBPath
            => GlobalVar.strApplicationPath + "所有产品\\" + GlobalVar.strProductName + "\\LBCameraSetttings.json";
 
 
 
        /// <summary>
        /// 软件路径
        /// </summary>
        public static string strApplicationPath = Application.StartupPath;
 
        /// <summary>
        /// 产品名称
        /// </summary>
        public static string strProductName = "产品0";
 
        /// <summary>
        /// 存储日志路径
        /// </summary>
        public static string strPathLog = Application.StartupPath + "生产日志\\" + DateTime.Now.ToString("yyyyMMdd");
 
        /// <summary>
        /// 存储日志路径
        /// </summary>
        public static string strPathCsv = Application.StartupPath + "生产数据\\" + DateTime.Now.ToString("yyyyMMdd");
 
        /// <summary>
        /// 软件开启日期
        /// </summary>
        public static string strStartTime = string.Empty;
 
        public static string strUserName = "未登录";
    }
}