Example #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="Model"></param>
        /// <param name="aValue"></param>
        public static void MakePaddockList(TStockList Model, ref TPaddInit[] aValue)
        {
            TPaddockInfo aPadd;
            int          Idx, Jdx;

            Array.Resize(ref aValue, Model.Paddocks.Count());

            for (Idx = 0; Idx < aValue.Length; Idx++)
            {
                aPadd             = Model.Paddocks.byIndex(Idx);
                aValue[Idx]       = new TPaddInit();
                aValue[Idx].name  = aPadd.sName;                                      // "name"
                aValue[Idx].area  = aPadd.fArea;                                      // "area"
                aValue[Idx].slope = aPadd.Slope;                                      // "slope"
                Array.Resize(ref aValue[Idx].forages, aPadd.Forages.Count());
                for (Jdx = 0; Jdx < aPadd.Forages.Count(); Jdx++)
                {
                    aValue[Idx].forages[Jdx] = aPadd.Forages.byIndex(Jdx).sName;
                }
                aValue[Idx].excretion = aPadd.sExcretionDest;                              // "excretion"
            }
        }
Example #2
0
        /// <summary>
        /// 
        /// </summary>
        /// <param name="Model"></param>
        /// <param name="aValue"></param>
        public static void MakePaddockList(TStockList Model, ref TPaddInit[] aValue)
        {
            TPaddockInfo aPadd;
            int Idx, Jdx;

            Array.Resize(ref aValue, Model.Paddocks.Count());

            for (Idx = 0; Idx < aValue.Length; Idx++)
            {
                aPadd = Model.Paddocks.byIndex(Idx);
                aValue[Idx] = new TPaddInit();
                aValue[Idx].name = aPadd.sName;                                       // "name"                                
                aValue[Idx].area = aPadd.fArea;                                       // "area"                                
                aValue[Idx].slope = aPadd.Slope;                                       // "slope"                               
                Array.Resize(ref aValue[Idx].forages, aPadd.Forages.Count());
                for (Jdx = 0; Jdx < aPadd.Forages.Count(); Jdx++)
                    aValue[Idx].forages[Jdx] = aPadd.Forages.byIndex(Jdx).sName;
                aValue[Idx].excretion = aPadd.sExcretionDest;                              // "excretion"                           
            }
        }