public void GetLayout() { _layout = _nanoleafClient.LayoutEndpoint.GetLayout(); _globalOrientation = _nanoleafClient.LayoutEndpoint.GetGlobalOrientation(); if (_layout == null || _layout.NumberOfPanels <= 0) { return; } ConstructPanelsAsPolygons(); //Set the device type according to the type of panels switch (_layout.PanelPositions.ElementAt(0).ShapeType) { case ShapeType.ContolSquarePassive: case ShapeType.ControlSquarePrimary: case ShapeType.Square: DeviceType = DeviceType.Canvas; break; case ShapeType.Triangle: DeviceType = DeviceType.Aurora; break; } }
public void GetLayout() { _layout = _nanoleafClient.LayoutEndpoint.GetLayout(); _globalOrientation = _nanoleafClient.LayoutEndpoint.GetGlobalOrientation(); if (_layout == null || _layout.NumberOfPanels <= 0) { return; } ConstructPanelsAsPolygons(); //Set the device type according to the type of panels (which panel type occurs most) switch (_layout.PanelPositions.GroupBy(panel => panel.ShapeType).OrderByDescending(group => group.Count()).First().Key) { case ShapeType.ContolSquarePassive: case ShapeType.ControlSquarePrimary: case ShapeType.Square: DeviceType = DeviceType.Canvas; break; case ShapeType.Triangle: DeviceType = DeviceType.Aurora; break; case ShapeType.Hexagon: DeviceType = DeviceType.Hexagon; break; default: DeviceType = DeviceType.Unknown; break; } }
public void GetLayout() { _layout = _nanoleafClient.LayoutEndpoint.GetLayout(); _globalOrientation = _nanoleafClient.LayoutEndpoint.GetGlobalOrientation(); if (_layout != null) { ConstructPanelsAsTriangles(); } }