VsICoreAnalyzerConfiguration VsICoreAnalyzerPage.GetConfiguration()
        {
            VsLineDetectionConfiguration cfg = new VsLineDetectionConfiguration();

            cfg.ThresholdStrong = this.trackBar1.Value;
            cfg.ThresholdWeak   = this.trackBar2.Value;

            return(cfg);
        }
Esempio n. 2
0
        VsICoreAnalyzerConfiguration VsICoreAnalyzerPage.GetConfiguration()
        {
            VsLineDetectionConfiguration cfg = new VsLineDetectionConfiguration();

            cfg.ThresholdStrong = this.trackBar1.Value;
            cfg.ThresholdWeak = this.trackBar2.Value;

            return cfg;
        }
        void VsICoreAnalyzerPage.SetConfiguration(VsICoreAnalyzerConfiguration config)
        {
            VsLineDetectionConfiguration cfg = (VsLineDetectionConfiguration)config;

            if (cfg != null)
            {
                this.trackBar1.Value = cfg.ThresholdStrong;
                this.trackBar2.Value = cfg.ThresholdWeak;
            }
        }
        void VsICoreAnalyzerDescription.SaveConfiguration(System.Xml.XmlTextWriter writer, VsICoreAnalyzerConfiguration config)
        {
            VsLineDetectionConfiguration cfg = (VsLineDetectionConfiguration)config;

            if (cfg != null)
            {
                writer.WriteAttributeString("ThresholdStrong", cfg.ThresholdStrong.ToString());
                writer.WriteAttributeString("ThresholdWeak", cfg.ThresholdWeak.ToString());
                writer.WriteAttributeString("ThresholdHough", cfg.ThresholdHough.ToString());
            }
        }
        VsICoreAnalyzerConfiguration VsICoreAnalyzerDescription.LoadConfiguration(Hashtable reader)
        {
            VsLineDetectionConfiguration config = new VsLineDetectionConfiguration();

            try
            {
                config.LoadConfiguration(reader);
            }
            catch (Exception)
            {
            }
            return(config);
        }
        VsICoreAnalyzer VsICoreAnalyzerDescription.CreateAnalyser(long syncTimer, VsICoreAnalyzerConfiguration config)
        {
            VsLineDetectionConfiguration cfg = (VsLineDetectionConfiguration)config;

            if (cfg != null)
            {
                VsLineDetection analyser = new VsLineDetection(syncTimer);

                analyser.AnalyzerConfiguration = cfg.GetConfiguration();

                return((VsLineDetection)analyser);
            }
            return(null);
        }
        VsICoreAnalyzerConfiguration VsICoreAnalyzerDescription.LoadConfiguration(System.Xml.XmlTextReader reader)
        {
            VsLineDetectionConfiguration config = new VsLineDetectionConfiguration();

            try
            {
                config.ThresholdStrong = int.Parse(reader.GetAttribute("ThresholdStrong"));
                config.ThresholdWeak   = int.Parse(reader.GetAttribute("ThresholdWeak"));
                config.ThresholdHough  = int.Parse(reader.GetAttribute("ThresholdHough"));
            }
            catch (Exception)
            {
            }
            return(config);
        }
        VsICoreAnalyzerConfiguration VsICoreAnalyzerDescription.LoadConfiguration(System.Xml.XmlTextReader reader)
        {
            VsLineDetectionConfiguration config = new VsLineDetectionConfiguration();

            try
            {
                config.ThresholdStrong = int.Parse(reader.GetAttribute("ThresholdStrong"));
                config.ThresholdWeak   = int.Parse(reader.GetAttribute("ThresholdWeak"));
                config.ThresholdHough = int.Parse(reader.GetAttribute("ThresholdHough"));
            }
            catch (Exception)
            {
            }
            return config;
        }
        VsICoreAnalyzerConfiguration VsICoreAnalyzerDescription.LoadConfiguration(Hashtable reader)
        {
            VsLineDetectionConfiguration config = new VsLineDetectionConfiguration();

            try
            {
                config.LoadConfiguration(reader);
            }
            catch (Exception)
            {
            }
            return config;
        }