public FormNewInterlayer(Document document, InterlayerProperties interlayerProperties) : base(document, interlayerProperties) { InitializeComponent(); // initialize value if (null != interlayerProperties) { InterlayerLength = interlayerProperties.Length; InterlayerWidth = interlayerProperties.Width; Thickness = interlayerProperties.Thickness; Weight = interlayerProperties.Weight; Color = interlayerProperties.Color; } else { // initialize value InterlayerLength = UnitsManager.ConvertLengthFrom(1200.0, UnitsManager.UnitSystem.UNIT_METRIC1); InterlayerWidth = UnitsManager.ConvertLengthFrom(1000.0, UnitsManager.UnitSystem.UNIT_METRIC1); Thickness = UnitsManager.ConvertLengthFrom(1.0, UnitsManager.UnitSystem.UNIT_METRIC1); Weight = UnitsManager.ConvertMassFrom(1.0, UnitsManager.UnitSystem.UNIT_METRIC1); Color = Color.Beige; } // disable Ok button UpdateStatus(string.Empty); // units UnitsManager.AdaptUnitLabels(this); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); try { // show case in uCtrlCaseOrientation if (!(Globals.StackBuilderAddIn.Application.ActiveSheet is Excel.Worksheet xlSheet)) { return; } var caseLength = ReadDouble(xlSheet, Settings.Default.CellCaseLength, Resources.ID_CASE_LENGTH); var caseWidth = ReadDouble(xlSheet, Settings.Default.CellCaseWidth, Resources.ID_CASE_WIDTH); var caseHeight = ReadDouble(xlSheet, Settings.Default.CellCaseHeight, Resources.ID_CASE_HEIGHT); var bProperties = new BoxProperties(null, caseLength, caseWidth, caseHeight); bProperties.SetColor(Color.Chocolate); bProperties.TapeWidth = new OptDouble(true, UnitsManager.ConvertLengthFrom(50.0, UnitsManager.UnitSystem.UNIT_METRIC1)); bProperties.TapeColor = Color.Beige; uCtrlCaseOrientation.BProperties = bProperties; } catch (Exception ex) { Console.WriteLine(ex.ToString()); } }
public FormNewPalletCap(Document document, PalletCapProperties capProperties) : base(document, capProperties) { InitializeComponent(); // units UnitsManager.AdaptUnitLabels(this); if (null != capProperties) { CapLength = capProperties.Length; CapWidth = capProperties.Width; CapHeight = capProperties.Height; CapInnerLength = capProperties.InsideLength; CapInnerWidth = capProperties.InsideWidth; CapInnerHeight = capProperties.InsideHeight; CapWeight = capProperties.Weight; CapColor = capProperties.Color; } else { CapLength = UnitsManager.ConvertLengthFrom(1200.0, UnitsManager.UnitSystem.UNIT_METRIC1); CapWidth = UnitsManager.ConvertLengthFrom(1000.0, UnitsManager.UnitSystem.UNIT_METRIC1); CapHeight = UnitsManager.ConvertLengthFrom(50.0, UnitsManager.UnitSystem.UNIT_METRIC1); CapWeight = UnitsManager.ConvertSurfaceMassFrom(0.5, UnitsManager.UnitSystem.UNIT_METRIC1); CapColor = Color.Khaki; } UpdateStatus(string.Empty); }
public FormNewCylinder(Document document, CylinderProperties cylinder) : base(document, cylinder) { InitializeComponent(); // properties if (null != cylinder) { uCtrlDiameterOuter.Value = 2.0 * cylinder.RadiusOuter; uCtrlDiameterInner.Value = 2.0 * cylinder.RadiusInner; uCtrlHeight.Value = cylinder.Height; uCtrlWeight.Value = cylinder.Weight; cbColorWallOuter.Color = cylinder.ColorWallOuter; cbColorWallInner.Color = cylinder.ColorWallInner; cbColorTop.Color = cylinder.ColorTop; } else { uCtrlDiameterOuter.Value = UnitsManager.ConvertLengthFrom(2.0 * 75.0, UnitsManager.UnitSystem.UNIT_METRIC1); uCtrlDiameterInner.Value = UnitsManager.ConvertLengthFrom(0.0, UnitsManager.UnitSystem.UNIT_METRIC1); uCtrlHeight.Value = UnitsManager.ConvertLengthFrom(150.0, UnitsManager.UnitSystem.UNIT_METRIC1); uCtrlWeight.Value = UnitsManager.ConvertMassFrom(1.0, UnitsManager.UnitSystem.UNIT_METRIC1); cbColorWallOuter.Color = System.Drawing.Color.LightSkyBlue; cbColorWallInner.Color = System.Drawing.Color.Chocolate; cbColorTop.Color = System.Drawing.Color.Gray; } // disable Ok button UpdateStatus(string.Empty); // units UnitsManager.AdaptUnitLabels(this); }
public FormNewPalletFilm(Document doc, PalletFilmProperties item) : base(doc, item) { InitializeComponent(); if (null != item) { chkbTransparency.Checked = item.UseTransparency; chkbHatching.Checked = item.UseHatching; HatchSpacing = UnitsManager.ConvertLengthFrom(item.HatchSpacing, UnitsManager.UnitSystem.UNIT_METRIC1); HatchAngle = item.HatchAngle; FilmColor = item.Color; Weight = item.Weight; } else { chkbTransparency.Checked = true; chkbHatching.Checked = true; HatchSpacing = UnitsManager.ConvertLengthFrom(150.0, UnitsManager.UnitSystem.UNIT_METRIC1); HatchAngle = 45.0; FilmColor = Color.LightSkyBlue; } OnChkbHatchingCheckedChanged(this, null); UpdateStatus(string.Empty); // units UnitsManager.AdaptUnitLabels(this); }
public FormNewBag(Document document, BagProperties bag) : base(document, bag) { InitializeComponent(); if (DesignMode) { return; } // properties if (null != bag) { uCtrlOuterDimensions.ValueX = bag.Length; uCtrlOuterDimensions.ValueY = bag.Width; uCtrlOuterDimensions.ValueZ = bag.Height; uCtrlRadius.Value = bag.Radius; uCtrlWeight.Value = bag.Weight; uCtrlNetWeight.Value = bag.NetWeight; cbColor.Color = bag.ColorFill; } else { uCtrlOuterDimensions.ValueX = UnitsManager.ConvertLengthFrom(400.0, UnitsManager.UnitSystem.UNIT_METRIC1); uCtrlOuterDimensions.ValueY = UnitsManager.ConvertLengthFrom(300.0, UnitsManager.UnitSystem.UNIT_METRIC1); uCtrlOuterDimensions.ValueZ = UnitsManager.ConvertLengthFrom(100.0, UnitsManager.UnitSystem.UNIT_METRIC1); uCtrlRadius.Value = UnitsManager.ConvertLengthFrom(40.0, UnitsManager.UnitSystem.UNIT_METRIC1); uCtrlWeight.Value = UnitsManager.ConvertMassFrom(1.0, UnitsManager.UnitSystem.UNIT_METRIC1); uCtrlNetWeight.Value = OptDouble.Zero; cbColor.Color = Color.Beige; } // units UnitsManager.AdaptUnitLabels(this); }
private void FillPalletList() { int rangeIndex = 0; int numberOfItems = 0; using (WCFClient wcfClient = new WCFClient()) { do { DCSBPallet[] dcsbPallets = wcfClient.Client.GetAllPallets(rangeIndex++, ref numberOfItems); foreach (var dcsbPallet in dcsbPallets) { UnitsManager.UnitSystem us = (UnitsManager.UnitSystem)dcsbPallet.UnitSystem; var palletProperties = new PalletProperties(null, dcsbPallet.PalletType, UnitsManager.ConvertLengthFrom(dcsbPallet.Dimensions.M0, us), UnitsManager.ConvertLengthFrom(dcsbPallet.Dimensions.M1, us), UnitsManager.ConvertLengthFrom(dcsbPallet.Dimensions.M2, us) ) { Color = Color.FromArgb(dcsbPallet.Color), Weight = UnitsManager.ConvertMassFrom(dcsbPallet.Weight, us) }; palletProperties.ID.SetNameDesc(dcsbPallet.Name, dcsbPallet.Description); lbPallets.Items.Add(new ItemBaseWrapper(palletProperties), true); } }while ((rangeIndex + 1) * 20 < numberOfItems); } }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); // Graphics3DControl graphCtrl.DrawingContainer = this; graphCtrl.AngleHoriz = 270.0; if (null != Item) { PalletLabelProperties palletLabel = Item as PalletLabelProperties; Color = palletLabel.Color; Dimensions = palletLabel.Dimensions; Weight = palletLabel.Weight; Bitmap = palletLabel.Bitmap; } else { Color = Color.White; Dimensions = new Vector2D( UnitsManager.ConvertLengthFrom(210, UnitsManager.UnitSystem.UNIT_METRIC1), UnitsManager.ConvertLengthFrom(297, UnitsManager.UnitSystem.UNIT_METRIC1)); Weight = 0.0; Bitmap = Resources.PalletLabelDefault; } }
public FormNewPalletCorners(Document doc, PalletCornerProperties palletCorners) : base(doc, palletCorners) { InitializeComponent(); if (null != palletCorners) { CornerLength = palletCorners.Length; CornerWidth = palletCorners.Width; CornerThickness = palletCorners.Thickness; CornerWeight = palletCorners.Weight; CornerColor = palletCorners.Color; } else { CornerLength = UnitsManager.ConvertLengthFrom(1200.0, UnitsManager.UnitSystem.UNIT_METRIC1);; CornerWidth = UnitsManager.ConvertLengthFrom(40.0, UnitsManager.UnitSystem.UNIT_METRIC1);; CornerThickness = UnitsManager.ConvertLengthFrom(5.0, UnitsManager.UnitSystem.UNIT_METRIC1); CornerWeight = UnitsManager.ConvertMassFrom(0.050, UnitsManager.UnitSystem.UNIT_METRIC1); CornerColor = Color.Khaki; } UpdateStatus(string.Empty); // units UnitsManager.AdaptUnitLabels(this); }
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); }
/// <summary> /// Constructor (edit existing properties) /// </summary> /// <param name="document">Document to which the edited item belongs</param> /// <param name="truckProperties">Edited item</param> public FormNewTruck(Document document, TruckProperties truckProperties) : base(document, truckProperties) { InitializeComponent(); // initialize data if (null != truckProperties) { TruckLength = truckProperties.Length; TruckWidth = truckProperties.Width; TruckHeight = truckProperties.Height; TruckAdmissibleLoadWeight = truckProperties.AdmissibleLoadWeight; TruckColor = truckProperties.Color; } else { TruckLength = UnitsManager.ConvertLengthFrom(13600, UnitsManager.UnitSystem.UNIT_METRIC1); TruckWidth = UnitsManager.ConvertLengthFrom(2450, UnitsManager.UnitSystem.UNIT_METRIC1); TruckHeight = UnitsManager.ConvertLengthFrom(2700, UnitsManager.UnitSystem.UNIT_METRIC1); TruckAdmissibleLoadWeight = UnitsManager.ConvertMassFrom(38000, UnitsManager.UnitSystem.UNIT_METRIC1); TruckColor = Color.LightBlue; } UpdateStatus(string.Empty); // units UnitsManager.AdaptUnitLabels(this); }
private void UpdateThicknesses(object sender, EventArgs e) { UCtrlTriDouble uCtrlDim = sender as UCtrlTriDouble; if (null != uCtrlDim) { double thickness = UnitsManager.ConvertLengthFrom(5.0, UnitsManager.UnitSystem.UNIT_METRIC1); if (uCtrlDimensionsOuter == uCtrlDim && CapLength > thickness) { CapInnerLength = CapLength - thickness; } if (uCtrlDimensionsOuter == uCtrlDim && CapWidth > thickness) { CapInnerWidth = CapWidth - thickness; } if (uCtrlDimensionsOuter == uCtrlDim && CapHeight > thickness) { CapInnerHeight = CapHeight - thickness; } } // update UpdateStatus(string.Empty); // draw cap graphCtrl.Invalidate(); }
private void UpdateThicknesses(object sender, EventArgs e) { NumericUpDown nud = sender as NumericUpDown; if (null != nud) { double thickness = UnitsManager.ConvertLengthFrom(5.0, UnitsManager.UnitSystem.UNIT_METRIC1); if (nudCapLength == nud && CapLength > thickness) { CapInnerLength = CapLength - thickness; } if (nudCapWidth == nud && CapWidth > thickness) { CapInnerWidth = CapWidth - thickness; } if (nudCapHeight == nud && CapHeight > thickness) { CapInnerHeight = CapHeight - thickness; } } // update UpdateStatus(string.Empty); // draw cap graphCtrl.Invalidate(); }
/// <summary> /// FormNewBox constructor used when defining a new BoxProperties item /// </summary> /// <param name="document">Document in which the BoxProperties item is to be created</param> /// <param name="mode">Mode is either Mode.MODE_CASE or Mode.MODE_BOX</param> public FormNewBox(Document document, Mode mode) { InitializeComponent(); // set unit labels UnitsManager.AdaptUnitLabels(this); // save document reference _document = document; // mode _mode = mode; switch (_mode) { case Mode.MODE_CASE: tbName.Text = _document.GetValidNewTypeName(Resources.ID_CASE); nudLength.Value = (decimal)UnitsManager.ConvertLengthFrom(400.0, UnitsManager.UnitSystem.UNIT_METRIC1); nudWidth.Value = (decimal)UnitsManager.ConvertLengthFrom(300.0, UnitsManager.UnitSystem.UNIT_METRIC1); nudHeight.Value = (decimal)UnitsManager.ConvertLengthFrom(200.0, UnitsManager.UnitSystem.UNIT_METRIC1); nudInsideLength.Value = nudLength.Value - (decimal)UnitsManager.ConvertLengthFrom(6.0, UnitsManager.UnitSystem.UNIT_METRIC1); nudInsideWidth.Value = nudWidth.Value - (decimal)UnitsManager.ConvertLengthFrom(6.0, UnitsManager.UnitSystem.UNIT_METRIC1); nudInsideHeight.Value = nudHeight.Value - (decimal)UnitsManager.ConvertLengthFrom(6.0, UnitsManager.UnitSystem.UNIT_METRIC1); nudTapeWidth.Value = (decimal)UnitsManager.ConvertLengthFrom(50, UnitsManager.UnitSystem.UNIT_METRIC1); cbTapeColor.Color = Color.Beige; break; case Mode.MODE_BOX: tbName.Text = _document.GetValidNewTypeName(Resources.ID_BOX); nudLength.Value = (decimal)UnitsManager.ConvertLengthFrom(120.0, UnitsManager.UnitSystem.UNIT_METRIC1); nudWidth.Value = (decimal)UnitsManager.ConvertLengthFrom(60.0, UnitsManager.UnitSystem.UNIT_METRIC1); nudHeight.Value = (decimal)UnitsManager.ConvertLengthFrom(30.0, UnitsManager.UnitSystem.UNIT_METRIC1); nudInsideLength.Value = nudLength.Value - (decimal)UnitsManager.ConvertLengthFrom(6.0, UnitsManager.UnitSystem.UNIT_METRIC1); nudInsideWidth.Value = nudWidth.Value - (decimal)UnitsManager.ConvertLengthFrom(6.0, UnitsManager.UnitSystem.UNIT_METRIC1); nudInsideHeight.Value = nudHeight.Value - (decimal)UnitsManager.ConvertLengthFrom(6.0, UnitsManager.UnitSystem.UNIT_METRIC1); break; default: break; } // description (same as name) tbDescription.Text = tbName.Text; // color : all faces set together / face by face chkAllFaces.Checked = false; chkAllFaces_CheckedChanged(this, null); // set colors for (int i = 0; i < 6; ++i) { _faceColors[i] = _mode == Mode.MODE_BOX ? Color.Turquoise : Color.Chocolate; } // set textures _textures = new List <Pair <HalfAxis.HAxis, Texture> >(); // set default face cbFace.SelectedIndex = 0; // net weight NetWeight = new OptDouble(false, UnitsManager.ConvertMassFrom(0.0, UnitsManager.UnitSystem.UNIT_METRIC1)); // disable Ok button UpdateButtonOkStatus(); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); // font size GridFontSize = 8; // fill combo boxes cbBoxes.Initialize(_doc, this, null); // initialize orientation uCtrlCaseOrient.AllowedOrientations = new bool[] { Settings.Default.AllowVerticalX, Settings.Default.AllowVerticalY, Settings.Default.AllowVerticalZ }; // initialize grid gridSolutions.Selection.SelectionChanged += new SourceGrid.RangeRegionChangedEventHandler(onSelChangeGrid); // load cases DCSBCase[] sbCases = WCFClientSingleton.Instance.Client.GetAllCases(); foreach (DCSBCase sbCase in sbCases) { try { // get values from database if (!sbCase.HasInnerDims) { continue; } UnitsManager.UnitSystem us = (UnitsManager.UnitSystem)sbCase.UnitSystem; double boxLength = UnitsManager.ConvertLengthFrom(sbCase.DimensionsOuter.M0, us); double boxWidth = UnitsManager.ConvertLengthFrom(sbCase.DimensionsOuter.M1, us); double boxHeight = UnitsManager.ConvertLengthFrom(sbCase.DimensionsOuter.M2, us); double innerLength = UnitsManager.ConvertLengthFrom(sbCase.DimensionsInner.M0, us); double innerWidth = UnitsManager.ConvertLengthFrom(sbCase.DimensionsInner.M1, us); double innerHeight = UnitsManager.ConvertLengthFrom(sbCase.DimensionsInner.M2, us); double weight = UnitsManager.ConvertMassFrom(sbCase.Weight, us); Color[] colors = new Color[6]; for (int i = 0; i < 6; ++i) { colors[i] = Color.FromArgb(sbCase.Colors[i]); } // instantiate box properties BoxProperties bProperties = new BoxProperties(null , boxLength, boxWidth, boxHeight , innerLength, innerWidth, innerHeight); bProperties.ID.SetNameDesc(sbCase.Name, sbCase.Description); bProperties.SetWeight(weight); bProperties.TapeWidth = new OptDouble(sbCase.ShowTape, sbCase.TapeWidth); bProperties.TapeColor = Color.FromArgb(sbCase.TapeColor); bProperties.SetAllColors(colors); // insert in listbox control chklbCases.Items.Add(new ItemBaseCB(bProperties), true); } catch (Exception ex) { _log.Error(ex.Message); } } // update graph control graphCtrl.DrawingContainer = this; }
public OptionPanelPalletEdition() { InitializeComponent(); CategoryPath = Properties.Resources.ID_OPTIONSPALLETEDITION; DisplayName = Properties.Resources.ID_DISPLAYPALLETEDITION; // initialize distance uCtrlDistAbove.Value = UnitsManager.ConvertLengthFrom(Properties.Settings.Default.DistanceAboveSelectedLayer, UnitsManager.UnitSystem.UNIT_METRIC1); }
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); }
internal BoxProperties ToCase(DataCase dtCase) { BoxProperties boxProperties = new BoxProperties(null , dtCase.OuterDimensions[0], dtCase.OuterDimensions[1], dtCase.OuterDimensions[2] , dtCase.InnerDimensions[0], dtCase.InnerDimensions[1], dtCase.InnerDimensions[2]); Color[] colors = Enumerable.Repeat(Color.Chocolate, 6).ToArray(); boxProperties.ID.SetNameDesc(dtCase.Name, dtCase.Description); boxProperties.SetAllColors(colors); boxProperties.TapeColor = Color.Beige; boxProperties.TapeWidth = new OptDouble(true, UnitsManager.ConvertLengthFrom(50, UnitsManager.UnitSystem.UNIT_METRIC1)); boxProperties.SetWeight(dtCase.Weight); boxProperties.SetNetWeight(new OptDouble(dtCase.NetWeight > 0.0, dtCase.NetWeight)); return(boxProperties); }
public FormNewBundle(Document document) : base(document, null) { InitializeComponent(); // set unit labels UnitsManager.AdaptUnitLabels(this); // initialize value BundleLength = UnitsManager.ConvertLengthFrom(400.0, UnitsManager.UnitSystem.UNIT_METRIC1); BundleWidth = UnitsManager.ConvertLengthFrom(300.0, UnitsManager.UnitSystem.UNIT_METRIC1); UnitThickness = UnitsManager.ConvertLengthFrom(5.0, UnitsManager.UnitSystem.UNIT_METRIC1); NoFlats = 10; Color = Color.LightGray; // disable Ok buttons UpdateStatus(string.Empty); }
public FormNewInterlayer(Document document) { InitializeComponent(); // set unit labels UnitsManager.AdaptUnitLabels(this); // save document reference _document = document; // name / description tbName.Text = _document.GetValidNewTypeName(Resources.ID_INTERLAYER); tbDescription.Text = tbName.Text; // initialize value InterlayerLength = UnitsManager.ConvertLengthFrom(1200.0, UnitsManager.UnitSystem.UNIT_METRIC1); InterlayerWidth = UnitsManager.ConvertLengthFrom(1000.0, UnitsManager.UnitSystem.UNIT_METRIC1); // disable Ok button UpdateButtonOkStatus(); }
public FormNewBundle(Document document) { InitializeComponent(); // set unit labels UnitsManager.AdaptUnitLabels(this); // save document reference _document = document; // name tbName.Text = _document.GetValidNewTypeName(Resources.ID_BUNDLE); tbDescription.Text = tbName.Text; // initialize value BundleLength = UnitsManager.ConvertLengthFrom(400.0, UnitsManager.UnitSystem.UNIT_METRIC1); BundleWidth = UnitsManager.ConvertLengthFrom(300.0, UnitsManager.UnitSystem.UNIT_METRIC1); UnitThickness = UnitsManager.ConvertLengthFrom(5.0, UnitsManager.UnitSystem.UNIT_METRIC1); NoFlats = 10; // disable Ok buttons UpdateButtonOkStatus(); }
private void FillGridPallets(WCFClient wcfClient) { // initialize grid List <string> captions = new List <string> { string.Format(Properties.Resources.ID_DIMENSIONS, UnitsManager.UnitString(UnitsManager.UnitType.UT_LENGTH)), string.Format(Properties.Resources.ID_WEIGHT_WU, UnitsManager.UnitString(UnitsManager.UnitType.UT_MASS)) }; GridInitialize(gridPallets, captions); // handling delete event SourceGrid.Cells.Controllers.CustomEvents buttonDelete = new SourceGrid.Cells.Controllers.CustomEvents(); buttonDelete.Click += new EventHandler(OnDeleteItem); _pallets = wcfClient.Client.GetAllPalletsSearch(SearchString, SearchDescription, RangeIndex, ref _numberOfItems, false); int iIndex = 0; foreach (DCSBPallet p in _pallets) { UnitsManager.UnitSystem us = (UnitsManager.UnitSystem)p.UnitSystem; gridPallets.Rows.Insert(++iIndex); int iCol = 0; gridPallets[iIndex, iCol++] = new SourceGrid.Cells.Cell(p.Name); gridPallets[iIndex, iCol++] = new SourceGrid.Cells.Cell(p.Description); gridPallets[iIndex, iCol++] = new SourceGrid.Cells.Cell( string.Format("{0:0.##} x {1:0.##} x {2:0.##}", UnitsManager.ConvertLengthFrom(p.Dimensions.M0, us), UnitsManager.ConvertLengthFrom(p.Dimensions.M1, us), UnitsManager.ConvertLengthFrom(p.Dimensions.M2, us)) ); gridPallets[iIndex, iCol++] = new SourceGrid.Cells.Cell( string.Format("{0:0.###}", UnitsManager.ConvertMassFrom(p.Weight, us)) ); gridPallets[iIndex, iCol] = new SourceGrid.Cells.Button("") { Image = Properties.Resources.Delete }; gridPallets[iIndex, iCol++].AddController(buttonDelete); } GridFinalize(gridPallets); }
/// <summary> /// Constructor (new truck properties) /// </summary> /// <param name="document">Document to which the new item will belong</param> public FormNewTruck(Document document) { InitializeComponent(); // set unit labels UnitsManager.AdaptUnitLabels(this); // save document reference _document = document; // initialize data tbName.Text = _document.GetValidNewTypeName(Resources.ID_TRUCK); TruckLength = UnitsManager.ConvertLengthFrom(13600, UnitsManager.UnitSystem.UNIT_METRIC1); TruckWidth = UnitsManager.ConvertLengthFrom(2450, UnitsManager.UnitSystem.UNIT_METRIC1); TruckHeight = UnitsManager.ConvertLengthFrom(2700, UnitsManager.UnitSystem.UNIT_METRIC1); TruckAdmissibleLoadWeight = UnitsManager.ConvertMassFrom(38000, UnitsManager.UnitSystem.UNIT_METRIC1); TruckColor = Color.LightBlue; // description tbDescription.Text = tbName.Text; // disable Ok button UpdateButtonOkStatus(); }
internal BoxProperties ToCase(DataCase dtCase) { BoxProperties boxProperties = new BoxProperties(null , dtCase.OuterDimensions[0], dtCase.OuterDimensions[1], dtCase.OuterDimensions[2] , dtCase.InnerDimensions[0], dtCase.InnerDimensions[1], dtCase.InnerDimensions[2]); Color[] colors = new Color[6]; for (int i = 0; i < 6; ++i) { colors[i] = Color.Chocolate; } boxProperties.ID.SetNameDesc(dtCase.Name, dtCase.Description); boxProperties.SetAllColors(colors); boxProperties.ShowTape = true; boxProperties.TapeColor = Color.Beige; boxProperties.TapeWidth = UnitsManager.ConvertLengthFrom(50, UnitsManager.UnitSystem.UNIT_METRIC1); boxProperties.SetWeight(dtCase.Weight); boxProperties.SetNetWeight(new OptDouble(dtCase.NetWeight > 0.0, dtCase.NetWeight)); return(boxProperties); }
private void onPalletTypeChanged(object sender, EventArgs e) { PalletData palletData = PalletData.GetByName(PalletTypeName); if (null == palletData) { return; } // set name / description / length / width / height / weight PalletName = palletData.Name; Description = palletData.Description; PalletLength = UnitsManager.ConvertLengthFrom(palletData.Length, UnitsManager.UnitSystem.UNIT_METRIC1); PalletWidth = UnitsManager.ConvertLengthFrom(palletData.Width, UnitsManager.UnitSystem.UNIT_METRIC1); PalletHeight = UnitsManager.ConvertLengthFrom(palletData.Height, UnitsManager.UnitSystem.UNIT_METRIC1); Weight = UnitsManager.ConvertMassFrom(palletData.Weight, UnitsManager.UnitSystem.UNIT_METRIC1); PalletColor = palletData.Color; graphCtrl.Invalidate(); }
private void InsertPictogram(ref BoxProperties boxProperties) { string pictoPath = Properties.Settings.Default.pictoTOP; if (File.Exists(pictoPath)) { // load image Bitmap bmp = new Bitmap(pictoPath); // case dimensions double length = boxProperties.Length; double width = boxProperties.Width; double height = boxProperties.Height; // dimensions and margins double margin = 2; double pictoSize = 10; double minDim = Math.Min(Math.Min(length, width), Math.Min(width, height)); if (minDim < pictoSize) { margin = 0.0; pictoSize = minDim; } // top position double topPos = boxProperties.Height - margin - pictoSize; // insert picto as a texture boxProperties.AddTexture(HalfAxis.HAxis.AXIS_X_N , UnitsManager.ConvertLengthFrom(new Vector2D(width - margin - pictoSize, topPos), UnitsManager.UnitSystem.UNIT_METRIC2) , UnitsManager.ConvertLengthFrom(new Vector2D(pictoSize, pictoSize), UnitsManager.UnitSystem.UNIT_METRIC2) , 0, bmp); boxProperties.AddTexture(HalfAxis.HAxis.AXIS_X_P , UnitsManager.ConvertLengthFrom(new Vector2D(width - margin - pictoSize, topPos), UnitsManager.UnitSystem.UNIT_METRIC2) , UnitsManager.ConvertLengthFrom(new Vector2D(pictoSize, pictoSize), UnitsManager.UnitSystem.UNIT_METRIC2) , 0, bmp); boxProperties.AddTexture(HalfAxis.HAxis.AXIS_Y_N , UnitsManager.ConvertLengthFrom(new Vector2D(length - margin - pictoSize, topPos), UnitsManager.UnitSystem.UNIT_METRIC2) , UnitsManager.ConvertLengthFrom(new Vector2D(pictoSize, pictoSize), UnitsManager.UnitSystem.UNIT_METRIC2) , 0, bmp); boxProperties.AddTexture(HalfAxis.HAxis.AXIS_Y_P , UnitsManager.ConvertLengthFrom(new Vector2D(length - margin - pictoSize, topPos), UnitsManager.UnitSystem.UNIT_METRIC2) , UnitsManager.ConvertLengthFrom(new Vector2D(pictoSize, pictoSize), UnitsManager.UnitSystem.UNIT_METRIC2) , 0, bmp); } }
public FormNewCylinder(Document document) { InitializeComponent(); // set unit labels UnitsManager.AdaptUnitLabels(this); // save document reference _document = document; // name / description tbName.Text = _document.GetValidNewTypeName(Resources.ID_CYLINDER); tbDescription.Text = tbName.Text; // properties nudDiameterOuter.Value = (decimal)UnitsManager.ConvertLengthFrom(2.0 * 75.0, UnitsManager.UnitSystem.UNIT_METRIC1); nudDiameterInner.Value = (decimal)UnitsManager.ConvertLengthFrom(0.0, UnitsManager.UnitSystem.UNIT_METRIC1); nudHeight.Value = (decimal)UnitsManager.ConvertLengthFrom(150.0, UnitsManager.UnitSystem.UNIT_METRIC1); nudWeight.Value = (decimal)UnitsManager.ConvertMassFrom(1.0, UnitsManager.UnitSystem.UNIT_METRIC1); cbColorWallOuter.Color = System.Drawing.Color.LightSkyBlue; cbColorWallInner.Color = System.Drawing.Color.Chocolate; cbColorTop.Color = System.Drawing.Color.Gray; // disable Ok button UpdateButtonOkStatus(); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); // Graphics3DControl graphCtrl.DrawingContainer = this; // list of packs cbInnerPackable.Initialize(_document, this, PackProp?.Content); // arrangement if (null != PackProp) { cbDir.SelectedIndex = (int)(PackProp.BoxOrientation); RevSolidLayout = PackProp.RevSolidLayout; Arrangement = PackProp.Arrangement; Wrapper = PackProp.Wrap; Tray = PackProp.Tray; uCtrlOuterDimensions.Checked = PackProp.HasForcedOuterDimensions; OuterDimensions = PackProp.OuterDimensions; Bulge = PackProp.Bulge; } else { cbDir.SelectedIndex = 5; // HalfAxis.HAxis.AXIS_Z_P RevSolidLayout = PackProperties.EnuRevSolidLayout.ALIGNED; Arrangement = new PackArrangement(3, 2, 1); Wrapper = new WrapperPolyethilene(0.1, 0.010, Color.LightGray) { }; Tray = new PackTray(UnitsManager.ConvertLengthFrom(40, UnitsManager.UnitSystem.UNIT_METRIC1), 0.050, Color.Chocolate) { UnitThickness = UnitsManager.ConvertLengthFrom(1.0, UnitsManager.UnitSystem.UNIT_METRIC1) }; } // set StrapperSet ctrlStrapperSet.StrapperSet = StrapperSet; // disable Ok button UpdateStatus(string.Empty); }
protected override void OnLoad(EventArgs e) { base.OnLoad(e); // font size GridFontSize = Settings.Default.GridFontSize; // initialize combo boxes cbBoxes.Initialize(_doc, this, null); cbPallets.Initialize(_doc, this, null); // initialize graph containers graphCtrlPack.DrawingContainer = this; graphCtrlSolution.DrawingContainer = this; // set default pallet height MaximumPalletHeight = UnitsManager.ConvertLengthFrom(Settings.Default.PalletHeight, UnitsManager.UnitSystem.UNIT_METRIC1); // set default wall numbers and thickness HasWrapper = Settings.Default.OptHasWrapper; uCtrlWrapperWalls.NoX = Settings.Default.NumberWallsLength; uCtrlWrapperWalls.NoY = Settings.Default.NumberWallsWidth; uCtrlWrapperWalls.NoZ = Settings.Default.NumberWallsHeight; WrapperWallThickness = UnitsManager.ConvertLengthFrom(Settings.Default.WrapperThickness, UnitsManager.UnitSystem.UNIT_METRIC1); WrapperWallSurfMass = UnitsManager.ConvertSurfaceMassFrom(Settings.Default.WrapperSurfMass, UnitsManager.UnitSystem.UNIT_METRIC1); HasTray = Settings.Default.OptHasTray; uCtrlTrayWalls.NoX = Settings.Default.NumberWallsLength; uCtrlTrayWalls.NoY = Settings.Default.NumberWallsWidth; uCtrlTrayWalls.NoZ = Settings.Default.NumberWallsHeight; uCtrlTrayHeight.Value = UnitsManager.ConvertLengthFrom(Settings.Default.TrayHeight, UnitsManager.UnitSystem.UNIT_METRIC1); uCtrlTrayThickness.Value = UnitsManager.ConvertLengthFrom(Settings.Default.TrayThickness, UnitsManager.UnitSystem.UNIT_METRIC1); uCtrlTraySurfMass.Value = UnitsManager.ConvertSurfaceMassFrom(Settings.Default.TraySurfMass, UnitsManager.UnitSystem.UNIT_METRIC1); // set default number of boxes nudNumber.Value = Settings.Default.NumberBoxesPerCase; // set default wrapper type cbWrapperType.SelectedIndex = Settings.Default.WrapperType; // initialize grid gridSolutions.Selection.SelectionChanged += OnSelChangeGrid; UpdateStatus(string.Empty); }
public void Draw(Graphics3DControl ctrl, Graphics3D graphics) { if (null == _selectedItem) { return; } // get unit system UnitsManager.UnitSystem us = (UnitsManager.UnitSystem)_selectedItem.UnitSystem; // pallet if (_selectedItem is DCSBPallet dcsbPallet) { double palletLength = UnitsManager.ConvertLengthFrom(dcsbPallet.Dimensions.M0, us); double palletWidth = UnitsManager.ConvertLengthFrom(dcsbPallet.Dimensions.M1, us); double palletHeight = UnitsManager.ConvertLengthFrom(dcsbPallet.Dimensions.M2, us); PalletProperties palletProperties = new PalletProperties(null, dcsbPallet.PalletType, palletLength, palletWidth, palletHeight) { Color = Color.FromArgb(dcsbPallet.Color) }; Pallet pallet = new Pallet(palletProperties); pallet.Draw(graphics, Transform3D.Identity); graphics.AddDimensions(new DimensionCube(palletLength, palletWidth, palletHeight)); } }