DDEGenerator.ccpage 6.0 KB

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