Exemplo n.º 1
0
        private void ConnectAndStartSession()
        {
            ipAddress  = IPAddress.Parse("144.32.137.126");
            portNumber = int.Parse("8001");
            IPEndPoint ipEndPoint = new IPEndPoint(ipAddress, portNumber);

            try
            {
                TCPProcessor.ConnectToServer(ipEndPoint);
            }
            catch
            {
                MessageBox.Show("Connection to server failed");
            }

            if (ipAddress != null)
            {
                SendMCECommand.StartCameras();
            }
            else
            {
                MessageBox.Show("Connection to server failed");
            }

            btnStartTreadmill.Enabled = true;
            //nudElevation.Enabled = true;
            nudSpeed.Enabled = true;
            //btnDisengage.Enabled = true;
            btnReset.Enabled      = true;
            btnEndSession.Enabled = true;
        }
Exemplo n.º 2
0
 private void nudSpeed_ValueChanged(object sender, EventArgs e)
 {
     if (btnStartTreadmill.Text == "Stop Treadmill")
     {
         SendMCECommand.SetTreadmillSpeed((float)nudSpeed.Value);
     }
 }
Exemplo n.º 3
0
 private void StartAll()
 {
     if (btnStartTreadmill.Text == "Start Treadmill")
     {
         if (plotFeet != null)
         {
             plotFeet.Dispose();
         }
         //SendMCECommand.Calibrate();
         //SendMCECommand.SetTreadmillSpeed((float)nudSpeed.Value);
         //feetSound.Enabled = true;
         btnStartTreadmill.Text = "Stop Treadmill";
         if (chkLink.Checked == true)
         {
             if (chkDelayStart.Checked == true)
             {
                 timer1.Enabled = true;
             }
             else
             {
                 StartData();
             }
         }
     }
     else
     {
         SendMCECommand.SetTreadmillSpeed(0.0F);
         btnStartTreadmill.Text = "Start Treadmill";
         StopData();
         timer1.Enabled = false;
         //asymmetryAnalyser.Enabled = false;
         //feetSound.Enabled = false;
     }
 }
Exemplo n.º 4
0
        /// <summary>
        /// The contructor
        /// </summary>
        public GUI()
        {
            InitializeComponent();

            SendMCECommand.StartCameras();

            //Set screen docks, add and hide them
            clinican_Login_Screen.Dock = DockStyle.Fill;
            this.Controls.Add(clinican_Login_Screen);


            _progressBarHiderTimer.Interval = 500;
            _progressBarHiderTimer.Tick    += new EventHandler(_progressBarHiderTimer_Tick);

            Patient_Screen.HideForm += new Patient_Screen.HideFormEventHandler(Patient_Screen_HideForm);

            //Register for events for screen load and close
            Clinician_Login_Screen.Login       += new Clinician_Login_Screen.LoginEventHandler(Clinician_Login_Screen_Login);
            Patient_Records_Screen.Logout      += new Patient_Records_Screen.LogoutEventHandler(Patient_Records_Screen_Logout);
            Patient_Records_Screen.OpenPatient += new Patient_Records_Screen.OpenPatientEventHandler(Patient_Records_Screen_OpenPatient);
            Patient_Screen.ClosePatient        += new Patient_Screen.ClosePatientEventHandler(Patient_Screen_ClosePatient);
            Clinician_Records_Screen.Logout    += new Clinician_Records_Screen.LogoutEventHandler(Clinician_Records_Screen_Logout);

            //register for events for status bar updates
            Patient_Records_Screen.SetProgressBarValue += new Patient_Records_Screen.SetProgressBarValueEventHandler(Patient_Records_Screen_SetProgressBarValue);
            Patient_Records_Screen.SetStatusLabelValue += new Patient_Records_Screen.SetStatusLabelValueEventHandler(Patient_Records_Screen_SetStatusLabelValue);
            Patient_Screen.SetProgressBarValue         += new Patient_Screen.SetProgressBarValueEventHandler(Patient_Screen_SetProgressBarValue);
            Patient_Screen.SetStatusLabelValue         += new Patient_Screen.SetStatusLabelValueEventHandler(Patient_Screen_SetStatusLabelValue);
        }
Exemplo n.º 5
0
 private void StartAll()
 {
     if (btnStartTreadmill.Text == "Start Treadmill")
     {
         btnStartTreadmill.Text = "Stop Treadmill";
         if (chkLink.Checked == true)
         {
             if (chkDelayStart.Checked == true)
             {
                 timer1.Enabled = true;
             }
             else
             {
                 StartData();
             }
         }
     }
     else
     {
         SendMCECommand.SetTreadmillSpeed(0.0F);
         btnStartTreadmill.Text = "Start Treadmill";
         StopData();
         timer1.Enabled = false;
     }
 }
Exemplo n.º 6
0
 private void frmUI_FormClosing(object sender, FormClosingEventArgs e)
 {
     //personDataList.Add(person.SerialData);//this saves the last person into the list ie. others are saved on entry of new person
     SavePersonData(); //save/serialize personDataList
     sound.EndCurrentEnvironment();
     SendMCECommand.StopTreadmill();
     Application.Exit();
 }
Exemplo n.º 7
0
        private void StartData()
        {
            SendMCECommand.Calibrate();
            TestSubject person = new TestSubject("Me", "111", "Male", 20, markerHeightCal);

            dataCollection = new TightropeData(person, "Test1", 1);
            sound          = new ALSoundEnvironment(person);
            SendMCECommand.SetTreadmillSpeed((float)nudSpeed.Value);
        }
Exemplo n.º 8
0
        private void ConnectAndStartSession()
        {
            TCPProcessor.ManagedConnectToServer();
            SendMCECommand.StartCameras();

            //btnStartTreadmill.Enabled = true;

            nudSpeed.Enabled = true;
        }
Exemplo n.º 9
0
 private void frmUI_FormClosing(object sender, FormClosingEventArgs e)
 {
     SendMCECommand.StopTreadmill();
     if (plotFeet != null)
     {
         plotFeet.Dispose();
     }
     Application.Exit();
 }
Exemplo n.º 10
0
 private void StartData()
 {
     SendMCECommand.Calibrate();
     file           = new StreamWriter(@"D:/Test/tightrope.csv", false);
     dataCollection = new TightropeData(file, markerHeightCal);
     SendMCECommand.SetTreadmillSpeed((float)nudSpeed.Value);
     //feetSound.Enabled = true;
     plotFeet = new ZedGraphPlotForm();
     plotFeet.ContinuePlotting = true;
     //asymmetryAnalyser.Enabled = true;
 }
Exemplo n.º 11
0
 private void btnVisualFeedback_Click(object sender, EventArgs e)
 {
     if (btnVisualFeedback.Text == "Start visual feedback")
     {
         btnVisualFeedback.Text = "Stop visual feedback";
         SendMCECommand.SetTreadmillSpeed((float)nudSpeed.Value);
         System.Diagnostics.Debug.WriteLine("Speed sent:" + ((float)nudSpeed.Value).ToString());
     }
     else
     {
         btnVisualFeedback.Text = "Start visual feedback";
         SendMCECommand.SetTreadmillSpeed(0.0F);
     }
 }
Exemplo n.º 12
0
        private void StopData()
        {
            SendMCECommand.SetTreadmillSpeed(0.0F);
            timer1.Enabled = false;
            guiUpdate.Stop();
            dataCollection.DataEventCleanUp();
            allPositionData.MarkerDataCollectionCleanUp();
            person.StopTestFrameReceiveEvent();
            //person.Right.FootCleanUp();
            //person.Left.FootCleanUp();
            //person.Left = null;
            //person.Right = null;
            System.Diagnostics.Debug.WriteLine("End of session.");
            if (cbTestID.Text == "Sound")
            {
                sound.StopUpdate = true;
                if (cbDiscrete.Checked)
                {
                    sound.DiscreteFootDown_Off();
                }
                sound.FootDown = false;
                sound.StopPlaying();
                //sound.EndCurrentEnvironment();
            }
            btnStartTreadmill.Text = "Start task";
            if (!Directory.Exists(txtFileName.Text))
            {
                FolderSetup();
            }
            dataCollection.ToFile();
            dataCollection.WriteRawFeetData();
            allPositionData.FileMarkerListPositionData();
            allPositionData.FileMarkerListPositionData_CSV();
            //dataCollection.WriteAccuracyData();
            startTime      = 0;
            Foot.Frontfoot = null;

            person.PersonData.AddFileName(txtFileName.Text);
            lbFileNames.Items.Add(txtFileName.Text);
            int tmp = int.Parse(txtTestNumber.Text);

            tmp++;
            txtTestNumber.Text        = tmp.ToString();
            txtFileName.Text          = cbTestID.Text + @"\" + cbTestID.Text + "_" + txtTestNumber.Text + "_" + person.PersonData.PersonID;
            btnSavePersonData.Enabled = true;
        }
Exemplo n.º 13
0
        private void StartData()
        {
            //if (CalibrateFeet() == true)//check that no exception occurred during feet calibtation
            {
                btnStartTreadmill.Text = "Stop task";
                string fileID = fbdPath.SelectedPath + @"\" + txtFileName.Text;
                if (person.Left != null)
                {
                    startTime       = person.Left.CurrentMarker.TimeStamp;
                    dataCollection  = new TightropeData(person, fileID, startTime);
                    allPositionData = new MarkerDataCollection(fileID);

                    //wait here for WFRE/Frontfoot to be not null
                    if (cbTestID.Text == "Sound")
                    {
                        sound.Left  = person.Left;
                        sound.Right = person.Right;
                        if (cbDiscrete.Checked)
                        {
                            sound.FootDown = true;
                            sound.DiscreteFootDown_On();
                        }
                        else
                        {
                            sound.FootDown = false;
                        }
                        if (cbFrequency.Checked)
                        {
                            sound.StartSound();
                        }
                    }
                    person.NewTestFrameReceiveEvent();
                    SendMCECommand.SetTreadmillSpeed((float)nudSpeed.Value);
                    timer1.Interval = testlength;
                    timer1.Enabled  = true;
                    guiUpdate.Start();
                }
            }
        }
Exemplo n.º 14
0
        /// <summary>
        /// Main Task Designer Form.
        /// </summary>
        public TaskDesigner()
        {
            InitializeComponent();
            TCPProcessor.ManagedConnectToServer();

            m_objectsToDraw = (StromoLight_RemoteDrawingList.DrawingList)Activator.GetObject(typeof(StromoLight_RemoteDrawingList.DrawingList), "tcp://localhost:8002/TaskDesignerConnection");
            m_prevHeight    = this.numericUpDownObjectHeight.Value;



            SendMCECommand.StartCameras();
            //Set up getting tasks from server
            if (TCPProcessor.ConnectedToServer)
            {
                _remote_DataManager = (Task_Remote_DataManager)Activator.GetObject(typeof(Task_Remote_DataManager), TCPProcessor.BuildServerRemotingString(8005, "TaskRemoteDataManagerConnection"));
            }

            //make the default task
            _defaultTask = new Task();
            Corridor corridor = new Corridor(-1.5f, 0.0f, 4.0f, 1.5f, 6.0f, -500.0f);

            _defaultTask.ObjectList.Add(corridor);
        }
Exemplo n.º 15
0
 private void btnReset_Click(object sender, EventArgs e)
 {
     SendMCECommand.StopTreadmill();
     nudSpeed.Value     = 0;
     nudElevation.Value = 0;
 }
Exemplo n.º 16
0
 private void frmUI_FormClosing(object sender, FormClosingEventArgs e)
 {
     SendMCECommand.StopTreadmill();
     Application.Exit();
 }
Exemplo n.º 17
0
 private void Connect()
 {
     TCPProcessor.ManagedConnectToServer();
     SendMCECommand.StartCameras();
 }