Exemplo n.º 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(SelPackPalletSolution 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 SelectSolutionBySol(PackPalletSolution sol)
        {
            if (HasSolutionSelected(sol))
            {
                return;
            }
            // instantiate new SelSolution
            SelPackPalletSolution selSolution = new SelPackPalletSolution(ParentDocument, this, sol);

            // 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 SelectSolutionByIndex(int index)
        {
            if (index < 0 || index > _solutions.Count)
            {
                return; // no solution with this index
            }
            if (HasSolutionSelected(index))
            {
                return;
            }
            // instantiate new SelSolution
            SelPackPalletSolution selSolution = new SelPackPalletSolution(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(PackPalletAnalysis analysis, SelPackPalletSolution selSolution)
 {
     UpdateSelectButtonText();
     UpdateGridCheckBoxes();
 }
Exemplo n.º 6
0
 private void SavePackPalletSolution(
     PackPalletSolution sol
     , SelPackPalletSolution 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);
     // layers
     XmlElement boxLayersElt = xmlDoc.CreateElement("BoxLayers");
     solutionElt.AppendChild(boxLayersElt);
     Save(sol.Layer, boxLayersElt, xmlDoc);
     // layerRefs
     XmlElement layerRefsElt = xmlDoc.CreateElement("LayerRefs");
     solutionElt.AppendChild(layerRefsElt);
     // layers
     foreach (LayerDescriptor layerDesc in sol.Layers)
     {
         XmlElement layerRefElt = xmlDoc.CreateElement("LayerRef");
         layerRefsElt.AppendChild(layerRefElt);
         XmlAttribute attributeSwapped = xmlDoc.CreateAttribute("Swapped");
         attributeSwapped.Value = layerDesc.Swapped.ToString();
         layerRefElt.Attributes.Append(attributeSwapped);
         XmlAttribute attributeHasInterlayer = xmlDoc.CreateAttribute("HasInterlayer");
         attributeHasInterlayer.Value = layerDesc.HasInterlayer.ToString();
         layerRefElt.Attributes.Append(attributeHasInterlayer);
     }
     // Is selected ?
     if (null != selSolution)
     {
         // selected attribute
         XmlAttribute selAttribute = xmlDoc.CreateAttribute("Selected");
         selAttribute.Value = "true";
         solutionElt.Attributes.Append(selAttribute);
     }
 }
Exemplo n.º 7
0
 public ReportData(PackPalletAnalysis packPalletAnalysis, SelPackPalletSolution selPackPalletSolution)
 {
     _packPalletAnalysis = packPalletAnalysis;
     _selPackPalletSolution = selPackPalletSolution;
 }
 public void UnSelectSolution(SelPackPalletSolution 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 SelectSolutionBySol(PackPalletSolution sol)
 {
     if (HasSolutionSelected(sol)) return;
     // instantiate new SelSolution
     SelPackPalletSolution selSolution = new SelPackPalletSolution(ParentDocument, this, sol);
     // 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 SelectSolutionByIndex(int index)
 {
     if (index < 0 || index > _solutions.Count)
         return; // no solution with this index
     if (HasSolutionSelected(index)) return;
     // instantiate new SelSolution
     SelPackPalletSolution selSolution = new SelPackPalletSolution(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();
 }
Exemplo n.º 11
0
 public NodeTag(NodeType type, Document document, PackPalletAnalysis analysis, SelPackPalletSolution selSolution)
 {
     _type = type;
     _document = document;
     _itemProperties = null;
     _packPalletAnalysis = analysis;
     _selPackPalletSolution = selSolution;
 }
Exemplo n.º 12
0
 private void onPackPalletAnalysisSolutionSelectionRemoved(PackPalletAnalysis analysis, SelPackPalletSolution selSolution)
 {
     // retrieve parent document
     Document doc = analysis.ParentDocument;
     // get node
     TreeNode selSolutionNode = FindNode(null, new NodeTag(NodeTag.NodeType.NT_PACKPALLETANALYSISSOLUTION, 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);
 }
Exemplo n.º 13
0
 private void onPackPalletAnalysisSolutionSelected(PackPalletAnalysis analysis, SelPackPalletSolution selSolution)
 {
     // retrieve parent document
     Document doc = analysis.ParentDocument;
     // get parent node
     TreeNode parentNode = FindNode(null, new NodeTag(NodeTag.NodeType.NT_PACKPALLETANALYSIS, doc, analysis));
     if (null == parentNode) throw new Exception("Failed to locate Analysis (NT_PACKPALLETANALYSIS) node...");
     // insert selected solution node
     TreeNode nodeSelSolution = new TreeNode(selSolution.Name, 15, 15);
     nodeSelSolution.Tag = new NodeTag(NodeTag.NodeType.NT_PACKPALLETANALYSISSOLUTION, doc, analysis, selSolution);
     parentNode.Nodes.Add(nodeSelSolution);
     // expand tree nodes
     parentNode.Expand();
 }