protected override void OnLoad(EventArgs e) { base.OnLoad(e); // Graphics3DControl graphCtrl.DrawingContainer = this; // list of packs ComboBoxHelpers.FillCombo(_boxes.ToArray(), cbInnerBox, null != _packProperties ? _packProperties.Box : _boxes[0]); // arrangement if (null != _packProperties) { cbDir.SelectedIndex = (int)(_packProperties.BoxOrientation); Arrangement = _packProperties.Arrangement; Wrapper = _packProperties.Wrap; uCtrlOuterDimensions.Checked = _packProperties.HasForcedOuterDimensions; OuterDimensions = _packProperties.OuterDimensions; } else { cbDir.SelectedIndex = 5; // HalfAxis.HAxis.AXIS_Z_P Arrangement = new PackArrangement(3, 2, 1); Wrapper = new WrapperPolyethilene(0.1, 0.010, Color.LightGray, true); uCtrlThickness.Value = UnitsManager.ConvertLengthFrom(0.1, UnitsManager.UnitSystem.UNIT_METRIC1); uCtrlHeight.Value = UnitsManager.ConvertLengthFrom(40, UnitsManager.UnitSystem.UNIT_METRIC1); } // disable Ok button UpdateStatus(string.Empty); }
private void FillLayerControls() { try { cbLayerType.Packable = _analysis.Content; // build layers and fill CCtrl foreach (LayerDesc layerDesc in _solution.LayerDescriptors) { LayerSolver solver = new LayerSolver(); Layer2D layer = solver.BuildLayer(_analysis.ContentDimensions, _analysis.ContainerDimensions, layerDesc as LayerDescBox); cbLayerType.Items.Add(layer); } if (cbLayerType.Items.Count > 0) { cbLayerType.SelectedIndex = 0; } // interlayer combo box Document doc = _document as Document; if (null == doc) { return; } ItemBase[] interlayers = doc.ListByType(typeof(InterlayerProperties)).ToArray(); ComboBoxHelpers.FillCombo(interlayers, cbInterlayer, null); } catch (Exception ex) { _log.Error(ex.Message); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); // initialize drawing container graphCtrlSolution.Viewer = new ViewerSolution(_solution); graphCtrlSolution.Invalidate(); graphCtrlSolution.VolumeSelected += onLayerSelected; FillLayerControls(); UpdateControls(); ComboBoxHelpers.FillCombo(PalletCorners, cbPalletCorners, null); chkbPalletCorners.Enabled = (cbPalletCorners.Items.Count > 0); ComboBoxHelpers.FillCombo(PalletCaps, cbPalletCap, null); chkbPalletCap.Enabled = (cbPalletCap.Items.Count > 0); ComboBoxHelpers.FillCombo(PalletFilms, cbPalletFilm, null); chkbPalletFilm.Enabled = (cbPalletFilm.Items.Count > 0); chkbPalletCorners.CheckedChanged += onPalletProtectionChanged; chkbPalletCap.CheckedChanged += onPalletProtectionChanged; chkbPalletFilm.CheckedChanged += onPalletProtectionChanged; cbPalletCorners.SelectedIndexChanged += onPalletProtectionChanged; cbPalletCap.SelectedIndexChanged += onPalletProtectionChanged; cbPalletFilm.SelectedIndexChanged += onPalletProtectionChanged; FillGrid(); UpdateGrid(); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); BoxProperties[] cases = _document.Cases.ToArray(); PalletProperties[] pallets = _document.Pallets.ToArray(); // fill combo boxes ComboBoxHelpers.FillCombo(cases, cbCases, (null != _analysis) ? _analysis.BProperties : cases[0]); ComboBoxHelpers.FillCombo(pallets, cbPallets, (null != _analysis) ? _analysis.PalletProperties : pallets[0]); uCtrlLayerList.LayerSelected += onLayerSelected; if (null == _analysis) { uCtrlCaseOrientation.AllowedOrientations = new bool[] { false, false, true }; uCtrlOptMaximumHeight.Value = new OptDouble(true, 1500.0); uCtrlOptMaximumWeight.Value = new OptDouble(true, 1000.0); uCtrlOverhang.ValueX = 0.0; uCtrlOverhang.ValueY = 0.0; checkBoxBestLayersOnly.Checked = true; } bnNext.Enabled = false; }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); // --- initialize drawing container graphCtrlSolution.Viewer = new ViewerSolution(_solution); graphCtrlSolution.Invalidate(); graphCtrlSolution.VolumeSelected += OnLayerSelected; // --- // --- initialize layer controls UpdateControls(); uCtrlMaxPalletHeight.Value = _analysis.ConstraintSet.OptMaxHeight.Value; uCtrlOptMaximumWeight.Value = _analysis.ConstraintSet.OptMaxWeight; uCtrlOptMaxNumber.Value = _analysis.ConstraintSet.OptMaxNumber; uCtrlMaxPalletHeight.ValueChanged += new UCtrlDouble.ValueChangedDelegate(OnCriterionChanged); uCtrlOptMaximumWeight.ValueChanged += new UCtrlOptDouble.ValueChangedDelegate(OnCriterionChanged); uCtrlOptMaxNumber.ValueChanged += new UCtrlOptInt.ValueChangedDelegate(OnCriterionChanged); AnalysisCasePallet analysisCasePallet = _analysis as AnalysisCasePallet; ComboBoxHelpers.FillCombo(PalletCorners, cbPalletCorners, analysisCasePallet?.PalletCornerProperties); chkbPalletCorners.Enabled = (cbPalletCorners.Items.Count > 0); ComboBoxHelpers.FillCombo(PalletCorners, cbPalletCornersTop, analysisCasePallet?.PalletCornerTopProperties); chkbPalletCornersTopX.Enabled = (cbPalletCornersTop.Items.Count > 0); ComboBoxHelpers.FillCombo(PalletCaps, cbPalletCap, analysisCasePallet?.PalletCapProperties); chkbPalletCap.Enabled = (cbPalletCap.Items.Count > 0); ComboBoxHelpers.FillCombo(PalletFilms, cbPalletFilm, analysisCasePallet?.PalletFilmProperties); chkbPalletFilm.Enabled = (cbPalletFilm.Items.Count > 0); chkbPalletCornersTopX.Enabled = (cbPalletCornersTop.Items.Count > 0); chkbPalletCornersTopY.Enabled = (cbPalletCornersTop.Items.Count > 0); if (null != analysisCasePallet) { chkbPalletCorners.Checked = null != analysisCasePallet.PalletCornerProperties; chkbPalletCornersTopX.Checked = null != analysisCasePallet.PalletCornerTopProperties && analysisCasePallet.PalletCornersTopX; chkbPalletCornersTopY.Checked = null != analysisCasePallet.PalletCornerTopProperties && analysisCasePallet.PalletCornersTopY; chkbPalletCap.Checked = null != analysisCasePallet.PalletCapProperties; chkbPalletFilm.Checked = null != analysisCasePallet.PalletFilmProperties; ctrlStrapperSet.StrapperSet = analysisCasePallet.StrapperSet; PalletFilmTopCovering = analysisCasePallet.PalletFilmTopCovering; } // --- // --- initialize grid control FillGrid(); UpdateGrid(); // --- _initialized = true; }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); ComboBoxHelpers.FillCombo(_packs, cbPack, (null != _analysis) ? _analysis.PackProperties : _packs[0]); ComboBoxHelpers.FillCombo(_pallets, cbPallet, (null != _analysis) ? _analysis.PalletProperties : _pallets[0]); ComboBoxHelpers.FillCombo(_interlayers, cbInterlayer, (null != _analysis ? _analysis.InterlayerProperties : (_interlayers.Length > 0 ? _interlayers[0] : null))); chkbInterlayer.Enabled = cbInterlayer.Items.Count > 0; chkbInterlayer.Checked = (null != _analysis) ? _analysis.HasInterlayer : false; PackPalletConstraintSet constraintSet = (null != _analysis) ? _analysis.ConstraintSet : null; if (null != constraintSet) { chkbInterlayerFirstLayer.Checked = constraintSet.HasFirstInterlayer; OverhangX = constraintSet.OverhangX; OverhangY = constraintSet.OverhangY; MinimumOverhangX = constraintSet.MinOverhangX; MinimumOverhangY = constraintSet.MinOverhangY; MaximumSpace = constraintSet.MaximumSpaceAllowed; MinimumSpace = constraintSet.MinimumSpace; MaximumPalletHeight = constraintSet.MaximumPalletHeight; MaximumPalletWeight = constraintSet.MaximumPalletWeight; MaximumLayerWeight = constraintSet.MaximumLayerWeight; } else { chkbInterlayerFirstLayer.Checked = false; OverhangX = Settings.Default.OverhangX; OverhangY = Settings.Default.OverhangY; MinimumOverhangX = OptDouble.Zero; MinimumOverhangY = OptDouble.Zero; MaximumSpace = OptDouble.Zero; MinimumSpace = OptDouble.Zero; MaximumPalletHeight = new OptDouble(true, UnitsManager.ConvertLengthFrom(1200.0, UnitsManager.UnitSystem.UNIT_METRIC1)); MaximumPalletWeight = new OptDouble(false, UnitsManager.ConvertMassFrom(1000.0, UnitsManager.UnitSystem.UNIT_METRIC1)); MaximumLayerWeight = new OptDouble(false, UnitsManager.ConvertMassFrom(100.0, UnitsManager.UnitSystem.UNIT_METRIC1)); } onInterlayerChecked(this, null); UpdateStatus(string.Empty); }
private void FormNewBoxCaseAnalysis_Load(object sender, EventArgs e) { try { // name / description if (null != _analysis) { tbName.Text = _analysis.Name; tbDescription.Text = _analysis.Description; BoxProperties boxProperties = _analysis.BProperties as BoxProperties; if (null != _analysis) { IncludeCaseAsBoxes = boxProperties.HasInsideDimensions; } } // fill boxes combo ComboBoxHelpers.FillCombo(Boxes, cbBox, null == _analysis ? null : _analysis.BProperties); // fill case properties ComboBoxHelpers.FillCombo(Cases, cbCase, null == _analysis ? null : _analysis.CaseProperties); // allowed position box + allowed patterns if (null == _analysis) { AllowVerticalX = Settings.Default.AllowVerticalX; AllowVerticalY = Settings.Default.AllowVerticalY; AllowVerticalZ = Settings.Default.AllowVerticalZ; IncludeCaseAsBoxes = Settings.Default.IncludeCaseAsBoxes; } else { BoxCaseConstraintSet constraintSet = _analysis.ConstraintSet as BoxCaseConstraintSet; if (null != constraintSet) { AllowVerticalX = constraintSet.AllowOrthoAxis(HalfAxis.HAxis.AXIS_X_N) || constraintSet.AllowOrthoAxis(HalfAxis.HAxis.AXIS_X_P); AllowVerticalY = constraintSet.AllowOrthoAxis(HalfAxis.HAxis.AXIS_Y_N) || constraintSet.AllowOrthoAxis(HalfAxis.HAxis.AXIS_Y_P); AllowVerticalZ = constraintSet.AllowOrthoAxis(HalfAxis.HAxis.AXIS_Z_N) || constraintSet.AllowOrthoAxis(HalfAxis.HAxis.AXIS_Z_P); } } } catch (Exception ex) { _log.Error(ex.ToString()); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); // --- window caption this.Text = _analysis.Name + " - " + _analysis.ParentDocument.Name; // --- initialize drawing container graphCtrlSolution.Viewer = new ViewerSolution(_solution); graphCtrlSolution.Invalidate(); graphCtrlSolution.VolumeSelected += onLayerSelected; // --- // --- initialize layer controls FillLayerControls(); UpdateControls(); uCtrlMaxPalletHeight.Value = _analysis.ConstraintSet.OptMaxHeight.Value; uCtrlOptMaximumWeight.Value = _analysis.ConstraintSet.OptMaxWeight; uCtrlMaxPalletHeight.ValueChanged += new treeDiM.StackBuilder.Basics.UCtrlDouble.onValueChanged(this.onCriterionChanged); uCtrlOptMaximumWeight.ValueChanged += new treeDiM.StackBuilder.Basics.UCtrlOptDouble.onValueChanged(this.onCriterionChanged); ComboBoxHelpers.FillCombo(PalletCorners, cbPalletCorners, null); chkbPalletCorners.Enabled = (cbPalletCorners.Items.Count > 0); ComboBoxHelpers.FillCombo(PalletCaps, cbPalletCap, null); chkbPalletCap.Enabled = (cbPalletCap.Items.Count > 0); ComboBoxHelpers.FillCombo(PalletFilms, cbPalletFilm, null); chkbPalletFilm.Enabled = (cbPalletFilm.Items.Count > 0); chkbPalletCorners.CheckedChanged += onPalletProtectionChanged; chkbPalletCap.CheckedChanged += onPalletProtectionChanged; chkbPalletFilm.CheckedChanged += onPalletProtectionChanged; cbPalletCorners.SelectedIndexChanged += onPalletProtectionChanged; cbPalletCap.SelectedIndexChanged += onPalletProtectionChanged; cbPalletFilm.SelectedIndexChanged += onPalletProtectionChanged; // --- // --- initialize grid control FillGrid(); UpdateGrid(); // --- }
private void FillLayerControls() { // layer combo box foreach (LayerDesc layerDesc in _solution.LayerDescriptors) { cbLayerType.Items.Add(layerDesc); } if (cbLayerType.Items.Count > 0) { cbLayerType.SelectedIndex = 0; } // interlayer combo box Document doc = _document as Document; if (null == doc) { return; } ItemBase[] interlayers = doc.ListByType(typeof(InterlayerProperties)).ToArray(); ComboBoxHelpers.FillCombo(interlayers, cbInterlater, null); }
private void chkIncludeCases_CheckedChanged(object sender, EventArgs e) { // fill boxes combo ComboBoxHelpers.FillCombo(Boxes, cbBox, null == _analysis ? null : _analysis.BProperties); }