Пример #1
0
 public InputParameters(UnitofVolume i_unitOfVolume, double i_GridCellArea, double i_BaseHorizonDiffValue, double i_FluidContact)
 {
     this.m_unitofVolume         = i_unitOfVolume;
     this.m_GridCellArea         = i_GridCellArea;
     this.m_BaseHorizonDiffValue = i_BaseHorizonDiffValue * Constants.MeterToFeet;
     this.m_FluidContact         = i_FluidContact * Constants.MeterToFeet;
 }
        /// <summary>
        /// Handles Volume Calculate Volume(Oil/Gas) and Exit Buttons Interactions
        /// </summary>
        /// <param name="parameter"></param>
        public void ButtonClickCommandHandler(object parameter)
        {
            try
            {
                switch ((parameter.ToString().Trim()))
                {
                case "Calculate Volume":
                    if (m_TopHorizonDepthValues != null && m_TopHorizonDepthValues.Count > 0)
                    {
                        UnitofVolume unitofVolume = UnitofVolume.CubicFeet;
                        if (CubicMeter)
                        {
                            unitofVolume = UnitofVolume.CubicMeter;
                        }
                        else if (Barrel)
                        {
                            unitofVolume = UnitofVolume.Barrel;
                        }
                        if (!m_isValuesReadFromConfig)
                        {
                            ReadConfigurationValues();
                        }
                        InputParameters  objParams = new InputParameters(unitofVolume, m_gridCellArea, m_twoHorizonsDepthDiff, m_fluidContactDepth);
                        VolumeCalculator objVCalc  = new VolumeCalculator(objParams, m_TopHorizonDepthValues);
                        Volume = objVCalc.ComputeVolume();
                    }
                    break;

                case "Exit":
                    Application.Current.Shutdown();
                    break;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }