| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607 |
- //using Cognex.VisionPro.ToolBlock;
- //using Cognex.VisionPro;
- //using MathNet.Numerics.LinearAlgebra;
- //using MathNet.Numerics.RootFinding;
- //using NPOI.SS.Formula.Functions;
- //using NPOI.Util;
- //using OpenCvSharp;
- //using OpenCvSharp.Flann;
- //using Prism.Events;
- //using Prism.Ioc;
- //using Prism.Mvvm;
- //using Prism.Regions;
- //using Prism.Services.Dialogs;
- //using System;
- //using System.Collections.Generic;
- //using System.Collections.ObjectModel;
- //using System.IO;
- //using System.Linq;
- //using System.Net.Sockets;
- //using System.Security.Cryptography;
- //using System.Text;
- //using System.Threading;
- //using System.Threading.Tasks;
- //using System.Windows;
- //using System.Windows.Documents;
- //using System.Windows.Interop;
- //using System.Windows.Media;
- //using System.Windows.Media.Media3D;
- //using Team.FFFeederService;
- //using Team.FFFeederService.Interfaces;
- //using TeamAAS_VP;
- //using TeamAAS_VP.Data;
- //using TeamAAS_VP.Enums;
- //using TeamAAS_VP.Events;
- //using TeamAAS_VP.Models;
- //using TeamAAS_VP.ViewModels.Home;
- //using TouchSocket.Core;
- //using TouchSocket.Sockets;
- //using TeamAAS_VP.Core;
- //using TeamAAS_VP.Interfaces;
- //public class UserScript:IVisionScripting
- //{
- // public IRegionManager regionManager { get; set; }
- // public IEventAggregator eventAggregator { get; set; }
- // public IContainerProvider container { get; set; }
- // public Management management { get; set; }
- // public ProductModel CurrentProduct { get; set; }
- // public async Task Execute(ProcedureModel procedure, string[] items, Action<Tuple<bool, string[]>> callback)
- // {
- // IVoiceCoilMotorFeeder Feeder = null;
- // if (procedure.FeederId != Guid.Empty)
- // {
- // Feeder = management.FeederService.GetFeeder(procedure.FeederId);
- // await RunProcedureFeeder(Feeder, procedure, items, rst =>
- // {
- // callback.Invoke(rst);
- // });
- // }
- // else
- // {
- // RunProcedureOther(procedure, items, rst =>
- // {
- // callback.Invoke(rst);
- // });
- // }
- // }
- // /// <summary>
- // /// Feeder相机引导模式
- // /// </summary>
- // /// <param name="Feeder"></param>
- // /// <param name="procedure"></param>
- // /// <param name="items"></param>
- // /// <param name="callback"></param>
- // /// <returns></returns>
- // private async Task RunProcedureFeeder(IVoiceCoilMotorFeeder Feeder, ProcedureModel procedure, string[] items, Action<Tuple<bool, string[]>> callback)
- // {
- // //是否检测上次的点位,相同点位排除
- // bool IsCheckLastPoints = false;
- // if (items.Length >= 2)
- // {
- // if (items[1] == "CheckLastPoints")
- // {
- // IsCheckLastPoints = true;
- // }
- // }
- // //Feeder光源亮度设置
- // if (procedure.LightValue > 3)
- // {
- // var light = await Feeder.GetLightBrightnessAsync();
- // if (procedure.LightValue != light)
- // {
- // await Feeder.SetLightValueAsync((ushort)procedure.LightValue);
- // }
- // //打开光源
- // await Feeder.OpenLightAsync();
- // }
- // //先振后拍时
- // if (procedure.VibrationModel == VibrationModel.VibrationPhoto)
- // {
- // if (procedure.FeederWorks != null && procedure.FeederWorks.FeederWorkList != null)
- // {
- // bool flog = false;
- // Dictionary<Guid, double> tuple;
- // if (management.feederCurentBlobArea.TryGetValue(management.CurrentProduct.ID, out tuple))
- // {
- // //首先判断是否是当前流程
- // if (tuple.TryGetValue(procedure.Id, out double minArea))
- // {
- // //如果上次的Blob面积小于设定的最小值,则触发供料
- // if (minArea <= procedure.MinArea)
- // {
- // flog = true;
- // SendTaskMessage($"执行料仓供料...", MessageLevel.Info);
- // await management.ExecuteFeederStockWorks(Feeder, procedure.FeederStockWorks);
- // await Task.Delay(procedure.WaitFeederStop);
- // SendTaskMessage($"料仓供料结束", MessageLevel.Info);
- // }
- // }
- // }
- // if (!flog)
- // {
- // //执行配置的Feeder振动任务
- // foreach (var feederwork in procedure.FeederWorks.FeederWorkList)
- // {
- // if (feederwork.Function == VibrationFunction.Delay)
- // {
- // await Task.Delay(feederwork.Duration);
- // }
- // else
- // {
- // await Feeder.StartAction((int)feederwork.Function, feederwork.Duration);
- // await Task.Delay(feederwork.Duration);
- // }
- // }
- // }
- // await Task.Delay(procedure.WaitFeederStop);
- // }
- // }
- // else
- // {
- // if (procedure.LightValue != 0)
- // {
- // await Task.Delay(procedure.WaitPhoto);
- // }
- // Dictionary<Guid, double> tuple;
- // if (management.feederCurentBlobArea.TryGetValue(management.CurrentProduct.ID, out tuple))
- // {
- // //首先判断是否是当前流程
- // if (tuple.TryGetValue(procedure.Id, out double minArea))
- // {
- // //如果上次的Blob面积小于设定的最小值,则触发供料
- // if (minArea <= procedure.MinArea)
- // {
- // SendTaskMessage($"执行料仓供料...", MessageLevel.Info);
- // await management.ExecuteFeederStockWorks(Feeder, procedure.FeederStockWorks);
- // await Task.Delay(procedure.WaitFeederStop);
- // SendTaskMessage($"料仓供料结束", MessageLevel.Info);
- // //执行配置的Feeder振动任务
- // /*foreach (var feederwork in procedure.FeederWorks.FeederWorkList)
- // {
- // if (feederwork.Function == VibrationFunction.Delay)
- // {
- // await Task.Delay(feederwork.Duration);
- // }
- // else
- // {
- // await Feeder.StartAction((int)feederwork.Function, feederwork.Duration);
- // await Task.Delay(feederwork.Duration);
- // }
- // }*/
- // await Task.Delay(procedure.WaitFeederStop);
- // }
- // }
- // }
- // }
- // DateTime nowtime = DateTime.Now;
- // //多次拍照
- // for (int i = 0; i < procedure.FeederFailLimit; i++)
- // {
- // SendTaskMessage($"开始执行【{i + 1}】视觉流程[{procedure.Name}]......", MessageLevel.Info);
- // //采集图像
- // var camera = management.CameraService.GetCamera(procedure.CameraId);
- // camera.SetExposureTime(procedure.ExposureTime);
- // camera.SetGain(procedure.Gain);
- // nowtime = DateTime.Now;
- // LogHelper.WriteLogInfo("开始采集图像");
- // procedure.ToolBlock.Inputs["InputImage"].Value = camera.Grab();
- // LogHelper.WriteLogInfo($"采集图像完成;用时:{(DateTime.Now - nowtime).Milliseconds}ms");
- // //运行视觉工具
- // LogHelper.WriteLogInfo("开始运行视觉工具");
- // procedure.ToolBlock.Run();
- // SendTaskMessage($"视觉流程[{procedure.Name}]执行结束!耗时:{procedure.ToolBlock.RunStatus.ProcessingTime:F1}ms", MessageLevel.Info);
- // CogToolBlockTerminalCollection outputCollection = procedure.ToolBlock.Outputs;
- // eventAggregator.GetEvent<RenderUpdateNotification>().Publish(new ShowRender()
- // {
- // CameraName = procedure.CameraName,
- // Id = procedure.CameraId,
- // Image = (ICogImage)procedure.ToolBlock.Inputs["InputImage"].Value,
- // Graphic = outputCollection["Graphic"].Value as CogGraphicCollection,
- // Result = (bool)(outputCollection["Found"].Value),
- // IsShow = true
- // });
- // DatabaseHelper.AddCameraRecords(management.CurrentProduct.Name, procedure.Name, outputCollection);
- // var BlobTotalArea = (double)outputCollection["BlobTotalArea"].Value;
- // //记录当前的blob面积
- // Dictionary<Guid, double> tuple;
- // if (management.feederCurentBlobArea.TryGetValue(management.CurrentProduct.ID, out tuple))
- // {
- // //如股票当前已经存在此流程的记录
- // if (tuple.ContainsKey(procedure.Id))
- // {
- // tuple[procedure.Id] = BlobTotalArea;
- // }
- // else
- // {
- // tuple.Add(procedure.Id, BlobTotalArea);
- // }
- // }
- // else
- // {
- // management.feederCurentBlobArea.Add(management.CurrentProduct.ID, new Dictionary<Guid, double>());
- // management.feederCurentBlobArea[management.CurrentProduct.ID].Add(procedure.Id, BlobTotalArea);
- // }
- // if (!outputCollection.Contains("Found"))
- // {
- // callback.Invoke(new Tuple<bool, string[]>(true, new string[] { "NG,NoOut[Found]" }));
- // return;
- // }
- // bool Found = (bool)(outputCollection["Found"].Value);
- // //拍照OK
- // if (Found)
- // {
- // SendTaskMessage($"拍照OK", MessageLevel.Debug);
- // if (procedure.ProcedureOutputs == null)
- // {
- // SendTaskMessage($"视觉流程未配置输出项!", MessageLevel.Alarm);
- // callback.Invoke(new Tuple<bool, string[]>(true, new string[] { "NG,NotOutputs" }));
- // return;
- // }
- // List<string> SendResults = new List<string>();
- // //SendResults.Add(new StringBuilder());
- // //SendResults[SendResults.Count - 1].Append("OK,");
- // bool isOk = true;
- // foreach (var output in procedure.ProcedureOutputs) //遍历配置的所有需要输出项
- // {
- // //根据输出类型进行区分输出
- // if (output.ValueType == typeof(string))
- // {
- // string[] strpoints = outputCollection[output.Name].Value.ToString().Split(";");
- // if (strpoints.Length <= 0)
- // {
- // continue;
- // //callback.Invoke(new Tuple<bool, string[]>(true, new string[] { $"Not[{output.Name}]" }));
- // //return;
- // }
- // //需要点位转换时,进行点位提取
- // if (output.IsPointTran)
- // {
- // List<Vector<double>> currentPointsForFeeder = new List<Vector<double>>();
- // int index = 0;
- // //获取相机校准
- // var calib = management.DeviceConfig.Calibrations.FirstOrDefault(cal => cal.Id == procedure.CalibrationId);
- // if (calib == null)
- // {
- // SendTaskMessage($"没有发现关联校准!", MessageLevel.Alarm);
- // callback.Invoke(new Tuple<bool, string[]>(true, new string[] { "NG,NotCalibrations" }));
- // return;
- // }
- // List<string> SendDtat = new List<string>();
- // //得到校准矩阵
- // Matrix<double> matrix = Matrix<double>.Build.DenseOfArray(calib.AffineTransformationMaterial);
- // List<string> points = new List<string>();
- // //遍历所有的输出点位
- // foreach (var pos in strpoints)
- // {
- // string[] spl = pos.Split(',');
- // double x = double.Parse(spl[0]);
- // double y = double.Parse(spl[1]);
- // double angle = double.Parse(spl[2]);
- // if (calib.CameraMount == CameraMount.FixedDown || calib.CameraMount == CameraMount.MobileJ2 || calib.CameraMount == CameraMount.MobileJ4)
- // {
- // angle *= -1;
- // }
- // //将像素坐标转换成机器人坐标
- // var rpos = matrix * Vector<double>.Build.Dense(new double[] { x, y, 1 });
- // currentPointsForFeeder.Add(rpos);
- // //判断是否有重复的点位,防止机器人重复取同一个物料,陷入死循环
- // if (IsCheckLastPoints)
- // {
- // if (management.LastPointsForFeeder.ContainsKey(Feeder.Id))
- // {
- // var repeated = management.LastPointsForFeeder[Feeder.Id].FirstOrDefault(p => Math.Abs(p[0] - rpos[0]) < 1 && Math.Abs(p[1] - rpos[1]) < 1);
- // if (repeated != null) continue;
- // }
- // }
- // index++;
- // if (index >= procedure.OutputPointCountMax)
- // {
- // points.Add($"{rpos[0]:F3},{rpos[1]:F3},{angle:F3}");
- // break;
- // }
- // else
- // {
- // points.Add($"{rpos[0]:F3},{rpos[1]:F3},{angle:F3}");
- // }
- // }
- // if (management.LastPointsForFeeder.ContainsKey(Feeder.Id))
- // {
- // management.LastPointsForFeeder[Feeder.Id] = currentPointsForFeeder; //将本次点位结果记录至最后一次
- // }
- // else
- // {
- // management.LastPointsForFeeder.Add(Feeder.Id, currentPointsForFeeder); //将本次点位结果记录至最后一次
- // }
- // SendTaskMessage($"可用的点位个数:{points.Count}", MessageLevel.Debug);
- // //如果可用的点位个数为0,则触发振动盘振动
- // if (points.Count == 0)
- // {
- // isOk = false;
- // break;
- // }
- // SendResults.Add($"{points.Count},{string.Join(",", points)}");
- // }
- // //直接输出字符串
- // else
- // {
- // List<string> bu = new List<string>();
- // foreach (var item in strpoints)
- // {
- // bu.Add(item);
- // }
- // SendResults.Add($"{string.Join(",", bu)}");
- // }
- // }
- // else
- // {
- // SendResults.Add(outputCollection[output.Name].Value.ToString());
- // }
- // }
- // if (!isOk)
- // {
- // //根据斑点面积决定是否料仓供料
- // if (BlobTotalArea <= procedure.MinArea)
- // {
- // SendTaskMessage($"执行料仓供料...", MessageLevel.Info);
- // await management.ExecuteFeederStockWorks(Feeder, procedure.FeederStockWorks, true);
- // await Task.Delay(procedure.WaitFeederStop);
- // SendTaskMessage($"料仓供料结束", MessageLevel.Info);
- // }
- // else
- // {
- // if (procedure.FeederWorks != null && procedure.FeederWorks.FeederWorkList != null)
- // {
- // SendTaskMessage($"执行Feeder振动", MessageLevel.Info);
- // //执行配置的Feeder振动任务
- // await management.ExecuteFeederWorks(Feeder, procedure.FeederWorks, true);
- // await Task.Delay(procedure.WaitFeederStop);
- // SendTaskMessage($"Feeder振动结束", MessageLevel.Info);
- // }
- // }
- // continue;
- // }
- // if (Feeder != null)
- // {
- // await Feeder.CloseLightAsync();
- // }
- // callback.Invoke(new Tuple<bool, string[]>(true, new string[] { $"OK,{string.Join(";", SendResults)}" }));
- // return;
- // }
- // //拍照NG
- // else
- // {
- // SendTaskMessage($"拍照NG", MessageLevel.Error);
- // //根据斑点面积决定是否料仓供料
- // if (BlobTotalArea <= procedure.MinArea)
- // {
- // SendTaskMessage($"执行料仓供料...", MessageLevel.Info);
- // await management.ExecuteFeederStockWorks(Feeder, procedure.FeederStockWorks);
- // await Task.Delay(procedure.WaitFeederStop);
- // SendTaskMessage($"料仓供料结束", MessageLevel.Info);
- // }
- // else
- // {
- // if (procedure.FeederWorks != null && procedure.FeederWorks.FeederWorkList != null)
- // {
- // SendTaskMessage($"执行Feeder振动", MessageLevel.Info);
- // //执行配置的Feeder振动任务
- // await management.ExecuteFeederWorks(Feeder, procedure.FeederWorks);
- // await Task.Delay(procedure.WaitFeederStop);
- // SendTaskMessage($"Feeder振动结束", MessageLevel.Info);
- // }
- // }
- // continue;
- // }
- // }
- // SendTaskMessage($"多次拍照失败,达到设定上限!", MessageLevel.Alarm);
- // callback.Invoke(new Tuple<bool, string[]>(true, new string[] { "NG,NoFind" }));
- // }
- // /// <summary>
- // /// 相机拍照,其他模式
- // /// </summary>
- // /// <param name="procedure"></param>
- // /// <param name="items"></param>
- // /// <param name="callback"></param>
- // private void RunProcedureOther(ProcedureModel procedure, string[] items, Action<Tuple<bool, string[]>> callback)
- // {
- // DateTime nowtime = DateTime.Now;
- // for (int i = 0; i < procedure.FeederFailLimit; i++)
- // {
- // SendTaskMessage($"开始执行【{i + 1}】视觉流程[{procedure.Name}]......", MessageLevel.Info);
- // //采集图像
- // var camera = management.CameraService.GetCamera(procedure.CameraId);
- // camera.SetExposureTime(procedure.ExposureTime);
- // camera.SetGain(procedure.Gain);
- // nowtime = DateTime.Now;
- // LogHelper.WriteLogInfo("开始采集图像");
- // procedure.ToolBlock.Inputs["InputImage"].Value = camera.Grab();
- // LogHelper.WriteLogInfo($"采集图像完成;用时:{(DateTime.Now - nowtime).Milliseconds}ms");
- // //运行视觉工具
- // procedure.ToolBlock.Run();
- // SendTaskMessage($"视觉流程[{procedure.Name}]执行结束!耗时:{procedure.ToolBlock.RunStatus.ProcessingTime:F1}ms", MessageLevel.Info);
- // CogToolBlockTerminalCollection outputCollection = procedure.ToolBlock.Outputs;
- // eventAggregator.GetEvent<RenderUpdateNotification>().Publish(new ShowRender()
- // {
- // CameraName = procedure.CameraName,
- // Id = procedure.CameraId,
- // Image = (ICogImage)procedure.ToolBlock.Inputs["InputImage"].Value,
- // Graphic = outputCollection["Graphic"].Value as CogGraphicCollection,
- // Result = (bool)(outputCollection["Found"].Value),
- // IsShow = true
- // });
- // DatabaseHelper.AddCameraRecords(management.CurrentProduct.Name, procedure.Name, outputCollection);
- // if (!outputCollection.Contains("Found"))
- // {
- // callback.Invoke(new Tuple<bool, string[]>(true, new string[] { "NG,NoOut[Found]" }));
- // return;
- // }
- // bool Found = (bool)(outputCollection["Found"].Value);
- // //拍照OK
- // if (Found)
- // {
- // SendTaskMessage($"拍照OK", MessageLevel.Debug);
- // if (procedure.ProcedureOutputs == null)
- // {
- // SendTaskMessage($"视觉流程未配置输出项!", MessageLevel.Alarm);
- // callback.Invoke(new Tuple<bool, string[]>(true, new string[] { "NG,NotOutputs" }));
- // return;
- // }
- // List<string> SendResults = new List<string>();
- // foreach (var output in procedure.ProcedureOutputs) //遍历配置的所有需要输出项
- // {
- // //根据输出类型进行区分输出
- // if (output.ValueType == typeof(string))
- // {
- // string[] strpoints = outputCollection[output.Name].Value.ToString().Split(";");
- // if (strpoints.Length <= 0)
- // {
- // continue;
- // }
- // //需要点位转换时,进行点位提取
- // if (output.IsPointTran)
- // {
- // int index = 0;
- // //获取校准
- // var calib = management.DeviceConfig.Calibrations.FirstOrDefault(cal => cal.Id == procedure.CalibrationId);
- // if (calib == null)
- // {
- // SendTaskMessage($"没有发现关联校准!", MessageLevel.Alarm);
- // callback.Invoke(new Tuple<bool, string[]>(true, new string[] { "NG,NotCalibrations" }));
- // return;
- // }
- // //得到校准的变换矩阵
- // Matrix<double> matrix = Matrix<double>.Build.DenseOfArray(calib.AffineTransformationMaterial);
- // StringBuilder sbpoints = new StringBuilder();
- // List<string> points = new List<string>();
- // foreach (var pos in strpoints)
- // {
- // string[] spl = pos.Split(',');
- // double x = double.Parse(spl[0]);
- // double y = double.Parse(spl[1]);
- // double angle = double.Parse(spl[2]);
- // if (calib.CameraMount == CameraMount.FixedDown || calib.CameraMount == CameraMount.MobileJ2 || calib.CameraMount == CameraMount.MobileJ4)
- // {
- // angle *= -1;
- // }
- // //将像素坐标转换成机器人坐标
- // var rpos = matrix * Vector<double>.Build.Dense(new double[] { x, y, 1 });
- // if (calib.CameraMount == TeamAAS_VP.Enums.CameraMount.MobileJ4)
- // {
- // if (items.Length < 4)
- // {
- // SendTaskMessage($"J4移动相机校准转换需要给入X,Y,U!", MessageLevel.Alarm);
- // callback.Invoke(new Tuple<bool, string[]>(true, new string[] { "NG,DataError" }));
- // return;
- // }
- // //像素直接转换成mm时的点位
- // double Robot_X, Robot_Y;
- // Robot_X = rpos[0];
- // Robot_Y = rpos[1];
- // //机器人当前TOOL 0下的坐标
- // double curpos_x = 0, curpos_y = 0, curpos_u = 0;
- // curpos_x = double.Parse(items[1]);
- // curpos_y = double.Parse(items[2]);
- // curpos_u = double.Parse(items[3]);
- // //得到旋转矩阵
- // double angle1 = Math.PI * (curpos_u - calib.MarkPoint.U) / 180;
- // // 创建T矩阵
- // Matrix<double> rotationMatrix = Matrix<double>.Build.DenseOfArray(new double[,]
- // {
- // { Math.Cos(angle1), -Math.Sin(angle1) },
- // { Math.Sin(angle1), Math.Cos(angle1) }
- // });
- // Vector<double> p3 = Vector<double>.Build.Dense(new double[] { Robot_X - calib.CalibPoints[0].Robot.X, Robot_Y - calib.CalibPoints[0].Robot.Y });
- // Vector<double> phere = Vector<double>.Build.Dense(new double[] { curpos_x, curpos_y });
- // var cc = rotationMatrix * p3 + phere;
- // rpos = Vector<double>.Build.Dense(new double[] { cc[0], cc[1] });
- // }
- // else
- // {
- // //当需要直接转换工具坐标时
- // if (items.Length == 4)
- // {
- // //根据机器人当前的点位计算工具坐标
- // ToolCoord tool = new ToolCoord();
- // tool.ComputeTool(double.Parse(items[1]), double.Parse(items[2]), double.Parse(items[3]), rpos[0], rpos[1]);
- // rpos = Vector<double>.Build.Dense(new double[] { tool.X, tool.Y });
- // }
- // }
- // index++;
- // if (index >= procedure.OutputPointCountMax)
- // {
- // points.Add($"{rpos[0]:F3},{rpos[1]:F3},{angle:F3}");
- // break;
- // }
- // else
- // {
- // points.Add($"{rpos[0]:F3},{rpos[1]:F3},{angle:F3}");
- // sbpoints.Append($"{rpos[0]:F3},{rpos[1]:F3},{angle:F3},");
- // }
- // }
- // SendResults.Add($"{points.Count},{string.Join(",", points)}");
- // }
- // //直接输出字符串
- // else
- // {
- // List<string> bu = new List<string>();
- // foreach (var item in strpoints)
- // {
- // bu.Add(item);
- // }
- // SendResults.Add($"{string.Join(",", bu)}");
- // }
- // }
- // else
- // {
- // SendResults.Add(outputCollection[output.Name].Value.ToString());
- // }
- // }
- // callback.Invoke(new Tuple<bool, string[]>(true, new string[] { $"OK,{string.Join(";", SendResults)}" }));
- // return;
- // }
- // //拍照NG
- // else
- // {
- // SendTaskMessage($"拍照NG", MessageLevel.Error);
- // continue;
- // }
- // }
- // SendTaskMessage($"多次拍照失败,达到设定上限!", MessageLevel.Alarm);
- // callback.Invoke(new Tuple<bool, string[]>(true, new string[] { "NG,NoFind" }));
- // }
- // public void SendTaskMessage(string msg, MessageLevel level)
- // {
- // eventAggregator.GetEvent<TaskMessageNotification>().Publish(new TeamAAS_VP.Models.MessageStruct() { Message = msg, level = level });
- // }
- //}
|