- Added QRValidation vision control system - Includes CapCleaningControl UI components - WebSocket-based barcode validation system - Support for Crevis PLC integration - Test projects for PLC emulator, motion, IO panel, and Modbus 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
80 lines
2.6 KiB
C#
80 lines
2.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Data;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Windows.Forms;
|
|
|
|
namespace UIControl
|
|
{
|
|
public partial class CtlMotor : Control
|
|
{
|
|
public int Length { get; set; }
|
|
public Boolean Pin_Run { get; set; }
|
|
public Boolean Pin_DirCW { get; set; }
|
|
public Boolean Pin_Max { get; set; }
|
|
public Boolean Pin_Min { get; set; }
|
|
|
|
[Browsable(true)]
|
|
public new string Text { get; set; }
|
|
[Browsable(true)]
|
|
public new Font Font { get; set; }
|
|
public CtlMotor()
|
|
{
|
|
InitializeComponent();
|
|
Length = 100;
|
|
this.Size = new Size(80, 80);
|
|
this.MaximumSize = new Size(80, 80);
|
|
this.MinimumSize = new Size(40, 40);
|
|
if (this.Font == null) this.Font = new Font("맑은 고딕", 10);
|
|
if (this.Text == null) this.Text = string.Empty;
|
|
}
|
|
|
|
int anim = 0;
|
|
protected override void OnPaint(PaintEventArgs pe)
|
|
{
|
|
base.OnPaint(pe);
|
|
pe.Graphics.DrawRect(DisplayRectangle, Color.Gray, 2);
|
|
var rect = new Rectangle(DisplayRectangle.Left + 2, DisplayRectangle.Top + 2, 10, 10);
|
|
var rect2 = new Rectangle(DisplayRectangle.Right - 2 - 10, DisplayRectangle.Top + 2, 10, 10);
|
|
if (this.Pin_Run)
|
|
{
|
|
if (this.Pin_DirCW)
|
|
{
|
|
if (anim % 2 == 0)
|
|
pe.Graphics.FillEllipse(Brushes.Lime, rect2);
|
|
else
|
|
pe.Graphics.FillEllipse(Brushes.Yellow, rect2);
|
|
pe.Graphics.DrawEllipse(Pens.Black, rect2);
|
|
}
|
|
else
|
|
{
|
|
if (anim % 2 == 0)
|
|
pe.Graphics.FillEllipse(Brushes.Lime, rect);
|
|
else
|
|
pe.Graphics.FillEllipse(Brushes.Blue, rect);
|
|
pe.Graphics.DrawEllipse(Pens.Black, rect);
|
|
}
|
|
|
|
}
|
|
else
|
|
{
|
|
pe.Graphics.FillEllipse(Brushes.Red, rect);
|
|
pe.Graphics.DrawEllipse(Pens.Black, rect);
|
|
}
|
|
|
|
if (string.IsNullOrEmpty(Text) == false)
|
|
{
|
|
pe.Graphics.DrawString(Text,
|
|
this.Font,
|
|
Brushes.Black,
|
|
DisplayRectangle,
|
|
new StringFormat { Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center });
|
|
}
|
|
anim += 1;
|
|
}
|
|
}
|
|
}
|