Esempio n. 1
0
        private void Bt_varAddCheck_Click(object sender, EventArgs e)
        {
            TreeNode CurSelectedNode = form1.treeView1.SelectedNode;
            var      CurPlc          = form1.Pmg.FindPLCByName(CurSelectedNode.Name);
            var      varName         = tx_varName.Text;
            var      datatype        = (DataType)Enum.Parse(typeof(DataType), co_plcAreaType.Text);
            var      db           = int.Parse(DBNumber.Text);
            var      startAddr    = int.Parse(tx_varAddr.Text);
            var      varType      = (VarType)Enum.Parse(typeof(VarType), co_varType.Text);
            var      count        = int.Parse(tx_varLenth.Text);
            var      bitNumber    = (Byte)int.Parse(tx_varBitAddr.Text);
            var      s7PlcValItem = new s7plcVarItem(form1.VarGridView, CurPlc, varName, datatype, db, startAddr, varType, count, bitNumber);

            s7PlcValItem.Node.ContextMenuStrip = form1.varContextStrip;
            s7PlcValItem.TreeView1             = form1.treeView1;
            CurPlc.Add(s7PlcValItem);
            this.DialogResult = DialogResult.OK;
        }
Esempio n. 2
0
 public void Add(s7plcVarItem item)
 {
     varlist.Add(item);
     Node.Nodes.Add(item.Node);
 }