コード例 #1
0
 public CaseDefinitionViewer(CaseDefinition caseDefinition, BoxProperties boxProperties, CaseOptimConstraintSet caseConstraintSet)
 {
     _caseDefinition = caseDefinition;
     _boxProperties = boxProperties;
     _caseOptimConstraintSet = caseConstraintSet;
     _globalOrientation = new Orientation(HalfAxis.HAxis.AXIS_X_P, HalfAxis.HAxis.AXIS_Y_P);
 }
コード例 #2
0
 /// <summary>
 /// Instantiate a new case from a box, a case definition and a case optimization constraintset
 /// </summary>
 /// <param name="document">Parent document</param>
 /// <param name="bProperties">Box properties</param>
 /// <param name="constraintSet">Case optimization constraint set</param>
 public CaseOfBoxesProperties(Document document
     , BoxProperties boxProperties
     , CaseDefinition caseDefinition
     , CaseOptimConstraintSet constraintSet)
     : base(document)
 {
     _boxProperties = boxProperties;
     _boxProperties.AddDependancie(this);
     _caseDefinition = caseDefinition;
     _constraintSet = constraintSet;
     OnAttributeModified(boxProperties);
 }
コード例 #3
0
 /// <summary>
 /// Instantiate a new case from a box, a case definition and a case optimization constraintset
 /// </summary>
 /// <param name="document">Parent document</param>
 /// <param name="bProperties">Box properties</param>
 /// <param name="constraintSet">Case optimization constraint set</param>
 public CaseOfBoxesProperties(Document document
                              , BoxProperties boxProperties
                              , CaseDefinition caseDefinition
                              , CaseOptimConstraintSet constraintSet)
     : base(document)
 {
     _boxProperties = boxProperties;
     _boxProperties.AddDependancie(this);
     _caseDefinition = caseDefinition;
     _constraintSet  = constraintSet;
     OnAttributeModified(boxProperties);
 }
コード例 #4
0
        /// <summary>
        /// Build a list of all case definitions given a number of box
        /// </summary>
        /// <param name="iNumber">Number of items to fit in box</param>
        /// <returns></returns>
        public List<CaseDefinition> CaseDefinitions(int iNumber)
        {
            List<CaseDefinition> caseDefinitionList = new List<CaseDefinition>();
            foreach (PackArrangement arr in BoxArrangements(iNumber))
            {
                for (int i=0; i<3; ++i)
                    for (int j=0; j<3; ++j)
                    {
                        if (j == i)
                            continue;

                        CaseDefinition caseDefinition = new CaseDefinition(arr, i, j);
                        if (caseDefinition.IsValid(_boxProperties, _caseOptimConstraintSet))
                            caseDefinitionList.Add(caseDefinition);
                    }
            }
            return caseDefinitionList;
        }
コード例 #5
0
 public CaseOfBoxesProperties CreateNewCaseOfBoxes(
     string name, string description
     , BoxProperties boxProperties
     , CaseDefinition caseDefinition
     , CaseOptimConstraintSet constraintSet)
 {
     CaseOfBoxesProperties caseProperties = new CaseOfBoxesProperties(this, boxProperties, caseDefinition, constraintSet);
     caseProperties.Name = name;
     caseProperties.Description = description;
     // insert in list
     _typeList.Add(caseProperties);
     // notify listeners
     NotifyOnNewTypeCreated(caseProperties);
     Modify();
     return caseProperties;
 }
コード例 #6
0
 private void SaveCaseDefinition(CaseDefinition caseDefinition, XmlElement xmlBoxProperties, XmlDocument xmlDoc)
 {
     XmlElement xmlCaseDefElement = xmlDoc.CreateElement("CaseDefinition");
     xmlBoxProperties.AppendChild(xmlCaseDefElement);
     // case arrangement
     XmlAttribute xmlArrangement = xmlDoc.CreateAttribute("Arrangement");
     xmlArrangement.Value = caseDefinition.Arrangement.ToString();
     xmlCaseDefElement.Attributes.Append(xmlArrangement);
     // box orientation
     XmlAttribute xmlOrientation = xmlDoc.CreateAttribute("Orientation");
     xmlOrientation.Value = string.Format("{0} {1}", caseDefinition.Dim0, caseDefinition.Dim1);
     xmlCaseDefElement.Attributes.Append(xmlOrientation);
 }
コード例 #7
0
 private void LoadCaseDefinition(XmlElement eltCaseDefinition, out CaseDefinition caseDefinition)
 {
     string sArrangement = eltCaseDefinition.Attributes["Arrangement"].Value;
     string sDim = eltCaseDefinition.Attributes["Orientation"].Value;
     int[] iOrientation = Document.ParseInt2(sDim);
     caseDefinition = new CaseDefinition(
         PackArrangement.TryParse(sArrangement)
         , iOrientation[0]
         , iOrientation[1]);
 }
コード例 #8
0
 public CaseOptimSolution(CaseDefinition caseDefinition, CasePalletSolution palletSolution)
 {
     _caseDefinition = caseDefinition;
     _palletSolution = palletSolution;
 }
コード例 #9
0
 public CaseOptimSolution(CaseDefinition caseDefinition, CasePalletSolution palletSolution)
 {
     _caseDefinition = caseDefinition;
     _palletSolution = palletSolution;
 }