Exemplo n.º 1
0
 /// <summary>
 /// 添加运动控制板卡
 /// </summary>
 /// <param name="nType">板卡类型</param>
 /// <param name="nMaxAxisNUm">板卡最大支持轴数</param>
 /// <returns></returns>
 public bool AddMotionCard(MOTION_TYPE nType, short nMaxAxisNUm)
 {
     //向该类链表_LIST_MOTION_WORK添加新的对象
     _LIST_MOTION_WORK.Add(CMotionWorkChristmas.GetInstance(nType, nMaxAxisNUm, m_uCardIndex));
     //卡号索引加一
     m_uCardIndex++;
     return(true);
 }
Exemplo n.º 2
0
    public void SetMode(MOTION_TYPE mode)
    {
        if (mode == _curMode)
        {
            return;
        }

        _curMode = mode;
    }
Exemplo n.º 3
0
        /// <summary>
        ///     单例初始化
        /// </summary>
        /// <param name="nType">运动控制板卡类型</param>
        /// <param name="nAxisNum">最大轴数,最大8</param>
        /// <param name="nCardNum">卡号</param>
        /// <returns></returns>
        public static CMotionWorkChristmas GetInstance(MOTION_TYPE nType, short nAxisNum, short nCardNum)
        {
            if (_LIST_MOTION_WORKING.Count > nCardNum)
                if (_LIST_MOTION_WORKING[nCardNum] != null)
                    return _LIST_MOTION_WORKING[nCardNum];

            lock (_LOCK)
            {
                switch (nType)
                {
                    case (short) MOTION_TYPE.GTS_MOTION: //固高
                        _MOTION_BASE = new CGtMotion(nAxisNum);
                        break;
                    default: //默认固高
                        _MOTION_BASE = new CGtMotion(nAxisNum);
                        break;
                }

                //if (_LIST_MOTION_WORKING[nCardNum] == null) _LIST_MOTION_WORKING[nCardNum] = new CMotionWorkChristmas(_MOTION_BASE, nCardNum);
                if (!(_LIST_MOTION_WORKING.Count > nCardNum))
                    _LIST_MOTION_WORKING.Add(new CMotionWorkChristmas(_MOTION_BASE, nCardNum));
                return _LIST_MOTION_WORKING[nCardNum];
            }
        }