public static bool VerfuegbarePID(Messgroesse m, byte[] b) { try { string[] pidZerlegt = m.zugriff.Split(" "); byte index = byte.Parse(pidZerlegt[1], System.Globalization.NumberStyles.AllowHexSpecifier); System.Collections.BitArray bits = new System.Collections.BitArray(b); //umdrehen? var l = new List <String>(); m.wert_string = ""; for (int i = 0; i < 32; ++i) { l.Add("PID " + pidZerlegt[0] + " " + (index + 1).ToString() + ": " + (bits[i] ? "Ja" : "Noi")); m.wert_string += l[i] + "\n"; } m.wert = l; return(true); } catch (Exception e) { if (Zugriff.DebugAusgabe) { Zugriff.Ausgabe("VerfuegbarePID erstellen Exception " + e.ToString()); } } return(false); }
public static bool ErstelleKraftstoffdruck(Messgroesse m, byte[] b) { try { int druck = 3 * b[0]; m.wert = druck; m.wert_string = druck.ToString(); } catch (Exception e) { if (Zugriff.DebugAusgabe) { Zugriff.Ausgabe("Kraftstoffdruck erstellen Exception " + e.ToString()); } } return(false); }
public static bool ErstelleGaspedal(Messgroesse m, byte[] b) { try { float stellung = 100 / 255 * b[0]; m.wert = stellung; m.wert_string = stellung.ToString(); } catch (Exception e) { if (Zugriff.DebugAusgabe) { Zugriff.Ausgabe("ErstelleGaspedal Exception " + e.ToString()); } } return(false); }
public static bool ErstelleMassenstrom(Messgroesse m, byte[] b) { try { double strom = (256 * b[0] + b[1]) / 100; m.wert = strom; m.wert_string = strom.ToString(); } catch (Exception e) { if (Zugriff.DebugAusgabe) { Zugriff.Ausgabe("Massenstrom erstellen Exception " + e.ToString()); } } return(false); }
public static bool ErstelleTempWasserUOel(Messgroesse m, byte[] b) { try { int temperatur = b[0] - 40; m.wert = temperatur; m.wert_string = temperatur.ToString(); return(true); } catch (Exception e) { if (Zugriff.DebugAusgabe) { Zugriff.Ausgabe("Temperatur erstellen Exception " + e.ToString()); } } return(false); }
public static bool ErstelleDrehzahl(Messgroesse m, byte[] b) { try { int drehzahl = (256 * b[0] + b[1]) / 4; m.wert = drehzahl; m.wert_string = drehzahl.ToString(); return(true); } catch (Exception e) { if (Zugriff.DebugAusgabe) { Zugriff.Ausgabe("Drehzahl erstellen Exception " + e.ToString()); } } return(false); }