Exemplo n.º 1
0
        private DynamicLayout GenAFNPanel()
        {
            var vm = this._vm;

            var layout = new DynamicLayout();

            layout.Bind((t) => t.Enabled, vm, v => v.AFNCrack.IsPanelEnabled);
            //layout.Bind((t) => t.Visible, vm, v => v.AFNCrack.IsPanelEnabled);

            layout.DefaultSpacing = new Size(4, 4);
            layout.DefaultPadding = new Padding(4);

            var wPerArea = new DoubleText();

            wPerArea.Width        = 250;
            wPerArea.ReservedText = ReservedText.Varies;
            wPerArea.SetDefault(_vm.AFNCrack.Default.FlowCoefficient);
            wPerArea.TextBinding.Bind(vm, _ => _.AFNCrack.FlowCoefficient.NumberText);
            layout.AddRow("Flow Coefficient:", wPerArea);


            var radFraction = new DoubleText();

            radFraction.ReservedText = ReservedText.Varies;
            radFraction.SetDefault(_vm.AFNCrack.Default.FlowExponent);
            radFraction.TextBinding.Bind(vm, _ => _.AFNCrack.FlowExponent.NumberText);
            layout.AddRow("Flow Exponent:", radFraction);

            layout.AddRow(null);

            return(layout);
        }
Exemplo n.º 2
0
        private DynamicLayout CreateOutdoorLayout()
        {
            var layout = new DynamicLayout();

            layout.DefaultSpacing = new Size(4, 4);

            layout.Bind(_ => _.Enabled, _vm, _ => _.IsOutdoorBoundary);

            var sun_CB = new CheckBox()
            {
                Text = "Sun Exposure"
            };

            sun_CB.CheckedBinding.Bind(_vm, _ => _.BCOutdoor.SunExposure.IsChecked);

            var wind_CB = new CheckBox()
            {
                Text = "Wind Exposure"
            };

            wind_CB.CheckedBinding.Bind(_vm, _ => _.BCOutdoor.WindExposure.IsChecked);

            layout.AddRow(sun_CB);
            layout.AddRow(wind_CB);


            var vFactor = new DoubleText();

            vFactor.ReservedText = ReservedText.Varies;
            vFactor.SetDefault(0);
            vFactor.TextBinding.Bind(_vm, _ => _.BCOutdoor.ViewFactor.NumberText);
            vFactor.Bind(_ => _.Enabled, _vm, _ => _.BCOutdoor.IsViewFactorInputEnabled);
            var autosize = new CheckBox()
            {
                Text = "Autocalculate"
            };

            autosize.Bind(_ => _.Checked, _vm, _ => _.BCOutdoor.IsViewFactorAutocalculate);
            layout.AddRow(autosize);
            layout.AddRow(vFactor);

            layout.AddRow("View Factor:");
            layout.AddRow(autosize);
            layout.AddRow(vFactor);

            return(layout);
        }
Exemplo n.º 3
0
        private GroupBox GenVentPanel()
        {
            var vm = this._vm;

            var layout = new DynamicLayout();

            layout.Bind((t) => t.Enabled, vm, v => v.VentilationOpening.IsPanelEnabled);
            //layout.Bind((t) => t.Visible, vm, v => v.VentilationOpening.IsPanelEnabled);

            // double fractionAreaOperable = 0.5, double fractionHeightOperable = 1, double dischargeCoefficient = 0.45,
            // bool windCrossVent = false, double flowCoefficientClosed = 0, double flowExponentClosed = 0.65, double twoWayThreshold = 0.0001

            layout.DefaultSpacing = new Size(4, 4);
            layout.DefaultPadding = new Padding(4);

            var wPerArea = new DoubleText();

            wPerArea.Width        = 250;
            wPerArea.ReservedText = ReservedText.Varies;
            wPerArea.SetDefault(_vm.VentilationOpening.Default.FractionAreaOperable);
            wPerArea.TextBinding.Bind(vm, _ => _.VentilationOpening.FractionAreaOperable.NumberText);
            layout.AddRow("Fraction Area Operable:");
            layout.AddRow(wPerArea);

            var radFraction = new DoubleText();

            radFraction.ReservedText = ReservedText.Varies;
            radFraction.SetDefault(_vm.VentilationOpening.Default.FractionHeightOperable);
            radFraction.TextBinding.Bind(vm, _ => _.VentilationOpening.FractionHeightOperable.NumberText);
            layout.AddRow("Fraction Height Operable:");
            layout.AddRow(radFraction);

            var visFraction = new DoubleText();

            visFraction.ReservedText = ReservedText.Varies;
            visFraction.SetDefault(_vm.VentilationOpening.Default.DischargeCoefficient);
            visFraction.TextBinding.Bind(vm, _ => _.VentilationOpening.DischargeCoefficient.NumberText);
            layout.AddRow("Discharge Coefficient:");
            layout.AddRow(visFraction);

            var autosize = new CheckBox()
            {
                Text = "WindCrossVent"
            };

            autosize.CheckedBinding.Bind(_vm, _ => _.VentilationOpening.WindCrossVent.IsChecked);
            layout.AddRow(autosize);

            var airFraction = new DoubleText();

            airFraction.ReservedText = ReservedText.Varies;
            airFraction.SetDefault(_vm.VentilationOpening.Default.FlowCoefficientClosed);
            airFraction.TextBinding.Bind(vm, _ => _.VentilationOpening.FlowCoefficientClosed.NumberText);
            layout.AddRow("Flow Coefficient Closed:");
            layout.AddRow(airFraction);

            var delta = new DoubleText();

            delta.ReservedText = ReservedText.Varies;
            delta.SetDefault(_vm.VentilationOpening.Default.FlowExponentClosed);
            delta.TextBinding.Bind(vm, _ => _.VentilationOpening.FlowExponentClosed.NumberText);
            layout.AddRow("Flow Exponent Closed:");
            layout.AddRow(delta);

            var twoWay = new DoubleText();

            twoWay.ReservedText = ReservedText.Varies;
            twoWay.SetDefault(_vm.VentilationOpening.Default.TwoWayThreshold);
            twoWay.TextBinding.Bind(vm, _ => _.VentilationOpening.TwoWayThreshold.NumberText);
            layout.AddRow("Two Way Threshold:");
            layout.AddRow(twoWay);

            layout.AddRow(null);


            var ltnByProgram = new CheckBox()
            {
                Text = ReservedText.NoControl
            };

            ltnByProgram.CheckedBinding.Bind(vm, _ => _.VentilationOpening.IsCheckboxChecked);

            var gp = new GroupBox()
            {
                Text = "Ventilation Opening", Height = 500
            };

            gp.Content = new StackLayout(ltnByProgram, layout)
            {
                Spacing = 4, Padding = new Padding(4)
            };
            return(gp);
        }