Example #1
0
 private void frmLayerManager_Load(object sender, EventArgs e)
 {
     string[] sHead     = new string[] { "序号", "层名称", "时间", "渐变", "压力", "转速", "控温类型" };
     bool[]   bReadOnly = new bool[] { false, false };
     CPublicDGV.InitializeDGV(dataGridView1, sHead, bReadOnly, true);
     FillDataGridView();
 }
Example #2
0
        private void FillGrid2()
        {
            CPublicDGV.InitializeDGV(dGV2, sCol2, bCol2, true);
            dGV2.Rows.Clear();

            ArrayList obj = new ArrayList();

            string[] str1;

            /// 创建XmlDocument类的实例
            XmlDocument myxmldoc = new XmlDocument();
            string      sXMLPath = CProject.sPrjPath + "\\Project\\Setting.xml";

            myxmldoc.Load(sXMLPath);

            string     xpath     = "root/System";
            XmlElement childNode = (XmlElement)myxmldoc.SelectSingleNode(xpath);

            foreach (XmlElement item in childNode.ChildNodes)
            {
                str1    = new string[dGV2.ColumnCount];
                str1[0] = item.GetAttribute("名称");
                str1[1] = item.GetAttribute("字地址");
                str1[3] = item.GetAttribute("描述");
                str1[4] = item.GetAttribute("备注");
                obj.Add(str1);
            }
            foreach (string[] rowArray in obj)
            {
                dGV2.Rows.Add(rowArray);
            }
        }
Example #3
0
 public frmUserManage(CUserInfo _User)
 {
     InitializeComponent();
     nUserInfo = _User;
     CPublicDGV.InitializeDGV(dGV1, sCol2, bCol2, true);
     dGV1.MultiSelect = false;
     FillGrid();
 }
Example #4
0
        private void FillCol(DataGridView dgv)
        {
            CPublicDGV.InitializeDGV(dGV1, sCol2, bCol2, true);

            dgv.SelectionMode = DataGridViewSelectionMode.CellSelect;
            for (int i = 0; i < dGV1.ColumnCount; i++)
            {
                dgv.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
            }
        }
Example #5
0
        public frmCComm()
        {
            InitializeComponent();
            FillTreeList();
            CommTimer           = new System.Timers.Timer(1000);                        //实例化Timer类,设置间隔时间为1000毫秒;
            CommTimer.Elapsed  += new System.Timers.ElapsedEventHandler(CommTimerCall); //到达时间的时候执行事件;
            CommTimer.AutoReset = true;                                                 //设置是执行一次(false)还是一直执行(true);
            CommTimer.Enabled   = false;                                                //是否执行System.Timers.Timer.Elapsed事件;

            CPublicDGV.InitializeDGV(dGV1, sCol1, bCol1, true);
        }
Example #6
0
        private System.Timers.Timer CommTimer;// = new Timer(1000);

        public RealtimeTable()
        {
            InitializeComponent();
            string[] sCol2 = new string[] { "序号", "子站名称", "变量名称", "变量值", "变量描述", "单位", "数据类型", "读写属性" };
            bool[]   bCol2 = new bool[] { false, false, false, false, false, false, false, false, false, false, false, false, false, false, false };

            CPublicDGV.InitializeDGV(dataGridView1, sCol2, bCol2, true);
            FillTreeList();
            CommTimer           = new System.Timers.Timer(1000);                        //实例化Timer类,设置间隔时间为1000毫秒;
            CommTimer.Elapsed  += new System.Timers.ElapsedEventHandler(CommTimerCall); //到达时间的时候执行事件;
            CommTimer.AutoReset = true;                                                 //设置是执行一次(false)还是一直执行(true);
            CommTimer.Enabled   = true;                                                 //是否执行System.Timers.Timer.Elapsed事件;
        }
Example #7
0
 private void LayDel_Click(object sender, EventArgs e)
 {
     if (MessageBox.Show("是否要删除选中的层?", "删除",
                         MessageBoxButtons.YesNo, MessageBoxIcon.Question,
                         MessageBoxDefaultButton.Button2) == DialogResult.Yes)
     {
         List <int> iRe = CPublicDGV.GetSelRow(dataGridView1);
         for (int i = iRe.Count - 1; i >= 0; i--)
         {
             LayDelFromXML(dataGridView1.Rows[iRe[i]].Cells[1].Value.ToString());
             dataGridView1.Rows.RemoveAt(iRe[i]);
         }
     }
 }
Example #8
0
        private void frmAlarmList_Load(object sender, EventArgs e)
        {
            CPublicDGV.InitializeDGV(dGV1, sCol1, bCol1, true);
            CPublicDGV.InitializeDGV(dGV2, sCol1, bCol1, true);
            CPublicDGV.InitializeDGV(dGV3, sCol1, bCol1, true);

            //CPublicDGV.InitializeDGV(HisdGV1, sCol2, bCol1, true);
            //CPublicDGV.InitializeDGV(HisdGV2, sCol2, bCol1, true);
            //CPublicDGV.InitializeDGV(HisdGV3, sCol2, bCol1, true);

            dTP_E.Value = DateTime.Now;
            dTP_S.Value = DateTime.Now.AddDays(-1);

            FillDGVRealTime();
        }
Example #9
0
 private void FillGrid()
 {
     sCol8 = new string[] { "欧陆表", "最小值", "最大值", "   P   ", "   I   ", "   D   " };
     CPublicDGV.InitializeDGV(dGV2, sCol2, bCol2, true);
     CPublicDGV.InitializeDGV(dGV5, sCol5, bCol5, true);
     CPublicDGV.InitializeDGV(dGV8, sCol8, bCol8, true);
     FillGrid1();
     FillGrid2();
     FillGrid3();
     FillGrid5();
     FillGrid8();
     UpdatePLCValue();
     NotSortable(dGV1);
     NotSortable(dGV2);
     NotSortable(dGV3);
     NotSortable(dGV5);
     NotSortable(dGV8);
 }
Example #10
0
        public frmC曲线刻度设置(CLSChart ZedG1, bool bCur)
        {
            InitializeComponent();
            ZedG = ZedG1;
            if (bCur)
            {
                this.Size            = new Size(501, 380);
                PaneFill.BackColor   = ZedG.PaneFill;
                ChartFill.BackColor  = ZedG.ChartFill;
                LegendFill.BackColor = ZedG.LegendFill;
                GridColor.BackColor  = ZedG.GridColor;

                XAxisTitleShow.Checked = ZedG.XAxisTitleShow;
                XAxisTitle.Text        = ZedG.XAxisTitle;
                XAxisFormat.Text       = ZedG.XAxisFormat;
                CurveLineWith.Value    = ZedG.CurveLineWith;
                groupBox2.Dock         = DockStyle.Fill;
                groupBox1.Visible      = false;
                button2.Visible        = false;
                FillDGV2();
            }
            else
            {
                this.Size         = new Size(400, 300);
                groupBox1.Dock    = DockStyle.Fill;
                groupBox2.Visible = false;
                button1.Visible   = false;
                CPublicDGV.InitializeDGV(dGV1, sCol2, bCol2, true);
                dGV1.AllowUserToAddRows = false; //禁止用户新建行
                dGV1.RowHeadersVisible  = false; //去掉左侧的行标题
                for (int i = 0; i < dGV1.ColumnCount; i++)
                {
                    dGV1.Columns[i].SortMode = DataGridViewColumnSortMode.NotSortable;
                }
                FillDGV1();
            }
        }