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); }
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()); } }
private void chkIncludeCases_CheckedChanged(object sender, EventArgs e) { // fill boxes combo ComboBoxHelpers.FillCombo(Boxes, cbBox, null == _analysis ? null : _analysis.BProperties); }