Пример #1
0
        private void getData(int ID)
        {
            RW_STREAM_BUS             SteamBus = new RW_STREAM_BUS();
            RW_EXTCOR_TEMPERATURE_BUS tempBus  = new RW_EXTCOR_TEMPERATURE_BUS();
            RW_STREAM             objSteam     = SteamBus.getData(ID);
            RW_EXTCOR_TEMPERATURE extTemp      = tempBus.getData(ID);

            txtFlowRate.Text             = objSteam.FlowRate.ToString();
            txtMaxOperatingPressure.Text = objSteam.MaxOperatingPressure.ToString();
            txtMinOperatingPressure.Text = objSteam.MinOperatingPressure.ToString();
            txtMaximumOperatingTemp.Text = objSteam.MaxOperatingTemperature.ToString();
            txtMinimumOperatingTemp.Text = objSteam.MinOperatingTemperature.ToString();
            txtCriticalExposure.Text     = objSteam.CriticalExposureTemperature.ToString();
            txtOperatingHydrogen.Text    = objSteam.H2SPartialPressure.ToString();

            txtOp12.Text  = extTemp.Minus12ToMinus8.ToString();
            txtOp8.Text   = extTemp.Minus8ToPlus6.ToString();
            txtOp6.Text   = extTemp.Plus6ToPlus32.ToString();
            txtOp32.Text  = extTemp.Plus32ToPlus71.ToString();
            txtOp71.Text  = extTemp.Plus71ToPlus107.ToString();
            txtOp107.Text = extTemp.Plus107ToPlus121.ToString();
            txtOp121.Text = extTemp.Plus121ToPlus135.ToString();
            txtOp135.Text = extTemp.Plus135ToPlus162.ToString();
            txtOp162.Text = extTemp.Plus162ToPlus176.ToString();
            txtOp176.Text = extTemp.MoreThanPlus176.ToString();
        }
Пример #2
0
        private void ShowDataToControl(int ID)
        {
            RW_STREAM_BUS SteamBus = new RW_STREAM_BUS();
            RW_STREAM     obj      = SteamBus.getData(ID);

            for (int i = 0; i < itemsAmineSolutionComposition.Length; i++)
            {
                if (obj.AmineSolution == itemsAmineSolutionComposition[i])
                {
                    cbAmineSolutionComposition.SelectedIndex = i + 1;
                    break;
                }
            }
            chkAqueousPhaseDuringOperation.Checked = Convert.ToBoolean(obj.AqueousOperation);
            chkAqueousPhaseShutdown.Checked        = Convert.ToBoolean(obj.AqueousShutdown);
            chkEnvironmentContainsCaustic.Checked  = Convert.ToBoolean(obj.Caustic);
            txtChlorideIon.Text              = obj.Chloride.ToString();
            txtCO3ConcentrationWater.Text    = obj.CO3Concentration.ToString();
            chkPresenceCyanides.Checked      = Convert.ToBoolean(obj.Cyanide);
            chkExposedAcidGas.Checked        = Convert.ToBoolean(obj.ExposedToGasAmine);
            chkExposedSulphurBearing.Checked = Convert.ToBoolean(obj.ExposedToSulphur);
            for (int i = 0; i < itemsExposureAmine.Length; i++)
            {
                if (obj.ExposureToAmine == itemsExposureAmine[i])
                {
                    cbExposureAmine.SelectedIndex = i + 1;
                    break;
                }
            }
            chkEnviromentContainsH2S.Checked = Convert.ToBoolean(obj.H2S);
            txtH2SContent.Text = obj.H2SInWater.ToString();
            chkPresenceHydrofluoricAcid.Checked = Convert.ToBoolean(obj.Hydrofluoric);
            chkChlorine.Checked         = Convert.ToBoolean(obj.MaterialExposedToClInt);
            txtNaOHConcentration.Text   = obj.NaOHConcentration.ToString();
            txtReleaseFluidPercent.Text = obj.ReleaseFluidPercentToxic.ToString();
            txtpHWater.Text             = obj.WaterpH.ToString();
            //tank
            //for (int i = 0; i < itemsTankFluid.Length; i++)
            //{
            //    if (obj.TankFluidName == itemsTankFluid[i])
            //    {
            //        cbFluidTank.SelectedIndex = i + 1;
            //        break;
            //    }
            //}
            txbModelFluid.Text                     = obj.TankFluidName;
            txtFluidHeight.Text                    = obj.FluidHeight.ToString();
            txtPercentageLeavingDike.Text          = obj.FluidLeaveDikePercent.ToString();
            txtPercentageLeavingRemainsOnSite.Text = obj.FluidLeaveDikeRemainOnSitePercent.ToString();
            txtPercentageFluidGoingOffsite.Text    = obj.FluidGoOffSitePercent.ToString();
        }
Пример #3
0
        public void ShowDatatoControl(int ID)
        {
            RW_STREAM_BUS SteamBus = new RW_STREAM_BUS();
            RW_STREAM     obj      = SteamBus.getData(ID);

            for (int i = 0; i < itemsAmineSolutionComposition.Length; i++)
            {
                if (obj.AmineSolution == itemsAmineSolutionComposition[i])
                {
                    cbAmineSolutionComposition.SelectedIndex = i + 1;
                    break;
                }
            }
            chkAqueousPhaseDuringOperation.Checked = Convert.ToBoolean(obj.AqueousOperation);
            chkAqueousPhaseShutdown.Checked        = Convert.ToBoolean(obj.AqueousShutdown);
            chkEnvironmentContainsCaustic.Checked  = Convert.ToBoolean(obj.Caustic);
            txtChlorideIon.Text              = obj.Chloride.ToString();
            txtCO3ConcentrationWater.Text    = obj.CO3Concentration.ToString();
            chkPresenceCyanides.Checked      = Convert.ToBoolean(obj.Cyanide);
            chkExposedAcidGas.Checked        = Convert.ToBoolean(obj.ExposedToGasAmine);
            chkExposedSulphurBearing.Checked = Convert.ToBoolean(obj.ExposedToSulphur);
            for (int i = 0; i < itemsExposureAmine.Length; i++)
            {
                if (obj.ExposureToAmine == itemsExposureAmine[i])
                {
                    cbExposureAmine.SelectedIndex = i + 1;
                    break;
                }
            }
            chkEnviromentContainsH2S.Checked    = Convert.ToBoolean(obj.H2S);
            txtH2SContentInWater.Text           = obj.H2SInWater.ToString();
            chkProcessContainsHydrogen.Checked  = Convert.ToBoolean(obj.Hydrogen);
            chkPresenceHydrofluoricAcid.Checked = Convert.ToBoolean(obj.Hydrofluoric);
            chkChlorine.Checked       = Convert.ToBoolean(obj.MaterialExposedToClInt);
            txtNaOHConcentration.Text = obj.NaOHConcentration.ToString();
            txtpHWater.Text           = obj.WaterpH.ToString();
            txbModelFluid.Text        = obj.TankFluidName;
            txbToxicFluid.Text        = obj.ToxicFluidName;
        }
        private void ShowDataToForm(int ID, string temperatureUnit, string pressureUnit, string flowRateUnit)
        {
            RW_STREAM_BUS             SteamBus = new RW_STREAM_BUS();
            RW_EXTCOR_TEMPERATURE_BUS tempBus  = new RW_EXTCOR_TEMPERATURE_BUS();
            RW_STREAM             objSteam     = SteamBus.getData(ID);
            RW_EXTCOR_TEMPERATURE extTemp      = tempBus.getData(ID);
            BUS_UNITS             convUnit     = new BUS_UNITS();

            switch (temperatureUnit)
            {
            case "DEG_C":
                txtMaximumOperatingTemp.Text = objSteam.MaxOperatingTemperature.ToString();
                txtMinimumOperatingTemp.Text = objSteam.MinOperatingTemperature.ToString();
                txtCriticalExposure.Text     = objSteam.CriticalExposureTemperature.ToString();
                break;

            case "DEG_F":
                txtMaximumOperatingTemp.Text = convUnit.CelToFah(objSteam.MaxOperatingTemperature).ToString();
                txtMinimumOperatingTemp.Text = convUnit.CelToFah(objSteam.MinOperatingTemperature).ToString();
                txtCriticalExposure.Text     = convUnit.CelToFah(objSteam.CriticalExposureTemperature).ToString();
                Console.WriteLine("Hha");
                break;

            case "K":
                txtMaximumOperatingTemp.Text = convUnit.CelToKenvin(objSteam.MaxOperatingTemperature).ToString();
                txtMinimumOperatingTemp.Text = convUnit.CelToKenvin(objSteam.MinOperatingTemperature).ToString();
                txtCriticalExposure.Text     = convUnit.CelToKenvin(objSteam.CriticalExposureTemperature).ToString();
                break;
            }
            switch (pressureUnit)
            {
            case "psi":
                txtMaxOperatingPressure.Text = objSteam.MaxOperatingPressure.ToString();
                txtMinOperatingPressure.Text = objSteam.MinOperatingPressure.ToString();
                txtOperatingHydrogen.Text    = objSteam.H2SPartialPressure.ToString();
                break;

            case "KSI":
                txtMaxOperatingPressure.Text = (objSteam.MaxOperatingPressure / convUnit.ksi).ToString();
                txtMinOperatingPressure.Text = (objSteam.MinOperatingPressure / convUnit.ksi).ToString();
                txtOperatingHydrogen.Text    = (objSteam.H2SPartialPressure / convUnit.ksi).ToString();
                break;

            case "bar":
                txtMaxOperatingPressure.Text = (objSteam.MaxOperatingPressure / convUnit.bar).ToString();
                txtMinOperatingPressure.Text = (objSteam.MinOperatingPressure / convUnit.bar).ToString();
                txtOperatingHydrogen.Text    = (objSteam.H2SPartialPressure / convUnit.bar).ToString();
                break;

            case "MPa":
                txtMaxOperatingPressure.Text = (objSteam.MaxOperatingPressure / convUnit.MPa).ToString();
                txtMinOperatingPressure.Text = (objSteam.MinOperatingPressure / convUnit.MPa).ToString();
                txtOperatingHydrogen.Text    = (objSteam.H2SPartialPressure / convUnit.MPa).ToString();
                break;

            case "N/m2":
                txtMaxOperatingPressure.Text = (objSteam.MaxOperatingPressure / convUnit.NpM2).ToString();
                txtMinOperatingPressure.Text = (objSteam.MinOperatingPressure / convUnit.NpM2).ToString();
                txtOperatingHydrogen.Text    = (objSteam.H2SPartialPressure / convUnit.NpM2).ToString();
                break;

            case "N/cm2":
                txtMaxOperatingPressure.Text = (objSteam.MaxOperatingPressure / convUnit.NpCM2).ToString();
                txtMinOperatingPressure.Text = (objSteam.MinOperatingPressure / convUnit.NpCM2).ToString();
                txtOperatingHydrogen.Text    = (objSteam.H2SPartialPressure / convUnit.NpCM2).ToString();
                break;
            }
            switch (flowRateUnit)
            {
            case "ft3/hr":
                txtFlowRate.Text = (objSteam.FlowRate / convUnit.ft3).ToString();
                break;

            case "m3/hr":
                txtFlowRate.Text = objSteam.FlowRate.ToString();
                break;
            }

            txtOp12.Text  = extTemp.Minus12ToMinus8.ToString();
            txtOp8.Text   = extTemp.Minus8ToPlus6.ToString();
            txtOp6.Text   = extTemp.Plus6ToPlus32.ToString();
            txtOp32.Text  = extTemp.Plus32ToPlus71.ToString();
            txtOp71.Text  = extTemp.Plus71ToPlus107.ToString();
            txtOp107.Text = extTemp.Plus107ToPlus121.ToString();
            txtOp121.Text = extTemp.Plus121ToPlus135.ToString();
            txtOp135.Text = extTemp.Plus135ToPlus162.ToString();
            txtOp162.Text = extTemp.Plus162ToPlus176.ToString();
            txtOp176.Text = extTemp.MoreThanPlus176.ToString();
        }