领胜LDS 键盘AOI检测项目
patrick.xu
2021-01-24 b5e7fa2db4ac36fdb7bf9fd330d12a72ade9d483
src/Bro.M071.Process/M071Process_MotionCard.cs
@@ -17,7 +17,6 @@
    public partial class M071Process
    {
        public Timer ResetTimer = null;
        const int FULLRESETTIME = 5;
        object machineStateLock = new object();
        //MachineState _machineStatePre = MachineState.Unknown;
@@ -30,6 +29,7 @@
                if (machineState == value)
                    return;
                LogAsync(DateTime.Now, $"设备状态切换:{machineState.ToString()}->{value.ToString()}", "");
                machineState = value;
                Task.Run(() =>
@@ -233,7 +233,7 @@
            if (opConfig?.InputPara != null && opConfig.InputPara.Count > 0)
            {
                //大复位信号
                ResetTimer.Change(opConfig.InputPara[0] == 1 ? FULLRESETTIME * 1000 : -1, -1);
                ResetTimer.Change(opConfig.InputPara[0] == 1 ? Config.FullResetRequiredDuration * 1000 : -1, -1);
                if (opConfig.InputPara[0] == 0)
                    return new ProcessResponse(true);
@@ -250,15 +250,15 @@
            RaisedAlarm("");
            if (MachineState != MachineState.Pause)
            {
                MachineState = MachineState.Ready;
            }
            else
            {
                LogAsync(DateTime.Now, "设备暂停中,无法复位", "");
                return new ProcessResponse(true);
            }
            //if (MachineState != MachineState.Pause)
            //{
            MachineState = MachineState.Ready;
            //}
            //else
            //{
            //    LogAsync(DateTime.Now, "设备暂停中,无法复位", "");
            //    return new ProcessResponse(true);
            //}
            if (IsEmergencyStopped)
            {
@@ -302,8 +302,11 @@
            MachineState = MachineState.Resetting;
            MotionCardDefaultRun("FullReset", ref opConfig, ref invokeDevice);
            productionList.ForEach(u => u.Dispose());
            productionList.Clear();
            lock (productionLock)
            {
                productionList.ForEach(u => u.Dispose());
                productionList.Clear();
            }
            OnFullResetDone?.Invoke();