Ejemplo n.º 1
0
 public AnalysisCasePallet(
     Packable packable,
     PalletProperties palletProperties,
     ConstraintSetCasePallet constraintSet)
     : base(packable, palletProperties, constraintSet)
 {
 }
Ejemplo n.º 2
0
        static void Main(string[] args)
        {

            bool bestLayersOnly = true;
            Vector3D dimBox = new Vector3D(400.0, 300.0, 150.0);
            Vector2D dimContainer = new Vector2D(1200.0, 1000.0);
            ConstraintSetCasePallet constraintSet = new ConstraintSetCasePallet();
            constraintSet.SetMaxHeight(1200.0); 

            try
            {
                LayerSolver solver = new LayerSolver();
                List<Layer2D> layers = solver.BuildLayers(dimBox, dimContainer, constraintSet, bestLayersOnly);

                int solIndex = 0;
                foreach (Layer2D layer in layers)
                {
                    string fileName = string.Format("{0}_{1}.bmp", layer.Name, solIndex++);
                    string filePath = Path.Combine(Path.GetTempPath(), fileName);
                    Console.WriteLine(string.Format("Generating {0}...", filePath));

                    Graphics2DImage graphics = new Graphics2DImage( new Size(150, 150) );
                    SolutionViewerLayer solViewer = new SolutionViewerLayer(layer);
                    BoxProperties bProperties = new BoxProperties(null, 400.0, 300.0, 150.0);
                    bProperties.SetColor(Color.Brown);
                    solViewer.Draw(graphics, bProperties, 1500.0);
                    graphics.SaveAs(filePath);
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
        }
Ejemplo n.º 3
0
 public AnalysisCasePallet(
     Packable packable,
     PalletProperties palletProperties,
     ConstraintSetCasePallet constraintSet,
     bool temporary = false)
     : base(packable, palletProperties, constraintSet, temporary)
 {
 }
Ejemplo n.º 4
0
        public AnalysisCasePallet(
            BProperties bProperties, 
            PalletProperties palletProperties,
            ConstraintSetCasePallet constraintSet)
            : base(bProperties.ParentDocument)
        {
            // sanity checks
            if (palletProperties.ParentDocument != ParentDocument)
                throw new Exception("box & pallet do not belong to the same document");

            _bProperties = bProperties;
            _palletProperties = palletProperties;
            _constraintSet = constraintSet;
        }
        public AnalysisCasePallet(
            Packable packable,
            PalletProperties palletProperties,
            ConstraintSetCasePallet constraintSet)
            : base(packable.ParentDocument, packable)
        {
            // sanity checks
            if (palletProperties.ParentDocument != ParentDocument)
            {
                throw new Exception("box & pallet do not belong to the same document");
            }

            _palletProperties = palletProperties;
            _constraintSet    = constraintSet;
        }
 private ConstraintSetCasePallet BuildConstraintSet()
 {
     // constraint set
     ConstraintSetCasePallet constraintSet = new ConstraintSetCasePallet();
     // overhang
     constraintSet.Overhang = new Vector2D(uCtrlOverhang.ValueX, uCtrlOverhang.ValueY);
     // orientations
     constraintSet.SetAllowedOrientations(uCtrlCaseOrientation.AllowedOrientations);
     // conditions
     constraintSet.OptMaxHeight = uCtrlOptMaximumHeight.Value;
     constraintSet.OptMaxWeight = uCtrlOptMaximumWeight.Value;
     return constraintSet;
 }
Ejemplo n.º 7
0
        public AnalysisCasePallet CreateNewAnalysisCasePallet(
            string name, string description
            , BProperties box, PalletProperties pallet
            , List<InterlayerProperties> interlayers
            , PalletCornerProperties palletCorners, PalletCapProperties palletCap, PalletFilmProperties palletFilm
            , ConstraintSetCasePallet constraintSet
            , List<LayerDesc> layerDescs
            )
        {
            AnalysisCasePallet analysis = new AnalysisCasePallet(box, pallet, constraintSet);
            foreach (InterlayerProperties interlayer in interlayers)
                analysis.AddInterlayer(interlayer);
            analysis.PalletCornerProperties     = palletCorners;
            analysis.PalletCapProperties        = palletCap;
            analysis.PalletFilmProperties       = palletFilm;
            analysis.AddSolution(layerDescs);

            // notify listeners
            NotifyOnNewAnalysisCreated(analysis);
            Modify();

            return analysis;
        }