Beispiel #1
0
        /// <summary>
        /// set txtbox values to given substrate parameters
        /// </summary>
        /// <param name="mySubstrate">substrate</param>
        private void set_TxtBoxValues_to_substrate(substrate mySubstrate)
        {
            if (grpName == null)
            {
                return;
            }

            grpName.setSubstrate(mySubstrate);
            grpID.setSubstrate(mySubstrate);

            grpCost.setSubstrate(mySubstrate);

            grpRP.setSubstrate(mySubstrate);
            grpRL.setSubstrate(mySubstrate);
            grpNDF.setSubstrate(mySubstrate);
            grpADF.setSubstrate(mySubstrate);
            grpADL.setSubstrate(mySubstrate);

            grpTS.setSubstrate(mySubstrate);
            grpVS.setSubstrate(mySubstrate);
            grpD_VS.setSubstrate(mySubstrate);

            grpPH.setSubstrate(mySubstrate);
            grpNH4.setSubstrate(mySubstrate);
            grpTA.setSubstrate(mySubstrate);
            grpT.setSubstrate(mySubstrate);
            grpCSBfil.setSubstrate(mySubstrate);

            grpSva.setSubstrate(mySubstrate);
            grpSbu.setSubstrate(mySubstrate);
            grpSpro.setSubstrate(mySubstrate);
            grpSac.setSubstrate(mySubstrate);
            grpSI.setSubstrate(mySubstrate);

            grpkdis.setSubstrate(mySubstrate);
            grpkhydch.setSubstrate(mySubstrate);
            grpkhydpr.setSubstrate(mySubstrate);
            grpkhydli.setSubstrate(mySubstrate);

            grpkmc4.setSubstrate(mySubstrate);
            grpkmpro.setSubstrate(mySubstrate);
            grpkmac.setSubstrate(mySubstrate);
            grpkmh2.setSubstrate(mySubstrate);

            cmbSubstrateClass.SelectedItem = mySubstrate.get_param_of_s("substrate_class");
        }
Beispiel #2
0
        /// <summary>
        /// Standard constructor initializing the groupbox
        /// </summary>
        /// <param name="parentFrame">gui this GroupBox exists in</param>
        /// <param name="mySubstrate">substrate object which is represented by this grpboxtxt</param>
        /// <param name="param">substrate parameter which is represented by this grpboxtxt</param>
        /// <param name="mydelegate">function that is called when txtbox looses focus. can
        /// check the value on validity</param>
        /// <param name="xPos">x-coordinate of position of GroupBox</param>
        /// <param name="yPos">y-coordinate of position of GroupBox</param>
        /// <param name="id_unit">id + unit of physValue</param>
        /// <param name="label">label of physValue, is the title of the GroupBox</param>
        /// <param name="helpText">text visualized as help while txtbox has focus</param>
        /// <param name="width">width of the GroupBox</param>
        /// <param name="height">height of the GroupBox</param>
        public GrpBoxTxt(gui_substrate parentFrame, substrate mySubstrate, String param,
                         LeaveDelegate mydelegate, int xPos, int yPos,
                         String id_unit, String label, String helpText, int width, int height)
            : this()
        {
            // save parameters in local fields

            this.mySubstrate = mySubstrate;
            this.param       = param;
            this.mydelegate  = mydelegate;
            this.helpText    = helpText;
            parent           = parentFrame;


            // get to be displayed param from substrate

            String value = mySubstrate.get_param_of_s(param);

            //

            ToolTip tt = new ToolTip();

            // set attributes of this GrpBoxTxt

            Bounds = new Rectangle(new Point(xPos, yPos), new Size(width, height));

            // set attributes of groupbox

            grpBox.Bounds = new Rectangle(new Point(0, 0), new Size(width, height));
            grpBox.Text   = id_unit + ":";

            tt.SetToolTip(grpBox, label);

            // set attributes of txtBox

            txtValue.Bounds = new Rectangle(new Point(6, 19),
                                            new Size(width - 6 - 6, height - 19 - 6));
            txtValue.Text = value;

            tt.SetToolTip(txtValue, label);
        }
Beispiel #3
0
        // -------------------------------------------------------------------------------------
        //                            !!! PUBLIC METHODS !!!
        // -------------------------------------------------------------------------------------

        /// <summary>
        /// Set value of txtValue txtbox to param of mySubstrate
        /// </summary>
        /// <param name="mySubstrate">new substrate</param>
        public void setSubstrate(substrate mySubstrate)
        {
            this.mySubstrate = mySubstrate;

            txtValue.Text = mySubstrate.get_param_of_s(param);
        }
        // -------------------------------------------------------------------------------------
        //                            !!! PRIVATE METHODS !!!
        // -------------------------------------------------------------------------------------

        /// <summary>
        /// init gui with substrate fields
        ///
        /// creates the gui txtbox objects
        /// </summary>
        /// <param name="mySubstrates">list of substrates</param>
        /// <returns>true on success, else false</returns>
        private bool init_gui_with_substrate(substrates mySubstrates)
        {
            // fill list

            if (mySubstrates.Count == 0)
            {
                MessageBox.Show("Es ist kein Substrat in der Liste!", "Substratliste ist leer!",
                                MessageBoxButtons.OK, MessageBoxIcon.Error);

                return(false);
            }

            lstSubstrates.Items.Clear();

            foreach (substrate mySub in mySubstrates)
            {
                lstSubstrates.Items.Add(mySub.name);
            }

            //

            lstSubstrates.SelectedIndex = 0;

            // is also set in selectedIndexChanged event
            sel_substrate = 0;

            //

            substrate mySubstrate = get_sel_substrate();

            // general parameters

            grpName = new GrpBoxTxt(this, mySubstrate, "name", del_grpName, 6, 19,
                                    strings.substrate_name, strings.substrate_name_tt);
            grpID = new GrpBoxTxt(this, mySubstrate, "id", del_grpID, 132, 19,
                                  strings.substrate_id, strings.substrate_id_tt);

            grpCost = new GrpBoxPhys(this, mySubstrate, "cost", 258, 19);

            // weender analysis

            grpRP  = new GrpBoxPhys(this, mySubstrate, "RP", 6, 19);
            grpRL  = new GrpBoxPhys(this, mySubstrate, "RL", 132, 19);
            grpNDF = new GrpBoxPhys(this, mySubstrate, "NDF", 258, 19);
            grpADF = new GrpBoxPhys(this, mySubstrate, "ADF", 384, 19);
            grpADL = new GrpBoxPhys(this, mySubstrate, "ADL", 510, 19);

            // chemical and physical parameters

            grpTS   = new GrpBoxPhys(this, mySubstrate, "TS", 6, 19);
            grpVS   = new GrpBoxPhys(this, mySubstrate, "VS", 132, 19);
            grpD_VS = new GrpBoxPhys(this, mySubstrate, "D_VS", 258, 19);

            grpPH     = new GrpBoxPhys(this, mySubstrate, "pH", 6, 70);
            grpNH4    = new GrpBoxPhys(this, mySubstrate, "Snh4", 132, 70);
            grpTA     = new GrpBoxPhys(this, mySubstrate, "TAC", 258, 70);
            grpT      = new GrpBoxPhys(this, mySubstrate, "T", 384, 70);
            grpCSBfil = new GrpBoxPhys(this, mySubstrate, "COD_S", 510, 70);

            grpSva  = new GrpBoxPhys(this, mySubstrate, "Sva", 6, 121);
            grpSbu  = new GrpBoxPhys(this, mySubstrate, "Sbu", 132, 121);
            grpSpro = new GrpBoxPhys(this, mySubstrate, "Spro", 258, 121);
            grpSac  = new GrpBoxPhys(this, mySubstrate, "Sac", 384, 121);
            grpSI   = new GrpBoxPhys(this, mySubstrate, "SIin", 510, 121);

            // model parameters

            grpkdis   = new GrpBoxPhys(this, mySubstrate, "kdis", 6, 19);
            grpkhydch = new GrpBoxPhys(this, mySubstrate, "khyd_ch", 132, 19);
            grpkhydpr = new GrpBoxPhys(this, mySubstrate, "khyd_pr", 258, 19);
            grpkhydli = new GrpBoxPhys(this, mySubstrate, "khyd_li", 384, 19);

            grpkmc4  = new GrpBoxPhys(this, mySubstrate, "km_c4", 6, 70);
            grpkmpro = new GrpBoxPhys(this, mySubstrate, "km_pro", 132, 70);
            grpkmac  = new GrpBoxPhys(this, mySubstrate, "km_ac", 258, 70);
            grpkmh2  = new GrpBoxPhys(this, mySubstrate, "km_h2", 384, 70);

            //

            cmbSubstrateClass.SelectedItem = mySubstrate.get_param_of_s("substrate_class");

            // add grpboxes to surrounding groupboxes

            grpGeneral.Controls.Add(grpName);
            grpGeneral.Controls.Add(grpID);
            grpGeneral.Controls.Add(grpCost);

            grpWeender.Controls.Add(grpRP);
            grpWeender.Controls.Add(grpRL);
            grpWeender.Controls.Add(grpNDF);
            grpWeender.Controls.Add(grpADF);
            grpWeender.Controls.Add(grpADL);

            grpPhys.Controls.Add(grpTS);
            grpPhys.Controls.Add(grpVS);
            grpPhys.Controls.Add(grpD_VS);

            grpPhys.Controls.Add(grpPH);
            grpPhys.Controls.Add(grpNH4);
            grpPhys.Controls.Add(grpTA);
            grpPhys.Controls.Add(grpT);
            grpPhys.Controls.Add(grpCSBfil);

            grpPhys.Controls.Add(grpSva);
            grpPhys.Controls.Add(grpSbu);
            grpPhys.Controls.Add(grpSpro);
            grpPhys.Controls.Add(grpSac);
            grpPhys.Controls.Add(grpSI);

            grpModel.Controls.Add(grpkdis);
            grpModel.Controls.Add(grpkhydch);
            grpModel.Controls.Add(grpkhydpr);
            grpModel.Controls.Add(grpkhydli);

            grpModel.Controls.Add(grpkmc4);
            grpModel.Controls.Add(grpkmpro);
            grpModel.Controls.Add(grpkmac);
            grpModel.Controls.Add(grpkmh2);


            // enable command buttons

            cmdAdd.Enabled   = true;
            cmdDel.Enabled   = true;
            cmdPrint.Enabled = true;

            return(true);
        }