HOME Kühlmitteltemperatur [°C] Ladelufttemp. [°C] Drehzahl [U/min] Anhebung Leerlaufdrehzahl [u/min] Drehmoment [Nm]: Batteriespannung [V] Generatorlast [%] Zuheizer PWM [%] Ladedruck Ist [mbar] Ladedruck Soll [mbar] Luftmasse [mg/Hub] Luftdruck [mbar] Raildruck Ist [bar] Geschwindigkeit [km/h] Beschleunigung [m/s²] TÖNS Heizzeit [ms] TÖNS Kühlzeit [ms] HOME coolant [°C] charge air temperature [°C] engine speed [U/min] increase idle speed [rpm] torque [Nm]: voltage [V] alternator load [%] aux heater PWM [%] act. boost pressure [mbar] target boost pressure [mbar] air mass [mg/stroke] air pressure [mbar] act. rail pressure [bar] speed [km/h] acceleration [m/s²] TÖNS heating time [ms] TÖNS cooling time [ms] > resultSets_Temps; List> resultSets_Abgleich; public void ExecuteJob(EdiabasNet ediabas, ref MultiMap resultDict, bool firstCall) { List> resultSets; // Job 1 - ständig zu aktualisierende Werte ediabas.ArgString = "JA;ILMMG;IPLAD;IPUMG;IUBAT;IMOAK;INMOT;SPLAD;IPRDR;IAFZG;IVKMH;ITZUH;IGENL"; 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]); } // Job 2 - seltener zu aktualisierende Werte if(jobs2counter == 0) { ediabas.ArgString = "JA;ITKUM;ITLAL"; ediabas.ArgBinaryStd = null; ediabas.ResultsRequests = string.Empty; ediabas.ExecuteJob("STATUS_MESSWERTBLOCK_LESEN"); resultSets_Temps = ediabas.ResultSets; ediabas.ArgString = "lla"; ediabas.ArgBinaryStd = null; ediabas.ResultsRequests = string.Empty; ediabas.ExecuteJob("ABGLEICH_LESEN"); resultSets_Abgleich = ediabas.ResultSets; } else if(jobs2counter >= 10) { jobs2counter = 0; } else { jobs2counter++; } if (resultSets_Temps != null && resultSets_Temps.Count >= 2) { EdiabasThread.MergeResultDictionarys(ref resultDict, resultSets_Temps[1]); } if (resultSets_Abgleich != null && resultSets_Abgleich.Count >= 2) { EdiabasThread.MergeResultDictionarys(ref resultDict, resultSets_Abgleich[1], "LLA_"); } // EdiabasNet.ResultData resultData; int curr_auxHeatPWM = 0; if (resultSets[1].TryGetValue("STAT_ZUHEIZER_ANSTEUERUNG_WERT", out resultData)) { if (resultData.OpData is Int64) { curr_auxHeatPWM = (double)((Int64)resultData.OpData); } } int curr_motorTemp = 0; if (resultSets[1].TryGetValue("STAT_KUEHLMITTELTEMPERATUR_WERT", out resultData)) { if (resultData.OpData is Int64) { curr_motorTemp = (double)((Int64)resultData.OpData); } } if (curr_auxHeatPWM > conf_DetectAuxHeatAbove) { auxHeat_offCounter = conf_auxHeat_offCounter_max; if(!state_active_AuxHeat) { state_active_AuxHeat = true; increaseIdle_newValue = conf_IncreaseIdle_AuxHeat; //increaseIdle_sendCmd = true; } } else if (auxHeat_offCounter > 0) { auxHeat_offCounter--; } else if (auxHeat_offCounter == 0) { state_active_AuxHeat = false; } if(!state_active_AuxHeat) { if(curr_motorTemp < conf_EngineReallyColdBelow) { if(!state_active_ReallyColdEngine) { state_active_ReallyColdEngine = true; state_active_ColdEngine = false; state_active_WarmEngine = false; increaseIdle_newValue = conf_IncreaseIdle_ReallyColdEngine; } } else if(curr_motorTemp < conf_EngineColdBelow) { if(!state_active_ColdEngine) { state_active_ReallyColdEngine = false; state_active_ColdEngine = true; state_active_WarmEngine = false; increaseIdle_newValue = conf_IncreaseIdle_ColdEngine; } } else if(curr_motorTemp >= conf_EngineWarmAbove) { state_active_ColdEngine = false; if(!state_active_WarmEngine) { state_active_ReallyColdEngine = false; state_active_WarmEngine = true; state_active_ColdEngine = false; increaseIdle_newValue = conf_IncreaseIdle_WarmEngine; } } } if (increaseIdle_currentValue != increaseIdle_newValue) { ediabas.ArgString = "lla;" + increaseIdle_newValue; ediabas.ArgBinaryStd = null; ediabas.ResultsRequests = "JOB_STATUS"; ediabas.ExecuteJob("ABGLEICH_VERSTELLEN"); //resultSets = ediabas.ResultSets; //if (resultSets != null && resultSets.Count >= 2) //{ // EdiabasThread.MergeResultDictionarys(ref resultDict, resultSets[1]); //} // ablaufvariable wieder zurücksetzen, sonst würde diese funktion nun bei jedem folgenden durchlauf ausgeführt werden... //increaseIdle_sendCmd = false; increaseIdle_currentValue = increaseIdle_newValue; } } public string FormatResult(JobReader.PageInfo pageInfo, MultiMap resultDict, string resultName, ref Android.Graphics.Color? textColor) { string result = string.Empty; double value; bool found; switch (resultName) { case "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 "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 "STAT_GENERATORLAST_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,3:0}", value); if (found && value <= 60) textColor = Android.Graphics.Color.White; else if (found && value <= 70) textColor = Android.Graphics.Color.Yellow; else if (found && value <= 80) textColor = Android.Graphics.Color.Orange; else if (found && value > 80) textColor = Android.Graphics.Color.Red; else textColor = Android.Graphics.Color.Gray; break; case "STAT_ZUHEIZER_ANSTEUERUNG_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,3:0}", value); if (found && value <= 60) textColor = Android.Graphics.Color.White; else if (found && value <= 70) textColor = Android.Graphics.Color.Yellow; else if (found && value <= 80) textColor = Android.Graphics.Color.Orange; else if (found && value > 80) textColor = Android.Graphics.Color.Red; else textColor = Android.Graphics.Color.Gray; break; case "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; case "STAT_LADELUFTTEMPERATUR_WERT": value = ActivityMain.GetResultDouble(resultDict, resultName, 0, out found); result = string.Format(ActivityMain.Culture, "{0,3:0}", value); if (found && value <= 55) textColor = Android.Graphics.Color.White; else if (found && value <= 65) textColor = Android.Graphics.Color.Yellow; else if (found && value <= 75) textColor = Android.Graphics.Color.Orange; else if (found && value > 85) textColor = Android.Graphics.Color.Red; else textColor = Android.Graphics.Color.Gray; break; } return result; } } ]]> resultDict, bool firstCall) { if(callCounter == 0) { List> resultSets; // Job - ständig zu aktualisierende Werte ediabas.ArgString = string.Empty; ediabas.ArgBinaryStd = null; ediabas.ResultsRequests = string.Empty; ediabas.ExecuteJob("STATUS_TOENS_IO"); resultSets = ediabas.ResultSets; if (resultSets != null && resultSets.Count >= 2) { EdiabasThread.MergeResultDictionarys(ref resultDict, resultSets[1]); } } else { if(callCounter < 15) callCounter++; else callCounter = 0; } } } ]]>