public bool GetStartService() { try { var xmlFile = objChannelManager.ReadKey(objChannelManager.XML_NAME_DEFAULT); if (string.IsNullOrEmpty(xmlFile) || string.IsNullOrWhiteSpace(xmlFile)) { return(false); } lock (mutex) { objChannelManager.Channels.Clear(); TagCollection.Tags.Clear(); var channels = objChannelManager.GetChannels(xmlFile); driverHelper.InitializeService(channels); driverHelper.Connect(); return(true); } } catch (Exception ex) { var err = new HMIException.ScadaException(GetType().Name, ex.Message); } return(true); }
public bool GetStartService() { var objChannelManager = ChannelService.GetChannelManager(); try { var xmlFile = objChannelManager.ReadKey(objChannelManager.XML_NAME_DEFAULT); if (string.IsNullOrEmpty(xmlFile) || string.IsNullOrWhiteSpace(xmlFile)) { return(false); } objChannelManager.Channels.Clear(); TagCollection.Tags.Clear(); var channels = objChannelManager.GetChannels(xmlFile); driverHelper.InitializeService(channels); driverHelper.Connect(); return(true); } catch (Exception ex) { EventscadaException?.Invoke(this.GetType().Name, ex.Message); } return(true); }