diff options
| author | Jacob Palecki <[email protected]> | 2020-07-24 17:40:48 -0700 |
|---|---|---|
| committer | Jacob Palecki <[email protected]> | 2020-07-24 17:40:48 -0700 |
| commit | eeb1287bb2ed3a634bf9f4ac713779dcfea229b2 (patch) | |
| tree | 0bbaef80f43937c59134e247702e4c7ba2ed773a | |
| parent | Merge branch 'master' into WrapperAndGrapher (diff) | |
| download | rawaccel-eeb1287bb2ed3a634bf9f4ac713779dcfea229b2.tar.xz rawaccel-eeb1287bb2ed3a634bf9f4ac713779dcfea229b2.zip | |
Add correct names and labels
| -rw-r--r-- | grapher/Form1.Designer.cs | 41 | ||||
| -rw-r--r-- | grapher/Form1.cs | 15 | ||||
| -rw-r--r-- | grapher/Program.cs | 2 |
3 files changed, 34 insertions, 24 deletions
diff --git a/grapher/Form1.Designer.cs b/grapher/Form1.Designer.cs index 8610ef4..b39c887 100644 --- a/grapher/Form1.Designer.cs +++ b/grapher/Form1.Designer.cs @@ -1,6 +1,6 @@ namespace grapher { - partial class Form1 + partial class RawAcceleration { /// <summary> /// Required designer variable. @@ -31,43 +31,46 @@ System.Windows.Forms.DataVisualization.Charting.ChartArea chartArea1 = new System.Windows.Forms.DataVisualization.Charting.ChartArea(); System.Windows.Forms.DataVisualization.Charting.Legend legend1 = new System.Windows.Forms.DataVisualization.Charting.Legend(); System.Windows.Forms.DataVisualization.Charting.Series series1 = new System.Windows.Forms.DataVisualization.Charting.Series(); - this.chart1 = new System.Windows.Forms.DataVisualization.Charting.Chart(); - ((System.ComponentModel.ISupportInitialize)(this.chart1)).BeginInit(); + this.AccelerationChart = new System.Windows.Forms.DataVisualization.Charting.Chart(); + ((System.ComponentModel.ISupportInitialize)(this.AccelerationChart)).BeginInit(); this.SuspendLayout(); // - // chart1 + // AccelerationChart // + chartArea1.AxisX.Title = "Speed (counts/ms)"; + chartArea1.AxisY.Title = "Sensitivity (magnitude ratio)"; chartArea1.Name = "ChartArea1"; - this.chart1.ChartAreas.Add(chartArea1); + this.AccelerationChart.ChartAreas.Add(chartArea1); legend1.Name = "Legend1"; - this.chart1.Legends.Add(legend1); - this.chart1.Location = new System.Drawing.Point(0, 0); - this.chart1.Name = "chart1"; + this.AccelerationChart.Legends.Add(legend1); + this.AccelerationChart.Location = new System.Drawing.Point(0, 0); + this.AccelerationChart.Name = "AccelerationChart"; series1.ChartArea = "ChartArea1"; series1.ChartType = System.Windows.Forms.DataVisualization.Charting.SeriesChartType.Line; series1.Legend = "Legend1"; - series1.Name = "Series1"; - this.chart1.Series.Add(series1); - this.chart1.Size = new System.Drawing.Size(800, 312); - this.chart1.TabIndex = 0; - this.chart1.Text = "chart1"; + series1.Name = "Accelerated Sensitivity"; + this.AccelerationChart.Series.Add(series1); + this.AccelerationChart.Size = new System.Drawing.Size(800, 312); + this.AccelerationChart.TabIndex = 0; + this.AccelerationChart.Text = "chart1"; // - // Form1 + // RawAcceleration // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(800, 310); - this.Controls.Add(this.chart1); - this.Name = "Form1"; - this.Text = "Form1"; - ((System.ComponentModel.ISupportInitialize)(this.chart1)).EndInit(); + this.Controls.Add(this.AccelerationChart); + this.Name = "RawAcceleration"; + this.Text = "Raw Acceleration Graph"; + this.Load += new System.EventHandler(this.Form1_Load); + ((System.ComponentModel.ISupportInitialize)(this.AccelerationChart)).EndInit(); this.ResumeLayout(false); } #endregion - private System.Windows.Forms.DataVisualization.Charting.Chart chart1; + private System.Windows.Forms.DataVisualization.Charting.Chart AccelerationChart; } } diff --git a/grapher/Form1.cs b/grapher/Form1.cs index b51ebe5..1915b01 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -10,12 +10,12 @@ using System.Windows.Forms; namespace grapher { - public partial class Form1 : Form + public partial class RawAcceleration : Form { - public Form1() + public RawAcceleration() { InitializeComponent(); - var managedAccel = new ManagedAccel(6, 0, 0.025, 1.01, 0); + var managedAccel = new ManagedAccel(6, 0, 1, 0.025, 0); var orderedPoints = new SortedDictionary<double, double>(); for (int i = 0; i < 100; i++) @@ -35,13 +35,15 @@ namespace grapher } } - var series = this.chart1.Series.FirstOrDefault(); + var series = this.AccelerationChart.Series.FirstOrDefault(); series.Points.Clear(); foreach (var point in orderedPoints) { series.Points.AddXY(point.Key, point.Value); } + + this.AccelerationChart.ChartAreas[0].AxisX.RoundAxisValues(); } public static double Magnitude(int x, int y) @@ -53,5 +55,10 @@ namespace grapher { return Math.Sqrt(x * x + y * y); } + + private void Form1_Load(object sender, EventArgs e) + { + + } } } diff --git a/grapher/Program.cs b/grapher/Program.cs index afd45ba..b36ece3 100644 --- a/grapher/Program.cs +++ b/grapher/Program.cs @@ -16,7 +16,7 @@ namespace grapher { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); - Application.Run(new Form1()); + Application.Run(new RawAcceleration()); } } } |