Пример #1
0
        public CylinderPalletAnalysis CreateNewCylinderPalletAnalysisUI()
        {
            FormNewAnalysisCylinder form = new FormNewAnalysisCylinder(this);

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

            if (DialogResult.OK == form.ShowDialog())
            {
                // build constraint set
                CylinderPalletConstraintSet constraintSet = new CylinderPalletConstraintSet();
                // interlayer period
                constraintSet.HasInterlayer         = form.HasInterlayer;
                constraintSet.InterlayerPeriod      = form.InterlayerPeriod;
                constraintSet.HasInterlayerAntiSlip = form.HasInterlayerAntiSlip;
                // stop criterion
                constraintSet.UseMaximumPalletHeight  = form.UseMaximumPalletHeight;
                constraintSet.MaximumPalletHeight     = form.MaximumPalletHeight;
                constraintSet.UseMaximumPalletWeight  = form.UseMaximumPalletWeight;
                constraintSet.MaximumPalletWeight     = form.MaximumPalletWeight;
                constraintSet.UseMaximumNumberOfItems = form.UseMaximumNumberOfItems;
                constraintSet.MaximumNumberOfItems    = form.MaximumNumberOfItems;

                return(CreateNewCylinderPalletAnalysis(form.AnalysisName, form.AnalysisDescription
                                                       , form.SelectedCylinder, form.SelectedPallet
                                                       , form.SelectedInterlayer, form.SelectedInterlayerAntiSlip
                                                       , constraintSet
                                                       , new CylinderSolver()));
            }
            return(null);
        }
Пример #2
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);
        }
Пример #3
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);
            }
        }
Пример #4
0
        public void EditCylinderPalletAnalysis(CylinderPalletAnalysis analysis)
        {
            bool recomputeRequired       = false;
            FormNewAnalysisCylinder form = new FormNewAnalysisCylinder(this, analysis);

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

            if (recomputeRequired = (DialogResult.OK == form.ShowDialog()))
            {
                analysis.CylinderProperties           = form.SelectedCylinder;
                analysis.PalletProperties             = form.SelectedPallet;
                analysis.InterlayerProperties         = form.SelectedInterlayer;
                analysis.InterlayerPropertiesAntiSlip = form.SelectedInterlayerAntiSlip;
                // analysis name / description
                analysis.Name        = form.AnalysisName;
                analysis.Description = form.AnalysisDescription;
                // constraint set
                CylinderPalletConstraintSet constraintSet = analysis.ConstraintSet;
                // interlayers
                constraintSet.HasInterlayer         = form.HasInterlayer;
                constraintSet.InterlayerPeriod      = form.InterlayerPeriod;
                constraintSet.HasInterlayerAntiSlip = form.HasInterlayerAntiSlip;
                // overhang / underhang
                constraintSet.OverhangX = form.OverhangX;
                constraintSet.OverhangY = form.OverhangY;
                // stop criterions
                constraintSet.UseMaximumPalletHeight        = form.UseMaximumPalletHeight;
                constraintSet.MaximumPalletHeight           = form.MaximumPalletHeight;
                constraintSet.UseMaximumPalletWeight        = form.UseMaximumPalletWeight;
                constraintSet.MaximumPalletWeight           = form.MaximumPalletWeight;
                constraintSet.UseMaximumNumberOfItems       = form.UseMaximumNumberOfItems;
                constraintSet.MaximumNumberOfItems          = form.MaximumNumberOfItems;
                constraintSet.UseMaximumLoadOnLowerCylinder = form.UseMaximumLoadOnLowerCylinder;
                constraintSet.MaximumLoadOnLowerCylinder    = form.MaximumLoadOnLowerCylinder;
            }
            if (recomputeRequired)
            {
                analysis.OnEndUpdate(null);
            }
        }