Пример #1
0
        /// <summary>
        /// ADAM输入信号
        /// </summary>
        /// <param name="sensor"></param>
        private void Adam_OnSensorTrigger(EnumSensor sensor)
        {
            Debug.WriteLine($"ADAM输入信号: {sensor}");
            Log.Information($"[开关触发]:{sensor}");
            switch (sensor)
            {
            case EnumSensor.ToStation:    //进位
                if (currentTag == null)
                {
                    adam.AlarmWarning(true);
                    ViewModels.FirstOrDefault().EngineCode = "请补充扫描发动机码";
                    Log.Warning("车辆进位检测到RFID漏读!");
                }
                else if (currentTag.EngineCode == appConfig.NullCode)
                {
                    ViewModels.FirstOrDefault().EngineCode = "空吊具";
                    Log.Information("进入一台空吊具.");
                }
                break;

            case EnumSensor.OutStation:    //限位
                if (currentTag != null)
                {
                    lastCode = currentTag.EngineCode;
                }
                currentTag = null;
                Task.Run(() => CheckTighenResult());
                break;

            default:
                break;
            }
        }
Пример #2
0
        /// <summary>
        /// 开关信号触发事件
        /// </summary>
        /// <param name="sensor"></param>
        private void Adam_OnSensorTrigger(EnumSensor sensor)
        {
            switch (sensor)
            {
            case EnumSensor.OutStation:
                Task.Run(() => EngineOutStation());
                break;

            case EnumSensor.Reset:
                if (_screenConfig.Id == 0)
                {
                    if (ViewModel.StopLine)
                    {
                        Invoke(new Action(() =>
                        {
                            //刷卡
                            if (frmAuthor != null && frmAuthor.Visible)
                            {
                                frmAuthor.Dispose();
                            }
                            frmAuthor = new FormAuthor(AuthorType.放行, card =>
                            {
                                if (card != null)
                                {
                                    opc.NoPass(false);
                                }
                            });
                            frmAuthor.Show(this);
                        }));
                    }
                }
                break;

            default:
                break;
            }
        }