Esempio n. 1
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();
        }
Esempio n. 2
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();
        }