Example #1
0
        private double DimensionX(Article article, SegmentClassification segmentClassification)
        {
            if (segmentClassification.IsArticleLinear())
            {
                string[] shapeList = segmentClassification.GetShapePointsList();
                if (shapeList.Length > 1)
                {
                    double saveValue = 0.0;
                    for (int i = 0; i <= shapeList.Length - 2; i++)
                    {
                        string[] points1 = shapeList[i].Split(KD.CharTools.Const.Comma);
                        string[] points2 = shapeList[i + 1].Split(KD.CharTools.Const.Comma);

                        for (int j = 0; j <= points1.Length - 2; j++)
                        {
                            double value = KD.StringTools.Convert.ToDouble(points1[j]) - KD.StringTools.Convert.ToDouble(points2[j]);
                            if (value > saveValue)
                            {
                                saveValue = value;
                            }
                        }
                    }
                    return(saveValue);
                }
            }
            return(article.DimensionX);
        }
Example #2
0
        public string Add(Article article)
        {
            SegmentClassification segmentClassification = new SegmentClassification(article);
            OrderInformations     articleInformations   = new OrderInformations(article, segmentClassification);
            string dataLine = null;

            if (articleInformations.IsOption_MEA(_fileEDI))
            {
                double dimX = this.DimensionX(article, segmentClassification);
                double dimY = article.DimensionY;
                double dimZ = article.DimensionZ;

                if (segmentClassification.IsArticleUnit() && (!segmentClassification.IsArticleSplashbackPanel() | !segmentClassification.IsArticleSplashbackPanel2()))
                {
                    dimY -= (OrderConstants.FrontDepth - 1);
                }

                if (segmentClassification.IsArticleSplashbackPanelShape() || segmentClassification.IsArticleSplashbackPanelShape2())
                {
                    double dimT = dimY;
                    dimY = dimZ;
                    dimZ = dimT;
                }

                List <double> dimensionList = new List <double>()
                {
                    dimX, dimY, dimZ
                };
                List <string> measureCodeList = new List <string>()
                {
                    MEA.Width, MEA.Depth, MEA.Height
                };
                int index = 0;

                foreach (double dimension in dimensionList)
                {
                    if (utility.IsDimensionValid(dimension))
                    {
                        OrderWrite.segmentNumberBetweenUNHandUNT += 1;
                        dataLine += StructureEDI.MEA + Separator.DataGroup + E6311 + c502.Add(measureCodeList[index]) + c174.Add(dimension) + Separator.EndLine;
                    }
                    index += 1;
                }
            }
            return(dataLine);
        }