Example #1
0
        public static Indicator CreateIndicator(XmlNode i_node)
        {
            Indicator indi = new Indicator();
            List<string> sourceParameters = new List<string>();

            indi.Type = i_node.Attributes[0].Value;

            foreach (XmlNode node in i_node.ChildNodes) {
                switch (node.Name) {
                    case "script_name":
                        indi.ScriptName = node.InnerText;
                        break;
                    case "source_parameter":
                        sourceParameters.Add(node.InnerText);
                        break;
                    case "plots":
                        indi.Plot = bool.Parse(node.InnerText);
                        break;
                    case "fixed_param_one":
                        indi.Params[0] = node.InnerText;
                        break;
                    case "fixed_param_two":
                        indi.Params[1] = node.InnerText;
                        break;
                    case "fixed_param_three":
                        indi.Params[2] = node.InnerText;
                        break;
                    case "variable_scope":
                        switch (node.InnerText) {
                            case "Block":
                                indi.Scope = Scope.Block;
                                break;
                            case "Simulation":
                                indi.Scope = Scope.Simulation;
                                break;
                            case "System":
                                indi.Scope = Scope.System;
                                break;
                        }
                        break;
                    default:
                        break;
                }
            }
            indi.SourceParameters = sourceParameters.ToArray();
            return indi;
        }
Example #2
0
 public void addIndicator(Indicator i_indicator)
 {
     m_arIndicators.Add(i_indicator);
 }