Exemplo n.º 1
0
 public string SWUnitsToString(SWUnitsEnum Units)
 {
     if (Units == SWUnitsEnum.Gravimetric)
     {
         return("grav. mm/mm");
     }
     if (Units == SWUnitsEnum.Volumetric)
     {
         return("mm/mm");
     }
     return("mm");
 }
Exemplo n.º 2
0
        /// <summary>
        /// Return SW. Units: vol mm/mm.
        /// </summary>
        public double[] SWVolumetric(Soil Soil)
        {
            if (SW == null)
            {
                return(null);
            }
            double[]    OriginalValues = (double[])SW.Clone();
            SWUnitsEnum originalUnits  = SWUnits;

            SWUnitsSet(SWUnitsEnum.Volumetric, Soil);
            double[] Values = (double[])SW.Clone();
            SW      = OriginalValues;
            SWUnits = originalUnits;
            return(Values);
        }
Exemplo n.º 3
0
 /// <summary>Change the units used for SW.</summary>
 /// <param name="ToUnits">To units.</param>
 public void SWUnitsSet(SWUnitsEnum ToUnits)
 {
     if (ToUnits != SWUnits)
     {
         // convert the numbers
         if (ToUnits == SWUnitsEnum.Gravimetric)
         {
             SW = SWGravimetric;
         }
         else if (ToUnits == SWUnitsEnum.mm)
         {
             SW = SWmm;
         }
         else if (ToUnits == SWUnitsEnum.Volumetric)
         {
             SW = SWVolumetric;
         }
         SWUnits = ToUnits;
     }
 }
Exemplo n.º 4
0
 public void SWUnitsSet(SWUnitsEnum ToUnits, Soil Soil)
 {
     if (ToUnits != SWUnits && SW != null)
     {
         // convert the numbers
         if (SWUnits == SWUnitsEnum.Volumetric)
         {
             if (ToUnits == SWUnitsEnum.Gravimetric)
             {
                 SW = MathUtility.Divide(SW, Soil.BDMapped(Thickness));
             }
             else if (ToUnits == SWUnitsEnum.mm)
             {
                 SW = MathUtility.Multiply(SW, Thickness);
             }
         }
         else if (SWUnits == SWUnitsEnum.Gravimetric)
         {
             if (ToUnits == SWUnitsEnum.Volumetric)
             {
                 SW = MathUtility.Multiply(SW, Soil.BDMapped(Thickness));
             }
             else if (ToUnits == SWUnitsEnum.mm)
             {
                 SW = MathUtility.Multiply(MathUtility.Multiply(SW, Soil.BDMapped(Thickness)), Thickness);
             }
         }
         else
         {
             if (ToUnits == SWUnitsEnum.Volumetric)
             {
                 SW = MathUtility.Divide(SW, Thickness);
             }
             else if (ToUnits == SWUnitsEnum.Gravimetric)
             {
                 SW = MathUtility.Divide(MathUtility.Divide(SW, Thickness), Soil.BDMapped(Thickness));
             }
         }
     }
     SWUnits = ToUnits;
 }
Exemplo n.º 5
0
 /// <summary>Change the units used for SW.</summary>
 /// <param name="ToUnits">To units.</param>
 public void SWUnitsSet(SWUnitsEnum ToUnits)
 {
     if (ToUnits != SWUnits)
     {
         // convert the numbers
         if (ToUnits == SWUnitsEnum.Gravimetric)
             SW = SWGravimetric;
         else if (ToUnits == SWUnitsEnum.mm)
             SW = SWmm;
         else if (ToUnits == SWUnitsEnum.Volumetric)
             SW = SWVolumetric;
         SWUnits = ToUnits;
     }
 }