예제 #1
0
        public async Task Initialize()
        {
            try
            {
                var i2Init  = _i2CConnector.Initialize();
                var spiInit = _spiConnector.Initialize();

                await spiInit;
                await i2Init;

                var factory = new GeneralFactory(_i2CConnector, _spiConnector, _driverLogger);

                foreach (var foundGroupId in _spiConnector.GetFoundGroupIds())
                {
                    var board = factory.CreateNeuronBoard(foundGroupId);

                    if (board == null)
                    {
                        continue;
                    }

                    _driverLogger.LogInformation(this, "Found Board " + board.BoardSystemInformation?.HardwareName + " on group " + foundGroupId);
                    _boards.Add(board);
                }

                OnInitializationFinish?.Invoke();
            }
            catch (Exception exception)
            {
                _driverLogger.LogException(this, exception);
            }
        }
예제 #2
0
        public void InitializationFinish()
        {
            UiManager.StartNewGameSession(Environment.Session);
            OnInitializationFinish?.Invoke(Environment);

            SessionResume();
        }