示例#1
0
        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;
            }
        }
示例#2
0
        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;
            }
        }
示例#3
0
        public void GetLayout()
        {
            _layout            = _nanoleafClient.LayoutEndpoint.GetLayout();
            _globalOrientation = _nanoleafClient.LayoutEndpoint.GetGlobalOrientation();

            if (_layout != null)
            {
                ConstructPanelsAsTriangles();
            }
        }