Example #1
0
        private bool autoresumeEnabled;                 //This is fetched from settings and set in the constructor

        public DetectorLoop(Config config, TemtemTableController tableController, OCRController ocrController, SettingsController settingsController)
        {
            this.config             = config;
            this.tableController    = tableController;
            this.ocrController      = ocrController;
            this.settingsController = settingsController;

            spot1RGB = ColorTranslator.FromHtml(config.spot1RGB).ToArgb();
            spot2RGB = ColorTranslator.FromHtml(config.spot2RGB).ToArgb();
            spot3RGB = ColorTranslator.FromHtml(config.spot3RGB).ToArgb();
            spot4RGB = ColorTranslator.FromHtml(config.spot4RGB).ToArgb();
            spot5RGB = ColorTranslator.FromHtml(config.spot5RGB).ToArgb();
            spot6RGB = ColorTranslator.FromHtml(config.spot6RGB).ToArgb();
            spot7RGB = ColorTranslator.FromHtml(config.spot7RGB).ToArgb();
            spot8RGB = ColorTranslator.FromHtml(config.spot8RGB).ToArgb();

            this.maxAllowedColorDistance = config.maxAllowedColorDistance;

            this.windowAndProcessNames = config.windowAndProcessNames;

            temtemWindows = new Dictionary <uint, TemtemWindowData>();

            //Get relevant settings from the settings controller
            detectionDisabledWhileTimerPaused = settingsController.GetUserSettings().disableDetectionWhileTimerPaused;
            autoresumeEnabled = settingsController.GetUserSettings().resumeAutopausedTimerOnDetection;

            //Add listeners for relevant setting changes
            settingsController.TimerPausedToggled       += TimerPausedListener;
            settingsController.TimerAutopaused          += TimerAutopauseListener;
            settingsController.DetectionDisabledChanged += DetectionDisabledListener;
            settingsController.AutoresumeEnabledChanged += AutoresumeEnabledListener;
        }
Example #2
0
        public DetectorLoop(Config config, TemtemTableController tableController, OCRController ocrController)
        {
            this.config          = config;
            this.tableController = tableController;
            this.ocrController   = ocrController;

            spot1RGB = ColorTranslator.FromHtml(config.spot1RGB).ToArgb();
            spot2RGB = ColorTranslator.FromHtml(config.spot2RGB).ToArgb();
            spot3RGB = ColorTranslator.FromHtml(config.spot3RGB).ToArgb();
            spot4RGB = ColorTranslator.FromHtml(config.spot4RGB).ToArgb();
            spot5RGB = ColorTranslator.FromHtml(config.spot5RGB).ToArgb();
            spot6RGB = ColorTranslator.FromHtml(config.spot6RGB).ToArgb();

            this.maxAllowedColorDistance = config.maxAllowedColorDistance;

            temtemWindows = new Dictionary <uint, TemtemWindowData>();
        }