void AddJsonDevice(JsonObject jdev) { var name = jdev["Name"].AsString(); var hostname = jdev["HostName"].AsString(); var pixelcount = jdev["PixelCount"].AsNumber(); Debug.Print("got device [{0}] HostName [{1}] PixelCount [{2}]", name, hostname, pixelcount); var dev = new SequenceDeviceBasic(name, hostname, (int)pixelcount); // @todo: do we care about silently ignoring decimals in the JSON? Devices.Add(name, dev); Program.AddDevice(dev); }
public override void SetDiscoveredDevices(IEnumerable <IGlimDevice> devices) { var gf = new GlimPixelMap.Factory(); foreach (var d in devices) { var sd = new SequenceDeviceBasic(d.HostName, d.HostName, 300); mDevices.Add(sd); gf.Add(sd); } mPixelMap = gf.Compile(); }
public SequenceParty() { Luminance = AddLuminanceControl(x => { }); Saturation = AddSaturationControl(x => { }); // comets! mGlimRedGun = new GlimDescriptor("Red", "GlimSwarm-103", 150, Color.Red); mGlimBlueGun = new GlimDescriptor("Blue", "GlimSwarm-104", 100, Color.Blue); mGlimStars = new SequenceDeviceBasic("Stars", "GlimSwarm-102", 150); mFxBarrel = new FxComet { BaseColor = Color.FromArgb(0xff, 0, 0xff), PixelCount = 50 }; mFxCannonTwinkle = new FxStarlightTwinkle { BaseColor = Color.FromArgb(0xff, 0, 0xff), SpeedFactor = 15.0, LuminanceMinima = 0.2, LuminanceMaxima = 0.8 }; mPixelMapStars = new GlimPixelMap.Factory { mGlimStars }.Compile(); mPixelMapBarrel = new GlimPixelMap.Factory { { mGlimRedGun, 100, 50 } }.Compile(); mPixelMapPerimeter = new GlimPixelMap.Factory { { mGlimRedGun, 0, 100 }, { mGlimBlueGun, 100, -100 } }.Compile(); mFxPerimeterRainbow = new FxScale(new FxRainbow()); mFxStarlight = new FxScale(new FxStarlightTwinkle { BaseColor = Color.Yellow }) { Saturation = 0.3 }; }