public void zoomOut(NPlot.Windows.PlotSurface2D plot) { double xLen = plot.XAxis1.WorldMax - plot.XAxis1.WorldMin; double newMinX = plot.XAxis1.WorldMin - xLen * 0.5; double newMaxX = plot.XAxis1.WorldMax + xLen * 0.5; if (newMinX < 0) { newMinX = 0; } if (newMaxX > this.maxValue[plot]) { newMaxX = this.maxValue[plot]; } plot.XAxis1.WorldMax = newMaxX; plot.XAxis1.WorldMin = newMinX; if (!timeScale.ContainsKey(plot)) { computeBarGraphTimeScales(); } this.SetBarGraphWidths(plot); plot.Refresh(); }
public void InitPS(NPlot.Windows.PlotSurface2D PlotSurface2D) { PlotSurface2D.AutoScaleAutoGeneratedAxes = true; PlotSurface2D.AutoScaleTitle = false; PlotSurface2D.DateTimeToolTip = true; PlotSurface2D.Legend = null; PlotSurface2D.LegendZOrder = -1; //PS.Location = new System.Drawing.Point(0, 0); PlotSurface2D.Name = "costPS"; PlotSurface2D.RightMenu = null; PlotSurface2D.Padding = 1; //滑鼠tooltips 時間+價格 PlotSurface2D.ShowCoordinates = true; PlotSurface2D.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.Default; PlotSurface2D.TabIndex = 2; PlotSurface2D.Title = "123"; PlotSurface2D.TitleFont = new System.Drawing.Font("Arial", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); PlotSurface2D.Clear(); Grid mygrid = new Grid(); mygrid.HorizontalGridType = Grid.GridType.Fine; mygrid.VerticalGridType = Grid.GridType.Fine; PlotSurface2D.Add(mygrid); }
public LineGrapher(NPlot.Windows.PlotSurface2D canvas, string y_key, string title, string x_label, string y_label) { containers = new List <VisFileContainer>(); this.y_key = y_key; this.y_label = y_label; this.x_label = x_label; this.title = title; this.canvas = canvas; canvas.Title = title; SetGraphDefaults(this.canvas, title); //F**K YOU, GRID /* * Grid grid = new Grid(); * grid.VerticalGridType = Grid.GridType.Coarse; * grid.HorizontalGridType = Grid.GridType.Coarse; * grid.MajorGridPen = new Pen(Color.LightGray, 1.0f); * * this.canvas.Add(grid); */ }
public void AddGraph(VisFileContainer v) { t.ColumnCount++; NPlot.Windows.PlotSurface2D plot = new NPlot.Windows.PlotSurface2D(); plot.Dock = DockStyle.Fill; foreach (BarPlot bp in v.barPlotTable[keyName]) { plot.Add(bp); } plot.Add(ComputeAveragePower(v)); plot.Legend = new Legend(); plot.Legend.HorizontalEdgePlacement = NPlot.Legend.Placement.Outside; plot.Legend.VerticalEdgePlacement = NPlot.Legend.Placement.Inside; plot.Legend.NumberItemsVertically = 4; plot.Legend.AttachTo(NPlot.PlotSurface2D.XAxisPosition.Bottom, NPlot.PlotSurface2D.YAxisPosition.Left); plot.Legend.YOffset = 40; plot.Title = v.deviceName + "\n" + v.configurationName; plot.Name = v.filepath; t.Controls.Add(plot, t.ColumnCount - 1, 0); t.ColumnStyles.Add(new ColumnStyle(SizeType.Percent)); RescaleBarGraphs(); }
public LapData(string fn) { player = 0; filename = fn; plot = new NPlot.Windows.PlotSurface2D();// pt; // read file data FileStream file = new FileStream(filename, FileMode.Open, FileAccess.Read); StreamReader sr = new StreamReader(file); string line = ""; players = new ArrayList(); splits = new ArrayList(); nsplits = Convert.ToInt32(sr.ReadLine()); char[] splitter = { '\t' }; while ((line = sr.ReadLine()) != null) { string[] result = line.Split(splitter); players.Add(result[0]); splits.Add(new ArrayList()); splits[splits.Count - 1] = new long[result.Length - 1]; for (int i = 1; i < result.Length; ++i) { string num = result[i]; ((long[])splits[splits.Count - 1])[i - 1] = Convert.ToInt32(num); } } file.Close(); }
public LapData(string fn) { player = 0; filename = fn; plot = new NPlot.Windows.PlotSurface2D(); // pt; // read file data FileStream file = new FileStream(filename, FileMode.Open, FileAccess.Read); StreamReader sr = new StreamReader(file); string line = ""; players = new ArrayList(); splits = new ArrayList(); nsplits = Convert.ToInt32(sr.ReadLine()); char[] splitter = { '\t' }; while ((line = sr.ReadLine()) != null) { string[] result = line.Split(splitter); players.Add(result[0]); splits.Add(new ArrayList()); splits[splits.Count - 1] = new long[result.Length - 1]; for (int i = 1; i < result.Length; ++i) { string num = result[i]; ((long[])splits[splits.Count - 1])[i - 1] = Convert.ToInt32(num); } } file.Close(); }
public static void SetGraphDefaults(NPlot.Windows.PlotSurface2D plot) { // Console.WriteLine("Setting defaults"); // plot.Add(grid); // plot.CacheAxes(); // plot.InteractionOccured += new NPlot.Windows.PlotSurface2D.InteractionHandler(Grapher.zoomRefresh); }
private static void SetGraphDefaults(NPlot.Windows.PlotSurface2D canvas, string title) { canvas.Padding = 15; canvas.ShowCoordinates = false; canvas.Dock = DockStyle.Fill; canvas.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality; canvas.Title = title; }
public void RefreshPlots(NPlot.Windows.PlotSurface2D graphSurface) { graphSurface.Clear(); if (_plots.Count == 0) { graphSurface.Hide(); return; } foreach (var plot in _plots) { var lp = new LinePlot { Color = plot.PlotColour, AbscissaData = plot.XData, OrdinateData = plot.YData, Label = plot.PlotName }; graphSurface.Add(lp); } graphSurface.Title = "Pilot Trends"; var grid = new Grid { VerticalGridType = Grid.GridType.Fine, HorizontalGridType = Grid.GridType.Fine, MajorGridPen = new Pen(Color.LightGray, 0.5f) }; graphSurface.Add(grid); graphSurface.Refresh(); var leg = new Legend { HorizontalEdgePlacement = Legend.Placement.Inside, VerticalEdgePlacement = Legend.Placement.Outside, XOffset = 10, YOffset = 10 }; leg.AttachTo(PlotSurface2D.XAxisPosition.Top, PlotSurface2D.YAxisPosition.Right); graphSurface.Legend = leg; graphSurface.LegendZOrder = 10; graphSurface.YAxis1.WorldMin = 0; graphSurface.XAxis1.Label = "Tour Number"; graphSurface.XAxis1.WorldMin -= 1; graphSurface.XAxis1.WorldMax += 1; graphSurface.Show(); graphSurface.Refresh(); }
public static void SetPowerLabels(NPlot.Windows.PlotSurface2D plot) { plot.YAxis1.LabelOffsetAbsolute = true; plot.YAxis1.LabelOffset = 40; plot.XAxis1.HideTickText = false; plot.Title = "Power Dissipation (watts)"; plot.XAxis1.Label = "Time (milliseconds)"; plot.YAxis1.Label = "Average Power (watts)"; }
//public ref TXF_MK refTXF(); public Kline(NPlot.Windows.PlotSurface2D nPS, NPlot.Windows.PlotSurface2D nPS2, int nMK, int nKLine_num) { PS = nPS; PS_volumn = nPS2; MK = nMK; KLine_num = nKLine_num; KP = new linep(this); //InitKLinePS(); KP.InitKLinePS(); }
private void DrawPointPlot(DataTable dt) { #region 1.初始化 volumePS this.volumePS = new NPlot.Windows.PlotSurface2D(); // // volumePS // this.volumePS.AutoScaleAutoGeneratedAxes = false; this.volumePS.AutoScaleTitle = false; this.volumePS.BackColor = System.Drawing.SystemColors.ControlLightLight; this.volumePS.DateTimeToolTip = false; this.volumePS.Legend = null; this.volumePS.LegendZOrder = -1; //this.volumePS.Location = new System.Drawing.Point(70, 636); this.volumePS.Dock = DockStyle.Fill; this.volumePS.Name = "volumePS"; this.volumePS.RightMenu = null; this.volumePS.ShowCoordinates = false; this.volumePS.Size = new System.Drawing.Size(1053, 139); this.volumePS.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; this.volumePS.TabIndex = 3; this.volumePS.Title = ""; this.volumePS.TitleFont = new System.Drawing.Font("Arial", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.volumePS.XAxis1 = null; this.volumePS.XAxis2 = null; this.volumePS.YAxis1 = null; this.volumePS.YAxis2 = null; #endregion /*--============================================volumePS-PointPlot========================================================--*/ #region 3.1 创建PointPlot【pp】. PointPlot pp = new PointPlot(); pp.Marker = new Marker(Marker.MarkerType.Square, 0); pp.Marker.Pen = new Pen(Color.Red, 5.0f); pp.Marker.DropLine = true; pp.DataSource = dt; pp.AbscissaData = "Date"; pp.OrdinateData = "Volume"; #endregion #region 3.2 添加pp到volumePS volumePS.Clear(); volumePS.Add(pp); volumePS.YAxis1.Label = "Volume"; volumePS.YAxis1.LabelOffsetAbsolute = true; volumePS.YAxis1.LabelOffset = 40; volumePS.AddAxesConstraint(new AxesConstraint.AxisPosition(PlotSurface2D.YAxisPosition.Left, 60)); volumePS.AddInteraction(new NPlot.Windows.PlotSurface2D.Interactions.AxisDrag(false)); volumePS.AddInteraction(new NPlot.Windows.PlotSurface2D.Interactions.HorizontalDrag()); volumePS.InteractionOccured += new NPlot.Windows.PlotSurface2D.InteractionHandler(volumePS_InteractionOccured); volumePS.PreRefresh += new NPlot.Windows.PlotSurface2D.PreRefreshHandler(volumePS_PreRefresh); #endregion }
private void AttachLegend(NPlot.Windows.PlotSurface2D surf) { Legend leg = new Legend(); leg.AttachTo(PlotSurface2D.XAxisPosition.Top, PlotSurface2D.YAxisPosition.Right); leg.HorizontalEdgePlacement = Legend.Placement.Inside; leg.VerticalEdgePlacement = Legend.Placement.Outside; leg.XOffset = 10; leg.YOffset = 10; surf.Legend = leg; surf.LegendZOrder = 10; }
private void PlotVoltageAngle_InteractionOccured(object sender) { if (!(sender is PlotSurface2D.Interactions.HorizontalDrag || sender is PlotSurface2D.Interactions.AxisDrag)) { return; } DateTime minDate, maxDate; minDate = new DateTime((long)PlotVoltageAngle.XAxis1.WorldMin); maxDate = new DateTime((long)PlotVoltageAngle.XAxis1.WorldMax); LastPlotInteraction = PlotVoltageAngle; m_framework.ChangeDateRange(minDate, maxDate); }
public LblData(string fn) //, NPlot.Windows.PlotSurface2D pt) { filename = fn; plot = new NPlot.Windows.PlotSurface2D(); // pt; // read file data FileStream file = new FileStream(filename, FileMode.Open, FileAccess.Read); StreamReader sr = new StreamReader(file); string line = ""; players = new ArrayList(); splits = new ArrayList(); nsplits = Convert.ToInt32(sr.ReadLine()); char[] splitter = { '\t' }; int playernum = 1; while ((line = sr.ReadLine()) != null) { string[] result = line.Split(splitter); players.Add(result[0]); splits.Add(new ArrayList()); /* * splits[splits.Count-1] = new long[result.Length-1]; * for (int i = 1; i < result.Length; ++i) * { * string num = result[i]; * ((long [])splits[splits.Count-1])[i-1] = Convert.ToInt32(num); * } */ splits[splits.Count - 1] = new long[result.Length]; for (int i = 0; i < result.Length; ++i) { if (i == 0) { ((long[])splits[splits.Count - 1])[i] = Convert.ToInt32(playernum++); } else { string num = result[i]; ((long[])splits[splits.Count - 1])[i] = Convert.ToInt32(num); } } } file.Close(); this.Stats(); }
private void InitializeComponent() { this.graph = new NPlot.Windows.PlotSurface2D(); this.label1 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // graph // this.graph.AutoScaleAutoGeneratedAxes = false; this.graph.AutoScaleTitle = false; this.graph.BackColor = System.Drawing.SystemColors.ControlLightLight; this.graph.DateTimeToolTip = false; this.graph.Dock = System.Windows.Forms.DockStyle.Fill; this.graph.Legend = null; this.graph.LegendZOrder = -1; this.graph.Location = new System.Drawing.Point(0, 0); this.graph.Name = "graph"; this.graph.RightMenu = null; this.graph.ShowCoordinates = true; this.graph.Size = new System.Drawing.Size(744, 400); this.graph.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; this.graph.TabIndex = 3; this.graph.Text = "plotSurface2D1"; this.graph.Title = ""; this.graph.TitleFont = new System.Drawing.Font("Arial", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.graph.XAxis1 = null; this.graph.XAxis2 = null; this.graph.YAxis1 = null; this.graph.YAxis2 = null; // // label1 // this.label1.Dock = System.Windows.Forms.DockStyle.Top; this.label1.Location = new System.Drawing.Point(0, 0); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(744, 13); this.label1.TabIndex = 4; this.label1.Text = "Loading data. Please wait..."; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; this.label1.Visible = false; // // ArchiverGraphView // this.ClientSize = new System.Drawing.Size(744, 400); this.Controls.Add(this.label1); this.Controls.Add(this.graph); this.Name = "ArchiverGraphView"; this.ResumeLayout(false); }
public void RemoveGraph(VisFileContainer v) { int removeIndex = -1; for (int i = 0; i < t.ColumnCount; i++) { Control obj = t.GetControlFromPosition(i, 0); if (obj is NPlot.Windows.PlotSurface2D) { NPlot.Windows.PlotSurface2D plot = (NPlot.Windows.PlotSurface2D)obj; if (plot.Name.Equals(v.filepath)) { t.Controls.Remove(plot); t.ColumnStyles.RemoveAt(i); removeIndex = i; break; } } } if (removeIndex == -1) { Console.WriteLine("WARNING: did not find graph to remove"); return; } if (removeIndex != t.ColumnCount - 1) { // we need to scoot the graphs down before removing the columns for (int i = removeIndex + 1; i < t.ColumnCount; i++) { Object nextObj = t.GetControlFromPosition(i, 0); NPlot.Windows.PlotSurface2D nextPlot = (NPlot.Windows.PlotSurface2D)nextObj; // p("Moving "+nextPlot.Name+" from "+(i)+" to "+(i-1)); t.Controls.Remove(nextPlot); t.Controls.Add(nextPlot, i - 1, 0); } } // then get rid of the last column and rescale everyone t.ColumnCount--; RescaleBarGraphs(); //Console.WriteLine("Moving "+plot.Title+" from "+i+1+" to "+i); return; }
private void RefreshPlot(plotType pType, bool legend, string title, string XLabel, int margin) { NPlot.Windows.PlotSurface2D surf = null; if (pType == plotType.Speed) { surf = SpeedPlot; } if (pType == plotType.Climb) { surf = ClimbPlot; } _numPlots = 0; foreach (int i in AircraftList.CheckedIndices) { DrawAircraft(pType, AircraftList.Items[i].ToString()); } if (_numPlots == 0) { return; } if (legend) { AttachLegend(surf); } surf.Title = title; surf.XAxis1.Label = XLabel; surf.YAxis1.Label = "feet"; surf.YAxis1.WorldMin = 0; surf.XAxis1.WorldMin -= margin; surf.XAxis1.WorldMax += margin; Grid grid = new Grid(); grid.VerticalGridType = Grid.GridType.Fine; grid.HorizontalGridType = Grid.GridType.Fine; grid.MajorGridPen = new Pen(Color.LightGray, 0.5f); surf.Add(grid); surf.Refresh(); }
public void SetBarGraphWidths(NPlot.Windows.PlotSurface2D canvas) { double numBars = (canvas.XAxis1.WorldLength) / (double)this.timeScale[canvas]; foreach (IDrawable drawable in canvas.Drawables) { if (drawable is BarPlot) { BarPlot bp = (BarPlot)drawable; bp.BarWidth = (float)Math.Floor(canvas.Width / (numBars)) - 4.0f; if (bp.BarWidth < 0) { bp.BarWidth = 1.0f; } } } canvas.Refresh(); }
public static void SetState(NPlot.Windows.PlotSurface2D graph, MouseState mouseState) { switch (mouseState) { case MouseState.Pan: graph.RemoveInteraction(zoomInteraction); graph.AddInteraction(panInteraction); break; case MouseState.Zoom: graph.RemoveInteraction(panInteraction); graph.AddInteraction(zoomInteraction); break; case MouseState.Pointer: graph.RemoveInteraction(zoomInteraction); graph.RemoveInteraction(panInteraction); break; } }
private void m_framework_NewQueryResults(object sender, QueryResultsEventArgs e) { if (InvokeRequired) { Invoke(new EventHandler <QueryResultsEventArgs>(m_framework_NewQueryResults), sender, e); return; } long points = 0; foreach (SignalDataBase pt in e.Results.Values) { points += pt.Count; } LblPointCount.Text = "Point Count: " + points.ToString(); PlotChart(e, PlotFrequency, m_frequencySignals, ReferenceEquals(PlotFrequency, LastPlotInteraction)); PlotChart(e, PlotVoltageAngle, m_voltageAngleSignals, ReferenceEquals(PlotVoltageAngle, LastPlotInteraction)); LastPlotInteraction = null; }
// set's all the Y axes of the bar plots displayed to be the same -- for comparison reasons public void SetCommonYAxis() { double min = double.MaxValue, max = 0.0; foreach (Object obj in t.Controls) { if (obj is NPlot.Windows.PlotSurface2D) { NPlot.Windows.PlotSurface2D plot = (NPlot.Windows.PlotSurface2D)obj; max = Math.Max(plot.YAxis1.WorldMax, max); min = Math.Min(plot.YAxis1.WorldMin, min); } } foreach (Object obj in t.Controls) { if (obj is NPlot.Windows.PlotSurface2D) { NPlot.Windows.PlotSurface2D plot = (NPlot.Windows.PlotSurface2D)obj; plot.YAxis1.WorldMax = max; plot.YAxis1.WorldMin = min; } } }
public LineGrapher(NPlot.Windows.PlotSurface2D canvas, string y_key, string title, string x_label, string y_label) { containers = new List<VisFileContainer>(); this.y_key = y_key; this.y_label = y_label; this.x_label = x_label; this.title = title; this.canvas = canvas; canvas.Title = title; SetGraphDefaults(this.canvas, title); //F**K YOU, GRID /* Grid grid = new Grid(); grid.VerticalGridType = Grid.GridType.Coarse; grid.HorizontalGridType = Grid.GridType.Coarse; grid.MajorGridPen = new Pen(Color.LightGray, 1.0f); this.canvas.Add(grid); */ }
private void PlotChart(QueryResultsEventArgs e, PlotSurface2D plot, List<KeyValuePair<int, Guid>> signals, bool cacheAxis) { if (cacheAxis) { double minX, maxX, minY, maxY; plot.Title = m_plotTitle; maxX = plot.XAxis1.WorldMax; minX = plot.XAxis1.WorldMin; maxY = plot.YAxis1.WorldMax; minY = plot.YAxis1.WorldMin; foreach (IDrawable drawing in plot.Drawables.ToArray()) plot.Remove(drawing, false); foreach (KeyValuePair<int, Guid> freq in signals) { SignalDataBase data = e.Results[freq.Value]; List<double> y = new List<double>(data.Count); List<double> x = new List<double>(data.Count); for (int i = 0; i < data.Count; i++) { ulong time; double value; data.GetData(i, out time, out value); x.Add(time); y.Add(value * m_scalingFactor); } LinePlot lines = new LinePlot(y, x); lines.Pen = m_colorWheel.TryGetPen(freq.Key); plot.Add(lines); } plot.XAxis1.WorldMax = maxX; plot.XAxis1.WorldMin = minX; plot.YAxis1.WorldMax = maxY; plot.YAxis1.WorldMin = minY; plot.Refresh(); } else { plot.Clear(); plot.Title = m_plotTitle; AddInteractions(); foreach (KeyValuePair<int, Guid> freq in signals) { SignalDataBase data = e.Results[freq.Value]; List<double> y = new List<double>(data.Count); List<double> x = new List<double>(data.Count); for (int i = 0; i < data.Count; i++) { ulong time; double value; data.GetData(i, out time, out value); x.Add(time); y.Add(value * m_scalingFactor); } LinePlot lines = new LinePlot(y, x); lines.Pen = m_colorWheel.TryGetPen(freq.Key); plot.Add(lines); } if (plot.XAxis1 != null) { plot.XAxis1.WorldMax = e.EndTime.Ticks; plot.XAxis1.WorldMin = e.StartTime.Ticks; } plot.Refresh(); } }
private void DrawCandlePlot(DataTable dt) { #region 1.初始化costPS this.costPS = new NPlot.Windows.PlotSurface2D(); this.costPS.AutoScaleAutoGeneratedAxes = false; this.costPS.AutoScaleTitle = false; this.costPS.BackColor = System.Drawing.SystemColors.ControlLightLight; this.costPS.DateTimeToolTip = false; this.costPS.Legend = null; this.costPS.LegendZOrder = -1; //this.costPS.Location = new System.Drawing.Point(70, 52); this.costPS.Dock = DockStyle.Fill; this.costPS.Size = new System.Drawing.Size(1053, 557); this.costPS.Name = "costPS"; this.costPS.RightMenu = null; this.costPS.ShowCoordinates = false; this.costPS.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; this.costPS.TabIndex = 2; this.costPS.Title = ""; this.costPS.TitleFont = new System.Drawing.Font("Arial", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.costPS.XAxis1 = null; this.costPS.XAxis2 = null; this.costPS.YAxis1 = null; this.costPS.YAxis2 = null; #endregion /*--===========================================costPS-CandlePlot=========================================================--*/ #region 2.1 创建 CandlePlot【cp】. CandlePlot cp = new CandlePlot(); cp.DataSource = dt; cp.AbscissaData = "Date"; cp.OpenData = "Open"; cp.LowData = "Low"; cp.HighData = "High"; cp.CloseData = "Close"; cp.BearishColor = Color.White; //方框颜色 cp.BullishColor = Color.Green; //方框颜色 cp.Style = CandlePlot.Styles.Filled; #endregion #region 2.2 添加cp到costPS costPS.Clear(); costPS.DateTimeToolTip = true; costPS.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias; costPS.Add(new Grid()); costPS.Add(cp); // costPS.Title = "AU:JBH";//标题 // costPS.YAxis1.Label = "Price [$]"; //左侧标题 costPS.YAxis1.LabelOffset = 40; costPS.YAxis1.LabelOffsetAbsolute = true; costPS.XAxis1.HideTickText = true; costPS.YAxis1.HideTickText = true;//是否隐藏垂直刻度线标尺 costPS.AddInteraction(new NPlot.Windows.PlotSurface2D.Interactions.HorizontalDrag()); costPS.AddInteraction(new NPlot.Windows.PlotSurface2D.Interactions.VerticalDrag()); costPS.AddInteraction(new NPlot.Windows.PlotSurface2D.Interactions.AxisDrag(false)); costPS.InteractionOccured += new NPlot.Windows.PlotSurface2D.InteractionHandler(costPS_InteractionOccured); costPS.AddAxesConstraint(new AxesConstraint.AxisPosition(PlotSurface2D.YAxisPosition.Left, 60)); this.costPS.RightMenu = new ReducedContextMenu(); #endregion }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.panelGraph = new System.Windows.Forms.Panel(); this.panelPlotContainer = new System.Windows.Forms.Panel(); this.plotSurface = new NPlot.Windows.PlotSurface2D(); this.panelSummaryLabels = new System.Windows.Forms.Panel(); this.lbCurPowerAvail = new System.Windows.Forms.Label(); this.lbCurPowerUsage = new System.Windows.Forms.Label(); this.label7 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.label1 = new System.Windows.Forms.Label(); this.lbRunningApps = new System.Windows.Forms.Label(); this.lbRunningJobs = new System.Windows.Forms.Label(); this.lbNumExec = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.lbTotalPowerUsage = new System.Windows.Forms.Label(); this.lbMaxPowerAvail = new System.Windows.Forms.Label(); this.tmRefreshSystem = new System.Windows.Forms.Timer(this.components); this.panelGraph.SuspendLayout(); this.panelPlotContainer.SuspendLayout(); this.panelSummaryLabels.SuspendLayout(); this.SuspendLayout(); // // panelGraph // this.panelGraph.AutoScroll = true; this.panelGraph.BackColor = System.Drawing.SystemColors.ControlLightLight; this.panelGraph.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.panelGraph.Controls.Add(this.panelPlotContainer); this.panelGraph.Controls.Add(this.panelSummaryLabels); this.panelGraph.Dock = System.Windows.Forms.DockStyle.Fill; this.panelGraph.Location = new System.Drawing.Point(0, 0); this.panelGraph.Name = "panelGraph"; this.panelGraph.Size = new System.Drawing.Size(864, 581); this.panelGraph.TabIndex = 5; // // panelPlotContainer // this.panelPlotContainer.Controls.Add(this.plotSurface); this.panelPlotContainer.Dock = System.Windows.Forms.DockStyle.Fill; this.panelPlotContainer.Location = new System.Drawing.Point(0, 96); this.panelPlotContainer.Name = "panelPlotContainer"; this.panelPlotContainer.Size = new System.Drawing.Size(860, 481); this.panelPlotContainer.TabIndex = 2; // // plotSurface // this.plotSurface.AutoScaleAutoGeneratedAxes = false; this.plotSurface.AutoScaleTitle = false; this.plotSurface.BackColor = System.Drawing.SystemColors.ControlLightLight; this.plotSurface.Cursor = System.Windows.Forms.Cursors.Cross; this.plotSurface.DateTimeToolTip = false; this.plotSurface.Dock = System.Windows.Forms.DockStyle.Fill; this.plotSurface.Legend = null; this.plotSurface.LegendZOrder = -1; this.plotSurface.Location = new System.Drawing.Point(0, 0); this.plotSurface.Name = "plotSurface"; this.plotSurface.Padding = 10; this.plotSurface.RightMenu = null; this.plotSurface.ShowCoordinates = true; this.plotSurface.Size = new System.Drawing.Size(860, 481); this.plotSurface.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; this.plotSurface.TabIndex = 0; this.plotSurface.Title = ""; this.plotSurface.TitleFont = new System.Drawing.Font("Arial", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.plotSurface.XAxis1 = null; this.plotSurface.XAxis2 = null; this.plotSurface.YAxis1 = null; this.plotSurface.YAxis2 = null; // // panelSummaryLabels // this.panelSummaryLabels.AutoScroll = true; this.panelSummaryLabels.AutoScrollMargin = new System.Drawing.Size(5, 5); this.panelSummaryLabels.AutoScrollMinSize = new System.Drawing.Size(300, 50); this.panelSummaryLabels.BackColor = System.Drawing.SystemColors.Highlight; this.panelSummaryLabels.Controls.Add(this.lbCurPowerAvail); this.panelSummaryLabels.Controls.Add(this.lbCurPowerUsage); this.panelSummaryLabels.Controls.Add(this.label7); this.panelSummaryLabels.Controls.Add(this.label6); this.panelSummaryLabels.Controls.Add(this.label5); this.panelSummaryLabels.Controls.Add(this.label1); this.panelSummaryLabels.Controls.Add(this.lbRunningApps); this.panelSummaryLabels.Controls.Add(this.lbRunningJobs); this.panelSummaryLabels.Controls.Add(this.lbNumExec); this.panelSummaryLabels.Controls.Add(this.label4); this.panelSummaryLabels.Controls.Add(this.label3); this.panelSummaryLabels.Controls.Add(this.label2); this.panelSummaryLabels.Controls.Add(this.lbTotalPowerUsage); this.panelSummaryLabels.Controls.Add(this.lbMaxPowerAvail); this.panelSummaryLabels.Dock = System.Windows.Forms.DockStyle.Top; this.panelSummaryLabels.Location = new System.Drawing.Point(0, 0); this.panelSummaryLabels.Name = "panelSummaryLabels"; this.panelSummaryLabels.Size = new System.Drawing.Size(860, 96); this.panelSummaryLabels.TabIndex = 1; // // lbCurPowerAvail // this.lbCurPowerAvail.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.lbCurPowerAvail.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; this.lbCurPowerAvail.Location = new System.Drawing.Point(696, 8); this.lbCurPowerAvail.Name = "lbCurPowerAvail"; this.lbCurPowerAvail.Size = new System.Drawing.Size(152, 23); this.lbCurPowerAvail.TabIndex = 13; this.lbCurPowerAvail.Text = "-"; this.lbCurPowerAvail.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // lbCurPowerUsage // this.lbCurPowerUsage.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.lbCurPowerUsage.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; this.lbCurPowerUsage.Location = new System.Drawing.Point(696, 33); this.lbCurPowerUsage.Name = "lbCurPowerUsage"; this.lbCurPowerUsage.Size = new System.Drawing.Size(152, 23); this.lbCurPowerUsage.TabIndex = 12; this.lbCurPowerUsage.Text = "-"; this.lbCurPowerUsage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label7 // this.label7.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; this.label7.Location = new System.Drawing.Point(568, 33); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(128, 23); this.label7.TabIndex = 11; this.label7.Text = "Current Power Usage"; this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label6 // this.label6.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; this.label6.Location = new System.Drawing.Point(568, 8); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(128, 23); this.label6.TabIndex = 10; this.label6.Text = "Current Power Available"; this.label6.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label5 // this.label5.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; this.label5.Location = new System.Drawing.Point(288, 33); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(120, 23); this.label5.TabIndex = 9; this.label5.Text = "Total Power Usage"; this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label1 // this.label1.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; this.label1.Location = new System.Drawing.Point(288, 8); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(120, 23); this.label1.TabIndex = 8; this.label1.Text = "Max. Power Available"; this.label1.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // lbRunningApps // this.lbRunningApps.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.lbRunningApps.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; this.lbRunningApps.Location = new System.Drawing.Point(160, 33); this.lbRunningApps.Name = "lbRunningApps"; this.lbRunningApps.Size = new System.Drawing.Size(112, 23); this.lbRunningApps.TabIndex = 7; this.lbRunningApps.Text = "-"; this.lbRunningApps.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // lbRunningJobs // this.lbRunningJobs.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.lbRunningJobs.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; this.lbRunningJobs.Location = new System.Drawing.Point(160, 56); this.lbRunningJobs.Name = "lbRunningJobs"; this.lbRunningJobs.Size = new System.Drawing.Size(112, 23); this.lbRunningJobs.TabIndex = 6; this.lbRunningJobs.Text = "-"; this.lbRunningJobs.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // lbNumExec // this.lbNumExec.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.lbNumExec.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; this.lbNumExec.Location = new System.Drawing.Point(160, 8); this.lbNumExec.Name = "lbNumExec"; this.lbNumExec.Size = new System.Drawing.Size(112, 23); this.lbNumExec.TabIndex = 5; this.lbNumExec.Text = "-"; this.lbNumExec.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label4 // this.label4.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; this.label4.Location = new System.Drawing.Point(8, 56); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(152, 23); this.label4.TabIndex = 4; this.label4.Text = "No. of running Threads/Jobs"; this.label4.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label3 // this.label3.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; this.label3.Location = new System.Drawing.Point(8, 8); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(106, 23); this.label3.TabIndex = 3; this.label3.Text = "No. of Executors"; this.label3.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // label2 // this.label2.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; this.label2.Location = new System.Drawing.Point(8, 33); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(144, 23); this.label2.TabIndex = 2; this.label2.Text = "No. of running Applications"; this.label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // lbTotalPowerUsage // this.lbTotalPowerUsage.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.lbTotalPowerUsage.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; this.lbTotalPowerUsage.Location = new System.Drawing.Point(408, 33); this.lbTotalPowerUsage.Name = "lbTotalPowerUsage"; this.lbTotalPowerUsage.Size = new System.Drawing.Size(152, 23); this.lbTotalPowerUsage.TabIndex = 1; this.lbTotalPowerUsage.Text = "-"; this.lbTotalPowerUsage.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // lbMaxPowerAvail // this.lbMaxPowerAvail.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0))); this.lbMaxPowerAvail.ForeColor = System.Drawing.SystemColors.ActiveCaptionText; this.lbMaxPowerAvail.Location = new System.Drawing.Point(408, 8); this.lbMaxPowerAvail.Name = "lbMaxPowerAvail"; this.lbMaxPowerAvail.Size = new System.Drawing.Size(152, 23); this.lbMaxPowerAvail.TabIndex = 0; this.lbMaxPowerAvail.Text = "-"; this.lbMaxPowerAvail.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // tmRefreshSystem // this.tmRefreshSystem.Interval = 2000; this.tmRefreshSystem.Tick += new System.EventHandler(this.tmRefreshSystem_Tick); // // SysPerfForm // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(864, 581); this.Controls.Add(this.panelGraph); this.Name = "SysPerfForm"; this.Text = "System Performance Monitor"; this.panelGraph.ResumeLayout(false); this.panelPlotContainer.ResumeLayout(false); this.panelSummaryLabels.ResumeLayout(false); this.ResumeLayout(false); }
/// <summary> /// Update (replot) the graphs /// </summary> public void PlotGraphs() { if (surface == null) { surface = new NPlot.Windows.PlotSurface2D(); tabPageGraphs.Controls.Add(surface); surface.Dock = DockStyle.Fill; surface2 = new NPlot.Windows.PlotSurface2D(); surface2.Height = 150; tabPageGraphs.Controls.Add(surface2); surface2.Dock = DockStyle.Bottom; } surface.Clear(); //Add a background grid for better chart readability. Grid grid = new Grid(); grid.VerticalGridType = Grid.GridType.Coarse; grid.HorizontalGridType = Grid.GridType.Coarse; grid.MajorGridPen = new Pen(Color.LightGray, 1.0f); surface.Add(grid); LinePlot lp1 = new LinePlot(); lp1.DataSource = controller.Stats.EvaluationItterations.History; lp1.Color = Color.Black; lp1.Label = "Itterations"; surface.Add(lp1); LinePlot lp2 = new LinePlot(); lp2.DataSource = controller.Stats.Nodes.History; lp2.Pen = new Pen(Color.Green, 2.0f); lp2.Label = "Nodes"; surface.Add(lp2); LinePlot lp3 = new LinePlot(); lp3.DataSource = controller.Stats.Duplicates.History; lp3.Pen = new Pen(Color.Orange, 1.0f); lp3.Label = "Duplicates"; surface.Add(lp3); LinePlot lp4 = new LinePlot(); lp4.DataSource = controller.Stats.DeadNodes.History; lp4.Pen = new Pen(Color.Red, 1.5f); lp4.Label = "Dead"; surface.Add(lp4); LinePlot lp6 = new LinePlot(); lp6.DataSource = controller.Stats.AvgEvalList.History; lp6.Pen = new Pen(Color.Brown, 1.3f); lp6.Label = "Eval List"; surface.Add(lp6); LinePlot lp7 = new LinePlot(); lp7.DataSource = controller.Stats.NodesFwd.History; lp7.Pen = new Pen(Color.Brown, 1.0f); lp7.Pen.DashStyle = DashStyle.Dash; lp7.Label = "Nodes Fwd"; surface.Add(lp7); LinePlot lp8 = new LinePlot(); lp8.DataSource = controller.Stats.NodesRev.History; lp8.Pen = new Pen(Color.Cyan, 1.0f); lp8.Pen.DashStyle = DashStyle.Dash; lp8.Label = "Nodes Rev"; surface.Add(lp8); surface.XAxis1.Label = "Elapsed Time (sec)"; surface.YAxis1.Label = "Total"; surface.Legend = new Legend(); surface.SmoothingMode = SmoothingMode.HighQuality; surface.Title = "Solver | Node Information"; surface.Refresh(); surface2.Clear(); StepPlot lp5 = new StepPlot(); lp5.Pen = new Pen(Color.Fuchsia, 2f); lp5.DataSource = controller.Stats.NodesPerSecond.History; lp5.Label = "Nodes/s"; surface2.Add(lp5); surface2.XAxis1.Label = "Elapsed Time (sec)"; surface2.YAxis1.Label = "Rate (node/sec)"; surface2.Legend = new Legend(); surface2.SmoothingMode = SmoothingMode.HighQuality; surface2.Refresh(); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SimplePlot)); this.plotSurface2D1 = new NPlot.Windows.PlotSurface2D(); this.toolStrip1 = new System.Windows.Forms.ToolStrip(); this.toolStripButtonClear = new System.Windows.Forms.ToolStripButton(); this.toolStripButtonLock = new System.Windows.Forms.ToolStripButton(); this.toolStripButtonLoop = new System.Windows.Forms.ToolStripButton(); this.toolStripButton1 = new System.Windows.Forms.ToolStripButton(); this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.toolStripDropDownChannel = new System.Windows.Forms.ToolStripDropDownButton(); this.timer1 = new System.Windows.Forms.Timer(this.components); this.toolStrip1.SuspendLayout(); this.SuspendLayout(); // // plotSurface2D1 // this.plotSurface2D1.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.plotSurface2D1.AutoScaleAutoGeneratedAxes = false; this.plotSurface2D1.AutoScaleTitle = false; this.plotSurface2D1.BackColor = System.Drawing.SystemColors.ControlLightLight; this.plotSurface2D1.DateTimeToolTip = false; this.plotSurface2D1.Legend = null; this.plotSurface2D1.LegendZOrder = -1; this.plotSurface2D1.Location = new System.Drawing.Point(0, 28); this.plotSurface2D1.Name = "plotSurface2D1"; this.plotSurface2D1.RightMenu = null; this.plotSurface2D1.ShowCoordinates = true; this.plotSurface2D1.Size = new System.Drawing.Size(746, 384); this.plotSurface2D1.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; this.plotSurface2D1.TabIndex = 0; this.plotSurface2D1.Title = ""; this.plotSurface2D1.TitleFont = new System.Drawing.Font("Arial", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.plotSurface2D1.XAxis1 = null; this.plotSurface2D1.XAxis2 = null; this.plotSurface2D1.YAxis1 = null; this.plotSurface2D1.YAxis2 = null; // // toolStrip1 // this.toolStrip1.ImageScalingSize = new System.Drawing.Size(24, 24); this.toolStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.toolStripButtonClear, this.toolStripButtonLock, this.toolStripButtonLoop, this.toolStripButton1, this.toolStripSeparator1, this.toolStripDropDownChannel}); this.toolStrip1.Location = new System.Drawing.Point(0, 0); this.toolStrip1.Name = "toolStrip1"; this.toolStrip1.Size = new System.Drawing.Size(746, 31); this.toolStrip1.TabIndex = 1; // // toolStripButtonClear // this.toolStripButtonClear.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.toolStripButtonClear.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonClear.Image"))); this.toolStripButtonClear.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButtonClear.Name = "toolStripButtonClear"; this.toolStripButtonClear.Size = new System.Drawing.Size(28, 28); this.toolStripButtonClear.Text = "清空"; this.toolStripButtonClear.Click += new System.EventHandler(this.toolStripButtonClear_Click); // // toolStripButtonLock // this.toolStripButtonLock.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.toolStripButtonLock.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonLock.Image"))); this.toolStripButtonLock.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButtonLock.Name = "toolStripButtonLock"; this.toolStripButtonLock.Size = new System.Drawing.Size(28, 28); this.toolStripButtonLock.Text = "图像锁定"; this.toolStripButtonLock.Click += new System.EventHandler(this.toolStripButtonLock_Click); // // toolStripButtonLoop // this.toolStripButtonLoop.Checked = true; this.toolStripButtonLoop.CheckState = System.Windows.Forms.CheckState.Checked; this.toolStripButtonLoop.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.toolStripButtonLoop.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButtonLoop.Image"))); this.toolStripButtonLoop.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButtonLoop.Name = "toolStripButtonLoop"; this.toolStripButtonLoop.Size = new System.Drawing.Size(28, 28); this.toolStripButtonLoop.Text = "循环模式"; this.toolStripButtonLoop.Click += new System.EventHandler(this.toolStripButtonLoop_Click); // // toolStripButton1 // this.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.toolStripButton1.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton1.Image"))); this.toolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButton1.Name = "toolStripButton1"; this.toolStripButton1.Size = new System.Drawing.Size(28, 28); this.toolStripButton1.Text = "图像大小自适应"; this.toolStripButton1.Click += new System.EventHandler(this.toolStripButton1_Click); // // toolStripSeparator1 // this.toolStripSeparator1.Name = "toolStripSeparator1"; this.toolStripSeparator1.Size = new System.Drawing.Size(6, 31); // // toolStripDropDownChannel // this.toolStripDropDownChannel.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; this.toolStripDropDownChannel.Image = ((System.Drawing.Image)(resources.GetObject("toolStripDropDownChannel.Image"))); this.toolStripDropDownChannel.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripDropDownChannel.Name = "toolStripDropDownChannel"; this.toolStripDropDownChannel.Size = new System.Drawing.Size(37, 28); this.toolStripDropDownChannel.Text = "通道选择"; // // timer1 // this.timer1.Enabled = true; this.timer1.Tick += new System.EventHandler(this.timer1_Tick); // // SimplePlot // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(746, 412); this.Controls.Add(this.toolStrip1); this.Controls.Add(this.plotSurface2D1); this.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); this.ID = "PlotObj"; this.Name = "SimplePlot"; this.Text = "简单图表"; this.toolStrip1.ResumeLayout(false); this.toolStrip1.PerformLayout(); this.ResumeLayout(false); this.PerformLayout(); }
public List <string> DealInfo(string nMatTime, string nBid, string nAsk, string nMatPri, NPlot.Windows.PlotSurface2D PS) { List <string> deal = new List <string>(); int i; //order -> deal for (i = 0; i < OrdList.Count; i++) { if (OrdList[i].BS.Equals("B") && OrdList[i].Price.Equals("M") || OrdList[i].BS.Equals("B") && int.Parse(nAsk) <= int.Parse(OrdList[i].Price)) { MatList.Add(new match(nMatTime, OrdList[i].FutNo, OrdList[i].BS, OrdList[i].Qty, nAsk, "")); deal.Add(nAsk + ",B," + OrdList[i].Price); DeleteNotMat(OrdList, OrdList[i].BS, OrdList[i].Price, PS); //OrdList.Remove(OrdList[i]); } else if (OrdList[i].BS.Equals("S") && OrdList[i].Price.Equals("M") || OrdList[i].BS.Equals("S") && int.Parse(nBid) >= int.Parse(OrdList[i].Price)) { MatList.Add(new match(nMatTime, OrdList[i].FutNo, OrdList[i].BS, OrdList[i].Qty, nBid, "")); deal.Add(nBid + ",S," + OrdList[i].Price); DeleteNotMat(OrdList, OrdList[i].BS, OrdList[i].Price, PS); //OrdList.Remove(OrdList[i]); } } return(deal); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.quitButton = new System.Windows.Forms.Button(); this.nextPlotButton = new System.Windows.Forms.Button(); this.printButton = new System.Windows.Forms.Button(); this.exampleNumberLabel = new System.Windows.Forms.Label(); this.prevPlotButton = new System.Windows.Forms.Button(); this.qeExampleTimer = new System.Windows.Forms.Timer(this.components); this.infoBox = new System.Windows.Forms.TextBox(); this.plotSurface = new NPlot.Windows.PlotSurface2D(); this.SuspendLayout(); // // quitButton // this.quitButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.quitButton.Location = new System.Drawing.Point(248, 386); this.quitButton.Name = "quitButton"; this.quitButton.TabIndex = 14; this.quitButton.Text = "Close"; this.quitButton.Click += new System.EventHandler(this.quitButton_Click); // // nextPlotButton // this.nextPlotButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.nextPlotButton.Location = new System.Drawing.Point(88, 386); this.nextPlotButton.Name = "nextPlotButton"; this.nextPlotButton.TabIndex = 17; this.nextPlotButton.Text = "Next"; this.nextPlotButton.Click += new System.EventHandler(this.nextPlotButton_Click); // // printButton // this.printButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.printButton.Location = new System.Drawing.Point(166, 386); this.printButton.Name = "printButton"; this.printButton.TabIndex = 9; this.printButton.Text = "Print"; this.printButton.Click += new System.EventHandler(this.printButton_Click); // // exampleNumberLabel // this.exampleNumberLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.exampleNumberLabel.Location = new System.Drawing.Point(336, 390); this.exampleNumberLabel.Name = "exampleNumberLabel"; this.exampleNumberLabel.Size = new System.Drawing.Size(72, 23); this.exampleNumberLabel.TabIndex = 16; // // prevPlotButton // this.prevPlotButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.prevPlotButton.Location = new System.Drawing.Point(8, 386); this.prevPlotButton.Name = "prevPlotButton"; this.prevPlotButton.TabIndex = 15; this.prevPlotButton.Text = "Prev"; this.prevPlotButton.Click += new System.EventHandler(this.prevPlotButton_Click); // // qeExampleTimer // this.qeExampleTimer.Interval = 500; this.qeExampleTimer.Tick += new System.EventHandler(this.qeExampleTimer_Tick); // // infoBox // this.infoBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); this.infoBox.AutoSize = false; this.infoBox.Location = new System.Drawing.Point(13, 416); this.infoBox.Multiline = true; this.infoBox.Name = "infoBox"; this.infoBox.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; this.infoBox.Size = new System.Drawing.Size(611, 92); this.infoBox.TabIndex = 18; // // plotSurface // this.plotSurface.AutoScaleAutoGeneratedAxes = false; this.plotSurface.AutoScaleTitle = false; this.plotSurface.BackColor = System.Drawing.SystemColors.Control; this.plotSurface.Legend = null; this.plotSurface.Location = new System.Drawing.Point(8, 8); this.plotSurface.Name = "plotSurface"; this.plotSurface.RightMenu = null; this.plotSurface.ShowCoordinates = false; this.plotSurface.Size = new System.Drawing.Size(616, 360); this.plotSurface.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; this.plotSurface.TabIndex = 13; this.plotSurface.Title = ""; this.plotSurface.TitleFont = new System.Drawing.Font("Arial", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.plotSurface.XAxis1 = null; this.plotSurface.XAxis2 = null; this.plotSurface.YAxis1 = null; this.plotSurface.YAxis2 = null; // // PlotSurface2DDemo // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(631, 520); this.Controls.Add(this.infoBox); this.Controls.Add(this.plotSurface); this.Controls.Add(this.quitButton); this.Controls.Add(this.printButton); this.Controls.Add(this.prevPlotButton); this.Controls.Add(this.exampleNumberLabel); this.Controls.Add(this.nextPlotButton); this.Name = "PlotSurface2DDemo"; this.Text = "NPlot C# Demo"; this.ResumeLayout(false); }
private void PlotChart(QueryResultsEventArgs e, PlotSurface2D plot, List <KeyValuePair <int, Guid> > signals, bool cacheAxis) { if (cacheAxis) { double minX, maxX, minY, maxY; plot.Title = m_plotTitle; maxX = plot.XAxis1.WorldMax; minX = plot.XAxis1.WorldMin; maxY = plot.YAxis1.WorldMax; minY = plot.YAxis1.WorldMin; foreach (IDrawable drawing in plot.Drawables.ToArray()) { plot.Remove(drawing, false); } foreach (KeyValuePair <int, Guid> freq in signals) { SignalDataBase data = e.Results[freq.Value]; List <double> y = new List <double>(data.Count); List <double> x = new List <double>(data.Count); for (int i = 0; i < data.Count; i++) { ulong time; double value; data.GetData(i, out time, out value); x.Add(time); y.Add(value * m_scalingFactor); } LinePlot lines = new LinePlot(y, x); lines.Pen = m_colorWheel.TryGetPen(freq.Key); plot.Add(lines); } plot.XAxis1.WorldMax = maxX; plot.XAxis1.WorldMin = minX; plot.YAxis1.WorldMax = maxY; plot.YAxis1.WorldMin = minY; plot.Refresh(); } else { plot.Clear(); plot.Title = m_plotTitle; AddInteractions(); foreach (KeyValuePair <int, Guid> freq in signals) { SignalDataBase data = e.Results[freq.Value]; List <double> y = new List <double>(data.Count); List <double> x = new List <double>(data.Count); for (int i = 0; i < data.Count; i++) { ulong time; double value; data.GetData(i, out time, out value); x.Add(time); y.Add(value * m_scalingFactor); } LinePlot lines = new LinePlot(y, x); lines.Pen = m_colorWheel.TryGetPen(freq.Key); plot.Add(lines); } if (plot.XAxis1 != null) { plot.XAxis1.WorldMax = e.EndTime.Ticks; plot.XAxis1.WorldMin = e.StartTime.Ticks; } plot.Refresh(); } }
private void BtnGo_Click(object sender, EventArgs e) { LastPlotInteraction = null; m_framework.ChangeDateRange(new DateTime(2012, 8, 2), new DateTime(2012, 8, 2, 1, 0, 0)); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); this.quitButton = new System.Windows.Forms.Button(); this.qeExampleTimer = new System.Windows.Forms.Timer(this.components); this.plotSurface = new NPlot.Windows.PlotSurface2D(); this.groupBox1 = new System.Windows.Forms.GroupBox(); this.nudMediumAlfa_Max = new System.Windows.Forms.NumericUpDown(); this.nudOutMediumAlfa_Min = new System.Windows.Forms.NumericUpDown(); this.label3 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.button1 = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.groupBox1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudMediumAlfa_Max)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.nudOutMediumAlfa_Min)).BeginInit(); this.SuspendLayout(); // // quitButton // this.quitButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.quitButton.Location = new System.Drawing.Point(530, 432); this.quitButton.Name = "quitButton"; this.quitButton.Size = new System.Drawing.Size(92, 35); this.quitButton.TabIndex = 14; this.quitButton.Text = "Закрыть"; this.quitButton.Click += new System.EventHandler(this.quitButton_Click); // // qeExampleTimer // this.qeExampleTimer.Interval = 500; this.qeExampleTimer.Tick += new System.EventHandler(this.qeExampleTimer_Tick); // // plotSurface // this.plotSurface.AutoScaleAutoGeneratedAxes = false; this.plotSurface.AutoScaleTitle = false; this.plotSurface.BackColor = System.Drawing.SystemColors.Control; this.plotSurface.DateTimeToolTip = false; this.plotSurface.Legend = null; this.plotSurface.LegendZOrder = -1; this.plotSurface.Location = new System.Drawing.Point(8, 8); this.plotSurface.Name = "plotSurface"; this.plotSurface.RightMenu = null; this.plotSurface.ShowCoordinates = false; this.plotSurface.Size = new System.Drawing.Size(616, 376); this.plotSurface.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; this.plotSurface.TabIndex = 13; this.plotSurface.Title = ""; this.plotSurface.TitleFont = new System.Drawing.Font("Arial", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.plotSurface.XAxis1 = null; this.plotSurface.XAxis2 = null; this.plotSurface.YAxis1 = null; this.plotSurface.YAxis2 = null; // // groupBox1 // this.groupBox1.Controls.Add(this.nudMediumAlfa_Max); this.groupBox1.Controls.Add(this.nudOutMediumAlfa_Min); this.groupBox1.Controls.Add(this.label3); this.groupBox1.Controls.Add(this.label2); this.groupBox1.Controls.Add(this.button1); this.groupBox1.Controls.Add(this.label1); this.groupBox1.Location = new System.Drawing.Point(8, 390); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(421, 92); this.groupBox1.TabIndex = 18; this.groupBox1.TabStop = false; this.groupBox1.Text = "Влияние параметров"; this.groupBox1.Enter += new System.EventHandler(this.groupBox1_Enter); // // nudMediumAlfa_Max // this.nudMediumAlfa_Max.Location = new System.Drawing.Point(157, 52); this.nudMediumAlfa_Max.Maximum = new decimal(new int[] { 20, 0, 0, 0 }); this.nudMediumAlfa_Max.Minimum = new decimal(new int[] { 10, 0, 0, 0 }); this.nudMediumAlfa_Max.Name = "nudMediumAlfa_Max"; this.nudMediumAlfa_Max.Size = new System.Drawing.Size(56, 20); this.nudMediumAlfa_Max.TabIndex = 1; this.nudMediumAlfa_Max.Value = new decimal(new int[] { 10, 0, 0, 0 }); this.nudMediumAlfa_Max.ValueChanged += new System.EventHandler(this.nudMediumAlfa_Max_ValueChanged); // // nudOutMediumAlfa_Min // this.nudOutMediumAlfa_Min.Location = new System.Drawing.Point(70, 52); this.nudOutMediumAlfa_Min.Maximum = new decimal(new int[] { 10, 0, 0, 0 }); this.nudOutMediumAlfa_Min.Minimum = new decimal(new int[] { 1, 0, 0, 0 }); this.nudOutMediumAlfa_Min.Name = "nudOutMediumAlfa_Min"; this.nudOutMediumAlfa_Min.Size = new System.Drawing.Size(56, 20); this.nudOutMediumAlfa_Min.TabIndex = 1; this.nudOutMediumAlfa_Min.Value = new decimal(new int[] { 1, 0, 0, 0 }); this.nudOutMediumAlfa_Min.ValueChanged += new System.EventHandler(this.nudOutMediumAlfa_Min_ValueChanged); // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(132, 54); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(19, 13); this.label3.TabIndex = 0; this.label3.Text = "до"; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(46, 54); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(18, 13); this.label2.TabIndex = 0; this.label2.Text = "от"; // // button1 // this.button1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.button1.Location = new System.Drawing.Point(287, 43); this.button1.Name = "button1"; this.button1.Size = new System.Drawing.Size(101, 35); this.button1.TabIndex = 15; this.button1.Text = "Построить"; this.button1.Click += new System.EventHandler(this.prevPlotButton_Click); // // label1 // this.label1.AutoSize = true; this.label1.Location = new System.Drawing.Point(22, 28); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(147, 13); this.label1.TabIndex = 0; this.label1.Text = "Первое слагаемое, ед.изм."; this.label1.Click += new System.EventHandler(this.label1_Click); // // PlotSurface2DDemo // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(634, 495); this.Controls.Add(this.groupBox1); this.Controls.Add(this.plotSurface); this.Controls.Add(this.quitButton); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; this.MaximizeBox = false; this.MinimizeBox = false; this.MinimumSize = new System.Drawing.Size(640, 517); this.Name = "PlotSurface2DDemo"; this.Text = "График"; this.groupBox1.ResumeLayout(false); this.groupBox1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.nudMediumAlfa_Max)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.nudOutMediumAlfa_Min)).EndInit(); this.ResumeLayout(false); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.components = new System.ComponentModel.Container(); System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(ExecutorProperties)); this.txId = new System.Windows.Forms.TextBox(); this.label9 = new System.Windows.Forms.Label(); this.txUsername = new System.Windows.Forms.TextBox(); this.label3 = new System.Windows.Forms.Label(); this.chkDedicated = new System.Windows.Forms.CheckBox(); this.chkConnected = new System.Windows.Forms.CheckBox(); this.txPort = new System.Windows.Forms.TextBox(); this.label2 = new System.Windows.Forms.Label(); this.label10 = new System.Windows.Forms.Label(); this.txPingTime = new System.Windows.Forms.TextBox(); this.tabAdvanced = new System.Windows.Forms.TabPage(); this.label12 = new System.Windows.Forms.Label(); this.label11 = new System.Windows.Forms.Label(); this.label6 = new System.Windows.Forms.Label(); this.txOS = new System.Windows.Forms.TextBox(); this.txArch = new System.Windows.Forms.TextBox(); this.txMaxCPU = new System.Windows.Forms.TextBox(); this.txNumCPUs = new System.Windows.Forms.TextBox(); this.label8 = new System.Windows.Forms.Label(); this.txMaxDisk = new System.Windows.Forms.TextBox(); this.label7 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.label5 = new System.Windows.Forms.Label(); this.tabPerf = new System.Windows.Forms.TabPage(); this.panel1 = new System.Windows.Forms.Panel(); this.plotSurface = new NPlot.Windows.PlotSurface2D(); this.tmRefreshSystem = new System.Windows.Forms.Timer(this.components); this.tabs.SuspendLayout(); this.tabGeneral.SuspendLayout(); this.tabAdvanced.SuspendLayout(); this.tabPerf.SuspendLayout(); this.panel1.SuspendLayout(); this.SuspendLayout(); // // tabs // this.tabs.Controls.Add(this.tabAdvanced); this.tabs.Controls.Add(this.tabPerf); this.tabs.Name = "tabs"; this.tabs.Controls.SetChildIndex(this.tabPerf, 0); this.tabs.Controls.SetChildIndex(this.tabAdvanced, 0); this.tabs.Controls.SetChildIndex(this.tabGeneral, 0); // // tabGeneral // this.tabGeneral.Controls.Add(this.label10); this.tabGeneral.Controls.Add(this.txPingTime); this.tabGeneral.Controls.Add(this.chkDedicated); this.tabGeneral.Controls.Add(this.chkConnected); this.tabGeneral.Controls.Add(this.txPort); this.tabGeneral.Controls.Add(this.label2); this.tabGeneral.Controls.Add(this.txId); this.tabGeneral.Controls.Add(this.label9); this.tabGeneral.Controls.Add(this.txUsername); this.tabGeneral.Controls.Add(this.label3); this.tabGeneral.Name = "tabGeneral"; this.tabGeneral.Controls.SetChildIndex(this.iconBox, 0); this.tabGeneral.Controls.SetChildIndex(this.lbName, 0); this.tabGeneral.Controls.SetChildIndex(this.lineLabel, 0); this.tabGeneral.Controls.SetChildIndex(this.label3, 0); this.tabGeneral.Controls.SetChildIndex(this.txUsername, 0); this.tabGeneral.Controls.SetChildIndex(this.label9, 0); this.tabGeneral.Controls.SetChildIndex(this.txId, 0); this.tabGeneral.Controls.SetChildIndex(this.label2, 0); this.tabGeneral.Controls.SetChildIndex(this.txPort, 0); this.tabGeneral.Controls.SetChildIndex(this.chkConnected, 0); this.tabGeneral.Controls.SetChildIndex(this.chkDedicated, 0); this.tabGeneral.Controls.SetChildIndex(this.txPingTime, 0); this.tabGeneral.Controls.SetChildIndex(this.label10, 0); // // btnApply // this.btnApply.Name = "btnApply"; // // btnCancel // this.btnCancel.Name = "btnCancel"; // // btnOK // this.btnOK.Name = "btnOK"; this.btnOK.Click += new System.EventHandler(this.btnOK_Click); // // iconBox // this.iconBox.Image = ((System.Drawing.Image)(resources.GetObject("iconBox.Image"))); this.iconBox.Name = "iconBox"; // // lbName // this.lbName.Name = "lbName"; // // lineLabel // this.lineLabel.Name = "lineLabel"; // // imgListSmall // this.imgListSmall.ImageStream = ((System.Windows.Forms.ImageListStreamer)(resources.GetObject("imgListSmall.ImageStream"))); // // txId // this.txId.BackColor = System.Drawing.Color.White; this.txId.Location = new System.Drawing.Point(96, 80); this.txId.Name = "txId"; this.txId.ReadOnly = true; this.txId.Size = new System.Drawing.Size(216, 20); this.txId.TabIndex = 26; this.txId.Text = "txId"; // // label9 // this.label9.AutoSize = true; this.label9.Location = new System.Drawing.Point(16, 82); this.label9.Name = "label9"; this.label9.Size = new System.Drawing.Size(17, 16); this.label9.TabIndex = 25; this.label9.Text = "Id:"; // // txUsername // this.txUsername.BackColor = System.Drawing.Color.White; this.txUsername.Location = new System.Drawing.Point(96, 144); this.txUsername.Name = "txUsername"; this.txUsername.ReadOnly = true; this.txUsername.Size = new System.Drawing.Size(144, 20); this.txUsername.TabIndex = 24; this.txUsername.Text = "txUsername"; // // label3 // this.label3.AutoSize = true; this.label3.Location = new System.Drawing.Point(16, 144); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(60, 16); this.label3.TabIndex = 23; this.label3.Text = "Username:"******"chkDedicated"; this.chkDedicated.Size = new System.Drawing.Size(80, 24); this.chkDedicated.TabIndex = 30; this.chkDedicated.Text = "Dedicated"; // // chkConnected // this.chkConnected.AutoCheck = false; this.chkConnected.Location = new System.Drawing.Point(16, 208); this.chkConnected.Name = "chkConnected"; this.chkConnected.Size = new System.Drawing.Size(80, 24); this.chkConnected.TabIndex = 29; this.chkConnected.Text = "Connected"; // // txPort // this.txPort.BackColor = System.Drawing.Color.White; this.txPort.Location = new System.Drawing.Point(96, 112); this.txPort.Name = "txPort"; this.txPort.ReadOnly = true; this.txPort.Size = new System.Drawing.Size(48, 20); this.txPort.TabIndex = 28; this.txPort.Text = "txPort"; // // label2 // this.label2.AutoSize = true; this.label2.Location = new System.Drawing.Point(16, 112); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(28, 16); this.label2.TabIndex = 27; this.label2.Text = "Port:"; // // label10 // this.label10.AutoSize = true; this.label10.Location = new System.Drawing.Point(16, 176); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(78, 16); this.label10.TabIndex = 32; this.label10.Text = "Last ping time:"; // // txPingTime // this.txPingTime.BackColor = System.Drawing.Color.White; this.txPingTime.Location = new System.Drawing.Point(96, 176); this.txPingTime.Name = "txPingTime"; this.txPingTime.ReadOnly = true; this.txPingTime.Size = new System.Drawing.Size(144, 20); this.txPingTime.TabIndex = 31; this.txPingTime.Text = "txPingTime"; // // tabAdvanced // this.tabAdvanced.Controls.Add(this.label12); this.tabAdvanced.Controls.Add(this.label11); this.tabAdvanced.Controls.Add(this.label6); this.tabAdvanced.Controls.Add(this.txOS); this.tabAdvanced.Controls.Add(this.txArch); this.tabAdvanced.Controls.Add(this.txMaxCPU); this.tabAdvanced.Controls.Add(this.txNumCPUs); this.tabAdvanced.Controls.Add(this.label8); this.tabAdvanced.Controls.Add(this.txMaxDisk); this.tabAdvanced.Controls.Add(this.label7); this.tabAdvanced.Controls.Add(this.label4); this.tabAdvanced.Controls.Add(this.label5); this.tabAdvanced.Location = new System.Drawing.Point(4, 22); this.tabAdvanced.Name = "tabAdvanced"; this.tabAdvanced.Size = new System.Drawing.Size(328, 318); this.tabAdvanced.TabIndex = 1; this.tabAdvanced.Text = "Advanced"; // // label12 // this.label12.AutoSize = true; this.label12.Location = new System.Drawing.Point(248, 114); this.label12.Name = "label12"; this.label12.Size = new System.Drawing.Size(24, 16); this.label12.TabIndex = 35; this.label12.Text = "MB."; // // label11 // this.label11.AutoSize = true; this.label11.Location = new System.Drawing.Point(248, 82); this.label11.Name = "label11"; this.label11.Size = new System.Drawing.Size(29, 16); this.label11.TabIndex = 34; this.label11.Text = "Mhz."; // // label6 // this.label6.AutoSize = true; this.label6.Location = new System.Drawing.Point(16, 80); this.label6.Name = "label6"; this.label6.Size = new System.Drawing.Size(59, 16); this.label6.TabIndex = 29; this.label6.Text = "Max. CPU:"; // // txOS // this.txOS.BackColor = System.Drawing.Color.White; this.txOS.Location = new System.Drawing.Point(112, 48); this.txOS.Name = "txOS"; this.txOS.ReadOnly = true; this.txOS.Size = new System.Drawing.Size(200, 20); this.txOS.TabIndex = 26; this.txOS.Text = "txOS"; // // txArch // this.txArch.BackColor = System.Drawing.Color.White; this.txArch.Location = new System.Drawing.Point(112, 16); this.txArch.Name = "txArch"; this.txArch.ReadOnly = true; this.txArch.Size = new System.Drawing.Size(200, 20); this.txArch.TabIndex = 24; this.txArch.Text = "txArch"; // // txMaxCPU // this.txMaxCPU.BackColor = System.Drawing.Color.White; this.txMaxCPU.Location = new System.Drawing.Point(112, 80); this.txMaxCPU.Name = "txMaxCPU"; this.txMaxCPU.ReadOnly = true; this.txMaxCPU.Size = new System.Drawing.Size(128, 20); this.txMaxCPU.TabIndex = 28; this.txMaxCPU.Text = "txMaxCPU"; // // txNumCPUs // this.txNumCPUs.BackColor = System.Drawing.Color.White; this.txNumCPUs.Location = new System.Drawing.Point(112, 144); this.txNumCPUs.Name = "txNumCPUs"; this.txNumCPUs.ReadOnly = true; this.txNumCPUs.Size = new System.Drawing.Size(40, 20); this.txNumCPUs.TabIndex = 32; this.txNumCPUs.Text = "txNumCPUs"; // // label8 // this.label8.AutoSize = true; this.label8.Location = new System.Drawing.Point(16, 144); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(59, 16); this.label8.TabIndex = 33; this.label8.Text = "# of CPUs:"; // // txMaxDisk // this.txMaxDisk.BackColor = System.Drawing.Color.White; this.txMaxDisk.Location = new System.Drawing.Point(112, 112); this.txMaxDisk.Name = "txMaxDisk"; this.txMaxDisk.ReadOnly = true; this.txMaxDisk.Size = new System.Drawing.Size(128, 20); this.txMaxDisk.TabIndex = 30; this.txMaxDisk.Text = "txMaxDisk"; // // label7 // this.label7.AutoSize = true; this.label7.Location = new System.Drawing.Point(16, 112); this.label7.Name = "label7"; this.label7.Size = new System.Drawing.Size(75, 16); this.label7.TabIndex = 31; this.label7.Text = "Max. Storage:"; // // label4 // this.label4.AutoSize = true; this.label4.Location = new System.Drawing.Point(16, 16); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(68, 16); this.label4.TabIndex = 25; this.label4.Text = "Architecture:"; // // label5 // this.label5.AutoSize = true; this.label5.Location = new System.Drawing.Point(16, 48); this.label5.Name = "label5"; this.label5.Size = new System.Drawing.Size(98, 16); this.label5.TabIndex = 27; this.label5.Text = "Operating System:"; // // tabPerf // this.tabPerf.Controls.Add(this.panel1); this.tabPerf.Location = new System.Drawing.Point(4, 22); this.tabPerf.Name = "tabPerf"; this.tabPerf.Size = new System.Drawing.Size(328, 318); this.tabPerf.TabIndex = 2; this.tabPerf.Text = "Performance"; // // panel1 // this.panel1.BackColor = System.Drawing.SystemColors.Control; this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D; this.panel1.Controls.Add(this.plotSurface); this.panel1.Location = new System.Drawing.Point(8, 8); this.panel1.Name = "panel1"; this.panel1.Size = new System.Drawing.Size(312, 304); this.panel1.TabIndex = 28; // // plotSurface // this.plotSurface.Anchor = System.Windows.Forms.AnchorStyles.None; this.plotSurface.AutoScaleAutoGeneratedAxes = true; this.plotSurface.AutoScaleTitle = true; this.plotSurface.BackColor = System.Drawing.SystemColors.ControlLightLight; this.plotSurface.DateTimeToolTip = false; this.plotSurface.Legend = null; this.plotSurface.LegendZOrder = -1; this.plotSurface.Location = new System.Drawing.Point(2, 2); this.plotSurface.Name = "plotSurface"; this.plotSurface.Padding = 0; this.plotSurface.RightMenu = null; this.plotSurface.ShowCoordinates = true; this.plotSurface.Size = new System.Drawing.Size(304, 296); this.plotSurface.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; this.plotSurface.TabIndex = 24; this.plotSurface.Text = "plotSurface2D1"; this.plotSurface.Title = ""; this.plotSurface.TitleFont = new System.Drawing.Font("Arial", 7F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.plotSurface.XAxis1 = null; this.plotSurface.XAxis2 = null; this.plotSurface.YAxis1 = null; this.plotSurface.YAxis2 = null; // // tmRefreshSystem // this.tmRefreshSystem.Interval = 2000; this.tmRefreshSystem.Tick += new System.EventHandler(this.tmRefreshSystem_Tick); // // ExecutorProperties // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(352, 389); this.Name = "ExecutorProperties"; this.Text = "Executor Properties"; this.tabs.ResumeLayout(false); this.tabGeneral.ResumeLayout(false); this.tabAdvanced.ResumeLayout(false); this.tabPerf.ResumeLayout(false); this.panel1.ResumeLayout(false); this.ResumeLayout(false); }
private void PlotChart(QueryResultsEventArgs e, PlotSurface2D plot, List <Guid> signals, bool cacheAxis) { if (cacheAxis) { maxX = plot.XAxis1.WorldMax; minX = plot.XAxis1.WorldMin; maxY = plot.YAxis1.WorldMax; minY = plot.YAxis1.WorldMin; foreach (IDrawable drawing in plot.Drawables.ToArray()) { plot.Remove(drawing, false); } ColorWheel.Reset(); foreach (Guid freq in signals) { SignalDataBase data = e.Results[freq]; List <double> y = new List <double>(data.Count); List <double> x = new List <double>(data.Count); for (int i = 0; i < data.Count; i++) { data.GetData(i, out ulong time, out double value); x.Add(time); y.Add(value); } LinePlot lines = new LinePlot(y, x); lines.Pen = ColorWheel.GetPen(); plot.Add(lines); } plot.XAxis1.WorldMax = maxX; plot.XAxis1.WorldMin = minX; plot.YAxis1.WorldMax = maxY; plot.YAxis1.WorldMin = minY; plot.Refresh(); } else { plot.Clear(); plot.AddInteraction(new PlotSurface2D.Interactions.HorizontalDrag()); plot.AddInteraction(new PlotSurface2D.Interactions.VerticalDrag()); plot.AddInteraction(new PlotSurface2D.Interactions.AxisDrag(false)); ColorWheel.Reset(); foreach (Guid freq in signals) { SignalDataBase data = e.Results[freq]; List <double> y = new List <double>(data.Count); List <double> x = new List <double>(data.Count); for (int i = 0; i < data.Count; i++) { data.GetData(i, out ulong time, out double value); x.Add(time); y.Add(value); } LinePlot lines = new LinePlot(y, x); lines.Pen = ColorWheel.GetPen(); plot.Add(lines); } plot.Refresh(); } }
public void AddGraph(VisFileContainer v) { t.ColumnCount++; NPlot.Windows.PlotSurface2D plot = new NPlot.Windows.PlotSurface2D(); plot.Dock = DockStyle.Fill; foreach (BarPlot bp in v.barPlotTable[keyName]) { plot.Add(bp); } plot.Add(ComputeAveragePower(v)); plot.Legend = new Legend(); plot.Legend.HorizontalEdgePlacement = NPlot.Legend.Placement.Outside; plot.Legend.VerticalEdgePlacement = NPlot.Legend.Placement.Inside; plot.Legend.NumberItemsVertically = 4; plot.Legend.AttachTo(NPlot.PlotSurface2D.XAxisPosition.Bottom,NPlot.PlotSurface2D.YAxisPosition.Left); plot.Legend.YOffset = 40; plot.Title = v.deviceName+"\n"+v.configurationName; plot.Name = v.filepath; t.Controls.Add(plot,t.ColumnCount-1,0); t.ColumnStyles.Add(new ColumnStyle(SizeType.Percent)); RescaleBarGraphs(); }
public List <string> MITToOrder(string nMatTime, string nBid, string nAsk, string nMatPri, NPlot.Windows.PlotSurface2D PS) { List <string> Order = new List <string>(); //MIT -> order int i; for (i = 0; i < MITList.Count; i++) { if (int.Parse(nMatPri) >= int.Parse(MITList[i].Price) && MITList[i].MITLabel.Equals(">=") || int.Parse(nMatPri) <= int.Parse(MITList[i].Price) && MITList[i].MITLabel.Equals("<=")) { OrdList.Add(new match(nMatTime, MITList[i].FutNo, MITList[i].BS, MITList[i].Qty, "M", "")); Order.Add(nMatPri + "," + MITList[i].BS + "," + MITList[i].Price); DeleteNotMat(MITList, MITList[i].BS, MITList[i].Price, PS); //MITList.Remove(MITList[i]); i--; } } return(Order); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.closeButton = new System.Windows.Forms.Button(); this.volumePS = new NPlot.Windows.PlotSurface2D(); this.costPS = new NPlot.Windows.PlotSurface2D(); this.SuspendLayout(); // // closeButton // this.closeButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.closeButton.Location = new System.Drawing.Point(8, 421); this.closeButton.Name = "closeButton"; this.closeButton.TabIndex = 1; this.closeButton.Text = "Close"; this.closeButton.Click += new System.EventHandler(this.closeButton_Click); // // volumePS // this.volumePS.AutoScaleAutoGeneratedAxes = false; this.volumePS.AutoScaleTitle = false; this.volumePS.BackColor = System.Drawing.SystemColors.ControlLightLight; this.volumePS.Legend = null; this.volumePS.Location = new System.Drawing.Point(13, 305); this.volumePS.Name = "volumePS"; this.volumePS.RightMenu = null; this.volumePS.ShowCoordinates = false; this.volumePS.Size = new System.Drawing.Size(606, 109); this.volumePS.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; this.volumePS.TabIndex = 3; this.volumePS.Title = ""; this.volumePS.TitleFont = new System.Drawing.Font("Arial", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.volumePS.XAxis1 = null; this.volumePS.XAxis2 = null; this.volumePS.YAxis1 = null; this.volumePS.YAxis2 = null; // // costPS // this.costPS.AutoScaleAutoGeneratedAxes = false; this.costPS.AutoScaleTitle = false; this.costPS.BackColor = System.Drawing.SystemColors.ControlLightLight; this.costPS.Legend = null; this.costPS.Location = new System.Drawing.Point(13, 13); this.costPS.Name = "costPS"; this.costPS.RightMenu = null; this.costPS.ShowCoordinates = false; this.costPS.Size = new System.Drawing.Size(606, 285); this.costPS.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.None; this.costPS.TabIndex = 2; this.costPS.Title = ""; this.costPS.TitleFont = new System.Drawing.Font("Arial", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Pixel); this.costPS.XAxis1 = null; this.costPS.XAxis2 = null; this.costPS.YAxis1 = null; this.costPS.YAxis2 = null; // // FinancialDemo // this.AutoScaleBaseSize = new System.Drawing.Size(5, 13); this.ClientSize = new System.Drawing.Size(631, 450); this.Controls.Add(this.volumePS); this.Controls.Add(this.costPS); this.Controls.Add(this.closeButton); this.Name = "FinancialDemo"; this.Text = "BasicDemo"; this.ResumeLayout(false); }