private async static void ProcessPackage(Package p) { switch (p.Opcode) { case (byte)Opcode.GPS_RESPONSE: { String[] packageData = p.Data.Split(','); dataFromDrone data = new dataFromDrone(); double d; DateTime dt; if (Double.TryParse(packageData[0], out d)) { data.Lat = d; } else { return; } if (Double.TryParse(packageData[1], out d)) { data.Lng = d; } else { return; } if (DateTime.TryParse(packageData[1], out dt)) { data.CurrTime = dt; } else { return; } data.DroneID = p.OriginatorAddress; bool resu = await Proxyhandler.instance.SendDroneStatus(data.DroneID, data.Lat, data.Lng, data.CurrTime, ""); _mainWindow.myRoute(data.Lat, data.Lng, data.CurrTime, ""); break; } case (byte)Opcode.PICTURE_RESPONSE: { //p.Data contains the whole picture break; } case (byte)Opcode.VIDEO_PACKAGE: { //p.Data contains an entire video frame //_mainWindow.SetNewImage(); break; } } return; }
public async static void HandleDroneData(dataFromDrone rcvData) { s3.RunWorkerAsync("'"); }