private static IMessage FactoryEventWithoutPosition(int id, ulong mid, MessageIdentifier mi, String datastring) { var res = mi.FactoryEvent(id, mid, null, ((GPSPoint)null).GetDate(), null, null); res.SensorsDataString = datastring; return(res); }
private static IMessage ParseEventWithPosition(int id, ulong mid, String[] s, MessageIdentifier ev, DateTime dtsent) { var pos = ParseGpsPoint(s, 6); if (pos.GetDate().AddHours(12) < dtsent) { pos = null; } return(ev.FactoryEvent(id, mid, pos, dtsent, null, null)); }
private static IMessage ParseEventWithPosition(int id, ulong mid, String[] s, MessageIdentifier ev, DateTime dtsent, int offset, String datastring) { var pos = ParseGpsPoint(s, offset); if (pos.GetDate().AddHours(12) < dtsent) { pos = null; } var res = ev.FactoryEvent(id, mid, pos, dtsent, null, null); res.SensorsDataString = datastring; return(res); }
private static IMessage ParseBateryInfo(int id, ulong mid, MessageIdentifier mi, String[] s) { var ev = mi.FactoryEvent(id, mid, null, ((GPSPoint)null).GetDate(), null, null); ev.SensorsDataString = String.Format(CultureInfo.InvariantCulture, "ExternalPowerSupplyFlag:{0},BatteryPercentage:{1},BatteryVoltage:{2},ChargingFlag:{3},LedOnFlag:{4}", s[7], //External power supply, Boolean s[9], //Battery percentage, 0..100 s[10], //Battery voltage, 0..450 (0.0V .. 4.50V) s[11], //Charging, Boolean s[12]); //LED on, Boolean return(ev); }
private static IMessage FactoryBrusca(String[] partes, INode node, GPSPoint evpos, MessageIdentifier ev, ulong mid) { var res = ev.FactoryEvent(node.Id, mid, evpos, evpos.GetDate(), null, null); res.SensorsDataString = String.Format( CultureInfo.InvariantCulture, "VelocidadInicial:{0},VelocidadFinal:{1},LapsoProgramado:{2}", Speed.KnotToKm(Convert.ToInt16(partes[5])), Speed.KnotToKm(Convert.ToInt16(partes[6])), Convert.ToInt16(partes[7])); STrace.Debug(typeof(Entrante).FullName, node.Id, String.Format("{0} {1}", ev, res.SensorsDataString)); return(res); }
private static IMessage ParseEventWithoutPosition(int id, ulong mid, MessageIdentifier mi) { return(mi.FactoryEvent(id, mid, null, DateTime.UtcNow, null, null)); }
private static IMessage ParseEventWithPosition(int id, ulong mid, String[] s, MessageIdentifier mi) { var pos = ParseGpsPoint(s); return(mi.FactoryEvent(id, mid, pos, pos.GetDate(), null, null)); }
public static Event CreateGenericEvent(MessageIdentifier messageIdentifier, Dispositivo dispositivo, DateTime date, IEnumerable <Int64> extraData) { return(messageIdentifier.FactoryEvent(MessageIdentifier.GenericMessage, dispositivo.Id, 0, null, date, null, extraData)); }