void movement_time_Tick(object sender, EventArgs e) { //displays current movement gesture to screen //could implement voice and animation screen for this in the future if (current_movement_tick == 0) { this.Accelerometer_output.Text = "Move up"; } else if (current_movement_tick == 1) { this.Accelerometer_output.Text = "Move down"; } else if (current_movement_tick == 2) { this.Accelerometer_output.Text = "Move left"; } else if (current_movement_tick == 3) { this.Accelerometer_output.Text = "Move right"; } else if (current_movement_tick == 4) { //adds the info to the database Motion_Test_Info newMotionInfo = new Motion_Test_Info { calibratedX = peakRotationX, calibratedY = peakRotationY, calibratedZ = peakRotationZ }; Motion_Info.Add(newMotionInfo); motionDB.Motion_Test_Information.InsertOnSubmit(newMotionInfo); //in this section I would also run a check to see if the user has rotated the phone //to much by checking his peakRotation's with the one calibrated and in the database //of course including a slight margin of error. This part however would require extensive //testing both by sober and non-sober persons and are as not yet implemented, including the //problem of accessing the database items which I still haven't fixed. this.NavigationService.Navigate(new Uri("/ResultPage.xaml?result=True", UriKind.Relative)); } current_movement_tick++; }
void movement_time_Tick(object sender, EventArgs e) { //displays current movement gesture to screen //could implement voice and animation screen for this in the future if(current_movement_tick == 0) { this.Accelerometer_output.Text = "Move up"; } else if (current_movement_tick == 1) { this.Accelerometer_output.Text = "Move down"; } else if (current_movement_tick == 2) { this.Accelerometer_output.Text = "Move left"; } else if (current_movement_tick == 3) { this.Accelerometer_output.Text = "Move right"; } else if (current_movement_tick == 4) { //adds the info to the database Motion_Test_Info newMotionInfo = new Motion_Test_Info { calibratedX = peakRotationX, calibratedY = peakRotationY, calibratedZ = peakRotationZ }; Motion_Info.Add(newMotionInfo); motionDB.Motion_Test_Information.InsertOnSubmit(newMotionInfo); //in this section I would also run a check to see if the user has rotated the phone //to much by checking his peakRotation's with the one calibrated and in the database //of course including a slight margin of error. This part however would require extensive //testing both by sober and non-sober persons and are as not yet implemented, including the //problem of accessing the database items which I still haven't fixed. this.NavigationService.Navigate(new Uri("/ResultPage.xaml?result=True", UriKind.Relative)); } current_movement_tick++; }