Exemple #1
0
        public void CompareToTest2()
        {
            var p1 = new CapeRealParameter();

            p1.DoubleValue    = 20;
            param.DoubleValue = 20;
            Assert.AreEqual(0, param.CompareTo(p1.value.ToString()));
        }
Exemple #2
0
        public void CompareToTest1()
        {
            var p1 = new CapeRealParameter();

            p1.DoubleValue = 67;
            Assert.AreNotEqual(0, param.CompareTo(p1));
            param.DoubleValue = 67;
            Assert.AreEqual(0, param.CompareTo(p1));
        }
 public void AddDefaultItem()
 {
     collection.Clear();
     realParam = new CapeRealParameter("real",
                                       UnitCategoryEnum.Area, CapeParamMode.CAPE_INPUT);
     collection.Add(realParam);
     intParam = new CapeIntParameter("int", CapeParamMode.CAPE_INPUT);
     collection.Add(intParam);
 }
Exemple #4
0
 public void CapeRealParameterTest1()
 {
     param = new CapeRealParameter("real",
                                   UnitCategoryEnum.Pressure, CapeParamMode.CAPE_INPUT,
                                   -100, 100, 10);
     Assert.AreEqual("real", param.ComponentName);
     Assert.AreEqual(10, param.DoubleValue);
     Assert.AreEqual(10, param.SIValue);
     Assert.AreEqual(-100, param.LowerBound);
     Assert.AreEqual(100, param.UpperBound);
     Assert.AreEqual(10, param.DefaultValue);
 }
Exemple #5
0
 public void ValidateTest()
 {
     param.value = 23.684;
     Assert.IsTrue(param.Validate());
     param.value = -200;
     Assert.IsFalse(param.Validate());
     param.value = double.NaN;
     Assert.IsFalse(param.Validate());
     param.value = 200;
     Assert.IsFalse(param.Validate());
     param = new CapeRealParameter();
     Assert.IsFalse(param.Validate());
 }
Exemple #6
0
 public void CapeRealParameterTest()
 {
     param = new CapeRealParameter();
     Assert.AreEqual(double.NaN, param.SIValue);
     param.value = 5;
     Assert.AreEqual(5, param.SIValue);
     Assert.AreEqual(5, param.DoubleValue);
     param.CurrentUnitCategory = UnitCategoryEnum.Temperature;
     param.CurrentUnit         = "C";
     Assert.AreEqual(5, param.DoubleValue);
     Assert.AreEqual(278.15, param.SIValue);
     param.CurrentUnit = "K";
     Assert.AreEqual(5, param.SIValue);
 }
Exemple #7
0
        public override void InitResults()
        {
            CasterLogger.Debug("InitResults");
            CapeRealParameter ParamTout = new CapeRealParameter("Tout", UnitCategoryEnum.Temperature, CapeParamMode.CAPE_OUTPUT);

            ParamTout.ComponentDescription = "temperature of actual outlet material";
            Results.Add(ParamTout);
            CapeRealParameter ParamPout = new CapeRealParameter("Pout", UnitCategoryEnum.Pressure, CapeParamMode.CAPE_OUTPUT);

            ParamPout.ComponentDescription = "pressure of actual outlet material";
            Results.Add(ParamPout);

            Results.Add(new CapeIntParameter("intParam", CapeParamMode.CAPE_OUTPUT));
            Results.Add(new CapeBooleanParameter("boolParam", CapeParamMode.CAPE_OUTPUT));
            Results.Add(new CapeOptionParameter("optionParam", typeof(Options), CapeParamMode.CAPE_OUTPUT));
            CasterLogger.Debug("InitResults completed");
        }
Exemple #8
0
        public override void InitParameters()
        {
            if (Parameters != null && Parameters.Count != 0)
            {
                CasterLogger.Debug("Parameters is not empty, skip InitParameters");
                return;
            }
            CasterLogger.Debug("InitParameters");
            CapeRealParameter ParamT = new CapeRealParameter("T", UnitCategoryEnum.Temperature,
                                                             CapeParamMode.CAPE_INPUT, defaultVal: 500);

            ParamT.ComponentDescription = "temperature of outlet material";
            CapeRealParameter ParamP = new CapeRealParameter("P", UnitCategoryEnum.Pressure,
                                                             CapeParamMode.CAPE_INPUT, defaultVal: 200000);

            ParamP.ComponentDescription = "pressure of outlet material";
            Parameters.Add(ParamT);
            Parameters.Add(ParamP);

            Parameters.Add(new CapeIntParameter("intParam", CapeParamMode.CAPE_INPUT));
            Parameters.Add(new CapeBooleanParameter("boolParam", CapeParamMode.CAPE_INPUT));
            Parameters.Add(new CapeOptionParameter("optionParam", typeof(Options), CapeParamMode.CAPE_INPUT));
            CasterLogger.Debug("InitParameters completed");
        }
 public RealParamViewBase(string uiName, CapeRealParameter realParam)
 {
     UIName = uiName;
     param  = realParam;
 }
Exemple #10
0
 public void CapeRealParameterInit()
 {
     param = new CapeRealParameter("real",
                                   UnitCategoryEnum.Pressure, CapeParamMode.CAPE_INPUT,
                                   -100, 100, 10);
 }