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); }
/// <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); }
/// <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; }
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; }
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); }
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]); }
public CaseOptimSolution(CaseDefinition caseDefinition, CasePalletSolution palletSolution) { _caseDefinition = caseDefinition; _palletSolution = palletSolution; }