AxisPointControl.cs 1.6 KB
using OnlineStore.Common;
using OnlineStore.DeviceLibrary;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace OnlineStore.XLRStore.useControl
{
    public partial class AxisPointControl : UserControl
    { 
        public AxisPointControl()
        {
            InitializeComponent();
        }
        public string PointText
        {
            get { return btnMove.Text; }
            set { btnMove.Text = value; }
        }

        public int PointValue
        {
            get { return FormUtil.GetIntValue( txtPoint.Text); }
            set { txtPoint.Text = value.ToString(); }
        }
        public Color PointBackColor
        {
            get { return btnMove.BackColor; }
            set { this.btnMove.BackColor = value; }
        }
        public Color PointForeColor
        {
            get { return btnMove.ForeColor; }
            set { this.btnMove.ForeColor = value; }
        }
        private int MoveSpeed;
        private AxisBean MoveAxis = null;
        public void  SetMoveData(AxisBean axisBean,int speed,int pointV)
        {
            this.MoveAxis = axisBean;
            this.MoveSpeed = speed;
            this.PointValue = pointV;
        }
        private void btnMove_Click(object sender, EventArgs e)
        {
            int v = FormUtil.GetIntValue(txtPoint);
            LogUtil.info(this.Name+" "+ MoveAxis.AxisName + " 点击:" + btnMove.Text);
            MoveAxis.AbsMove(null, v, MoveSpeed);
        }
    }
}