From a6a9f6785eb416ac48d34bb320265c812efc600b Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Wed, 12 Aug 2020 19:04:23 -0700 Subject: Add ability to have x\y graphs --- grapher/Form1.cs | 65 +++----------------------------------------------------- 1 file changed, 3 insertions(+), 62 deletions(-) (limited to 'grapher/Form1.cs') diff --git a/grapher/Form1.cs b/grapher/Form1.cs index 518ffc3..da9bd5f 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -126,9 +126,9 @@ namespace grapher this, new AccelCharts( this, - AccelerationChart, - VelocityChart, - GainChart, + new ChartXY(AccelerationChart, AccelerationChartY), + new ChartXY(VelocityChart, VelocityChartY), + new ChartXY(GainChart, GainChartY), showVelocityGainToolStripMenuItem), managedAcceleration, accelerationOptions, @@ -141,65 +141,6 @@ namespace grapher limitOrExponent, midpoint, writeButton); - - this.AccelerationChart.ChartAreas[0].AxisX.RoundAxisValues(); - - this.AccelerationChart.ChartAreas[0].AxisX.ScaleView.Zoomable = true; - this.AccelerationChart.ChartAreas[0].AxisY.ScaleView.Zoomable = true; - - this.AccelerationChart.ChartAreas[0].AxisY.ScaleView.MinSize = 0.01; - this.AccelerationChart.ChartAreas[0].AxisY.ScaleView.SmallScrollSize = 0.001; - - this.AccelerationChart.ChartAreas[0].CursorY.Interval = 0.001; - - this.AccelerationChart.ChartAreas[0].CursorX.AutoScroll = true; - this.AccelerationChart.ChartAreas[0].CursorY.AutoScroll = true; - - this.AccelerationChart.ChartAreas[0].CursorX.IsUserSelectionEnabled = true; - this.AccelerationChart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true; - - this.AccelerationChart.ChartAreas[0].CursorX.IsUserEnabled = true; - this.AccelerationChart.ChartAreas[0].CursorY.IsUserEnabled = true; - - - this.VelocityChart.ChartAreas[0].AxisX.RoundAxisValues(); - - this.VelocityChart.ChartAreas[0].AxisX.ScaleView.Zoomable = true; - this.VelocityChart.ChartAreas[0].AxisY.ScaleView.Zoomable = true; - - this.VelocityChart.ChartAreas[0].AxisY.ScaleView.MinSize = 0.01; - this.VelocityChart.ChartAreas[0].AxisY.ScaleView.SmallScrollSize = 0.001; - - this.VelocityChart.ChartAreas[0].CursorY.Interval = 0.001; - - this.VelocityChart.ChartAreas[0].CursorX.AutoScroll = true; - this.VelocityChart.ChartAreas[0].CursorY.AutoScroll = true; - - this.VelocityChart.ChartAreas[0].CursorX.IsUserSelectionEnabled = true; - this.VelocityChart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true; - - this.VelocityChart.ChartAreas[0].CursorX.IsUserEnabled = true; - this.VelocityChart.ChartAreas[0].CursorY.IsUserEnabled = true; - - - this.GainChart.ChartAreas[0].AxisX.RoundAxisValues(); - - this.GainChart.ChartAreas[0].AxisX.ScaleView.Zoomable = true; - this.GainChart.ChartAreas[0].AxisY.ScaleView.Zoomable = true; - - this.GainChart.ChartAreas[0].AxisY.ScaleView.MinSize = 0.01; - this.GainChart.ChartAreas[0].AxisY.ScaleView.SmallScrollSize = 0.001; - - this.GainChart.ChartAreas[0].CursorY.Interval = 0.001; - - this.GainChart.ChartAreas[0].CursorX.AutoScroll = true; - this.GainChart.ChartAreas[0].CursorY.AutoScroll = true; - - this.GainChart.ChartAreas[0].CursorX.IsUserSelectionEnabled = true; - this.GainChart.ChartAreas[0].CursorY.IsUserSelectionEnabled = true; - - this.GainChart.ChartAreas[0].CursorX.IsUserEnabled = true; - this.GainChart.ChartAreas[0].CursorY.IsUserEnabled = true; } #endregion Constructor -- cgit v1.2.3 From 30e1391b224ae028f4476e06a07415a0285ac6c9 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Wed, 12 Aug 2020 20:39:53 -0700 Subject: Almost working --- grapher/Form1.cs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'grapher/Form1.cs') diff --git a/grapher/Form1.cs b/grapher/Form1.cs index da9bd5f..a90cfbc 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -89,10 +89,19 @@ namespace grapher Marshal.FreeHGlobal(args_ptr); - var sensitivity = new OptionXY(sensitivityBoxX, sensitivityBoxY, sensXYLock, this, 1, sensitivityLabel, "Sensitivity"); + var accelCharts = new AccelCharts( + this, + new ChartXY(AccelerationChart, AccelerationChartY), + new ChartXY(VelocityChart, VelocityChartY), + new ChartXY(GainChart, GainChartY), + showVelocityGainToolStripMenuItem, + new CheckBox[] { sensXYLock, weightXYLock, capXYLock }); + + + var sensitivity = new OptionXY(sensitivityBoxX, sensitivityBoxY, sensXYLock, this, 1, sensitivityLabel, "Sensitivity", accelCharts); var rotation = new Option(rotationBox, this, 0, rotationLabel, "Rotation"); - var weight = new OptionXY(weightBoxFirst, weightBoxSecond, weightXYLock, this, 1, weightLabel, "Weight"); - var cap = new OptionXY(capBoxX, capBoxY, capXYLock, this, 0, capLabel, "Cap"); + var weight = new OptionXY(weightBoxFirst, weightBoxSecond, weightXYLock, this, 1, weightLabel, "Weight", accelCharts); + var cap = new OptionXY(capBoxX, capBoxY, capXYLock, this, 0, capLabel, "Cap", accelCharts); var offset = new Option(offsetBox, this, 0, offsetLabel, "Offset"); // The name and layout of these options is handled by AccelerationOptions object. @@ -124,12 +133,7 @@ namespace grapher AccelGUI = new AccelGUI( this, - new AccelCharts( - this, - new ChartXY(AccelerationChart, AccelerationChartY), - new ChartXY(VelocityChart, VelocityChartY), - new ChartXY(GainChart, GainChartY), - showVelocityGainToolStripMenuItem), + accelCharts, managedAcceleration, accelerationOptions, sensitivity, -- cgit v1.2.3 From 93a22c08b3223b040c3a3644fc3c4ef82fc576f0 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Thu, 13 Aug 2020 01:52:49 -0700 Subject: Dot to show mouse move --- grapher/Form1.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'grapher/Form1.cs') diff --git a/grapher/Form1.cs b/grapher/Form1.cs index a90cfbc..3df1b67 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -144,7 +144,8 @@ namespace grapher acceleration, limitOrExponent, midpoint, - writeButton); + writeButton, + MouseLabel); } #endregion Constructor @@ -157,6 +158,16 @@ namespace grapher #region Methods + protected override void WndProc(ref Message m) + { + if (m.Msg == 0x00ff) + { + AccelGUI.MouseWatcher.ReadMouseMove(m); + } + + base.WndProc(ref m); + } + private void Form1_Load(object sender, EventArgs e) { -- cgit v1.2.3 From 6602649bd7f9a9849b25fe55a5e5e8a617f40b70 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Thu, 13 Aug 2020 13:39:40 -0700 Subject: All works smoothly --- grapher/Form1.cs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'grapher/Form1.cs') diff --git a/grapher/Form1.cs b/grapher/Form1.cs index 3df1b67..d8db6fc 100644 --- a/grapher/Form1.cs +++ b/grapher/Form1.cs @@ -193,5 +193,10 @@ namespace grapher } #endregion Methods + + private void RawAcceleration_Paint(object sender, PaintEventArgs e) + { + AccelGUI.AccelCharts.DrawPoints(); + } } } -- cgit v1.2.3