You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

397 lines
16KB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3. xmlns:app="http://schemas.android.com/apk/res-auto"
  4. xmlns:tools="http://schemas.android.com/tools"
  5. android:id="@+id/constr_layout"
  6. android:layout_width="match_parent"
  7. android:layout_height="match_parent"
  8. tools:context=".MainActivity">
  9. <LinearLayout
  10. android:layout_width="match_parent"
  11. android:layout_height="match_parent"
  12. android:layout_marginStart="8dp"
  13. android:layout_marginEnd="8dp"
  14. android:layout_marginBottom="8dp"
  15. android:orientation="vertical"
  16. app:layout_constraintBottom_toBottomOf="parent"
  17. app:layout_constraintEnd_toEndOf="parent"
  18. app:layout_constraintStart_toStartOf="parent"
  19. app:layout_constraintTop_toTopOf="parent">
  20. <LinearLayout
  21. android:layout_width="match_parent"
  22. android:layout_height="wrap_content"
  23. android:orientation="vertical"
  24. android:paddingTop="8dp"
  25. android:paddingBottom="8dp">
  26. <androidx.constraintlayout.widget.ConstraintLayout
  27. android:layout_width="match_parent"
  28. android:layout_height="match_parent">
  29. <TextView
  30. android:id="@+id/textView4"
  31. android:layout_width="match_parent"
  32. android:layout_height="wrap_content"
  33. android:text="Track length"
  34. app:layout_constraintStart_toStartOf="parent"
  35. app:layout_constraintTop_toTopOf="parent" />
  36. <TextView
  37. android:id="@+id/trackLengthTextView"
  38. android:layout_width="wrap_content"
  39. android:layout_height="wrap_content"
  40. app:layout_constraintEnd_toEndOf="parent"
  41. app:layout_constraintTop_toTopOf="parent" />
  42. </androidx.constraintlayout.widget.ConstraintLayout>
  43. <SeekBar
  44. android:id="@+id/trackLengthSeekBar"
  45. style="@android:style/Widget.Material.SeekBar"
  46. android:layout_width="match_parent"
  47. android:layout_height="wrap_content"
  48. android:max="250"
  49. android:min="1"
  50. android:progress="50" />
  51. <androidx.constraintlayout.widget.ConstraintLayout
  52. android:layout_width="match_parent"
  53. android:layout_height="match_parent">
  54. <TextView
  55. android:id="@+id/textView3"
  56. android:layout_width="wrap_content"
  57. android:layout_height="wrap_content"
  58. android:text="Number of vehicles"
  59. app:layout_constraintStart_toStartOf="parent"
  60. app:layout_constraintTop_toTopOf="parent" />
  61. <TextView
  62. android:id="@+id/noOfVehiclesTextView"
  63. android:layout_width="wrap_content"
  64. android:layout_height="wrap_content"
  65. app:layout_constraintEnd_toEndOf="parent"
  66. app:layout_constraintTop_toTopOf="parent" />
  67. </androidx.constraintlayout.widget.ConstraintLayout>
  68. <SeekBar
  69. android:id="@+id/noOfVehiclesSeekBar"
  70. style="@style/Widget.AppCompat.SeekBar"
  71. android:layout_width="match_parent"
  72. android:layout_height="wrap_content"
  73. android:max="250"
  74. android:min="1"
  75. android:progress="3" />
  76. <androidx.constraintlayout.widget.ConstraintLayout
  77. android:layout_width="match_parent"
  78. android:layout_height="match_parent">
  79. <TextView
  80. android:id="@+id/textView5"
  81. android:layout_width="match_parent"
  82. android:layout_height="wrap_content"
  83. android:text="Maximum velocity"
  84. app:layout_constraintStart_toStartOf="parent"
  85. app:layout_constraintTop_toTopOf="parent" />
  86. <TextView
  87. android:id="@+id/maxVeloTextView"
  88. android:layout_width="wrap_content"
  89. android:layout_height="wrap_content"
  90. app:layout_constraintEnd_toEndOf="@+id/textView5"
  91. app:layout_constraintTop_toTopOf="parent" />
  92. </androidx.constraintlayout.widget.ConstraintLayout>
  93. <SeekBar
  94. android:id="@+id/maxVelocitySeekBar"
  95. style="@style/Widget.AppCompat.SeekBar.Discrete"
  96. android:layout_width="match_parent"
  97. android:layout_height="wrap_content"
  98. android:max="10"
  99. android:progress="3" />
  100. <androidx.constraintlayout.widget.ConstraintLayout
  101. android:layout_width="match_parent"
  102. android:layout_height="match_parent">
  103. <TextView
  104. android:id="@+id/brakeProbLabel"
  105. android:layout_width="match_parent"
  106. android:layout_height="wrap_content"
  107. android:text="Brake probability"
  108. app:layout_constraintStart_toStartOf="parent"
  109. app:layout_constraintTop_toTopOf="parent" />
  110. <TextView
  111. android:id="@+id/brakeProbTextView"
  112. android:layout_width="wrap_content"
  113. android:layout_height="wrap_content"
  114. app:layout_constraintEnd_toEndOf="@+id/brakeProbLabel"
  115. app:layout_constraintTop_toTopOf="parent" />
  116. </androidx.constraintlayout.widget.ConstraintLayout>
  117. <SeekBar
  118. android:id="@+id/brakeProbabilitySeekBar"
  119. style="@style/Widget.AppCompat.SeekBar.Discrete"
  120. android:layout_width="match_parent"
  121. android:layout_height="wrap_content"
  122. android:max="20"
  123. android:min="0"
  124. android:progress="6" />
  125. </LinearLayout>
  126. <View
  127. android:id="@+id/divider"
  128. android:layout_width="match_parent"
  129. android:layout_height="1dp"
  130. android:background="?android:attr/listDivider" />
  131. <TableLayout
  132. android:layout_width="match_parent"
  133. android:layout_height="wrap_content"
  134. android:paddingTop="8dp"
  135. android:paddingBottom="8dp">
  136. <TableRow
  137. android:layout_width="match_parent"
  138. android:layout_height="match_parent" >
  139. <TextView
  140. android:id="@+id/textView7"
  141. android:layout_width="wrap_content"
  142. android:layout_height="wrap_content"
  143. android:text="Steps" />
  144. <TextView
  145. android:id="@+id/textView9"
  146. android:layout_width="wrap_content"
  147. android:layout_height="wrap_content"
  148. android:text=" " />
  149. <TextView
  150. android:id="@+id/stepsTextView"
  151. android:layout_width="wrap_content"
  152. android:layout_height="wrap_content"
  153. android:text="0" />
  154. </TableRow>
  155. <TableRow
  156. android:layout_width="match_parent"
  157. android:layout_height="match_parent">
  158. <TextView
  159. android:id="@+id/textView2"
  160. android:layout_width="match_parent"
  161. android:layout_height="wrap_content"
  162. android:text="Average velocity (overall):" />
  163. <TextView
  164. android:id="@+id/textView10"
  165. android:layout_width="wrap_content"
  166. android:layout_height="wrap_content"
  167. android:text=" " />
  168. <TextView
  169. android:id="@+id/avgVeloOverallView"
  170. android:layout_width="wrap_content"
  171. android:layout_height="wrap_content"
  172. android:text="0.0" />
  173. </TableRow>
  174. <TableRow
  175. android:layout_width="match_parent"
  176. android:layout_height="match_parent">
  177. <TextView
  178. android:id="@+id/textView"
  179. android:layout_width="match_parent"
  180. android:layout_height="wrap_content"
  181. android:text="Average velocity (last step):" />
  182. <TextView
  183. android:id="@+id/textView11"
  184. android:layout_width="wrap_content"
  185. android:layout_height="wrap_content"
  186. android:text=" " />
  187. <TextView
  188. android:id="@+id/avgVeloLastView"
  189. android:layout_width="wrap_content"
  190. android:layout_height="wrap_content"
  191. android:text="0.0" />
  192. </TableRow>
  193. <TableRow
  194. android:layout_width="match_parent"
  195. android:layout_height="match_parent" >
  196. <TextView
  197. android:id="@+id/textView14"
  198. android:layout_width="wrap_content"
  199. android:layout_height="wrap_content"
  200. android:text="Delayed average velocity:" />
  201. <TextView
  202. android:id="@+id/textView13"
  203. android:layout_width="wrap_content"
  204. android:layout_height="wrap_content"
  205. android:text=" " />
  206. <TextView
  207. android:id="@+id/delayedAvgTextView"
  208. android:layout_width="wrap_content"
  209. android:layout_height="wrap_content"
  210. android:text="0.0" />
  211. </TableRow>
  212. </TableLayout>
  213. <View
  214. android:id="@+id/divider2"
  215. android:layout_width="match_parent"
  216. android:layout_height="1dp"
  217. android:background="?android:attr/listDivider" />
  218. <androidx.constraintlayout.widget.ConstraintLayout
  219. android:layout_width="match_parent"
  220. android:layout_height="match_parent"
  221. android:paddingTop="8dp"
  222. android:paddingBottom="8dp">
  223. <LinearLayout
  224. android:id="@+id/trackViewStack"
  225. android:layout_width="match_parent"
  226. android:layout_height="0dp"
  227. android:orientation="vertical"
  228. app:layout_constraintBottom_toTopOf="@+id/constraintLayout2"
  229. app:layout_constraintEnd_toEndOf="parent"
  230. app:layout_constraintStart_toStartOf="parent"
  231. app:layout_constraintTop_toTopOf="parent">
  232. </LinearLayout>
  233. <androidx.constraintlayout.widget.ConstraintLayout
  234. android:id="@+id/constraintLayout2"
  235. android:layout_width="0dp"
  236. android:layout_height="wrap_content"
  237. app:layout_constraintBottom_toTopOf="@+id/constraintLayout"
  238. app:layout_constraintEnd_toEndOf="parent"
  239. app:layout_constraintStart_toStartOf="parent">
  240. <TextView
  241. android:id="@+id/textView8"
  242. android:layout_width="wrap_content"
  243. android:layout_height="wrap_content"
  244. android:text="Frameskip"
  245. app:layout_constraintStart_toStartOf="parent"
  246. app:layout_constraintTop_toTopOf="parent" />
  247. <SeekBar
  248. android:id="@+id/frameskipSeekBar"
  249. android:layout_width="0dp"
  250. android:layout_height="wrap_content"
  251. android:max="1000"
  252. app:layout_constraintEnd_toStartOf="@id/frameSkipTextView"
  253. app:layout_constraintStart_toEndOf="@id/textView8"
  254. app:layout_constraintTop_toTopOf="parent" />
  255. <TextView
  256. android:id="@+id/frameSkipTextView"
  257. android:layout_width="50dp"
  258. android:layout_height="wrap_content"
  259. android:gravity="right"
  260. android:text="0"
  261. app:layout_constraintEnd_toEndOf="parent"
  262. app:layout_constraintTop_toTopOf="parent" />
  263. </androidx.constraintlayout.widget.ConstraintLayout>
  264. <androidx.constraintlayout.widget.ConstraintLayout
  265. android:id="@+id/constraintLayout"
  266. android:layout_width="0dp"
  267. android:layout_height="wrap_content"
  268. app:layout_constraintBottom_toTopOf="@+id/linearLayout"
  269. app:layout_constraintEnd_toEndOf="parent"
  270. app:layout_constraintStart_toStartOf="parent">
  271. <TextView
  272. android:id="@+id/textView6"
  273. android:layout_width="wrap_content"
  274. android:layout_height="wrap_content"
  275. android:text="Delay: "
  276. app:layout_constraintStart_toStartOf="parent"
  277. app:layout_constraintTop_toTopOf="parent" />
  278. <SeekBar
  279. android:id="@+id/simDelaySeekBar"
  280. android:layout_width="0dp"
  281. android:layout_height="wrap_content"
  282. android:max="500"
  283. android:min="0"
  284. app:layout_constraintEnd_toStartOf="@+id/simDelayTextView"
  285. app:layout_constraintStart_toEndOf="@+id/textView6"
  286. app:layout_constraintTop_toTopOf="parent" />
  287. <TextView
  288. android:id="@+id/simDelayTextView"
  289. android:layout_width="50dp"
  290. android:layout_height="wrap_content"
  291. android:gravity="right"
  292. android:text="0"
  293. app:layout_constraintEnd_toEndOf="parent"
  294. app:layout_constraintTop_toTopOf="parent" />
  295. </androidx.constraintlayout.widget.ConstraintLayout>
  296. <LinearLayout
  297. android:id="@+id/linearLayout"
  298. android:layout_width="match_parent"
  299. android:layout_height="wrap_content"
  300. android:orientation="horizontal"
  301. android:paddingTop="8dp"
  302. app:layout_constraintBottom_toBottomOf="parent"
  303. app:layout_constraintEnd_toEndOf="parent">
  304. <Button
  305. android:id="@+id/playButton"
  306. style="@style/Widget.AppCompat.Button.Borderless"
  307. android:layout_width="wrap_content"
  308. android:layout_height="wrap_content"
  309. android:onClick="onPlayButtonClick"
  310. android:text="Play" />
  311. <Button
  312. android:id="@+id/stepButton"
  313. style="@style/Widget.AppCompat.Button.Borderless"
  314. android:layout_width="wrap_content"
  315. android:layout_height="wrap_content"
  316. android:onClick="onStepButtonClick"
  317. android:text="Step" />
  318. <Button
  319. android:id="@+id/stopButton"
  320. style="@style/Widget.AppCompat.Button.Borderless"
  321. android:layout_width="wrap_content"
  322. android:layout_height="wrap_content"
  323. android:enabled="false"
  324. android:onClick="onStopButtonClick"
  325. android:text="Stop" />
  326. <Button
  327. android:id="@+id/clearButton"
  328. style="@style/Widget.AppCompat.Button.Borderless"
  329. android:layout_width="0dp"
  330. android:layout_height="wrap_content"
  331. android:layout_weight="1"
  332. android:onClick="onClearButtonClick"
  333. android:text="clear" />
  334. </LinearLayout>
  335. </androidx.constraintlayout.widget.ConstraintLayout>
  336. </LinearLayout>
  337. </androidx.constraintlayout.widget.ConstraintLayout>