Condition.xaml.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Shapes;
  14. namespace VTExperiment1
  15. {
  16. /// <summary>
  17. /// Interaction logic for Condition.xaml
  18. /// </summary>
  19. public partial class Condition : Window
  20. {
  21. bool PFilled = false;
  22. bool BLFilled = false;
  23. bool OFilled = false;
  24. public Condition()
  25. {
  26. InitializeComponent();
  27. foreach (string s in Enum.GetNames(typeof(BodyLocations)))
  28. BodyLocationBox.Items.Add(s);
  29. foreach (string s in Enum.GetNames(typeof(Orientations)))
  30. OrientationBox.Items.Add(s);
  31. }
  32. private void SaveButton_Click(object sender, RoutedEventArgs e)
  33. {
  34. Logger.logger = new LogWriter(ParticipantTextField.Text, BodyLocationBox.SelectedValue.ToString() , OrientationBox.SelectedValue.ToString());
  35. Close();
  36. }
  37. private void ParticipantTextField_TextChanged(object sender, TextChangedEventArgs e)
  38. {
  39. PFilled = true;
  40. if (PFilled & BLFilled & OFilled)
  41. SaveButton.IsEnabled = true;
  42. }
  43. private void BodyLocationBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
  44. {
  45. BLFilled = true;
  46. if (PFilled & BLFilled & OFilled)
  47. SaveButton.IsEnabled = true;
  48. }
  49. private void OrientationBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
  50. {
  51. OFilled = true;
  52. if (PFilled & BLFilled & OFilled)
  53. SaveButton.IsEnabled = true;
  54. }
  55. }
  56. public static class Logger
  57. {
  58. public static LogWriter logger;
  59. }
  60. enum BodyLocations
  61. {
  62. Wrist,
  63. Forearm,
  64. UpperArm,
  65. Back,
  66. Stomach,
  67. Thigh,
  68. Leg
  69. }
  70. enum Orientations
  71. {
  72. Along,
  73. Round
  74. }
  75. }