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