Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="options">if <c>null</c> set to default <see cref="BrickOptions"/></param>
        /// <param name="logger">if <c>null</c> set to default <see cref="NullLogger"/></param>
        public Brick(BrickOptions options = null, ILogger <Brick> logger = null) : base(ChainLayer.One)
        {
            Options = options ?? new BrickOptions();
            Logger  = logger ?? new NullLogger <Brick>();

            Console = new BrickConsole();
            Sound   = new Sound();
            Display = new Display();
            Led     = new Led();
            Battery = new Battery();
            Drive   = new Drive();
            Buttons = new Buttons();
            Memory  = new Memory();

            //Init IO Ports
            IOPort = new IOPort();
            Slave1 = new IOPorts(ChainLayer.Two);
            Slave2 = new IOPorts(ChainLayer.Three);
            Slave3 = new IOPorts(ChainLayer.Four);

            //add ports to internal dictionary
            IOPort.AddPorts(this);
            IOPort.AddPorts(Slave1);
            IOPort.AddPorts(Slave2);
            IOPort.AddPorts(Slave3);

            //connect any devices from configuration if available
            DeviceConfiguration.Connect(IOPort, Options.Devices);
        }
        public Manager()
        {
            InitializeComponent();

            //init the brick
            BrickOptions options = new BrickOptions();

            options.DisablePowerUpSelfTest();
            options.DisableEventMonitor();
            Brick = new Brick(options);

            //load the user settings
            UserSettings.Initialize();
        }
 private void ButtonSave_Click(object sender, EventArgs e)
 {
     BrickOptions brickOptions = new BrickOptions();
 }