Exemple #1
0
        /// <summary>
        /// 使用nodeID   nodeName参数刷新 listView_Properties
        /// </summary>
        /// <param name="nodeID_str"></param>
        /// <param name="nodeName"></param>
        private void Refresh_listView_Properties(string nodeID_str, string nodeName)
        {
            DataBLL dataBLL = new DataBLL();

            ModelLayer.Nodes nodeSel = null;
            int nodeID = System.Convert.ToInt32(nodeID_str);

            nodeSel          = dataBLL.getNodeInfo(nodeID);//获取node的详细信息
            nodeSel.nodeName = nodeName;
            nodeSel.nodeID   = nodeID;
            listView_AddItems(listView_Properties, nodeSel.getNodeDic());
        }
Exemple #2
0
        public ModelLayer.Nodes getNodeInfo(int nodeID)
        {
            DataTable nodeDT = currentDB.getNodeInfo(nodeID);

            ModelLayer.Nodes nodeInfo = new ModelLayer.Nodes();
            if (nodeDT.Rows.Count > 0)
            {
                nodeInfo.signalType = nodeDT.Rows[0]["signalType"].ToString();
                nodeInfo.device     = nodeDT.Rows[0]["device"].ToString();
                nodeInfo.chNO       = System.Convert.ToInt32(nodeDT.Rows[0]["chNO"].ToString());
            }
            return(nodeInfo);
        }
Exemple #3
0
 /// <summary>
 /// 双击系统树节点
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void sysTree_NodeMouseDoubleClick(object sender, TreeNodeMouseClickEventArgs e)
 {
     if (e.Node.LastNode == null)
     {
         DataBLL          dataBLL = new DataBLL();
         ModelLayer.Nodes nodeSel = null;
         int nodeID = System.Convert.ToInt32(e.Node.Name);
         nodeSel          = dataBLL.getNodeInfo(nodeID);//获取node的详细信息 device,signalType,chNO
         nodeSel.nodeName = e.Node.Text;
         nodeSel.nodeID   = nodeID;
         listView_AddItems(listView_Properties, nodeSel.getNodeDic());
         if (nodeSel.device == null || nodeSel.device == "")
         {
             //没有nodeinfo 使用自定义layoutpanel布局
             MyUserControl.MyTableLayoutPanel tlp = new MyUserControl.MyTableLayoutPanel();
             tlp.SetNodeConfigPanel(nodeID, nodeSel.nodeName);
             tlp.save.Click += new System.EventHandler(this.tpl_save_Click);
             Ctab_MainTab.PageAdd(tlp, nodeID, nodeSel.nodeName, tabPageList);
         }
         else
         {
             if (nodeSel.device.ToUpper() == "WIFI")
             {
                 //有nodeinfo  添加曲线图
                 MyUserControl.TCPWave tcpWave = new  MyUserControl.TCPWave();
                 tcpWave.Dock = DockStyle.Fill;
                 Ctab_MainTab.PageAdd(tcpWave, nodeID, nodeSel.nodeName, tabPageList);
             }
             else
             {
                 //有nodeinfo  添加曲线图
                 CANModels.ADForm.ADForm fm = new CANModels.ADForm.ADForm(nodeSel.chNO);
                 fm.FormBorderStyle = FormBorderStyle.None; // 取消窗体边框
                 fm.TopLevel        = false;                // 取消最顶层窗体
                 fm.Dock            = DockStyle.Fill;
                 Ctab_MainTab.PageAdd(fm, nodeID, nodeSel.nodeName, tabPageList);
                 fm.Show();
             }
         }
     }
 }