Exemplo n.º 1
0
        private void FormNewBoxCaseAnalysis_Load(object sender, EventArgs e)
        {
            try
            {
                // name / description
                if (null != _analysis)
                {
                    tbName.Text        = _analysis.Name;
                    tbDescription.Text = _analysis.Description;

                    BoxProperties boxProperties = _analysis.BProperties as BoxProperties;
                    if (null != _analysis)
                    {
                        IncludeCaseAsBoxes = boxProperties.HasInsideDimensions;
                    }
                }
                // fill boxes combo
                ComboBoxHelpers.FillCombo(Boxes, cbBox, null == _analysis ? null : _analysis.BProperties);
                // fill case properties
                ComboBoxHelpers.FillCombo(Cases, cbCase, null == _analysis ? null : _analysis.CaseProperties);
                // allowed position box + allowed patterns
                if (null == _analysis)
                {
                    AllowVerticalX     = Settings.Default.AllowVerticalX;
                    AllowVerticalY     = Settings.Default.AllowVerticalY;
                    AllowVerticalZ     = Settings.Default.AllowVerticalZ;
                    IncludeCaseAsBoxes = Settings.Default.IncludeCaseAsBoxes;
                }
                else
                {
                    BoxCaseConstraintSet constraintSet = _analysis.ConstraintSet as BoxCaseConstraintSet;
                    if (null != constraintSet)
                    {
                        AllowVerticalX = constraintSet.AllowOrthoAxis(HalfAxis.HAxis.AXIS_X_N) || constraintSet.AllowOrthoAxis(HalfAxis.HAxis.AXIS_X_P);
                        AllowVerticalY = constraintSet.AllowOrthoAxis(HalfAxis.HAxis.AXIS_Y_N) || constraintSet.AllowOrthoAxis(HalfAxis.HAxis.AXIS_Y_P);
                        AllowVerticalZ = constraintSet.AllowOrthoAxis(HalfAxis.HAxis.AXIS_Z_N) || constraintSet.AllowOrthoAxis(HalfAxis.HAxis.AXIS_Z_P);
                    }
                }
            }
            catch (Exception ex)
            {
                _log.Error(ex.ToString());
            }
        }