Exemple #1
0
        public NotificationServer(
            IHubContext <OverlayHub> overlayHubContext,
            IHubContext <TTSMarqueeHub> ttsMarqueeHubContext,
            IWebHostEnvironment env)
        {
            _overlayHubContext    = overlayHubContext;
            _ttsMarqueeHubContext = ttsMarqueeHubContext;

            imagePath = Path.Combine(env.WebRootPath, "Assets", "Images");

            imageURLs = new DepletableBag <string>()
            {
                AutoRefill = true
            };

            foreach (string imagePath in Directory.GetFiles(imagePath))
            {
                string url = $"{ASSET_URL}/{Path.GetFileName(imagePath)}";
                imageURLs.Add(url);
            }
        }
        public void Initialize(double taskGuessRate)
        {
            trial        = 0;
            repetitions  = 0;
            correctCount = 0;

            stepBag = new DepletableBag <ConstantStimSet>()
            {
                AutoRefill = false
            };

            int dim1Limit = StimDimensions.GetSteps(0);
            int dim2Limit = StimDimensions.GetSteps(1);
            int dim3Limit = StimDimensions.GetSteps(2);
            int dim4Limit = StimDimensions.GetSteps(3);

            for (int dim1 = 0; dim1 < dim1Limit; dim1++)
            {
                for (int dim2 = 0; dim2 < dim2Limit; dim2++)
                {
                    for (int dim3 = 0; dim3 < dim3Limit; dim3++)
                    {
                        for (int dim4 = 0; dim4 < dim4Limit; dim4++)
                        {
                            //One copy for each track
                            for (int track = 0; track < Tracks; track++)
                            {
                                stepBag.Add(new ConstantStimSet(dim1, dim2, dim3, dim4));
                            }
                        }
                    }
                }
            }

            this.taskGuessRate = taskGuessRate;
        }