Esempio n. 1
0
        /// <summary>
        /// 判断当前轴运动是否是在PA 的安全 配置列表里面(pa.tag_AxisSafeManage.tag_AxisSafeList)  在返回TRUE
        /// </summary>
        /// <param name="_ac"></param>
        /// <param name="pa"></param>
        /// <returns></returns>
        public static bool isIOAxisHavePoint(AxisConfig _ac, PointAggregate pa, double pos)
        {
            int i = 0;

            if (pa == null || pa.tag_AxisSafeManage == null || pa.tag_AxisSafeManage.tag_AxisSafeList == null)
            {
                return(false);
            }
            while (i < pa.tag_AxisSafeManage.tag_AxisSafeList.Count)
            {
                AxisSafe currac = pa.tag_AxisSafeManage.tag_AxisSafeList[i];
                if ((int)_ac.tag_MotionCardManufacturer * 1000 + _ac.CardNum * 100 + _ac.AxisNum == currac.tag_AxisId)
                {
                    double poen_ac = 0.0;
                    NewCtrlCardV0.SR_GetPrfPos((int)_ac.tag_MotionCardManufacturer, _ac.CardNum, _ac.AxisNum, ref poen_ac);
                    //  if (i == 0)
                    {
                        poen_ac = poen_ac / _ac.Eucf;
                        if (poen_ac <= currac.tag_max && poen_ac >= currac.tag_min)
                        {
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                }
                i++;
            }
            return(false);
        }
Esempio n. 2
0
        /// <summary>
        /// 判断当前位置是否是本点的安全区 安全返回TRUE
        /// </summary>
        /// <returns></returns>
        public bool PointIsSafe(PointAggregate point)
        {
            foreach (StationModule sm in StationManage._Config.arrWorkStation)
            {
                foreach (AxisConfig ac in sm.arrAxis)
                {
                    AxisSafe asf = GetAxisSafe((short)ac.tag_MotionCardManufacturer, ac.CardNum, ac.AxisNum);
                    if (asf != null)
                    {
                        double poen_ac = 0;
                        NewCtrlCardV0.SR_GetPrfPos((int)ac.tag_MotionCardManufacturer, ac.CardNum, ac.AxisNum, ref poen_ac);
                        poen_ac = poen_ac / ac.Eucf;

                        if (!asf.IsSafe(poen_ac))
                        //if (!asf.IsSafe(ac.dblEncPos))
                        {
                            return(false);
                        }
                    }
                }
            }
            return(true);
        }