DDEGenerator.ccpage 6.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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="Generator" display-mode="grid" fontsize="small" gauges-portrait="2" gauges-landscape="4" logfile="DME_DDE.log">
  4. <strings lang="de">
  5. <string name="Generator">Generator</string>
  6. <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_MOTORDREHZAHL_WERT"> Drehzahl [U/min]</string>
  7. <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_UBATT_WERT"> Batteriespannung [V]</string>
  8. <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_GENERATORLAST_WERT"> Generatorlast [%]</string>
  9. <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_ZUHEIZER_ANSTEUERUNG_WERT"> Zuheizer Ansteuerung [%]:</string>
  10. <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_KUEHLMITTELTEMPERATUR_WERT"> Kühlmitteltemperatur [°C]</string>
  11. <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_MOTORMOMENT_AKTUELL_WERT"> Drehmoment [Nm]:</string>
  12. </strings>
  13. <strings>
  14. <string name="Generator">Generator</string>
  15. <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_MOTORDREHZAHL_WERT"> engine speed [U/min]</string>
  16. <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_UBATT_WERT"> voltage [V]</string>
  17. <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_GENERATORLAST_WERT"> alternator load [%]</string>
  18. <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_ZUHEIZER_ANSTEUERUNG_WERT"> el. heater PWM [%]:</string>
  19. <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_KUEHLMITTELTEMPERATUR_WERT"> coolant [°C]</string>
  20. <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_MOTORMOMENT_AKTUELL_WERT"> torque [Nm]:</string>
  21. </strings>
  22. <jobs>
  23. <job sgbd="D50M57E1" name="STATUS_MESSWERTBLOCK_LESEN" args="JA;IUBAT;ITKUM;IMOAK;INMOT;IGENL;ITZUH">
  24. <display name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_MOTORDREHZAHL_WERT" result="STAT_MOTORDREHZAHL_WERT" grid-type="simple-gauge-round" min-value="0" max-value="5000" log_tag="STAT_MOTORDREHZAHL_WERT" />
  25. <display name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_KUEHLMITTELTEMPERATUR_WERT" result="STAT_KUEHLMITTELTEMPERATUR_WERT" grid-type="simple-gauge-round" min-value="-20" max-value="120" log_tag="STAT_KUEHLMITTELTEMPERATUR_WERT" />
  26. <display name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_MOTORMOMENT_AKTUELL_WERT" result="STAT_MOTORMOMENT_AKTUELL_WERT" format="L" grid-type="simple-gauge-round" min-value="0" max-value="600" log_tag="STAT_MOTORMOMENT_AKTUELL_WERT" />
  27. <display name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_UBATT_WERT" result="STAT_UBATT_WERT" grid-type="simple-gauge-round" min-value="0" max-value="15" log_tag="STAT_UBATT_WERT" />
  28. <display name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_GENERATORLAST_WERT" result="STAT_GENERATORLAST_WERT" format=".1R" grid-type="simple-gauge-round" min-value="0" max-value="100" log_tag="STAT_GENERATORLAST_WERT" />
  29. <display name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_ZUHEIZER_ANSTEUERUNG_WERT" result="STAT_ZUHEIZER_ANSTEUERUNG_WERT" format=".1R" grid-type="simple-gauge-round" min-value="0" max-value="100" log_tag="STAT_ZUHEIZER_ANSTEUERUNG_WERT" />
  30. </job>
  31. </jobs>
  32. <code show_warnings="true">
  33. <![CDATA[
  34. class PageClass
  35. {
  36. public string FormatResult(JobReader.PageInfo pageInfo, MultiMap<string, EdiabasNet.ResultData> resultDict, string resultName, ref Android.Graphics.Color? textColor)
  37. {
  38. string result = string.Empty;
  39. double value;
  40. bool found;
  41. switch (resultName)
  42. {
  43. case "STATUS_MESSWERTBLOCK_LESEN#STAT_MOTORDREHZAHL_WERT":
  44. value = ActivityMain.GetResultDouble(resultDict, resultName, 0, out found);
  45. // result format: {0,[DIGITS TOTAL INCL COMMA],[0|0.0|0.00|0.000...]}
  46. result = string.Format(ActivityMain.Culture, "{0,4:0}", value);
  47. if (found && value <= 4000) textColor = Android.Graphics.Color.White;
  48. else if (found && value <= 4250) textColor = Android.Graphics.Color.Yellow;
  49. else if (found && value <= 4500) textColor = Android.Graphics.Color.Orange;
  50. else if (found && value > 4500) textColor = Android.Graphics.Color.Red;
  51. else textColor = Android.Graphics.Color.Gray;
  52. break;
  53. case "STATUS_MESSWERTBLOCK_LESEN#STAT_UBATT_WERT":
  54. value = ActivityMain.GetResultDouble(resultDict, resultName, 0, out found);
  55. // result format: {0,[DIGITS TOTAL INCL COMMA],[0|0.0|0.00|0.000...]}
  56. result = string.Format(ActivityMain.Culture, "{0,4:0.0}", value);
  57. if (found && value < 10.5) textColor = Android.Graphics.Color.Red;
  58. else if (found && value < 11.5) textColor = Android.Graphics.Color.Orange;
  59. else if (found && value <= 12.5) textColor = Android.Graphics.Color.Yellow;
  60. else if (found && value <= 13.2) textColor = Android.Graphics.Color.Gray;
  61. else if (found && value <= 14.5) textColor = Android.Graphics.Color.White;
  62. else if (found && value > 14.5) textColor = Android.Graphics.Color.Red;
  63. else textColor = Android.Graphics.Color.Gray;
  64. break;
  65. case "STATUS_MESSWERTBLOCK_LESEN#STAT_KUEHLMITTELTEMPERATUR_WERT":
  66. value = ActivityMain.GetResultDouble(resultDict, resultName, 0, out found);
  67. result = string.Format(ActivityMain.Culture, "{0,3:0}", value);
  68. if (found && value < 75) textColor = Android.Graphics.Color.Blue;
  69. else if (found && value <= 105) textColor = Android.Graphics.Color.White;
  70. else if (found && value <= 110) textColor = Android.Graphics.Color.Yellow;
  71. else if (found && value <= 115) textColor = Android.Graphics.Color.Orange;
  72. else if (found && value > 115) textColor = Android.Graphics.Color.Red;
  73. else textColor = Android.Graphics.Color.Gray;
  74. break;
  75. }
  76. return result;
  77. }
  78. }
  79. ]]>
  80. </code>
  81. </page>
  82. </fragment>