Ejemplo n.º 1
0
 public void UnSelectSolution(SelPackPalletSolution selSolution)
 {
     if (selSolution == null)
     {
         return;                      // this solution not selected
     }
     // remove from list
     _selectedSolutions.Remove(selSolution);
     ParentDocument.RemoveItem(selSolution);
     // fire event
     SolutionSelectionRemoved?.Invoke(this, selSolution);
     // set document modified (not analysis, otherwise selected solutions are erased)
     ParentDocument.Modify();
 }
Ejemplo n.º 2
0
        public void SelectSolutionBySol(PackPalletSolution sol)
        {
            if (HasSolutionSelected(sol))
            {
                return;
            }
            // instantiate new SelSolution
            var selSolution = new SelPackPalletSolution(ParentDocument, this, sol);

            // insert in list
            _selectedSolutions.Add(selSolution);
            // fire event
            SolutionSelected?.Invoke(this, selSolution);
            // set document modified (not analysis, otherwise selected solutions are erased)
            ParentDocument.Modify();
        }
Ejemplo n.º 3
0
        public void SelectSolutionByIndex(int index)
        {
            if (index < 0 || index > _solutions.Count)
            {
                return; // no solution with this index
            }
            if (HasSolutionSelected(index))
            {
                return;
            }
            // instantiate new SelSolution
            var selSolution = new SelPackPalletSolution(ParentDocument, this, _solutions[index]);

            // insert in list
            _selectedSolutions.Add(selSolution);
            // fire event
            SolutionSelected?.Invoke(this, selSolution);
            // set document modified (not analysis, otherwise selected solutions are erased)
            ParentDocument.Modify();
        }
 void onSolutionSelectionChanged(PackPalletAnalysis analysis, SelPackPalletSolution selSolution)
 {
     UpdateSelectButtonText();
     UpdateGridCheckBoxes();
 }
Ejemplo n.º 5
0
 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();
 }
Ejemplo n.º 6
0
 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();
 }
Ejemplo n.º 7
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);
     }
 }
Ejemplo n.º 8
0
 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();
 }
Ejemplo n.º 9
0
 public NodeTag(NodeType type, Document document, PackPalletAnalysis analysis, SelPackPalletSolution selSolution)
 {
     _type = type;
     _document = document;
     _itemProperties = null;
     _packPalletAnalysis = analysis;
     _selPackPalletSolution = selSolution;
 }
Ejemplo n.º 10
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);
 }
Ejemplo n.º 11
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();
 }
Ejemplo n.º 12
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; 
 }
Ejemplo n.º 13
0
 public ReportData(PackPalletAnalysis packPalletAnalysis, SelPackPalletSolution selPackPalletSolution)
 {
     _packPalletAnalysis = packPalletAnalysis;
     _selPackPalletSolution = selPackPalletSolution;
 }