/// <summary> /// Imports all controllers from the specified path and port /// and searchs for user defined interfaces for each controller. /// </summary> public void ImportAllControllers(IList <string> userDefinedInterfaces) { _logger.Debug(string.Format("Import controller tree skeleton on '{0}:{1}'", _adsAddress, _adsPort)); _alarmsImporter.ImportAlarms(); IReadOnlyCollection <IControllerTag> controllerTags = _findControllerTags.FindControllerTags(); if (controllerTags.IsNullOrEmpty()) { return; } IControllerTag anyControllerTag = controllerTags.First(); _tagListener.AddUdtHandler <CtrlCommonInterface>(anyControllerTag.GetCommonInterfaceDataType()); foreach (IControllerTag controllerTag in controllerTags) { Tag commonInterfaceTag = controllerTag.GetCommonInterfaceTag(); if (commonInterfaceTag != null) { _tagListener.ReadTagSynchronously(commonInterfaceTag); } } Controller controller = ImportControllerWithChildren(_rootController, controllerTags, userDefinedInterfaces, MaxChildImportDepth); _controllerTree.Initialize(controller); _alarmsImporter.AlarmsChanged += alarms => _controllerTree.UpdateAlarms(alarms); _controllerTree.UpdateAlarms(_alarmsImporter.GetAllImportedAlarms()); _logger.Debug(string.Format("Finished import of controller skeleton tree on '{0}:{1}'", _adsAddress, _adsPort)); }
/// <summary> /// Initializes a new <see cref="AlarmImporterAlarmsManagerPlugin"/> instance. /// </summary> /// <param name="alarmsImporter">The alarms importer to import the alarms from.</param> public AlarmImporterAlarmsManagerPlugin(IAlarmsImporter alarmsImporter) { _alarmsImporter = alarmsImporter; _alarmsImporter.ImportAlarms(); AlarmAdded += _ => { }; }