示例#1
0
        public ECTAnalysis CreateNewECTAnalysis(string name, string description)
        {
            ECTAnalysis ectAnalysis = new ECTAnalysis(this.ParentDocument, _analysis, this);

            _ectAnalyses.Add(ectAnalysis);
            AddDependancy(ectAnalysis);
            ParentDocument.Modify();

            return(ectAnalysis);
        }
示例#2
0
        /// <summary>
        /// Creates new truck analysis based on solution
        /// This method used when loading truck analysis from file
        /// </summary>
        /// <param name="name"></param>
        /// <param name="description"></param>
        /// <param name="truckProperties"></param>
        /// <param name="constraintSet"></param>
        /// <param name="solutions"></param>
        /// <returns></returns>
        public TruckAnalysis CreateNewTruckAnalysis(string name, string description, TruckProperties truckProperties, TruckConstraintSet constraintSet, List <TruckSolution> solutions)
        {
            TruckAnalysis truckAnalysis = new TruckAnalysis(this.ParentDocument, _analysis, this, truckProperties, constraintSet);

            truckAnalysis.ID.SetNameDesc(name, description);
            truckAnalysis.Solutions = solutions;
            _truckAnalyses.Add(truckAnalysis);
            AddDependancy(truckAnalysis);
            ParentDocument.Modify();

            return(truckAnalysis);
        }
示例#3
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();
 }
示例#4
0
        /// <summary>
        /// Creates a new truck analysis based on solution
        /// </summary>
        /// <param name="name">Analysis name</param>
        /// <param name="description">Description</param>
        /// <param name="truckProperties">Truck</param>
        /// <param name="constraintSet">ConstraintSet</param>
        /// <param name="solver">Solver to use to generate solutions</param>
        /// <returns></returns>
        public TruckAnalysis CreateNewTruckAnalysis(string name, string description, TruckProperties truckProperties, TruckConstraintSet constraintSet, ITruckSolver solver)
        {
            TruckAnalysis truckAnalysis = new TruckAnalysis(this.ParentDocument, _analysis, this, truckProperties, constraintSet);

            truckAnalysis.Name        = name;
            truckAnalysis.Description = description;
            _truckAnalyses.Add(truckAnalysis);
            AddDependancy(truckAnalysis);
            solver.ProcessAnalysis(truckAnalysis);
            ParentDocument.NotifyOnNewTruckAnalysisCreated(_analysis, this, truckAnalysis);
            ParentDocument.Modify();

            return(truckAnalysis);
        }
示例#5
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();
        }
 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();
 }
示例#7
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();
        }
        public void SelectSolutionByIndex(int index)
        {
            if (index < 0 || index >= _caseSolutions.Count)
            {
                return;
            }
            if (HasSolutionSelected(index))
            {
                return;
            }
            // instantiate new SelCaseSolution
            SelBoxCasePalletSolution selCaseSolution = new SelBoxCasePalletSolution(ParentDocument, this, _caseSolutions[index]);

            // insert in list
            _selectedSolutions.Add(selCaseSolution);
            // fire event
            if (null != SolutionSelected)
            {
                SolutionSelected(this, selCaseSolution);
            }
            //  set document modified
            ParentDocument.Modify();
        }
示例#9
0
        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
            SelBoxCaseSolution selSolution = new SelBoxCaseSolution(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();
        }