Ejemplo n.º 1
0
        // -------------------------------------------------------------------------------------
        //                              !!! CONSTRUCTOR METHODS !!!
        // -------------------------------------------------------------------------------------

        /// <summary>
        /// Standard Constructor sets parameters to default values
        /// </summary>
        public finances()
        {
            double[] values = { /*0.214,*/ 0.015, 0.0, /*0.04,*/ 0.18 };

            try
            {
                set_params_of(values);

                // init some EEG
                myEEG = new eeg2009();
            }
            catch (exception e)
            {
                Console.WriteLine(e.Message);
                Console.WriteLine("Could not create finances object!");
            }
        }
Ejemplo n.º 2
0
        // TODO - Methode mit mySubstrates auch hinzufügen, wird für EEG 2012 benötigt



        /// <summary>
        /// Read params from reader which reads a xml file.
        /// reads until end elements of finances
        /// </summary>
        /// <param name="reader">an open reader</param>
        public void getParamsFromXMLReader(ref XmlTextReader reader)
        {
            string xml_tag = "";

            bool do_while = true;

            while (reader.Read() && do_while)
            {
                switch (reader.NodeType)
                {
                case System.Xml.XmlNodeType.Element: // this knot is an element
                    xml_tag = reader.Name;

                    if (xml_tag == "EEG2009") // plant has EEG 2009
                    {
                        myEEG = new eeg2009();

                        myEEG.getParamsFromXMLReader(ref reader);
                    }
                    else if (xml_tag == "EEG2012") // plant has EEG 2012
                    {
                        myEEG = new eeg2012();

                        myEEG.getParamsFromXMLReader(ref reader);
                    }
                    break;

                case System.Xml.XmlNodeType.EndElement:
                    if (reader.Name == "finances")
                    {
                        do_while = false;
                    }

                    break;
                }
            }
        }