Ejemplo n.º 1
0
        public void UpdateCurErrInfo(List<MonitorDataFlag> monitorDataFlags)
        {
            if (this.InvokeRequired)
            {
                UpdateCurErrInfoHandler cs = new UpdateCurErrInfoHandler(UpdateCurErrInfo);
                this.Invoke(cs, new object[] { monitorDataFlags });
                return;
            }

            if (monitorDataFlags == null || monitorDataFlags.Count == 0)
            {
                dbDataGridView_MonitorInfo.RowCount = 1;
                _isFirst = true;
                return;
            }
            dbDataGridView_MonitorInfo.RowCount = monitorDataFlags.Count + 1;

            for (int i = 0; i < monitorDataFlags.Count; i++)
            {
                dbDataGridView_MonitorInfo.Rows[i + 1].ReadOnly = true;
                dbDataGridView_MonitorInfo.Rows[i + 1].Height = 30;
                dbDataGridView_MonitorInfo.Rows[i + 1].DefaultCellStyle.BackColor = Color.AliceBlue;
                dbDataGridView_MonitorInfo.Columns[0].DefaultCellStyle.SelectionBackColor = Color.AliceBlue;
                //dbDataGridView_MonitorInfo.Rows[i + 1].DefaultCellStyle.SelectionBackColor = Color.Blue;
                dbDataGridView_MonitorInfo.Rows[i + 1].SetValues(new object[]
                                                             {
                                                                 monitorDataFlags[i].SNName,
                                                                 monitorDataFlags[i].IsSenderDVIValid,
                                                                 monitorDataFlags[i].IsSBStatusValid,
                                                                 monitorDataFlags[i].IsTemperatureValid,
                                                                monitorDataFlags[i].IsMCStatusValid,
                                                                monitorDataFlags[i].IsHumidityValid,
                                                                monitorDataFlags[i].IsSmokeValid,
                                                                monitorDataFlags[i].IsFanValid,
                                                                monitorDataFlags[i].IsPowerValid,
                                                                monitorDataFlags[i].IsRowLineValid,
                                                                monitorDataFlags[i].IsGeneralStatusValid,
                                                                monitorDataFlags[i].IsOnCareValid,
                                                                 monitorDataFlags[i].SN
                                                             });
            }
            if (DataGridClickEvent != null && _isFirst)
            {
                dbDataGridView_MonitorInfo[2, 1].Selected = true;
                DataGridClickEvent(dbDataGridView_MonitorInfo[12, 1].Value.ToString(), 2);
                _isFirst = false;
            }
        }
Ejemplo n.º 2
0
        public void UpdateCurErrInfo(List <MonitorDataFlag> monitorDataFlags)
        {
            if (this.InvokeRequired)
            {
                UpdateCurErrInfoHandler cs = new UpdateCurErrInfoHandler(UpdateCurErrInfo);
                this.Invoke(cs, new object[] { monitorDataFlags });
                return;
            }

            if (monitorDataFlags == null || monitorDataFlags.Count == 0)
            {
                dbDataGridView_MonitorInfo.RowCount = 1;
                _isFirst = true;
                return;
            }
            dbDataGridView_MonitorInfo.RowCount = monitorDataFlags.Count + 1;

            for (int i = 0; i < monitorDataFlags.Count; i++)
            {
                dbDataGridView_MonitorInfo.Rows[i + 1].ReadOnly = true;
                dbDataGridView_MonitorInfo.Rows[i + 1].Height   = 30;
                dbDataGridView_MonitorInfo.Rows[i + 1].DefaultCellStyle.BackColor         = Color.AliceBlue;
                dbDataGridView_MonitorInfo.Columns[0].DefaultCellStyle.SelectionBackColor = Color.AliceBlue;
                //dbDataGridView_MonitorInfo.Rows[i + 1].DefaultCellStyle.SelectionBackColor = Color.Blue;
                dbDataGridView_MonitorInfo.Rows[i + 1].SetValues(new object[]
                {
                    monitorDataFlags[i].SNName,
                    monitorDataFlags[i].IsSenderDVIValid,
                    monitorDataFlags[i].IsSBStatusValid,
                    monitorDataFlags[i].IsTemperatureValid,
                    monitorDataFlags[i].IsMCStatusValid,
                    monitorDataFlags[i].IsHumidityValid,
                    monitorDataFlags[i].IsSmokeValid,
                    monitorDataFlags[i].IsFanValid,
                    monitorDataFlags[i].IsPowerValid,
                    monitorDataFlags[i].IsRowLineValid,
                    monitorDataFlags[i].IsGeneralStatusValid,
                    monitorDataFlags[i].IsOnCareValid,
                    monitorDataFlags[i].SN
                });
            }
            if (DataGridClickEvent != null && _isFirst)
            {
                dbDataGridView_MonitorInfo[2, 1].Selected = true;
                DataGridClickEvent(dbDataGridView_MonitorInfo[12, 1].Value.ToString(), 2);
                _isFirst = false;
            }
        }