| | |
| | | #endregion |
| | | |
| | | #region Halcon算子设置 |
| | | private void InitialHalconTool() |
| | | protected virtual void InitialHalconTool() |
| | | { |
| | | foreach (HDevEngineTool tool in _halconToolDict.Values) |
| | | { |
| | |
| | | { |
| | | toolPath.GetHalconToolPathList().ForEach(path => |
| | | { |
| | | if (!string.IsNullOrWhiteSpace(path)) |
| | | { |
| | | string directoryPath = Path.GetDirectoryName(path); |
| | | string fileName = Path.GetFileNameWithoutExtension(path); |
| | | |
| | | HDevEngineTool tool = new HDevEngineTool(directoryPath); |
| | | tool.LoadProcedure(fileName); |
| | | |
| | | //使用“|”作为间隔符 |
| | | _halconToolDict[monitorSet.Id + "|" + path] = tool; |
| | | } |
| | | LoadHalconTool(path, monitorSet.Id); |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | protected void LoadHalconTool(string algorithemPath, string prefix) |
| | | { |
| | | if (!string.IsNullOrWhiteSpace(algorithemPath)) |
| | | { |
| | | string directoryPath = Path.GetDirectoryName(algorithemPath); |
| | | string fileName = Path.GetFileNameWithoutExtension(algorithemPath); |
| | | |
| | | HDevEngineTool tool = new HDevEngineTool(directoryPath); |
| | | tool.LoadProcedure(fileName); |
| | | |
| | | //使用“|”作为间隔符 |
| | | _halconToolDict[prefix + "|" + algorithemPath] = tool; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | #endregion |
| | | |
| | | #region IMonitor监听 |
| | | protected virtual void OnMonitorInvoke(DateTime dt, string deviceId, IDevice sourceDevice, MonitorSet monitorSet) |
| | | protected virtual void OnMonitorInvoke(DateTime dt, string deviceId, IDevice sourceDevice, IMonitorSet monitorSet) |
| | | { |
| | | string methodCode = monitorSet.MethodCode; |
| | | |
| | |
| | | #endregion |
| | | |
| | | #region 报警和DownTime |
| | | ObservableCollection<WarningSet> _warningRemains = new ObservableCollection<WarningSet>(); |
| | | ObservableCollection<IWarningSet> _warningRemains = new ObservableCollection<IWarningSet>(); |
| | | |
| | | protected virtual void OnMonitorAlarm(DateTime dt, IDevice device, WarningSet warning) |
| | | protected virtual void OnMonitorAlarm(DateTime dt, IDevice device, IWarningSet warning) |
| | | { |
| | | if (warning.CurrentStatus) |
| | | { |