/// <summary>
        /// Creates a new session based on the supplied task
        /// </summary>
        /// <param name="task"></param>
        private void CreateNewSession(Task task)
        {
            if (CurrentClinician.ScheduleSessions)
            {
                Session newSession = new Session();

                newSession.Task = task;
                newSession.Clinician = CurrentClinician.NameString;

                // Add
                _patient.AddSession(newSession);
                _remote_DataManager.ClientUpdatePatient(_patient, _selectedPatientIndex);
                _remote_DataManager.ClientRequestUpdatedPatientList();
                FillInListViewSessions();

                if(session_Details_Control.Visible)
                    buttonBack_Click(null, null);
            }
            else
                MessageBox.Show(StroMoHab_Client.Properties.Settings.Default.InvalidPermissionsString, "StroMoHab Client", MessageBoxButtons.OK, MessageBoxIcon.Error);


        }
Пример #2
0
 /// <summary>
 /// Adds a sesion
 /// </summary>
 /// <param name="session"></param>
 public void AddSession(Session session)
 {
     _sessions.Add(session);
 }
        /// <summary>
        /// Gets ready to play back a session
        /// </summary>
        /// <param name="patientIndex"></param>
        /// <param name="sessionIndex"></param>
        /// <param name="subSessionIndex"></param>
        static void Patient_Remote_DataManager_OpenSessionForPlaybackRequestedByClient(int patientIndex, int sessionIndex, int subSessionIndex)
        {
            

            //use the indexes to load the correct subsession
            _currentSession = _patients[patientIndex].Sessions[sessionIndex];
            _currentSubSessionIndex = subSessionIndex;
            _currentSubSession = _currentSession.SubSessions[_currentSubSessionIndex];

            //Check the motion capture data is present on disk, if it is, open the subsession, else mark it as not pressent
            if(System.IO.File.Exists(VirtualMotionCaptureController.BuildSubSessionFileName(_currentSubSession.SubSessionStartTime)))
            {
                VirtualMotionCaptureController.OpenMotionCaptureSubSession(_currentSubSession.SubSessionStartTime);
            }
            else
            {
                //data isn't availiable
                _currentSession.MotionCaptureDataRecorded = false;
                _currentSession.SubSessions[_currentSubSessionIndex] = _currentSubSession;
                _patients[_patientIndex].Sessions[_currentSessionIndex] = _currentSession;
                Patient_Remote_DataManager_UpdatePatientRequestedByClient(_patients[_patientIndex], _patientIndex);
            }
        }
 /// <summary>
 /// Deletes the MC data associated with the given session
 /// </summary>
 /// <param name="session"></param>
 private static void DeleteMotionCaptureDataForSession(Session session)
 {
     foreach (SubSession sub in session.SubSessions)
     {
         if (File.Exists(VirtualMotionCaptureController.BuildSubSessionFileName(sub.SubSessionStartTime)))
             File.Delete(VirtualMotionCaptureController.BuildSubSessionFileName(sub.SubSessionStartTime));
     }
 }
 /// <summary>
 /// Starts or stops recording. Must call Patient_Remote_DataManager_PrepareToRecordNewSessionRequestedByClient first
 /// </summary>
 /// <param name="active"></param>
 static void Patient_Remote_DataManager_ChangeRecordStatusRequestedByClient(bool active)
 {
     if (active)
     {
         _currentSession = _patients[_patientIndex].Sessions[_currentSessionIndex];
         StartRecording();
     }
     else
     {
         StopRecording();
     }
 }