public RecordTreeNode(WfdbRecordWraper record) : base()
 {
     this.Record = record;
     this.Text   = this.Record.Name;
     foreach (WfdbSignalWraper signal in record.Signals)
     {
         SignalTreeNode s = new SignalTreeNode(signal);
         this.Nodes.Add(s);
     }
 }
示例#2
0
 public void LoadToGraph()
 {
     this.zedGraph.Enabled = false;
     foreach (TreeNode rec in this.Nodes)
     {
         if (rec is RecordTreeNode)
         {
             foreach (TreeNode sign in rec.Nodes)
             {
                 if (sign is SignalTreeNode)
                 {
                     SignalTreeNode s = (SignalTreeNode)sign;
                     if (s.Checked)
                     {
                         if (s.Curve == null)
                         {
                             s.Curve =
                                 this.zedGraph.GraphPane.AddCurve
                                     (s.Name, s.Signal.GetSamples(), Color.Black, SymbolType.None);
                         }
                         else if (!this.zedGraph.GraphPane.CurveList.Contains(s.Curve))
                         {
                             this.zedGraph.GraphPane.CurveList.Add(s.Curve);
                         }
                     }
                     else
                     {
                         if (s.Curve != null &&
                             this.zedGraph.GraphPane.CurveList.Contains(s.Curve))
                         {
                             this.zedGraph.GraphPane.CurveList.Remove(s.Curve);
                         }
                     }
                 }
             }
         }
     }
     this.zedGraph.Enabled = true;
     this.zedGraph.AxisChange();
     this.zedGraph.Refresh();
 }
        private void removeRecordToolStripMenuItem_Click(object sender, EventArgs e)
        {
            RecordTreeNode node = (this.signalsTreeView.SelectedNode as RecordTreeNode);

            if (node != null)
            {
                // MessageBox.Show(node.Record.Name);
                List <SignalTreeNode> loaded = new List <SignalTreeNode>();
                foreach (TreeNode signode in node.Nodes)
                {
                    SignalTreeNode sigNode = signode as SignalTreeNode;
                    if (sigNode != null)
                    {
                        if (this.ZedGraphControl.GraphPane.CurveList.Contains(sigNode.Curve))
                        {
                            loaded.Add(sigNode);
                        }
                    }
                }
                if (loaded.Count != 0)
                {
                    MessageBoxButtons buttons = MessageBoxButtons.YesNo;
                    string            title   = "";
                    string            message = "This signals are loaded: \n\r";
                    foreach (SignalTreeNode s in loaded)
                    {
                        message += s.Signal.SignalNumber + "\n\r";
                    }
                    message += "If you confirm, you will loose control about them from this control";
                    if (MessageBox.Show(message, title, buttons) == DialogResult.Yes)
                    {
                        node.RemoveRecord();
                    }
                }
                else
                {
                    node.RemoveRecord();
                }
            }
        }