Exemplo n.º 1
0
        /// <summary>
        /// 复制警戒线到默认曲线
        /// </summary>
        /// <param name="lt"></param>
        /// <returns></returns>
        SectionSeries getSeriesFromLimit(sectionLimit lt)
        {
            SectionSeries ps = new SectionSeries(null);

            ps.Color           = lt.Color;
            ps.BorderWidth     = lt.Width;
            ps.BorderDashStyle = lt.Style;
            ps.Limit           = lt.Limit;
            ps.Enabled         = lt.Enable;
            ps.Name            = lt.Name;
            return(ps);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 复制警戒线
        /// </summary>
        /// <param name="ps"></param>
        /// <returns></returns>
        private sectionLimit setLimit(PMSSeries ps)
        {
            sectionLimit lt = new sectionLimit();

            lt.Color  = ps.Color;
            lt.Width  = ps.BorderWidth;
            lt.Style  = ps.BorderDashStyle;
            lt.Limit  = (ps as SectionSeries).Limit;
            lt.Enable = ps.Enabled;
            lt.Name   = ps.Name;
            return(lt);
        }
Exemplo n.º 3
0
        private void btnAdd_Click(object sender, EventArgs e)
        {
            string       aim = "警戒线";
            sectionLimit pt  = new sectionLimit();

            pt.Name   = GetNameFromList(limitList, aim);
            pt.Color  = Color.Red;
            pt.Enable = true;
            pt.Style  = ChartDashStyle.Solid;
            pt.Width  = 1;
            pt.Limit  = 0;
            limitList.Add(pt);
            initlvwLimit();
            lvwLimit.Items[lvwLimit.Items.Count - 1].Selected = true;
        }
Exemplo n.º 4
0
        private void AddLimitToolStripMenuItem_Click(object sender, EventArgs e)
        {
            string aim = "警戒线";

            treeView1.ContextMenuStrip = null;
            treeView1.ExpandAll();
            propertyGrid1.SelectedObject = null;
            sectionLimit pt = new sectionLimit();

            pt.Name = GetNameFromList(limitList, aim);
            if (treeView1.Nodes[sectionDec].Nodes[curve].Nodes[alert].Nodes.Count != 0)
            {
                for (int i = 0; i < treeView1.Nodes[sectionDec].Nodes[curve].Nodes[alert].Nodes.Count; i++)
                {
                    int j;
                    if (treeView1.Nodes[sectionDec].Nodes[curve].Nodes[alert].Nodes[i].Text.Length > aim.Length)
                    {
                        if (int.TryParse(treeView1.Nodes[sectionDec].Nodes[curve].Nodes[alert].Nodes[i].Text.Substring(aim.Length), out j))
                        {
                            if (int.Parse(pt.Name.Substring(aim.Length)) < int.Parse(treeView1.Nodes[sectionDec].Nodes[curve].Nodes[alert].Nodes[i].Text.Substring(aim.Length)))
                            {
                                treeView1.Nodes[sectionDec].Nodes[curve].Nodes[alert].Nodes.Insert(i, pt.Name, pt.Name);
                                limitList.Insert(i, pt);
                                break;
                            }
                        }
                    }
                    if (i == treeView1.Nodes[sectionDec].Nodes[curve].Nodes[alert].Nodes.Count - 1)
                    {
                        treeView1.Nodes[sectionDec].Nodes[curve].Nodes[alert].Nodes.Add(pt.Name, pt.Name);
                        limitList.Add(pt);
                        break;
                    }
                }
            }
            else
            {
                treeView1.Nodes[sectionDec].Nodes[curve].Nodes[alert].Nodes.Add(pt.Name, pt.Name);
                limitList.Add(pt);
            }
            pt.Color  = Color.Red;
            pt.Enable = true;
            pt.Style  = ChartDashStyle.Solid;
            pt.Width  = 1;


            treeView1.Nodes[sectionDec].Nodes[curve].Nodes[alert].Nodes[pt.Name].Tag = pt;
        }