123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- <?xml version="1.0" encoding="utf-8"?>
- <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">
- <page name="IBUS_App" display-mode="grid" fontsize="medium" gauges-portrait="2" gauges-landscape="4" logfile="DME_DDE.log">
- <strings lang="de">
- <string name="IBUS_App">LEISTUNG</string>
- <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_MOTORMOMENT_AKTUELL_WERT"> Drehmoment [Nm]:</string>
- <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_MOTORDREHZAHL_WERT"> Drehzahl [U/min]</string>
- <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_MOTORMOMENT_WUNSCH_WERT"> Leistung [PS]</string>
- <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_LUFTMASSE_PRO_HUB_WERT"> Leistung [kW]</string>
- </strings>
- <strings>
- <string name="IBUS_App">POWER</string>
- <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_MOTORMOMENT_AKTUELL_WERT"> torque [Nm]:</string>
- <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_MOTORDREHZAHL_WERT"> engine speed [U/min]</string>
- <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_MOTORMOMENT_WUNSCH_WERT"> power [HP]</string>
- <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_LUFTMASSE_PRO_HUB_WERT"> power [kW]</string>
- </strings>
-
- <display name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_MOTORMOMENT_AKTUELL_WERT" result="STATUS_MESSWERTBLOCK_LESEN#STAT_MOTORMOMENT_AKTUELL_WERT" grid-type="simple-gauge-round" min-value="0" max-value="600" log_tag="STAT_MOTORMOMENT_AKTUELL_WERT" />
- <display name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_MOTORDREHZAHL_WERT" result="STATUS_MESSWERTBLOCK_LESEN#STAT_MOTORDREHZAHL_WERT" grid-type="simple-gauge-round" min-value="0" max-value="5000" log_tag="STAT_MOTORDREHZAHL_WERT" />
- <display name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_MOTORMOMENT_WUNSCH_WERT" result="STATUS_MESSWERTBLOCK_LESEN#STAT_MOTORMOMENT_WUNSCH_WERT" grid-type="simple-gauge-round" min-value="0" max-value="600" log_tag="STAT_POWER_HP" />
- <display name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_LUFTMASSE_PRO_HUB_WERT" result="STATUS_MESSWERTBLOCK_LESEN#STAT_LUFTMASSE_PRO_HUB_WERT" grid-type="simple-gauge-round" min-value="0" max-value="1500" log_tag="STAT_POWER_KW" />
- <jobs />
- <code show_warnings="true">
- <![CDATA[
- class PageClass
- {
- private int mom_torque = 0;
- private int mom_N = 0;
-
- public void ExecuteJob(EdiabasNet ediabas, ref MultiMap<string, EdiabasNet.ResultData> resultDict, bool firstCall)
- {
- List<Dictionary<string, EdiabasNet.ResultData>> resultSets;
-
- // Job 1 - ständig zu aktualisierende Werte
- ediabas.ArgString = "JA;IMOAK;INMOT;IMWVO;ILMMG";
- ediabas.ArgBinaryStd = null;
- ediabas.ResultsRequests = string.Empty;
- ediabas.ExecuteJob("STATUS_MESSWERTBLOCK_LESEN");
- resultSets = ediabas.ResultSets;
- if (resultSets != null && resultSets.Count >= 2)
- {
- EdiabasThread.MergeResultDictionarys(ref resultDict, resultSets[1], "STATUS_MESSWERTBLOCK_LESEN#");
- }
-
-
-
- // extract values and save to global variables
-
- EdiabasNet.ResultData resultData;
- if (resultSets[1].TryGetValue("STAT_MOTORDREHZAHL_WERT", out resultData))
- {
- if (resultData.OpData is Double)
- {
- mom_N = (int)((Double)resultData.OpData);
- }
- }
-
- if (resultSets[1].TryGetValue("STAT_MOTORMOMENT_AKTUELL_WERT", out resultData))
- {
- if (resultData.OpData is Double)
- {
- mom_torque = (int)((Double)resultData.OpData);
- }
- }
-
- }
-
-
- public string FormatResult(JobReader.PageInfo pageInfo, MultiMap<string, EdiabasNet.ResultData> resultDict, string resultName, ref Android.Graphics.Color? textColor)
- {
- string result = string.Empty;
- double value;
- // bool found;
-
- // List of possible colors: https://docs.microsoft.com/en-us/dotnet/api/android.graphics.color?view=xamarin-android-sdk-9
-
- switch (resultName)
- {
- case "STATUS_MESSWERTBLOCK_LESEN#STAT_MOTORMOMENT_WUNSCH_WERT":
- // value = ActivityMain.GetResultDouble(resultDict, resultName, 0, out found);
-
- // this is the reading we overwrite with calculated horsepower
-
- value = mom_torque * mom_N / 7127;
-
- // result format: {0,[DIGITS TOTAL INCL COMMA],[0|0.0|0.00|0.000...]}
- result = string.Format(ActivityMain.Culture, "{0,1:0}", value);
-
- // if (found && value <= 4000) textColor = Android.Graphics.Color.White;
- // else if (found && value <= 4250) textColor = Android.Graphics.Color.Yellow;
- // else if (found && value <= 4500) textColor = Android.Graphics.Color.Orange;
- // else if (found && value > 4500) textColor = Android.Graphics.Color.Red;
- // else textColor = Android.Graphics.Color.Gray;
-
- break;
-
- case "STATUS_MESSWERTBLOCK_LESEN#STAT_LUFTMASSE_PRO_HUB_WERT":
- // value = ActivityMain.GetResultDouble(resultDict, resultName, 0, out found);
-
- // and this one we will overwrite with power in kW
-
- value = mom_torque * mom_N / 7127 / 1.36;
-
- // result format: {0,[DIGITS TOTAL INCL COMMA],[0|0.0|0.00|0.000...]}
- result = string.Format(ActivityMain.Culture, "{0,1:0}", value);
-
- // if (found && value <= 4000) textColor = Android.Graphics.Color.White;
- // else if (found && value <= 4250) textColor = Android.Graphics.Color.Yellow;
- // else if (found && value <= 4500) textColor = Android.Graphics.Color.Orange;
- // else if (found && value > 4500) textColor = Android.Graphics.Color.Red;
- // else textColor = Android.Graphics.Color.Gray;
-
- break;
- }
- return result;
- }
- }
- ]]>
- </code>
-
- </page>
- </fragment>
|