1
0

set color of graph toggles to their respective curves

This commit is contained in:
2025-01-06 00:50:58 +01:00
parent 9d72035abd
commit 391cd0939d
2 changed files with 27 additions and 35 deletions

38
src/App.Designer.cs generated
View File

@@ -69,7 +69,6 @@ partial class App
statusPanel = new System.Windows.Forms.TableLayoutPanel(); statusPanel = new System.Windows.Forms.TableLayoutPanel();
stateLabel = new System.Windows.Forms.Label(); stateLabel = new System.Windows.Forms.Label();
brakeLabel = new System.Windows.Forms.Label(); brakeLabel = new System.Windows.Forms.Label();
menuStrip1 = new System.Windows.Forms.MenuStrip();
leftPanel.SuspendLayout(); leftPanel.SuspendLayout();
leftFillPanel.SuspendLayout(); leftFillPanel.SuspendLayout();
((System.ComponentModel.ISupportInitialize)speedGaugeCanvas).BeginInit(); ((System.ComponentModel.ISupportInitialize)speedGaugeCanvas).BeginInit();
@@ -89,7 +88,7 @@ partial class App
leftPanel.Controls.Add(leftFillPanel); leftPanel.Controls.Add(leftFillPanel);
leftPanel.Controls.Add(leftBottomPanel); leftPanel.Controls.Add(leftBottomPanel);
leftPanel.Dock = System.Windows.Forms.DockStyle.Left; leftPanel.Dock = System.Windows.Forms.DockStyle.Left;
leftPanel.Location = new System.Drawing.Point(0, 24); leftPanel.Location = new System.Drawing.Point(0, 0);
leftPanel.Name = "leftPanel"; leftPanel.Name = "leftPanel";
leftPanel.Size = new System.Drawing.Size(300, 480); leftPanel.Size = new System.Drawing.Size(300, 480);
leftPanel.TabIndex = 1; leftPanel.TabIndex = 1;
@@ -288,7 +287,7 @@ partial class App
rightPanel.Controls.Add(graphPanel); rightPanel.Controls.Add(graphPanel);
rightPanel.Controls.Add(valuesPanel); rightPanel.Controls.Add(valuesPanel);
rightPanel.Dock = System.Windows.Forms.DockStyle.Fill; rightPanel.Dock = System.Windows.Forms.DockStyle.Fill;
rightPanel.Location = new System.Drawing.Point(300, 24); rightPanel.Location = new System.Drawing.Point(300, 0);
rightPanel.Name = "rightPanel"; rightPanel.Name = "rightPanel";
rightPanel.Size = new System.Drawing.Size(1300, 480); rightPanel.Size = new System.Drawing.Size(1300, 480);
rightPanel.TabIndex = 2; rightPanel.TabIndex = 2;
@@ -330,7 +329,8 @@ partial class App
// servoToggle // servoToggle
// //
servoToggle.AutoSize = true; servoToggle.AutoSize = true;
servoToggle.Location = new System.Drawing.Point(452, 10); servoToggle.ForeColor = System.Drawing.Color.FromArgb(((int)((byte)255)), ((int)((byte)127)), ((int)((byte)255)));
servoToggle.Location = new System.Drawing.Point(492, 10);
servoToggle.Name = "servoToggle"; servoToggle.Name = "servoToggle";
servoToggle.Size = new System.Drawing.Size(65, 24); servoToggle.Size = new System.Drawing.Size(65, 24);
servoToggle.TabIndex = 5; servoToggle.TabIndex = 5;
@@ -340,7 +340,8 @@ partial class App
// accelerationToggle // accelerationToggle
// //
accelerationToggle.AutoSize = true; accelerationToggle.AutoSize = true;
accelerationToggle.Location = new System.Drawing.Point(335, 10); accelerationToggle.ForeColor = System.Drawing.Color.FromArgb(((int)((byte)127)), ((int)((byte)255)), ((int)((byte)127)));
accelerationToggle.Location = new System.Drawing.Point(367, 10);
accelerationToggle.Name = "accelerationToggle"; accelerationToggle.Name = "accelerationToggle";
accelerationToggle.Size = new System.Drawing.Size(111, 24); accelerationToggle.Size = new System.Drawing.Size(111, 24);
accelerationToggle.TabIndex = 4; accelerationToggle.TabIndex = 4;
@@ -350,7 +351,8 @@ partial class App
// speedToggle // speedToggle
// //
speedToggle.AutoSize = true; speedToggle.AutoSize = true;
speedToggle.Location = new System.Drawing.Point(255, 10); speedToggle.ForeColor = System.Drawing.Color.FromArgb(((int)((byte)127)), ((int)((byte)255)), ((int)((byte)255)));
speedToggle.Location = new System.Drawing.Point(279, 10);
speedToggle.Name = "speedToggle"; speedToggle.Name = "speedToggle";
speedToggle.Size = new System.Drawing.Size(74, 24); speedToggle.Size = new System.Drawing.Size(74, 24);
speedToggle.TabIndex = 3; speedToggle.TabIndex = 3;
@@ -360,7 +362,8 @@ partial class App
// derivativeToggle // derivativeToggle
// //
derivativeToggle.AutoSize = true; derivativeToggle.AutoSize = true;
derivativeToggle.Location = new System.Drawing.Point(164, 10); derivativeToggle.ForeColor = System.Drawing.Color.FromArgb(((int)((byte)255)), ((int)((byte)63)), ((int)((byte)63)));
derivativeToggle.Location = new System.Drawing.Point(180, 10);
derivativeToggle.Name = "derivativeToggle"; derivativeToggle.Name = "derivativeToggle";
derivativeToggle.Size = new System.Drawing.Size(85, 24); derivativeToggle.Size = new System.Drawing.Size(85, 24);
derivativeToggle.TabIndex = 2; derivativeToggle.TabIndex = 2;
@@ -370,7 +373,8 @@ partial class App
// integralToggle // integralToggle
// //
integralToggle.AutoSize = true; integralToggle.AutoSize = true;
integralToggle.Location = new System.Drawing.Point(79, 10); integralToggle.ForeColor = System.Drawing.Color.Yellow;
integralToggle.Location = new System.Drawing.Point(87, 10);
integralToggle.Name = "integralToggle"; integralToggle.Name = "integralToggle";
integralToggle.Size = new System.Drawing.Size(79, 24); integralToggle.Size = new System.Drawing.Size(79, 24);
integralToggle.TabIndex = 1; integralToggle.TabIndex = 1;
@@ -380,6 +384,7 @@ partial class App
// errorToggle // errorToggle
// //
errorToggle.AutoSize = true; errorToggle.AutoSize = true;
errorToggle.ForeColor = System.Drawing.Color.FromArgb(((int)((byte)127)), ((int)((byte)127)), ((int)((byte)255)));
errorToggle.Location = new System.Drawing.Point(6, 10); errorToggle.Location = new System.Drawing.Point(6, 10);
errorToggle.Name = "errorToggle"; errorToggle.Name = "errorToggle";
errorToggle.Size = new System.Drawing.Size(67, 24); errorToggle.Size = new System.Drawing.Size(67, 24);
@@ -671,7 +676,7 @@ partial class App
statusPanel.Controls.Add(stateLabel, 0, 0); statusPanel.Controls.Add(stateLabel, 0, 0);
statusPanel.Controls.Add(brakeLabel, 1, 0); statusPanel.Controls.Add(brakeLabel, 1, 0);
statusPanel.Dock = System.Windows.Forms.DockStyle.Bottom; statusPanel.Dock = System.Windows.Forms.DockStyle.Bottom;
statusPanel.Location = new System.Drawing.Point(0, 504); statusPanel.Location = new System.Drawing.Point(0, 480);
statusPanel.Name = "statusPanel"; statusPanel.Name = "statusPanel";
statusPanel.RowCount = 1; statusPanel.RowCount = 1;
statusPanel.RowStyles.Add(new System.Windows.Forms.RowStyle()); statusPanel.RowStyles.Add(new System.Windows.Forms.RowStyle());
@@ -707,28 +712,18 @@ partial class App
brakeLabel.Text = "Frein"; brakeLabel.Text = "Frein";
brakeLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; brakeLabel.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
// //
// menuStrip1
//
menuStrip1.Location = new System.Drawing.Point(0, 0);
menuStrip1.Name = "menuStrip1";
menuStrip1.Size = new System.Drawing.Size(1600, 24);
menuStrip1.TabIndex = 4;
menuStrip1.Text = "menuStrip1";
//
// App // App
// //
AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F); AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
BackColor = System.Drawing.Color.FromArgb(((int)((byte)30)), ((int)((byte)30)), ((int)((byte)30))); BackColor = System.Drawing.Color.FromArgb(((int)((byte)30)), ((int)((byte)30)), ((int)((byte)30)));
ClientSize = new System.Drawing.Size(1600, 536); ClientSize = new System.Drawing.Size(1600, 512);
Controls.Add(rightPanel); Controls.Add(rightPanel);
Controls.Add(leftPanel); Controls.Add(leftPanel);
Controls.Add(statusPanel); Controls.Add(statusPanel);
Controls.Add(menuStrip1);
Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)0)); Font = new System.Drawing.Font("Segoe UI", 11.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)0));
ForeColor = System.Drawing.Color.White; ForeColor = System.Drawing.Color.White;
Location = new System.Drawing.Point(15, 15); Location = new System.Drawing.Point(15, 15);
MainMenuStrip = menuStrip1;
MinimumSize = new System.Drawing.Size(1616, 551); MinimumSize = new System.Drawing.Size(1616, 551);
Text = "Cruise Controller MX5"; Text = "Cruise Controller MX5";
Load += App_Load; Load += App_Load;
@@ -750,11 +745,8 @@ partial class App
tableLayoutPanel1.PerformLayout(); tableLayoutPanel1.PerformLayout();
statusPanel.ResumeLayout(false); statusPanel.ResumeLayout(false);
ResumeLayout(false); ResumeLayout(false);
PerformLayout();
} }
private System.Windows.Forms.MenuStrip menuStrip1;
private System.Windows.Forms.CheckBox speedToggle; private System.Windows.Forms.CheckBox speedToggle;
private System.Windows.Forms.CheckBox accelerationToggle; private System.Windows.Forms.CheckBox accelerationToggle;
private System.Windows.Forms.CheckBox servoToggle; private System.Windows.Forms.CheckBox servoToggle;

View File

@@ -659,9 +659,9 @@ public partial class App : Form
ctx.SetTextAlign(DrawContext.TextHorizontalAlignment.Left, DrawContext.TextVerticalAlignment.Center); ctx.SetTextAlign(DrawContext.TextHorizontalAlignment.Left, DrawContext.TextVerticalAlignment.Center);
ctx.Fill(127, 127, 255); ctx.Fill(127, 127, 255);
g.DrawString(maxValue.ToString("N3", CultureInfo.InvariantCulture), _font12, ctx.FillBrush, 4, g.DrawString(maxValue.ToString("N3", CultureInfo.InvariantCulture), _font12, ctx.FillBrush, 4,
graphMargin / 2f, ctx.TextAlignment); graphMargin / 2F, ctx.TextAlignment);
g.DrawString(minValue.ToString("N3", CultureInfo.InvariantCulture), _font12, ctx.FillBrush, 4, g.DrawString(minValue.ToString("N3", CultureInfo.InvariantCulture), _font12, ctx.FillBrush, 4,
graphRect.Height - graphMargin / 2f, ctx.TextAlignment); graphRect.Height - graphMargin / 2F + 1, ctx.TextAlignment);
ctx.ResetTextAlign(); ctx.ResetTextAlign();
} }
} }
@@ -764,9 +764,9 @@ public partial class App : Form
ctx.SetTextAlign(DrawContext.TextHorizontalAlignment.Left, DrawContext.TextVerticalAlignment.Center); ctx.SetTextAlign(DrawContext.TextHorizontalAlignment.Left, DrawContext.TextVerticalAlignment.Center);
ctx.Fill(255, 255, 0); ctx.Fill(255, 255, 0);
g.DrawString(maxValue.ToString("N3", CultureInfo.InvariantCulture), _font12, ctx.FillBrush, 90, g.DrawString(maxValue.ToString("N3", CultureInfo.InvariantCulture), _font12, ctx.FillBrush, 90,
graphMargin / 2f, ctx.TextAlignment); graphMargin / 2F, ctx.TextAlignment);
g.DrawString(minValue.ToString("N3", CultureInfo.InvariantCulture), _font12, ctx.FillBrush, 90, g.DrawString(minValue.ToString("N3", CultureInfo.InvariantCulture), _font12, ctx.FillBrush, 90,
graphRect.Height - graphMargin / 2f, ctx.TextAlignment); graphRect.Height - graphMargin / 2F + 1, ctx.TextAlignment);
ctx.ResetTextAlign(); ctx.ResetTextAlign();
} }
} }
@@ -869,9 +869,9 @@ public partial class App : Form
ctx.SetTextAlign(DrawContext.TextHorizontalAlignment.Left, DrawContext.TextVerticalAlignment.Center); ctx.SetTextAlign(DrawContext.TextHorizontalAlignment.Left, DrawContext.TextVerticalAlignment.Center);
ctx.Fill(255, 63, 63); ctx.Fill(255, 63, 63);
g.DrawString(maxValue.ToString("N3", CultureInfo.InvariantCulture), _font12, ctx.FillBrush, 176, g.DrawString(maxValue.ToString("N3", CultureInfo.InvariantCulture), _font12, ctx.FillBrush, 176,
graphMargin / 2f, ctx.TextAlignment); graphMargin / 2F, ctx.TextAlignment);
g.DrawString(minValue.ToString("N3", CultureInfo.InvariantCulture), _font12, ctx.FillBrush, 176, g.DrawString(minValue.ToString("N3", CultureInfo.InvariantCulture), _font12, ctx.FillBrush, 176,
graphRect.Height - graphMargin / 2f, ctx.TextAlignment); graphRect.Height - graphMargin / 2F + 1, ctx.TextAlignment);
ctx.ResetTextAlign(); ctx.ResetTextAlign();
} }
} }
@@ -980,9 +980,9 @@ public partial class App : Form
ctx.SetTextAlign(DrawContext.TextHorizontalAlignment.Left, DrawContext.TextVerticalAlignment.Center); ctx.SetTextAlign(DrawContext.TextHorizontalAlignment.Left, DrawContext.TextVerticalAlignment.Center);
ctx.Fill(127, 255, 255); ctx.Fill(127, 255, 255);
g.DrawString(maxValue.ToString("N3", CultureInfo.InvariantCulture), _font12, ctx.FillBrush, 262, g.DrawString(maxValue.ToString("N3", CultureInfo.InvariantCulture), _font12, ctx.FillBrush, 262,
graphMargin / 2f, ctx.TextAlignment); graphMargin / 2F, ctx.TextAlignment);
g.DrawString(minValue.ToString("N3", CultureInfo.InvariantCulture), _font12, ctx.FillBrush, 262, g.DrawString(minValue.ToString("N3", CultureInfo.InvariantCulture), _font12, ctx.FillBrush, 262,
graphRect.Height - graphMargin / 2f, ctx.TextAlignment); graphRect.Height - graphMargin / 2F + 1, ctx.TextAlignment);
ctx.ResetTextAlign(); ctx.ResetTextAlign();
} }
} }
@@ -1085,9 +1085,9 @@ public partial class App : Form
ctx.SetTextAlign(DrawContext.TextHorizontalAlignment.Left, DrawContext.TextVerticalAlignment.Center); ctx.SetTextAlign(DrawContext.TextHorizontalAlignment.Left, DrawContext.TextVerticalAlignment.Center);
ctx.Fill(127, 255, 127); ctx.Fill(127, 255, 127);
g.DrawString(maxValue.ToString("N3", CultureInfo.InvariantCulture), _font12, ctx.FillBrush, 348, g.DrawString(maxValue.ToString("N3", CultureInfo.InvariantCulture), _font12, ctx.FillBrush, 348,
graphMargin / 2f, ctx.TextAlignment); graphMargin / 2F, ctx.TextAlignment);
g.DrawString(minValue.ToString("N3", CultureInfo.InvariantCulture), _font12, ctx.FillBrush, 348, g.DrawString(minValue.ToString("N3", CultureInfo.InvariantCulture), _font12, ctx.FillBrush, 348,
graphRect.Height - graphMargin / 2f, ctx.TextAlignment); graphRect.Height - graphMargin / 2F + 1, ctx.TextAlignment);
ctx.ResetTextAlign(); ctx.ResetTextAlign();
} }
} }
@@ -1176,9 +1176,9 @@ public partial class App : Form
ctx.SetTextAlign(DrawContext.TextHorizontalAlignment.Left, DrawContext.TextVerticalAlignment.Center); ctx.SetTextAlign(DrawContext.TextHorizontalAlignment.Left, DrawContext.TextVerticalAlignment.Center);
ctx.Fill(255, 127, 255); ctx.Fill(255, 127, 255);
g.DrawString(maxValue.ToString(CultureInfo.InvariantCulture), _font12, ctx.FillBrush, 434, g.DrawString(maxValue.ToString(CultureInfo.InvariantCulture), _font12, ctx.FillBrush, 434,
graphMargin / 2f, ctx.TextAlignment); graphMargin / 2F, ctx.TextAlignment);
g.DrawString(minValue.ToString(CultureInfo.InvariantCulture), _font12, ctx.FillBrush, 434, g.DrawString(minValue.ToString(CultureInfo.InvariantCulture), _font12, ctx.FillBrush, 434,
graphRect.Height - graphMargin / 2f, ctx.TextAlignment); graphRect.Height - graphMargin / 2F + 1, ctx.TextAlignment);
ctx.ResetTextAlign(); ctx.ResetTextAlign();
} }
} }