Example #1
0
 public ProgressDisplay()
 {
     ContentPanel.SetNarrative(this);
     //_ContentPanel.SetNarrative(this, QRA_Frontend.Resources.Narratives.BlankNarrative);
     InitializeComponent();
     Load += ProgressDisplay_Load;
 }
Example #2
0
        void IQraBaseNotify.Notify_LoadComplete()
        {
            var cpType = new ContentPanel().GetType();
            var cp     = (ContentPanel)QuickFunctions.GetFirstParentOfSpecifiedType(this, cpType);

            cp.SetNarrative(Narratives.CPO_Overpressure);

            pbOverpSpinner.Hide();
            InitializeInputGrid();
            InitializeInputOptionsTab();
        }
Example #3
0
        void IQraBaseNotify.Notify_LoadComplete()
        {
            //SetNarrative();
            ContentPanel.SetNarrative(this, Narratives.DP__Data_Probabilities);
            SetDischargeCoefficient();

            UpdateIgnitionProbablitiesList();
            FillIgnitionProbabilitiesTable();

            QraStateContainer.SetValue("ResultsAreStale", true);
            _mIgnoringChangeEvents = false;
        }
        void IQraBaseNotify.Notify_LoadComplete()
        {
            pbSpinner.Hide();
            var cpType = new ContentPanel().GetType();
            var cp     = (ContentPanel)QuickFunctions.GetFirstParentOfSpecifiedType(this, cpType);

            cp.SetNarrative(Narratives.GPD_GasPlumeDispersion);

            // Set up data-bind grids
            var vdColl = new ParameterWrapperCollection(new[]
            {
                new ParameterWrapper("PlumeWrapper.XMin", "X lower limit", DistanceUnit.Meter,
                                     StockConverters.DistanceConverter),
                new ParameterWrapper("PlumeWrapper.XMax", "X upper limit", DistanceUnit.Meter,
                                     StockConverters.DistanceConverter),
                new ParameterWrapper("PlumeWrapper.YMin", "Y lower limit", DistanceUnit.Meter,
                                     StockConverters.DistanceConverter),
                new ParameterWrapper("PlumeWrapper.YMax", "Y upper limit", DistanceUnit.Meter,
                                     StockConverters.DistanceConverter),
                new ParameterWrapper("PlumeWrapper.Contours", "Contours (mole fraction)", UnitlessUnit.Unitless,
                                     StockConverters.UnitlessConverter),

                new ParameterWrapper("SysParam.ExternalPresMPA", "Ambient pressure", PressureUnit.Pa,
                                     StockConverters.PressureConverter),
                new ParameterWrapper("SysParam.ExternalTempC", "Ambient temperature", TempUnit.Kelvin,
                                     StockConverters.TemperatureConverter),
                new ParameterWrapper("FlameWrapper.d_orifice", "Orifice diameter", DistanceUnit.Meter,
                                     StockConverters.DistanceConverter),
                new ParameterWrapper("OpWrapper.Cd0", "Orifice discharge coefficient", UnitlessUnit.Unitless,
                                     StockConverters.UnitlessConverter),
                new ParameterWrapper("FlameWrapper.P_H2", "Hydrogen pressure", PressureUnit.Pa,
                                     StockConverters.PressureConverter),
                new ParameterWrapper("FlameWrapper.T_H2", "Hydrogen temperature", TempUnit.Kelvin,
                                     StockConverters.TemperatureConverter),
                new ParameterWrapper("PlumeWrapper.jet_angle", "Angle of jet", AngleUnit.Radians,
                                     StockConverters.AngleConverter)
            });

            StaticGridHelperRoutines.InitInteractiveGrid(PlumeParams, vdColl, false);

            PlumeParams.Columns[0].Width = 200;
            PlumeParams.Columns[1].Width = 200;
            PlumeParams.Columns[2].Width = 200;

            //tbPlotTitle_TextChanged(tbPlotTitle,new System.EventArgs());
        }
Example #5
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);
        }
Example #6
0
 private void SetupUi()
 {
     ContentPanel.SetNarrative(this, Narratives.BU__UnderConstruction);
 }
Example #7
0
 void IQraBaseNotify.Notify_LoadComplete()
 {
     ContentPanel.SetNarrative(this, Narratives.CP_CP_PlotT_TopNarrative);
     InitializeInputGrid();
     pbSpinner.Hide();
 }
Example #8
0
 private void SetupUi()
 {
     ContentPanel.SetNarrative(this, Narratives.EX__HydrogenDeflagration);
 }
Example #9
0
 private void SetNarrative()
 {
     ContentPanel.SetNarrative(this, Narratives.CP_CP_PlotT_TopNarrative);
 }
Example #10
0
 private void SetupUi()
 {
     ContentPanel.SetNarrative(this, Narratives.BU__PrincipalExitBlocked);
 }
Example #11
0
 private void SetupUi()
 {
     ContentPanel.SetNarrative(this, Narratives.HM__ProtectionSystemsFailure);
 }
Example #12
0
 private void SetupUi()
 {
     ContentPanel.SetNarrative(this, Narratives.HM__ExposureFire);
 }
Example #13
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);
        }
Example #14
0
        void IQraBaseNotify.Notify_LoadComplete()
        {
            ContentPanel.SetNarrative(this, Narratives.HM__ExternalFactor);

            UiStateRoutines.SetSelectedDropdownValue(cbPipeDiams, "0.31");
        }
Example #15
0
 private void SetupUi()
 {
     ContentPanel.SetNarrative(this, Narratives.EX__PressureVesselBurst);
 }
Example #16
0
 private void SetupUi()
 {
     ContentPanel.SetNarrative(this, Narratives.CM__ConsequenceModels);
     SetupCfdInputGrid();
     FillExposureTimeUnitsSelector();
 }
Example #17
0
 private void SetNarrative()
 {
     ContentPanel.SetNarrative(this, Narratives.Scenarios);
 }
Example #18
0
 private void SetupUi()
 {
     ContentPanel.SetNarrative(this, Narratives.HM__UnintendedRelease);
 }