Presentation is loading. Please wait.

Presentation is loading. Please wait.

Ondrej Stastny Microsoft Premier Field Engineer Windows 8.1 Äpipäev.

Similar presentations


Presentation on theme: "Ondrej Stastny Microsoft Premier Field Engineer Windows 8.1 Äpipäev."— Presentation transcript:

1 Ondrej Stastny Microsoft Premier Field Engineer Windows 8.1 Äpipäev

2

3

4

5

6 // create the data stream SpeechSynthesisStream synthesisStream; synthesisStream = await this.synthesizer.SynthesizeSsmlToStreamAsync(text); // start this audio stream playing this.media.AutoPlay = true; this.media.SetSource(synthesisStream, synthesisStream.ContentType); this.media.Play();

7

8 public static async Task ConnectToDrone() { // Set up the UDP connection string remotePort = "5556"; HostName droneIP = new HostName("192.168.1.1"); udpSocket = new DatagramSocket(); await udpSocket.BindServiceNameAsync(remotePort); await udpSocket.ConnectAsync(droneIP, remotePort); udpWriter = new DataWriter(udpSocket.OutputStream); }

9 public static async Task SendDroneCommand(string command) { udpWriter.WriteString(command); await udpWriter.StoreAsync(); }

10 // Strafe drone forward or backward at velocity in range [-1,1] public static string GetDroneStrafeForwardBackward(uint sequenceNumber, double velocity) { // Convert the ratio into a value the drone understands int value = FloatConversion(velocity); return CreateATPCMDCommand(sequenceNumber, "0," + value + ",0,0"); } // Return a full ATPCMD command private static string CreateATPCMDCommand(uint sequenceNumber, string command) { return "AT*PCMD=" + sequenceNumber + ",1," + command + Environment.NewLine; }

11

12

13

14 protected virtual void RegisterForPrinting() { // Create the PrintDocument. printDocument = new PrintDocument(); // Save the DocumentSource. printDocumentSource = printDocument.DocumentSource; // Add an event handler which creates preview pages. printDocument.Paginate += CreatePrintPreviewPages; // Add an event handler which provides a specified preview page. printDocument.GetPreviewPage += GetPrintPreviewPage; // Add an event handler which provides all final print pages. printDocument.AddPages += AddPrintPages; // Create a PrintManager and add a handler for printing initialization. PrintManager printMan = PrintManager.GetForCurrentView(); printMan.PrintTaskRequested += PrintTaskRequested; // Initialize print content for this scenario PreparePrintContent(); }


Download ppt "Ondrej Stastny Microsoft Premier Field Engineer Windows 8.1 Äpipäev."

Similar presentations


Ads by Google