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); }
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); }
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); } }
public void EditPackPalletAnalsyis(PackPalletAnalysis analysis) { // do we need to recompute analysis bool recomputeRequired = false; FormNewAnalysisPackPallet form = new FormNewAnalysisPackPallet(this, analysis); form.Packs = ListByType(typeof(PackProperties)).ToArray(); form.Pallets = Pallets.ToArray(); form.Interlayers = ListByType(typeof(InterlayerProperties)).ToArray(); if (recomputeRequired = (DialogResult.OK == form.ShowDialog())) { // analysis name / description analysis.Name = form.ItemName; analysis.Description = form.ItemDescription; // analysis pack / pallet /interlayer analysis.PackProperties = form.PackProperties; analysis.PalletProperties = form.PalletProperties; analysis.InterlayerProperties = form.InterlayerProperties; // constraint set PackPalletConstraintSet constraintSet = analysis.ConstraintSet; constraintSet.OverhangX = form.OverhangX; constraintSet.OverhangY = form.OverhangY; constraintSet.MinOverhangX = form.MinimumOverhangX; constraintSet.MinOverhangY = form.MinimumOverhangY; constraintSet.MinimumSpace = form.MinimumSpace; constraintSet.MaximumSpaceAllowed = form.MaximumSpace; constraintSet.LayerSwapPeriod = form.LayerSwapPeriod; constraintSet.InterlayerPeriod = form.InterlayerPeriod; constraintSet.HasFirstInterlayer = form.HasFirstInterlayer; // stop criterions constraintSet.MaximumPalletHeight = form.MaximumPalletHeight; constraintSet.MaximumPalletWeight = form.MaximumPalletWeight; } if (recomputeRequired) { analysis.OnEndUpdate(null); if (analysis.Solutions.Count < 1) { MessageBox.Show(Properties.Resources.ID_ANALYSISHASNOSOLUTION, Application.ProductName, MessageBoxButtons.OK); } } }
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); } }
/// <summary> /// Creates a new bundle analysis /// </summary> /// <returns>created bundle analysis</returns> public CasePalletAnalysis CreateNewBundlePalletAnalysisUI() { FormNewAnalysisBundle form = new FormNewAnalysisBundle(this, null); form.Boxes = Bundles.ToArray(); form.Pallets = Pallets.ToArray(); if (DialogResult.OK == form.ShowDialog()) { // build constraintSet BundlePalletConstraintSet constraintSet = new BundlePalletConstraintSet(); // overhang / underhang constraintSet.OverhangX = form.OverhangX; constraintSet.OverhangY = form.OverhangY; // allowed patterns foreach (string s in form.AllowedPatterns) { constraintSet.SetAllowedPattern(s); } // allow aligned / alternate layer constraintSet.AllowAlternateLayers = form.AllowAlternateLayers; constraintSet.AllowAlignedLayers = form.AllowAlignedLayers; // stop criterion constraintSet.UseMaximumHeight = form.UseMaximumPalletHeight; constraintSet.UseMaximumNumberOfCases = form.UseMaximumNumberOfBoxes; constraintSet.UseMaximumPalletWeight = form.UseMaximumPalletWeight; constraintSet.MaximumHeight = form.MaximumPalletHeight; constraintSet.MaximumNumberOfItems = form.MaximumNumberOfBoxes; constraintSet.MaximumPalletWeight = form.MaximumPalletWeight; return(CreateNewCasePalletAnalysis(form.ItemName, form.ItemDescription, form.SelectedBundle, form.SelectedPallet, null, null, null, null, null, constraintSet, new CasePalletSolver())); } return(null); }
/// <summary> /// Edit specified pallet analysis /// </summary> /// <param name="analysis"></param> public void EditCasePalletAnalysis(CasePalletAnalysis analysis) { // do we need to recompute analysis bool recomputeRequired = false; if (analysis.IsBoxAnalysis) { FormNewAnalysisLegacy form = new FormNewAnalysisLegacy(this, analysis); form.Cases = Cases.ToArray(); form.Pallets = Pallets.ToArray(); form.Interlayers = Interlayers.ToArray(); form.PalletCorners = ListByType(typeof(PalletCornerProperties)).ToArray(); form.PalletCaps = ListByType(typeof(PalletCapProperties)).ToArray(); form.PalletFilms = ListByType(typeof(PalletFilmProperties)).ToArray(); if (recomputeRequired = (DialogResult.OK == form.ShowDialog())) { // analysis name / description analysis.Name = form.AnalysisName; analysis.Description = form.AnalysisDescription; // box / palet / interlayer analysis.BProperties = form.SelectedBox; analysis.PalletProperties = form.SelectedPallet; analysis.InterlayerProperties = form.SelectedInterlayer; analysis.InterlayerPropertiesAntiSlip = form.SelectedInterlayerAntiSlip; // build constraint set CasePalletConstraintSet constraintSet = analysis.ConstraintSet as CasePalletConstraintSet; // overhang / underhang constraintSet.OverhangX = form.OverhangX; constraintSet.OverhangY = form.OverhangY; // allowed axes constraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_X_N, form.AllowVerticalX); constraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_X_P, form.AllowVerticalX); constraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_Y_N, form.AllowVerticalY); constraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_Y_P, form.AllowVerticalY); constraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_Z_N, form.AllowVerticalZ); constraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_Z_P, form.AllowVerticalZ); // allowed dir change constraintSet.AllowTwoLayerOrientations = form.AllowTwoLayerOrientations; constraintSet.AllowLastLayerOrientationChange = form.AllowLastLayerOrientationChange; // allowed patterns constraintSet.ClearAllowedPatterns(); foreach (string s in form.AllowedPatterns) { constraintSet.SetAllowedPattern(s); } // allow alternate layer constraintSet.AllowAlternateLayers = form.AllowAlternateLayers; constraintSet.AllowAlignedLayers = form.AllowAlignedLayers; // interlayers constraintSet.HasInterlayer = form.HasInterlayers; constraintSet.InterlayerPeriod = form.InterlayerPeriod; constraintSet.HasInterlayerAntiSlip = form.HasInterlayerAntiSlip; // pallet corner analysis.PalletCornerProperties = form.SelectedPalletCorners; // pallet cap analysis.PalletCapProperties = form.SelectedPalletCap; // pallet film analysis.PalletFilmProperties = form.SelectedPalletFilm; // stop criterion constraintSet.UseMaximumHeight = form.UseMaximumPalletHeight; constraintSet.UseMaximumNumberOfCases = form.UseMaximumNumberOfBoxes; constraintSet.UseMaximumPalletWeight = form.UseMaximumPalletWeight; constraintSet.UseMaximumWeightOnBox = form.UseMaximumLoadOnBox; constraintSet.MaximumHeight = form.MaximumPalletHeight; constraintSet.MaximumNumberOfItems = form.MaximumNumberOfBoxes; constraintSet.MaximumPalletWeight = form.MaximumPalletWeight; constraintSet.MaximumWeightOnBox = form.MaximumLoadOnBox; // number of solution kept constraintSet.UseNumberOfSolutionsKept = Properties.Settings.Default.KeepBestSolutions; if (constraintSet.UseNumberOfSolutionsKept) { constraintSet.NumberOfSolutionsKept = Properties.Settings.Default.NoSolutionsToKeep; } // pallet film turns constraintSet.PalletFilmTurns = form.PalletFilmTurns; } } else if (analysis.IsBundleAnalysis) { FormNewAnalysisBundle form = new FormNewAnalysisBundle(this, analysis); form.Boxes = Bundles.ToArray(); form.Pallets = Pallets.ToArray(); if (recomputeRequired = (DialogResult.OK == form.ShowDialog())) { // analysis name / description analysis.Name = form.ItemName; analysis.Description = form.ItemDescription; // analysis bundle / pallet analysis.BProperties = form.SelectedBundle; analysis.PalletProperties = form.SelectedPallet; // build constraintSet BundlePalletConstraintSet constraintSet = analysis.ConstraintSet as BundlePalletConstraintSet; // overhang / underhang constraintSet.OverhangX = form.OverhangX; constraintSet.OverhangY = form.OverhangY; // allowed patterns constraintSet.ClearAllowedPatterns(); foreach (string s in form.AllowedPatterns) { constraintSet.SetAllowedPattern(s); } // allow aligned / alternate layer constraintSet.AllowAlternateLayers = form.AllowAlternateLayers; constraintSet.AllowAlignedLayers = form.AllowAlignedLayers; // stop criterions constraintSet.UseMaximumHeight = form.UseMaximumPalletHeight; constraintSet.UseMaximumNumberOfCases = form.UseMaximumNumberOfBoxes; constraintSet.UseMaximumPalletWeight = form.UseMaximumPalletWeight; constraintSet.MaximumHeight = form.MaximumPalletHeight; constraintSet.MaximumNumberOfItems = form.MaximumNumberOfBoxes; constraintSet.MaximumPalletWeight = form.MaximumPalletWeight; } } if (recomputeRequired) { analysis.OnEndUpdate(null); } }
/// <summary> /// Creates a new palet analysis /// </summary> /// <returns>created palet analysis</returns> public CasePalletAnalysis CreateNewCasePalletAnalysisUI() { if (!CanCreateCasePalletAnalysis) { return(null); } FormNewAnalysis form = new FormNewAnalysis(this); form.Cases = Cases.ToArray(); form.Pallets = Pallets.ToArray(); form.Interlayers = Interlayers.ToArray(); form.PalletCorners = ListByType(typeof(PalletCornerProperties)).ToArray(); form.PalletCaps = ListByType(typeof(PalletCapProperties)).ToArray(); form.PalletFilms = ListByType(typeof(PalletFilmProperties)).ToArray(); if (DialogResult.OK == form.ShowDialog()) { // build constraint set CasePalletConstraintSet constraintSet = new CasePalletConstraintSet(); // overhang / underhang constraintSet.OverhangX = form.OverhangX; constraintSet.OverhangY = form.OverhangY; // allowed axes constraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_X_N, form.AllowVerticalX); constraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_X_P, form.AllowVerticalX); constraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_Y_N, form.AllowVerticalY); constraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_Y_P, form.AllowVerticalY); constraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_Z_N, form.AllowVerticalZ); constraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_Z_P, form.AllowVerticalZ); // allowed patterns constraintSet.ClearAllowedPatterns(); foreach (string s in form.AllowedPatterns) { constraintSet.SetAllowedPattern(s); } // allow alternate layer constraintSet.AllowAlternateLayers = form.AllowAlternateLayers; constraintSet.AllowAlignedLayers = form.AllowAlignedLayers; // interlayers constraintSet.HasInterlayer = form.HasInterlayers; constraintSet.InterlayerPeriod = form.InterlayerPeriod; constraintSet.HasInterlayerAntiSlip = form.HasInterlayerAntiSlip; // stop criterion constraintSet.UseMaximumHeight = form.UseMaximumPalletHeight; constraintSet.UseMaximumNumberOfCases = form.UseMaximumNumberOfBoxes; constraintSet.UseMaximumPalletWeight = form.UseMaximumPalletWeight; constraintSet.UseMaximumWeightOnBox = form.UseMaximumLoadOnBox; constraintSet.MaximumHeight = form.MaximumPalletHeight; constraintSet.MaximumNumberOfItems = form.MaximumNumberOfBoxes; constraintSet.MaximumPalletWeight = form.MaximumPalletWeight; constraintSet.MaximumWeightOnBox = form.MaximumLoadOnBox; // number of solution kept constraintSet.UseNumberOfSolutionsKept = Properties.Settings.Default.KeepBestSolutions; if (constraintSet.UseNumberOfSolutionsKept) { constraintSet.NumberOfSolutionsKept = Properties.Settings.Default.NoSolutionsToKeep; } // number of pallet film turns constraintSet.PalletFilmTurns = form.PalletFilmTurns; return(CreateNewCasePalletAnalysis( form.AnalysisName, form.AnalysisDescription, form.SelectedBox, form.SelectedPallet, form.SelectedInterlayer, form.SelectedInterlayerAntiSlip, form.SelectedPalletCorners, form.SelectedPalletCap, form.SelectedPalletFilm, constraintSet, new CasePalletSolver())); } return(null); }