Ejemplo n.º 1
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.ID.SetNameDesc(form.AnalysisName, 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)
                    {
                        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.ID.SetNameDesc(form.ItemName, 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);
            }
        }
Ejemplo 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);
        }
Ejemplo n.º 3
0
        public BoxCaseAnalysis CreateNewBoxCaseAnalysisUI()
        {
            FormNewBoxCaseAnalysis form = new FormNewBoxCaseAnalysis(this);

            if (DialogResult.OK == form.ShowDialog())
            {
                // build constraint set
                BoxCaseConstraintSet constraintSet = new BoxCaseConstraintSet();
                // allowed axes
                constraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_X_N, form.AllowVerticalX);
                constraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_X_P, form.AllowVerticalX);
                constraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_Y_N, form.AllowVerticalY);
                constraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_Y_P, form.AllowVerticalY);
                constraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_Z_N, form.AllowVerticalZ);
                constraintSet.SetAllowedOrthoAxis(HalfAxis.HAxis.AXIS_Z_P, form.AllowVerticalZ);
                // 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.AnalysisName, form.AnalysisDescription
                    , form.SelectedBox, form.SelectedCase
                    , constraintSet
                    , new BoxCaseSolver());
            }
            return null;
        }