Beispiel #1
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;
        }