void LoadParameters()
 {
     AdjustableParameters = new Dictionary <string, ParameterProfile>();
     AdjustableParameters["ScaleStepRatio"] = new ParameterProfile
     {
         Description  = "Ratio of the new scale to the old scale when stepping up scales",
         MaxValue     = 3,
         MinValue     = 1.001,
         CurrentValue = 1.1,
         Interval     = 0.001
     };
     AdjustableParameters["MinimumNieghbors"] = new ParameterProfile
     {
         Description  = "Minimum number of nearby matching features to qualify as face",
         MaxValue     = 25,
         MinValue     = 1,
         CurrentValue = 7,
         Interval     = 1
     };
     AdjustableParameters["MinimumSearchSize"] = new ParameterProfile
     {
         Description  = "Minimum Length/Width of Search Square in pixels",
         MaxValue     = 200,
         MinValue     = 1,
         CurrentValue = 40,
         Interval     = 1
     };
     AdjustableParameters["BoundsX"] = new ParameterProfile
     {
         Description  = "X location of bounding rectangle",
         MaxValue     = 10000,
         MinValue     = 0,
         CurrentValue = 190,
         Interval     = 10
     };
     AdjustableParameters["BoundsY"] = new ParameterProfile
     {
         Description  = "Y location of bounding rectangle",
         MaxValue     = 10000,
         MinValue     = 0,
         CurrentValue = 60,
         Interval     = 10
     };
     AdjustableParameters["BoundsHeight"] = new ParameterProfile
     {
         Description  = "Height of bounding rectangle",
         MaxValue     = 10000,
         MinValue     = 0,
         CurrentValue = 380,
         Interval     = 10
     };
     AdjustableParameters["BoundsWidth"] = new ParameterProfile
     {
         Description  = "Width of bounding rectangle",
         MaxValue     = 10000,
         MinValue     = 0,
         CurrentValue = 240,
         Interval     = 10
     };
 }
        private void SetParameterProfiles(string classConfigurationName)
        {
            base.AddParameterProfile(new ParameterProfile(VisualXhtmlEditorFuntion.ContainerClassesParameterName,
                                                          typeof(string), false,
                                                          new ConstantValueProvider(""), StandardWidgetFunctions.TextBoxWidget, null,
                                                          "Container Classes",
                                                          new HelpDefinition("Class names to attach to the editor (for styling) and to use for filtering components. Seperate multiple names with space or comma.")
                                                          ));

            ParameterProfile classConfigNamePP =
                new ParameterProfile(VisualXhtmlEditorFuntion.ClassConfigurationNameParameterName,
                                     typeof(string), false,
                                     new ConstantValueProvider(classConfigurationName), StandardWidgetFunctions.TextBoxWidget, null,
                                     "Class configuration name", new HelpDefinition("The visual editor can be configured to offer the editor a special set of class names for formatting xhtml elements. The default value is '" + classConfigurationName + "'"));

            base.AddParameterProfile(classConfigNamePP);

            ParameterProfile typeNamePP =
                new ParameterProfile(VisualXhtmlEditorFuntion.EmbedableFieldTypeParameterName,
                                     typeof(Type), false,
                                     new ConstantValueProvider(null), StandardWidgetFunctions.DataTypeSelectorWidget, null,
                                     "Embedable fields, Data type", new HelpDefinition("If a data type is selected, fields from this type can be inserted into the xhtml."));

            base.AddParameterProfile(typeNamePP);

            StringSelector.BuildInlineXhtmlEditorParameters().ForEach(AddParameterProfile);
        }
Esempio n. 3
0
 public LabeledIncrementor(ParameterProfile profile)
 {
     InitializeComponent();
     _currentProfile             = profile;
     txtNum.Text                 = profile.CurrentValue.ToString();
     IncrementorDescription.Text = profile.Description;
 }
Esempio n. 4
0
 public JavsMotion()
 {
     AdjustableParameters = new Dictionary <string, ParameterProfile>();
     AdjustableParameters["MinMotionArea"] = new ParameterProfile
     {
         Description  = "Minimum Motion Size Threshold",
         MaxValue     = 1000,
         MinValue     = 5,
         CurrentValue = 100,
         Interval     = 1
     };
     AdjustableParameters["MinMotionDistance"] = new ParameterProfile
     {
         Description  = "Minimum Motion Distance Threshold",
         MaxValue     = 1,
         MinValue     = 0.005,
         CurrentValue = 0.05,
         Interval     = 0.005
     };
     //Try out various background subtractors
     _backgroundSubtractor = new BackgroundSubtractorMOG2();
     //Can the parameters taken by this constructor be adjusted during capture?
     _motionHistory = new MotionHistory(
         1.0,  //in second, the duration of motion history you wants to keep
         0.05, //in second, maxDelta for cvCalcMotionGradient
         0.5); //in second, minDelta for cvCalcMotionGradient
 }
Esempio n. 5
0
 public JavsPerson()
 {
     AdjustableParameters          = new Dictionary <string, ParameterProfile>();
     AdjustableParameters["Scale"] = new ParameterProfile
     {
         Description  = "Coefficient of the detection window increase",
         MaxValue     = 2,
         MinValue     = 1,
         CurrentValue = 1.05,
         Interval     = 0.01
     };
     AdjustableParameters["SimilarityThreshold"] = new ParameterProfile
     {
         Description  = "Minimum similarity Threshold, 0 = no grouping",
         MaxValue     = 10,
         MinValue     = 0,
         CurrentValue = 2,
         Interval     = 0.5
     };
     AdjustableParameters["MeanShiftGrouping"] = new ParameterProfile
     {
         Description  = "Use (1) or don't use (0) Mean Shift Grouping",
         MaxValue     = 1,
         MinValue     = 0,
         CurrentValue = 0,
         Interval     = 1
     };
 }
Esempio n. 6
0
        public CheckBoxWidgetFuntion(EntityTokenFactory entityTokenFactory)
            : base(CompositeName, typeof(bool), entityTokenFactory)
        {
            ParameterProfile pp =
                new ParameterProfile("ItemLabel", typeof(string), false,
                                     new ConstantValueProvider(""), StandardWidgetFunctions.TextBoxWidget, null,
                                     "Sub label", new HelpDefinition("Text to whow beside the checkbox"));

            base.AddParameterProfile(pp);
        }
        public DateTimeSelectorWidgetFunction(EntityTokenFactory entityTokenFactory)
            : base(CompositeName, typeof(DateTime), entityTokenFactory)
        {
            ParameterProfile pp =
                new ParameterProfile("ReadOnly", typeof(bool), false,
                                     new ConstantValueProvider(false), StandardWidgetFunctions.CheckBoxWidget, null,
                                     "Read only", new HelpDefinition("When selected users can not change the date."));

            base.AddParameterProfile(pp);
        }
        public TextBoxWidgetFuntion(EntityTokenFactory entityTokenFactory)
            : base(CompositeName, typeof(string), entityTokenFactory)
        {
            ParameterProfile spellCheckPP =
                new ParameterProfile(TextBoxWidgetFuntion.SpellCheckParameterName,
                                     typeof(bool), false,
                                     new ConstantValueProvider(true), StandardWidgetFunctions.GetBoolSelectorWidget("Allow spell checking", "Do not allow spell checking"), null,
                                     "Spell check", new HelpDefinition("By default text will be spell checked (when available). You should explicitly disable spell checking on fields that contain e-mails, code values etc. not suitable for spell checking. "));

            base.AddParameterProfile(spellCheckPP);
        }
        public FormMarkupWidgetFuntion(EntityTokenFactory entityTokenFactory)
            : base(CompositeName, typeof(string), entityTokenFactory)
        {
            var markupParameterProfile =
                new ParameterProfile(MarkupParameterName,
                                     typeof(string), true,
                                     new ConstantValueProvider(
                                         @"<TextBox Label=""$label"" Help=""$help"" SpellCheck=""true"">
	<TextBox.Text>
	  <cms:bind source=""$binding"" />
	</TextBox.Text>
</TextBox>"), StandardWidgetFunctions.TextAreaWidget, null,
                                     "Markup", new HelpDefinition("Markup will be inserted into result form markup. Macroses are: '$binding', '$label' and '$help'"));

            base.AddParameterProfile(markupParameterProfile);
        }
Esempio n. 10
0
 public static string OfficeUserProfile(string type, string getBy, string byValue)
 {
     try
     {
         string           sp        = "dbo.tcdsb_LTO_getOfficerProfile @Type, @GetBy, @ByValue";
         ParameterProfile parameter = new ParameterProfile {
             GetBy = getBy, Type = type, ByValue = byValue
         };
         string result = GeneralDataAccess.TextValue(sp, parameter);
         return(result);
     }
     catch (Exception ex)
     {
         var exm = ex.Message;
         return("");
     }
 }
Esempio n. 11
0
        private void SetParameterProfiles(bool require, string trueLabel, string falseLabel)
        {
            ParameterProfile trueLabelPP =
                new ParameterProfile(BoolSelectorWidgetFuntion.TrueLabelParameterName,
                                     typeof(string), require,
                                     new ConstantValueProvider(trueLabel), StandardWidgetFunctions.TextBoxWidget, null,
                                     "True label", new HelpDefinition("Label to show when value is true"));

            ParameterProfile falseLabelPP =
                new ParameterProfile(BoolSelectorWidgetFuntion.FalseLabelParameterName,
                                     typeof(string), require,
                                     new ConstantValueProvider(falseLabel), StandardWidgetFunctions.TextBoxWidget, null,
                                     "False label", new HelpDefinition("Label to show when value is false"));

            base.AddParameterProfile(trueLabelPP);
            base.AddParameterProfile(falseLabelPP);
        }
        /// <exclude />
        public static void SetParameterValue(XElement functionMarkup, ParameterProfile parameter, object parameterValue)
        {
            bool newValueNotEmpty = parameterValue != null &&
                                    (!(parameterValue is IList) || ((IList)parameterValue).Count > 0) &&
                                    !(parameter.IsRequired && parameterValue as string == string.Empty);

            var parameterNode = functionMarkup.Elements(ParameterNodeXName).FirstOrDefault(p => (string)p.Attribute("name") == parameter.Name);

            if (parameterNode != null)
            {
                parameterNode.Remove();
            }

            if (newValueNotEmpty && parameterValue != parameter.GetDefaultValue())
            {
                var newConstantParam = new ConstantObjectParameterRuntimeTreeNode(parameter.Name, parameterValue);

                functionMarkup.Add(newConstantParam.Serialize());
            }
        }
        /// <summary>
        /// Gets simple parameter value from it's markup.
        /// </summary>
        /// <returns></returns>
        public static object GetParameterValue(XElement parameterNode, ParameterProfile parameterProfile)
        {
            List <XElement> parameterElements = parameterNode.Elements(ParameterValueElementXName).ToList();

            if (parameterElements.Any())
            {
                return(parameterElements.Select(element => element.Attribute("value").Value).ToList());
            }

            var valueAttr = parameterNode.Attribute("value");

            if (valueAttr != null)
            {
                try
                {
                    return(XmlSerializationHelper.Deserialize(valueAttr, parameterProfile.Type));
                }
                catch (Exception ex)
                {
                    Log.LogError(LogTitle, ex);

                    return(parameterProfile.GetDefaultValue());
                }
            }

            if (parameterNode.Elements().Any())
            {
                Type paramType = parameterProfile.Type;

                if (paramType.IsSubclassOf(typeof(XContainer)) ||
                    (paramType.IsLazyGenericType() &&
                     paramType.GetGenericArguments()[0].IsSubclassOf(typeof(XContainer))))
                {
                    return(ValueTypeConverter.Convert(parameterNode.Elements().First(), parameterProfile.Type));
                }

                throw new NotImplementedException("Not supported type of function parameter element node: '{0}'".FormatWith(paramType.FullName));
            }

            return(parameterProfile.GetDefaultValue());
        }
 public MvcFunctionBuilder AddParameter(ParameterProfile parameterProfile)
 {
     _function.AddParameter(parameterProfile);
     return(this);
 }
Esempio n. 15
0
 protected void AddParameterProfile(ParameterProfile pp) => ((List <ParameterProfile>)ParameterProfiles).Add(pp);
Esempio n. 16
0
 public virtual void AddParameter(ParameterProfile parameterProfile)
 {
     _parameters.Add(parameterProfile);
 }
 /// <exclude />
 protected void AddParameterProfile(ParameterProfile pp)
 {
     ((List <ParameterProfile>) this.ParameterProfiles).Add(pp);
 }