コード例 #1
0
        private void btnCalcTagAdd_Click(object sender, EventArgs e)
        {
            frmEditCalcTag frm = new frmEditCalcTag(SetCalcTagInformation, CheckDuplicateTag, this.taglist_data, false);

            frm.Owner = this;
            frm.ShowDialog();
            RefreshDeviceCalcTagList();
        }
コード例 #2
0
        private void btnTemplateAddCalcTag_Click(object sender, EventArgs e)
        {
            ConcurrentDictionary <string, cls_Tag> dicTag = new ConcurrentDictionary <string, cls_Tag>();

            foreach (cls_Tag tag in this.tag_list)
            {
                dicTag.TryAdd(tag.TagName, tag);
            }


            frmEditCalcTag frm = new frmEditCalcTag(SetCalcTagInformation, CheckDuplicateTag, dicTag, false);

            frm.Owner = this;
            frm.ShowDialog();
            DisplayCalcTagList();
        }
コード例 #3
0
        private void lvCalcTagList_DoubleClick(object sender, EventArgs e)
        {
            string strCalcTagName;
            ConcurrentDictionary <string, cls_Tag> dictTag = new ConcurrentDictionary <string, cls_Tag>();
            cls_CalcTag calc_tag = new cls_CalcTag();

            if (lvCalcTagList.SelectedItems.Count == 0)
            {
                MessageBox.Show("Please select the calculation tag first!", "Error");
                return;
            }

            foreach (cls_Tag tag in this.tag_list)
            {
                dictTag.TryAdd(tag.TagName, tag);
            }

            strCalcTagName = lvCalcTagList.SelectedItems[0].Text;
            int i = 0;

            foreach (cls_CalcTag t in this.calc_tag_list)
            {
                if (t.TagName == strCalcTagName)
                {
                    calc_tag = t;
                    break;
                }
                i++;
            }
            this.calc_tag_index = i;

            frmEditCalcTag frm = new frmEditCalcTag(SetCalcTagInformation, dictTag, calc_tag);

            frm.Owner = this;
            frm.ShowDialog();
            DisplayCalcTagList();
        }
コード例 #4
0
        private void lvCalcTagList_DoubleClick(object sender, EventArgs e)
        {
            string      strCalcTagName;
            cls_CalcTag calc_tag = new cls_CalcTag();

            if (lvCalcTagList.SelectedItems.Count == 0)
            {
                MessageBox.Show("Please select the calculation tag first!", "Error");
                return;
            }

            strCalcTagName = lvCalcTagList.SelectedItems[0].Text;
            if (!calc_taglist_data.TryGetValue(strCalcTagName, out calc_tag))
            {
                MessageBox.Show("Get tag[" + strCalcTagName + "] information error", "Error");
                return;
            }

            frmEditCalcTag frm = new frmEditCalcTag(SetCalcTagInformation, this.taglist_data, calc_tag);

            frm.Owner = this;
            frm.ShowDialog();
            RefreshDeviceCalcTagList();
        }