⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 formnwrtupackage.cs

📁 GPRS数据采集驱动源码
💻 CS
📖 第 1 页 / 共 3 页
字号:
			this.groupBox1.Controls.Add(this.label4);
			this.groupBox1.Controls.Add(this.nUDNum);
			this.groupBox1.Controls.Add(this.cbRtuSeq);
			this.groupBox1.Controls.Add(this.label6);
			this.groupBox1.Controls.Add(this.label2);
			this.groupBox1.Controls.Add(this.tbName);
			this.groupBox1.Controls.Add(this.label3);
			this.groupBox1.Controls.Add(this.label1);
			this.groupBox1.Controls.Add(this.lb);
			this.groupBox1.Controls.Add(this.nUDBytes);
			this.groupBox1.Location = new System.Drawing.Point(144, 168);
			this.groupBox1.Name = "groupBox1";
			this.groupBox1.Size = new System.Drawing.Size(528, 296);
			this.groupBox1.TabIndex = 69;
			this.groupBox1.TabStop = false;
			this.groupBox1.Text = "监测指标物理通道信息";
			// 
			// tbMemo
			// 
			this.tbMemo.Location = new System.Drawing.Point(96, 240);
			this.tbMemo.Multiline = true;
			this.tbMemo.Name = "tbMemo";
			this.tbMemo.Size = new System.Drawing.Size(416, 32);
			this.tbMemo.TabIndex = 60;
			this.tbMemo.Text = "";
			// 
			// chbUse
			// 
			this.chbUse.Checked = true;
			this.chbUse.CheckState = System.Windows.Forms.CheckState.Checked;
			this.chbUse.Location = new System.Drawing.Point(56, 198);
			this.chbUse.Name = "chbUse";
			this.chbUse.Size = new System.Drawing.Size(88, 24);
			this.chbUse.TabIndex = 59;
			this.chbUse.Text = "通道已用";
			// 
			// nUDChannel
			// 
			this.nUDChannel.Location = new System.Drawing.Point(98, 93);
			this.nUDChannel.Maximum = new System.Decimal(new int[] {
																	   1000000,
																	   0,
																	   0,
																	   0});
			this.nUDChannel.Name = "nUDChannel";
			this.nUDChannel.Size = new System.Drawing.Size(72, 21);
			this.nUDChannel.TabIndex = 54;
			// 
			// label4
			// 
			this.label4.Location = new System.Drawing.Point(32, 95);
			this.label4.Name = "label4";
			this.label4.Size = new System.Drawing.Size(64, 23);
			this.label4.TabIndex = 58;
			this.label4.Text = "通道号*:";
			this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			// 
			// nUDNum
			// 
			this.nUDNum.Location = new System.Drawing.Point(98, 128);
			this.nUDNum.Maximum = new System.Decimal(new int[] {
																   1000000,
																   0,
																   0,
																   0});
			this.nUDNum.Name = "nUDNum";
			this.nUDNum.Size = new System.Drawing.Size(72, 21);
			this.nUDNum.TabIndex = 55;
			// 
			// cbRtuSeq
			// 
			this.cbRtuSeq.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
			this.cbRtuSeq.Location = new System.Drawing.Point(98, 59);
			this.cbRtuSeq.Name = "cbRtuSeq";
			this.cbRtuSeq.Size = new System.Drawing.Size(136, 20);
			this.cbRtuSeq.TabIndex = 53;
			// 
			// label6
			// 
			this.label6.Location = new System.Drawing.Point(16, 59);
			this.label6.Name = "label6";
			this.label6.Size = new System.Drawing.Size(80, 24);
			this.label6.TabIndex = 57;
			this.label6.Text = "RTU设备号*:";
			this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			// 
			// label2
			// 
			this.label2.Location = new System.Drawing.Point(36, 130);
			this.label2.Name = "label2";
			this.label2.Size = new System.Drawing.Size(60, 23);
			this.label2.TabIndex = 56;
			this.label2.Text = "排序号*:";
			this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			// 
			// tbName
			// 
			this.tbName.Location = new System.Drawing.Point(98, 24);
			this.tbName.Name = "tbName";
			this.tbName.Size = new System.Drawing.Size(136, 21);
			this.tbName.TabIndex = 1;
			this.tbName.Text = "";
			// 
			// label3
			// 
			this.label3.Location = new System.Drawing.Point(24, 24);
			this.label3.Name = "label3";
			this.label3.Size = new System.Drawing.Size(72, 23);
			this.label3.TabIndex = 44;
			this.label3.Text = "指标名*:";
			this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			// 
			// label1
			// 
			this.label1.Location = new System.Drawing.Point(11, 162);
			this.label1.Name = "label1";
			this.label1.Size = new System.Drawing.Size(85, 24);
			this.label1.TabIndex = 57;
			this.label1.Text = "指标字节数*:";
			this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			// 
			// lb
			// 
			this.lb.Location = new System.Drawing.Point(48, 245);
			this.lb.Name = "lb";
			this.lb.Size = new System.Drawing.Size(47, 24);
			this.lb.TabIndex = 61;
			this.lb.Text = "备注:";
			this.lb.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
			// 
			// nUDBytes
			// 
			this.nUDBytes.Location = new System.Drawing.Point(98, 163);
			this.nUDBytes.Maximum = new System.Decimal(new int[] {
																	 4,
																	 0,
																	 0,
																	 0});
			this.nUDBytes.Minimum = new System.Decimal(new int[] {
																	 1,
																	 0,
																	 0,
																	 0});
			this.nUDBytes.Name = "nUDBytes";
			this.nUDBytes.Size = new System.Drawing.Size(72, 21);
			this.nUDBytes.TabIndex = 55;
			this.nUDBytes.Value = new System.Decimal(new int[] {
																   1,
																   0,
																   0,
																   0});
			// 
			// btnClose
			// 
			this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel;
			this.btnClose.Location = new System.Drawing.Point(688, 440);
			this.btnClose.Name = "btnClose";
			this.btnClose.TabIndex = 74;
			this.btnClose.Text = "退出&C";
			this.btnClose.Click += new System.EventHandler(this.btnClose_Click);
			// 
			// btnDelete
			// 
			this.btnDelete.Location = new System.Drawing.Point(688, 272);
			this.btnDelete.Name = "btnDelete";
			this.btnDelete.TabIndex = 73;
			this.btnDelete.Text = "删除&D";
			this.btnDelete.Click += new System.EventHandler(this.btnDelete_Click);
			// 
			// btnSearch
			// 
			this.btnSearch.Location = new System.Drawing.Point(688, 240);
			this.btnSearch.Name = "btnSearch";
			this.btnSearch.TabIndex = 72;
			this.btnSearch.Text = "查询&S";
			this.btnSearch.Click += new System.EventHandler(this.btnSearch_Click);
			// 
			// btnModify
			// 
			this.btnModify.Location = new System.Drawing.Point(688, 208);
			this.btnModify.Name = "btnModify";
			this.btnModify.TabIndex = 71;
			this.btnModify.Text = "修改&M";
			this.btnModify.Click += new System.EventHandler(this.btnModify_Click);
			// 
			// btnAdd
			// 
			this.btnAdd.Location = new System.Drawing.Point(688, 176);
			this.btnAdd.Name = "btnAdd";
			this.btnAdd.TabIndex = 70;
			this.btnAdd.Text = "增加&A";
			this.btnAdd.Click += new System.EventHandler(this.btnAdd_Click);
			// 
			// FormnwRtuPackage
			// 
			this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
			this.ClientSize = new System.Drawing.Size(770, 479);
			this.Controls.Add(this.btnClose);
			this.Controls.Add(this.btnDelete);
			this.Controls.Add(this.btnSearch);
			this.Controls.Add(this.btnModify);
			this.Controls.Add(this.btnAdd);
			this.Controls.Add(this.dgdTgt);
			this.Controls.Add(this.tvMain);
			this.Controls.Add(this.groupBox1);
			this.Name = "FormnwRtuPackage";
			this.Text = "监测点物理通道配置";
			((System.ComponentModel.ISupportInitialize)(this.dgdTgt)).EndInit();
			this.groupBox1.ResumeLayout(false);
			((System.ComponentModel.ISupportInitialize)(this.nUDChannel)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.nUDNum)).EndInit();
			((System.ComponentModel.ISupportInitialize)(this.nUDBytes)).EndInit();
			this.ResumeLayout(false);

		}		#endregion

		/// <summary>
		/// 取得列表
		/// </summary>
		private void GetData()
		{
			clsAsswConfigGUI.SetTVnwMntSpt(this.tvMain);
		
			ShowTgtList();
		}

		//根据选择的检测点显示检测指标列表
		private void ShowTgtList()
		{
			TreeNode tn=this.tvMain.SelectedNode;
			if (tn==null)
				return ;

			DataRow dr=(DataRow)tn.Tag;
			int iseq=Convert.ToInt32(dr["fd_seq"]);

			//刷新RTU列表
			this.cbRtuSeq.DataSource=null;
			clsAsswConfigGUI.FillRtuCb(this.cbRtuSeq,iseq);			
			
			//绑定指标datagrid
			DataSet ds=Class_Comm.GetServiceAsswConf().GetPackageByMntSptSeq(iseq);

			//DataGrid如果绑定了数据之后,会出现下面的情况当
			//用鼠标选中某一编辑框的情况下,对DataGrid的数据源DataSource进行更新,会出现列xxx不属于table的错误

			if(this.dgdTgt.DataSource!=null)
			{
				this.dgdTgt.TableStyles.Clear();
			}

			this.dgdTgt.TableStyles.Add(this.dataGridTableStyle1);
			
			
			this.dgdTgt.DataSource=ds.Tables["tb_nwRtuPackage"];
			this.dgdTgt.Tag=ds.Tables["tb_nwRtuPackage"];

			if (ds.Tables["tb_nwRtuPackage"].Rows.Count>0)
			{
				this.dgdTgt.Select(0);
				this.ShowTgtDetail();
			}

		}


		#region 绑定星系列表信息
		/// <summary>
		/// 绑定详细列表
		/// </summary>
		private void ShowTgtDetail()
		{
			int row = this.dgdTgt.CurrentRowIndex;

			this.dgdTgt.Select(row);

			DataTable dt=(DataTable)this.dgdTgt.Tag;
			DataRow dr=dt.Rows[row];

			
			this.TName=dr["fd_name"].ToString();			
			this.RtuSeq=Convert.ToInt32(dr["fd_rtuseq"]);
			this.Channel=Convert.ToInt32(dr["fd_channel"]);
			this.Num=Convert.ToInt32(dr["fd_num"]);
			this.Memo=dr["fd_memo"].ToString();
			this.UseFlag=dr["fd_useFlag"].ToString();
			this.Nums=Convert.ToInt32(dr["fd_nums"]);
			
		}
		#endregion

		private void tvMain_AfterSelect(object sender, System.Windows.Forms.TreeViewEventArgs e)
		{
			try
			{
				this.ShowTgtList();
			}
			catch(Exception exp)
			{
				Class_Comm.ErrMsgBox("系统运行发生错误,请和系统管理员联系!\n\n错误信息:"+exp.Message);
			}
		}

		private void btnAdd_Click(object sender, System.EventArgs e)
		{
			if (this.TName=="")
			{
				Class_Comm.MsgBox("资料输入不全,名称必须输入!");
				this.tbName.Focus();
				return;
			}		

			if (this.cbRtuSeq.Text=="")
			{
				Class_Comm.MsgBox("资料输入不全,RTU设备号必须选择输入!");
				this.cbRtuSeq.Focus();
				return;
			}	
		
			
			TreeNode tn=this.tvMain.SelectedNode;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -