コード例 #1
0
ファイル: FormMain.cs プロジェクト: randianb/my-csharp-sample
        /// <summary>
        /// Point
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void pointToolStripMenuItem_Click(object sender, EventArgs e)
        {
            FormPoint subForm = new FormPoint();

            subForm.MdiParent = this;
            subForm.Show();
        }
コード例 #2
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));
            }
        }
コード例 #3
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);
            }
        }