/// <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;
        }
Example #2
0
        /// <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;
        }
        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);
        }
Example #4
0
 /// <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;
 }
Example #5
0
 private void SaveWrapperBase(PackWrapper wrapper, XmlElement wrapperElt, XmlDocument xmlDoc)
 {
     if (null == wrapper) return;
     // type
     XmlAttribute typeAttrib = xmlDoc.CreateAttribute("Type");
     typeAttrib.Value = wrapper.Type.ToString();
     wrapperElt.Attributes.Append(typeAttrib);
     // color
     XmlAttribute colorAttrib = xmlDoc.CreateAttribute("Color");
     colorAttrib.Value = string.Format("{0}", wrapper.Color.ToArgb());
     wrapperElt.Attributes.Append(colorAttrib);
     // weight
     XmlAttribute weightAttrib = xmlDoc.CreateAttribute("Weight");
     weightAttrib.Value = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", wrapper.Weight);
     wrapperElt.Attributes.Append(weightAttrib);
     // thickness
     XmlAttribute thicknessAttrib = xmlDoc.CreateAttribute("UnitThickness");
     thicknessAttrib.Value = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", wrapper.UnitThickness);
     wrapperElt.Attributes.Append(thicknessAttrib);
 }