Specifications.java 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. package model;
  2. import java.util.Arrays;
  3. import java.util.List;
  4. /**
  5. * Lists the specification. Used for the Android app. Template:
  6. * Name:[Object name, shown on top of the app]
  7. * Shape:[object's shape and position][...]...
  8. * Contact:[shape and position of the conductive part]
  9. * ButtonTrue:[message that appears below the object on the app if the object did change its state]
  10. * ButtonFalse:[initial message that stays if the object didn't change its state]
  11. *
  12. * Shape information: rectangle: [R; x position from the object's middle; y position; width; height;]
  13. * circle: [C; x position; y position; diameter]
  14. * position and size in millimeter. E.g.: [R;5;5;20;20]
  15. * @author Martin Herbers
  16. *
  17. */
  18. public class Specifications {
  19. public static List<String> getSqueezeSpecs() {
  20. return Arrays.asList(
  21. "Name:Pressure",
  22. "Shape:[C;0;0;26][R;0;" + (Settings.getSettings().getSizeScreen() + 12) + ";" + (Settings.getSettings().getSizeScreen() + 4) + ";" + (Settings.getSettings().getSizeScreen() + 4) + "]",
  23. "Contact:[R;0;" + (Settings.getSettings().getSizeScreen() + 12) + ";" + Settings.getSettings().getSizeScreen() + ";" + Settings.getSettings().getSizeScreen() + "]",
  24. "ButtonTrue:The object got squeezed!",
  25. "ButtonFalse:The object didn't get squeezed."
  26. );
  27. }
  28. public static List<String> getWeightSpecs() {
  29. return Arrays.asList(
  30. "Name:Load " + (Settings.getSettings().getWeight()/10.0f) + "kg",
  31. "Shape:[R;0;0;20;61]",
  32. "Contact:[C;0;1;" + Settings.getSettings().getSizeScreen() + "]",
  33. "ButtonTrue:A weight of more than " + (Settings.getSettings().getWeight()/10.0f) + " Kg was applied!",
  34. "ButtonFalse:A weight of less than " + (Settings.getSettings().getWeight()/10.0f) + " Kg was applied."
  35. );
  36. }
  37. public static List<String> getTemperatureMeltSpecs() {
  38. return Arrays.asList(
  39. "Name:Rising Temperature",
  40. "Shape:[R;0;0;20;42][R;0;-20;10;2]",
  41. "Contact:[C;0;3;" + Settings.getSettings().getSizeScreen() + "]",
  42. "ButtonTrue:The object was stored above 0�C!",
  43. "ButtonFalse:The object was cooled the whole time."
  44. );
  45. }
  46. public static List<String> getTemperatureFreezeSpecs() {
  47. return Arrays.asList(
  48. "Name:Falling Temperature",
  49. "Shape:[R;0;0;20;43][C;10;-8;6]",
  50. "Contact:[C;0;7;" + Settings.getSettings().getSizeScreen() + "]",
  51. "ButtonTrue:The object was stored below 0�C!",
  52. "ButtonFalse:The object was above 0�C the whole time."
  53. );
  54. }
  55. public static List<String> getAccelerationSpecs() {
  56. return Arrays.asList(
  57. "Name:Acceleration " + Settings.getSettings().getAcceleration() + "m/s�",
  58. "Shape:[R;0;0;20;40][C;0;-10;6][C;0;10;6]",
  59. "Contact:[C;0;10;" + Settings.getSettings().getSizeScreen() + "]",
  60. "ButtonTrue:The object was accelerated with " + Settings.getSettings().getAcceleration() + "m/s�!",
  61. "ButtonFalse:The object was accelerated with less than " + Settings.getSettings().getAcceleration() + "m/s�."
  62. );
  63. }
  64. public static List<String> getFlipSpecs() {
  65. return Arrays.asList(
  66. "Name:Flip",
  67. "Shape:[C;0;0;34]",
  68. "Contact:[C;0;0;" + Settings.getSettings().getSizeScreen() + "]",
  69. "ButtonTrue:The object got flipped!",
  70. "ButtonFalse:The object didn't get flipped."
  71. );
  72. }
  73. public static List<String> getTiltSpecs() {
  74. return Arrays.asList(
  75. "Name:Tilt",
  76. "Shape:[R;0;0;18;30]",
  77. "Contact:[C;0;8;" + Settings.getSettings().getSizeScreen() + "]",
  78. "ButtonTrue:The object got tilted!",
  79. "ButtonFalse:The object didn't get tilted."
  80. );
  81. }
  82. //ADD CODE HERE FOR ADDITIONAL INTERACTION
  83. //New function that returns the specification as listed in the top comment in a List of Stings
  84. }