Browse Source

PDC hinzu mit farbigen Anzeigen

FloKra 3 years ago
parent
commit
3b13de9ef5
2 changed files with 197 additions and 0 deletions
  1. 186 0
      PDC/PDCACT.ccpage
  2. 11 0
      PDC/README.md

+ 186 - 0
PDC/PDCACT.ccpage

@@ -0,0 +1,186 @@
+<?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="PDC" fontsize="small" display-mode="grid" gauges-portrait="2" gauges-landscape="4" logfile="PDCACT.log">
+    <strings>
+      <string name="PDC">PDC</string>
+      <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_HL_WERT">  back left [cm]</string>
+      <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_HML_WERT">  back left middle [cm]</string>
+      <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_HMR_WERT">  back right middle [cm]</string>
+      <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_HR_WERT">  back right [cm]</string>
+      <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_VL_WERT">  front left [cm]</string>
+      <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_VML_WERT">  front left middle [cm]</string>
+      <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_VMR_WERT">  front right middle [cm]</string>
+      <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_VR_WERT">  front right [cm]</string>
+    </strings>
+	<strings lang="de">
+      <string name="PDC">PDC</string>
+      <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_HL_WERT">  Hinten Links [cm]</string>
+      <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_HML_WERT">  Hinten Links Mitte [cm]</string>
+      <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_HMR_WERT">  Hinten Rechts Mitte [cm]</string>
+      <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_HR_WERT">  Hinten Rechts [cm]</string>
+      <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_VL_WERT">  Vorn Links [cm]</string>
+      <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_VML_WERT">  Vorn Links Mitte [cm]</string>
+      <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_VMR_WERT">  Vorn Rechts Mitte [cm]</string>
+      <string name="!JOB#STATUS_MESSWERTE_LESEN#STAT_WEG_VR_WERT">  Vorn Rechts [cm]</string>
+    </strings>
+    <jobs sgbd="pdcact">
+      <job name="STATUS_MESSWERTE_LESEN">
+        <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" />
+		<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" />
+        <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" />
+		<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" />
+	    <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" />
+		<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" />
+        <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" />
+		<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" />
+      </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;
+            Int64 value;
+            bool found;
+
+            switch (resultName)
+            {
+                case "STATUS_MESSWERTE_LESEN#STAT_WEG_VL_WERT":
+                    value = ActivityMain.GetResultInt64(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,3: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 <= 20) textColor = Android.Graphics.Color.Red;
+                    else if (found && value <= 40) textColor = Android.Graphics.Color.Orange;
+                    else if (found && value <= 80) textColor = Android.Graphics.Color.Yellow;
+					else if (found && value <= 100) textColor = Android.Graphics.Color.Green;
+					else if (found && value > 200) textColor = Android.Graphics.Color.White;
+                    else textColor = Android.Graphics.Color.Gray;
+                    
+                    break;
+					
+                case "STATUS_MESSWERTE_LESEN#STAT_WEG_VML_WERT":
+                    value = ActivityMain.GetResultInt64(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,3: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 <= 20) textColor = Android.Graphics.Color.Red;
+                    else if (found && value <= 40) textColor = Android.Graphics.Color.Orange;
+                    else if (found && value <= 80) textColor = Android.Graphics.Color.Yellow;
+					else if (found && value <= 100) textColor = Android.Graphics.Color.Green;
+					else if (found && value > 200) textColor = Android.Graphics.Color.White;
+                    else textColor = Android.Graphics.Color.Gray;
+                    
+                    break;
+					
+                case "STATUS_MESSWERTE_LESEN#STAT_WEG_VMR_WERT":
+                    value = ActivityMain.GetResultInt64(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,3: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 <= 20) textColor = Android.Graphics.Color.Red;
+                    else if (found && value <= 40) textColor = Android.Graphics.Color.Orange;
+                    else if (found && value <= 80) textColor = Android.Graphics.Color.Yellow;
+					else if (found && value <= 100) textColor = Android.Graphics.Color.Green;
+					else if (found && value > 200) textColor = Android.Graphics.Color.White;
+                    else textColor = Android.Graphics.Color.Gray;
+                    
+                    break;
+					
+                case "STATUS_MESSWERTE_LESEN#STAT_WEG_VR_WERT":
+                    value = ActivityMain.GetResultInt64(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,3: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 <= 20) textColor = Android.Graphics.Color.Red;
+                    else if (found && value <= 40) textColor = Android.Graphics.Color.Orange;
+                    else if (found && value <= 80) textColor = Android.Graphics.Color.Yellow;
+					else if (found && value <= 100) textColor = Android.Graphics.Color.Green;
+					else if (found && value > 200) textColor = Android.Graphics.Color.White;
+                    else textColor = Android.Graphics.Color.Gray;
+                    
+                    break;
+					
+                case "STATUS_MESSWERTE_LESEN#STAT_WEG_HL_WERT":
+                    value = ActivityMain.GetResultInt64(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,3: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 <= 20) textColor = Android.Graphics.Color.Red;
+                    else if (found && value <= 40) textColor = Android.Graphics.Color.Orange;
+                    else if (found && value <= 80) textColor = Android.Graphics.Color.Yellow;
+					else if (found && value <= 100) textColor = Android.Graphics.Color.Green;
+					else if (found && value > 200) textColor = Android.Graphics.Color.White;
+                    else textColor = Android.Graphics.Color.Gray;
+                    
+                    break;
+					
+                case "STATUS_MESSWERTE_LESEN#STAT_WEG_HML_WERT":
+                    value = ActivityMain.GetResultInt64(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,3: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 <= 20) textColor = Android.Graphics.Color.Red;
+                    else if (found && value <= 40) textColor = Android.Graphics.Color.Orange;
+                    else if (found && value <= 80) textColor = Android.Graphics.Color.Yellow;
+					else if (found && value <= 100) textColor = Android.Graphics.Color.Green;
+					else if (found && value > 200) textColor = Android.Graphics.Color.White;
+                    else textColor = Android.Graphics.Color.Gray;
+                    
+                    break;
+					
+                case "STATUS_MESSWERTE_LESEN#STAT_WEG_HMR_WERT":
+                    value = ActivityMain.GetResultInt64(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,3: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 <= 20) textColor = Android.Graphics.Color.Red;
+                    else if (found && value <= 40) textColor = Android.Graphics.Color.Orange;
+                    else if (found && value <= 80) textColor = Android.Graphics.Color.Yellow;
+					else if (found && value <= 100) textColor = Android.Graphics.Color.Green;
+					else if (found && value > 200) textColor = Android.Graphics.Color.White;
+                    else textColor = Android.Graphics.Color.Gray;
+                    
+                    break;
+					
+                case "STATUS_MESSWERTE_LESEN#STAT_WEG_HR_WERT":
+                    value = ActivityMain.GetResultInt64(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,3: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 <= 20) textColor = Android.Graphics.Color.Red;
+                    else if (found && value <= 40) textColor = Android.Graphics.Color.Orange;
+                    else if (found && value <= 80) textColor = Android.Graphics.Color.Yellow;
+					else if (found && value <= 100) textColor = Android.Graphics.Color.Green;
+					else if (found && value > 200) textColor = Android.Graphics.Color.White;
+                    else textColor = Android.Graphics.Color.Gray;
+                    
+                    break;
+					
+
+            }
+            return result;
+        }
+    }
+      ]]>
+    </code>
+  </page>
+</fragment>

+ 11 - 0
PDC/README.md

@@ -0,0 +1,11 @@
+# DeepOBDConf
+
+## PDC
+
+Fahrzeuge: E46, E39
+
+
+
+#### Changelog
+
+19.11.2020: erweitert um farbige Anzeigen (korrigierte Version von André)