From 4aa2f3ed741dcbd39233e125a34cac8163267d8d Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 1 Sep 2020 02:39:09 -0700 Subject: Move constants to central class --- grapher/Constants/Constants.cs | 76 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 grapher/Constants/Constants.cs (limited to 'grapher/Constants/Constants.cs') diff --git a/grapher/Constants/Constants.cs b/grapher/Constants/Constants.cs new file mode 100644 index 0000000..61fa663 --- /dev/null +++ b/grapher/Constants/Constants.cs @@ -0,0 +1,76 @@ +using System; +using System.Collections.Generic; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace grapher +{ + public static class Constants + { + #region Constants + + /// Vertical separation between charts, in pixels. + public const int ChartSeparationVertical = 10; + + /// Default name of settings file. + public const string DefaultSettingsFileName = @"settings.json"; + + /// Needed to show full contents in form. Unsure why. + public const int FormHeightPadding = 35; + + /// Format string for gain cap active value label. + public const string GainCapFormatString = "0.##"; + + /// DPI by which charts are scaled if none is set by user. + public const int DefaultDPI = 1200; + + /// Poll rate by which charts are scaled if none is set by user. + public const int DefaultPollRate = 1000; + + /// Resolution of chart calulation. + public const int Resolution = 100; + + /// Multiplied by DPI over poll rate to find rough max expected velocity. + public const double MaxMultiplier = 85; + + /// Ratio of max (X, Y) used in "by component" calulations to those used in "whole vector" calculations. + public const double XYToCombinedRatio = 1.4; + + /// Separation between X and Y active value labels, in pixels. + public const int ActiveLabelXYSeparation = 2; + + /// Format string for shortened x and y textboxes. + public const string ShortenedFormatString = "0.###"; + + /// Format string for default active value labels. + public const string DefaultActiveValueFormatString = "0.######"; + + /// Format string for default textboxes. + public const string DefaultFieldFormatString = "0.#########"; + + /// Possible options to display in a layout. + public const int PossibleOptionsCount = 4; + + /// Possible x/y options to display in a layout. + public const int PossibleOptionsXYCount = 2; + + /// Horizontal separation between charts, in pixels. + public const int ChartSeparationHorizontal = 10; + + /// Default horizontal separation between x and y fields, in pixels. + public const int DefaultFieldSeparation = 4; + + /// Format string for shortened x and y fields. + public const string ShortenedFieldFormatString = "0.###"; + #endregion Constants + + #region ReadOnly + + /// Color of font in active value labels. + public static readonly Color ActiveValueFontColor = Color.FromArgb(255, 65, 65, 65); + + #endregion ReadOnly + } +} -- cgit v1.2.3 From 95cc3ed0a0bf66f5535b873f245bc1c35a145478 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 1 Sep 2020 21:45:42 -0700 Subject: intermittent commit - large commit halfway done --- grapher/Constants/Constants.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'grapher/Constants/Constants.cs') diff --git a/grapher/Constants/Constants.cs b/grapher/Constants/Constants.cs index 61fa663..833512b 100644 --- a/grapher/Constants/Constants.cs +++ b/grapher/Constants/Constants.cs @@ -54,7 +54,7 @@ namespace grapher public const int PossibleOptionsCount = 4; /// Possible x/y options to display in a layout. - public const int PossibleOptionsXYCount = 2; + public const int PossibleOptionsXYCount = 0; /// Horizontal separation between charts, in pixels. public const int ChartSeparationHorizontal = 10; @@ -62,8 +62,20 @@ namespace grapher /// Default horizontal separation between x and y fields, in pixels. public const int DefaultFieldSeparation = 4; + /// Default horizontal separation between an option's label and box, in pixels. + public const int OptionLabelBoxSeperation = 10; + + /// Default horizontal separation between an option's label and box, in pixels. + public const int OptionVerticalSeperation = 4; + /// Format string for shortened x and y fields. public const string ShortenedFieldFormatString = "0.###"; + + /// Format string for shortened x and y dropdowns. + public const string AccelDropDownDefaultFullText = "Acceleration Type"; + + /// Format string for default dropdowns. + public const string AccelDropDownDefaultShortText = "Accel Type"; #endregion Constants #region ReadOnly -- cgit v1.2.3 From 26130b21dabaab7fc331844df11465623a811197 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 1 Sep 2020 22:42:07 -0700 Subject: Second half - the parts in place --- grapher/Constants/Constants.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'grapher/Constants/Constants.cs') diff --git a/grapher/Constants/Constants.cs b/grapher/Constants/Constants.cs index 833512b..3d19b21 100644 --- a/grapher/Constants/Constants.cs +++ b/grapher/Constants/Constants.cs @@ -51,7 +51,7 @@ namespace grapher public const string DefaultFieldFormatString = "0.#########"; /// Possible options to display in a layout. - public const int PossibleOptionsCount = 4; + public const int PossibleOptionsCount = 6; /// Possible x/y options to display in a layout. public const int PossibleOptionsXYCount = 0; -- cgit v1.2.3 From 0fb1013f66026c696fec6469c02aba1c91711289 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Mon, 7 Sep 2020 19:13:30 -0700 Subject: Fix some separation bugs --- grapher/Constants/Constants.cs | 51 +++++++++++++++++++++--------------------- 1 file changed, 26 insertions(+), 25 deletions(-) (limited to 'grapher/Constants/Constants.cs') diff --git a/grapher/Constants/Constants.cs b/grapher/Constants/Constants.cs index 3d19b21..c7ca617 100644 --- a/grapher/Constants/Constants.cs +++ b/grapher/Constants/Constants.cs @@ -11,18 +11,6 @@ namespace grapher { #region Constants - /// Vertical separation between charts, in pixels. - public const int ChartSeparationVertical = 10; - - /// Default name of settings file. - public const string DefaultSettingsFileName = @"settings.json"; - - /// Needed to show full contents in form. Unsure why. - public const int FormHeightPadding = 35; - - /// Format string for gain cap active value label. - public const string GainCapFormatString = "0.##"; - /// DPI by which charts are scaled if none is set by user. public const int DefaultDPI = 1200; @@ -38,23 +26,17 @@ namespace grapher /// Ratio of max (X, Y) used in "by component" calulations to those used in "whole vector" calculations. public const double XYToCombinedRatio = 1.4; + /// Possible options to display in a layout. + public const int PossibleOptionsCount = 6; + /// Separation between X and Y active value labels, in pixels. public const int ActiveLabelXYSeparation = 2; - /// Format string for shortened x and y textboxes. - public const string ShortenedFormatString = "0.###"; - - /// Format string for default active value labels. - public const string DefaultActiveValueFormatString = "0.######"; - - /// Format string for default textboxes. - public const string DefaultFieldFormatString = "0.#########"; - - /// Possible options to display in a layout. - public const int PossibleOptionsCount = 6; + /// Vertical separation between charts, in pixels. + public const int ChartSeparationVertical = 10; - /// Possible x/y options to display in a layout. - public const int PossibleOptionsXYCount = 0; + /// Needed to show full contents in form. Unsure why. + public const int FormHeightPadding = 35; /// Horizontal separation between charts, in pixels. public const int ChartSeparationHorizontal = 10; @@ -68,14 +50,33 @@ namespace grapher /// Default horizontal separation between an option's label and box, in pixels. public const int OptionVerticalSeperation = 4; + /// Horizonatl separation between left side of single dropdown and left side of labels beneath dropdown + public const int DropDownLeftSeparation = 10; + + /// Format string for shortened x and y textboxes. + public const string ShortenedFormatString = "0.###"; + + /// Format string for default active value labels. + public const string DefaultActiveValueFormatString = "0.######"; + + /// Format string for default textboxes. + public const string DefaultFieldFormatString = "0.#########"; + /// Format string for shortened x and y fields. public const string ShortenedFieldFormatString = "0.###"; + /// Format string for gain cap active value label. + public const string GainCapFormatString = "0.##"; + /// Format string for shortened x and y dropdowns. public const string AccelDropDownDefaultFullText = "Acceleration Type"; /// Format string for default dropdowns. public const string AccelDropDownDefaultShortText = "Accel Type"; + + /// Default name of settings file. + public const string DefaultSettingsFileName = @"settings.json"; + #endregion Constants #region ReadOnly -- cgit v1.2.3 From 1462da675f1bc36d2a770413f13ccc68165cf1e9 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Mon, 7 Sep 2020 20:30:15 -0700 Subject: Add chart resize --- grapher/Constants/Constants.cs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'grapher/Constants/Constants.cs') diff --git a/grapher/Constants/Constants.cs b/grapher/Constants/Constants.cs index c7ca617..9367fd1 100644 --- a/grapher/Constants/Constants.cs +++ b/grapher/Constants/Constants.cs @@ -50,9 +50,20 @@ namespace grapher /// Default horizontal separation between an option's label and box, in pixels. public const int OptionVerticalSeperation = 4; - /// Horizonatl separation between left side of single dropdown and left side of labels beneath dropdown + /// Horizontal separation between left side of single dropdown and left side of labels beneath dropdown public const int DropDownLeftSeparation = 10; + /// Width of charts when widened + public const int WideChartWidth = 810; + + /// Width of charts when widened + public const int WideChartLeft = 270; + + /// Width of charts when narrowed + public const int NarrowChartWidth = 698; + + public const int NarrowChartLeft = 482; + /// Format string for shortened x and y textboxes. public const string ShortenedFormatString = "0.###"; -- cgit v1.2.3 From f2322540dd904474587ddebfa8d96dc66a902530 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 8 Sep 2020 00:51:05 -0700 Subject: Alignment for whole mode works --- grapher/Constants/Constants.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'grapher/Constants/Constants.cs') diff --git a/grapher/Constants/Constants.cs b/grapher/Constants/Constants.cs index 9367fd1..887c8aa 100644 --- a/grapher/Constants/Constants.cs +++ b/grapher/Constants/Constants.cs @@ -54,10 +54,10 @@ namespace grapher public const int DropDownLeftSeparation = 10; /// Width of charts when widened - public const int WideChartWidth = 810; + public const int WideChartWidth = 723; /// Width of charts when widened - public const int WideChartLeft = 270; + public const int WideChartLeft = 333; /// Width of charts when narrowed public const int NarrowChartWidth = 698; -- cgit v1.2.3 From 9502dcf7608475857b1487375997d20a9d29622e Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 8 Sep 2020 01:26:22 -0700 Subject: Remove and sort usings en masse --- grapher/Constants/Constants.cs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'grapher/Constants/Constants.cs') diff --git a/grapher/Constants/Constants.cs b/grapher/Constants/Constants.cs index 887c8aa..51cd0cb 100644 --- a/grapher/Constants/Constants.cs +++ b/grapher/Constants/Constants.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Drawing; namespace grapher { -- cgit v1.2.3 From d31ef3c66c9919d3520ee34db062687a84bc5fa4 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 8 Sep 2020 14:01:33 -0700 Subject: Add delay on button enable after writing to driver --- grapher/Constants/Constants.cs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'grapher/Constants/Constants.cs') diff --git a/grapher/Constants/Constants.cs b/grapher/Constants/Constants.cs index 51cd0cb..d74d045 100644 --- a/grapher/Constants/Constants.cs +++ b/grapher/Constants/Constants.cs @@ -80,6 +80,12 @@ namespace grapher /// Format string for default dropdowns. public const string AccelDropDownDefaultShortText = "Accel Type"; + /// Default text to be displayed on write button. + public const string WriteButtonDefaultText = "Write To Driver"; + + /// Default text to be displayed on write button. + public const string WriteButtonDelayText = "Delay"; + /// Default name of settings file. public const string DefaultSettingsFileName = @"settings.json"; -- cgit v1.2.3 From 79bb4f0bc1d72c36767ff73825b7f70db9615928 Mon Sep 17 00:00:00 2001 From: Jacob Palecki Date: Tue, 8 Sep 2020 14:21:22 -0700 Subject: Set WriteButton vertical placement --- grapher/Constants/Constants.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'grapher/Constants/Constants.cs') diff --git a/grapher/Constants/Constants.cs b/grapher/Constants/Constants.cs index d74d045..aaf8bb9 100644 --- a/grapher/Constants/Constants.cs +++ b/grapher/Constants/Constants.cs @@ -51,14 +51,17 @@ namespace grapher /// Width of charts when widened public const int WideChartWidth = 723; - /// Width of charts when widened + /// Left placement of charts when widened public const int WideChartLeft = 333; /// Width of charts when narrowed public const int NarrowChartWidth = 698; + /// Left placement of charts when narrowed public const int NarrowChartLeft = 482; + public const int WriteButtonVerticalOffset = 50; + /// Format string for shortened x and y textboxes. public const string ShortenedFormatString = "0.###"; -- cgit v1.2.3