Example #1
0
        private void StartAHMSetup()
        {
            lock (mutex)
            {
                if (cameraMouseAssist != null)
                {
                    cameraMouseAssist.Dispose();
                    cameraMouseAssist = null;
                }

                cameraMouseAssist = new AHMCameraMouseAssist();

                if (setupType.Equals(AHMSetupType.KeyPress))
                {
                    ahmSetup = new AHMKeyPressSetup();
                }
                else if (setupType.Equals(AHMSetupType.Movement30Sec))
                {
                    ahmSetup = new AHMRectangleSetup(30, mouseControlModuleStandard);
                }
                else if (setupType.Equals(AHMSetupType.Movement45Sec))
                {
                    ahmSetup = new AHMRectangleSetup(45, mouseControlModuleStandard);
                }
                else if (setupType.Equals(AHMSetupType.Movement60Sec))
                {
                    ahmSetup = new AHMRectangleSetup(60, mouseControlModuleStandard);
                }
                else if (setupType.Equals(AHMSetupType.MovementInfinite))
                {
                    ahmSetup = new AHMRectangleSetup(0, mouseControlModuleStandard);
                }
                else if (setupType.Equals(AHMSetupType.Timing15Sec))
                {
                    ahmSetup = new AHMTimingSetup(15);
                }
                else if (setupType.Equals(AHMSetupType.Timing10Sec))
                {
                    ahmSetup = new AHMTimingSetup(10);
                }

                ahmSetup.NumTemplates         = numTemplates;
                ahmSetup.TrackingSuiteAdapter = trackingSuiteAdapter;
                //ahmSetup.FinishedSetup = SetupFinished;
                ahmSetup.ImageSize = imageSize;
                ahmSetup.ObsSize   = obsSize;
                ahmSetup.RatioVideoInputToMaxOutput = trackingSuiteAdapter.GetRatioInputToOutput()[0];
                ahmSetup.Init(1);
            }
        }
        public void LoadFromControls()
        {
            if (trackingModule == null)
            {
                return;
            }
            isLoading = true;

            AHMSetupType setupType = trackingModule.SetupType;

            if (setupType.Equals(AHMSetupType.Timing15Sec))
            {
                this.comboBoxSetupType.SelectedItem = "Natural Movement";
            }
            else
            {
                trackingModule.SetupType            = AHMSetupType.Movement30Sec;
                this.comboBoxSetupType.SelectedItem = "Rectangle Movement";
            }

            int updateFrequency = trackingModule.UpdateFrequency;

            if (updateFrequency == 0)
            {
                this.comboBoxUpdateFequency.SelectedItem = "Fast";
            }
            else
            {
                trackingModule.UpdateFrequency           = 500;
                this.comboBoxUpdateFequency.SelectedItem = "Slow";
            }

            this.checkBoxAutoStart.Checked = trackingModule.AutoStartMode == AutoStartMode.NoseMouth;

            isLoading = false;
        }
        public void LoadFromControls()
        {
            if (trackingModule == null)
            {
                return;
            }

            isLoading = true;
            this.lightingCorrection.Checked   = trackingModule.KernelLightingCorrection;
            this.checkBoxExtraDisplay.Checked = trackingModule.ExtraDisplay;

            AHMSetupType setupType = trackingModule.SetupType;

            if (setupType.Equals(AHMSetupType.Timing15Sec))
            {
                this.comboBoxSetupType.SelectedItem = "Natural Movement";
            }
            else if (setupType.Equals(AHMSetupType.KeyPress))
            {
                this.comboBoxSetupType.SelectedItem = "Key Press";
            }
            else if (setupType.Equals(AHMSetupType.Movement30Sec))
            {
                this.comboBoxSetupType.SelectedItem = "Movement - 30 Sec";
            }
            else if (setupType.Equals(AHMSetupType.Movement45Sec))
            {
                this.comboBoxSetupType.SelectedItem = "Movement - 45 Sec";
            }
            else if (setupType.Equals(AHMSetupType.Movement60Sec))
            {
                this.comboBoxSetupType.SelectedItem = "Movement - 60 Sec";
            }
            else if (setupType.Equals(AHMSetupType.MovementInfinite))
            {
                this.comboBoxSetupType.SelectedItem = "Movement - Infinite";
            }

            int updateFrequency = trackingModule.UpdateFrequency;

            if (updateFrequency == 0)
            {
                this.comboBoxUpdateFequency.SelectedItem = "Every Frame";
            }
            else if (updateFrequency == 1000)
            {
                this.comboBoxUpdateFequency.SelectedItem = "Once Per Second";
            }
            else if (updateFrequency == 500)
            {
                this.comboBoxUpdateFequency.SelectedItem = "Twice Per Second";
            }
            else if (updateFrequency == 333)
            {
                this.comboBoxUpdateFequency.SelectedItem = "Three Per Second";
            }

            this.comboBoxAutoStart.SelectedItem = trackingModule.AutoStartMode.ToString();

            this.NumTemplates.SelectedItem = trackingModule.NumTemplates.ToString();
            isLoading = false;
        }