| | |
| | | |
| | | namespace LB_SmartVision.ProcessRun |
| | | { |
| | | public delegate void ProcessRunBllRun(); |
| | | |
| | | public class ProcessRunBll |
| | | { |
| | | |
| | |
| | | process.Load(ProcessPath); |
| | | process.strProcessName = ProcessName; |
| | | |
| | | //if (process is VisionProTool && Tool.ContainsChinese(ProcessName)) |
| | | // MessageBox.Show($"VisionPro工具不支持命名为中文:{ProcessName}", "异常"); |
| | | |
| | | if (process is ScriptTool script) |
| | | { |
| | | if (script.Params.Outputs.Count <= 0) |
| | |
| | | { |
| | | dicInputsMapping.TryAdd(name, new List<Tuple<string, string>>()); |
| | | dicInputsMapping[name].Add(new Tuple<string, string>(name + ".Inputs.Image", "")); |
| | | //dicInputsMapping[name].Add(new Tuple<string, string>(name + ".Inputs.Fixture", "")); |
| | | |
| | | foreach (var item in process.Params.Inputs) |
| | | dicInputsMapping[name].Add(new Tuple<string, string>(name + ".Inputs." + item.Name, "")); |
| | |
| | | dicOutputsMapping[name].Add(name + ".Outputs.Image"); |
| | | dicOutputsMapping[name].Add(name + ".Outputs.Record"); |
| | | dicOutputsMapping[name].Add(name + ".Outputs.Result"); |
| | | //dicOutputsMapping[name].Add(name + ".Outputs.Fixture"); |
| | | |
| | | foreach (var item in process.Params.Outputs) |
| | | dicOutputsMapping[name].Add(name + ".Outputs." + item.Name); |
| | |
| | | double total_OK; |
| | | double total_NG; |
| | | |
| | | /// <summary> |
| | | /// 轮胎级统计 - OK计数 |
| | | /// </summary> |
| | | double tyre_OK; |
| | | /// <summary> |
| | | /// 轮胎级统计 - NG计数 |
| | | /// </summary> |
| | | double tyre_NG; |
| | | |
| | | public double total |
| | | { |
| | | get { return total_OK + total_NG; } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 轮胎总数 |
| | | /// </summary> |
| | | public double tyreTotal |
| | | { |
| | | get { return tyre_OK + tyre_NG; } |
| | | } |
| | | |
| | | public double Rate_OK |
| | |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 轮胎良品率 |
| | | /// </summary> |
| | | public double TyreRate_OK |
| | | { |
| | | get |
| | | { |
| | | if (tyreTotal == 0) |
| | | return 100; |
| | | return (tyre_OK / tyreTotal) * 100; |
| | | } |
| | | } |
| | | |
| | | public void ClearTotal() |
| | | { |
| | | total_OK = 0; |
| | | total_NG = 0; |
| | | tyre_OK = 0; |
| | | tyre_NG = 0; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 添加轮胎统计 |
| | | /// </summary> |
| | | /// <param name="isOK">轮胎是否OK</param> |
| | | public void AddTyreResult(bool isOK) |
| | | { |
| | | if (isOK) |
| | | tyre_OK++; |
| | | else |
| | | tyre_NG++; |
| | | } |
| | | |
| | | /// <summary> |