public DetectionDataPacket(IncomingRawUdpPacket packetWrapper) { this.incomingRawUdpPacket = packetWrapper; packet = new Datapackets(packetWrapper.RawBytes) { Address = incomingRawUdpPacket.IPAddress, Persisteddate = DateTime.Now.Ticks }; }
public static DetectionInstance FromPacket(Datapackets packet) { // Detection data packet has epoch, calc first peak, related status, create detection instance long possibleStrikeTime = packet.Received; var peakData = PeakDetect.GetMaxPeak(packet.Data.GetPeaks()); // from the index work out the time difference double possibleStrikeTimeDec = possibleStrikeTime + peakData.Item1 * 1 / 3.6e6; return(new DetectionInstance() { DetectionTime = possibleStrikeTimeDec }); }