/// <summary>Copy constructor</summary>
        public ThermalTimeState(ThermalTimeState toCopy, bool copyAll)
        {
            _parametersIO = new ParametersIO(this);

            for (int i = 0; i < Enum.GetNames(typeof(Delta)).Length; i++)
            {
                _deltaTT[i] = toCopy._deltaTT[i];
                _cumulTT[i] = toCopy._cumulTT[i];
            }
            if (copyAll) //by default nothing is copied to improve performances ( only the output needed to be saved must be copied)
            {
                _minTair = toCopy._minTair;

                _maxTair = toCopy._maxTair;

                _minTshoot = toCopy._minTshoot;

                _maxTshoot = toCopy._maxTshoot;

                _minTsoil = toCopy._minTsoil;

                _maxTsoil = toCopy._maxTsoil;

                _phaseValue = toCopy._phaseValue;
                //Debug
                if (toCopy._hourlyShootTemperature == null)
                {
                    _hourlyShootTemperature = null;
                }
                else
                {
                    for (int i = 0; i < 24; i++)
                    {
                        _hourlyShootTemperature[i] = toCopy._hourlyShootTemperature[i];
                    }
                }

                if (toCopy._hourlyAirTemperature == null)
                {
                    _hourlyAirTemperature = null;
                }
                else
                {
                    for (int i = 0; i < 24; i++)
                    {
                        _hourlyAirTemperature[i] = toCopy._hourlyAirTemperature[i];
                    }
                }
            }
        }
Exemple #2
0
        /// <summary>
        /// Calculate method for the component with test of preconditions
        /// </summary>
        /// <param name=t>ThermalTimeState Domain class contains the accessors to values</param>
        /// <param name="saveLog">Save log via a writer or show on screen</param>
        /// <param name="callID">Context description for violations</param>
        public void Estimate
            (IStrategySiriusQualityThermalTime st, ThermalTimeState t, bool saveLog, string callID)
        {
            _resultPreConditions  = String.Empty;
            _resultPostConditions = String.Empty;
            _resultPreConditions  = st.TestPreConditions(t, callID);
            st.Estimate
                (t);
            _resultPostConditions = st.TestPostConditions(t, callID);

            if (_resultPreConditions != String.Empty || _resultPostConditions != String.Empty)
            {
                p.TestsOut(_resultPreConditions + _resultPostConditions, saveLog, callID);
            }
        }
Exemple #3
0
 /// <summary>
 /// Calculate method for the component
 /// </summary>
 /// <param name=t>ThermalTimeState Domain class contains the accessors to values</param>
 public void Estimate
     (IStrategySiriusQualityThermalTime st, ThermalTimeState t)
 {
     st.Estimate
         (t);
 }
 public ThermalTimeBiomaWrapper(Universe universe) : base(universe)
 {
     thermalTimeComponent = new SiriusQualityThermalTime.Strategies.CalculateDailyThermalTime();
     thermalTimeState     = new SiriusQualityThermalTime.ThermalTimeState();
     loadParameters();
 }