Пример #1
0
        //新增测点
        private void AddPoint(object sender, RoutedEventArgs e)
        {
            FormPoint form = new FormPoint();

            form.Owner = this;
            if ((bool)form.ShowDialog())
            {
                //确定新增
                OPCManager.AddPoint((SHHOPCGroup)tree.SelectedItem, new SHHOPCItem(Guid.NewGuid(), new SHHEquipment((SHHEquipmentID)form.EquipID, SHHEquipmentType.Analog, form.PointName, "kpa"), form.PointName, form.Place, form.Id));
            }
        }
Пример #2
0
        //修改测点
        private void ModifyPoint(object sender, RoutedEventArgs e)
        {
            SHHOPCItem node = tree.SelectedItem as SHHOPCItem;
            FormPoint  form = new FormPoint();


            //载入参数
            form.cbx_EquipID.SelectedIndex = (int)node.Equipment.Id;
            form.tbx_Name.Text             = node.PointName;
            form.tbx_Place.Text            = node.PointPlace;
            form.tbx_Id.Text = node.OPCItemID;
            form.Owner       = this;

            if ((bool)form.ShowDialog())
            {
                node.PointName    = form.PointName;
                node.PointPlace   = form.Place;
                node.Equipment.Id = (SHHEquipmentID)form.EquipID;


                //确定修改
                OPCManager.ModifyPoint(node);
            }
        }