Exemplo n.º 1
0
        public HCylinderPalletAnalysis CreateNewHCylinderPalletAnalysisUI()
        {
            FormNewAnalysisHCylinder form = new FormNewAnalysisHCylinder(this);

            form.Cylinders = Cylinders.ToArray();
            form.Pallets   = Pallets.ToArray();

            if (DialogResult.OK == form.ShowDialog())
            {
                // build constraint set
                HCylinderPalletConstraintSet constraintSet = new HCylinderPalletConstraintSet();
                // stop criterion
                constraintSet.MaximumPalletHeight     = form.MaximumPalletHeight;
                constraintSet.UseMaximumPalletHeight  = form.UseMaximumPalletHeight;
                constraintSet.MaximumPalletWeight     = form.MaximumPalletWeight;
                constraintSet.UseMaximumPalletWeight  = form.UseMaximumPalletWeight;
                constraintSet.MaximumNumberOfItems    = form.MaximumNumberOfItems;
                constraintSet.UseMaximumNumberOfItems = form.UseMaximumNumberOfItems;
                constraintSet.SetAllowedPatterns(form.AllowPatternDefault, form.AllowPatternStaggered, form.AllowPatternColumn);
                constraintSet.RowSpacing = form.RowSpacing;

                return(CreateNewHCylinderPalletAnalysis(
                           form.AnalysisName, form.AnalysisDescription,
                           form.SelectedCylinder, form.SelectedPallet,
                           constraintSet,
                           new HCylinderSolver()));
            }
            return(null);
        }
Exemplo n.º 2
0
        public void EditHCylinderPalletAnalysis(HCylinderPalletAnalysis analysis)
        {
            bool recomputeRequired        = false;
            FormNewAnalysisHCylinder form = new FormNewAnalysisHCylinder(this, analysis);

            form.Cylinders = Cylinders.ToArray();
            form.Pallets   = Pallets.ToArray();

            if (recomputeRequired = (DialogResult.OK == form.ShowDialog()))
            {
                analysis.CylinderProperties = form.SelectedCylinder;
                analysis.PalletProperties   = form.SelectedPallet;
                // analysis name / description
                analysis.ID.SetNameDesc(form.AnalysisName, form.AnalysisDescription);
                // constraint set
                HCylinderPalletConstraintSet constraintSet = analysis.ConstraintSet;
                // overhang / underhang
                constraintSet.OverhangX = form.OverhangX;
                constraintSet.OverhangY = form.OverhangY;
                // stop criterions
                constraintSet.MaximumPalletHeight     = form.MaximumPalletHeight;
                constraintSet.UseMaximumPalletHeight  = form.UseMaximumPalletHeight;
                constraintSet.MaximumPalletWeight     = form.MaximumPalletWeight;
                constraintSet.UseMaximumPalletWeight  = form.UseMaximumPalletWeight;
                constraintSet.MaximumNumberOfItems    = form.MaximumNumberOfItems;
                constraintSet.UseMaximumNumberOfItems = form.UseMaximumNumberOfItems;
                // allowed patterns
                constraintSet.SetAllowedPatterns(form.AllowPatternDefault, form.AllowPatternStaggered, form.AllowPatternColumn);
                constraintSet.RowSpacing = form.RowSpacing;
            }
            if (recomputeRequired)
            {
                analysis.OnEndUpdate(null);
            }
        }
Exemplo n.º 3
0
 public HCylinderPalletAnalysis(
     CylinderProperties cylProperties,
     PalletProperties palletProperties,
     HCylinderPalletConstraintSet constraintSet)
     : base(cylProperties.ParentDocument)
 {
     CylinderProperties = cylProperties;
     PalletProperties   = palletProperties;
     _constraintSet     = constraintSet;
 }
Exemplo n.º 4
0
        public void ProcessAnalysis(HCylinderPalletAnalysis analysis)
        {
            _cylProperties    = analysis.CylinderProperties;
            _palletProperties = analysis.PalletProperties;
            _constraintSet    = analysis.ConstraintSet;
            if (!_constraintSet.IsValid)
            {
                throw new EngineException("Constraint set is invalid!");
            }

            analysis.Solutions = GenerateSolutions();
        }
Exemplo n.º 5
0
 public CylLoad(CylinderProperties cylProperties, PalletProperties palletProperties, HCylinderPalletConstraintSet constraintSet)
 {
     _palletLength = palletProperties.Length + constraintSet.OverhangX;
     _palletWidth  = palletProperties.Width + constraintSet.OverhangY;
     _palletHeight = palletProperties.Height;
     _rowSpacing   = constraintSet.RowSpacing;
     Initialize(cylProperties);
 }