public void SingletonTest() { var service = EnlightFountainService.GetInstance("url", "key"); var service2 = EnlightFountainService.GetInstance(null, null); Assert.ReferenceEquals(service, service2); }
public void MethodPostTest() { var service = EnlightFountainService.GetInstance(SERVER_URL, "some alphanumeric api key"); var msg = new EnlightFountainControlLibrary.Messages.Control.RequestControl(15); RequestControlResponse model = service.SendMessage <RequestControlResponse>(msg); Assert.IsNotNull(model); }
public void MethodGetTest() { var service = EnlightFountainService.GetInstance(SERVER_URL, "some alphanumeric api key"); var msg = new EnlightFountainControlLibrary.Messages.Control.QueryControlList(); FountainControllerList list = service.SendMessage <FountainControllerList>(msg); Assert.IsNotNull(list); }
private void OnLoaded(object sender, RoutedEventArgs routedEventArgs) { // TODO: initialize up EnlightFountainService enlightFountainService = EnlightFountainService.GetInstance(ENLIGHT_WEBSERVER_URL, ENLIGHT_API_KEY); this.sensorChooser = new KinectSensorChooser(); this.sensorChooser.KinectChanged += SensorChooserOnKinectChanged; this.sensorChooserUi.KinectSensorChooser = this.sensorChooser; this.sensorChooser.Start(); this.FillScrollContent(); // Create the drawing group we'll use for drawing this.drawingGroup = new DrawingGroup(); // Create an image source that we can use in our image control this.imageSource = new DrawingImage(this.drawingGroup); // Display the drawing using our image control SkeletonOverlay.Source = this.imageSource; this.sensor = sensorChooser.Kinect; if (sensor != null) { // Turn on the skeleton stream to receive skeleton frames this.sensor.SkeletonStream.Enable(); // Add an event handler to be called whenever there is new color frame data this.sensor.SkeletonFrameReady += this.SensorSkeletonFrameReady; // Turn on the color stream to receive color frames this.sensor.ColorStream.Enable(ColorImageFormat.RgbResolution640x480Fps30); // Allocate space to put the pixels we'll receive this.colorPixels = new byte[this.sensor.ColorStream.FramePixelDataLength]; // This is the bitmap we'll display on-screen this.colorBitmap = new WriteableBitmap(this.sensor.ColorStream.FrameWidth, this.sensor.ColorStream.FrameHeight, 96.0, 96.0, PixelFormats.Bgr32, null); this.KinectFeed.Source = colorBitmap; // Add an event handler to be called whenever there is new color frame data this.sensor.ColorFrameReady += this.SensorColorFrameReady; } }