This commit is contained in:
meelstorm
2025-09-24 16:27:07 +02:00
parent 0ebe629922
commit 87c1145744
11 changed files with 59 additions and 41 deletions

View File

@@ -38,25 +38,25 @@ namespace VisionBuilder.UI.IOCommander.Windows
this.ShowInTaskbar = false;
this.StartPosition = FormStartPosition.Manual;
this.Location = new Point(50, 50);
this.Size = new Size(280, 450); // Made wider to accommodate labels
this.Size = new Size(400, 350); // Made wider and adjusted height for 10 rows
this.BackColor = Color.FromArgb(64, 64, 64);
this.MinimizeBox = false;
this.MaximizeBox = false;
// Create pin indicators for input pins 0-19 and output pins 0-19 (20 rows, 2 columns)
int pinSize = 18;
int spacing = 2;
int centerX = 140; // Center the graphics in the wider form
int startY = 10;
// Create pin indicators for input pins 1-10 and output pins 1-10 (10 rows, 2 columns)
int pinSize = 24; // Increased from 18
int spacing = 4; // Increased from 2
int centerX = 200; // Center the graphics in the wider form
int startY = 15; // Slightly more margin
// Get label dictionaries for quick lookup
var inputLabelDict = _settings.InputPinLabels?.ToDictionary(pl => pl.Pin, pl => pl.Label) ?? new Dictionary<int, string>();
var outputLabelDict = _settings.OutputPinLabels?.ToDictionary(pl => pl.Pin, pl => pl.Label) ?? new Dictionary<int, string>();
for (int row = 0; row < 20; row++)
for (int row = 0; row < 10; row++) // Changed from 20 to 10
{
int inputPin = row; // Input pins numbered 0-19
int outputPin = row; // Output pins numbered 0-19
int inputPin = row + 1; // Input pins numbered 1-10
int outputPin = row + 1; // Output pins numbered 1-10
// Left column (input pins)
var leftIndicator = new PinIndicator(inputPin, true)
@@ -81,9 +81,9 @@ namespace VisionBuilder.UI.IOCommander.Windows
var leftLabel = new Label
{
Text = inputLabelText,
Location = new Point(5, startY + (row * (pinSize + spacing)) + 2),
Size = new Size(centerX - pinSize - spacing * 3 - 5, 14),
Font = new Font("Arial", 6, FontStyle.Bold),
Location = new Point(5, startY + (row * (pinSize + spacing)) + 4), // Adjusted vertical alignment
Size = new Size(centerX - pinSize - spacing * 3 - 5, 16), // Increased height from 14
Font = new Font("Arial", 8, FontStyle.Bold), // Increased from 6
ForeColor = Color.White,
BackColor = Color.Transparent,
TextAlign = ContentAlignment.MiddleRight
@@ -95,9 +95,9 @@ namespace VisionBuilder.UI.IOCommander.Windows
var rightLabel = new Label
{
Text = outputLabelText,
Location = new Point(centerX + pinSize + spacing * 3, startY + (row * (pinSize + spacing)) + 2),
Size = new Size(this.Width - (centerX + pinSize + spacing * 3) - 10, 14),
Font = new Font("Arial", 6, FontStyle.Bold),
Location = new Point(centerX + pinSize + spacing * 3, startY + (row * (pinSize + spacing)) + 4), // Adjusted vertical alignment
Size = new Size(this.Width - (centerX + pinSize + spacing * 3) - 10, 16), // Increased height from 14
Font = new Font("Arial", 8, FontStyle.Bold), // Increased from 6
ForeColor = Color.White,
BackColor = Color.Transparent,
TextAlign = ContentAlignment.MiddleLeft