Ejemplo n.º 1
0
        public static FrameConstructorForm GetUniqueInstance(float[] layerHeights, float[] spanWidths)
        {
            var ins = _uiniqueInstance ?? new FrameConstructorForm();

            //
            ins.SetDataGridView(layerHeights, spanWidths);
            //
            _uiniqueInstance = ins;
            return(ins);
        }
Ejemplo n.º 2
0
        public static FrameConstructorForm GetUniqueInstance(ushort layerCount, ushort spanCount)
        {
            var ins = _uiniqueInstance ?? new FrameConstructorForm();

            //
            ins.SetDataGridView(layerCount, spanCount);
            //
            _uiniqueInstance = ins;
            return(ins);
        }
Ejemplo n.º 3
0
        private void button_GenerateFrame_Click(object sender, EventArgs e)
        {
            // create a new form
            var layerCount = (ushort)textBoxNum_layers.ValueNumber;
            var spanCount  = (ushort)textBoxNum_spans.ValueNumber;


            // 构造窗口
            FrameConstructorForm fc = null;

            if ((layerCount > 0) && (spanCount > 0))
            {
                if (layerCount == _frameStructure.LayerHeights.Length &&
                    spanCount == _frameStructure.SpanWidths.Length)
                {
                    fc = FrameConstructorForm.GetUniqueInstance(_frameStructure.LayerHeights, _frameStructure.SpanWidths);
                }
                else
                {
                    fc = FrameConstructorForm.GetUniqueInstance(layerCount, spanCount);
                }
            }
            else
            {
                MessageBox.Show(@"框架的层数与跨数都必须大于0", @"提示", MessageBoxButtons.OK, MessageBoxIcon.Information);
                return;
            }

            if (fc != null)
            {
                var res = fc.ShowDialog();
                if (res == DialogResult.OK)
                {
                    Material mat  = _definitions.Materials.FirstOrDefault();
                    Profile  prof = _definitions.Profiles.FirstOrDefault();

                    _frameStructure = Frame.Create(fc.LayerHeights, fc.SpanWidths, defaultMat: mat, defaultProfile: prof);

                    //
                    RefreshUI_FrameTable(_frameStructure);
                    eZDataGridViewFrame.Refresh();

                    //
                    FramePointorChanged?.Invoke(_frameStructure);
                }
            }
        }
Ejemplo n.º 4
0
        /// <summary> 构造函数 </summary>
        private FrameConstructorForm()
        {
            _uiniqueInstance = this;
            InitializeComponent();
            //
            KeyPreview = true;
            //
            dgv_Layers.KeyDelete     = true;
            dgv_Layers.ShowRowNumber = true;
            dgv_Layers.SupportPaste  = true;
            //
            dgv_Spans.KeyDelete     = true;
            dgv_Spans.ShowRowNumber = true;
            dgv_Spans.SupportPaste  = true;
            //
            ColumnLayerHeight.ValueType = typeof(float);
            ColumnSpanWidth.ValueType   = typeof(float);

            //
        }