| LB_SmartVision/Forms/Pages/ProcessPage/ProcessControl.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| LB_SmartVision/LB_SmartVision.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| LB_SmartVision/ProcessRun/ProcessRunBll.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| LB_SmartVision/VisionForm.Designer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| LB_SmartVision/VisionForm.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| LB_SmartVision/log4net.config | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| LB_SmartVisionCommon/UserData.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| LB_VisionProcesses/Cameras/2DCameraForm.Designer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| LB_VisionProcesses/Cameras/2DCameraForm.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
| LB_VisionProcesses/Forms/GlobalVarForm.Designer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
LB_SmartVision/Forms/Pages/ProcessPage/ProcessControl.cs
@@ -101,7 +101,7 @@ return false; } if (isCircleRuning || ProcessRunBll.bPruning) if (isCircleRuning || ProcessRunBll.bRuning) ProcessRunBll.LogInfo($"{ProcessRunBll.Name}æ£å¨è¿è¡", LogInfoType.ERROR); ProcessRunBll.Run(); LB_SmartVision/LB_SmartVision.csproj
@@ -14,6 +14,7 @@ </ItemGroup> <ItemGroup> <ProjectReference Include="..\LB_SmartVisionLoginUI\LB_SmartVisionLoginUI.csproj" /> <ProjectReference Include="..\LB_VisionControl\LB_VisionControl.csproj" /> <ProjectReference Include="..\LB_VisionFlowNode\LB_VisionFlowNode.csproj" /> <ProjectReference Include="..\LB_VisionProcesses\LB_VisionProcesses.csproj" /> LB_SmartVision/ProcessRun/ProcessRunBll.cs
@@ -27,7 +27,9 @@ foreach (var item in IProcess.dicProcesses) { if (NodeName.StartsWith(item.Key)) { return item.Value.ToString(); } } return string.Empty; @@ -41,7 +43,7 @@ /// <summary> /// è¿è¡æ è®° /// </summary> public bool bPruning public bool bRuning { set { @@ -903,9 +905,8 @@ /// <returns></returns> public bool Run() { bPruning = true; bRuning = true; bCompleted = false; DateTime StartTime = DateTime.Now; try { @@ -921,30 +922,34 @@ Result = false; Msg = string.Format("è¿è¡åéäºæå¤{0}", ex.Message.Trim()); } RunTime = (DateTime.Now - StartTime).TotalMilliseconds; bPruning = false; bRuning = false; bCompleted = true; if (Result) { total_OK++; Msg = "è¿è¡æå"; } else { total_NG++; } if (IProcess.dicGlobalVars.ContainsKey($"{Name}.Result")) { IProcess.dicGlobalVars[$"{Name}.Result"] = Result; } else { IProcess.dicGlobalVars.TryAdd($"{Name}.Result", Result); } if (IProcess.dicGlobalVars.ContainsKey($"{Name}.Msg")) { IProcess.dicGlobalVars[$"{Name}.Msg"] = Msg; } else { IProcess.dicGlobalVars.TryAdd($"{Name}.Msg", Msg); } // æå¨è§¦ååå¾åæ¶ GC.Collect(); return Result; LB_SmartVision/VisionForm.Designer.cs
@@ -189,6 +189,7 @@ btn_Login.TabIndex = 3; btn_Login.Text = "ç¨æ·ç»å½"; btn_Login.TextAlignment = StringAlignment.Center; btn_Login.Click += btn_Login_Click; // // btn_GlobalVar // @@ -209,6 +210,7 @@ btn_GlobalVar.TabIndex = 4; btn_GlobalVar.Text = "å ¨å±åé"; btn_GlobalVar.TextAlignment = StringAlignment.Center; btn_GlobalVar.Click += btn_GlobalVar_Click; // // com_ProductName // @@ -222,6 +224,7 @@ com_ProductName.Name = "com_ProductName"; com_ProductName.Size = new Size(152, 26); com_ProductName.TabIndex = 5; com_ProductName.SelectedValueChanged += com_ProductName_SelectedValueChanged; // // materialTabSelector // LB_SmartVision/VisionForm.cs
@@ -1,4 +1,5 @@ using HalconDotNet; using LB_SmartVision.Forms; using LB_SmartVision.Forms.Pages; using LB_SmartVision.Forms.Pages.CameraPage; using LB_SmartVision.Forms.Pages.CommunicatorPage; @@ -9,10 +10,15 @@ using LB_SmartVision.Forms.Pages.UserManagementPage; using LB_SmartVision.ProcessRun; using LB_SmartVision.Tool; using LB_SmartVisionCommon; using LB_SmartVisionLoginUI; using LB_VisionProcesses; using LB_VisionProcesses.Cameras; using LB_VisionProcesses.Cameras.HRCameras; using LB_VisionProcesses.Communicators; using LB_VisionProcesses.Communicators.TCom; using LB_VisionProcesses.Forms; using log4net.Config; using Newtonsoft.Json; using Newtonsoft.Json.Serialization; using Sunny.UI; @@ -229,9 +235,78 @@ } private void LogInfo(string arg1, LogInfoType type) private void LogInfo(string strLog, LogInfoType infoType) { if (string.IsNullOrEmpty(strLog)) { return; } string strInfo = DateTime.Now.ToString("[yyyy:MM:HH:mm:ss:fff] "); strInfo += strLog; if (infoType != LogInfoType.NOSHOW) { // 妿å½å䏿¯ UI 线ç¨ï¼åéè¿ Invoke å°æä½è°åº¦å° UI çº¿ç¨ if (this.rich_Info.InvokeRequired) { this.rich_Info.BeginInvoke(new Action<string>((msg) => { if (this.rich_Info.Lines.Length > 1000) { this.rich_Info.Clear(); } switch (infoType) { case LogInfoType.INFO: this.rich_Info.SelectionColor = Color.Wheat; break; case LogInfoType.WARN: this.rich_Info.SelectionColor = Color.LightGoldenrodYellow; break; case LogInfoType.PASS: this.rich_Info.SelectionColor = Color.Green; break; case LogInfoType.ERROR: this.rich_Info.SelectionColor = Color.Red; break; } // æ´æ° UI æ§ä»¶ï¼æ¯å¦æ¾ç¤ºæ¥æ¶å°çæ¶æ¯ this.rich_Info.AppendText(strInfo); this.rich_Info.AppendText("\r\n"); this.rich_Info.SelectionStart = this.rich_Info.Text.Length; this.rich_Info.ScrollToCaret(); }), strInfo); } else { if (this.rich_Info.Lines.Length > 1000) this.rich_Info.Clear(); // 妿已ç»å¨ UI 线ç¨ä¸ï¼ç´æ¥æ´æ° UI switch (infoType) { case LogInfoType.INFO: this.rich_Info.SelectionColor = Color.Wheat; break; case LogInfoType.WARN: this.rich_Info.SelectionColor = Color.Yellow; break; case LogInfoType.PASS: this.rich_Info.SelectionColor = Color.Green; break; case LogInfoType.ERROR: this.rich_Info.SelectionColor = Color.Red; break; } this.rich_Info.AppendText(strInfo); this.rich_Info.AppendText("\r\n"); this.rich_Info.SelectionStart = this.rich_Info.Text.Length; this.rich_Info.ScrollToCaret(); } } AsyncLogHelper.Info(strLog); } public static bool SaveAllLayout() @@ -406,9 +481,36 @@ } catch { return false; } } private void EnsureDirectory(string path) { // 妿æ¯ç¸å¯¹è·¯å¾ï¼è½¬æ¢ä¸ºç»å¯¹è·¯å¾ string fullPath = Path.IsPathRooted(path) ? path : Path.GetFullPath(path); if (!Directory.Exists(fullPath)) { Directory.CreateDirectory(fullPath); LogInfo($"â ç®å½å建: {fullPath}", LogInfoType.INFO); } else { LogInfo($"â¹ï¸ ç®å½å·²åå¨: {fullPath}", LogInfoType.INFO); } } private void VisionForm_Load(object sender, EventArgs e) { XmlConfigurator.Configure(new System.IO.FileInfo("log4net.config")); string[] paths = { @"ç产æ¥å¿\Run_Log", @"ç产æ¥å¿\Debug_Log", @"ç产æ¥å¿\Error_Log", @"ç产æ¥å¿\Fatal", @"ç产æ¥å¿\Warn", }; foreach (string path in paths) { EnsureDirectory(path); } if (!LB_SmartVision.Tool.Tool.ReadStringConfig("æ°æ®åºåç§°", out string DateBaseName)) { DateBaseName = "产å0"; @@ -526,7 +628,7 @@ switch (brand) { case CameraBrand.HRCamera: //camera = new HRCamera(); camera = new HRCamera(); break; case CameraBrand.LBCamera: //camera = new LBCamera(); @@ -957,7 +1059,6 @@ File.WriteAllText(GlobalVar.allLayoutPath, strJson, Encoding.UTF8); LogInfo($"å ¨å±å¸å±ä¿åæå", LogInfoType.INFO); return true; } catch { return false; } @@ -970,6 +1071,7 @@ if (!File.Exists(allLayoutPath)) { Debug.WriteLine("æä»¶ä¸åå¨å建空æä»¶"); AsyncLogHelper.Info("æä»¶ä¸åå¨å建空æä»¶"); // è·åä¸å¸¦æä»¶åçç®å½è·¯å¾ string directoryPath = Path.GetDirectoryName(allLayoutPath); SaveAllLayout(); @@ -993,5 +1095,351 @@ } catch { return false; } } private void btn_GlobalVar_Click(object sender, EventArgs e) { GlobalVarForm globalVarForm = new GlobalVarForm(GlobalVar.allProcessVarsPath); globalVarForm.ShowDialog(); } private void btn_Login_Click(object sender, EventArgs e) { //this.Hide(); //MainWindow.InstanceLoginandConfirmation().ShowDialog(); //if (!MainWindow.InstanceLoginandConfirmation().isQuit && MainWindow.InstanceLoginandConfirmation().correctUser) //{ // MainWindow.InstanceLoginandConfirmation().closeLoginFrm(); // if (UserManager.Instance.CurrentUser.EmployeePermission == UserPermission.Operator) // { // //æä½åæéçé¢ // } // else if (UserManager.Instance.CurrentUser.EmployeePermission == UserPermission.Engineer) // { // //ææ¯åæéçé¢ // } // else if (UserManager.Instance.CurrentUser.EmployeePermission == UserPermission.Administrator) // { // //管çåæéçé¢ // } // this.Show(); //} } private void com_ProductName_SelectedValueChanged(object sender, EventArgs e) { if (com_ProductName.SelectedItem == null || com_ProductName.SelectedItem?.ToString() == GlobalVar.strProductName) { return; } if (com_ProductName.SelectedItem?.ToString() == "æ°å¢") { using (CreateProductForm createDatabaseForm = new CreateProductForm()) { createDatabaseForm.ShowDialog(); } } else { //åæ´åä¿åç°æé ç½® SaveAllSetting(); LogInfo($"产åä»{GlobalVar.strProductName}忢{com_ProductName.SelectedItem?.ToString()}", LogInfoType.WARN); //Tool.WriteConfig("æ°æ®åºåç§°", com_ProductName.SelectedItem?.ToString()); GlobalVar.strProductName = com_ProductName.SelectedItem?.ToString(); foreach (BaseCamera camera in GlobalVar.dicCameras.Values) { camera.Dispose(); } GlobalVar.dicCameras.Clear(); foreach (BaseCommunicator communicator in GlobalVar.dicCommunicators.Values) { communicator.TriggerRunMessageReceived -= TriggerRunMessageReceived; communicator.Disconnect(); } GlobalVar.dicCommunicators.Clear(); //ä¿åå®ç°æé ç½®åæå¼ææäºä»¶ foreach (var Process in GlobalVar.dicProcesses.Values) { Process.LogInfo -= LogInfo; } GlobalVar.dicProcesses.Clear(); //éæ°å è½½é ç½® this.VisionForm_Load(sender, e); } } private void TriggerRunMessageReceived(string name, string msg) { if (msg == null || msg.Trim('\0', '\r', '\n', ' ', '\uFEFF') == "" || string.IsNullOrEmpty(msg)) { return; } LogInfo(string.Format("é讯[{0}]æ¥æ¶å°çæ¶æ¯\"{1}\"", name, msg), LogInfoType.INFO); var matchedItems = GlobalVar.dicProcessSetting .Where(item => { var value = item.Value; var triggerComm = value["触åé讯"]; var triggerChar = value["触åå符"]; return triggerComm != null && triggerComm.Equals(name) && (string.IsNullOrEmpty(triggerChar?.ToString()) || msg.StartsWith(triggerChar.ToString())); }) .ToList(); // é¿å éå¤åå ¸è®¿é®åè£ ç®±æä½ if (matchedItems.Count <= 0) { return; } if (!ckb_AllowRun.Checked) { LogInfo(string.Format($"æ£æ¥å°å¯è¢«è§¦åçæµç¨,å½åä¸ä¸ºè¿è¡æ¨¡å¼!"), LogInfoType.ERROR); return; } GlobalVar.dicProcesses.Values.AsParallel().ForAll(v => v.bCompleted = false); LogInfo(string.Format($"æ£æ¥å°å¯è¢«è§¦åçæµç¨,æ¸ ç©ºæææµç¨è¿è¡å®ææ è®°ä½!"), LogInfoType.INFO); Parallel.ForEach(matchedItems, item => { string ProcessName = item.Value["æµç¨å"]; LogInfo($"æµç¨[{ProcessName}]å¼å§è¿è¡", LogInfoType.INFO); if (!GlobalVar.dicProcesses.ContainsKey(ProcessName)) { LogInfo(string.Format("æµç¨[{0}]ä¸åå¨,è¯·æ£æ¥æµç¨è®¾ç½®", ProcessName), LogInfoType.ERROR); return; } ProcessRunBll RunBll = GlobalVar.dicProcesses[ProcessName]; if (RunBll == null || RunBll.bRuning) { LogInfo(string.Format("æµç¨[{0}]䏿¬¡æªè¿è¡å®æ,触å失败", ProcessName) , LogInfoType.ERROR); return; } try { bool result = false; string msg = string.Empty; int times = Convert.ToInt32(item.Value["éæµæ¬¡æ°"].ToString()); string ConnecResult = item.Value["å ³èç»æ"]; if (times < 0) { result = GlobalVar.dicProcesses[ProcessName].Run(); msg = GlobalVar.dicProcesses[ProcessName].Msg; if (!(string.IsNullOrEmpty(ConnecResult) || ConnecResult.Trim() == "æªå ³è")) { GlobalVar.dicProcesses[ProcessName].GetBooleanOutput(ConnecResult, out result); GlobalVar.dicProcesses[ProcessName].Result = result; } if (!result) { LogInfo($"æµç¨[{ProcessName}]被强å¶è¿è¡æå", LogInfoType.WARN); GlobalVar.dicProcesses[ProcessName].Result = true; result = true; } } else { while (times >= 0) { result = RunBll.Run(); msg = RunBll.Msg; if (!(string.IsNullOrEmpty(ConnecResult) || ConnecResult.Trim() == "æªå ³è")) { RunBll.GetBooleanOutput(ConnecResult, out result); RunBll.Result = result; } if (result) { break; } else if (!result && times > 0) { LogInfo(string.Format("æµç¨[{0}]è¿è¡å¤±è´¥éæ°æµè¯,å©ä½æ¬¡æ°[{1}]", ProcessName, times), LogInfoType.WARN); } times--; } } string ConnectProcess = item.Value["å ³èæµç¨"]; if (!(ConnectProcess == null || string.IsNullOrEmpty(ConnectProcess) || ConnectProcess.Trim() == "")) { //ç¨éå·æè åå·å»é´éå ³èæµç¨ string[] arrConnectProcess; if (ConnectProcess.Split(';').Length >= ConnectProcess.Split(',').Length) { arrConnectProcess = ConnectProcess.Split(';'); } else { arrConnectProcess = ConnectProcess.Split(','); } foreach (string strConnectProcess in arrConnectProcess) { if (GlobalVar.dicProcesses.ContainsKey(strConnectProcess)) { ProcessRunBll ConnectRunBll = GlobalVar.dicProcesses[strConnectProcess]; int waitTime = 10; DateTime startTime = DateTime.Now; while ((DateTime.Now - startTime).TotalSeconds < waitTime && (ConnectRunBll.bRuning || !ConnectRunBll.bCompleted)) { LogInfo(string.Format("å ³èæµç¨[{0}]æªè¿è¡å®æ,å©ä½çå¾ [{1}]s", strConnectProcess, (waitTime - ((DateTime.Now - startTime).TotalSeconds))) , LogInfoType.NOSHOW); Thread.Sleep(1000); continue; } if (ConnectRunBll.bRuning || !ConnectRunBll.bCompleted) { GlobalVar.dicProcesses[ProcessName].Msg = string.Format("æµç¨[{0}]æªè¿è¡å®æ", ProcessName); LogInfo(string.Format("å ³èæµç¨[{0}]æªè¿è¡å®æ", strConnectProcess), LogInfoType.ERROR); result = false; break; } else if (!ConnectRunBll.bRuning && ConnectRunBll.bCompleted) { LogInfo(string.Format("å ³èæµç¨[{0}]è¿è¡å®æ", strConnectProcess), LogInfoType.INFO); } result &= ConnectRunBll.Result; if (!ConnectRunBll.Result) { LogInfo($"æµç¨[{ProcessName}]çå ³èæµç¨[{strConnectProcess}]è¿è¡å¤±è´¥", LogInfoType.ERROR); msg = $"å ³èæµç¨[{strConnectProcess}]è¿è¡å¤±è´¥"; } } } } LogInfo(result ? $"æµç¨[{ProcessName}]è¿è¡æå" : $"æµç¨[{ProcessName}]è¿è¡å¤±è´¥,åå æ¯{msg}", result ? LogInfoType.PASS : LogInfoType.ERROR); string SendComName = result ? item.Value["æåé讯"] : item.Value["失败é讯"]; string SendMsg = result ? item.Value["æåå符"] : item.Value["失败å符"]; if (GlobalVar.dicCommunicators.ContainsKey(SendComName) && (!string.IsNullOrEmpty(SendMsg) || SendMsg.Trim() != "")) { GlobalVar.dicCommunicators[SendComName].SendMessage(SendMsg); LogInfo(string.Format("åéç»[{0}]äºæ¶æ¯\"{1}\"", SendComName, SendMsg), LogInfoType.INFO); } } catch (Exception ex) { LogInfo(string.Format("æµç¨[{0}]è¿è¡åçäºæå¤,åå æ¯:{1}", ProcessName, ex.Message + $"ã{ex.StackTrace}ã"), LogInfoType.ERROR); RunBll.Result = false; RunBll.Msg = $"[æå¤]{ex.Message}"; } finally { #region ä»RunSettingPageåLayoutä¸è·åæ¯å¦ä¿åå¾ç string strImageType = "jpeg"; bool bSaveRunImage = false; bool bSaveResultImage = false; long lImageQuality = 100L; //ckbSaveRunImage if (GlobalVar.ControlStates.TryGetValue("ckbSaveRunImage_CheckBox", out object oSaveRunImage)) { if (oSaveRunImage != null && oSaveRunImage is bool) { bSaveRunImage = (bool)oSaveRunImage; } } //ckbSaveResultImage if (GlobalVar.ControlStates.TryGetValue("ckbSaveResultImage_CheckBox", out object oSaveResultImage)) { if (oSaveResultImage != null && oSaveResultImage is bool) { bSaveResultImage = (bool)oSaveResultImage; } } //txtImageQuality if (GlobalVar.ControlStates.TryGetValue("txtImageQuality_TextBox", out object oImageQuality)) { if (oImageQuality != null && oImageQuality is string) { lImageQuality = Convert.ToInt64((string)oImageQuality); } } //cmbImageType if (GlobalVar.ControlStates.TryGetValue("cmbImageType_ComboBox", out object oImageType)) { try { // å¨æè§£æComboBoxæ°æ® var json = JsonConvert.SerializeObject(oImageType); var comboData = JsonConvert.DeserializeAnonymousType(json, new { Items = new List<object>(), SelectedIndex = 0 }); if (comboData != null && comboData.Items.Count > 0) { strImageType = comboData.Items[comboData.SelectedIndex].ToString(); } } catch { } } // çæå¾çå¹¶æ¾ç¤ºå°æ§ä»¶ä¸ HObject InputImage = null; HObject RecordImage = null; foreach (var layout in GlobalVar.dicLayout.Values .Where(layout => layout.ProcessName == ProcessName) .ToList()) { string title = layout.Title; string strImagePath = layout.SaveImageDir; if (!AllProcessesPage.dicProcessControls.ContainsKey(title)) { continue; } RunBll.GetImage(layout, out InputImage, out RecordImage); AllProcessesPage.dicProcessControls[title].ShowHoImage(RecordImage); if (!string.IsNullOrEmpty(layout.SaveImageDir)) { string fileNameHead = layout.SaveImageHead; string result = Regex.Replace(fileNameHead, @"\{[^}]+\}", match => { // å»é¤{}åªä¿çæ¬å·å çå 容 string content = match.Value; content = content.Trim('{', '}'); // å»é¤é¦å°¾ç{} RunBll.GetStringOutput(content, out string str); return str; }); string fileName = $"{result}-[{DateTime.Now.ToString("HH.mm.ss.ffff")}]"; // ä½¿ç¨æ£åè¡¨è¾¾å¼æ¿æ¢ææéæ³å符 string invalidChars = Regex.Escape(new string(Path.GetInvalidFileNameChars())); string pattern = $"[{invalidChars}]"; fileName = Regex.Replace(fileName, pattern, "-"); strImagePath = Regex.Replace(strImagePath, @"\{[^}]+\}", match => { // å»é¤{}åªä¿çæ¬å·å çå 容 string content = match.Value; content = content.Trim('{', '}'); // å»é¤é¦å°¾ç{} RunBll.GetStringOutput(content, out string str); return str; }); if (bSaveRunImage) { // æåä¸çº§ç®å½å¿ é¡»ä¸ºå¹´ææ¥,伿 ¹æ®æ¶é´æ¥å 餿§å¾ç string directoryPath = Path.Combine(strImagePath, $"{ProcessName}\\åå¾\\{RunBll.Result}\\{DateTime.Now.ToString("yyyyMMdd")}\\"); LB_SmartVision.Tool.Tool.AddRealImage(InputImage, directoryPath, fileName, strImageType, lImageQuality); } if (bSaveResultImage) { // æåä¸çº§ç®å½å¿ é¡»ä¸ºå¹´ææ¥,伿 ¹æ®æ¶é´æ¥å 餿§å¾ç string directoryPath = Path.Combine(strImagePath, $"{ProcessName}\\æªå¾\\{RunBll.Result}\\{DateTime.Now.ToString("yyyyMMdd")}\\"); LB_SmartVision.Tool.Tool.AddRealImage(RecordImage, directoryPath, fileName, "jpg", 50L); } } } foreach (var csv in GlobalVar.dicCsvSetting.Values .Where(csv => csv.ProcessName == ProcessName) .ToList()) { if (RunBll.GetCsv(csv , out List<string> DataTitle, out Dictionary<string, object> ResultData)) { string filePath = Path.Combine(GlobalVar.strPathCsv, $"{ProcessName}.csv"); LB_SmartVision.Tool.Tool.SaveData(filePath, DataTitle, ResultData); } } #endregion } }); } } } LB_SmartVision/log4net.config
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,107 @@ <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /> </configSections> <log4net> <root> <level value="ALL"/> <!-- æ·»å ææappenderå¼ç¨ --> <appender-ref ref="DebugLogger" /> <appender-ref ref="InfoLogger" /> <appender-ref ref="WarnLogger" /> <appender-ref ref="ErrorLogger" /> <appender-ref ref="FatalLogger" /> </root> <appender name="DebugLogger" type="log4net.Appender.RollingFileAppender"> <file value="ç产æ¥å¿\Debug_Log\"/> <appendToFile value="true" /> <lockingModel type="log4net.Appender.FileAppender+MinimalLock" /> <Encoding value="UTF-8" /> <maxSizeRollBackups value="-1"/> <StaticLogFileName value="false"/> <rollingStyle value="Date" /> <param name="datePattern" value="yyyy-MM/yyyy-MM-dd.'log'" /> <createDirs value="true" /> <filter type="log4net.Filter.LevelRangeFilter"> <levelMin value="DEBUG" /> <levelMax value="DEBUG" /> </filter> <layout type="log4net.Layout.PatternLayout"> <param name="ConversionPattern" value="%date [%thread] %-5level %logger - %message%newline" /> </layout> </appender> <appender name="InfoLogger" type="log4net.Appender.RollingFileAppender"> <file value="ç产æ¥å¿\Run_Log\"/> <appendToFile value="true" /> <lockingModel type="log4net.Appender.FileAppender+MinimalLock" /> <Encoding value="UTF-8" /> <maxSizeRollBackups value="-1"/> <StaticLogFileName value="false"/> <rollingStyle value="Date" /> <param name="datePattern" value="yyyy-MM/yyyy-MM-dd.'log'" /> <createDirs value="true" /> <filter type="log4net.Filter.LevelRangeFilter"> <levelMin value="INFO" /> <levelMax value="INFO" /> </filter> <layout type="log4net.Layout.PatternLayout"> <param name="ConversionPattern" value="%date [%thread] %-5level %logger - %message%newline" /> </layout> </appender> <appender name="WarnLogger" type="log4net.Appender.RollingFileAppender"> <file value="ç产æ¥å¿\Warn\"/> <appendToFile value="true" /> <lockingModel type="log4net.Appender.FileAppender+MinimalLock" /> <Encoding value="UTF-8" /> <maxSizeRollBackups value="10"/> <StaticLogFileName value="false"/> <rollingStyle value="Date" /> <param name="datePattern" value="yyyy-MM/yyyy-MM-dd.'log'" /> <createDirs value="true" /> <filter type="log4net.Filter.LevelRangeFilter"> <levelMin value="WARN" /> <levelMax value="WARN" /> </filter> <layout type="log4net.Layout.PatternLayout"> <param name="ConversionPattern" value="%date [%thread] %-5level %logger - %message%newline" /> </layout> </appender> <appender name="ErrorLogger" type="log4net.Appender.RollingFileAppender"> <file value="ç产æ¥å¿\Error_Log\"/> <appendToFile value="true" /> <lockingModel type="log4net.Appender.FileAppender+MinimalLock" /> <Encoding value="UTF-8" /> <maxSizeRollBackups value="-1"/> <StaticLogFileName value="false"/> <rollingStyle value="Date" /> <param name="datePattern" value="yyyy-MM/yyyy-MM-dd.'log'" /> <createDirs value="true" /> <filter type="log4net.Filter.LevelRangeFilter"> <levelMin value="ERROR" /> <levelMax value="ERROR" /> </filter> <layout type="log4net.Layout.PatternLayout"> <param name="ConversionPattern" value="%date [%thread] %-5level %logger - %message%newline" /> </layout> </appender> <appender name="FatalLogger" type="log4net.Appender.RollingFileAppender"> <file value="ç产æ¥å¿\Fatal\"/> <appendToFile value="true" /> <lockingModel type="log4net.Appender.FileAppender+MinimalLock" /> <Encoding value="UTF-8" /> <maxSizeRollBackups value="-1"/> <StaticLogFileName value="false"/> <rollingStyle value="Date" /> <param name="datePattern" value="yyyy-MM/yyyy-MM-dd.'log'" /> <createDirs value="true" /> <filter type="log4net.Filter.LevelRangeFilter"> <levelMin value="FATAL" /> <levelMax value="FATAL" /> </filter> <layout type="log4net.Layout.PatternLayout"> <param name="ConversionPattern" value="%date [%thread] %-5level %logger - %message%newline" /> </layout> </appender> </log4net> </configuration> LB_SmartVisionCommon/UserData.cs
@@ -74,6 +74,10 @@ /// </summary> Operator, /// <summary> /// UserPermissionï¼Engineer /// </summary> Engineer, /// <summary> /// UserPermissionï¼Administrator /// </summary> Administrator LB_VisionProcesses/Cameras/2DCameraForm.Designer.cs
@@ -29,15 +29,15 @@ private void InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(CameraForm)); cmb_Brand = new ComboBox(); cmb_SN = new ComboBox(); cmbBrand = new ComboBox(); cmbSN = new ComboBox(); label1 = new Label(); label2 = new Label(); btn_StartGrab = new Button(); btn_CloseGrab = new Button(); btn_GrabOnce = new Button(); btn_Open = new Button(); btn_Close = new Button(); btnStartGrab = new Button(); btnCloseGrab = new Button(); btnGrabOnce = new Button(); btnOpen = new Button(); btnClose = new Button(); label5 = new Label(); lblPicCount = new Label(); txtGain = new TextBox(); @@ -54,9 +54,9 @@ tableLayoutPanel3 = new TableLayoutPanel(); tableLayoutPanel4 = new TableLayoutPanel(); tableLayoutPanel5 = new TableLayoutPanel(); btn_Edit = new Button(); btnEdit = new Button(); tableLayoutPanel6 = new TableLayoutPanel(); btn_SaveImage = new Button(); btnSaveImage = new Button(); tableLayoutPanel7 = new TableLayoutPanel(); tableLayoutPanel8 = new TableLayoutPanel(); tableLayoutPanel1 = new TableLayoutPanel(); @@ -70,8 +70,8 @@ cmbImagesPath = new ComboBox(); tableLayoutPanel9 = new TableLayoutPanel(); ckbLocalTest = new CheckBox(); btn_AddImages = new Button(); btn_LocalGrab = new Button(); btnAddImages = new Button(); btnLocalGrab = new Button(); tableLayoutPanel10 = new TableLayoutPanel(); label6 = new Label(); txtTimeout = new TextBox(); @@ -100,25 +100,25 @@ panel_2DCameraForm.SuspendLayout(); SuspendLayout(); // // cmb_Brand // cmbBrand // cmb_Brand.Dock = DockStyle.Fill; cmb_Brand.FormattingEnabled = true; cmb_Brand.Location = new Point(53, 3); cmb_Brand.Name = "cmb_Brand"; cmb_Brand.Size = new Size(297, 25); cmb_Brand.TabIndex = 0; cmbBrand.Dock = DockStyle.Fill; cmbBrand.FormattingEnabled = true; cmbBrand.Location = new Point(53, 3); cmbBrand.Name = "cmbBrand"; cmbBrand.Size = new Size(296, 25); cmbBrand.TabIndex = 0; // // cmb_SN // cmbSN // cmb_SN.Dock = DockStyle.Fill; cmb_SN.FormattingEnabled = true; cmb_SN.Location = new Point(53, 3); cmb_SN.Name = "cmb_SN"; cmb_SN.Size = new Size(297, 25); cmb_SN.TabIndex = 1; cmb_SN.SelectedIndexChanged += cmbSN_SelectedIndexChanged; cmb_SN.MouseDown += cmbSN_MouseDown; cmbSN.Dock = DockStyle.Fill; cmbSN.FormattingEnabled = true; cmbSN.Location = new Point(53, 3); cmbSN.Name = "cmbSN"; cmbSN.Size = new Size(296, 25); cmbSN.TabIndex = 1; cmbSN.SelectedIndexChanged += cmbSN_SelectedIndexChanged; cmbSN.MouseDown += cmbSN_MouseDown; // // label1 // @@ -142,65 +142,65 @@ label2.Text = "SN"; label2.TextAlign = ContentAlignment.MiddleCenter; // // btn_StartGrab // btnStartGrab // btn_StartGrab.Dock = DockStyle.Fill; btn_StartGrab.ForeColor = SystemColors.ControlText; btn_StartGrab.Location = new Point(91, 3); btn_StartGrab.Name = "btn_StartGrab"; btn_StartGrab.Size = new Size(82, 28); btn_StartGrab.TabIndex = 5; btn_StartGrab.Text = "è¿ç»éé"; btn_StartGrab.UseVisualStyleBackColor = true; btn_StartGrab.Click += btn_StartGrab_Click; btnStartGrab.Dock = DockStyle.Fill; btnStartGrab.ForeColor = SystemColors.ControlText; btnStartGrab.Location = new Point(91, 3); btnStartGrab.Name = "btnStartGrab"; btnStartGrab.Size = new Size(82, 28); btnStartGrab.TabIndex = 5; btnStartGrab.Text = "è¿ç»éé"; btnStartGrab.UseVisualStyleBackColor = true; btnStartGrab.Click += btnStartGrab_Click; // // btn_CloseGrab // btnCloseGrab // btn_CloseGrab.Dock = DockStyle.Fill; btn_CloseGrab.ForeColor = SystemColors.Desktop; btn_CloseGrab.Location = new Point(179, 3); btn_CloseGrab.Name = "btn_CloseGrab"; btn_CloseGrab.Size = new Size(82, 28); btn_CloseGrab.TabIndex = 6; btn_CloseGrab.Text = "å ³ééé"; btn_CloseGrab.UseVisualStyleBackColor = true; btn_CloseGrab.Click += btn_CloseGrab_Click; btnCloseGrab.Dock = DockStyle.Fill; btnCloseGrab.ForeColor = SystemColors.Desktop; btnCloseGrab.Location = new Point(179, 3); btnCloseGrab.Name = "btnCloseGrab"; btnCloseGrab.Size = new Size(82, 28); btnCloseGrab.TabIndex = 6; btnCloseGrab.Text = "å ³ééé"; btnCloseGrab.UseVisualStyleBackColor = true; btnCloseGrab.Click += btnCloseGrab_Click; // // btn_GrabOnce // btnGrabOnce // btn_GrabOnce.Dock = DockStyle.Fill; btn_GrabOnce.ForeColor = SystemColors.ControlText; btn_GrabOnce.Location = new Point(3, 3); btn_GrabOnce.Name = "btn_GrabOnce"; btn_GrabOnce.Size = new Size(82, 28); btn_GrabOnce.TabIndex = 7; btn_GrabOnce.Text = "åå¼ éé"; btn_GrabOnce.UseVisualStyleBackColor = true; btn_GrabOnce.Click += btn_GrabOnce_Click; btnGrabOnce.Dock = DockStyle.Fill; btnGrabOnce.ForeColor = SystemColors.ControlText; btnGrabOnce.Location = new Point(3, 3); btnGrabOnce.Name = "btnGrabOnce"; btnGrabOnce.Size = new Size(82, 28); btnGrabOnce.TabIndex = 7; btnGrabOnce.Text = "åå¼ éé"; btnGrabOnce.UseVisualStyleBackColor = true; btnGrabOnce.Click += btnGrabOnce_Click; // // btn_Open // btnOpen // btn_Open.Dock = DockStyle.Fill; btn_Open.ForeColor = SystemColors.ControlText; btn_Open.Location = new Point(3, 3); btn_Open.Name = "btn_Open"; btn_Open.Size = new Size(82, 28); btn_Open.TabIndex = 8; btn_Open.Text = "æå¼"; btn_Open.UseVisualStyleBackColor = true; btn_Open.Click += btn_Open_Click; btnOpen.Dock = DockStyle.Fill; btnOpen.ForeColor = SystemColors.ControlText; btnOpen.Location = new Point(3, 3); btnOpen.Name = "btnOpen"; btnOpen.Size = new Size(82, 28); btnOpen.TabIndex = 8; btnOpen.Text = "æå¼"; btnOpen.UseVisualStyleBackColor = true; btnOpen.Click += btnOpen_Click; // // btn_Close // btnClose // btn_Close.Dock = DockStyle.Fill; btn_Close.ForeColor = SystemColors.ControlText; btn_Close.Location = new Point(91, 3); btn_Close.Name = "btn_Close"; btn_Close.Size = new Size(82, 28); btn_Close.TabIndex = 9; btn_Close.Text = "å ³é"; btn_Close.UseVisualStyleBackColor = true; btn_Close.Click += btn_Close_Click; btnClose.Dock = DockStyle.Fill; btnClose.ForeColor = SystemColors.ControlText; btnClose.Location = new Point(91, 3); btnClose.Name = "btnClose"; btnClose.Size = new Size(82, 28); btnClose.TabIndex = 9; btnClose.Text = "å ³é"; btnClose.UseVisualStyleBackColor = true; btnClose.Click += btnClose_Click; // // label5 // @@ -219,7 +219,7 @@ lblPicCount.Dock = DockStyle.Fill; lblPicCount.Location = new Point(123, 0); lblPicCount.Name = "lblPicCount"; lblPicCount.Size = new Size(227, 34); lblPicCount.Size = new Size(226, 34); lblPicCount.TabIndex = 16; lblPicCount.Text = "0"; lblPicCount.TextAlign = ContentAlignment.MiddleLeft; @@ -229,18 +229,18 @@ txtGain.Dock = DockStyle.Fill; txtGain.Location = new Point(53, 3); txtGain.Name = "txtGain"; txtGain.Size = new Size(297, 23); txtGain.Size = new Size(296, 23); txtGain.TabIndex = 21; txtGain.TextChanged += txt_Gain_TextChanged; txtGain.TextChanged += txtGain_TextChanged; // // txtExp // txtExp.Dock = DockStyle.Fill; txtExp.Location = new Point(53, 3); txtExp.Name = "txtExp"; txtExp.Size = new Size(297, 23); txtExp.Size = new Size(296, 23); txtExp.TabIndex = 20; txtExp.TextChanged += txt_Exp_TextChanged; txtExp.TextChanged += txtExp_TextChanged; // // label4 // @@ -272,7 +272,7 @@ groupBox1.ForeColor = SystemColors.Control; groupBox1.Location = new Point(0, 0); groupBox1.Name = "groupBox1"; groupBox1.Size = new Size(486, 591); groupBox1.Size = new Size(487, 591); groupBox1.TabIndex = 17; groupBox1.TabStop = false; groupBox1.Text = "宿¶éé"; @@ -282,7 +282,7 @@ panel_Picture.Dock = DockStyle.Fill; panel_Picture.Location = new Point(3, 19); panel_Picture.Name = "panel_Picture"; panel_Picture.Size = new Size(480, 569); panel_Picture.Size = new Size(481, 569); panel_Picture.TabIndex = 0; // // radioButtonSoft @@ -291,7 +291,7 @@ radioButtonSoft.Dock = DockStyle.Fill; radioButtonSoft.Location = new Point(3, 123); radioButtonSoft.Name = "radioButtonSoft"; radioButtonSoft.Size = new Size(353, 34); radioButtonSoft.Size = new Size(352, 34); radioButtonSoft.TabIndex = 23; radioButtonSoft.TabStop = true; radioButtonSoft.Text = "软触å"; @@ -304,7 +304,7 @@ radioButtonHard.Dock = DockStyle.Fill; radioButtonHard.Location = new Point(3, 203); radioButtonHard.Name = "radioButtonHard"; radioButtonHard.Size = new Size(353, 34); radioButtonHard.Size = new Size(352, 34); radioButtonHard.TabIndex = 24; radioButtonHard.TabStop = true; radioButtonHard.Text = "硬触å"; @@ -324,7 +324,7 @@ // splitContainer1.Panel2.Controls.Add(groupBox1); splitContainer1.Size = new Size(855, 591); splitContainer1.SplitterDistance = 365; splitContainer1.SplitterDistance = 364; splitContainer1.TabIndex = 19; // // groupBox2 @@ -336,7 +336,7 @@ groupBox2.Location = new Point(0, 0); groupBox2.MinimumSize = new Size(261, 61); groupBox2.Name = "groupBox2"; groupBox2.Size = new Size(365, 591); groupBox2.Size = new Size(364, 591); groupBox2.TabIndex = 0; groupBox2.TabStop = false; groupBox2.Text = "ç¸æºåæ°"; @@ -378,7 +378,7 @@ tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Percent, 7.143011F)); tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Percent, 7.14086771F)); tableLayoutPanel2.RowStyles.Add(new RowStyle(SizeType.Absolute, 20F)); tableLayoutPanel2.Size = new Size(359, 569); tableLayoutPanel2.Size = new Size(358, 569); tableLayoutPanel2.TabIndex = 25; // // tableLayoutPanel3 @@ -387,13 +387,13 @@ tableLayoutPanel3.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 50F)); tableLayoutPanel3.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F)); tableLayoutPanel3.Controls.Add(label1, 0, 0); tableLayoutPanel3.Controls.Add(cmb_Brand, 1, 0); tableLayoutPanel3.Controls.Add(cmbBrand, 1, 0); tableLayoutPanel3.Dock = DockStyle.Fill; tableLayoutPanel3.Location = new Point(3, 3); tableLayoutPanel3.Name = "tableLayoutPanel3"; tableLayoutPanel3.RowCount = 1; tableLayoutPanel3.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); tableLayoutPanel3.Size = new Size(353, 34); tableLayoutPanel3.Size = new Size(352, 34); tableLayoutPanel3.TabIndex = 0; // // tableLayoutPanel4 @@ -402,13 +402,13 @@ tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Absolute, 50F)); tableLayoutPanel4.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F)); tableLayoutPanel4.Controls.Add(label2, 0, 0); tableLayoutPanel4.Controls.Add(cmb_SN, 1, 0); tableLayoutPanel4.Controls.Add(cmbSN, 1, 0); tableLayoutPanel4.Dock = DockStyle.Fill; tableLayoutPanel4.Location = new Point(3, 43); tableLayoutPanel4.Name = "tableLayoutPanel4"; tableLayoutPanel4.RowCount = 1; tableLayoutPanel4.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); tableLayoutPanel4.Size = new Size(353, 34); tableLayoutPanel4.Size = new Size(352, 34); tableLayoutPanel4.TabIndex = 1; // // tableLayoutPanel5 @@ -418,29 +418,29 @@ tableLayoutPanel5.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F)); tableLayoutPanel5.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F)); tableLayoutPanel5.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25F)); tableLayoutPanel5.Controls.Add(btn_Open, 0, 0); tableLayoutPanel5.Controls.Add(btn_Close, 1, 0); tableLayoutPanel5.Controls.Add(btn_Edit, 3, 0); tableLayoutPanel5.Controls.Add(btnOpen, 0, 0); tableLayoutPanel5.Controls.Add(btnClose, 1, 0); tableLayoutPanel5.Controls.Add(btnEdit, 3, 0); tableLayoutPanel5.Dock = DockStyle.Fill; tableLayoutPanel5.Location = new Point(3, 83); tableLayoutPanel5.Name = "tableLayoutPanel5"; tableLayoutPanel5.RowCount = 1; tableLayoutPanel5.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); tableLayoutPanel5.Size = new Size(353, 34); tableLayoutPanel5.Size = new Size(352, 34); tableLayoutPanel5.TabIndex = 2; // // btn_Edit // btnEdit // btn_Edit.Dock = DockStyle.Fill; btn_Edit.Enabled = false; btn_Edit.ForeColor = SystemColors.ControlText; btn_Edit.Location = new Point(267, 3); btn_Edit.Name = "btn_Edit"; btn_Edit.Size = new Size(83, 28); btn_Edit.TabIndex = 10; btn_Edit.Text = "ç¼è¾"; btn_Edit.UseVisualStyleBackColor = true; btn_Edit.Click += btn_Edit_Click; btnEdit.Dock = DockStyle.Fill; btnEdit.Enabled = false; btnEdit.ForeColor = SystemColors.ControlText; btnEdit.Location = new Point(267, 3); btnEdit.Name = "btnEdit"; btnEdit.Size = new Size(82, 28); btnEdit.TabIndex = 10; btnEdit.Text = "ç¼è¾"; btnEdit.UseVisualStyleBackColor = true; btnEdit.Click += btnEdit_Click; // // tableLayoutPanel6 // @@ -449,30 +449,30 @@ tableLayoutPanel6.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25.0006275F)); tableLayoutPanel6.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 25.0006237F)); tableLayoutPanel6.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 24.9981289F)); tableLayoutPanel6.Controls.Add(btn_GrabOnce, 0, 0); tableLayoutPanel6.Controls.Add(btn_StartGrab, 1, 0); tableLayoutPanel6.Controls.Add(btn_CloseGrab, 2, 0); tableLayoutPanel6.Controls.Add(btn_SaveImage, 3, 0); tableLayoutPanel6.Controls.Add(btnGrabOnce, 0, 0); tableLayoutPanel6.Controls.Add(btnStartGrab, 1, 0); tableLayoutPanel6.Controls.Add(btnCloseGrab, 2, 0); tableLayoutPanel6.Controls.Add(btnSaveImage, 3, 0); tableLayoutPanel6.Dock = DockStyle.Fill; tableLayoutPanel6.Location = new Point(3, 163); tableLayoutPanel6.Name = "tableLayoutPanel6"; tableLayoutPanel6.RowCount = 1; tableLayoutPanel6.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); tableLayoutPanel6.Size = new Size(353, 34); tableLayoutPanel6.Size = new Size(352, 34); tableLayoutPanel6.TabIndex = 24; // // btn_SaveImage // btnSaveImage // btn_SaveImage.Dock = DockStyle.Fill; btn_SaveImage.ForeColor = SystemColors.Desktop; btn_SaveImage.Location = new Point(266, 2); btn_SaveImage.Margin = new Padding(2); btn_SaveImage.Name = "btn_SaveImage"; btn_SaveImage.Size = new Size(85, 30); btn_SaveImage.TabIndex = 8; btn_SaveImage.Text = "ä¿åå¾ç"; btn_SaveImage.UseVisualStyleBackColor = true; btn_SaveImage.Click += btn_SaveImage_Click; btnSaveImage.Dock = DockStyle.Fill; btnSaveImage.ForeColor = SystemColors.Desktop; btnSaveImage.Location = new Point(266, 2); btnSaveImage.Margin = new Padding(2, 2, 2, 2); btnSaveImage.Name = "btnSaveImage"; btnSaveImage.Size = new Size(84, 30); btnSaveImage.TabIndex = 8; btnSaveImage.Text = "ä¿åå¾ç"; btnSaveImage.UseVisualStyleBackColor = true; btnSaveImage.Click += btnSaveImage_Click; // // tableLayoutPanel7 // @@ -486,7 +486,7 @@ tableLayoutPanel7.Name = "tableLayoutPanel7"; tableLayoutPanel7.RowCount = 1; tableLayoutPanel7.RowStyles.Add(new RowStyle(SizeType.Percent, 50F)); tableLayoutPanel7.Size = new Size(353, 34); tableLayoutPanel7.Size = new Size(352, 34); tableLayoutPanel7.TabIndex = 25; // // tableLayoutPanel8 @@ -501,7 +501,7 @@ tableLayoutPanel8.Name = "tableLayoutPanel8"; tableLayoutPanel8.RowCount = 1; tableLayoutPanel8.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); tableLayoutPanel8.Size = new Size(353, 34); tableLayoutPanel8.Size = new Size(352, 34); tableLayoutPanel8.TabIndex = 26; // // tableLayoutPanel1 @@ -518,20 +518,19 @@ tableLayoutPanel1.Name = "tableLayoutPanel1"; tableLayoutPanel1.RowCount = 1; tableLayoutPanel1.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); tableLayoutPanel1.Size = new Size(353, 34); tableLayoutPanel1.Size = new Size(352, 34); tableLayoutPanel1.TabIndex = 29; // // btnStartHard // btnStartHard.Dock = DockStyle.Fill; btnStartHard.ForeColor = SystemColors.InfoText; btnStartHard.Location = new Point(3, 3); btnStartHard.Name = "btnStartHard"; btnStartHard.Size = new Size(64, 28); btnStartHard.TabIndex = 22; btnStartHard.Text = "çå¾ è§¦å"; btnStartHard.UseVisualStyleBackColor = true; btnStartHard.Click += btn_StartHard_Click; btnStartHard.Click += btnStartHard_Click; // // ckbUpParams // @@ -539,7 +538,7 @@ ckbUpParams.Dock = DockStyle.Fill; ckbUpParams.Location = new Point(73, 3); ckbUpParams.Name = "ckbUpParams"; ckbUpParams.Size = new Size(135, 28); ckbUpParams.Size = new Size(134, 28); ckbUpParams.TabIndex = 23; ckbUpParams.Text = "æ¯å¦æ¯æ¬¡åå ¥åæ°"; ckbUpParams.UseVisualStyleBackColor = true; @@ -548,7 +547,7 @@ // ckbRegrab.AutoSize = true; ckbRegrab.Dock = DockStyle.Fill; ckbRegrab.Location = new Point(214, 3); ckbRegrab.Location = new Point(213, 3); ckbRegrab.Name = "ckbRegrab"; ckbRegrab.Size = new Size(136, 28); ckbRegrab.TabIndex = 24; @@ -567,7 +566,7 @@ tableLayoutPanel12.Name = "tableLayoutPanel12"; tableLayoutPanel12.RowCount = 1; tableLayoutPanel12.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); tableLayoutPanel12.Size = new Size(353, 43); tableLayoutPanel12.Size = new Size(352, 43); tableLayoutPanel12.TabIndex = 31; // // lblCapTime @@ -576,7 +575,7 @@ lblCapTime.Dock = DockStyle.Fill; lblCapTime.Location = new Point(123, 0); lblCapTime.Name = "lblCapTime"; lblCapTime.Size = new Size(227, 43); lblCapTime.Size = new Size(226, 43); lblCapTime.TabIndex = 16; lblCapTime.Text = "0ms"; lblCapTime.TextAlign = ContentAlignment.MiddleLeft; @@ -604,7 +603,7 @@ tableLayoutPanel11.Name = "tableLayoutPanel11"; tableLayoutPanel11.RowCount = 1; tableLayoutPanel11.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); tableLayoutPanel11.Size = new Size(353, 34); tableLayoutPanel11.Size = new Size(352, 34); tableLayoutPanel11.TabIndex = 30; // // cmbImagesPath @@ -615,7 +614,7 @@ cmbImagesPath.FormattingEnabled = true; cmbImagesPath.Location = new Point(3, 443); cmbImagesPath.Name = "cmbImagesPath"; cmbImagesPath.Size = new Size(353, 25); cmbImagesPath.Size = new Size(352, 25); cmbImagesPath.TabIndex = 0; cmbImagesPath.SelectedIndexChanged += cmbImagesPath_SelectedIndexChanged; cmbImagesPath.MouseHover += cmbImagesPath_MouseHover; @@ -627,14 +626,14 @@ tableLayoutPanel9.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.3333321F)); tableLayoutPanel9.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 33.3333321F)); tableLayoutPanel9.Controls.Add(ckbLocalTest, 0, 0); tableLayoutPanel9.Controls.Add(btn_AddImages, 1, 0); tableLayoutPanel9.Controls.Add(btn_LocalGrab, 2, 0); tableLayoutPanel9.Controls.Add(btnAddImages, 1, 0); tableLayoutPanel9.Controls.Add(btnLocalGrab, 2, 0); tableLayoutPanel9.Dock = DockStyle.Fill; tableLayoutPanel9.Location = new Point(3, 403); tableLayoutPanel9.Name = "tableLayoutPanel9"; tableLayoutPanel9.RowCount = 1; tableLayoutPanel9.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); tableLayoutPanel9.Size = new Size(353, 34); tableLayoutPanel9.Size = new Size(352, 34); tableLayoutPanel9.TabIndex = 27; // // ckbLocalTest @@ -648,29 +647,29 @@ ckbLocalTest.Text = "æ¬å°åå¾"; ckbLocalTest.UseVisualStyleBackColor = true; // // btn_AddImages // btnAddImages // btn_AddImages.Dock = DockStyle.Fill; btn_AddImages.ForeColor = SystemColors.Desktop; btn_AddImages.Location = new Point(120, 3); btn_AddImages.Name = "btn_AddImages"; btn_AddImages.Size = new Size(111, 28); btn_AddImages.TabIndex = 1; btn_AddImages.Text = "æ·»å å¾ç"; btn_AddImages.UseVisualStyleBackColor = true; btn_AddImages.Click += btn_AddImages_Click; btnAddImages.Dock = DockStyle.Fill; btnAddImages.ForeColor = SystemColors.Desktop; btnAddImages.Location = new Point(120, 3); btnAddImages.Name = "btnAddImages"; btnAddImages.Size = new Size(111, 28); btnAddImages.TabIndex = 1; btnAddImages.Text = "æ·»å å¾ç"; btnAddImages.UseVisualStyleBackColor = true; btnAddImages.Click += btnAddImages_Click; // // btn_LocalGrab // btnLocalGrab // btn_LocalGrab.Dock = DockStyle.Fill; btn_LocalGrab.ForeColor = SystemColors.Desktop; btn_LocalGrab.Location = new Point(237, 3); btn_LocalGrab.Name = "btn_LocalGrab"; btn_LocalGrab.Size = new Size(113, 28); btn_LocalGrab.TabIndex = 2; btn_LocalGrab.Text = "æ¬å°åå¾"; btn_LocalGrab.UseVisualStyleBackColor = true; btn_LocalGrab.Click += btn_LocalGrab_Click; btnLocalGrab.Dock = DockStyle.Fill; btnLocalGrab.ForeColor = SystemColors.Desktop; btnLocalGrab.Location = new Point(237, 3); btnLocalGrab.Name = "btnLocalGrab"; btnLocalGrab.Size = new Size(112, 28); btnLocalGrab.TabIndex = 2; btnLocalGrab.Text = "æ¬å°åå¾"; btnLocalGrab.UseVisualStyleBackColor = true; btnLocalGrab.Click += btnLocalGrab_Click; // // tableLayoutPanel10 // @@ -684,7 +683,7 @@ tableLayoutPanel10.Name = "tableLayoutPanel10"; tableLayoutPanel10.RowCount = 1; tableLayoutPanel10.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); tableLayoutPanel10.Size = new Size(353, 34); tableLayoutPanel10.Size = new Size(352, 34); tableLayoutPanel10.TabIndex = 32; // // label6 @@ -703,7 +702,7 @@ txtTimeout.Dock = DockStyle.Fill; txtTimeout.Location = new Point(53, 3); txtTimeout.Name = "txtTimeout"; txtTimeout.Size = new Size(297, 23); txtTimeout.Size = new Size(296, 23); txtTimeout.TabIndex = 1; // // theme_2DCameraForm @@ -725,6 +724,7 @@ theme_2DCameraForm.StartPosition = FormStartPosition.WindowsDefaultLocation; theme_2DCameraForm.TabIndex = 20; theme_2DCameraForm.Text = "2Dç¸æºè®¾ç½®çé¢"; theme_2DCameraForm.Click += theme_2DCameraForm_Click; // // controlBox1 // @@ -736,7 +736,7 @@ controlBox1.EnableMaximizeButton = false; controlBox1.EnableMinimizeButton = false; controlBox1.ForeColor = Color.FromArgb(155, 155, 155); controlBox1.Location = new Point(785, 18); controlBox1.Location = new Point(807, 15); controlBox1.MaximizeHoverColor = Color.FromArgb(74, 74, 74); controlBox1.MinimizeHoverColor = Color.FromArgb(63, 63, 65); controlBox1.Name = "controlBox1"; @@ -752,7 +752,7 @@ panel_2DCameraForm.EdgeColor = Color.FromArgb(32, 41, 50); panel_2DCameraForm.Location = new Point(10, 70); panel_2DCameraForm.Name = "panel_2DCameraForm"; panel_2DCameraForm.Padding = new Padding(5); panel_2DCameraForm.Padding = new Padding(5, 5, 5, 5); panel_2DCameraForm.Size = new Size(865, 601); panel_2DCameraForm.SmoothingType = System.Drawing.Drawing2D.SmoothingMode.HighQuality; panel_2DCameraForm.TabIndex = 20; @@ -807,15 +807,15 @@ #endregion private ComboBox cmb_Brand; private ComboBox cmb_SN; private ComboBox cmbBrand; private ComboBox cmbSN; private Label label1; private Label label2; private Button btn_StartGrab; private Button btn_CloseGrab; private Button btn_GrabOnce; private Button btn_Open; private Button btn_Close; private Button btnStartGrab; private Button btnCloseGrab; private Button btnGrabOnce; private Button btnOpen; private Button btnClose; private TextBox txtGain; private TextBox txtExp; private Label label4; @@ -844,11 +844,11 @@ private TableLayoutPanel tableLayoutPanel12; private ComboBox cmbImagesPath; private CheckBox ckbLocalTest; private Button btn_AddImages; private Button btn_LocalGrab; private Button btn_Edit; private Button btnAddImages; private Button btnLocalGrab; private Button btnEdit; private CheckBox ckbUpParams; private Button btn_SaveImage; private Button btnSaveImage; private TableLayoutPanel tableLayoutPanel10; private Label label6; private TextBox txtTimeout; LB_VisionProcesses/Cameras/2DCameraForm.cs
@@ -38,9 +38,9 @@ { InitializeComponent(); //ä¼ å ¥ç¸æºå¥æåç¦ç¨è¿æ¥/æå¼æé® this.btn_Open.Enabled = false; this.btn_Close.Enabled = false; this.cmb_Brand.Enabled = false; //this.btnOpen.Enabled = false; //this.btnClose.Enabled = false; //this.cmbBrand.Enabled = false; this.panel_Picture.Controls.Clear(); this.dicCameras = dicCameras; @@ -48,7 +48,7 @@ this.camConfig = camConfig; foreach (var CamSN in dicCameras.Keys) cmb_SN.Items.Add(CamSN); cmbSN.Items.Add(CamSN); Enum.TryParse(camConfig.Params.Inputs["è§¦åæ¹å¼"].ToString(), out TriggerSource TriggerSource); @@ -96,17 +96,23 @@ var brands = Enum.GetValues(typeof(CameraBrand)).Cast<CameraBrand>(); foreach (var brand in brands) { cmb_Brand.Items.Add(brand.ToString()); cmbBrand.Items.Add(brand.ToString()); } //éæ©Camä¼è§¦åValueChangedäºä»¶ï¼æ²¡æè¾å ¥ç¸æºçæ åµä¸éæ©å°-1 if (camConfig != null) { string SN = camConfig.Params.Inputs["ç¸æºSN"].ToString(); int Index = cmb_SN.FindString(SN); int Index = cmbSN.FindString(SN); cmb_SN.Text = SN; cmb_SN.SelectedIndex = Index; cmbSN.Text = SN; cmbSN.SelectedIndex = Index; // å¦ææ²¡æ¾å°ç´¢å¼ï¼å¯è½æ¯æ°å¢çï¼ï¼æå¨è§¦å䏿¬¡é»è¾ä»¥æ´æ°UI if (Index == -1) { cmbSN_SelectedIndexChanged(null, null); } ckbLocalTest.Checked = Convert.ToBoolean(camConfig.Params.Inputs["æ¯å¦æ¬å°åå¾"].ToString()); ckbUpParams.Checked = Convert.ToBoolean(camConfig.Params.Inputs["æ¯å¦æ¯æ¬¡åå ¥åæ°"].ToString()); @@ -147,9 +153,9 @@ if (dicCameras != null && dicCameras.Count > 0) return; cmb_SN.Items.Clear(); cmbSN.Items.Clear(); // å°è¯å°è¾å ¥å符串转æ¢ä¸ºæä¸¾å¼ if (Enum.TryParse(cmb_Brand.Text, true, out CameraBrand brand)) if (Enum.TryParse(cmbBrand.Text, true, out CameraBrand brand)) { // ä½¿ç¨ switch è¯å¥æ¥å¤ææä¸¾å¼ switch (brand) @@ -167,8 +173,8 @@ foreach (var item in camera.GetListEnum()) { if (!cmb_SN.Items.Contains(item)) cmb_SN.Items.Add(item); if (!cmbSN.Items.Contains(item)) cmbSN.Items.Add(item); } } else @@ -179,7 +185,7 @@ private void cmbSN_SelectedIndexChanged(object sender, EventArgs e) { btn_Edit.Enabled = false; btnEdit.Enabled = false; //camConfigä¸ä¸ºç©ºï¼è¾å ¥æç¸æºï¼ï¼æ´æ¹ç¸æºéæ©éè¦éæ°å è½½å·å¾äºä»¶ if (camConfig != null && camera != null) { @@ -192,25 +198,37 @@ camera.Dispose(); } if (dicCameras != null && dicCameras.Count > 0 && dicCameras.ContainsKey(cmb_SN.Text)) camera = dicCameras[cmb_SN.Text]; if (dicCameras != null && dicCameras.Count > 0 && dicCameras.ContainsKey(cmbSN.Text)) camera = dicCameras[cmbSN.Text]; //说æç¸æºå·²ç»åå§åæå if (camera != null && camera.isGrabbing) if (camera != null) { camera.ImageGrabbed -= GetImageBllComplete; camera.ImageGrabbed += GetImageBllComplete; int Index = cmbBrand.FindString(camera.Brand.ToString()); if (Index >= 0) { cmbBrand.Text = camera.Brand.ToString(); cmbBrand.SelectedIndex = Index; } int Index = cmb_Brand.FindString(camera.Brand.ToString()); ; cmb_Brand.Text = camera.Brand.ToString(); cmb_Brand.SelectedIndex = Index; if (camera.isGrabbing) { camera.ImageGrabbed -= GetImageBllComplete; camera.ImageGrabbed += GetImageBllComplete; this.btnEdit.Enabled = true; } // å¦æç¸æºåå¨äºåå ¸ä¸ï¼è¯´ææ¯å·²è¿æ¥ç设å¤ï¼å 许ç¼è¾ else if (dicCameras != null && dicCameras.ContainsKey(camera.SN)) { this.btnEdit.Enabled = true; } } } private void btn_Open_Click(object sender, EventArgs e) private void btnOpen_Click(object sender, EventArgs e) { // å°è¯å°è¾å ¥å符串转æ¢ä¸ºæä¸¾å¼ if (Enum.TryParse(cmb_Brand.Text, true, out CameraBrand brand)) if (Enum.TryParse(cmbBrand.Text, true, out CameraBrand brand)) { if (camera != null) { @@ -232,11 +250,12 @@ return; } if (cmb_SN.Items.Count > 0 && camera.InitDevice(cmb_SN.Text.ToString(), this.Handle)) if (cmbSN.Items.Count > 0 && camera.InitDevice(cmbSN.Text.ToString(), this.Handle)) { camera.ImageGrabbed -= GetImageBllComplete; camera.ImageGrabbed += GetImageBllComplete; MessageBox.Show(camera.SN + "æå¼æå"); this.btnEdit.Enabled = true; } } else @@ -266,11 +285,11 @@ } } private void btn_Close_Click(object sender, EventArgs e) private void btnClose_Click(object sender, EventArgs e) { if (camera == null) return; this.btn_Edit.Enabled = false; this.btnEdit.Enabled = false; if (camera.CloseDevice()) { @@ -279,10 +298,71 @@ } } private void btn_Edit_Click(object sender, EventArgs e) private void btnEdit_Click(object sender, EventArgs e) { if (camera == null) return; using (Form editForm = new Form()) { editForm.Text = "é«çº§åæ°è®¾ç½® - " + camera.SN; editForm.Size = new System.Drawing.Size(400, 500); editForm.StartPosition = FormStartPosition.CenterParent; editForm.FormBorderStyle = FormBorderStyle.SizableToolWindow; PropertyGrid pg = new PropertyGrid(); pg.Dock = DockStyle.Fill; pg.SelectedObject = new CameraAdvancedSettings(camera); editForm.Controls.Add(pg); editForm.ShowDialog(); } } /// <summary> /// ç¸æºé«çº§è®¾ç½®å è£ ç±» /// </summary> public class CameraAdvancedSettings { private BaseCamera _camera; public CameraAdvancedSettings(BaseCamera camera) { _camera = camera; } [System.ComponentModel.Category("触å设置"), System.ComponentModel.Description("è§¦åæº")] public TriggerSource TriggerSource { get { _camera.GetTriggerMode(out _, out TriggerSource s); return s; } set { _camera.GetTriggerMode(out TriggerMode m, out _); _camera.SetTriggerMode(m, value); } } [System.ComponentModel.Category("触å设置"), System.ComponentModel.Description("è§¦åææ§")] public TriggerPolarity TriggerPolarity { get { _camera.GetTriggerPolarity(out TriggerPolarity p); return p; } set { _camera.SetTriggerPolarity(value); } } [System.ComponentModel.Category("触å设置"), System.ComponentModel.Description("触åå»¶æ¶(us)")] public double TriggerDelay { get { _camera.GetTriggerDelay(out double d); return d; } set { _camera.SetTriggerDelay(value); } } [System.ComponentModel.Category("触å设置"), System.ComponentModel.Description("è§¦åæ»¤æ³¢(us)")] public double TriggerFilter { get { _camera.GetTriggerFliter(out double f); return f; } set { _camera.SetTriggerFliter(value); } } [System.ComponentModel.Category("å¾å设置"), System.ComponentModel.Description("èªå¨ç½å¹³è¡¡")] public void AutoBalanceWhite() { _camera.AutoBalanceWhite(); } } /// <summary> @@ -324,7 +404,7 @@ private Pen pen = new Pen(Color.Blue, 3f); private System.Drawing.Point[] stPointList = new System.Drawing.Point[4]; private void btn_GrabOnce_Click(object sender, EventArgs e) private void btnGrabOnce_Click(object sender, EventArgs e) { DateTime StartTime = DateTime.Now; if (camera == null) @@ -332,7 +412,7 @@ Task.Factory.StartNew(() => { camera.GetCamConfig(out CameraConfig OriCamConfig); //camera.GetCamConfig(out CameraConfig OriCamConfig); camera.SetExpouseTime(Convert.ToDouble(txtExp.Text)); camera.SetGain(Convert.ToDouble(txtGain.Text)); @@ -348,11 +428,11 @@ })); //å¤ååé讯å£è®¾ç½® camera.SetCamConfig(OriCamConfig); //camera.SetCamConfig(OriCamConfig); }); } private void btn_StartHard_Click(object sender, EventArgs e) private void btnStartHard_Click(object sender, EventArgs e) { if (camera == null) return; @@ -360,7 +440,7 @@ total.Clear(); // å°è¯å°è¾å ¥å符串转æ¢ä¸ºæä¸¾å¼ if (Enum.TryParse(cmb_Brand.Text, true, out CameraBrand brand)) if (Enum.TryParse(cmbBrand.Text, true, out CameraBrand brand)) { camera.StopGrabbing(); camera.StartWith_HardTriggerModel(); @@ -368,11 +448,11 @@ startGrabtime = DateTime.Now; cmb_SN.Enabled = false; cmb_Brand.Enabled = false; cmbSN.Enabled = false; cmbBrand.Enabled = false; } private void btn_StartGrab_Click(object sender, EventArgs e) private void btnStartGrab_Click(object sender, EventArgs e) { if (camera == null) return; @@ -380,7 +460,7 @@ total.Clear(); // å°è¯å°è¾å ¥å符串转æ¢ä¸ºæä¸¾å¼ if (Enum.TryParse(cmb_Brand.Text, true, out CameraBrand brand)) if (Enum.TryParse(cmbBrand.Text, true, out CameraBrand brand)) { Task.Factory.StartNew(() => { @@ -391,11 +471,11 @@ } startGrabtime = DateTime.Now; cmb_SN.Enabled = false; cmb_Brand.Enabled = false; cmbSN.Enabled = false; cmbBrand.Enabled = false; } private void btn_CloseGrab_Click(object sender, EventArgs e) private void btnCloseGrab_Click(object sender, EventArgs e) { try { @@ -403,7 +483,7 @@ return; // å°è¯å°è¾å ¥å符串转æ¢ä¸ºæä¸¾å¼ if (Enum.TryParse(cmb_Brand.Text, true, out CameraBrand brand)) if (Enum.TryParse(cmbBrand.Text, true, out CameraBrand brand)) { Task.Factory.StartNew(() => { @@ -413,13 +493,13 @@ }); } cmb_SN.Enabled = true; cmb_Brand.Enabled = true; cmbSN.Enabled = true; cmbBrand.Enabled = true; } catch { } } private void btn_LocalGrab_Click(object sender, EventArgs e) private void btnLocalGrab_Click(object sender, EventArgs e) { try { @@ -452,7 +532,7 @@ catch { } } private void txt_Exp_TextChanged(object sender, EventArgs e) private void txtExp_TextChanged(object sender, EventArgs e) { if (camera == null) return; @@ -462,7 +542,7 @@ camera.SetExpouseTime(exp); } private void txt_Gain_TextChanged(object sender, EventArgs e) private void txtGain_TextChanged(object sender, EventArgs e) { if (camera == null) return; @@ -472,7 +552,7 @@ camera.SetGain(gain); } private void btn_AddImages_Click(object sender, EventArgs e) private void btnAddImages_Click(object sender, EventArgs e) { OpenFileDialog openFileDialog = new OpenFileDialog(); @@ -517,9 +597,25 @@ if (res == DialogResult.Yes) //ä¿åVPP { camConfig.Params.Inputs.Add("ç¸æºSN", cmb_SN.Text); TriggerSource actualSource = TriggerSource.Line0; TriggerPolarity polarity = TriggerPolarity.RisingEdge; double delay = 0; double filter = 0; if (camera != null) { camera.GetTriggerMode(out _, out actualSource); camera.GetTriggerPolarity(out polarity); camera.GetTriggerDelay(out delay); camera.GetTriggerFliter(out filter); } camConfig.Params.Inputs.Add("ç¸æºSN", cmbSN.Text); camConfig.Params.Inputs.Add("è§¦åæ¨¡å¼", TriggerMode.On); camConfig.Params.Inputs.Add("è§¦åæ¹å¼", radioButtonSoft.Checked ? TriggerSource.Software : TriggerSource.Line0); camConfig.Params.Inputs.Add("è§¦åæ¹å¼", radioButtonSoft.Checked ? TriggerSource.Software : actualSource); camConfig.Params.Inputs.Add("è§¦åææ§", polarity); camConfig.Params.Inputs.Add("触åå»¶æ¶", delay); camConfig.Params.Inputs.Add("è§¦åæ¶æ", filter); camConfig.Params.Inputs.Add("æ¯å¦æ¬å°åå¾", ckbLocalTest.Checked); camConfig.Params.Inputs.Add("æ¬å°åå¾è·¯å¾", cmbImagesPath.Items.Cast<string>().ToList()); camConfig.Params.Inputs.Add("æ¯å¦å¤±è´¥éæ°åå¾", ckbRegrab.Checked); @@ -548,10 +644,11 @@ camera.ImageGrabbed -= GetImageBllComplete; camera.StopGrabbing(); camera.GetTriggerMode(out _, out TriggerSource actualSource); if (radioButtonSoft.Checked) camera.SetTriggerMode(TriggerMode.On, TriggerSource.Software); else camera.SetTriggerMode(TriggerMode.On, TriggerSource.Line0); camera.SetTriggerMode(TriggerMode.On, actualSource); camera.StartGrabbing(); } @@ -574,7 +671,7 @@ }; } private void btn_SaveImage_Click(object sender, EventArgs e) private void btnSaveImage_Click(object sender, EventArgs e) { if (Bitmap == null) { @@ -614,17 +711,28 @@ private void radioButtonSoft_CheckedChanged(object sender, EventArgs e) { btn_GrabOnce.Enabled = radioButtonSoft.Checked; btn_StartGrab.Enabled = radioButtonSoft.Checked; btn_CloseGrab.Enabled = radioButtonSoft.Checked; btnGrabOnce.Enabled = radioButtonSoft.Checked; btnStartGrab.Enabled = radioButtonSoft.Checked; btnCloseGrab.Enabled = radioButtonSoft.Checked; btnStartHard.Enabled = !radioButtonSoft.Checked; if (camera == null) return; camera.GetTriggerMode(out _, out TriggerSource currentSource); if (radioButtonSoft.Checked) { camera.SetTriggerMode(TriggerMode.On, TriggerSource.Software); } else camera.SetTriggerMode(TriggerMode.On, TriggerSource.Line0); { // 妿å½åå·²ç»æ¯ç¡¬ä»¶è§¦åæºï¼åä¿æï¼å¦åé»è®¤Line0 if (currentSource == TriggerSource.Software) camera.SetTriggerMode(TriggerMode.On, TriggerSource.Line0); else camera.SetTriggerMode(TriggerMode.On, currentSource); } } System.Windows.Forms.ToolTip ToolTip = new System.Windows.Forms.ToolTip(); @@ -650,12 +758,17 @@ private void controlBox_2DCameraForm_Click(object sender, EventArgs e) { } private void dungeonControlBox_2DCameraForm_Click(object sender, EventArgs e) { // this.Close(); // this.Close(); } private void theme_2DCameraForm_Click(object sender, EventArgs e) { } } } LB_VisionProcesses/Forms/GlobalVarForm.Designer.cs
@@ -37,7 +37,6 @@ btn_Delete = new ReaLTaiizor.Controls.Button(); btn_Add = new ReaLTaiizor.Controls.Button(); theme_GlobalVarForm.SuspendLayout(); controlsPanel.SuspendLayout(); tlp_GlobalVarForm.SuspendLayout(); tlp_GlobalVarFormOperator.SuspendLayout(); SuspendLayout(); @@ -45,8 +44,8 @@ // theme_GlobalVarForm // theme_GlobalVarForm.BackColor = Color.FromArgb(32, 41, 50); theme_GlobalVarForm.Controls.Add(tlp_GlobalVarForm); theme_GlobalVarForm.Controls.Add(controlBox_GlobalVarForm); theme_GlobalVarForm.Controls.Add(controlsPanel); theme_GlobalVarForm.Dock = DockStyle.Fill; theme_GlobalVarForm.Font = new Font("Microsoft Sans Serif", 9F); theme_GlobalVarForm.Image = (Image)resources.GetObject("theme_GlobalVarForm.Image"); @@ -71,7 +70,7 @@ controlBox_GlobalVarForm.EnableMaximizeButton = false; controlBox_GlobalVarForm.EnableMinimizeButton = false; controlBox_GlobalVarForm.ForeColor = Color.FromArgb(155, 155, 155); controlBox_GlobalVarForm.Location = new Point(700, 12); controlBox_GlobalVarForm.Location = new Point(700, 18); controlBox_GlobalVarForm.MaximizeHoverColor = Color.FromArgb(74, 74, 74); controlBox_GlobalVarForm.MinimizeHoverColor = Color.FromArgb(63, 63, 65); controlBox_GlobalVarForm.Name = "controlBox_GlobalVarForm"; @@ -81,13 +80,12 @@ // controlsPanel // controlsPanel.BackColor = Color.FromArgb(39, 51, 63); controlsPanel.Controls.Add(tlp_GlobalVarForm); controlsPanel.Dock = DockStyle.Fill; controlsPanel.EdgeColor = Color.FromArgb(32, 41, 50); controlsPanel.Location = new Point(10, 70); controlsPanel.Location = new Point(3, 3); controlsPanel.Name = "controlsPanel"; controlsPanel.Padding = new Padding(5); controlsPanel.Size = new Size(780, 521); controlsPanel.Size = new Size(774, 455); controlsPanel.SmoothingType = System.Drawing.Drawing2D.SmoothingMode.HighQuality; controlsPanel.TabIndex = 0; controlsPanel.Text = "panel1"; @@ -98,13 +96,14 @@ tlp_GlobalVarForm.ColumnCount = 1; tlp_GlobalVarForm.ColumnStyles.Add(new ColumnStyle(SizeType.Percent, 100F)); tlp_GlobalVarForm.Controls.Add(tlp_GlobalVarFormOperator, 0, 1); tlp_GlobalVarForm.Controls.Add(controlsPanel, 0, 0); tlp_GlobalVarForm.Dock = DockStyle.Fill; tlp_GlobalVarForm.Location = new Point(5, 5); tlp_GlobalVarForm.Location = new Point(10, 70); tlp_GlobalVarForm.Name = "tlp_GlobalVarForm"; tlp_GlobalVarForm.RowCount = 2; tlp_GlobalVarForm.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); tlp_GlobalVarForm.RowStyles.Add(new RowStyle(SizeType.Absolute, 60F)); tlp_GlobalVarForm.Size = new Size(770, 511); tlp_GlobalVarForm.Size = new Size(780, 521); tlp_GlobalVarForm.TabIndex = 0; tlp_GlobalVarForm.TagString = null; // @@ -120,11 +119,11 @@ tlp_GlobalVarFormOperator.Controls.Add(btn_Delete, 4, 0); tlp_GlobalVarFormOperator.Controls.Add(btn_Add, 5, 0); tlp_GlobalVarFormOperator.Dock = DockStyle.Fill; tlp_GlobalVarFormOperator.Location = new Point(3, 454); tlp_GlobalVarFormOperator.Location = new Point(3, 464); tlp_GlobalVarFormOperator.Name = "tlp_GlobalVarFormOperator"; tlp_GlobalVarFormOperator.RowCount = 1; tlp_GlobalVarFormOperator.RowStyles.Add(new RowStyle(SizeType.Percent, 100F)); tlp_GlobalVarFormOperator.Size = new Size(764, 54); tlp_GlobalVarFormOperator.Size = new Size(774, 54); tlp_GlobalVarFormOperator.TabIndex = 0; tlp_GlobalVarFormOperator.TagString = null; // @@ -139,11 +138,11 @@ btn_Delete.Image = null; btn_Delete.ImageAlign = ContentAlignment.MiddleLeft; btn_Delete.InactiveColor = Color.FromArgb(32, 34, 37); btn_Delete.Location = new Point(511, 3); btn_Delete.Location = new Point(516, 3); btn_Delete.Name = "btn_Delete"; btn_Delete.PressedBorderColor = Color.FromArgb(165, 37, 37); btn_Delete.PressedColor = Color.FromArgb(165, 37, 37); btn_Delete.Size = new Size(121, 48); btn_Delete.Size = new Size(122, 48); btn_Delete.TabIndex = 0; btn_Delete.Text = "ç§»é¤"; btn_Delete.TextAlignment = StringAlignment.Center; @@ -160,11 +159,11 @@ btn_Add.Image = null; btn_Add.ImageAlign = ContentAlignment.MiddleLeft; btn_Add.InactiveColor = Color.FromArgb(32, 34, 37); btn_Add.Location = new Point(638, 3); btn_Add.Location = new Point(644, 3); btn_Add.Name = "btn_Add"; btn_Add.PressedBorderColor = Color.FromArgb(165, 37, 37); btn_Add.PressedColor = Color.FromArgb(165, 37, 37); btn_Add.Size = new Size(123, 48); btn_Add.Size = new Size(127, 48); btn_Add.TabIndex = 1; btn_Add.Text = "æ·»å "; btn_Add.TextAlignment = StringAlignment.Center; @@ -184,7 +183,6 @@ FormClosing += GlobalVarForm_FormClosing; Load += GlobalVarForm_Load; theme_GlobalVarForm.ResumeLayout(false); controlsPanel.ResumeLayout(false); tlp_GlobalVarForm.ResumeLayout(false); tlp_GlobalVarFormOperator.ResumeLayout(false); ResumeLayout(false);