Beispiel #1
0
        public decimal GetRatio(Rectange Big)
        {
            decimal s1, s2;

            s1 = Width * Length * Kaidu;
            s2 = Big.Length * Big.Width;
            return(decimal.Round(s1 / s2, 4));
        }
Beispiel #2
0
        public Rectange GetPaperRect()
        {
            PaperTreeNode pt  = this;
            PaperTreeNode pt1 = this;

            while (pt != null)
            {
                pt1 = pt;
                pt  = pt.Root;
            }
            Rectange result = new Rectange(pt1.Len, pt1.Width);

            result.Name = EnumHelper.GetEnumName <CutModeMenu>((int)CutMode) + pt1.Kaidu.ToString() + "开";
            result.Id   = 0;
            return(result);
        }
Beispiel #3
0
        public Rectange GetPsRect()
        {
            PaperTreeNode pt  = this;
            PaperTreeNode pt1 = this;

            while (pt.Root != null)
            {
                pt1 = pt;
                pt  = pt.Root;
            }
            Rectange result = new Rectange(pt1.Len, pt1.Width);

            result.Name = "上机尺寸:" + pt1.Kaidu.ToString() + "开";
            result.Id   = 0;
            return(result);
        }
Beispiel #4
0
        public Rectange Node2Rect()
        {
            Rectange result = new Rectange(Len, Width);

            result.Name = EnumHelper.GetEnumName <CutModeMenu>((int)(CutMode));
            if (result == Common.BigPaper)
            {
                result.Name = "大规纸";
            }
            if (result == Common.SmallPaper)
            {
                result.Name = "正规规纸";
            }
            result.Id    = 0;
            result.Kaidu = Kaidu;
            return(result);
        }
Beispiel #5
0
        public List <PaperTreeNode> GetCutList(int l, int h)
        {
            Rectange      rect  = new Rectange(l, h);
            PaperTreeNode big   = GetFitSize(l, h, AllBig);
            PaperTreeNode small = GetFitSize(l, h, AllSmall);

            List <Model.PaperTreeNode> list = big.GetCutRouter();
            decimal r = GetPaperRation(l, h, list);

            List <Model.PaperTreeNode> list2 = small.GetCutRouter();
            decimal r1 = GetPaperRation(l, h, list2);

            if (r > r1)
            {
                return(list);
            }
            else
            {
                return(list2);
            }
        }
Beispiel #6
0
 public PaperTreeNode(Rectange paper) : this(7, paper.Length, paper.Width, null, 1)
 {
 }