Ejemplo n.º 1
0
        public void Draw(Graphics3DControl ctrl, Graphics3D graphics)
        {
            StrapperSet.SetDimension(OuterDimensions);
            // build pack
            PackProperties packProperties = new PackProperties(
                null, SelectedBox, Arrangement, BoxOrientation, Wrapper)
            {
                StrapperSet = StrapperSet
            };

            if (uCtrlOuterDimensions.Checked)
            {
                packProperties.ForceOuterDimensions(
                    new Vector3D(uCtrlOuterDimensions.X, uCtrlOuterDimensions.Y, uCtrlOuterDimensions.Z));
            }
            Pack pack = new Pack(0, packProperties)
            {
                ForceTransparency = true
            };

            graphics.AddBox(pack);
            graphics.AddDimensions(new DimensionCube(Vector3D.Zero, pack.Length, pack.Width, pack.Height, Color.Black, true));
            if (packProperties.Wrap.Transparent)
            {
                graphics.AddDimensions(
                    new DimensionCube(
                        packProperties.InnerOffset
                        , packProperties.InnerLength, packProperties.InnerWidth, packProperties.InnerHeight
                        , Color.Red, false));
            }
        }
Ejemplo n.º 2
0
        private List <AnalysisLayered> PackOptimSolutions(ConstraintSetCasePallet constraintSet, int iNumber)
        {
            // TODO: better as IEnumerable<>?
            var analyses = new List <AnalysisLayered>();

            foreach (CaseDefinition caseDefinition in CaseDefinitions(iNumber))
            {
                try
                {
                    // build pack properties
                    Vector3D outerDimensions = caseDefinition.OuterDimensions(BoxProperties, ParamSetPackOpt);
                    var      packProperties  = new PackProperties(
                        null,
                        BoxProperties,
                        caseDefinition.Arrangement,
                        PackProperties.Orientation(caseDefinition.Dim0, caseDefinition.Dim1),
                        PackProperties.EnuRevSolidLayout.ALIGNED,
                        BuildWrapper(),
                        BuildTray()
                        );
                    packProperties.ForceOuterDimensions(outerDimensions);

                    // solver
                    var solver = new SolverCasePallet(packProperties, PalletProperties, constraintSet);
                    analyses.AddRange(solver.BuildAnalyses(false));
                }
                catch (Exception ex)
                {
                    _log.Error(ex.Message);
                }
            }
            // sort caseOptimSolution
            analyses.Sort(new AnalysisComparer());
            return(analyses);
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Creates a new PackProperties object
 /// </summary>
 public void CreateNewPackUI()
 {
     using (FormNewPack form = new FormNewPack(this, null)
     {
         Boxes = Boxes.ToList()
     })
     {
         if (DialogResult.OK == form.ShowDialog())
         {
             PackProperties packProperties = CreateNewPack(
                 form.ItemName, form.ItemDescription
                 , form.SelectedPackable
                 , form.Arrangement
                 , form.BoxOrientation, form.RevSolidLayout
                 , form.Wrapper
                 , form.Tray);
             if (form.HasForcedOuterDimensions)
             {
                 packProperties.ForceOuterDimensions(form.OuterDimensions);
             }
             packProperties.StrapperSet = form.StrapperSet;
             packProperties.Bulge       = form.Bulge;
         }
     }
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Creates a new PackProperties object
        /// </summary>
        public void CreateNewPackUI()
        {
            FormNewPack form = new FormNewPack(this, null);

            form.Boxes = Boxes;
            if (DialogResult.OK == form.ShowDialog())
            {
                PackProperties packProperties = CreateNewPack(
                    form.ItemName, form.ItemDescription
                    , form.SelectedBox
                    , form.Arrangement
                    , form.BoxOrientation
                    , form.Wrapper);
                if (form.HasForcedOuterDimensions)
                {
                    packProperties.ForceOuterDimensions(form.OuterDimensions);
                }
            }
        }