Exemplo n.º 1
0
        public BoxCaseAnalysis CreateNewBundleCaseAnalysisUI()
        {
            FormNewAnalysisBundleCase form = new FormNewAnalysisBundleCase(this, null);

            if (DialogResult.OK == form.ShowDialog())
            {
                // build constraint set
                BundleCaseConstraintSet constraintSet = new BundleCaseConstraintSet();
                // maximum case weight
                constraintSet.UseMaximumCaseWeight = form.UseMaximumCaseWeight;
                constraintSet.MaximumCaseWeight    = form.MaximumCaseWeight;
                // maximum number of items
                constraintSet.UseMaximumNumberOfBoxes = form.UseMaximumNumberOfBoxes;
                constraintSet.MaximumNumberOfBoxes    = form.MaximumNumberOfBoxes;

                return(CreateNewBoxCaseAnalysis(
                           form.ItemName, form.ItemDescription
                           , form.SelectedBundle, form.SelectedCase
                           , constraintSet
                           , new BoxCaseSolver()));
            }
            return(null);
        }
Exemplo n.º 2
0
        /// <summary>
        /// edit box / case analysis
        /// </summary>
        public void EditBoxCaseAnalysis(BoxCaseAnalysis boxCaseAnalysis)
        {
            bool recomputeRequired = false;

            if (boxCaseAnalysis.IsBoxAnalysis)
            {
                FormNewBoxCaseAnalysis form = new FormNewBoxCaseAnalysis(boxCaseAnalysis.ParentDocument, boxCaseAnalysis);
                if (recomputeRequired = (DialogResult.OK == form.ShowDialog()))
                {
                    // analysis name / description
                    boxCaseAnalysis.Name        = form.AnalysisName;
                    boxCaseAnalysis.Description = form.AnalysisDescription;
                    // selected box
                    boxCaseAnalysis.BProperties    = form.SelectedBox;
                    boxCaseAnalysis.CaseProperties = form.SelectedCase;
                    // constraint set
                    BCaseConstraintSet   constraintSet        = boxCaseAnalysis.ConstraintSet;
                    BoxCaseConstraintSet boxCaseConstraintSet = constraintSet as BoxCaseConstraintSet;
                    if (null != boxCaseConstraintSet)
                    {
                        // allowed axes
                        boxCaseConstraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_X_N, form.AllowVerticalX);
                        boxCaseConstraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_X_P, form.AllowVerticalX);
                        boxCaseConstraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_Y_N, form.AllowVerticalY);
                        boxCaseConstraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_Y_P, form.AllowVerticalY);
                        boxCaseConstraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_Z_N, form.AllowVerticalZ);
                        boxCaseConstraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_Z_P, form.AllowVerticalZ);
                    }
                    // use maximum case weight
                    constraintSet.UseMaximumCaseWeight = form.UseMaximumCaseWeight;
                    constraintSet.MaximumCaseWeight    = form.MaximumCaseWeight;
                    // use maximum number of items
                    constraintSet.UseMaximumNumberOfBoxes = form.UseMaximumNumberOfBoxes;
                    constraintSet.MaximumNumberOfBoxes    = form.MaximumNumberOfBoxes;
                }
            }
            else if (boxCaseAnalysis.IsBundleAnalysis)
            {
                FormNewAnalysisBundleCase form = new FormNewAnalysisBundleCase(boxCaseAnalysis.ParentDocument, boxCaseAnalysis);
                if (recomputeRequired = (DialogResult.OK == form.ShowDialog()))
                {
                    // analysis name / description
                    boxCaseAnalysis.Name        = form.ItemName;
                    boxCaseAnalysis.Description = form.ItemDescription;
                    // selected bundle
                    boxCaseAnalysis.BProperties    = form.SelectedBundle;
                    boxCaseAnalysis.CaseProperties = form.SelectedCase;
                    // constraint set
                    BCaseConstraintSet constraintSet = boxCaseAnalysis.ConstraintSet;
                    // use maximum case weight
                    constraintSet.UseMaximumCaseWeight = form.UseMaximumCaseWeight;
                    constraintSet.MaximumCaseWeight    = form.MaximumCaseWeight;
                    // use maximum number of items
                    constraintSet.UseMaximumNumberOfBoxes = form.UseMaximumNumberOfBoxes;
                    constraintSet.MaximumNumberOfBoxes    = form.MaximumNumberOfBoxes;
                }
            }
            if (recomputeRequired)
            {
                boxCaseAnalysis.OnEndUpdate(null);
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// edit box / case analysis
        /// </summary>
        public void EditBoxCaseAnalysis(BoxCaseAnalysis boxCaseAnalysis)
        {
            bool recomputeRequired = false;

            if (boxCaseAnalysis.IsBoxAnalysis)
            {
                FormNewBoxCaseAnalysis form = new FormNewBoxCaseAnalysis(boxCaseAnalysis.ParentDocument, boxCaseAnalysis);
                if (recomputeRequired = (DialogResult.OK == form.ShowDialog()))
                {
                    // analysis name / description
                    boxCaseAnalysis.Name = form.AnalysisName;
                    boxCaseAnalysis.Description = form.AnalysisDescription;
                    // selected box
                    boxCaseAnalysis.BProperties = form.SelectedBox;
                    boxCaseAnalysis.CaseProperties = form.SelectedCase;
                    // constraint set
                    BCaseConstraintSet constraintSet = boxCaseAnalysis.ConstraintSet;
                    BoxCaseConstraintSet boxCaseConstraintSet = constraintSet as BoxCaseConstraintSet;
                    if (null != boxCaseConstraintSet)
                    {
                        // allowed axes
                        boxCaseConstraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_X_N, form.AllowVerticalX);
                        boxCaseConstraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_X_P, form.AllowVerticalX);
                        boxCaseConstraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_Y_N, form.AllowVerticalY);
                        boxCaseConstraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_Y_P, form.AllowVerticalY);
                        boxCaseConstraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_Z_N, form.AllowVerticalZ);
                        boxCaseConstraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_Z_P, form.AllowVerticalZ);
                    }
                    // use maximum case weight
                    constraintSet.UseMaximumCaseWeight = form.UseMaximumCaseWeight;
                    constraintSet.MaximumCaseWeight = form.MaximumCaseWeight;
                    // use maximum number of items
                    constraintSet.UseMaximumNumberOfBoxes = form.UseMaximumNumberOfBoxes;
                    constraintSet.MaximumNumberOfBoxes = form.MaximumNumberOfBoxes;
                }
            }
            else if (boxCaseAnalysis.IsBundleAnalysis)
            {
                FormNewAnalysisBundleCase form = new FormNewAnalysisBundleCase(boxCaseAnalysis.ParentDocument, boxCaseAnalysis);
                if (recomputeRequired = (DialogResult.OK == form.ShowDialog()))
                {
                    // analysis name / description
                    boxCaseAnalysis.Name = form.ItemName;
                    boxCaseAnalysis.Description = form.ItemDescription;
                    // selected bundle
                    boxCaseAnalysis.BProperties = form.SelectedBundle;
                    boxCaseAnalysis.CaseProperties = form.SelectedCase;
                    // constraint set
                    BCaseConstraintSet constraintSet = boxCaseAnalysis.ConstraintSet;
                    // use maximum case weight
                    constraintSet.UseMaximumCaseWeight = form.UseMaximumCaseWeight;
                    constraintSet.MaximumCaseWeight = form.MaximumCaseWeight;
                    // use maximum number of items
                    constraintSet.UseMaximumNumberOfBoxes = form.UseMaximumNumberOfBoxes;
                    constraintSet.MaximumNumberOfBoxes = form.MaximumNumberOfBoxes;
                }
            }
            if (recomputeRequired)
                boxCaseAnalysis.OnEndUpdate(null);
        }
Exemplo n.º 4
0
        public BoxCaseAnalysis CreateNewBundleCaseAnalysisUI()
        {
            FormNewAnalysisBundleCase form = new FormNewAnalysisBundleCase(this, null);
            if (DialogResult.OK == form.ShowDialog())
            {
                // build constraint set
                BundleCaseConstraintSet constraintSet = new BundleCaseConstraintSet();
                // maximum case weight
                constraintSet.UseMaximumCaseWeight = form.UseMaximumCaseWeight;
                constraintSet.MaximumCaseWeight = form.MaximumCaseWeight;
                // maximum number of items
                constraintSet.UseMaximumNumberOfBoxes = form.UseMaximumNumberOfBoxes;
                constraintSet.MaximumNumberOfBoxes = form.MaximumNumberOfBoxes;

                return CreateNewBoxCaseAnalysis(
                    form.ItemName, form.ItemDescription
                    , form.SelectedBundle, form.SelectedCase
                    , constraintSet
                    , new BoxCaseSolver());
            }
            return null;
        }