/// <summary> /// Updates PageReads in the Chart /// </summary> private void UpdatePageReadChart(Int64 PageReads) { try { if (this.statusStrip1.InvokeRequired) { SetInt64Callback d = new SetInt64Callback(UpdatePageReadChart); this.Invoke(d, new object[] { PageReads }); } else { PageReads = (PageReads == 0) ? 1 : PageReads; this.chtPageReads.Series["PageReads"].Points.Clear(); this.chtPageReads.Series["PageReads"].Points.Add(new DataPoint(0, PageReads)); this.chtPageReads.Update(); } } catch (Exception ex) { ShowThreadExceptionDialog("UpdatePageReadChart", ex); } }
/// <summary> /// Updates Latches in the Chart /// </summary> private void UpdateLatchChart(Int64 Latches) { try { if (this.statusStrip1.InvokeRequired) { SetInt64Callback d = new SetInt64Callback(UpdateLatchChart); this.Invoke(d, new object[] { Latches }); } else { Latches = (Latches == 0) ? 1 : Latches; this.chtLatches.Series["Latches"].Points.Clear(); this.chtLatches.Series["Latches"].Points.Add(new DataPoint(0, Latches)); this.chtLatches.Update(); } } catch (Exception ex) { ShowThreadExceptionDialog("UpdateLatchChart", ex); } }
/// <summary> /// Updates the TPS bar in the chart, and causes the whole chart to be re-drawn with the new data. /// </summary> private void UpdateTPSChart(Int64 TPS) { try { if (this.statusStrip1.InvokeRequired) { SetInt64Callback d = new SetInt64Callback(UpdateTPSChart); this.Invoke(d, new object[] { TPS }); } else { // Updating Speedometer if (TPS >= 0) { //double normalizedTPS = (double)TPS; //uiControls.speedDial.CurrentValue = normalizedTPS; //uiControls.speedDial.DialText = normalizedTPS.ToString("#.##"); // Updating TPS chart TPSChartTime++; // X Axis Overflow if (TPSChartTime > this.chtTPS.ChartAreas[0].AxisX.Maximum) { this.chtTPS.ChartAreas[0].AxisX.Maximum += 100; } this.chtTPS.Series[0].Points.Add(new System.Windows.Forms.DataVisualization.Charting.DataPoint(TPSChartTime, TPS)); } else { this.chtTPS.Series[0].Points.Clear(); TPSChartTime = 0; } this.chtTPS.Update(); } } catch (Exception ex) { ShowThreadExceptionDialog("UpdateTPSChart", ex); } }
/// <summary> /// Updates the TPS bar in the chart, and causes the whole chart to be re-drawn with the new data. /// </summary> private void UpdateTPSChart(Int64 TPS) { try { if (this.statusStrip1.InvokeRequired) { SetInt64Callback d = new SetInt64Callback(UpdateTPSChart); this.Invoke(d, new object[] { TPS }); } else { // Updating Speedometer if (TPS >= 0) { double normalizedTPS = (double)TPS / 1000; uiControls.speedDial.CurrentValue = normalizedTPS; uiControls.speedDial.DialText = normalizedTPS.ToString("#.##"); // Updating TPS chart TPSChartTime++; // X Axis Overflow if (TPSChartTime > this.chtTPS.ChartAreas[0].AxisX.Maximum) { this.chtTPS.ChartAreas[0].AxisX.Maximum += 100; } this.chtTPS.Series[0].Points.Add(new System.Windows.Forms.DataVisualization.Charting.DataPoint(TPSChartTime, TPS)); } else { this.chtTPS.Series[0].Points.Clear(); TPSChartTime = 0; } this.chtTPS.Update(); } } catch (Exception ex) { ShowThreadExceptionDialog("UpdateTPSChart", ex); } }