Exemple #1
0
        /// <summary>
        /// show DataTag info
        /// </summary>
        /// <param name="dt"></param>
        private void ShowInfo(DataTag dt)
        {
            try
            {
                if (dt != null)
                {
                    this.isLoadingData = true;
                    ClearControls();
                    cboTagKind.SelectedValue = dt.TagKind;

                    txtTagName.Text = dt.GetSystemTagName();
                    txtUnit.Text = dt.GetSystemUnit();
                    cboPoint.SelectedIndex = dt.Point;
                    ntbZeroStatic.Text = CalcOperator.GetRoundDownString((double)dt.StaticZero , dt.Point);

                    if (dt.TagKind == 2)
                    {
                        if (dt.Expression != null)
                        {
                            txtCalc2.Text = dt.Expression;
                        }
                    }

                    if (!IsMeasure)
                    {
                        pnlTagInfo.Enabled = dt.TagKind == 2 || (dt.IsBlank && dt.TagKind == 0) ? true : false;
                        btnDelete.Enabled = dt.TagKind == 0 ? false : true;
                        if (dt.IsBlank)
                        {
                            cboTagKind.SelectedValue = 2;
                        }
                        cboTagKind.Enabled = false;
                    }
                }
            }
            catch (Exception ex)
            {
                ShowErrorMessage(ex);
            }
            finally
            { this.isLoadingData = false; }
        }
 /// <summary>
 /// select rotation DataTag
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void btnRotation_Click(object sender, EventArgs e)
 {
     try
     {
         selectedRotation = this.list[dgvDataTag.CurrentCell.RowIndex];
         dgvRotation.Rows.Clear();
         dgvRotation.Rows.Add(new string[] { selectedRotation.GetSystemTagName(), selectedRotation.GetSystemUnit(), selectedRotation.TagNo.ToString() });
         this.relationSetting.RelationList[0] = new RelationSetting();
         this.relationSetting.RelationList[0].ChannelNo = 0;
         this.relationSetting.RelationList[0].TagNo_1 = selectedRotation.TagNo;
         this.relationSetting.RelationList[0].TagNo_2 = -1;
         this.dirtyFlag = true;
     }
     catch (Exception ex)
     {
         ShowErrorMessage(ex);
     }
 }