The code of the ClimIndices API and of the IClimIndices interface is shown below.
ClimIndices API |
|
/* ---------------------------------------------------------------- Code generated by CRA.ModelLayer.ACC - API Code Generator http://components.biomamodelling.org/components/acc/help/ Ermes Movedi UNIMI 03/11/2014 11:17:49 ---------------------------------------------------------------- */ using System; using System.Collections.Generic; using System.Text; using CRA.AgroManagement; using CRA.ModelLayer.Core; namespace UNIMI.ClimIndices.Interfaces { /// <summary> /// UNIMI.ClimIndices.Interfaces component API /// </summary> public class ClimIndicesAPI { private string _resultPreConditions; private string _resultPostConditions; Preconditions p = new Preconditions(); /// <summary> /// Calculate method for the component /// </summary> /// <param name=d>DataWeather Domain class contains the accessors to values and the code to load/write parameters from an XML file (MPE)</param> /// <param name=u>UnivariateDataWeather Domain class contains the accessors to values and the code to load/write parameters from an XML file (MPE)</param> /// <param name=d1>DataClimIndices Domain class contains the accessors to values and the code to load/write parameters from an XML file (MPE)</param> public void Estimate (IClimIndicesStrategy st, DataWeather d, UnivariateDataWeather u, DataClimIndices dc) { st.Estimate (d, u, dc); } /// <summary> /// Calculate method for the component with test of preconditions /// </summary> /// <param name=d>DataWeather Domain class contains the accessors to values and the code to load/write parameters from an XML file (MPE)</param> /// <param name=u>UnivariateDataWeather Domain class contains the accessors to values and the code to load/write parameters from an XML file (MPE)</param> /// <param name=d1>DataClimIndices Domain class contains the accessors to values and the code to load/write parameters from an XML file (MPE)</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 (IClimIndicesStrategy st, DataWeather d, UnivariateDataWeather u, DataClimIndices dc, bool saveLog, string callID) { _resultPreConditions = String.Empty; _resultPostConditions = String.Empty; _resultPreConditions = st.TestPreConditions(d, u, dc, callID); st.Estimate (d, u, dc); _resultPostConditions = st.TestPostConditions(d, u, dc, callID); if (_resultPreConditions != String.Empty || _resultPostConditions != String.Empty) { p.TestsOut(_resultPreConditions + _resultPostConditions, saveLog, callID); } } /// <summary> /// Show the about form with access to the help and codedoc /// </summary> public void Info() { // The following assumes an about form called AboutBox //AboutBox a = new AboutBox(); //a.ShowDialog(); } } } |
IClimIndicesStrategy is the interface that all strategies must implement |
|
/* ----------------------------------------------------------- Code generated by CRA.ModelLayer.ACC - API Code Generator http://components.biomamodelling.org/components/acc/help/ Ermes Movedi UNIMI 03/11/2014 11:17:49 ----------------------------------------------------------- */ using System; using CRA.ModelLayer.Strategy; namespace UNIMI.ClimIndices.Interfaces { /// <summary> /// UNIMI.ClimIndices.Interfaces component model interface /// </summary> public interface IClimIndicesStrategy : IStrategy { /// <summary> /// Calculate method for models /// </summary> /// <param name=d>DataWeather Domain class contains the accessors to values and the code to load/write parameters from an XML file (MPE)</param> /// <param name=u>UnivariateDataWeather Domain class contains the accessors to values and the code to load/write parameters from an XML file (MPE)</param> /// <param name=d1>DataClimIndices Domain class contains the accessors to values and the code to load/write parameters from an XML file (MPE)</param> void Estimate (DataWeather d, UnivariateDataWeather u, DataClimIndices dc); /// <summary> /// Test of pre conditions /// </summary> /// <param name=d>DataWeather Domain class contains the accessors to values and the code to load/write parameters from an XML file (MPE)</param> /// <param name=u>UnivariateDataWeather Domain class contains the accessors to values and the code to load/write parameters from an XML file (MPE)</param> /// <param name=d1>DataClimIndices Domain class contains the accessors to values and the code to load/write parameters from an XML file (MPE)</param> /// <param name=callID>Preconditions test context</param> /// <returns>List of violations</returns> string TestPreConditions(DataWeather d, UnivariateDataWeather u, DataClimIndices dc, string callID); /// <summary> /// Test of post-conditions /// </summary> /// <param name=d>DataWeather Domain class contains the accessors to values and the code to load/write parameters from an XML file (MPE)</param> /// <param name=u>UnivariateDataWeather Domain class contains the accessors to values and the code to load/write parameters from an XML file (MPE)</param> /// <param name=d1>DataClimIndices Domain class contains the accessors to values and the code to load/write parameters from an XML file (MPE)</param> /// <param name=callID>Postconditions test context</param> /// <returns>List of violations</returns> string TestPostConditions(DataWeather d, UnivariateDataWeather u, DataClimIndices dc, string callID); /// <summary> /// Set parameters to the default value /// </summary> void SetParametersDefaultValue(); } } |
|
Created with the Personal Edition of HelpNDoc: Free EPub and documentation generator