protected void DrawEngeryGraph() { HammingWindow hammingWindow = new HammingWindow(Parameters.HAMMING_WINDOW_WIDE); Processor processor = new Processor(waveFile, hammingWindow); processor.Process(); GraphPane graphPane = new GraphPane(); graphPane.Clone(); graphPane.XAxis.Title.Text = "Time"; graphPane.YAxis.Title.Text = "Amplitude"; PointPairList list = ConvertEnegryToPointPairList(processor.enegryArray.ToArray()); if (list == null) { return; } LineItem curve = graphPane.AddCurve("Curve", list, Color.Red, SymbolType.None); curve.Line.Width = 2.0F; //curve.Line.Fill = new Fill(Color.White, Color.Red, 45F); zedGraphControl.MasterPane.Add(graphPane); zedGraphControl.AxisChange(); }
protected void DrawEngeryGraph() { WindowFunction hammingWindow = Utility.CreateWindow(); Processor processor = new Processor(waveFile, hammingWindow); processor.Process(); processor.EndPointDetect(); GraphPane graphPane = zedGraphControl.GraphPane; graphPane.Clone(); graphPane.Title.Text = Parameters.WINDOW_TYPE.ToString(); graphPane.XAxis.Title.Text = "Time"; graphPane.YAxis.Title.Text = "Amplitude"; PointPairList list = Utility.ConvertEnegryToPointPairList(processor.enegryArray.ToArray()); if (list == null) { return; } LineItem curve = graphPane.AddCurve("Enegry", list, Color.Red, SymbolType.None); if (processor.endPointList != null) { foreach (int end in processor.endPointList) { double x = Parameters.HAMMING_WINDOW_WIDE / 2 + end * (Parameters.HAMMING_WINDOW_WIDE - Parameters.COVERED_WIDE); PointPairList endList = new PointPairList(); endList.Add(x, 0); endList.Add(x, 500000000); LineItem line = graphPane.AddCurve("Endpoint", endList, Color.Blue, SymbolType.None); line.Line.Width = 1F; } } int activity = processor.ActivityDetect(); if (activity != -1) { PointPairList endList = new PointPairList(); double x = Parameters.HAMMING_WINDOW_WIDE / 2 + activity * (Parameters.HAMMING_WINDOW_WIDE - Parameters.COVERED_WIDE); endList.Add(x, 0); endList.Add(x, 500000000); LineItem line = graphPane.AddCurve("Activity", endList, Color.GreenYellow, SymbolType.None); line.Line.Width = 1F; } curve.Line.Width = 1F; //curve.Line.Fill = new Fill(Color.White, Color.Red, 45F); zedGraphControl.AxisChange(); }
/// <summary> /// Update status (main thread). /// </summary> public void UpdateStatus(ChromatogramLoadingStatus status) { if (!_backgroundInitialized) { _backgroundInitialized = true; BackgroundInitialize(); } // Create info for new file. var key = status.FilePath.GetFilePath(); var info = GetInfo(key); if (info == null) { info = _graphs[key] = new GraphInfo { GraphPane = _templatePane.Clone(), ActiveCurves = new List <CurveInfo>() }; info.GraphPane.Title.Text = status.FilePath.GetFileNameWithoutExtension(); } // Create curve information from the transition data. List <ChromatogramLoadingStatus.TransitionData.Peak> bin; while (status.Transitions.BinnedPeaks.TryDequeue(out bin)) { if (status.Transitions.Progressive) { ProcessBinProgressive(bin, info); } else { ProcessBinSRM(bin, info); } } if (status.Transitions.Progressive) { info.CurrentTime = status.Transitions.CurrentTime; info.MaxX = Math.Max(info.MaxX, status.Transitions.MaxRetentionTime); } else { info.CurrentTime = null; } status.Transitions.MaxIntensity = info.MaxY; }
private void DrawGraph() { GraphPane graphPane = zedGraphControl.GraphPane; graphPane.Clone(); graphPane.XAxis.Title.Text = "Time"; graphPane.YAxis.Title.Text = "Amplitude"; PointPairList list = Utility.ConvertToPointPairList(waveFile); if (list == null) { return; } LineItem curve = graphPane.AddCurve("", list, Color.Red, SymbolType.None); curve.Line.Width = 1F; zedGraphControl.AxisChange(); }