コード例 #1
0
ファイル: ProgressDisplay.cs プロジェクト: spfeiffer1/hyram
 public ProgressDisplay()
 {
     ContentPanel.SetNarrative(this);
     //_ContentPanel.SetNarrative(this, QRA_Frontend.Resources.Narratives.BlankNarrative);
     InitializeComponent();
     Load += ProgressDisplay_Load;
 }
コード例 #2
0
        void IQraBaseNotify.Notify_LoadComplete()
        {
            //SetNarrative();
            ContentPanel.SetNarrative(this, Narratives.DP__Data_Probabilities);
            SetDischargeCoefficient();

            UpdateIgnitionProbablitiesList();
            FillIgnitionProbabilitiesTable();

            QraStateContainer.SetValue("ResultsAreStale", true);
            _mIgnoringChangeEvents = false;
        }
コード例 #3
0
        private void GenerateResults()
        {
            ContentPanel.SetNarrative(this, Narratives.SS__ScenarioStats);
            var result = QraStateContainer.GetValue <QraResult>("Result");

            // Set risk metrics
            dgRiskMetrics.Rows[0].Cells[1].Value = result.TotalPll;
            dgRiskMetrics.Rows[1].Cells[1].Value = result.Far;
            dgRiskMetrics.Rows[2].Cells[1].Value = result.Air;

            var curRow = 1;

            for (var i = 0; i < result.LeakResults.Count; i++)
            {
                var leakRes = result.LeakResults[i];
                dgRanking.Rows.Add(curRow++, leakRes.GetLeakSizeString(), "Shutdown", leakRes.ShutdownAvgEvents,
                                   leakRes.ProbShutdown, 0);
                dgRanking.Rows.Add(curRow++, leakRes.GetLeakSizeString(), "Jet fire", leakRes.JetfireAvgEvents,
                                   leakRes.ProbJetfire, leakRes.JetfirePllContrib);
                dgRanking.Rows.Add(curRow++, leakRes.GetLeakSizeString(), "Explosion", leakRes.ExplosAvgEvents,
                                   leakRes.ProbExplosion, leakRes.ExplosionPllContrib);
                dgRanking.Rows.Add(curRow++, leakRes.GetLeakSizeString(), "No ignition", leakRes.NoIgnAvgEvents,
                                   leakRes.ProbNoIgnition, 0);
            }

            // Load position plots
            pbPositionPlot000d01.SizeMode = PictureBoxSizeMode.Zoom;
            pbPositionPlot000d01.Load(result.PositionPlotFilenames[0]);
            pbPositionPlot000d10.Load(result.PositionPlotFilenames[1]);
            pbPositionPlot001d00.Load(result.PositionPlotFilenames[2]);
            pbPositionPlot010d00.Load(result.PositionPlotFilenames[3]);
            pbPositionPlot100d00.Load(result.PositionPlotFilenames[4]);

            // Add cut set data
            PopulateCutSetTable(CutSetDGV000d01, result.LeakResults[0], false);
            PopulateCutSetTable(CutSetDGV000d10, result.LeakResults[1], false);
            PopulateCutSetTable(CutSetDGV001d00, result.LeakResults[2], false);
            PopulateCutSetTable(CutSetDGV010d00, result.LeakResults[3], false);
            PopulateCutSetTable(CutSetDGV100d00, result.LeakResults[4], true);
        }
コード例 #4
0
 private void SetNarrative()
 {
     ContentPanel.SetNarrative(this, Narratives.Scenarios);
 }
コード例 #5
0
 private void SetupUi()
 {
     ContentPanel.SetNarrative(this, Narratives.CM__ConsequenceModels);
     SetupCfdInputGrid();
     FillExposureTimeUnitsSelector();
 }
コード例 #6
0
 private void SetupUi()
 {
     ContentPanel.SetNarrative(this, Narratives.BU__UnderConstruction);
 }
コード例 #7
0
ファイル: PhysFlameTemp.cs プロジェクト: spfeiffer1/hyram
 void IQraBaseNotify.Notify_LoadComplete()
 {
     ContentPanel.SetNarrative(this, Narratives.CP_CP_PlotT_TopNarrative);
     InitializeInputGrid();
     pbSpinner.Hide();
 }
コード例 #8
0
 private void SetupUi()
 {
     ContentPanel.SetNarrative(this, Narratives.EX__HydrogenDeflagration);
 }
コード例 #9
0
 private void SetNarrative()
 {
     ContentPanel.SetNarrative(this, Narratives.CP_CP_PlotT_TopNarrative);
 }
コード例 #10
0
 private void SetupUi()
 {
     ContentPanel.SetNarrative(this, Narratives.HM__ProtectionSystemsFailure);
 }
コード例 #11
0
 private void SetupUi()
 {
     ContentPanel.SetNarrative(this, Narratives.HM__ExposureFire);
 }
コード例 #12
0
        void IQraBaseNotify.Notify_LoadComplete()
        {
            StartIgnoringGridChangeEvents();

            // TODO (Cianan): Can simplify all this setup by using one-way binding to objects
            ContentPanel.SetNarrative(this, Narratives.SD__System_Description);
            // Set up component grid
            var vdColl = new ParameterWrapperCollection(new[]
            {
                new ParameterWrapper("Components.NrCompressors", "# Compressors"),
                new ParameterWrapper("Components.NrCylinders", "# Cylinders"),
                new ParameterWrapper("Components.NrValves", "# Valves"),
                new ParameterWrapper("Components.NrInstruments", "# Instruments"),
                new ParameterWrapper("Components.NrJoints", "# Joints"),
                new ParameterWrapper("Components.NrHoses", "# Hoses"),
                new ParameterWrapper("Components.PipeLength", "Pipes (length)", DistanceUnit.Meter,
                                     StockConverters.DistanceConverter),
                new ParameterWrapper("Components.NrFilters", "# Filters"),
                new ParameterWrapper("Components.NrFlanges", "# Flanges"),
                new ParameterWrapper("Components.NrExtraComp1", "# Extra Component 1"),
                new ParameterWrapper("Components.NrExtraComp2", "# Extra Component 2")
            });

            StaticGridHelperRoutines.InitInteractiveGrid(dgComponents, vdColl, false);

            // Set up system params grid
            var vdColl2 = new ParameterWrapperCollection(
                new[]
            {
                new ParameterWrapper("SysParam.PipeOD", "Pipe Outer Diameter", DistanceUnit.Inch,
                                     StockConverters.DistanceConverter),
                new ParameterWrapper("SysParam.PipeWallThick", "Pipe Wall Thickness", DistanceUnit.Inch,
                                     StockConverters.DistanceConverter),
                new ParameterWrapper("SysParam.InternalTempC", "Hydrogen Temperature", TempUnit.Celsius,
                                     StockConverters.TemperatureConverter),
                new ParameterWrapper("SysParam.InternalPresMPA", "Hydrogen Pressure", PressureUnit.MPa,
                                     StockConverters.PressureConverter),
                new ParameterWrapper("SysParam.ExternalTempC", "Ambient Temperature", TempUnit.Celsius,
                                     StockConverters.TemperatureConverter),
                new ParameterWrapper("SysParam.ExternalPresMPA", "Ambient Pressure", PressureUnit.MPa,
                                     StockConverters.PressureConverter)
            }
                );

            StaticGridHelperRoutines.InitInteractiveGrid(dgSystemParameters_Piping, vdColl2, false);
            dgSystemParameters_Piping.Columns[0].Width = 200;

            // Vehicle grid
            StaticGridHelperRoutines.InitInteractiveGrid(dgSystemParameters_Vehicles, new ParameterWrapperCollection(
                                                             new[]
            {
                new ParameterWrapper("nVehicles", "Number of Vehicles"),
                new ParameterWrapper("nFuelingsPerVehicleDay", "Number of Fuelings Per Vehicle Day"),
                new ParameterWrapper("nVehicleOperatingDays", "Number of Vehicle Operating Days per Year"),
                new ParameterWrapper("nDemands", "Annual Demands (calculated)", UnitlessUnit.Unitless,
                                     StockConverters.UnitlessConverter)
            }
                                                             ), false);

            dgSystemParameters_Vehicles.Columns[0].Width = 300;
            dgSystemParameters_Vehicles.Columns[1].Width = 100;

            // Set up facility grid
            StaticGridHelperRoutines.InitInteractiveGrid(dgFacilityParameters, new ParameterWrapperCollection(
                                                             new[]
            {
                new ParameterWrapper("Facility.Length", "Length (x-direction)", DistanceUnit.Meter,
                                     StockConverters.DistanceConverter),
                new ParameterWrapper("Facility.Width", "Width (z-direction)", DistanceUnit.Meter,
                                     StockConverters.DistanceConverter),
                new ParameterWrapper("Facility.Height", "Height (y-direction)", DistanceUnit.Meter,
                                     StockConverters.DistanceConverter)
            }
                                                             ), false);

            SetOccupantInputsGrid();

            // Set up enclosure grid
            StaticGridHelperRoutines.InitInteractiveGrid(dgEnclosure, new ParameterWrapperCollection(
                                                             new[]
            {
                new ParameterWrapper("Enclosure.Height", "Height", DistanceUnit.Meter,
                                     StockConverters.DistanceConverter),
                new ParameterWrapper("Enclosure.AreaOfFloorAndCeiling", "Area (floor and ceiling)",
                                     AreaUnit.SqMeters, StockConverters.AreaConverter),
                new ParameterWrapper("Enclosure.HeightOfRelease", "Height of release", DistanceUnit.Meter,
                                     StockConverters.DistanceConverter),
                new ParameterWrapper("Enclosure.XWall", "Distance from release to wall (perpendicular)",
                                     DistanceUnit.Meter, StockConverters.DistanceConverter)
            }
                                                             ));

            // Override grid
            var overrideColl = new ParameterWrapperCollection(new[]
            {
                new ParameterWrapper("H2Release.000d01", "0.01% H2 Release"),
                new ParameterWrapper("H2Release.000d10", "0.10% H2 Release"),
                new ParameterWrapper("H2Release.001d00", "1% H2 Release"),
                new ParameterWrapper("H2Release.010d00", "10% H2 Release"),
                new ParameterWrapper("H2Release.100d00", "100% H2 Release"),
                new ParameterWrapper("Failure.ManualOverride", "100% H2 Release (accidents and shutdown failures)"),
                new ParameterWrapper("Pdetectisolate", "Gas detection credit")
            });

            StaticGridHelperRoutines.InitInteractiveGrid(dgManualOverrides, overrideColl, false);


            var ceilingVentDgv = dgCeilingVent;

            SetVentGrid(ceilingVentDgv, WhichVent.Ceiling);
            ceilingVentDgv.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCells);

            var floorVentDgv = dgFloorVent;

            SetVentGrid(floorVentDgv, WhichVent.Floor);

            // Set up random seed textbox
            var saveIgnoreValue = _ignoreRandomSeedChangeEvent;

            _ignoreRandomSeedChangeEvent = true;
            try
            {
                var cv = GetRandomSeedFromDatabase();
                cv.EnsureBaseValueIsTruncatedInt();
                var newValue = Math.Truncate(cv.GetValue(UnitlessUnit.Unitless)[0]);
                tbRandomSeed.Text = Parsing.DoubleToString(Math.Truncate(newValue));
            }
            finally
            {
                _ignoreRandomSeedChangeEvent = saveIgnoreValue;
            }

            // Set up exclusion textbox
            var exclusionRadius = QraStateContainer.GetNdValue("QRAD:EXCLUSIONRADIUS");

            tbExclusionRadius.Text = Parsing.DoubleToString(exclusionRadius);

            SetXLocParamAndModifyCellVisibilityInOccupantsGrid();

            StopIgnoringGridChangeEvents();
            // If check is enabled in analysis, this ensures analysis will be re-run
            QraStateContainer.SetValue("ResultsAreStale", true);

            // Remove a page that's not yet used.
            tcFacilityParameters.TabPages.Remove(tpEnclosure);
        }
コード例 #13
0
        void IQraBaseNotify.Notify_LoadComplete()
        {
            ContentPanel.SetNarrative(this, Narratives.HM__ExternalFactor);

            UiStateRoutines.SetSelectedDropdownValue(cbPipeDiams, "0.31");
        }
コード例 #14
0
 private void SetupUi()
 {
     ContentPanel.SetNarrative(this, Narratives.EX__PressureVesselBurst);
 }
コード例 #15
0
 private void SetupUi()
 {
     ContentPanel.SetNarrative(this, Narratives.BU__PrincipalExitBlocked);
 }
コード例 #16
0
 private void SetupUi()
 {
     ContentPanel.SetNarrative(this, Narratives.HM__UnintendedRelease);
 }