PDCACT.ccpage 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <fragment xmlns="http://www.holeschak.de/BmwDeepObd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.holeschak.de/BmwDeepObd BmwDeepObd.xsd">
  3. <page name="PDC" fontsize="small" display-mode="grid" gauges-portrait="2" gauges-landscape="4" logfile="PDCACT.log">
  4. <strings>
  5. <string name="PDC">PDC</string>
  6. <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_HL_WERT"> back left [cm]</string>
  7. <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_HML_WERT"> back left middle [cm]</string>
  8. <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_HMR_WERT"> back right middle [cm]</string>
  9. <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_HR_WERT"> back right [cm]</string>
  10. <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_VL_WERT"> front left [cm]</string>
  11. <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_VML_WERT"> front left middle [cm]</string>
  12. <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_VMR_WERT"> front right middle [cm]</string>
  13. <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_VR_WERT"> front right [cm]</string>
  14. </strings>
  15. <strings lang="de">
  16. <string name="PDC">PDC</string>
  17. <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_HL_WERT"> Hinten Links [cm]</string>
  18. <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_HML_WERT"> Hinten Links Mitte [cm]</string>
  19. <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_HMR_WERT"> Hinten Rechts Mitte [cm]</string>
  20. <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_HR_WERT"> Hinten Rechts [cm]</string>
  21. <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_VL_WERT"> Vorn Links [cm]</string>
  22. <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_VML_WERT"> Vorn Links Mitte [cm]</string>
  23. <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_VMR_WERT"> Vorn Rechts Mitte [cm]</string>
  24. <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_VR_WERT"> Vorn Rechts [cm]</string>
  25. </strings>
  26. <jobs sgbd="pdcact">
  27. <job name="STATUS_MESSWERTE_LESEN">
  28. <display name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_VL_WERT" result="STAT_WEG_VL_WERT" grid-type="simple-gauge-round" min-value="0" max-value="255" log_tag="STAT_WEG_VL_WERT" />
  29. <display name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_VML_WERT" result="STAT_WEG_VML_WERT" grid-type="simple-gauge-round" min-value="0" max-value="255" log_tag="STAT_WEG_VML_WERT" />
  30. <display name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_VMR_WERT" result="STAT_WEG_VMR_WERT" grid-type="simple-gauge-round" min-value="0" max-value="255" log_tag="STAT_WEG_VMR_WERT" />
  31. <display name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_VR_WERT" result="STAT_WEG_VR_WERT" grid-type="simple-gauge-round" min-value="0" max-value="255" log_tag="STAT_WEG_VR_WERT" />
  32. <display name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_HL_WERT" result="STAT_WEG_HL_WERT" grid-type="simple-gauge-round" min-value="0" max-value="255" log_tag="STAT_WEG_HL_WERT" />
  33. <display name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_HML_WERT" result="STAT_WEG_HML_WERT" grid-type="simple-gauge-round" min-value="0" max-value="255" log_tag="STAT_WEG_HML_WERT" />
  34. <display name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_HMR_WERT" result="STAT_WEG_HMR_WERT" grid-type="simple-gauge-round" min-value="0" max-value="255" log_tag="STAT_WEG_HMR_WERT" />
  35. <display name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_HR_WERT" result="STAT_WEG_HR_WERT" grid-type="simple-gauge-round" min-value="0" max-value="255" log_tag="STAT_WEG_HR_WERT" />
  36. </job>
  37. </jobs>
  38. <code show_warnings="true">
  39. <![CDATA[
  40. class PageClass
  41. {
  42. public string FormatResult(JobReader.PageInfo pageInfo, MultiMap<string, EdiabasNet.ResultData> resultDict, string resultName, ref Android.Graphics.Color? textColor)
  43. {
  44. string result = string.Empty;
  45. Int64 value;
  46. bool found;
  47. switch (resultName)
  48. {
  49. case "STATUS_MESSWERTE_LESEN#STAT_WEG_VL_WERT":
  50. value = ActivityMain.GetResultInt64(resultDict, resultName, 0, out found);
  51. // result format: {0,[DIGITS TOTAL INCL COMMA],[0|0.0|0.00|0.000...]}
  52. result = string.Format(ActivityMain.Culture, "{0,3:0}", value);
  53. // Liste der möglichen Farbnamen: https://docs.microsoft.com/en-us/dotnet/api/android.graphics.color?view=xamarin-android-sdk-9
  54. if (found && value <= 20) textColor = Android.Graphics.Color.Red;
  55. else if (found && value <= 40) textColor = Android.Graphics.Color.Orange;
  56. else if (found && value <= 80) textColor = Android.Graphics.Color.Yellow;
  57. else if (found && value <= 100) textColor = Android.Graphics.Color.Green;
  58. else if (found && value > 200) textColor = Android.Graphics.Color.White;
  59. else textColor = Android.Graphics.Color.Gray;
  60. break;
  61. case "STATUS_MESSWERTE_LESEN#STAT_WEG_VML_WERT":
  62. value = ActivityMain.GetResultInt64(resultDict, resultName, 0, out found);
  63. // result format: {0,[DIGITS TOTAL INCL COMMA],[0|0.0|0.00|0.000...]}
  64. result = string.Format(ActivityMain.Culture, "{0,3:0}", value);
  65. // Liste der möglichen Farbnamen: https://docs.microsoft.com/en-us/dotnet/api/android.graphics.color?view=xamarin-android-sdk-9
  66. if (found && value <= 20) textColor = Android.Graphics.Color.Red;
  67. else if (found && value <= 40) textColor = Android.Graphics.Color.Orange;
  68. else if (found && value <= 80) textColor = Android.Graphics.Color.Yellow;
  69. else if (found && value <= 100) textColor = Android.Graphics.Color.Green;
  70. else if (found && value > 200) textColor = Android.Graphics.Color.White;
  71. else textColor = Android.Graphics.Color.Gray;
  72. break;
  73. case "STATUS_MESSWERTE_LESEN#STAT_WEG_VMR_WERT":
  74. value = ActivityMain.GetResultInt64(resultDict, resultName, 0, out found);
  75. // result format: {0,[DIGITS TOTAL INCL COMMA],[0|0.0|0.00|0.000...]}
  76. result = string.Format(ActivityMain.Culture, "{0,3:0}", value);
  77. // Liste der möglichen Farbnamen: https://docs.microsoft.com/en-us/dotnet/api/android.graphics.color?view=xamarin-android-sdk-9
  78. if (found && value <= 20) textColor = Android.Graphics.Color.Red;
  79. else if (found && value <= 40) textColor = Android.Graphics.Color.Orange;
  80. else if (found && value <= 80) textColor = Android.Graphics.Color.Yellow;
  81. else if (found && value <= 100) textColor = Android.Graphics.Color.Green;
  82. else if (found && value > 200) textColor = Android.Graphics.Color.White;
  83. else textColor = Android.Graphics.Color.Gray;
  84. break;
  85. case "STATUS_MESSWERTE_LESEN#STAT_WEG_VR_WERT":
  86. value = ActivityMain.GetResultInt64(resultDict, resultName, 0, out found);
  87. // result format: {0,[DIGITS TOTAL INCL COMMA],[0|0.0|0.00|0.000...]}
  88. result = string.Format(ActivityMain.Culture, "{0,3:0}", value);
  89. // Liste der möglichen Farbnamen: https://docs.microsoft.com/en-us/dotnet/api/android.graphics.color?view=xamarin-android-sdk-9
  90. if (found && value <= 20) textColor = Android.Graphics.Color.Red;
  91. else if (found && value <= 40) textColor = Android.Graphics.Color.Orange;
  92. else if (found && value <= 80) textColor = Android.Graphics.Color.Yellow;
  93. else if (found && value <= 100) textColor = Android.Graphics.Color.Green;
  94. else if (found && value > 200) textColor = Android.Graphics.Color.White;
  95. else textColor = Android.Graphics.Color.Gray;
  96. break;
  97. case "STATUS_MESSWERTE_LESEN#STAT_WEG_HL_WERT":
  98. value = ActivityMain.GetResultInt64(resultDict, resultName, 0, out found);
  99. // result format: {0,[DIGITS TOTAL INCL COMMA],[0|0.0|0.00|0.000...]}
  100. result = string.Format(ActivityMain.Culture, "{0,3:0}", value);
  101. // Liste der möglichen Farbnamen: https://docs.microsoft.com/en-us/dotnet/api/android.graphics.color?view=xamarin-android-sdk-9
  102. if (found && value <= 20) textColor = Android.Graphics.Color.Red;
  103. else if (found && value <= 40) textColor = Android.Graphics.Color.Orange;
  104. else if (found && value <= 80) textColor = Android.Graphics.Color.Yellow;
  105. else if (found && value <= 100) textColor = Android.Graphics.Color.Green;
  106. else if (found && value > 200) textColor = Android.Graphics.Color.White;
  107. else textColor = Android.Graphics.Color.Gray;
  108. break;
  109. case "STATUS_MESSWERTE_LESEN#STAT_WEG_HML_WERT":
  110. value = ActivityMain.GetResultInt64(resultDict, resultName, 0, out found);
  111. // result format: {0,[DIGITS TOTAL INCL COMMA],[0|0.0|0.00|0.000...]}
  112. result = string.Format(ActivityMain.Culture, "{0,3:0}", value);
  113. // Liste der möglichen Farbnamen: https://docs.microsoft.com/en-us/dotnet/api/android.graphics.color?view=xamarin-android-sdk-9
  114. if (found && value <= 20) textColor = Android.Graphics.Color.Red;
  115. else if (found && value <= 40) textColor = Android.Graphics.Color.Orange;
  116. else if (found && value <= 80) textColor = Android.Graphics.Color.Yellow;
  117. else if (found && value <= 100) textColor = Android.Graphics.Color.Green;
  118. else if (found && value > 200) textColor = Android.Graphics.Color.White;
  119. else textColor = Android.Graphics.Color.Gray;
  120. break;
  121. case "STATUS_MESSWERTE_LESEN#STAT_WEG_HMR_WERT":
  122. value = ActivityMain.GetResultInt64(resultDict, resultName, 0, out found);
  123. // result format: {0,[DIGITS TOTAL INCL COMMA],[0|0.0|0.00|0.000...]}
  124. result = string.Format(ActivityMain.Culture, "{0,3:0}", value);
  125. // Liste der möglichen Farbnamen: https://docs.microsoft.com/en-us/dotnet/api/android.graphics.color?view=xamarin-android-sdk-9
  126. if (found && value <= 20) textColor = Android.Graphics.Color.Red;
  127. else if (found && value <= 40) textColor = Android.Graphics.Color.Orange;
  128. else if (found && value <= 80) textColor = Android.Graphics.Color.Yellow;
  129. else if (found && value <= 100) textColor = Android.Graphics.Color.Green;
  130. else if (found && value > 200) textColor = Android.Graphics.Color.White;
  131. else textColor = Android.Graphics.Color.Gray;
  132. break;
  133. case "STATUS_MESSWERTE_LESEN#STAT_WEG_HR_WERT":
  134. value = ActivityMain.GetResultInt64(resultDict, resultName, 0, out found);
  135. // result format: {0,[DIGITS TOTAL INCL COMMA],[0|0.0|0.00|0.000...]}
  136. result = string.Format(ActivityMain.Culture, "{0,3:0}", value);
  137. // Liste der möglichen Farbnamen: https://docs.microsoft.com/en-us/dotnet/api/android.graphics.color?view=xamarin-android-sdk-9
  138. if (found && value <= 20) textColor = Android.Graphics.Color.Red;
  139. else if (found && value <= 40) textColor = Android.Graphics.Color.Orange;
  140. else if (found && value <= 80) textColor = Android.Graphics.Color.Yellow;
  141. else if (found && value <= 100) textColor = Android.Graphics.Color.Green;
  142. else if (found && value > 200) textColor = Android.Graphics.Color.White;
  143. else textColor = Android.Graphics.Color.Gray;
  144. break;
  145. }
  146. return result;
  147. }
  148. }
  149. ]]>
  150. </code>
  151. </page>
  152. </fragment>