/// <summary>
        /// Generate new Intermediate with baselining values
        /// ${Appbeheer_01_Inloggen_br // reference (baseline value)
        /// ${Appbeheer_01_Inloggen_be // evaluated value (difference from baseline in %)
        /// ${Appbeheer_01_Inloggen_be_c // colorcode, mark when current value exceeds threshold th1, green when diff > -15%, red when diff > +15%
        /// </summary>
        /// <param name="intermediate"></param>
        /// <param name="baselineIntermediate"></param>
        /// <param name="baselineReferenceIntermediate"></param>
        /// <param name="colorcodeBetter"></param>
        /// <param name="colorcodeWorse"></param>
        /// <returns></returns>
        public Intermediate GenerateBaselineEvaluationValues(Intermediate intermediate, Intermediate baselineIntermediate, Intermediate baselineReferenceIntermediate, string colorcodeBetter, string colorcodeWorse)
        {
            Intermediate result = new Intermediate();

            // voor alle items in de baseline reference: doe evaluatie
            foreach (KeyValuePair <string, string> baselinePair in baselineReferenceIntermediate)
            {
                // add _br value from baseline reference
                result.AddValue(GetBaselineReferenceKey(baselinePair.Key), baselinePair.Value);

                // evaluate and generate _be and _be_c values
                if (intermediate.ContainsKey(baselinePair.Key))
                {
                    string baselineValueSeries          = baselineIntermediate.GetValue(baselinePair.Key);
                    string baselineThresholdValueSeries = baselineIntermediate.GetValue(Thresholds.GetThresholdColorKey(baselinePair.Key));

                    string currentValueSeries          = intermediate.GetValue(baselinePair.Key);
                    string currentThresholdValueSeries = intermediate.GetValue(Thresholds.GetThresholdColorKey(baselinePair.Key));

                    // generate _be and _be_c values
                    Intermediate evalResult = GenerateEvaluation(baselinePair.Key, baselineValueSeries, currentValueSeries, baselineThresholdValueSeries, currentThresholdValueSeries, colorcodeBetter, colorcodeWorse);
                    result.Add(evalResult);
                }
            }

            return(result);
        }
 /// <summary>
 /// Add new key=value or (if key exist): add value to list of values
 /// </summary>
 /// <param name="key"></param>
 /// <param name="value"></param>
 /// <param name="list"></param>
 private void AddToList(string key, string value, Intermediate list)
 {
     if (list.ContainsKey(key))
     {
         list[key] += Intermediate.LISTSEPARATOR + value;
     }
     else
     {
         list.Add(key, value);
     }
 }
Example #3
0
 /// <summary>
 /// Add transaction details key-value pair or replace value of existing key (warning)
 /// </summary>
 /// <param name="name"></param>
 /// <param name="value"></param>
 public void Add(string name, string value)
 {
     if (items.ContainsKey(name))
     {
         Log.WriteLine("WARNING: replacing value of existing key [" + name + "]");
         items[name] = value;
     }
     else
     {
         items.Add(name, value);
     }
 }