Пример #1
0
        public Shield(ShieldType shieldtype, Base.UControllerType basetype)
        {
            Type       = shieldtype;
            ShieldBase = new Base(basetype);
            Connectors = new List <Connector>();
            TimeEvents = new List <TimeEvent>();

            switch (shieldtype)
            {
            case ShieldType.Central:
                break;

            case ShieldType.Roseta:
                //Definimos un tipo Roseta generico: 2 digitales, 2 analogicos, 3 PWM, 1 dimmer
                AddConnector("Digital0", Enums.ConnectorType.IODigital, new String[] { "A0" });
                AddConnector("Digital1", Enums.ConnectorType.IODigital, new String[] { "A1" });
                AddConnector("Analog0", Enums.ConnectorType.Analog, new String[] { "F0" });
                AddConnector("Analog1", Enums.ConnectorType.Analog, new String[] { "F1" });
                AddConnector("Analog2", Enums.ConnectorType.Analog, new String[] { "F2" });
                AddConnector("PWM", Enums.ConnectorType.IODigital, new String[] { "B4", "B7", "G5" });
                AddConnector("Dimmer0", Enums.ConnectorType.Dimmer, new String[] { "G0" });
                break;

            case ShieldType.Regleta:
                break;

            case ShieldType.Lampara:
                break;

            default:
                throw new Exception();
            }
        }
Пример #2
0
        public Node(String name, bool movil, Shield.ShieldType shieldtype, Base.UControllerType basetype)
        {
            NodeAddress = 0x00; //TODO: Calcular
            Name        = name;
            Movil       = movil;
            if (movil)
            {
                CalculatePosition();
            }
            else
            {
                NodePosition = new Position()
                {
                    Floor = "", X = 0, Y = 0
                };
            }

            NodeShield = new Shield(shieldtype, basetype);
        }