Esempio n. 1
0
 Layer2D BuildLayer(CasePalletSolution palletSolution, TruckProperties truckProperties, TruckConstraintSet constraintSet
     ,HalfAxis.HAxis axisOrtho, bool swapped)
 { 
     return new Layer2D(new Vector3D(palletSolution.PalletLength, palletSolution.PalletWidth, palletSolution.PalletHeight)
                         , new Vector2D(truckProperties.Length, truckProperties.Width)
                         , axisOrtho, swapped);
 }
Esempio n. 2
0
 public Truck(TruckProperties truckProperties)
 {
     _length = truckProperties.Length;
     _width = truckProperties.Width;
     _height = truckProperties.Height;
     _colorFill = truckProperties.Color;
     _colorPath = Color.Black;
 }
 public AnalysisPalletTruck(
     Packable packable,
     TruckProperties truckProperties,
     ConstraintSetPalletTruck constraintSet)
     : base(packable.ParentDocument, packable)
 {
     TruckProperties = truckProperties;
     ConstraintSet   = constraintSet;
 }
Esempio n. 4
0
        /// <summary>
        /// Creates new truck analysis based on solution
        /// This method used when loading truck analysis from file
        /// </summary>
        /// <param name="name"></param>
        /// <param name="description"></param>
        /// <param name="truckProperties"></param>
        /// <param name="constraintSet"></param>
        /// <param name="solutions"></param>
        /// <returns></returns>
        public TruckAnalysis CreateNewTruckAnalysis(string name, string description, TruckProperties truckProperties, TruckConstraintSet constraintSet, List <TruckSolution> solutions)
        {
            TruckAnalysis truckAnalysis = new TruckAnalysis(this.ParentDocument, _analysis, this, truckProperties, constraintSet);

            truckAnalysis.ID.SetNameDesc(name, description);
            truckAnalysis.Solutions = solutions;
            _truckAnalyses.Add(truckAnalysis);
            AddDependancy(truckAnalysis);
            ParentDocument.Modify();

            return(truckAnalysis);
        }
Esempio n. 5
0
        /// <summary>
        /// Creates new truck analysis based on solution
        /// This method used when loading truck analysis from file
        /// </summary>
        /// <param name="name"></param>
        /// <param name="description"></param>
        /// <param name="truckProperties"></param>
        /// <param name="constraintSet"></param>
        /// <param name="solutions"></param>
        /// <returns></returns>
        public TruckAnalysis CreateNewTruckAnalysis(string name, string description, TruckProperties truckProperties, TruckConstraintSet constraintSet, List<TruckSolution> solutions)
        {
            TruckAnalysis truckAnalysis = new TruckAnalysis(this.ParentDocument, _analysis, this, truckProperties, constraintSet);
            truckAnalysis.Name = name;
            truckAnalysis.Description = description;
            truckAnalysis.Solutions = solutions;
            _truckAnalyses.Add(truckAnalysis);
            AddDependancy(truckAnalysis);
            ParentDocument.NotifyOnNewTruckAnalysisCreated(_analysis, this, truckAnalysis);
            ParentDocument.Modify();

            return truckAnalysis;
        }
Esempio n. 6
0
 /// <summary>
 /// Truck analysis
 /// </summary>
 /// <param name="document">Parent document</param>
 /// <param name="analysis">Parent pallet analysis</param>
 /// <param name="selSolution">Parent selected solution</param>
 /// <param name="truckProperties">TruckProperties item</param>
 /// <param name="constraintSet">Constraint set</param>
 public TruckAnalysis(
     Document document
     , CasePalletAnalysis analysis
     , SelCasePalletSolution selSolution
     , TruckProperties truckProperties
     , TruckConstraintSet constraintSet)
     : base(document)
 {
     ID.Name              = truckProperties.ID.Name;
     _analysis            = analysis;
     _selSolution         = selSolution;
     this.TruckProperties = truckProperties;
     _constraintSet       = constraintSet;
 }
Esempio n. 7
0
 /// <summary>
 /// Truck analysis
 /// </summary>
 /// <param name="document">Parent document</param>
 /// <param name="analysis">Parent pallet analysis</param>
 /// <param name="selSolution">Parent selected solution</param>
 /// <param name="truckProperties">TruckProperties item</param>
 /// <param name="constraintSet">Constraint set</param>
 public TruckAnalysis(
     Document document
     , CasePalletAnalysis analysis
     , SelCasePalletSolution selSolution
     , TruckProperties truckProperties
     , TruckConstraintSet constraintSet)
     : base(document)
 {
     Name = truckProperties.Name;
     _analysis = analysis;
     _selSolution = selSolution;
     this.TruckProperties = truckProperties;
     _constraintSet = constraintSet;
 }
Esempio n. 8
0
        /// <summary>
        /// Creates a new truck analysis based on solution
        /// </summary>
        /// <param name="name">Analysis name</param>
        /// <param name="description">Description</param>
        /// <param name="truckProperties">Truck</param>
        /// <param name="constraintSet">ConstraintSet</param>
        /// <param name="solver">Solver to use to generate solutions</param>
        /// <returns></returns>
        public TruckAnalysis CreateNewTruckAnalysis(string name, string description, TruckProperties truckProperties, TruckConstraintSet constraintSet, ITruckSolver solver)
        {
            TruckAnalysis truckAnalysis = new TruckAnalysis(this.ParentDocument, _analysis, this, truckProperties, constraintSet);

            truckAnalysis.Name        = name;
            truckAnalysis.Description = description;
            _truckAnalyses.Add(truckAnalysis);
            AddDependancy(truckAnalysis);
            solver.ProcessAnalysis(truckAnalysis);
            ParentDocument.NotifyOnNewTruckAnalysisCreated(_analysis, this, truckAnalysis);
            ParentDocument.Modify();

            return(truckAnalysis);
        }
Esempio n. 9
0
        protected AnalysisPackableTruck(Document document, Packable packable, TruckProperties truckProperties,
                                        ConstraintSetPackableTruck constraintSet)
            : base(document, packable)
        {
            // sanity checks
            if ((null != truckProperties.ParentDocument) &&
                truckProperties.ParentDocument != ParentDocument)
            {
                throw new Exception("case & truck do not belong to the same document");
            }
            // also add dependancy
            TruckProperties = truckProperties;

            ConstraintSet = constraintSet;
        }
Esempio n. 10
0
 /// <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)
 {
     InitializeComponent();
     // set unit labels
     UnitsManager.AdaptUnitLabels(this);
     // save document reference
     _document = document;
     _truckProperties = truckProperties;
     // set caption text
     Text = string.Format(Properties.Resources.ID_EDIT, _truckProperties.Name);
     // initialize data
     tbName.Text = _truckProperties.Name;
     tbDescription.Text = _truckProperties.Description;
     TruckLength = _truckProperties.Length;
     TruckWidth = _truckProperties.Width;
     TruckHeight = _truckProperties.Height;
     TruckAdmissibleLoadWeight = _truckProperties.AdmissibleLoadWeight;
     TruckColor = _truckProperties.Color;
     // disable Ok button
     UpdateButtonOkStatus();
 }
Esempio n. 11
0
 public ConstraintSetCylinderTruck(TruckProperties truck)
     : base(truck)
 {
 }
Esempio n. 12
0
 public AnalysisHCylTruck(Document doc, CylinderProperties cylinder, TruckProperties truckProperties, ConstraintSetPackableTruck constraintSet)
     : base(doc, cylinder)
 {
     TruckProperties = truckProperties;
     ConstraintSet   = constraintSet;
 }
Esempio n. 13
0
 public TruckItem(TruckProperties truckProperties)
 {
     _truckProperties = truckProperties;
 }
Esempio n. 14
0
 /// <summary>
 /// Creates a new truck in this document
 /// </summary>
 /// <param name="name">Name</param>
 /// <param name="description">Description</param>
 /// <param name="length">Length</param>
 /// <param name="width">Width</param>
 /// <param name="height">Height</param>
 /// <param name="admissibleLoadWeight">AdmissibleLoadWeight</param>
 /// <param name="color">Color</param>
 /// <returns>TruckProperties</returns>
 public TruckProperties CreateNewTruck(
     string name, string description
     , double length
     , double width
     , double height
     , double admissibleLoadWeight
     , Color color)
 {
     TruckProperties truckProperties = new TruckProperties(this, length, width, height);
     truckProperties.Name = name;
     truckProperties.Description = description;
     truckProperties.AdmissibleLoadWeight = admissibleLoadWeight;
     truckProperties.Color = color;
     // insert in list
     _typeList.Add(truckProperties);
     // notify listeners
     NotifyOnNewTypeCreated(truckProperties);
     Modify();
     return truckProperties;
 }
Esempio n. 15
0
 public void Draw(Graphics3DControl ctrl, Graphics3D graphics)
 {
     if (TruckLength == 0 || TruckWidth == 0 || TruckHeight == 0)
         return;
     TruckProperties truckProperties = new TruckProperties(null, TruckLength, TruckWidth, TruckHeight);
     truckProperties.Color = TruckColor;
     Truck truck = new Truck(truckProperties);
     truck.DrawBegin(graphics);
     truck.DrawEnd(graphics);
     graphics.AddDimensions(new DimensionCube(TruckLength, TruckWidth, TruckHeight));
 }
Esempio n. 16
0
 public AnalysisCaseTruck(Document doc, Packable packable, TruckProperties truckProperties, ConstraintSetPackableTruck constraintSet)
     : base(doc, packable, truckProperties, constraintSet)
 {
 }
Esempio n. 17
0
 public void Save(TruckProperties truckProperties, XmlElement parentElement, XmlDocument xmlDoc)
 {
     // create xmlPalletProperties element
     XmlElement xmlTruckProperties = xmlDoc.CreateElement("TruckProperties");
     parentElement.AppendChild(xmlTruckProperties);
     // Id
     XmlAttribute guidAttribute = xmlDoc.CreateAttribute("Id");
     guidAttribute.Value = truckProperties.Guid.ToString();
     xmlTruckProperties.Attributes.Append(guidAttribute);
     // name
     XmlAttribute nameAttribute = xmlDoc.CreateAttribute("Name");
     nameAttribute.Value = truckProperties.Name;
     xmlTruckProperties.Attributes.Append(nameAttribute);
     // description
     XmlAttribute descAttribute = xmlDoc.CreateAttribute("Description");
     descAttribute.Value = truckProperties.Description;
     xmlTruckProperties.Attributes.Append(descAttribute);
     // length
     XmlAttribute lengthAttribute = xmlDoc.CreateAttribute("Length");
     lengthAttribute.Value = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", truckProperties.Length);
     xmlTruckProperties.Attributes.Append(lengthAttribute);
     // width
     XmlAttribute widthAttribute = xmlDoc.CreateAttribute("Width");
     widthAttribute.Value = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", truckProperties.Width);
     xmlTruckProperties.Attributes.Append(widthAttribute);
     // height
     XmlAttribute heightAttribute = xmlDoc.CreateAttribute("Height");
     heightAttribute.Value = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", truckProperties.Height);
     xmlTruckProperties.Attributes.Append(heightAttribute);
     // weight
     XmlAttribute weightAttribute = xmlDoc.CreateAttribute("AdmissibleLoadWeight");
     weightAttribute.Value = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", truckProperties.AdmissibleLoadWeight);
     xmlTruckProperties.Attributes.Append(weightAttribute);
     // color
     XmlAttribute colorAttribute = xmlDoc.CreateAttribute("Color");
     colorAttribute.Value = string.Format("{0}", truckProperties.Color.ToArgb());
     xmlTruckProperties.Attributes.Append(colorAttribute);
 }