/******************** Video Source Events ***********************/ private void CameraFound() { lock (mutex) { if (CMSLogger.CanCreateLogEvent(false, false, false, "CMSLogCameraFoundEvent")) { CMSLogCameraFoundEvent cameraFoundEvent = new CMSLogCameraFoundEvent(); if (cameraFoundEvent != null) { CMSLogger.SendLogEvent(cameraFoundEvent); } } if (controllerState.Equals(CMSState.CameraNotFound)) { if (videoSource.StartSource()) { SetState(CMSState.Setup); model.CurrentMonikor = videoSource.GetCurrentMonikor(); } else { SetState(CMSState.CameraNotFound); } } else { throw new Exception("Received Camera Found in state " + controllerState.ToString()); } } }
/******************** Other Functions ****************/ private void SetState(CMSState state) { lock (mutex) { /* * if (state.Equals(CMSState.Tracking)) * { * videoDisplay.SetTrackingControlMessage(false, ""); * } * else if (state.Equals(CMSState.ControlTracking)) * { * videoDisplay.SetTrackingControlMessage(true, ""); * } * else if (state.Equals(CMSState.Setup)) * { * videoDisplay.ReceiveMessage("", Color.Black); * //videoDisplay.SetTrackingControlMessage(false, false); * }*/ controllerState = state; CMSTrackingSuite curSuite = model.SelectedSuite; if (curSuite != null) { curSuite.StateChange(state); } if (CMSLogger.CanCreateLogEvent(false, false, false, "CMSLogStateChangeEvent")) { CMSLogStateChangeEvent stateChangeEvent = new CMSLogStateChangeEvent(); stateChangeEvent.State = state.ToString(); CMSLogger.SendLogEvent(stateChangeEvent); } } }