Example #1
0
 private void dataGridView1_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         HistoryLines m_frmHistoryLines = new HistoryLines(UnitNO);
         m_frmHistoryLines.labelTag.TagID   = int.Parse(dataGridView1.CurrentRow.Cells["TagID"].Value.ToString());
         m_frmHistoryLines.labelTag.TagDesc = dataGridView1.CurrentRow.Cells["TagDesc"].Value.ToString();
         m_frmHistoryLines.Show();
     }
     catch (Exception ex) { WriteLog.WriteLogs(ex.ToString()); }
 }
Example #2
0
 private void Label_DoubleClick(object sender, EventArgs e)
 {
     try
     {
         HistoryLines m_frmHistoryLines = new HistoryLines(5);
         Label        label             = (Label)sender;
         m_frmHistoryLines.labelTag.TagID   = ((LabelTag)label.Tag).TagID;
         m_frmHistoryLines.labelTag.TagDesc = ((LabelTag)label.Tag).TagDesc;
         m_frmHistoryLines.Show();
     }
     catch { }
 }
Example #3
0
        private void btnOk_Click(object sender, EventArgs e)
        {
            dtCheckedTags = m_viewTagValue.Table.GetChanges();
            List <DataRow> lstDeleteRows = new List <DataRow>();

            if (dtCheckedTags != null)
            {
                foreach (DataRow row in dtCheckedTags.Rows)
                {
                    if (row["CheckRow"].ToString() == "1")
                    {
                        sExcelCells += row["ExcelCell"] + ",";
                    }
                    else
                    {
                        lstDeleteRows.Add(row);
                    }
                }
                sExcelCells = sExcelCells.Trim(',');
                if (lstDeleteRows.Count > 0)
                {
                    foreach (DataRow row in lstDeleteRows)
                    {
                        dtCheckedTags.Rows.Remove(row);
                    }
                }
            }
            //this.Close();
            //else
            //{
            //    MessageBox.Show("请选择测点!");
            //}

            //SelectTagDate在生成对象调用时,由ShowDialog()改成了Show();
            //因为用ShowDialog()时也会造成窗口无反应的假死现象,所以加了下面的语句。add by hlt 2017-1-18
            HistoryLines historyLines = new HistoryLines(UnitNO);

            if (sExcelCells.Length > 0)
            {
                historyLines.SetBeginTime(BeginTime);
                historyLines.SetEndTime(EndTime);
                historyLines.SetExcelCells(sExcelCells);
                historyLines.SetCheckedTags(dtCheckedTags);
            }
            else
            {
                historyLines.seriesCollection = chartParent.Series;
            }
            historyLines.Show();
            //this.Hide();
            this.Close();
        }