コード例 #1
0
        public override void InitParameters()
        {
            Parameters = new List<AlgorithmParameter>();

            AlgorithmParameter logSize = new IntParameter(
                "LoG Filter Size", "LFR", 9, 3, 101);

            Parameters.Add(logSize);

            AlgorithmParameter logSigma = new DoubleParameter(
               "LoG Filter Sigma (Dev)", "LFD", 1.6f, 0.5f, 10.0f);

            Parameters.Add(logSigma);

            AlgorithmParameter matchPatchSize = new IntParameter(
               "Correlation Matching Patch Size", "CMPS", 5, 3, 101);

            Parameters.Add(matchPatchSize);

            AlgorithmParameter useSmoothCorrelation = new BooleanParameter(
               "Use Smoothed Correlation", "USC", false);

            Parameters.Add(useSmoothCorrelation);

            AlgorithmParameter correlationThreshold = new DoubleParameter(
               "Correlation Matching Threshold", "CMT", 0.90f, 0.0f, 1.0f);

            Parameters.Add(correlationThreshold);

            AlgorithmParameter maxDisp = new IntParameter(
               "Max Expected Disparity Along Epiline", "MD", 30, 0, 30000);

            Parameters.Add(maxDisp);
        }
コード例 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="osc"></param>
        /// /// <param name="zone"></param>
        /// <param name="waveSequence"></param>
        public override void SetWaveSequence(int osc, int zone, IWaveSequence waveSequence)
        {
            IntParameter parameter = new IntParameter();

            parameter.SetMultiBytes(Root, Root.Content, GetZoneMsByteOffset(osc, zone), 2, false, false, null);
            parameter.Value = GetWaveSequenceIndex(waveSequence);
        }
コード例 #3
0
 public DynContainer(DataContainer parent)
     : base(parent, "DynCont", "DynContainer")
 {
     IntParam4  = new IntParameter(this, "IntParam4", "IntParam4", 0);
     StrParam5  = new StringParameter(this, "StrParam5", "StrParam5", "def");
     BoolParam6 = new BoolParameter(this, "BoolParam6", "BoolParam6", true);
 }
コード例 #4
0
        public void TryParse_NonEmptyType()
        {
            var ip = new IntParameter("name", false);

            ip.TryParse("0", out object result);
            Assert.IsType <int>(result);
        }
コード例 #5
0
ファイル: ProgramTest.cs プロジェクト: dipu/Integrate
        public void AddParameters()
        {
            Library lib = Library.Create(this.AllorsSession, "TestLib");
            Program pgm = Program.Create(this.AllorsSession, "TestPgm", lib);

            Parameter parm1 = StringParameter.Create(this.AllorsSession, "@parm1", 10, "test1");

            pgm.FirstParameter = parm1;

            Parameter parm2 = StringParameter.Create(this.AllorsSession, "@parm2", 20, "test2");

            parm1.NextParameter = parm2;

            Parameter parm3 = IntParameter.Create(this.AllorsSession, "@parm3", 30);

            parm2.NextParameter = parm3;

            Parameter parm4 = DecimalParameter.Create(this.AllorsSession, "@parm4", 5, 2, 0M);

            parm3.NextParameter = parm4;

            Parameter parm5 = DateTimeParameter.Create(this.AllorsSession, "@parm5", DateTime.Now);

            parm4.NextParameter = parm5;

            Assert.IsTrue(pgm.Parameters.Count == 5);
        }
コード例 #6
0
ファイル: KronosProgram.cs プロジェクト: DaBlick/PCG-Tools
        /// <summary>
        ///
        /// </summary>
        /// <param name="osc"></param>
        /// /// <param name="zone"></param>
        /// <param name="waveSequence"></param>
        public override void SetWaveSequence(int osc, int zone, IWaveSequence waveSequence)
        {
            IntParameter parameter = new IntParameter();

            // ReSharper disable once SwitchStatementMissingSomeCases
            switch (PcgRoot.Model.OsVersion)
            {
            case Models.EOsVersion.EOsVersionKronos10_11:     // FALL THROUGH
            case Models.EOsVersion.EOsVersionKronos15_16:
                var bankIndex = ((IBank)waveSequence.Parent).Index;
                if (bankIndex >= 0x40)
                {
                    bankIndex -= 0x40;     // 40..46.. U-A..U-G
                }

                parameter.Set(Root, Root.Content, GetZoneMsByteOffset(osc, zone) + 1, 7, 0, false, this);
                parameter.Value = bankIndex;

                parameter.Set(Root, Root.Content, GetZoneMsByteOffset(osc, zone) + 2, 7, 0, false, this);
                parameter.Value = waveSequence.Index;
                break;

            case Models.EOsVersion.EOsVersionKronos2x:     // FALL THROUGH
            case Models.EOsVersion.EOsVersionKronos3x:
                parameter.SetMultiBytes(Root, Root.Content, GetZoneMsByteOffset(osc, zone), 2, false, false, null);
                parameter.Value = GetWaveSequenceIndex(waveSequence);
                break;

            default:
                throw new ApplicationException("Illegal (non Kronos) model");
            }
        }
コード例 #7
0
    private void endBlur()
    {
        FloatParameter sf = new FloatParameter {
            value = 4f
        };
        FloatParameter af = new FloatParameter {
            value = 32f
        };
        IntParameter si = new IntParameter {
            value = 0
        };

        //print("end blur");
        blurComponent.gameObject.GetComponent <CameraBob>().Bob = false;
        //blurComponent.enabled = false;
        //camEffects.profile.AddSettings<MotionBlur>().shutterAngle = sf;
        //camEffects.profile.AddSettings<MotionBlur>().sampleCount = si;
        //camEffects.profile.AddSettings<DepthOfField>().aperture = af;


        MotionBlur mb;

        if (camEffects.profile.TryGetSettings(out mb))
        {
            mb.enabled.value = false;
        }
        DepthOfField df;

        if (camEffects.profile.TryGetSettings(out df))
        {
            df.enabled.value = false;
        }
    }
コード例 #8
0
ファイル: ProgramTest.cs プロジェクト: dipu/Integrate
        public void CallTest007()
        {
            Library      lib = Library.Create(this.AllorsSession, "TestLib");
            IntParameter parm1;

            using (Program pgm = Program.Create(this.AllorsSession, "Test007", lib))
            {
                parm1 = IntParameter.Create(this.AllorsSession, "@parm1", 0);
                pgm.FirstParameter = parm1;

                string connectionstring = ConfigurationManager.ConnectionStrings["iseries"].ConnectionString;
                using (Session session = new Session(connectionstring))
                {
                    pgm.Call(session);

                    int result = parm1.Value;

                    Assert.IsTrue(parm1.Value > 0);

                    // Second call must update value with 1
                    pgm.Call(session);
                    Assert.IsTrue(parm1.Value == result + 1);
                    session.Commit();
                }
            }
        }
コード例 #9
0
    private void startBlur()
    {
        FloatParameter sf = new FloatParameter {
            value = 360f
        };
        FloatParameter af = new FloatParameter {
            value = 24f
        };
        IntParameter si = new IntParameter {
            value = 32
        };

        //print("start blur");
        blurComponent.gameObject.GetComponent <CameraBob>().Bob = true;
        //blurComponent.enabled = true;
        //camEffects.profile.AddSettings<MotionBlur>().shutterAngle = sf;
        //camEffects.profile.AddSettings<MotionBlur>().sampleCount = si;
        //camEffects.profile.AddSettings<DepthOfField>().aperture= af;

        MotionBlur mb;

        camEffects.profile.TryGetSettings(out mb);
        mb.enabled.value = true;
        DepthOfField df;

        camEffects.profile.TryGetSettings(out df);
        df.enabled.value = true;

        frameCounter = 0;
    }
コード例 #10
0
        public void ModificationTest()
        {
            var p = new IntParameter(null, "myIntId", "myIntName", 11);

            p.OnChanged += ParamOnChanged;

            _passedOnChanged = false;
            p.Value          = 11;
            Assert.IsFalse(_passedOnChanged, "OnChanged called without a cause");
            Assert.IsFalse(p.IsModified, "IsModified = true but must be false");

            _passedOnChanged = false;
            p.Value          = 0;
            Assert.IsTrue(_passedOnChanged, "OnChanged call missing");
            Assert.IsTrue(p.IsModified, "IsModified = false but must be true");

            _passedOnChanged = false;
            p.Value          = 55;
            Assert.IsTrue(_passedOnChanged, "OnChanged call missing");
            Assert.IsTrue(p.IsModified, "IsModified = true but must be false");

            p.OnChanged     -= ParamOnChanged;
            _passedOnChanged = false;
            p.Value          = 345;
            Assert.IsFalse(_passedOnChanged, "OnChanged not allowed but occurred");
            Assert.IsTrue(p.IsModified, "IsModified = false but must be true");
        }
コード例 #11
0
        public void TryParse_NonEmptyValue()
        {
            var ip = new IntParameter("name", false);

            ip.TryParse("0", out object result);
            Assert.Equal(0, (int)result);
        }
コード例 #12
0
ファイル: JsonUtilities.cs プロジェクト: via5/Synergy
            public void Opt(string key, IntParameter v)
            {
                if (!HasKey(key))
                {
                    return;
                }

                var node = c_[key];

                var o = node as JSONClass;

                if (o == null)
                {
                    v.Value = node.AsInt;
                }
                else
                {
                    v.Value = o["value"].AsInt;

                    if (o.HasKey("parameter"))
                    {
                        v.Name = o["parameter"];
                        v.Register();
                    }
                }
            }
コード例 #13
0
ファイル: KronosProgram.cs プロジェクト: DaBlick/PCG-Tools
        /// <summary>
        ///
        /// </summary>
        /// <param name="osc"></param>
        /// <param name="zone"></param>
        /// <returns></returns>
        private EMode GetZoneMsType(int osc, int zone)
        {
            var offset = ByteOffset + 2774 + osc * (3240 - 2774) +
                         zone * (2796 - 2774);

            var parameter = new IntParameter();

            parameter.Set(Root, Root.Content, offset, 1, 0, false, null);
            int   value = parameter.Value;
            EMode mode;

            switch (value)
            {
            case 0:
                mode = EMode.Off;
                break;

            case 1:
                mode = EMode.Sample;
                break;

            case 2:
                mode = EMode.WaveSequence;
                break;

            default:
                mode = EMode.Off;
                // Not supported, selected when copy drum kit from Kronos OS3.0 file.
                // throw new ApplicationException("Illegal case");
                break;
            }

            return(mode);
        }
コード例 #14
0
 public Cont1(DataContainer parent)
     : base(parent, "Cont1", "Cont1")
 {
     IntParam    = new IntParameter(this, "IntParam", "IntParam", 0);
     StrParam    = new StringParameter(this, "StrParam", "StrParam", "abc");
     FloatParam1 = new FloatParameter(this, "FloatParam1", "FloatParam1", 0.5f, "m/s", 5);
     FloatParam2 = new FloatParameter(this, "FP2", "FloatParam2", 5.5f, "m/s", 8);
 }
コード例 #15
0
ファイル: CensusFeatureMatcher.cs プロジェクト: KFlaga/Cam3D
        public override void InitParameters()
        {
            base.InitParameters();

            AlgorithmParameter windowRadiusParam = new IntParameter(
                "Window Radius", "WRAD", 4, 1, 20);
            Parameters.Add(windowRadiusParam);
        }
コード例 #16
0
        public void BufferTest()
        {
            var p = new IntParameter(null, "myIntId", "myIntName", 123);

            p.Value = 555555;
            p.ResetModifiedState();
            Assert.AreEqual(p.BufferedValue, p.Value, "BufferedValue not set correctly");
        }
コード例 #17
0
        public void ProhibitedValueChangeTest()
        {
            var p = new IntParameter(null, "myIntId", "myIntName", 0);

            CheckProhibitedValueChange(p, 77,
                                       param =>
                                       ((IntParameter)param).Value = 1234
                                       );
        }
コード例 #18
0
ファイル: ShapeChecker.cs プロジェクト: KFlaga/Cam3D
        public override void InitParameters()
        {
            base.InitParameters();

            AlgorithmParameter radius = new IntParameter(
                "Check Neighbourhood Radius", "CNR",  3, 1, 99);
            Parameters.Add(radius);

            AlgorithmParameter redTresh = new DoubleParameter(
               "Red Value Treshold", "RVT", 0.25, 0.0, 1.0);
            Parameters.Add(redTresh);
        }
コード例 #19
0
        public void SetValueTest()
        {
            var p = new IntParameter(null, "myIntId", "myIntName", 1);

            p.AsString = "123456789";

            CheckSetErroneousValueAsString(p, "Otto");
            CheckSetErroneousValueAsString(p, "1,234");
            CheckSetErroneousValueAsString(p, "567.345");
            CheckSetErroneousValueAsString(p, "45645.");
            CheckSetErroneousValueAsString(p, "-4545764.123e12");
        }
コード例 #20
0
        public void InitializationTest()
        {
            var p = new IntParameter(null, "myIntId", "myIntName", 55);

            Assert.IsNotNull(p, "Parameter object could not be created");

            Assert.AreEqual(p.Id, "myIntId", "Id not initialized correctly");
            Assert.AreEqual(p.Designation, "myIntName", "Name not initialized correctly");
            Assert.AreEqual(p.PathId, "myIntId", "PathId not initialized correctly");
            Assert.AreEqual(p.Value, 55, "Value not initialized correctly");
            Assert.AreEqual(p.BufferedValue, 55, "BufferedValue not initialized correctly");
            Assert.AreEqual(p.AsString, "55", "AsString not initialized correctly");
        }
コード例 #21
0
ファイル: LoGFilter.cs プロジェクト: KFlaga/Cam3D
        public override void InitParameters()
        {
            Parameters = new List<AlgorithmParameter>();
            AlgorithmParameter winRadius = new IntParameter(
                "Filter Window Size", "FWS", 4, 1, 101);

            Parameters.Add(winRadius);

            AlgorithmParameter deviation = new DoubleParameter(
               "Filter Deviation", "FD", 1.6f, 0.01f, 50.0f);

            Parameters.Add(deviation);
        }
コード例 #22
0
        protected override bool GetParameter(int hash)
        {
            if (hash == -1)
            {
                m_Parameter = null;
            }
            else
            {
                m_Parameter = motionController.motionGraph.GetIntProperty(hash);
            }

            return(m_Parameter != null);
        }
コード例 #23
0
ファイル: JsonUtilities.cs プロジェクト: via5/Synergy
            public void Add(string key, IntParameter b)
            {
                var o = new J.Object();

                o.Add("value", b.InternalValue);

                if (b.Registered)
                {
                    o.Add("parameter", b.Name);
                }

                c_?.Add(key, o.Impl);
            }
コード例 #24
0
ファイル: ScenarioParser.cs プロジェクト: JoeButikofer/Phobia
    static List <Parameter> ParseParameters(JSONArray parametersArray)
    {
        var parameters = new List <Parameter>();

        for (int i = 0; i < parametersArray.Count; i++)
        {
            var parameterJson = parametersArray[i];

            switch (parameterJson["type"])
            {
            case "bool":
                BoolParameter pBool = new BoolParameter();
                pBool.Name             = parameterJson["name"].Value;
                pBool.DisplayName      = parameterJson["displayName"].Value;
                pBool.IntensityDefault = ParseBoolValues(parameterJson["intensityDefault"].AsArray);
                parameters.Add(pBool);
                break;

            case "int":
                IntParameter pInt = new IntParameter();
                pInt.Min              = parameterJson["min"].AsInt;
                pInt.Max              = parameterJson["max"].AsInt;
                pInt.Name             = parameterJson["name"].Value;
                pInt.DisplayName      = parameterJson["displayName"].Value;
                pInt.IntensityDefault = ParseIntValues(parameterJson["intensityDefault"].AsArray);
                parameters.Add(pInt);
                break;

            case "float":
                FloatParameter pFloat = new FloatParameter();
                pFloat.Min              = parameterJson["min"].AsFloat;
                pFloat.Max              = parameterJson["max"].AsFloat;
                pFloat.Name             = parameterJson["name"].Value;
                pFloat.DisplayName      = parameterJson["displayName"].Value;
                pFloat.IntensityDefault = ParseFloatValues(parameterJson["intensityDefault"].AsArray);
                parameters.Add(pFloat);
                break;

            case "choice":
                ChoiceParameter pString = new ChoiceParameter();
                pString.Values           = ParseStringValues(parameterJson["values"].AsArray);
                pString.Name             = parameterJson["name"].Value;
                pString.DisplayName      = parameterJson["displayName"].Value;
                pString.IntensityDefault = ParseIntValues(parameterJson["intensityDefault"].AsArray);
                parameters.Add(pString);
                break;
            }
        }

        return(parameters);
    }
コード例 #25
0
        /// <summary>
        /// Sets used drum kit.
        /// </summary>
        /// <param name="osc"></param>
        /// <param name="zone"></param>
        /// <param name="drumKit"></param>
        /// <returns></returns>
        private void SetUsedDrumKit(int osc, int zone, IDrumKit drumKit)
        {
            IntParameter parameter = new IntParameter();

            parameter.SetMultiBytes(Root, Root.Content, GetZoneMsByteOffset(osc, zone) + 2, 2, // + 2: Number (bank unused, alwyas 0?)
                                    false, false, null);

            int index = PcgRoot.DrumKitBanks.FindIndexOf(drumKit);

            if (index >= 0)
            {
                parameter.Value = index;
            }
        }
コード例 #26
0
ファイル: ProgramTest.cs プロジェクト: dipu/Integrate
        public void CallTest006()
        {
            Library           lib = Library.Create(this.AllorsSession, "TestLib");
            IntParameter      parm5;
            StringParameter   parm6;
            DecimalParameter  parm7;
            DateTimeParameter parm8;

            DateTime tijd = DateTime.Now;

            using (Program pgm = Program.Create(this.AllorsSession, "Test006", lib))
            {
                IntParameter parm1 = IntParameter.Create(this.AllorsSession, "@parm1", 25);
                pgm.FirstParameter = parm1;

                StringParameter parm2 = StringParameter.Create(this.AllorsSession, "@parm2", 20, "testing");
                parm1.NextParameter = parm2;

                DecimalParameter parm3 = DecimalParameter.Create(this.AllorsSession, "@parm3", 18, 2, 118.36M);
                parm2.NextParameter = parm3;

                DateTimeParameter parm4 = DateTimeParameter.Create(this.AllorsSession, "@parm4", tijd);
                parm3.NextParameter = parm4;

                parm5 = IntParameter.Create(this.AllorsSession, "@parm5", 0);
                parm4.NextParameter = parm5;

                parm6 = StringParameter.Create(this.AllorsSession, "@parm6", 20, "");
                parm5.NextParameter = parm6;

                parm7 = DecimalParameter.Create(this.AllorsSession, "@parm7", 18, 2, 0.00M);
                parm6.NextParameter = parm7;

                parm8 = DateTimeParameter.Create(this.AllorsSession, "@parm8", DateTime.MinValue);
                parm7.NextParameter = parm8;

                string connectionstring = ConfigurationManager.ConnectionStrings["iseries"].ConnectionString;
                using (Session session = new Session(connectionstring))
                {
                    pgm.Call(session);
                    session.Commit();
                }
            }

            Assert.IsTrue(parm5.Value == 25);
            Assert.IsTrue(parm6.Value == "testing");
            Assert.IsTrue(parm7.Value == 118.36M);
            Assert.IsTrue(parm8.Value.Date == tijd.Date);
        }
コード例 #27
0
        public void CreateInt()
        {
            IntParameter param = IntParameter.Create(this.AllorsSession, "strParam", 100);

            Assert.IsTrue(param != null);
            Assert.IsTrue(param.Value == 100);
            Assert.IsTrue(param.Name == "strParam");

            iDB2Parameter newValue = new iDB2Parameter("strParam", iDB2DbType.iDB2Integer);

            newValue.Value = 200;
            param.UpdateValue(newValue);

            Assert.IsTrue(param.Value == 200);
        }
コード例 #28
0
ファイル: Cont2.cs プロジェクト: martinlangee/DataTree
 public Cont2(DataContainer parent)
     : base(parent, "Cont2", "Cont2")
 {
     IntParam3  = new IntParameter(this, "IntParam3", "IntParam3", 0);
     StrParam4  = new StringParameter(this, "StrParam4", "StrParam4", "def");
     BoolParam5 = new BoolParameter(this, "BoolParam5", "BoolParam5", true);
     ChParam6   = new ChoiceParameter(this, "ChParam6", "ChParam6", 5,
                                      new List <Tuple <int, string> >
     {
         new Tuple <int, string>(0, "rot"),
         new Tuple <int, string>(5, "gelb"),
         new Tuple <int, string>(10, "grün"),
         new Tuple <int, string>(20, "blau"),
     });
     BinParam7 = new BinaryParameter(this, "BinParam7", "BinParam7", new byte[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 });
 }
コード例 #29
0
ファイル: UTParameters.cs プロジェクト: marekdaniluk/lab
            public void IntParameterTest()
            {
                string       testKey   = "test";
                IntParameter parameter = new IntParameter();

                parameter[testKey] = 10;
                IntParameter copy = new IntParameter(parameter);

                Assert.IsTrue(parameter != copy);
                Assert.IsTrue(parameter[testKey] == copy[testKey]);
                copy[testKey] = 20;
                Assert.IsTrue(parameter[testKey] != copy[testKey]);
                IntParameter reference = parameter;

                Assert.IsTrue(parameter == reference);
            }
コード例 #30
0
        /// <summary>
        /// This method will update all the variables binded to the Game Parameter "subject"
        /// </summary>
        /// <param name="subject">Game Parameters inherit Subject class</param>
        public void UpdateRoutine(Subject subject)
        {
            // creating a generic variable egVar and instantiating the correct type
            // the eg types are the same implemented as parameters (string, int, bool, double)
            egVar         var;
            GameParameter gp = (GameParameter)subject;

            if (subject.GetType() == typeof(IntParameter))
            {
                IntParameter iP = (IntParameter)subject;
                egInt        i  = iP.Value;
                var = i;
            }
            else if (subject.GetType() == typeof(BoolParameter))
            {
                BoolParameter bP = (BoolParameter)subject;
                egBool        b  = bP.Value;
                var = b;
            }
            else if (subject.GetType() == typeof(StringListParameter))
            {
                StringListParameter sP = (StringListParameter)subject;
                egString            s  = sP.Value;
                var = s;
            }
            else if (subject.GetType() == typeof(StringParameter))
            {
                StringParameter sP = (StringParameter)subject;
                egString        s  = sP.Value;
                Debug.Log((string)s + " variable Handler test");
                var = s;
            }
            else if (subject.GetType() == typeof(RangeParameter))
            {
                RangeParameter fP = (RangeParameter)subject;
                egFloat        s  = fP.Value;
                var = s;
            }
            else
            {
                // if the type is not registered something went wrong
                Debug.Log("ERROR, type: " + subject.GetType() + " not defined as a parameter type. Check parameter types.");
                return;
            }
            //then we will update the variables
            UpdateVariables(var, gp.Name);
        }
コード例 #31
0
        /// <summary>
        /// Returns the drum kit used by osc (zero based) and MS zone (zero based).
        /// </summary>
        /// <param name="osc"></param>
        /// <param name="zone"></param>
        /// <returns></returns>
        protected IDrumKit GetUsedDrumKit(int osc, int zone)
        {
            IntParameter parameter = new IntParameter();

            parameter.SetMultiBytes(Root, Root.Content, GetZoneMsByteOffset(osc, zone) + 2, 2, // + 2: Number (bank unused, always 0?)
                                    false, false, null);
            int index = parameter.Value;

            IDrumKit drumKit = null;

            if (PcgRoot.DrumKitBanks != null)
            {
                drumKit = PcgRoot.DrumKitBanks.GetByIndex(index);
            }

            return(drumKit);
        }
コード例 #32
0
        public TestCont1(DataContainer parent, string id, string name)
            : base(parent, id, name)
        {
            Tc3 = new TestCont3(this);

            IntParam = new IntParameter(this, "IP", "IntParam", 0);
            StrParam = new StringParameter(this, "SP", "StrParam", "abc");
            FloatParam = new FloatParameter(this, "FP", "FloatParam", 0.5f, "m/s", 5);
            BinParam = new BinaryParameter(this, "BP", "BinParam", new byte[] { 1, 2, 3, 4, 5 });
            ChParam = new ChoiceParameter(this, "CP", "ChParam", 0, new List<Tuple<int, string>>()
                                                                    {
                                                                        new Tuple<int, string>(0, "Ch1"),
                                                                        new Tuple<int, string>(3, "Ch2"),
                                                                        new Tuple<int, string>(5, "Ch3"),
                                                                        new Tuple<int, string>(15, "Ch4"),
                                                                    });
        }
コード例 #33
0
        public void SetParameter(IntParameter Parameter, int Value)
        {
            FThread.Perform(() =>
            {
                switch (Parameter)
                {
                case IntParameter.AEAG:
                    FDevice.SetParam(PRM.AEAG, Value);
                    break;

                case IntParameter.Exposure:
                    FDevice.SetParam(PRM.EXPOSURE, Value);
                    break;

                case IntParameter.Gain:
                    FDevice.SetParam(PRM.GAIN, (float)Value);
                    break;

                case IntParameter.RegionHeight:
                    int value = Value;
                    value    /= 4;
                    value    *= 4;
                    if (value < 4)
                    {
                        value = 4;
                    }

                    FDevice.SetParam(PRM.HEIGHT, value);
                    break;

                case IntParameter.RegionWidth:
                    FDevice.SetParam(PRM.WIDTH, Value);
                    break;

                case IntParameter.RegionX:
                    FDevice.SetParam(PRM.OFFSET_X, Value);
                    break;

                case IntParameter.RegionY:
                    FDevice.SetParam(PRM.OFFSET_Y, Value);
                    break;
                }
            });
        }
コード例 #34
0
        internal bool Compare(CalculatorCondition.Type type, int parameterIndex, CompareType compareType)
        {
            switch (type)
            {
            case CalculatorCondition.Type.Int:
                IntParameter intParameter = _IntParameters[parameterIndex];
                return(intParameter.Compare(compareType));

            case CalculatorCondition.Type.Float:
                FloatParameter floatParameter = _FloatParameters[parameterIndex];
                return(floatParameter.Compare(compareType));

            case CalculatorCondition.Type.Bool:
                BoolParameter boolParameter = _BoolParameters[parameterIndex];
                return(boolParameter.Compare());
            }

            return(false);
        }
コード例 #35
0
ファイル: MomentsFeatureMatcher.cs プロジェクト: KFlaga/Cam3D
        public override void InitParameters()
        {
            base.InitParameters();

            AlgorithmParameter windowRadiusParam = new IntParameter(
                "Patch Radius", "WRAD", 4, 1, 20);
            Parameters.Add(windowRadiusParam);

            AlgorithmParameter mahalParam = new BooleanParameter(
                "Use Mahalanobis Distance", "MAHAL", true);
            Parameters.Add(mahalParam);

            AlgorithmParameter centerParam = new BooleanParameter(
                "Use Centered Moments", "CENTER", false);
            Parameters.Add(centerParam);

            AlgorithmParameter scaleParam = new BooleanParameter(
                "Use Scaled Moments", "SCALE", true);
            Parameters.Add(scaleParam);
        }
コード例 #36
0
ファイル: LimitRangeRefiner.cs プロジェクト: KFlaga/Cam3D
        public override void InitParameters()
        {
            base.InitParameters();

            IntParameter leftMaxXParam = new IntParameter(
                "Left Max Disparity X", "MAX_LEFT_X", 0, -10000, 10000);
            Parameters.Add(leftMaxXParam);

            IntParameter leftMinXParam = new IntParameter(
                "Left Min Disparity X", "MIN_LEFT_X", -100, -10000, 10000);
            Parameters.Add(leftMinXParam);

            IntParameter leftMaxYParam = new IntParameter(
                "Left Max Disparity Y", "MAX_LEFT_Y", 10, -10000, 10000);
            Parameters.Add(leftMaxYParam);

            IntParameter leftMinYParam = new IntParameter(
                "Left Min Disparity Y", "MIN_LEFT_Y", -10, -10000, 10000);
            Parameters.Add(leftMinYParam);

            IntParameter rightMaxXParam = new IntParameter(
                "Right Max Disparity X", "MAX_RIGHT_X", 100, -10000, 10000);
            Parameters.Add(rightMaxXParam);

            IntParameter rightMinXParam = new IntParameter(
                "Right Min Disparity X", "MIN_RIGHT_X", 0, -10000, 10000);
            Parameters.Add(rightMinXParam);

            IntParameter rightMaxYParam = new IntParameter(
                "Right Max Disparity Y", "MAX_RIGHT_Y", 10, -10000, 10000);
            Parameters.Add(rightMaxYParam);

            IntParameter rightMinYParam = new IntParameter(
                "Right Min Disparity Y", "MIN_RIGHT_Y", -10, -10000, 10000);
            Parameters.Add(rightMinYParam);
        }
コード例 #37
0
 public static void GetParameterType(IntParameter obj, MethodReturnEventArgs<Type> e)
 {
     e.Result = typeof(int);
     BaseParameterActions.DecorateParameterType(obj, e, true);
 }
コード例 #38
0
		public void SetParameter(IntParameter Parameter, int Value)
		{
			FThread.Perform(() =>
				{
					switch (Parameter)
					{
						case IntParameter.AEAG:
							FDevice.SetParam(PRM.AEAG, Value);
							break;
						case IntParameter.Exposure:
							FDevice.SetParam(PRM.EXPOSURE, Value);
							break;
						case IntParameter.Gain:
							FDevice.SetParam(PRM.GAIN, (float)Value);
							break;
						case IntParameter.RegionHeight:
							int value = Value;
							value /= 4;
							value *= 4;
							if (value < 4)
								value = 4;

							FDevice.SetParam(PRM.HEIGHT, value);
							break;
						case IntParameter.RegionWidth:
							FDevice.SetParam(PRM.WIDTH, Value);
							break;
						case IntParameter.RegionX:
							FDevice.SetParam(PRM.OFFSET_X, Value);
							break;
						case IntParameter.RegionY:
							FDevice.SetParam(PRM.OFFSET_Y, Value);
							break;
					}
				});
		}
コード例 #39
0
        public void InitParameters()
        {
            _params = new List<AlgorithmParameter>();
            DoubleParameter matchCoeffParam = new DoubleParameter(
                "c_m: Matching Error Coeff (e_m = d^2 * c_m / 2Nm)", "CMATCH", 0.01, 0.0, 100000.0);
            _params.Add(matchCoeffParam);

            DoubleParameter trinagCoeffParam = new DoubleParameter(
                "c_t: Triangulation Error Coeff (e_t = d^2 * c_t / 3Ni)", "CTRI", 5.0, 0.0, 100000.0);
            _params.Add(trinagCoeffParam);

            DoubleParameter imgCoeffParam = new DoubleParameter(
                "c_i: Reprojection Error Coeff (e_i = d^2 * c_i / 2Ni)", "CIMAGE", 5.0, 0.0, 100000.0);
            _params.Add(imgCoeffParam);

            DoubleParameter gridsCoeffParam = new DoubleParameter(
                "c_g: Grids Error Coeff (e_g = d^2 * c_g * 3Ni / 12Ng)", "CGRIDS", 1.0, 0.0, 100000.0);
            _params.Add(gridsCoeffParam);

            IntParameter maxItParam = new IntParameter(
                "Max Iterations", "ITERS", 100, 1, 10000);
            _params.Add(maxItParam);
        }
コード例 #40
0
 public static void GetParameterTypeString(IntParameter obj, MethodReturnEventArgs<string> e)
 {
     e.Result = "int";
     BaseParameterActions.DecorateParameterType(obj, e, true);
 }
コード例 #41
0
        public override void InitParameters()
        {
            base.InitParameters();
            AlgorithmParameter maskW = new IntParameter(
                "Mask Width Radius", "MWR", 3, 1, 6);
            _parameters.Add(maskW);

            AlgorithmParameter maskH = new IntParameter(
                "Mask Height Radius", "MHR", 3, 1, 6);
            _parameters.Add(maskH);

            AlgorithmParameter useSmooth = new BooleanParameter(
                "Use gaussian smoothing", "UGS", false);
            _parameters.Add(useSmooth);

            AlgorithmParameter smootSgm = new DoubleParameter(
                "Smoothing Deviation", "SD", 1.2, 0.01, 10.0);
            _parameters.Add(smootSgm);
        }
コード例 #42
0
ファイル: RankCostComputer.cs プロジェクト: KFlaga/Cam3D
        public override void InitParameters()
        {
            base.InitParameters();
            AlgorithmParameter maskRW = new IntParameter(
                "Rank-Compute Mask Width Radius", "RMWR", 3, 1, 10);
            _parameters.Add(maskRW);

            AlgorithmParameter maskRH = new IntParameter(
                "Rank-Compute Mask Height Radius", "RMHR", 3, 1, 10);
            _parameters.Add(maskRH);

            AlgorithmParameter maskCW = new IntParameter(
                "Correlation Mask Width Radius", "CMWR", 3, 1, 10);
            _parameters.Add(maskCW);

            AlgorithmParameter maskCH = new IntParameter(
                "Correlation Mask Height Radius", "CMHR", 3, 1, 10);
            _parameters.Add(maskCH);
        }
コード例 #43
0
ファイル: CensusCostComputer.cs プロジェクト: KFlaga/Cam3D
        public override void InitParameters()
        {
            base.InitParameters();
            AlgorithmParameter maskW = new IntParameter(
                "Mask Width Radius", "MWR", 6, 1, 7);
            _parameters.Add(maskW);

            AlgorithmParameter maskH = new IntParameter(
                "Mask Height Radius", "MHR", 6, 1, 7);
            _parameters.Add(maskH);
        }
コード例 #44
0
ファイル: PeakRemovalRefiner.cs プロジェクト: KFlaga/Cam3D
        public override void InitParameters()
        {
            base.InitParameters();

            DoubleParameter maxDiffParam = new DoubleParameter(
                "Max Disparity Difference", "DIFF", 2.0, 0.0, 10000.0);
            Parameters.Add(maxDiffParam);

            IntParameter minSegmentParam = new IntParameter(
                "Min Segment Size", "SEG", 6, 1, 10000);
            Parameters.Add(minSegmentParam);

            BooleanParameter interpolateParam = new BooleanParameter(
                "Interpolate Invalidated Segments", "INT", false);
            Parameters.Add(interpolateParam);
        }
コード例 #45
0
		internal Present ImageDetail(System.Drawing.Size assumedDisplaySize)
		{
			Monitor.Enter(this);
			Present result;
			try
			{
				double num = Math.Max((double)this.primarySource.PixelWidth / (double)assumedDisplaySize.Width, (double)this.primarySource.PixelHeight / (double)assumedDisplaySize.Height);
				num = Math.Max(num, 1.0);
				int num2 = 1 + (int)Math.Ceiling(Math.Log(num) / Math.Log(2.0));
				D.Assert(num2 >= 0);
				result = new IntParameter(num2);
			}
			finally
			{
				Monitor.Exit(this);
			}
			return result;
		}
コード例 #46
0
ファイル: MedianFilter.cs プロジェクト: KFlaga/Cam3D
        public override void InitParameters()
        {
            Parameters = new List<AlgorithmParameter>();
            AlgorithmParameter winRadius = new IntParameter(
                "Filter Window Size", "FWS", 3, 1, 99);

            Parameters.Add(winRadius);

            AlgorithmParameter filterBorder = new BooleanParameter(
               "Filter Border", "FB", true);

            Parameters.Add(filterBorder);
        }
コード例 #47
0
ファイル: ShapesGridCPFinder.cs プロジェクト: KFlaga/Cam3D
        public override void InitParameters()
        {
            base.InitParameters();

            AlgorithmParameter treshLow = new DoubleParameter(
                "Size Elimination Threshold Low", "SETL", 0.1, 0.0001, 1.0);
            Parameters.Add(treshLow);

            AlgorithmParameter treshHigh = new DoubleParameter(
               "Size Elimination Threshold High", "SETH", 10.0, 1.0, 1000.0);
            Parameters.Add(treshHigh);

            AlgorithmParameter useMedianFilter = new BooleanParameter(
               "Use Median Prefiltering", "UMF", false);
            Parameters.Add(useMedianFilter);

            AlgorithmParameter medianFilterRadous = new IntParameter(
               "Median Filter Radius (opt)", "MFR", 3, 1, 9);
            Parameters.Add(medianFilterRadous);

            AlgorithmParameter doStretch = new BooleanParameter(
               "Stretch/Saturate histogram", "SSH", false);
            Parameters.Add(doStretch);

            AlgorithmParameter saturateDark = new DoubleParameter(
               "Dark saturation treshold", "DSH", 0.2, 0.0, 1.0);
            Parameters.Add(saturateDark);

            AlgorithmParameter saturateLight = new DoubleParameter(
               "Light saturation treshold", "LSH", 0.8, 0.0, 1.0);
            Parameters.Add(saturateLight);
        }
コード例 #48
0
ファイル: CamCalibrator.cs プロジェクト: KFlaga/Cam3D
        public void InitParameters()
        {
            Parameters = new List<AlgorithmParameter>();

            AlgorithmParameter linOnly = new BooleanParameter(
                    "Perform only linear estimation", "LIN", false);
            Parameters.Add(linOnly);

            AlgorithmParameter normLin = new BooleanParameter(
                    "Normalize points for linear estimation", "NPL", true);
            Parameters.Add(normLin);

            AlgorithmParameter normIt = new BooleanParameter(
                    "Normalize points for iterative estimation", "NPI", true);
            Parameters.Add(normIt);

            AlgorithmParameter cov = new BooleanParameter(
                    "Use covariance matrix", "COV", true);
            Parameters.Add(cov);

            AlgorithmParameter skew = new BooleanParameter(
                    "Minimalise skew", "SKEW", true);
            Parameters.Add(skew);

            AlgorithmParameter varImgX = new DoubleParameter(
                    "Image Measurements Variance X", "VIX", 0.25, 0.0, 100.0);
            Parameters.Add(varImgX);

            AlgorithmParameter varImgY = new DoubleParameter(
               "Image Measurements Variance Y", "VIY", 0.25, 0.0, 100.0);
            Parameters.Add(varImgY);

            AlgorithmParameter varRealX = new DoubleParameter(
               "Real Measurements Variance X", "VRX", 1.0, 0.0, 1000.0);
            Parameters.Add(varRealX);

            AlgorithmParameter varRealY = new DoubleParameter(
               "Real Measurements Variance Y", "VRY", 1.0, 0.0, 1000.0);
            Parameters.Add(varRealY);

            AlgorithmParameter varRealZ = new DoubleParameter(
               "Real Measurements Variance Z", "VRZ", 1.0, 0.0, 1000.0);
            Parameters.Add(varRealZ);

            AlgorithmParameter iters = new IntParameter(
               "Max Iterations", "MI", 100, 1, 10000);
            Parameters.Add(iters);

            AlgorithmParameter eliminate = new BooleanParameter(
               "Outliers elimination after linear estimation", "ELIM", false);
            Parameters.Add(eliminate);

            AlgorithmParameter outCoeff = new DoubleParameter(
               "Elimination coeff (elim if e >= m * c)", "ECOEFF", 1.5, 0.0, 1000.0);
            Parameters.Add(outCoeff);

            AlgorithmParameter overGrids = new BooleanParameter(
               "Overwrite grids with estimated", "OVERG", false);
            Parameters.Add(overGrids);
        }
コード例 #49
0
ファイル: WholeImageScan.cs プロジェクト: KFlaga/Cam3D
        public override void InitParameters()
        {
            base.InitParameters();

            IntParameter maxDXParam =
                new IntParameter("Max Disparity In X (Positive)", "DXPOS", 1, -100000, 100000);
            Parameters.Add(maxDXParam);

            IntParameter minDXParam =
                new IntParameter("Max Disparity In X (Negative)", "DXNEG", 1, -100000, 100000);
            Parameters.Add(minDXParam);

            IntParameter maxDYParam =
                new IntParameter("Max Disparity In Y (Positive)", "DYPOS", 1, -100000, 100000);
            Parameters.Add(maxDYParam);

            IntParameter minDYParam =
                new IntParameter("Max Disparity In Y (Negative)", "DYNEG", 1, -100000, 100000);
            Parameters.Add(minDYParam);

            ParametrizedObjectParameter disparityParam = new ParametrizedObjectParameter(
                "Disparity Computer", "DISP_COMP");

            disparityParam.Parameterizables = new List<IParameterizable>();
            var dcWTA = new WTADisparityComputer();
            dcWTA.InitParameters();
            disparityParam.Parameterizables.Add(dcWTA);

            var intWTA = new InterpolationDisparityComputer();
            intWTA.InitParameters();
            disparityParam.Parameterizables.Add(intWTA);

            Parameters.Add(disparityParam);
        }