/// <summary>Attach to channel and connect any event handlers</summary> /// <returns>Connection status</returns> private Channels.EConnectionState ChannelsAttach() { try { if (mChannels != null) { Channels.EConnectionState State = mChannels.Connect(); if (State == Channels.EConnectionState.Connected) // Open channels { // Attach event handlers (as required) if (mChannels.Application != null) { mChannels.Application.mEventSubscriptionHeartbeat.Event += new EventHandler <CommunicationsChannel_Application.EventArgsHeartbeat>(EventHandlerHeartbeatApp); } if (mChannels.ImageProcessing != null) { mChannels.ImageProcessing.mEventSubscriptionHeartbeat.Event += new EventHandler <CommunicationsChannel_ImageProcessing.EventArgsHeartbeat>(EventHandlerHeartbeatIP); mChannels.ImageProcessing.mEventSubscriptionImageProcessing.Event += new EventHandler <CommunicationsChannel_ImageProcessing.EventArgsIPEvent>(EventHandlerIPEvent); } } return(State); } } catch (Exception ex) { AppLog.LogException(ex); } return(Channels.EConnectionState.Error); }
/// <summary>Attach to channel and connect any event handlers</summary> /// <returns>Connection status</returns> private Channels.EConnectionState ChannelsAttach() { try { if (mChannels != null) { Channels.EConnectionState State = mChannels.Connect(); if (State == Channels.EConnectionState.Connected) // Open channels { // Attach event handlers (as required) if (mChannels.Application != null) { mChannels.Application.mEventSubscriptionHeartbeat.Event += new EventHandler <CommunicationsChannel_Application.EventArgsHeartbeat>(EventHandlerHeartbeatApp); } if (mChannels.Manipulator != null) { mChannels.Manipulator.mEventSubscriptionHeartbeat.Event += new EventHandler <CommunicationsChannel_Manipulator.EventArgsHeartbeat>(EventHandlerHeartbeatMan); mChannels.Manipulator.mEventSubscriptionManipulatorMove.Event += new EventHandler <CommunicationsChannel_Manipulator.EventArgsManipulatorMoveEvent>(EventHandlerManipulatorMoveEvent); } } return(State); } } catch (Exception ex) { AppLog.LogException(ex); } return(Channels.EConnectionState.Error); }
/// <summary>Attach to channel and connect any event handlers</summary> /// <returns>Connection status</returns> private Channels.EConnectionState ChannelsAttach() { try { if (mChannels != null) { Channels.EConnectionState State = mChannels.Connect(); if (State == Channels.EConnectionState.Connected) // Open channels { // Attach event handlers (as required) if (mChannels.Application != null) { mChannels.Application.mEventSubscriptionHeartbeat.Event += new EventHandler <CommunicationsChannel_Application.EventArgsHeartbeat>(EventHandlerHeartbeatApp); } if (mChannels.Xray != null) { mChannels.Xray.mEventSubscriptionHeartbeat.Event += new EventHandler <CommunicationsChannel_XRay.EventArgsHeartbeat>(EventHandlerHeartbeatXRay); mChannels.Xray.mEventSubscriptionEntireStatus.Event += new EventHandler <CommunicationsChannel_XRay.EventArgsXRayEntireStatus>(EventHandlerXRayEntireStatus); } } return(State); } } catch (Exception ex) { AppLog.LogException(ex); } return(Channels.EConnectionState.Error); }