summaryrefslogtreecommitdiff
path: root/grapher
diff options
context:
space:
mode:
authorMatthew Strasiotto <[email protected]>2021-05-01 20:33:57 +1000
committerMatthew Strasiotto <[email protected]>2021-05-01 20:33:57 +1000
commit9a506f235ce7903e345f2deecccdfd91bbc88304 (patch)
tree2a0b309999de4d778951e9fd29336f76fa10fab7 /grapher
parentUpdate marker size for charts to be bigger (diff)
downloadrawaccel-9a506f235ce7903e345f2deecccdfd91bbc88304.tar.xz
rawaccel-9a506f235ce7903e345f2deecccdfd91bbc88304.zip
remove Settings.Settings based config, migrate defintitions to constants
Diffstat (limited to 'grapher')
-rw-r--r--grapher/App.config22
-rw-r--r--grapher/Constants/Constants.cs9
-rw-r--r--grapher/Models/Charts/ChartXY.cs16
-rw-r--r--grapher/Properties/Settings.Designer.cs60
-rw-r--r--grapher/Properties/Settings.settings20
5 files changed, 18 insertions, 109 deletions
diff --git a/grapher/App.config b/grapher/App.config
index 8afc72c..ebe5140 100644
--- a/grapher/App.config
+++ b/grapher/App.config
@@ -1,30 +1,8 @@
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
- <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
- <section name="grapher.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
- </sectionGroup>
</configSections>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
</startup>
- <userSettings>
- <grapher.Properties.Settings>
- <setting name="Chart_Font_Size" serializeAs="String">
- <value>15</value>
- </setting>
- <setting name="Chart_Axis_Font_Size" serializeAs="String">
- <value>12</value>
- </setting>
- <setting name="Chart_Series_Line_Width" serializeAs="String">
- <value>3</value>
- </setting>
- <setting name="Chart_BG_Colour" serializeAs="String">
- <value>Green</value>
- </setting>
- <setting name="Chart_FG_Colour" serializeAs="String">
- <value>White</value>
- </setting>
- </grapher.Properties.Settings>
- </userSettings>
</configuration> \ No newline at end of file
diff --git a/grapher/Constants/Constants.cs b/grapher/Constants/Constants.cs
index 6710aa0..ce18389 100644
--- a/grapher/Constants/Constants.cs
+++ b/grapher/Constants/Constants.cs
@@ -129,6 +129,15 @@ namespace grapher
/// <summary> Style used by System.Double.Parse </summary>
public const NumberStyles FloatStyle = NumberStyles.Float | NumberStyles.AllowThousands;
+ /// <summary> Font Size for Chart Titles </summary>
+ public const float ChartTitleFontSize = 15;
+
+ /// <summary> Font Size for Chart Axis Titles </summary>
+ public const float ChartAxisFontSize = 12;
+
+ /// <summary> Line Width For Series data on chart </summary>
+ public const int ChartSeriesLineWidth = 3;
+
/// <summary> Foreground Color When Streamer Mode Active </summary>
public static readonly System.Drawing.Color fgStreamer = System.Drawing.Color.White;
diff --git a/grapher/Models/Charts/ChartXY.cs b/grapher/Models/Charts/ChartXY.cs
index 969607c..d247264 100644
--- a/grapher/Models/Charts/ChartXY.cs
+++ b/grapher/Models/Charts/ChartXY.cs
@@ -91,8 +91,6 @@ namespace grapher
public static void setChartColors(Chart chart, System.Drawing.Color fgColor, System.Drawing.Color bgColor)
{
- // System.Drawing.Color fgColor = global::grapher.Properties.Settings.Default.Chart_FG_Colour;
- // System.Drawing.Color bgColor = global::grapher.Properties.Settings.Default.Chart_BG_Colour;
System.Drawing.Color bgTrans = System.Drawing.Color.Transparent;
chart.ForeColor = fgColor;
@@ -154,15 +152,15 @@ namespace grapher
chart.Series[1].Points.Clear();
chart.Series[1].Points.AddXY(0, 0);
- area.AxisX.TitleFont = new System.Drawing.Font(area.AxisX.TitleFont.Name, global::grapher.Properties.Settings.Default.Chart_Axis_Font_Size, System.Drawing.FontStyle.Bold);
+ area.AxisX.TitleFont = new System.Drawing.Font(area.AxisX.TitleFont.Name, Constants.ChartAxisFontSize, System.Drawing.FontStyle.Bold);
area.AxisY.TitleFont = area.AxisX.TitleFont;
- title.Font = new System.Drawing.Font(title.Font.Name, global::grapher.Properties.Settings.Default.Chart_Font_Size, System.Drawing.FontStyle.Italic | System.Drawing.FontStyle.Bold);
- int line_width = global::grapher.Properties.Settings.Default.Chart_Series_Line_Width;
- chart.Series[0].BorderWidth = line_width;
- chart.Series[0].MarkerSize = line_width * 2;
- chart.Series[2].BorderWidth = line_width;
- chart.Series[2].MarkerSize = line_width * 2;
+ title.Font = new System.Drawing.Font(title.Font.Name, Constants.ChartTitleFontSize, System.Drawing.FontStyle.Italic | System.Drawing.FontStyle.Bold);
+
+ chart.Series[0].BorderWidth = Constants.ChartSeriesLineWidth;
+ chart.Series[0].MarkerSize = Constants.ChartSeriesLineWidth * 2;
+ chart.Series[2].BorderWidth = Constants.ChartSeriesLineWidth;
+ chart.Series[2].MarkerSize = Constants.ChartSeriesLineWidth * 2;
area.AxisX.MinorGrid.Enabled = true;
area.AxisX.MinorGrid.LineDashStyle = ChartDashStyle.Dot;
diff --git a/grapher/Properties/Settings.Designer.cs b/grapher/Properties/Settings.Designer.cs
index 076bd06..de55113 100644
--- a/grapher/Properties/Settings.Designer.cs
+++ b/grapher/Properties/Settings.Designer.cs
@@ -22,65 +22,5 @@ namespace grapher.Properties {
return defaultInstance;
}
}
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("15")]
- public float Chart_Font_Size {
- get {
- return ((float)(this["Chart_Font_Size"]));
- }
- set {
- this["Chart_Font_Size"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("12")]
- public float Chart_Axis_Font_Size {
- get {
- return ((float)(this["Chart_Axis_Font_Size"]));
- }
- set {
- this["Chart_Axis_Font_Size"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("3")]
- public int Chart_Series_Line_Width {
- get {
- return ((int)(this["Chart_Series_Line_Width"]));
- }
- set {
- this["Chart_Series_Line_Width"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("Green")]
- public global::System.Drawing.Color Chart_BG_Colour {
- get {
- return ((global::System.Drawing.Color)(this["Chart_BG_Colour"]));
- }
- set {
- this["Chart_BG_Colour"] = value;
- }
- }
-
- [global::System.Configuration.UserScopedSettingAttribute()]
- [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("White")]
- public global::System.Drawing.Color Chart_FG_Colour {
- get {
- return ((global::System.Drawing.Color)(this["Chart_FG_Colour"]));
- }
- set {
- this["Chart_FG_Colour"] = value;
- }
- }
}
}
diff --git a/grapher/Properties/Settings.settings b/grapher/Properties/Settings.settings
index 6fe821b..8e615f2 100644
--- a/grapher/Properties/Settings.settings
+++ b/grapher/Properties/Settings.settings
@@ -1,21 +1,5 @@
<?xml version='1.0' encoding='utf-8'?>
-<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="grapher.Properties" GeneratedClassName="Settings">
+<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<Profiles />
- <Settings>
- <Setting Name="Chart_Font_Size" Type="System.Single" Scope="User">
- <Value Profile="(Default)">15</Value>
- </Setting>
- <Setting Name="Chart_Axis_Font_Size" Type="System.Single" Scope="User">
- <Value Profile="(Default)">12</Value>
- </Setting>
- <Setting Name="Chart_Series_Line_Width" Type="System.Int32" Scope="User">
- <Value Profile="(Default)">3</Value>
- </Setting>
- <Setting Name="Chart_BG_Colour" Type="System.Drawing.Color" Scope="User">
- <Value Profile="(Default)">Green</Value>
- </Setting>
- <Setting Name="Chart_FG_Colour" Type="System.Drawing.Color" Scope="User">
- <Value Profile="(Default)">White</Value>
- </Setting>
- </Settings>
+ <Settings />
</SettingsFile> \ No newline at end of file