| | |
| | | "Krypton.Docking": "6.2111.312", |
| | | "ScottPlot.WinForms": "4.1.58", |
| | | "SunnyUI": "3.0.9", |
| | | "runtimepack.Microsoft.Windows.SDK.NET.Ref": "10.0.19041.28" |
| | | "runtimepack.Microsoft.Windows.SDK.NET.Ref": "10.0.19041.52" |
| | | }, |
| | | "runtime": { |
| | | "Bro.UI.Main.dll": {} |
| | | } |
| | | }, |
| | | "runtimepack.Microsoft.Windows.SDK.NET.Ref/10.0.19041.28": { |
| | | "runtimepack.Microsoft.Windows.SDK.NET.Ref/10.0.19041.52": { |
| | | "runtime": { |
| | | "Microsoft.Windows.SDK.NET.dll": { |
| | | "assemblyVersion": "10.0.19041.24", |
| | | "fileVersion": "10.0.19041.28" |
| | | "assemblyVersion": "10.0.19041.38", |
| | | "fileVersion": "10.0.19041.52" |
| | | }, |
| | | "WinRT.Runtime.dll": { |
| | | "assemblyVersion": "2.0.0.0", |
| | | "fileVersion": "2.0.1.40881" |
| | | "assemblyVersion": "2.1.0.0", |
| | | "fileVersion": "2.1.6.47881" |
| | | } |
| | | } |
| | | }, |
| | |
| | | "Bro.UI.Model.Winform": "1.0.0" |
| | | }, |
| | | "runtime": { |
| | | "Bro.Common.Device.dll": {} |
| | | "Bro.Common.Device.dll": { |
| | | "assemblyVersion": "1.0.0", |
| | | "fileVersion": "1.0.40124.0" |
| | | } |
| | | } |
| | | }, |
| | | "Bro.Common.Model/1.0.0": { |
| | |
| | | "System.Resources.ResourceManager": "4.3.0" |
| | | }, |
| | | "runtime": { |
| | | "Bro.Common.Model.dll": {} |
| | | "Bro.Common.Model.dll": { |
| | | "assemblyVersion": "1.0.0", |
| | | "fileVersion": "1.0.40127.0" |
| | | } |
| | | }, |
| | | "resources": { |
| | | "en-US/Bro.Common.Model.resources.dll": { |
| | |
| | | "Microsoft.EntityFrameworkCore": "7.0.0" |
| | | }, |
| | | "runtime": { |
| | | "Bro.DataBase.Model.dll": {} |
| | | "Bro.DataBase.Model.dll": { |
| | | "assemblyVersion": "1.0.0", |
| | | "fileVersion": "1.0.0.0" |
| | | } |
| | | } |
| | | }, |
| | | "Bro.Process/1.0.0": { |
| | |
| | | "Bro.UI.Model.Winform": "1.0.0" |
| | | }, |
| | | "runtime": { |
| | | "Bro.Process.dll": {} |
| | | "Bro.Process.dll": { |
| | | "assemblyVersion": "1.0.0", |
| | | "fileVersion": "1.0.40125.0" |
| | | } |
| | | } |
| | | }, |
| | | "Bro.Process.DataBase/1.0.0": { |
| | |
| | | "System.Configuration.ConfigurationManager": "6.0.0" |
| | | }, |
| | | "runtime": { |
| | | "Bro.Process.DataBase.dll": {} |
| | | "Bro.Process.DataBase.dll": { |
| | | "assemblyVersion": "1.0.0", |
| | | "fileVersion": "1.0.21116.0" |
| | | } |
| | | } |
| | | }, |
| | | "Bro.UI.Device.Winform/1.0.0": { |
| | |
| | | "Bro.UI.Model.Winform": "1.0.0" |
| | | }, |
| | | "runtime": { |
| | | "Bro.UI.Device.Winform.dll": {} |
| | | "Bro.UI.Device.Winform.dll": { |
| | | "assemblyVersion": "1.0.0", |
| | | "fileVersion": "1.0.30415.0" |
| | | } |
| | | } |
| | | }, |
| | | "Bro.UI.Model.Winform/1.0.0": { |
| | |
| | | "SunnyUI": "3.0.9" |
| | | }, |
| | | "runtime": { |
| | | "Bro.UI.Model.Winform.dll": {} |
| | | "Bro.UI.Model.Winform.dll": { |
| | | "assemblyVersion": "1.0.0", |
| | | "fileVersion": "1.0.21118.0" |
| | | } |
| | | } |
| | | }, |
| | | "halcondotnet/12.0.0.0": { |
| | |
| | | "serviceable": false, |
| | | "sha512": "" |
| | | }, |
| | | "runtimepack.Microsoft.Windows.SDK.NET.Ref/10.0.19041.28": { |
| | | "runtimepack.Microsoft.Windows.SDK.NET.Ref/10.0.19041.52": { |
| | | "type": "runtimepack", |
| | | "serviceable": false, |
| | | "sha512": "" |
| | |
| | | </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" /> |
| | |
| | | <Reference Include="SunnyUI.Common"> |
| | | <HintPath>..\..\libs\Nuget\SunnyUI.Common.dll</HintPath> |
| | | </Reference> |
| | | </ItemGroup> |
| | | |
| | | <ItemGroup> |
| | | <Compile Update="FrmProductList.cs"> |
| | | <SubType>UserControl</SubType> |
| | | </Compile> |
| | | </ItemGroup> |
| | | |
| | | </Project> |
| | |
| | | |
| | | public bool IsPreStationOK { get; set; } = false; |
| | | |
| | | public List<string> ImagePaths { get; set; } = new List<string>(); |
| | | |
| | | public DateTime? EndTime { get; set; } = null; |
| | | |
| | | object _checkResultLock = new object(); |
New file |
| | |
| | | { |
| | | "profiles": { |
| | | "Bro.M135.Common": { |
| | | "commandName": "Project" |
| | | } |
| | | } |
| | | } |
| | |
| | | using System.Drawing.Printing; |
| | | using System.Reflection; |
| | | using System.Windows.Forms.Design; |
| | | using static Bro.Common.Helper.EnumHelper; |
| | | |
| | | namespace Bro.M141.Process |
| | | { |
| | |
| | | [TypeConverter(typeof(CollectionCountConvert))] |
| | | [Editor(typeof(ComplexCollectionEditor<Printer>), typeof(UITypeEditor))] |
| | | public List<Printer> Printers { get; set; } = new List<Printer>(); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | [Category("产品显示界面配置")] |
| | |
| | | [Description("应对单次检测项需要多次拍照时,记录图片的索引号,从0开始")] |
| | | public int ImageIndex { get; set; } = 0; |
| | | |
| | | [Category("启用配置")] |
| | | [DisplayName("固定检测项")] |
| | | [Description("true:该检测项是固定检测项目,必须执行 false:该检测是可变检测项目,流程中决定是否检测,默认不检测")] |
| | | public bool IsFixed { get; set; } = true; |
| | | |
| | | [Category("取像设置")] |
| | | [DisplayName("相机选择")] |
| | | [Description("选择该检测项对应的相机")] |
| | |
| | | [DisplayName("OK图片保存开关")] |
| | | public bool OKImageSwitch { get; set; } = false; |
| | | |
| | | |
| | | [Category("图片保存设置")] |
| | | [Description("该站检测图片保存时,保存的图片顺序后缀")] |
| | | [DisplayName("图片保存顺序后缀")] |
| | | public string ImageSaveSeq { get; set; } = "1"; |
| | | |
| | | public string GetDisplayText() |
| | | { |
| | |
| | | } |
| | | |
| | | |
| | | [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("点位设置")] |
| | |
| | | [Description("该检测项所涉及的所有检测点位集合")] |
| | | [TypeConverter(typeof(ComplexObjectConvert))] |
| | | [Editor(typeof(ComplexCollectionEditor<MeasurePointSelector>), typeof(UITypeEditor))] |
| | | |
| | | |
| | | |
| | | public List<MeasurePointSelector> MeasurePointNameCollection { get; set; } = new List<MeasurePointSelector>(); |
| | | |
| | | |
| | |
| | | |
| | | public M141Process(string productCode) : base(productCode) { } |
| | | #endregion |
| | | |
| | | TaskFactory _taskFactory = new TaskFactory(TaskCreationOptions.LongRunning, TaskContinuationOptions.LongRunning); |
| | | |
| | | public event Action<string, P_PRODUCT_DETAIL, string> OnSinglePostionDetectResultUpdate; |
| | | |
| | | protected M141Config M141Config => Config as M141Config; |
| | | |
| | | public static object _productListLock = new object(); |
| | |
| | | public override void InitialProcessMethods() |
| | | { |
| | | base.InitialProcessMethods(); |
| | | |
| | | |
| | | if (ThHeartPlc == null) |
| | | { |
| | |
| | | bool devicestate = false; |
| | | PLCBase Plc2; |
| | | public Thread ThHeartPlc; |
| | | |
| | | |
| | | |
| | | public override void Open() |
| | |
| | | base.Close(); |
| | | |
| | | } |
| | | |
| | | |
| | | public void Heartplc() |
| | | { |
| | |
| | | Dictionary<string, List<string>> _positionSpecHeads = new Dictionary<string, List<string>>(); |
| | | |
| | | |
| | | |
| | | |
| | | volatile int uploadId = 0; |
| | | |
| | | |
| | |
| | | // dicpid[tem] = pidList[i]; |
| | | //} |
| | | |
| | | |
| | | List<DetectResult> detectResults = ML?.RunMLDetectionSync(imgSet, pidList, measureBind.DetectionId); |
| | | //var c=products[0].ImagePaths; |
| | | List<DetectResult> detectResults = ML?.RunMLDetectionSync(imgSet, pidList, measureBind.DetectionId,false,null,null,"", products[0].ImagePaths); |
| | | List<DetectResult> ngResults = new List<DetectResult>(); |
| | | |
| | | |
| | |
| | | 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; |
| | |
| | | |
| | | return msg; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | [ProcessMethod("", "ProductDataUpload", "产品数据汇总", InvokeType.TestInvoke)] |
| | |
| | | } |
| | | |
| | | |
| | | 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) |
| | |
| | | }); |
| | | return specList; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | protected void FillSpecResults(string pid, List<ISpec> detectSpec, List<double> results, string SEQUENCE) |
| | | { |
| | |
| | | |
| | | UpdateDefectAsync(defects); |
| | | var defectClass = GetDefectClassFromDefectList(defects); |
| | | UpdateResult(DateTime.Now, p.SN, defectClass.ClassName, ""); |
| | | UpdateResult(DateTime.Now, p.SN, defectClass.ClassName, "",p.ImagePaths); |
| | | |
| | | //产品序号+1 |
| | | //Interlocked.Increment(ref _productIndex); |
New file |
| | |
| | | { |
| | | "profiles": { |
| | | "Bro.M141.Process": { |
| | | "commandName": "Project" |
| | | } |
| | | } |
| | | } |
| | |
| | | base.Open(); |
| | | } |
| | | |
| | | |
| | | [ProcessMethod("", "PositionCheck_P1", "工位1检测", InvokeType.TestInvoke)] |
| | | public ResponseMessage PositionCheck_P1(IOperationConfig config, IDevice invokeDevice, IDevice sourceDevice) |
| | | { |
| | |
| | | |
| | | return msg; |
| | | } |
| | | |
| | | |
| | | [ProcessMethod("", "PositionCheck_P2", "工位2检测", InvokeType.TestInvoke)] |
| | | public ResponseMessage PositionCheck_P2(IOperationConfig config, IDevice invokeDevice, IDevice sourceDevice) |
| | |
| | | return msg; |
| | | } |
| | | |
| | | |
| | | [ProcessMethod("", "PositionCheck_P3", "工位3检测", InvokeType.TestInvoke)] |
| | | public ResponseMessage PositionCheck_P3(IOperationConfig config, IDevice invokeDevice, IDevice sourceDevice) |
| | | { |
| | |
| | | |
| | | return msg; |
| | | } |
| | | |
| | | |
| | | |
| | | [ProcessMethod("ImageCheck", "ReadBarcode", "读码", InvokeType.TestInvoke)] |
| | |
| | | |
| | | return "NOREAD"; |
| | | } |
| | | |
| | | |
| | | private bool CheckBarcodeValid(string barcode) |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | | } |