Пример #1
0
                public PosInf Clone()
                {
                    PosInf posInf = new PosInf();

                    posInf.Pos       = Pos.Clone();
                    posInf.idx       = idx;
                    posInf.Row       = Row;
                    posInf.Col       = Col;
                    posInf.isEmpty   = isEmpty;
                    posInf.isDisable = isDisable;
                    posInf.rect      = new Rectangle(rect.X, rect.Y, rect.Width, rect.Height);
                    posInf.md        = md.Clone();
                    return(posInf);
                }
Пример #2
0
            /// <summary>
            /// 放置模组到指定位置
            /// </summary>
            /// <param name="md">要放置的模组</param>
            /// <param name="idx">指定位置</param>
            /// <returns></returns>
            public EM_RES Push(MdDat md, int idx = -1)
            {
                //获取空位置
                List <PosInf> ls_pos = GetPosList(EM_CM_RES.EMPTY, md.res);

                if (ls_pos == null || ls_pos.Count == 0)
                {
                    return(EM_RES.PARA_OUTOFRANG);
                }
                //如果指定位置
                if (idx != -1)
                {
                    idx = ls_pos.FindIndex(s => { return(s.idx == idx); });
                }
                else
                {
                    idx = 0;
                }
                if (idx < 0 || idx >= ls_pos.Count)
                {
                    return(EM_RES.PARA_OUTOFRANG);
                }

                //push
                md.idx                   = idx;
                md.pos                   = ls_pos.ElementAt(idx).Pos;
                md.tray_barcode          = barcode;
                ls_pos.ElementAt(idx).md = md.Clone();

                //最后一个返回END
                if (list_pos.Count == 1)
                {
                    return(EM_RES.END);
                }
                else
                {
                    return(EM_RES.OK);
                }
            }