<?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="small" gauges-portrait="2" gauges-landscape="5" logfile="DME_DDE.log">
    <strings lang="de">
      <string name="IBUS_App">IBUS_App</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_LUFTMASSE_PRO_HUB_WERT"> Luftmasse [mg/Hub]</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_UBATT_WERT"> Batteriespannung [V]</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_KUEHLMITTELTEMPERATUR_WERT"> Kühlmitteltemperatur [°C]</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_KRAFTSTOFFTEMPERATURK_WERT"> Kraftstofftemperatur [°C]</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_LADELUFTTEMPERATUR_WERT"> Ladelufttemp. [°C]</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_EINSPRITZMENGE_AKTUELL_WERT"> Einspritzmenge [mg]</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_ABGASTEMPERATUR_VOR_KATALYSATOR_WERT"> Abgastemp. vor Kat [°C]</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_LADEDRUCK_WERT"> Ladedruck Ist [mbar]</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_LADEDRUCK_SOLL_WERT"> Ladedruck Soll [mbar]</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_UMGEBUNGSDRUCK_WERT"> Luftdruck [mbar]</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_RAILDRUCK_WERT"> Raildruck Ist [bar]</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_RAILDRUCK_SOLL_WERT"> Raildruck Soll [bar]</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_FAHRZEUGBESCHLEUNIGUNG_WERT"> Beschleunigung [m/s²]</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_GESCHWINDIGKEIT_WERT"> Geschwindigkeit [km/h]</string>
      <string name="!JOB#STATUS_TOENS_IO#STAT_TOG_HIGH_WERT">  TÖNS Heizzeit [ms]</string>
      <string name="!JOB#STATUS_TOENS_IO#STAT_TOG_LOW_WERT">  TÖNS Kühlzeit [ms]</string>
    </strings>
    <strings>
      <string name="IBUS_App">IBUS_App</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_LUFTMASSE_PRO_HUB_WERT"> air mass [mg/stroke]</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_UBATT_WERT"> voltage [V]</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_KUEHLMITTELTEMPERATUR_WERT"> coolant [°C]</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_KRAFTSTOFFTEMPERATURK_WERT"> fuel temperature [°C]</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_LADELUFTTEMPERATUR_WERT"> charge air temperature [°C]</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_EINSPRITZMENGE_AKTUELL_WERT"> fuel mass [mg]</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_ABGASTEMPERATUR_VOR_KATALYSATOR_WERT"> exhaust before cat [°C]</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_LADEDRUCK_WERT"> act. boost pressure [mbar]</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_LADEDRUCK_SOLL_WERT"> target boost pressure [mbar]</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_UMGEBUNGSDRUCK_WERT"> air pressure [mbar]</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_RAILDRUCK_WERT"> act. rail pressure [bar]</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_RAILDRUCK_SOLL_WERT"> target rail pressure [bar]</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_FAHRZEUGBESCHLEUNIGUNG_WERT"> acceleration [m/s²]</string>
      <string name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_GESCHWINDIGKEIT_WERT"> speed [km/h]</string>
      <string name="!JOB#STATUS_TOENS_IO#STAT_TOG_HIGH_WERT">  TÖNS heating time [ms]</string>
      <string name="!JOB#STATUS_TOENS_IO#STAT_TOG_LOW_WERT">  TÖNS cooling time [ms]</string>
    </strings>  
    <jobs>
      <job sgbd="D50M57E1" name="STATUS_MESSWERTBLOCK_LESEN" args="JA;ILMMG;IPLAD;IPUMG;IUBAT;ITKUM;IMOAK;INMOT;ITKRS;ITLAL;IMEIA;ITAVO;SPLAD;IPRDR;SPRDR;IAFZG;IVKMH">
        <display name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_LUFTMASSE_PRO_HUB_WERT" result="STAT_LUFTMASSE_PRO_HUB_WERT" format="L" grid-type="simple-gauge-round" min-value="0" max-value="1500" log_tag="STAT_LUFTMASSE_PRO_HUB_WERT" />
        <display name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_LADEDRUCK_WERT" result="STAT_LADEDRUCK_WERT" format="4.1R" grid-type="simple-gauge-round" min-value="0" max-value="2500" log_tag="STAT_LADEDRUCK_WERT" />
        <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" />
        <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" />
        <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" />
        <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" />
        <display name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_KRAFTSTOFFTEMPERATURK_WERT" result="STAT_KRAFTSTOFFTEMPERATURK_WERT" format="2.1R" grid-type="simple-gauge-round" min-value="-20" max-value="80" log_tag="STAT_KRAFTSTOFFTEMPERATURK_WERT" />
        <display name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_LADELUFTTEMPERATUR_WERT" result="STAT_LADELUFTTEMPERATUR_WERT" format=".1R" grid-type="simple-gauge-round" min-value="-20" max-value="80" log_tag="STAT_LADELUFTTEMPERATUR_WERT" />
        <display name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_EINSPRITZMENGE_AKTUELL_WERT" result="STAT_EINSPRITZMENGE_AKTUELL_WERT" format="L" grid-type="simple-gauge-round" min-value="0" max-value="100" log_tag="STAT_EINSPRITZMENGE_AKTUELL_WERT" />
        <display name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_ABGASTEMPERATUR_VOR_KATALYSATOR_WERT" result="STAT_ABGASTEMPERATUR_VOR_KATALYSATOR_WERT" format="L" grid-type="simple-gauge-round" min-value="0" max-value="500" log_tag="STAT_ABGASTEMPERATUR_VOR_KATALYSATOR_WERT" />
        <display name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_LADEDRUCK_SOLL_WERT" result="STAT_LADEDRUCK_SOLL_WERT" format="4.1R" grid-type="simple-gauge-round" min-value="0" max-value="2500" log_tag="STAT_LADEDRUCK_SOLL_WERT" />
        <display name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_RAILDRUCK_WERT" result="STAT_RAILDRUCK_WERT" format="L" grid-type="simple-gauge-round" min-value="0" max-value="1400" log_tag="STAT_RAILDRUCK_WERT" />
        <display name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_RAILDRUCK_SOLL_WERT" result="STAT_RAILDRUCK_SOLL_WERT" format="L" grid-type="simple-gauge-round" min-value="0" max-value="1400" log_tag="STAT_RAILDRUCK_SOLL_WERT" />
        <display name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_FAHRZEUGBESCHLEUNIGUNG_WERT" result="STAT_FAHRZEUGBESCHLEUNIGUNG_WERT" format="2.3R" grid-type="simple-gauge-round" min-value="-15" max-value="15" log_tag="STAT_FAHRZEUGBESCHLEUNIGUNG_WERT" />
        <display name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_GESCHWINDIGKEIT_WERT" result="STAT_GESCHWINDIGKEIT_WERT" format="L" grid-type="simple-gauge-round" min-value="0" max-value="250" log_tag="STAT_GESCHWINDIGKEIT_WERT" />
        <display name="!JOB#STATUS_MESSWERTBLOCK_LESEN#STAT_UMGEBUNGSDRUCK_WERT" result="STAT_UMGEBUNGSDRUCK_WERT" format="4.1R" grid-type="simple-gauge-round" min-value="800" max-value="1300" log_tag="STAT_UMGEBUNGSDRUCK_WERT" />
      </job>
      <job sgbd="kombi46r" name="STATUS_TOENS_IO">
        <display name="!JOB#STATUS_TOENS_IO#STAT_TOG_HIGH_WERT" result="STAT_TOG_HIGH_WERT" format="L" grid-type="simple-gauge-round" min-value="0" max-value="1000" log_tag="STAT_TOG_HIGH_WERT" />
        <display name="!JOB#STATUS_TOENS_IO#STAT_TOG_LOW_WERT" result="STAT_TOG_LOW_WERT" format="L" grid-type="simple-gauge-round" min-value="0" max-value="1000" log_tag="STAT_TOG_LOW_WERT" />
      </job>
    </jobs>
    <code show_warnings="true">
    <![CDATA[
    class PageClass
    {
        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;

            switch (resultName)
            {
                case "STATUS_MESSWERTBLOCK_LESEN#STAT_MOTORDREHZAHL_WERT":
                    value = ActivityMain.GetResultDouble(resultDict, resultName, 0, out found);
                    
                    // result format: {0,[DIGITS TOTAL INCL COMMA],[0|0.0|0.00|0.000...]}
                    result = string.Format(ActivityMain.Culture, "{0,4:0}", value);
                    
					// Liste der möglichen Farbnamen: https://docs.microsoft.com/en-us/dotnet/api/android.graphics.color?view=xamarin-android-sdk-9
                    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_UBATT_WERT":
                    value = ActivityMain.GetResultDouble(resultDict, resultName, 0, out found);
                    
                    // result format: {0,[DIGITS TOTAL INCL COMMA],[0|0.0|0.00|0.000...]}
                    result = string.Format(ActivityMain.Culture, "{0,4:0.0}", value);
                    
                    if (found && value < 10.5) textColor = Android.Graphics.Color.Red;
                    else if (found && value < 11.5) textColor = Android.Graphics.Color.Orange;
                    else if (found && value <= 12.5) textColor = Android.Graphics.Color.Yellow;
                    else if (found && value <= 13.2) textColor = Android.Graphics.Color.Gray;
                    else if (found && value <= 14.5) textColor = Android.Graphics.Color.White;
                    else if (found && value > 14.5) textColor = Android.Graphics.Color.Red;
                    else textColor = Android.Graphics.Color.Gray;
                    
                    break;


                case "STATUS_MESSWERTBLOCK_LESEN#STAT_KUEHLMITTELTEMPERATUR_WERT":
                    value = ActivityMain.GetResultDouble(resultDict, resultName, 0, out found);
                    result = string.Format(ActivityMain.Culture, "{0,3:0}", value);
                    
                    if (found && value < 75) textColor = Android.Graphics.Color.Blue;
                    else if (found && value <= 105) textColor = Android.Graphics.Color.White;
                    else if (found && value <= 110) textColor = Android.Graphics.Color.Yellow;
                    else if (found && value <= 115) textColor = Android.Graphics.Color.Orange;
                    else if (found && value > 115) textColor = Android.Graphics.Color.Red;
                    else textColor = Android.Graphics.Color.Gray;
                    
                    break;
            }
            return result;
        }
    }
      ]]>
    </code>
  </page>
</fragment>