static void processGraphItem(graphitem graphitem)
        {
            List <displayitem> list = new List <displayitem>();

            foreach (var expression in graphitem.expressions)
            {
                var items = expression.Split(new char[] { ' ', '\t', '\n' }, StringSplitOptions.RemoveEmptyEntries);

                foreach (var item in items)
                {
                    var matchs = Regex.Matches(item.Trim(), @"^([A-z0-9_]+)\.([A-z0-9_]+)[:2]*$");

                    if (matchs.Count > 0)
                    {
                        foreach (Match match in matchs)
                        {
                            var temp = new displayitem();
                            // right axis
                            if (item.EndsWith(":2"))
                            {
                                temp.left = false;
                            }

                            temp.type  = match.Groups[1].Value.ToString();
                            temp.field = match.Groups[2].Value.ToString();

                            list.Add(temp);
                        }
                    }
                    else
                    {
                        var temp = new displayitem();
                        if (item.EndsWith(":2"))
                        {
                            temp.left = false;
                        }
                        temp.expression = item;
                        temp.type       = item;
                        list.Add(temp);
                    }
                }
            }

            var dispitem = new displaylist()
            {
                Name  = graphitem.name,
                items = list.ToArray()
            };

            graphs.Add(dispitem);
        }
        private void CMB_preselect_SelectedIndexChanged(object sender, EventArgs e)
        {
            displaylist selectlist = (displaylist)CMB_preselect.SelectedValue;

            if (selectlist.items == null)
            {
                return;
            }

            BUT_cleargraph_Click(null, null);

            foreach (var item in selectlist.items)
            {
                try
                {
                    GraphItem(item.type, item.field, item.left);
                }
                catch { }
            }
        }
Beispiel #3
0
        void processGraphItem(graphitem graphitem)
        {
            List<displayitem> list = new List<displayitem>();

            foreach (var expression in graphitem.expressions)
            {
                var items = expression.Split(new char[] {' ', '\t', '\n'}, StringSplitOptions.RemoveEmptyEntries);

                foreach (var item in items)
                {
                    var matchs = Regex.Matches(item.Trim(), @"^([A-z0-9_]+)\.([A-z0-9_]+)[:2]*$");

                    // there is a item we dont understand/abandon it
                    if (matchs.Count == 0)
                        break;

                    foreach (Match match in matchs)
                    {
                        var temp = new displayitem();
                        // right axis
                        if (item.EndsWith(":2"))
                            temp.left = false;

                        temp.type = match.Groups[1].Value.ToString();
                        temp.field = match.Groups[2].Value.ToString();

                        list.Add(temp);
                    }
                }
            }

            var dispitem = new displaylist()
            {
                Name = graphitem.name,
                items = list.ToArray()
            };

            graphs.Add(dispitem);
        }