Beispiel #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);
        }
Beispiel #2
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 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);
            }
        }
        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);
        }
        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;
        }