Esempio n. 1
0
        public static async Task <ushort[]> ExecuteFormatBack(IFormattedValue userValue,
                                                              RuleExecutionContext ruleExecutionContext, List <IRuleNode> ruleNodes)
        {
            ruleExecutionContext.SetVariable(VariableNames.INPUT_VALUE, userValue);
            foreach (var ruleNode in ruleNodes)
            {
                try
                {
                    await ruleNode.ExecuteNode(ruleExecutionContext);
                }
                catch (Exception e)
                {
                }
            }

            return(ruleExecutionContext.GetVariable <List <ushort> >(VariableNames.DEVICE_VALUE).ToArray());
        }
Esempio n. 2
0
        public static async Task <IFormattedValue> ExecuteFormat(ushort[] deviceValue,
                                                                 RuleExecutionContext ruleExecutionContext, List <IRuleNode> ruleNodes)
        {
            ruleExecutionContext.SetVariable(VariableNames.DEVICE_VALUE, deviceValue.ToList());
            foreach (var ruleNode in ruleNodes)
            {
                try
                {
                    await ruleNode.ExecuteNode(ruleExecutionContext);
                }
                catch (Exception e)
                {
                }
            }

            return(ruleExecutionContext.GetVariable <IFormattedValue>(VariableNames.RESULT_VALUE));
        }
Esempio n. 3
0
 public virtual async Task <object> ExecuteNode(RuleExecutionContext ruleExecutionContext)
 {
     return(ruleExecutionContext);
 }