领胜LDS 键盘AOI检测项目
xcd
2020-07-04 753b5add58defa5c09015308efb81bcaea0ebe91
修改板卡操作配置基类复数化
2个文件已添加
14个文件已修改
377 ■■■■ 已修改文件
src/Bro.Common.Device/DeviceBase/MotionCardBase.cs 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.Device.GTSCard/GTSCardDriver.cs 32 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.M071.Process/Bro.M071.Process.csproj 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.M071.Process/M071Config.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.M071.Process/M071Process.cs 19 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.M071.Process/M071Process_MotionCard.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.M071.Process/UI/M071_MainForm.Designer.cs 80 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.M071.Process/UI/M071_MainForm.cs 63 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.M071.Process/UI/M071_ShortcutFrm.Designer.cs 39 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.M071.Process/UI/M071_ShortcutFrm.cs 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.UI.Config/MainFrm.Designer.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.UI.Config/MainFrm.cs 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.UI.Config/MenuForms/FrmConfig.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.UI.Config/MenuForms/FrmOperation.cs 15 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.UI.Config/MenuForms/FrmOperation.resx 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.UI.Device.Winform/MotionCard/CtrlMotionCardOperationBase.cs 24 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/Bro.Common.Device/DeviceBase/MotionCardBase.cs
@@ -126,7 +126,6 @@
        public List<IMonitorSet> GetAllMonitorSet()
        {
            WarningSetCollection.ForEach(m => m.Source = this.Name);
            MonitorSetCollection.ForEach(m => m.SourceDevice = this.Id);
            return MonitorSetCollection;
        }
@@ -135,6 +134,20 @@
    [Device("MotionCardBase", "板卡操作配置基类", EnumHelper.DeviceAttributeType.OperationConfig)]
    public class MotionCardOperationConfigBase : OperationConfigBase, IComplexDisplay
    {
        [Category("板卡操作")]
        [Description("板卡操作配置基类集合,依次执行")]
        [TypeConverter(typeof(CollectionCountConvert))]
        [Editor(typeof(ComplexCollectionEditor<MotionCardOperationConfigBase>), typeof(UITypeEditor))]
        public List<MotionCardOperationSet> OperationCollection { get; set; } = new List<MotionCardOperationSet>();
        public string GetDisplayText()
        {
            return string.Join(" ", OperationCollection.Select(u => u.GetDisplayText()));
        }
    }
    public class MotionCardOperationSet : IComplexDisplay
    {
        [Category("IO操作配置")]
        [DisplayName("IO预检查定义集合")]
@@ -219,15 +232,15 @@
        }
    }
    [Device("MotionCardOperationConfigCollection", "板卡操作配置基类集合", EnumHelper.DeviceAttributeType.OperationConfig)]
    public class MotionCardOperationConfigCollection : OperationConfigBase
    {
        [Category("复位操作")]
        [Description("板卡操作配置基类集合,依次执行")]
        [TypeConverter(typeof(CollectionCountConvert))]
        [Editor(typeof(ComplexCollectionEditor<MotionCardOperationConfigBase>), typeof(UITypeEditor))]
        public List<MotionCardOperationConfigBase> MotionCardOpsCollection { get; set; } = new List<MotionCardOperationConfigBase>();
    }
    //[Device("MotionCardOperationConfigCollection", "板卡操作配置基类集合", EnumHelper.DeviceAttributeType.OperationConfig)]
    //public class MotionCardOperationConfigCollection : OperationConfigBase
    //{
    //    [Category("复位操作")]
    //    [Description("板卡操作配置基类集合,依次执行")]
    //    [TypeConverter(typeof(CollectionCountConvert))]
    //    [Editor(typeof(ComplexCollectionEditor<MotionCardOperationConfigBase>), typeof(UITypeEditor))]
    //    public List<MotionCardOperationConfigBase> MotionCardOpsCollection { get; set; } = new List<MotionCardOperationConfigBase>();
    //}
    public class IORefrenceItemCollectionEditor : CollectionEditor
    {
src/Bro.Device.GTSCard/GTSCardDriver.cs
@@ -164,22 +164,22 @@
        /// <returns>运动控制+停止判断</returns>
        public override ResponseMessage MoveToPoint(IOperationConfig opConfig)
        {
            bool resultOK = false;
            var gtsOperationConfig = opConfig as GTSCardOperationConfig;
            List<Task<bool>> taskList = new List<Task<bool>>();
            //TaskFactory factory = new TaskFactory(TaskCreationOptions.LongRunning, TaskContinuationOptions.None);
            // 如果是多个轴的运动 等每个轴运动结束
            foreach (var movingOp in gtsOperationConfig.MovingOps)
            {
                //var task = factory.StartNew<bool>((op) =>
                //{
                //    return SingleAxisMoving(op as MovingOption);
                //}, movingOp);
                var task = SingleAxisMoving(movingOp);
                taskList.Add(task);
            }
            Task.WaitAll(taskList.ToArray());
            resultOK = taskList.All(u => u.GetAwaiter().GetResult());
            //bool resultOK = false;
            //var gtsOperationConfig = opConfig as GTSCardOperationConfig;
            //List<Task<bool>> taskList = new List<Task<bool>>();
            ////TaskFactory factory = new TaskFactory(TaskCreationOptions.LongRunning, TaskContinuationOptions.None);
            //// 如果是多个轴的运动 等每个轴运动结束
            //foreach (var movingOp in gtsOperationConfig.MovingOps)
            //{
            //    //var task = factory.StartNew<bool>((op) =>
            //    //{
            //    //    return SingleAxisMoving(op as MovingOption);
            //    //}, movingOp);
            //    var task = SingleAxisMoving(movingOp);
            //    taskList.Add(task);
            //}
            //Task.WaitAll(taskList.ToArray());
            //resultOK = taskList.All(u => u.GetAwaiter().GetResult());
            //return resultOK;
            throw new NotImplementedException();
src/Bro.M071.Process/Bro.M071.Process.csproj
@@ -120,6 +120,12 @@
    <Compile Include="UI\M071_MainForm.Designer.cs">
      <DependentUpon>M071_MainForm.cs</DependentUpon>
    </Compile>
    <Compile Include="UI\M071_ShortcutFrm.cs">
      <SubType>Form</SubType>
    </Compile>
    <Compile Include="UI\M071_ShortcutFrm.Designer.cs">
      <DependentUpon>M071_ShortcutFrm.cs</DependentUpon>
    </Compile>
    <EmbeddedResource Include="Properties\Resources.resx">
      <Generator>ResXFileCodeGenerator</Generator>
      <LastGenOutput>Resources.Designer.cs</LastGenOutput>
src/Bro.M071.Process/M071Config.cs
@@ -77,5 +77,23 @@
        [Description("单键图片保存目录路径")]
        [Editor(typeof(FoldDialogEditor),typeof(UITypeEditor))]
        public string ImageSaveFolder { get; set; } = "";
        [Category("屏蔽配置")]
        [Description("true:屏蔽安全门 false:启用安全门")]
        [ReadOnly(true)]
        public bool IsSafetyDoorBlocked { get; set; } = false;
        [Category("屏蔽配置")]
        [Description("true:屏蔽安全光线 false:启用安全光线")]
        [ReadOnly(true)]
        public bool IsSafetyBeamBlocked { get; set; } = false;
        [Category("屏蔽配置")]
        [Description("true:屏蔽蜂鸣器 false:启用蜂鸣器")]
        public bool IsBeepBlocked { get; set; } = false;
        [Category("屏蔽配置")]
        [Description("true:禁止手动输入条码 false:允许手动输入条码")]
        public bool IsBarcodeManulInputBlocked { get; set; } = true;
    }
}
src/Bro.M071.Process/M071Process.cs
@@ -33,7 +33,7 @@
        #region 事件
        public event Action OnMeasureStart;
        public event Action<string> OnBarcodeChanged;
        public event Action OnClearBarcode;
        public event Action<IShapeElement> OnElementUpdated;
        #endregion
@@ -51,7 +51,7 @@
        /// </summary>
        private void CheckMachineState()
        {
            throw new NotImplementedException();
            //throw new NotImplementedException();
        }
        private void InitialSetting()
@@ -150,19 +150,7 @@
        //}
        #endregion
        private string barCode = "";
        public string BarCode
        {
            get => barCode;
            set
            {
                if (barCode != value)
                {
                    barCode = value;
                    OnBarcodeChanged?.Invoke(value);
                }
            }
        }
        public string BarCode { get; set; }
        List<ProductionMeasurement> productionList = new List<ProductionMeasurement>();
@@ -171,6 +159,7 @@
        {
            if (string.IsNullOrWhiteSpace(BarCode))
            {
                OnClearBarcode?.Invoke();
                throw new ProcessException("未输入产品条码,请勿开始测量");
            }
src/Bro.M071.Process/M071Process_MotionCard.cs
@@ -116,7 +116,7 @@
            //    motionCard.Run(opConfig);
            //}
            MotionCardDefaultRun("FullReset", ref opConfig, ref invokeDevice);
            //MotionCardDefaultRun("FullReset", ref opConfig, ref invokeDevice);
            return new ProcessResponse(true);
        }
src/Bro.M071.Process/UI/M071_MainForm.Designer.cs
@@ -33,6 +33,11 @@
            this.tsmiShowToolBar = new System.Windows.Forms.ToolStripMenuItem();
            this.tsmiShowStatusBar = new System.Windows.Forms.ToolStripMenuItem();
            this.tsmiShowEditor = new System.Windows.Forms.ToolStripMenuItem();
            this.lblCT = new System.Windows.Forms.Label();
            this.txtBarcode = new System.Windows.Forms.TextBox();
            this.lblProductionState = new System.Windows.Forms.Label();
            this.lblMachineState = new System.Windows.Forms.Label();
            this.plImage = new System.Windows.Forms.Panel();
            this.tscEditLocation = new System.Windows.Forms.ToolStripContainer();
            this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel();
            this.btnConfirmEdit = new System.Windows.Forms.Button();
@@ -82,6 +87,61 @@
            this.tsmiShowEditor.Size = new System.Drawing.Size(148, 22);
            this.tsmiShowEditor.Text = "编辑显示点位";
            this.tsmiShowEditor.CheckedChanged += new System.EventHandler(this.tsmiShowEditor_CheckedChanged);
            //
            // lblCT
            //
            this.lblCT.AutoSize = true;
            this.lblCT.Font = new System.Drawing.Font("Tahoma", 12F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, ((byte)(134)));
            this.lblCT.Location = new System.Drawing.Point(464, 19);
            this.lblCT.Name = "lblCT";
            this.lblCT.Size = new System.Drawing.Size(35, 14);
            this.lblCT.TabIndex = 4;
            this.lblCT.Text = "XXXX";
            //
            // txtBarcode
            //
            this.txtBarcode.Font = new System.Drawing.Font("Tahoma", 14F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, ((byte)(134)));
            this.txtBarcode.Location = new System.Drawing.Point(138, 13);
            this.txtBarcode.Name = "txtBarcode";
            this.txtBarcode.Size = new System.Drawing.Size(261, 24);
            this.txtBarcode.TabIndex = 3;
            this.txtBarcode.Text = "BARCODE";
            this.txtBarcode.TextChanged += new System.EventHandler(this.txtBarcode_TextChanged);
            //
            // lblProductionState
            //
            this.lblProductionState.AutoSize = true;
            this.lblProductionState.BackColor = System.Drawing.Color.Lime;
            this.lblProductionState.Font = new System.Drawing.Font("Tahoma", 20F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.World, ((byte)(134)));
            this.lblProductionState.ForeColor = System.Drawing.Color.White;
            this.lblProductionState.Location = new System.Drawing.Point(405, 13);
            this.lblProductionState.Name = "lblProductionState";
            this.lblProductionState.Size = new System.Drawing.Size(39, 24);
            this.lblProductionState.TabIndex = 2;
            this.lblProductionState.Text = "OK";
            //
            // lblMachineState
            //
            this.lblMachineState.AutoSize = true;
            this.lblMachineState.BackColor = System.Drawing.Color.Lime;
            this.lblMachineState.Font = new System.Drawing.Font("Tahoma", 20F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.World, ((byte)(134)));
            this.lblMachineState.ForeColor = System.Drawing.Color.White;
            this.lblMachineState.Location = new System.Drawing.Point(22, 12);
            this.lblMachineState.Name = "lblMachineState";
            this.lblMachineState.Size = new System.Drawing.Size(79, 24);
            this.lblMachineState.TabIndex = 2;
            this.lblMachineState.Text = "READY";
            //
            // plImage
            //
            this.plImage.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
            | System.Windows.Forms.AnchorStyles.Left)
            | System.Windows.Forms.AnchorStyles.Right)));
            this.plImage.ContextMenuStrip = this.contextMenuStrip1;
            this.plImage.Location = new System.Drawing.Point(1, 47);
            this.plImage.Name = "plImage";
            this.plImage.Size = new System.Drawing.Size(796, 304);
            this.plImage.TabIndex = 1;
            // 
            // tscEditLocation
            // 
@@ -159,7 +219,7 @@
            // 
            this.splitContainer1.Panel2.Controls.Add(this.propGridKeyIndicator);
            this.splitContainer1.Size = new System.Drawing.Size(203, 284);
            this.splitContainer1.SplitterDistance = 164;
            this.splitContainer1.SplitterDistance = 163;
            this.splitContainer1.TabIndex = 1;
            // 
            // lvMeasures
@@ -171,7 +231,7 @@
            this.lvMeasures.Location = new System.Drawing.Point(0, 0);
            this.lvMeasures.MultiSelect = false;
            this.lvMeasures.Name = "lvMeasures";
            this.lvMeasures.Size = new System.Drawing.Size(203, 164);
            this.lvMeasures.Size = new System.Drawing.Size(203, 163);
            this.lvMeasures.TabIndex = 0;
            this.lvMeasures.UseCompatibleStateImageBehavior = false;
            this.lvMeasures.View = System.Windows.Forms.View.List;
@@ -182,7 +242,7 @@
            this.propGridKeyIndicator.Dock = System.Windows.Forms.DockStyle.Fill;
            this.propGridKeyIndicator.Location = new System.Drawing.Point(0, 0);
            this.propGridKeyIndicator.Name = "propGridKeyIndicator";
            this.propGridKeyIndicator.Size = new System.Drawing.Size(203, 116);
            this.propGridKeyIndicator.Size = new System.Drawing.Size(203, 117);
            this.propGridKeyIndicator.TabIndex = 0;
            this.propGridKeyIndicator.ToolbarVisible = false;
            // 
@@ -191,10 +251,16 @@
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(800, 351);
            this.ContextMenuStrip = this.contextMenuStrip1;
            this.Controls.Add(this.lblCT);
            this.Controls.Add(this.txtBarcode);
            this.Controls.Add(this.lblProductionState);
            this.Controls.Add(this.lblMachineState);
            this.Controls.Add(this.plImage);
            this.Controls.Add(this.tscEditLocation);
            this.KeyPreview = true;
            this.Name = "M071_MainForm";
            this.Text = "M071_MainForm";
            this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.M071_MainForm_KeyUp);
            this.contextMenuStrip1.ResumeLayout(false);
            this.tscEditLocation.ContentPanel.ResumeLayout(false);
            this.tscEditLocation.ResumeLayout(false);
@@ -205,6 +271,7 @@
            ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
            this.splitContainer1.ResumeLayout(false);
            this.ResumeLayout(false);
            this.PerformLayout();
        }
@@ -221,5 +288,10 @@
        private System.Windows.Forms.ListView lvMeasures;
        private System.Windows.Forms.ToolStripMenuItem tsmiShowToolBar;
        private System.Windows.Forms.ToolStripMenuItem tsmiShowStatusBar;
        private System.Windows.Forms.Panel plImage;
        private System.Windows.Forms.Label lblMachineState;
        private System.Windows.Forms.Label lblProductionState;
        private System.Windows.Forms.TextBox txtBarcode;
        private System.Windows.Forms.Label lblCT;
    }
}
src/Bro.M071.Process/UI/M071_MainForm.cs
@@ -12,7 +12,7 @@
namespace Bro.M071.Process.UI
{
    [MenuNode("M071_MainForm", "键盘检测主界面", 3, "M071Node", true)]
    [MenuNode("M071_MainForm", "运行界面", 1, "M071Node", true)]
    public partial class M071_MainForm : MenuFrmBase
    {
        Canvas cvImage = new Canvas();
@@ -26,7 +26,7 @@
            tsmiShowStatusBar.Checked = cvImage.IsShowStatusBar = false;
            tsmiShowToolBar.Checked = cvImage.IsShowToolBar = false;
            cvImage.Dock = DockStyle.Fill;
            this.Controls.Add(cvImage);
            plImage.Controls.Add(cvImage);
            tscEditLocation.Visible = tsmiShowEditor.Checked = false;
        }
@@ -66,17 +66,14 @@
                item.Tag = u.Id;
                lvMeasures.Items.Add(item);
            });
        }
        private void lvMeasures_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (lvMeasures.SelectedItems.Count <= 0)
                return;
            var ele = cvImage.Elements.FirstOrDefault(u => u.ID == lvMeasures.SelectedItems[0].Tag.ToString());
            propGridKeyIndicator.SelectedObject = ele;
            txtBarcode.ReadOnly = Config.IsBarcodeManulInputBlocked;
            (Process as M071Process).OnClearBarcode -= M071_MainForm_OnClearBarcode;
            (Process as M071Process).OnClearBarcode += M071_MainForm_OnClearBarcode;
        }
        #region 图片区右键菜单
        private void tsmiShowToolBar_CheckedChanged(object sender, EventArgs e)
        {
            cvImage.IsShowToolBar = tsmiShowToolBar.Checked;
@@ -90,6 +87,18 @@
        private void tsmiShowEditor_CheckedChanged(object sender, EventArgs e)
        {
            tscEditLocation.Visible = tsmiShowEditor.Checked;
            tscEditLocation.BringToFront();
        }
        #endregion
        #region 标签编辑区
        private void lvMeasures_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (lvMeasures.SelectedItems.Count <= 0)
                return;
            var ele = cvImage.Elements.FirstOrDefault(u => u.ID == lvMeasures.SelectedItems[0].Tag.ToString());
            propGridKeyIndicator.SelectedObject = ele;
        }
        private void btnCancelEdit_Click(object sender, EventArgs e)
@@ -125,5 +134,39 @@
            MessageBox.Show("标签修改完成");
        }
        #endregion
        #region 上方状态区
        #region 条码
        string _barcode = "";
        private void M071_MainForm_KeyUp(object sender, KeyEventArgs e)
        {
            string keyStr = e.KeyCode.ToString();
            if (keyStr.Length == 1)
            {
                _barcode += keyStr.ToUpper();
            }
            if (e.KeyValue == 13)
            {
                txtBarcode.Text = _barcode;
                _barcode = "";
            }
        }
        private void txtBarcode_TextChanged(object sender, EventArgs e)
        {
            (Process as M071Process).BarCode = txtBarcode.Text.Trim();
        }
        private void M071_MainForm_OnClearBarcode()
        {
            txtBarcode.BeginInvoke(new Action(() => txtBarcode.Clear()));
        }
        #endregion
        #endregion
    }
}
src/Bro.M071.Process/UI/M071_ShortcutFrm.Designer.cs
New file
@@ -0,0 +1,39 @@
namespace Bro.M071.Process.UI
{
    partial class M071_ShortcutFrm
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }
        #region Windows Form Designer generated code
        /// <summary>
        /// Required method for Designer support - do not modify
        /// the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(800, 450);
            this.Text = "M071_ShortcutFrm";
        }
        #endregion
    }
}
src/Bro.M071.Process/UI/M071_ShortcutFrm.cs
New file
@@ -0,0 +1,22 @@
using Bro.UI.Model.Winform;
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 Bro.M071.Process.UI
{
    [MenuNode("M071_ShortcutFrm", "快捷操作", 2, "M071Node", true)]
    public partial class M071_ShortcutFrm : MenuFrmBase
    {
        public M071_ShortcutFrm()
        {
            InitializeComponent();
        }
    }
}
src/Bro.UI.Config/MainFrm.Designer.cs
@@ -197,6 +197,7 @@
            this.Font = new System.Drawing.Font("Tahoma", 11F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.World, ((byte)(134)));
            this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
            this.IsMdiContainer = true;
            this.KeyPreview = true;
            this.MainMenuStrip = this.menuMain;
            this.Margin = new System.Windows.Forms.Padding(3, 4, 3, 4);
            this.Name = "MainFrm";
src/Bro.UI.Config/MainFrm.cs
@@ -32,7 +32,7 @@
            VisualStudioToolStripExtender extender = new VisualStudioToolStripExtender();
            extender.SetStyle(menuMain, VisualStudioToolStripExtender.VsVersion.Vs2015, theme);
            InitialMenu(MenuFormFactory.MenuFrmTypeDict, "");
            //MenuFormFactory.MenuFrmTypeDict.ToList().ForEach(t =>
@@ -491,15 +491,18 @@
        private void Device_OnDeviceStateChanged(IDevice device, EnumHelper.DeviceState currentState)
        {
            for (int i = 1; i < ststripDevices.Items.Count; i++)
            ststripDevices.BeginInvoke(new Action(() =>
            {
                if ((ststripDevices.Items[i].Tag as IDevice)?.Id == device.Id)
                for (int i = 1; i < ststripDevices.Items.Count; i++)
                {
                    ststripDevices.Items[i].BackColor = currentState.GetEnumSelectedColor();
                    ststripDevices.Items[i].ForeColor = currentState.GetEnumSelectedFontColor();
                    break;
                    if ((ststripDevices.Items[i].Tag as IDevice)?.Id == device.Id)
                    {
                        ststripDevices.Items[i].BackColor = currentState.GetEnumSelectedColor();
                        ststripDevices.Items[i].ForeColor = currentState.GetEnumSelectedFontColor();
                        break;
                    }
                }
            }
            }));
        }
        #endregion
src/Bro.UI.Config/MenuForms/FrmConfig.cs
@@ -53,7 +53,7 @@
        private void buttonCreateConfig_Click(object sender, EventArgs e)
        {
            string pCode = Interaction.InputBox("请输入产品编码", "产品编码","",0,0);
            string pCode = Interaction.InputBox("请输入产品编码", "产品编码", "", 0, 0);
            if (string.IsNullOrWhiteSpace(pCode))
            {
                MessageBox.Show("请输入产品编码!");
src/Bro.UI.Config/MenuForms/FrmOperation.cs
@@ -140,7 +140,7 @@
        }
        bool isStart = true;
        private void btnStart_Click(object sender, System.EventArgs e)
        private async void btnStart_Click(object sender, System.EventArgs e)
        {
            if (Process == null)
            {
@@ -157,11 +157,11 @@
                //if (Process.ProcessState != EnumHelper.DeviceState.DSOpen)
                if (isStart)
                {
                    ProcessOperation(true);
                    await ProcessOperation(true);
                }
                else
                {
                    ProcessOperation(false);
                    await ProcessOperation(false);
                }
                isStart = !isStart;
@@ -172,7 +172,8 @@
            }
            finally
            {
                this.BeginInvoke(new Action(() => btnStart.Enabled = true));
                //this.BeginInvoke(new Action(() => btnStart.Enabled = true));
                btnStart.Enabled = true;
            }
            //});
        }
@@ -255,11 +256,11 @@
        //    }
        //}
        private void ProcessOperation(bool isStart)
        private async Task ProcessOperation(bool isStart)
        {
            if (isStart)
            {
                Process.Open();
                await Task.Run(() => Process.Open());
                //this.BeginInvoke(new Action(() =>
                //{
@@ -273,7 +274,7 @@
            }
            else
            {
                Process.Close();
                await Task.Run(() => Process.Close());
                //this.BeginInvoke(new Action(() =>
                //{
src/Bro.UI.Config/MenuForms/FrmOperation.resx
@@ -125,7 +125,7 @@
        AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
        LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
        ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADm
        CgAAAk1TRnQBSQFMAgEBAgEAAdgBAAHYAQABGAEAARgBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
        CgAAAk1TRnQBSQFMAgEBAgEAAeABAAHgAQABGAEAARgBAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo
        AwABYAMAARgDAAEBAQABCAYAAQkYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA
        AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5
        AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA
@@ -182,7 +182,7 @@
        AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w
        LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0
        ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAD4
        CAAAAk1TRnQBSQFMAwEBAAHYAQAB2AEAARgBAAEYAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
        CAAAAk1TRnQBSQFMAwEBAAHgAQAB4AEAARgBAAEYAQAE/wEJAQAI/wFCAU0BNgEEBgABNgEEAgABKAMA
        AWADAAEYAwABAQEAAQgGAAEJGAABgAIAAYADAAKAAQABgAMAAYABAAGAAQACgAIAA8ABAAHAAdwBwAEA
        AfABygGmAQABMwUAATMBAAEzAQABMwEAAjMCAAMWAQADHAEAAyIBAAMpAQADVQEAA00BAANCAQADOQEA
        AYABfAH/AQACUAH/AQABkwEAAdYBAAH/AewBzAEAAcYB1gHvAQAB1gLnAQABkAGpAa0CAAH/ATMDAAFm
src/Bro.UI.Device.Winform/MotionCard/CtrlMotionCardOperationBase.cs
@@ -52,18 +52,18 @@
        private void RadioButton_CheckedChanged(object sender, EventArgs e)
        {
            //加载对应运动的 movingConfig
            if (radioP2P.Checked)
            {
                movingConfig = MotionCardOperationConfig.MovingOps.FirstOrDefault(u => u.MoveMode == EnumHelper.MotorMoveMode.Normal);
            }
            else if (radioJog.Checked)
            {
                movingConfig = MotionCardOperationConfig.MovingOps.FirstOrDefault(u => u.MoveMode == EnumHelper.MotorMoveMode.Jog);
            }
            else if (radioGoHome.Checked)
            {
                movingConfig = MotionCardOperationConfig.MovingOps.FirstOrDefault(u => u.MoveMode == EnumHelper.MotorMoveMode.FindOri);
            }
            //if (radioP2P.Checked)
            //{
            //    movingConfig = MotionCardOperationConfig.MovingOps.FirstOrDefault(u => u.MoveMode == EnumHelper.MotorMoveMode.Normal);
            //}
            //else if (radioJog.Checked)
            //{
            //    movingConfig = MotionCardOperationConfig.MovingOps.FirstOrDefault(u => u.MoveMode == EnumHelper.MotorMoveMode.Jog);
            //}
            //else if (radioGoHome.Checked)
            //{
            //    movingConfig = MotionCardOperationConfig.MovingOps.FirstOrDefault(u => u.MoveMode == EnumHelper.MotorMoveMode.FindOri);
            //}
            propGrid.SelectedObject = movingConfig;
        }