Esempio n. 1
0
 public void SetRanges(double dynamic_min_lowlimit, double dynamic_min_highlimit, double dynamic_max_lowlimit, double dynamic_max_highlimit, string units)
 {
     if (units == "MB")
     {
         // Round to nearest MB inwards to agree with MemorySpinner and avoid bugs like CA-34996.
         double lowMB, highMB;
         MemorySpinner.CalcMBRanges(dynamic_min_lowlimit, dynamic_min_highlimit, out lowMB, out highMB);
         this.dynamic_min_lowlimit  = lowMB * Util.BINARY_MEGA;
         this.dynamic_min_highlimit = highMB * Util.BINARY_MEGA;
         MemorySpinner.CalcMBRanges(dynamic_max_lowlimit, dynamic_max_highlimit, out lowMB, out highMB);
         this.dynamic_max_lowlimit  = lowMB * Util.BINARY_MEGA;
         this.dynamic_max_highlimit = highMB * Util.BINARY_MEGA;
     }
     else
     {
         // Round to nearest GB inwards to agree with MemorySpinner and avoid bugs like CA-34996.
         double lowGB, highGB;
         MemorySpinner.CalcGBRanges(dynamic_min_lowlimit, dynamic_min_highlimit, out lowGB, out highGB);
         this.dynamic_min_lowlimit  = lowGB * Util.BINARY_GIGA;
         this.dynamic_min_highlimit = highGB * Util.BINARY_GIGA;
         MemorySpinner.CalcGBRanges(dynamic_max_lowlimit, dynamic_max_highlimit, out lowGB, out highGB);
         this.dynamic_max_lowlimit  = lowGB * Util.BINARY_GIGA;
         this.dynamic_max_highlimit = highGB * Util.BINARY_GIGA;
     }
 }
Esempio n. 2
0
        public void SetRanges(long dynamic_min_lowlimit, long dynamic_min_highlimit, long dynamic_max_lowlimit, long dynamic_max_highlimit)
        {
            // Round to nearest MB inwards to agree with MemorySpinner and avoid bugs like CA-34996.
            long lowMB, highMB;

            MemorySpinner.CalcMBRanges(dynamic_min_lowlimit, dynamic_min_highlimit, out lowMB, out highMB);
            this.dynamic_min_lowlimit  = lowMB * Util.BINARY_MEGA;
            this.dynamic_min_highlimit = highMB * Util.BINARY_MEGA;
            MemorySpinner.CalcMBRanges(dynamic_max_lowlimit, dynamic_max_highlimit, out lowMB, out highMB);
            this.dynamic_max_lowlimit  = lowMB * Util.BINARY_MEGA;
            this.dynamic_max_highlimit = highMB * Util.BINARY_MEGA;
        }