src/Bro.M135.Common/Bro.M135.Common.csproj | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/Bro.M135.Common/FrmProductList.Designer.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/Bro.M135.Common/FrmProductList.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/Bro.M135.Common/FrmProductList.resx | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/Bro.M135.Common/Properties/launchSettings.json | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/Bro.M141.Process/M141Config.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/Bro.M141.Process/M141Models.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/Bro.M141.Process/M141Process_ImageCheck.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/Bro.M141.Process/Properties/launchSettings.json | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
src/Bro.M141_AOI1.Process/AOI1Process.cs | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/Bro.M135.Common/Bro.M135.Common.csproj
@@ -22,6 +22,7 @@ </ItemGroup> <ItemGroup> <PackageReference Include="Microsoft.Windows.CppWinRT" Version="2.0.250303.1" /> <PackageReference Include="System.Drawing.Common" Version="6.0.0" /> <PackageReference Include="System.Security.Cryptography.Pkcs" Version="6.0.3" /> <PackageReference Include="System.Security.Cryptography.Xml" Version="6.0.1" /> @@ -55,12 +56,6 @@ <Reference Include="SunnyUI.Common"> <HintPath>..\..\libs\Nuget\SunnyUI.Common.dll</HintPath> </Reference> </ItemGroup> <ItemGroup> <Compile Update="FrmProductList.cs"> <SubType>UserControl</SubType> </Compile> </ItemGroup> </Project> src/Bro.M135.Common/FrmProductList.Designer.cs
File was deleted src/Bro.M135.Common/FrmProductList.cs
File was deleted src/Bro.M135.Common/FrmProductList.resx
File was deleted src/Bro.M135.Common/Properties/launchSettings.json
New file @@ -0,0 +1,7 @@ { "profiles": { "Bro.M135.Common": { "commandName": "Project" } } } src/Bro.M141.Process/M141Config.cs
@@ -13,6 +13,7 @@ using System.Drawing.Printing; using System.Reflection; using System.Windows.Forms.Design; using static Bro.Common.Helper.EnumHelper; namespace Bro.M141.Process { @@ -24,6 +25,12 @@ [TypeConverter(typeof(CollectionCountConvert))] [Editor(typeof(ComplexCollectionEditor<Printer>), typeof(UITypeEditor))] public List<Printer> Printers { get; set; } = new List<Printer>(); [Category("产品显示界面配置")] @@ -364,6 +371,11 @@ [Description("应对单次检测项需要多次拍照时,记录图片的索引号,从0开始")] public int ImageIndex { get; set; } = 0; [Category("启用配置")] [DisplayName("固定检测项")] [Description("true:该检测项是固定检测项目,必须执行 false:该检测是可变检测项目,流程中决定是否检测,默认不检测")] public bool IsFixed { get; set; } = true; [Category("取像设置")] [DisplayName("相机选择")] [Description("选择该检测项对应的相机")] @@ -422,7 +434,10 @@ [DisplayName("OK图片保存开关")] public bool OKImageSwitch { get; set; } = false; [Category("图片保存设置")] [Description("该站检测图片保存时,保存的图片顺序后缀")] [DisplayName("图片保存顺序后缀")] public string ImageSaveSeq { get; set; } = "1"; public string GetDisplayText() { @@ -907,6 +922,21 @@ } [Device("OfflineDemo", "离线测试", DeviceAttributeType.OperationConfig)] public class OfflineDemoOperationConfig : OperationConfigBase { [Category("图片目录")] [Description("图片目录")] [DisplayName("图片目录")] [Editor(typeof(FoldDialogEditor), typeof(UITypeEditor))] public string ImageFolder { get; set; } [Category("启动配置")] [Description("true:启动离线测试 false:停止离线测试")] [DisplayName("测试开关")] public bool IsStart { get; set; } = true; } public class RealTimeAdjustDataDetail : IComplexDisplay { [Category("点位设置")] src/Bro.M141.Process/M141Models.cs
@@ -203,6 +203,9 @@ [Description("该检测项所涉及的所有检测点位集合")] [TypeConverter(typeof(ComplexObjectConvert))] [Editor(typeof(ComplexCollectionEditor<MeasurePointSelector>), typeof(UITypeEditor))] public List<MeasurePointSelector> MeasurePointNameCollection { get; set; } = new List<MeasurePointSelector>(); src/Bro.M141.Process/M141Process_ImageCheck.cs
@@ -8,7 +8,9 @@ using Microsoft.VisualBasic; using Newtonsoft.Json; using Newtonsoft.Json.Linq; using NPOI.SS.UserModel; using NPOI.Util; using NPOI.XSSF.UserModel; using Sunny.UI; using System.Data; using System.Data.SqlTypes; @@ -441,6 +443,8 @@ } [ProcessMethod("", "ProductDataUpload", "产品数据汇总", InvokeType.TestInvoke)] public ResponseMessage ProductDataUpload(IOperationConfig config, IDevice invokeDevice, IDevice sourceDevice) { @@ -503,6 +507,109 @@ } private bool _isDemoStarted = false; [ProcessMethod("OfflineDemo", "OfflineDemo", "离线测试", InvokeType.CalibInvoke)] public ResponseMessage OfflineDemo(IOperationConfig config, IDevice invokeDevice, IDevice sourceDevice) { if (config is OfflineDemoOperationConfig opConfig) { if (_isDemoStarted) { _isDemoStarted = false; } else { _isDemoStarted = true; OfflineDemoAsync(opConfig.ImageFolder); } } return new ResponseMessage(); } private async void OfflineDemoAsync(string imageFolder) { await Task.Run(() => { var imageFileNames = new DirectoryInfo(imageFolder).GetFiles().Select(u => u.FullName).ToList(); for (int i = 0; i < imageFileNames.Count; i++) { if (!_isDemoStarted) { return; } var imageFile = Path.GetFileNameWithoutExtension(imageFileNames[i]); if (imageFile.EndsWith("Fit")) { continue; } var nameDatas = imageFile.Split(new char[] { '_'}, StringSplitOptions.RemoveEmptyEntries).ToList(); if (nameDatas.Count != 5) { LogAsync(DateTime.Now, EnumHelper.LogLevel.Error, $"文件{imageFile}命名不符合规范,不执行离线测试"); continue; } var sn = nameDatas[0]; var imageSeq = nameDatas[1]; var measureBind = M141Config.MeasureBindCollection.FirstOrDefault(u => u.ImageSaveSeq == imageSeq); if (measureBind == null || !measureBind.IsFixed) { LogAsync(DateTime.Now, EnumHelper.LogLevel.Assist, $"离线测试,工位{(measureBind == null ? "未匹配" : $"{measureBind.WorkPosition}未开启")}"); continue; } LogAsync(DateTime.Now, EnumHelper.LogLevel.Action, $"离线测试,产品{sn}开始工位{measureBind.WorkPosition}离线检测"); MLImageSet imgSet = new MLImageSet(); imgSet.HImage = new HalconDotNet.HImage(imageFileNames[i]); imgSet.PID = sn; var detectResults = ML.RunMLDetectionSync(imgSet, null, measureBind.DetectionId); imgSet.HImage?.Dispose(); imgSet.HImage = null; //var defectFields = M141Config.DefectLocationSettings.FirstOrDefault(u => u.PositionCode == measureBind.WorkPosition); //var list = detectResults.SelectMany(u => u.NetResults.SelectMany(m => m.DetectDetails)).ToList(); ////if (list.Count > 0) ////{ //// //list.ForEach(d => //// //{ //// // //if (defectFields == null) //// // //{ //// // // d.Tag = ""; //// // //} //// // //else //// // //{ //// // // RectangleF rect = new RectangleF(d.Rect.Point_LU.X, d.Rect.Point_LU.Y, d.Rect.Width, d.Rect.Height); //// // // //var rectList = defectFields.Display.RectDict.Where(u => rect.IntersectsWith(u.Value)).ToList(); //// // // //if (rectList.Count > 0) //// // // //{ //// // // // d.Tag = string.Join(" ", rectList.Select(u => u.Key).OrderBy(u => u)); //// // // //} //// // // //else //// // // //{ //// // // // d.Tag = ""; //// // // //} //// // //} //// //}); ////} //Bitmap originImage = new Bitmap(imageFileNames[i]); //DetectResultSaveExcelAsync(detectResults, sn, originImage, DateTime.Now); } }); } [ProcessMethod("printer", "printer", "打印机打印", InvokeType.TestInvoke)] public ResponseMessage Printer(IOperationConfig config, IDevice invokeDevice, IDevice sourceDevice) @@ -560,6 +667,9 @@ return specList; } protected void FillSpecResults(string pid, List<ISpec> detectSpec, List<double> results, string SEQUENCE) { detectSpec.ForEach(s => src/Bro.M141.Process/Properties/launchSettings.json
New file @@ -0,0 +1,7 @@ { "profiles": { "Bro.M141.Process": { "commandName": "Project" } } } src/Bro.M141_AOI1.Process/AOI1Process.cs
@@ -390,5 +390,9 @@ return msg; } } }