コード例 #1
0
        private bool checkSafe()
        {
            StationAA   stationAA      = (StationAA)StationMgr.GetInstance().GetStation("AA站");
            StationDisp stationDisp    = (StationDisp)StationMgr.GetInstance().GetStation("点胶站");
            double      SafeHeightAA   = stationAA.GetStationPointDic()["安全位置"].pointZ;
            double      SafeHeightDisp = stationDisp.GetStationPointDic()["安全位置"].pointZ;
            double      getAAPos       = MotionMgr.GetInstace().GetAxisPos(stationAA.AxisZ);
            double      getDispPos     = MotionMgr.GetInstace().GetAxisPos(stationDisp.AxisZ);

            if (MotionMgr.GetInstace().GetHomeFinishFlag(stationAA.AxisZ) != AxisHomeFinishFlag.Homed || getAAPos < SafeHeightAA - 0.5)
            {
                if (GlobalVariable.g_StationState != StationState.StationStateRun)
                {
                    MessageBox.Show("转盘运动前,检查AA站Z轴没有回原点或者低于安全高度", "Err", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
                }
                return(false);
            }

            if (MotionMgr.GetInstace().GetHomeFinishFlag(stationDisp.AxisZ) != AxisHomeFinishFlag.Homed || getDispPos < SafeHeightDisp - 0.5)
            {
                if (GlobalVariable.g_StationState != StationState.StationStateRun)
                {
                    MessageBox.Show("转盘运动前,检查点胶站Z轴没有回原点或者低于吐胶点高度", "Err", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
                }
                return(false);
            }

            //if (!IOMgr.GetInstace().ReadIoInBit("A治具盖上检测"))
            if (!SysFunConfig.LodUnloadPatten.IsSafeWhenURun("A"))
            {
                MessageBox.Show("转盘运动前,检查A治具盖上检测失败!", "Err", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
                return(false);
            }

            // if (!IOMgr.GetInstace().ReadIoInBit("B治具盖上检测"))
            if (!SysFunConfig.LodUnloadPatten.IsSafeWhenURun("B"))
            {
                MessageBox.Show("转盘运动前,检查B治具盖上检测失败!", "Err", MessageBoxButtons.OK, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly);
                return(false);
            }

            Info($"安全位置检查成功,disp:{MotionMgr.GetInstace().GetAxisPos(stationDisp.AxisZ)}aa:{ MotionMgr.GetInstace().GetAxisPos(stationAA.AxisZ)}.");
            return(true);
        }
コード例 #2
0
ファイル: Safe.cs プロジェクト: susan4343/StandardMathineHY
        public static bool IsSafeWhenTableAxisMoveHandler(int nAxisNo, double currentpos, double dsstpos, MoveType moveType)
        {
            StationAA   stationAA      = (StationAA)StationMgr.GetInstance().GetStation("AA站");
            StationDisp stationDisp    = (StationDisp)StationMgr.GetInstance().GetStation("点胶站");
            double      SafeHeightAA   = stationAA.GetStationPointDic()["安全位置"].pointZ;
            double      SafeHeightDisp = stationDisp.GetStationPointDic()["安全位置"].pointZ;

            //  double SafeHeightDisp = stationDisp.GetStationPointDic()["安全位置"].pointZ;
            if (MotionMgr.GetInstace().GetAxisName(nAxisNo) == "U")
            {
                if (MotionMgr.GetInstace().GetHomeFinishFlag(stationAA.AxisZ) != AxisHomeFinishFlag.Homed || MotionMgr.GetInstace().GetAxisPos(stationAA.AxisZ) < SafeHeightAA - 0.5)
                {
                    if (GlobalVariable.g_StationState != StationState.StationStateRun)
                    {
                        MessageBox.Show("转盘运动前,检查AA站Z轴没有回原点或者低于安全高度", "Err", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    return(false);
                }

                if (MotionMgr.GetInstace().GetHomeFinishFlag(stationDisp.AxisZ) != AxisHomeFinishFlag.Homed || MotionMgr.GetInstace().GetAxisPos(stationDisp.AxisZ) < SafeHeightDisp - 1)
                {
                    if (GlobalVariable.g_StationState != StationState.StationStateRun)
                    {
                        MessageBox.Show("转盘运动前,检查点胶站Z轴没有回原点或者低于吐胶点高度", "Err", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    _logger.Error("转盘运动前,检查点胶站Z轴没有回原点或者低于吐胶点高度");
                    return(false);
                }

                if (ParamSetMgr.GetInstance().GetBoolParam("是否侧向UV") &&
                    (!IOMgr.GetInstace().ReadIoInBit("左侧UV原位") || !IOMgr.GetInstace().ReadIoInBit("左侧UV原位")))
                {
                    if (GlobalVariable.g_StationState != StationState.StationStateRun)
                    {
                        MessageBox.Show("转盘运动前,左右UV是否在原位", "Err", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    _logger.Error("转盘运动前,左右UV是否在原位");
                    return(false);
                }
            }
            return(true);
        }