예제 #1
0
 void InitInstanceObj()
 {
     try
     {
         _CM  = new ChannelManage();
         _COR = new CompOfRecords();
         _CRQ = new CaptureRecordQuery();
         _TM  = new TemplateManager();
     }
     catch (Exception ex)
     {
         MyMessage.Show(string.Format("请联系技术人员处理该问题:\n{0}", ex));
     }
 }
예제 #2
0
 void InitInstanceObj()
 {
     try
     {
         //moduleChannel = new ChannelModule.MainView();
         moduleChannel = new ChannelManage();
         moduleCompare = new CompOfRecords();
         moduleSnap    = new CaptureRecordQuery();
     }
     catch (Exception ex)
     {
         MyMessage.Show(string.Format("请联系技术人员处理该问题:\n{0}", ex));
     }
 }
        private void ComChannel_Click(object sender, EventArgs e)
        {
            foreach (TreeNode nod in treeExplore.SelectedNode.Nodes)
            {
                if (nod.Text == "串口通道")
                {
                    MessageBox.Show("该通道已经建立!");
                    return;
                }
            }
            string   name = "串口通道";
            TreeNode tn   = new TreeNode(name);

            treeExplore.SelectedNode.Nodes.Add(tn);
            treeExplore.ExpandAll();
            ChannelManage ch = new ChannelManage();

            ChannelList.Add(ch);
            ch.ChannelName = name;
        }
예제 #4
0
        private void opendriver(string name)
        {
            string s = myProjectPath + name + ".dev";

            try
            {
                using (FileStream fs = new FileStream(s, FileMode.Open))
                {
                    if (fs != null)
                    {
                        BinaryFormatter BinaryRead = new BinaryFormatter();
                        ChannelManage   ch         = (ChannelManage)BinaryRead.Deserialize(fs);
                        ChannelList.Add(ch);
                        fs.Close();
                    }
                }
            }
            catch (System.Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }