Пример #1
0
        public bool TryAddParameter(ProfileParameter parameter)
        {
            if (this.TotalBytes + parameter.ByteCount > MaxBytes)
            {
                return(false);
            }

            this.Parameters.Add(parameter);
            return(true);
        }
Пример #2
0
 public MathValueAndDependencies(
     MathValue mathValue,
     ProfileParameter xParameter,
     Conversion xConversion,
     ProfileParameter yParameter,
     Conversion yConversion)
 {
     this.MathValue   = mathValue;
     this.XParameter  = xParameter;
     this.XConversion = xConversion;
     this.YParameter  = yParameter;
     this.YConversion = yConversion;
 }
Пример #3
0
        public MathValueProcessor(LogProfile profile, MathValueConfiguration mathValueConfiguration)
        {
            this.profile    = profile;
            this.mathValues = new List <MathValueAndDependencies>();

            foreach (MathValue mathValue in mathValueConfiguration.MathValues)
            {
                ProfileParameter xParameter  = null;
                Conversion       xConversion = null;
                ProfileParameter yParameter  = null;
                Conversion       yConversion = null;

                foreach (ProfileParameter parameter in this.profile.AllParameters)
                {
                    // TODO: Find the parameter in a configuration file that contains all parameters and conversions,
                    // pick the appropriate conversion even if it's not what the user chose for this log profile.
                    if (parameter.Name == mathValue.XParameter)
                    {
                        xParameter  = parameter;
                        xConversion = parameter.Conversion;
                    }

                    if (parameter.Name == mathValue.YParameter)
                    {
                        yParameter  = parameter;
                        yConversion = parameter.Conversion;
                    }
                }

                if ((xParameter != null) &&
                    (xConversion != null) &&
                    (yParameter != null) &&
                    (yConversion != null))
                {
                    MathValueAndDependencies valueAndDependencies = new MathValueAndDependencies(
                        mathValue,
                        xParameter,
                        xConversion,
                        yParameter,
                        yConversion);

                    this.mathValues.Add(valueAndDependencies);
                }
            }
        }