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 /// </summary> /// <param name="doc">Reference of parent <see cref="Document"/></param> /// <param name="box">Reference </param> public PackProperties(Document doc , BoxProperties box , PackArrangement arrangement , HalfAxis.HAxis orientation , PackWrapper wrapper) : base(doc) { _boxProperties = box; _boxProperties.AddDependancy(this); _arrangement = arrangement; _orientation = orientation; _wrapper = wrapper; }
public static void GetDimensions( BoxProperties boxProperties , HalfAxis.HAxis boxOrientation , PackArrangement arrangement , ref double length, ref double width, ref double height) { if (null == boxProperties) { return; } length = arrangement._iLength * boxProperties.Dim(PackProperties.DimIndex0(boxOrientation)); width = arrangement._iWidth * boxProperties.Dim(PackProperties.DimIndex1(boxOrientation)); height = arrangement._iHeight * boxProperties.Dim(3 - PackProperties.DimIndex0(boxOrientation) - PackProperties.DimIndex1(boxOrientation)); }
// static methods static public double EstimateWeight( BoxProperties boxProperties, PackArrangement arrangement, HalfAxis.HAxis orientation , int[] noWalls, double thickness, double surfacicMass) { double length = 0.0, width = 0.0, height = 0.0; PackProperties.GetDimensions(boxProperties, orientation, arrangement, ref length, ref width, ref height); Vector3D vDimensions = new Vector3D( length + noWalls[0] * thickness , width + noWalls[1] * thickness , height + noWalls[2] * thickness); double area = (noWalls[0] * vDimensions.Y * vDimensions.Z + noWalls[1] * vDimensions.X * vDimensions.Z + noWalls[2] * vDimensions.X * vDimensions.Y) * UnitsManager.FactorSquareLengthToArea; return area * surfacicMass; }
public PackProperties(Document doc , PackableBrick box , PackArrangement arrangement , HalfAxis.HAxis orientation , PackWrapper wrapper) : base(doc) { _innerPackable = box; if (null != doc) { _innerPackable.AddDependancy(this); } Arrangement = arrangement; BoxOrientation = orientation; Wrap = wrapper; }
// static methods static public double EstimateWeight( BoxProperties boxProperties, PackArrangement arrangement, HalfAxis.HAxis orientation , int[] noWalls, double thickness, double surfacicMass) { double length = 0.0, width = 0.0, height = 0.0; PackProperties.GetDimensions(boxProperties, orientation, arrangement, ref length, ref width, ref height); Vector3D vDimensions = new Vector3D( length + noWalls[0] * thickness , width + noWalls[1] * thickness , height + noWalls[2] * thickness); double area = (noWalls[0] * vDimensions.Y * vDimensions.Z + noWalls[1] * vDimensions.X * vDimensions.Z + noWalls[2] * vDimensions.X * vDimensions.Y) * UnitsManager.FactorSquareLengthToArea; return(area * surfacicMass); }
public PackProperties(Document doc , Packable packable , PackArrangement arrangement , HalfAxis.HAxis orientation, EnuRevSolidLayout revSolidLayout , PackWrapper wrapper , PackTray tray) : base(doc) { Content = packable; if (null != doc) { Content.AddDependancy(this); } Arrangement = arrangement; BoxOrientation = orientation; RevSolidLayout = revSolidLayout; Wrap = wrapper; Tray = tray; }
public static void GetDimensions( RevSolidProperties revSolid , EnuRevSolidLayout revSolidLayout , PackArrangement arrangement , ref double length, ref double width, ref double height) { if (null == revSolid) { return; } switch (revSolidLayout) { case EnuRevSolidLayout.ALIGNED: length = arrangement.Length * revSolid.Diameter; width = arrangement.Width * revSolid.Diameter; break; case EnuRevSolidLayout.STAGGERED_REGULAR: length = (arrangement.Length + 0.5) * revSolid.Diameter; width = ((arrangement.Width - 1) * 0.5 * Math.Sqrt(3.0) + 1) * revSolid.Diameter; break; case EnuRevSolidLayout.STAGGERED_MINUS1: length = arrangement.Length * revSolid.Diameter; width = ((arrangement.Width - 1) * 0.5 * Math.Sqrt(3.0) + 1) * revSolid.Diameter; break; case EnuRevSolidLayout.STAGGERED_PLUS1: length = (arrangement.Length + 1) * revSolid.Diameter; width = ((arrangement.Width - 1) * 0.5 * Math.Sqrt(3.0) + 1) * revSolid.Diameter; break; default: length = 0.0; width = 0.0; break; } height = arrangement.Height * revSolid.Height; }
/// <summary> /// Case definition constructor /// </summary> /// <param name="arrangement">Box arrangement</param> /// <param name="dim0">Dim 0 is 0, 1 or 2</param> /// <param name="dim1">Dim 1 is 0, 1 or 2</param> public CaseDefinition(PackArrangement arrangement, int dim0, int dim1) { _arrangement = arrangement; _dim0 = dim0; _dim1 = dim1; }
public static void GetDimensions( BoxProperties boxProperties , HalfAxis.HAxis boxOrientation , PackArrangement arrangement , ref double length, ref double width, ref double height) { if (null == boxProperties) return; length = arrangement._iLength * boxProperties.Dim(PackProperties.DimIndex0(boxOrientation)); width = arrangement._iWidth * boxProperties.Dim(PackProperties.DimIndex1(boxOrientation)); height = arrangement._iHeight * boxProperties.Dim(3 - PackProperties.DimIndex0(boxOrientation) - PackProperties.DimIndex1(boxOrientation)); }
/// <summary> /// constructor /// </summary> /// <param name="doc">Reference of parent <see cref="Document"/></param> /// <param name="box">Reference </param> public PackProperties(Document doc , BoxProperties box , PackArrangement arrangement , HalfAxis.HAxis orientation , PackWrapper wrapper) : base(doc) { _boxProperties = box; _boxProperties.AddDependancy(this); _arrangement = arrangement; _orientation = orientation; _wrapper = wrapper; }
/// <summary> /// Create a new pack /// </summary> /// <param name="name">Name</param> /// <param name="description">Description</param> /// <param name="box">Inner box</param> /// <param name="arrangement">Arrangement</param> /// <param name="axis">Axis</param> /// <param name="wrapper">Wrapper</param> /// <returns></returns> public PackProperties CreateNewPack( string name, string description , BoxProperties box , PackArrangement arrangement , HalfAxis.HAxis axis , PackWrapper wrapper) { // instantiate and initialize PackProperties packProperties = new PackProperties(this , box , arrangement , axis , wrapper); packProperties.Name = name; packProperties.Description = description; // insert in list _typeList.Add(packProperties); // notify listeners NotifyOnNewTypeCreated(packProperties); Modify(); return packProperties; }
/// <summary> /// Case definition constructor /// </summary> /// <param name="arrangement">Box arrangement</param> /// <param name="dim0">Dim 0 is 0, 1 or 2</param> /// <param name="dim1">Dim 1 is 0, 1 or 2</param> public CaseDefinition(PackArrangement arrangement, int dim0, int dim1) { _arrangement = arrangement; _dim0 = dim0; _dim1 = dim1; }