public ProbeConnectionForm()
 {
     InitializeComponent();
     _lightControlManager = new CCSLightControlManager();//DeviceController.GetCCSLightControlManagerInstance();
     _lightControlManager.On_ProbeConnectionWorked += _lightControlManager_On_Disconnected;
     _lightControlManager.On_SafetyClosed += _lightControlManager_On_SafetyClosed;
 }
        private void init(CCSLightControlManager manager, int interval)
        {
            _manager = manager;
            _manager.On_ReceivedData += _manager_On_ReceivedData;

            _timer = new System.Windows.Forms.Timer();
            _timer.Interval = interval;
            _timer.Tick += _timer_Tick;

            _messageStack = new List<object>();
        }
 public static CCSLightControlManager GetCCSLightControlManagerInstance()
 {
     if (_lightControlManager == null)
     {
         _lightControlManager = new CCSLightControlManager();
     }
     else
     {
         _lightControlManager.RemoveAllRegisterEvent();
     }
     _lightControlInstanceUsed = (_lightControlManager != null);
     return _lightControlManager;
 }
        private void CCSLightControlForm_Load(object sender, EventArgs e)
        {
            CCSLightControlForm_LocationChanged(sender, e);
            _lightControlManager = DeviceController.GetCCSLightControlManagerInstance();
            _lightControlManager.On_SafetyClosed += _lightControlManager_On_SafetyClosed;
            _lightControlManager.StartProbeConnetion(_heartbeatInterval);

            _lightControlAssistant = new CCSLightControlAssistant(_lightControlManager);
            initializeLightControl();
        }
 public static void ReleaseCCSLightControlManagerInstance()
 {
     _lightControlInstanceUsed = false;
     _lightControlManager = null;
 }
        private void CCSLightControlForm_Load(object sender, EventArgs e)
        {
            CCSLightControlForm_LocationChanged(sender, e);
            _lightControlManager = new CCSLightControlManager();
            _lightControlManager.On_SafetyClosed += _lightControlManager_On_SafetyClosed;
            if (_configModel.HeartBeatEnable)
                _lightControlManager.StartProbeConnetion(_configModel.HeartBeatInterval);

            _lightControlAssistant = new CCSLightControlAssistant(_lightControlManager);
            initializeLightControl();
        }
 /// <summary>
 /// CCSLightControlAssistant
 /// </summary>
 /// <param name="manager">CCSLightControlManager</param>
 /// <param name="checkInterval">ms</param>
 public CCSLightControlAssistant(CCSLightControlManager manager, int checkInterval)
 {
     init(manager, checkInterval);
 }
 /// <summary>
 /// CCSLightControlAssistant
 /// </summary>
 /// <param name="manager">CCSLightControlManager</param>
 public CCSLightControlAssistant(CCSLightControlManager manager)
 {
     init(manager, _interval);
 }