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(SelCylinderPalletSolution 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
            SelCylinderPalletSolution selSolution = new SelCylinderPalletSolution(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(SelCylinderPalletSolution 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
     SelCylinderPalletSolution selSolution = new SelCylinderPalletSolution(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();
 }
Example #6
0
        public void SaveCylinderPalletSolution(
            CylinderPalletAnalysis analysis
            , CylinderPalletSolution sol
            , SelCylinderPalletSolution 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 layersElt = xmlDoc.CreateElement("Layers");
            solutionElt.AppendChild(layersElt);

            foreach (ILayer layer in sol)
            {
                CylinderLayer cylLayer = layer as CylinderLayer;
                if (null != cylLayer)
                    Save(cylLayer, layersElt, xmlDoc);

                InterlayerPos interlayerPos = layer as InterlayerPos;
                if (null != interlayerPos)
                {
                    // Interlayer
                    XmlElement interlayerElt = xmlDoc.CreateElement("Interlayer");
                    layersElt.AppendChild(interlayerElt);
                    // ZLow
                    XmlAttribute zlowAttribute = xmlDoc.CreateAttribute("ZLow");
                    zlowAttribute.Value = string.Format(System.Globalization.CultureInfo.InvariantCulture, "{0}", interlayerPos.ZLow);
                    interlayerElt.Attributes.Append(zlowAttribute);
                }
            }
            if (null != selSolution)
            {
                // selected attribute
                XmlAttribute selAttribute = xmlDoc.CreateAttribute("Selected");
                selAttribute.Value = "true";
                solutionElt.Attributes.Append(selAttribute);
            }
        }
 public NodeTag(NodeType type, Document document, CylinderPalletAnalysis analysis, SelCylinderPalletSolution selSolution, TruckAnalysis truckAnalysis)
 {
     _type = type;
     _document = document;
     _itemProperties = null;
     _cylinderPalletAnalysis = analysis;
     _selCylinderPalletSolution = selSolution;
     _truckAnalysis = truckAnalysis;
 }
 private void onCylinderPalletSolutionSelectionRemoved(CylinderPalletAnalysis analysis, SelCylinderPalletSolution selSolution)
 {
     // retrieve parent document
     Document doc = analysis.ParentDocument;
     // get node
     TreeNode selSolutionNode = FindNode(null, new NodeTag(NodeTag.NodeType.NT_CYLINDERPALLETANALYSISSOLUTION, 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 onCylinderAnalysisSolutionSelected(CylinderPalletAnalysis analysis, SelCylinderPalletSolution selSolution)
 {
     // retrieve parent document
     Document doc = analysis.ParentDocument;
     // get parent node
     TreeNode parentNode = FindNode(null, new NodeTag(NodeTag.NodeType.NT_CYLINDERPALLETANALYSIS, doc, analysis));
     // inserted selected solution node
     TreeNode nodeSelSolution = new TreeNode(selSolution.Name, 15, 15);
     nodeSelSolution.Tag = new NodeTag(NodeTag.NodeType.NT_CYLINDERPALLETANALYSISSOLUTION, doc, analysis, selSolution);
     parentNode.Nodes.Add(nodeSelSolution);
     // expand tree nodes
     parentNode.Expand();
 }
 void onSolutionSelectionChanged(CylinderPalletAnalysis analysis, SelCylinderPalletSolution selSolution)
 {
     UpdateSelectButtonText();
     UpdateGridCheckBoxes();
 }