Example #1
0
 public ReportData(
     CasePalletAnalysis palletAnalysis, SelCasePalletSolution selSolution
     , CylinderPalletAnalysis cylinderPalletAnalysis, SelCylinderPalletSolution selCylinderPalletSolution
     , HCylinderPalletAnalysis hCylinderPalletAnalysis, SelHCylinderPalletSolution selHCylinderPalletSolution
     , BoxCaseAnalysis boxCaseAnalysis, SelBoxCaseSolution selBoxCaseSolution
     , BoxCasePalletAnalysis caseAnalysis, SelBoxCasePalletSolution selCaseSolution
     , PackPalletAnalysis packPalletAnalysis, SelPackPalletSolution selPackPalletSolution
     )
 {
     // case/pallet analysis
     _palletAnalysis = palletAnalysis;
     _selSolution = selSolution;
     // box/case/pallet analysis
     _caseAnalysis = caseAnalysis;
     _selCaseSolution = selCaseSolution;
     // Cylinder analysis
     _cylinderPalletAnalysis = cylinderPalletAnalysis;
     _selCylinderPalletSolution = selCylinderPalletSolution;
     // HCylinder analysis
     _hCylinderPalletAnalysis = hCylinderPalletAnalysis;
     _selHCylinderPalletSolution = selHCylinderPalletSolution;
     // Box case analysis
     _boxCaseAnalysis = boxCaseAnalysis;
     _selBoxCaseSolution = selBoxCaseSolution;
     // Pack pallet analysis
     _packPalletAnalysis = packPalletAnalysis;
     _selPackPalletSolution = selPackPalletSolution;
 }
 public void UnSelectSolution(SelHCylinderPalletSolution selSolution)
 {
     if (null == selSolution)
     {
         return;                      // this solution not selected
     }
     // remove from list
     _selectedSolutions.Remove(selSolution);
     ParentDocument.RemoveItem(selSolution);
     // fire event
     if (null != SolutionSelectionRemoved)
     {
         SolutionSelectionRemoved(this, selSolution);
     }
     // set document modified (not analysis, otherwise selected solutions are erased)
     ParentDocument.Modify();
 }
        public void SelectSolutionByIndex(int index)
        {
            if (index < 0 || index > _solutions.Count)
            {
                return;  // no solution with this index
            }
            if (HasSolutionSelected(index))
            {
                return;                                         // solution already selected
            }
            // instantiate new SelSolution
            SelHCylinderPalletSolution selSolution = new SelHCylinderPalletSolution(ParentDocument, this, _solutions[index]);

            // insert in list
            _selectedSolutions.Add(selSolution);
            // fire event
            if (null != SolutionSelected)
            {
                SolutionSelected(this, selSolution);
            }
            // set document modified (not analysis, otherwise selected solutions are erased)
            ParentDocument.Modify();
        }
 public void UnSelectSolution(SelHCylinderPalletSolution selSolution)
 {
     if (null == selSolution) return; // this solution not selected
     // remove from list
     _selectedSolutions.Remove(selSolution);
     ParentDocument.RemoveItem(selSolution);
     // fire event
     if (null != SolutionSelectionRemoved)
         SolutionSelectionRemoved(this, selSolution);
     // set document modified (not analysis, otherwise selected solutions are erased)
     ParentDocument.Modify();
 }
 public void SelectSolutionByIndex(int index)
 {
     if (index < 0 || index > _solutions.Count)
         return;  // no solution with this index
     if (HasSolutionSelected(index)) return;             // solution already selected
     // instantiate new SelSolution
     SelHCylinderPalletSolution selSolution = new SelHCylinderPalletSolution(ParentDocument, this, _solutions[index]);
     // insert in list
     _selectedSolutions.Add(selSolution);
     // fire event
     if (null != SolutionSelected)
         SolutionSelected(this, selSolution);
     // set document modified (not analysis, otherwise selected solutions are erased)
     ParentDocument.Modify();
 }
 void onSolutionSelectionChanged(HCylinderPalletAnalysis analysis, SelHCylinderPalletSolution selSolution)
 {
     UpdateSelectButtonText();
     UpdateGridCheckBoxes();
 }
Example #7
0
 public void SaveHCylinderPalletSolution(
     HCylinderPalletAnalysis analysis
     , HCylinderPalletSolution sol
     , SelHCylinderPalletSolution selSolution
     , XmlElement solutionsElt
     , XmlDocument xmlDoc)
 {
     // Solution
     XmlElement solutionElt = xmlDoc.CreateElement("Solution");
     solutionsElt.AppendChild(solutionElt);
     // title
     XmlAttribute titleAttribute = xmlDoc.CreateAttribute("Title");
     titleAttribute.Value = sol.Title;
     solutionElt.Attributes.Append(titleAttribute);
     // limit
     XmlAttribute limitReached = xmlDoc.CreateAttribute("LimitReached");
     limitReached.Value = string.Format("{0}", (int)sol.LimitReached);
     solutionElt.Attributes.Append(limitReached);
     // layers
     XmlElement positionsElt = xmlDoc.CreateElement("CylPositions");
     solutionElt.AppendChild(positionsElt);
     foreach (CylPosition cylPos in sol)
     {
         // CylPosition
         XmlElement positionElt = xmlDoc.CreateElement("CylPosition");
         positionsElt.AppendChild(positionElt);
         // XmlAttribute
         XmlAttribute attPosition = xmlDoc.CreateAttribute("Position");
         attPosition.Value = cylPos.XYZ.ToString();
         positionElt.Attributes.Append(attPosition);
         XmlAttribute attAxisDir = xmlDoc.CreateAttribute("AxisDir");
         attAxisDir.Value = HalfAxis.ToString(cylPos.Direction);
         positionElt.Attributes.Append(attAxisDir);
     }
     if (null != selSolution)
     {
         // selected attribute
         XmlAttribute selAttribute = xmlDoc.CreateAttribute("Selected");
         selAttribute.Value = "true";
         solutionElt.Attributes.Append(selAttribute);
     }
 }
 public NodeTag(NodeType type, Document document, HCylinderPalletAnalysis analysis, SelHCylinderPalletSolution selSolution, TruckAnalysis truckAnalysis)
 {
     _type = type;
     _document = document;
     _itemProperties = null;
     _hCylinderPalletAnalysis = analysis;
     _selHCylinderPalletSolution = selSolution;
     _truckAnalysis = truckAnalysis;
 }
 private void onHCylinderPalletSolutionSelectionRemoved(HCylinderPalletAnalysis analysis, SelHCylinderPalletSolution selSolution)
 {
     // retrieve parent document
     Document doc = analysis.ParentDocument;
     // get node
     TreeNode selSolutionNode = FindNode(null, new NodeTag(NodeTag.NodeType.NT_HCYLINDERPALLETANALYSISSOLUTION, doc, analysis, selSolution));
     // test
     if (null == selSolutionNode)
     {
         _log.Error(string.Format("Failed to find a valid tree node for selSolution {0}", selSolution.Name));
         return;
     }
     // remove node
     Nodes.Remove(selSolutionNode);
 }
 private void onHCylinderAnalysisSolutionSelected(HCylinderPalletAnalysis analysis, SelHCylinderPalletSolution selSolution)
 {
     // retrieve parent document
     Document doc = analysis.ParentDocument;
     // get parent node
     TreeNode parentNode = FindNode(null, new NodeTag(NodeTag.NodeType.NT_HCYLINDERPALLETANALYSIS, doc, analysis));
     // inserted selected solution node
     TreeNode nodeSelSolution = new TreeNode(selSolution.Name, 15, 15);
     nodeSelSolution.Tag = new NodeTag(NodeTag.NodeType.NT_HCYLINDERPALLETANALYSISSOLUTION, doc, analysis, selSolution);
     parentNode.Nodes.Add(nodeSelSolution);
     // expand tree nodes
     parentNode.Expand();
 }