示例#1
0
        public ActivityConditionIndex(OMSConditionIndexStore conditionIndex, List <string> expressions, List <ConsequenceStore> consequences)
        {
            _conditionIndex   = conditionIndex.ConditionCategory;
            _deConditionIndex = conditionIndex.AttributeDE;

            ConsequenceStore consequence = consequences.Find(delegate(ConsequenceStore c) { return(c.Attribute == "__" + conditionIndex.AttributeDE.Replace(" ", "").Replace("/", "")); });

            if (consequence != null)
            {
                _impact = consequence.Change;
            }

            foreach (string expression in expressions)
            {
                string partial = expression.Replace("(", "").Replace(")", "");
                if (partial.Contains("<"))// Maximum
                {
                    string[] values = partial.Split(' ');
                    string   value  = values[2].Replace("|", "");
                    _maximumIndex = double.Parse(value);
                }
                else if (partial.Contains(">")) //Minimum
                {
                    string[] values = partial.Split(' ');
                    string   value  = values[2].Replace("|", "");
                    _minimumIndex = double.Parse(value);
                }
            }
        }
示例#2
0
 public OMSAssetConditionIndexStore(AttributeStore conditionCategory, List <OCIWeightStore> weights)
 {
     _assetName = conditionCategory.AssetType;
     _conditionCategoryTable = conditionCategory.OmsTable;
     _conditionIndexes       = new List <OMSConditionIndexStore>();
     _weights = weights;
     foreach (OCIWeightStore ows in _weights)
     {
         OMSConditionIndexStore ciExists = _conditionIndexes.Find(delegate(OMSConditionIndexStore ci) { return(ci.ConditionCategory == ows.ConditionCategory); });
         if (ciExists == null)
         {
             OMSConditionIndexStore ci = new OMSConditionIndexStore(ows.ConditionCategory);
             _conditionIndexes.Add(ci);
         }
         if (!_uniqueCriteria.Contains(ows.Criteria))
         {
             _uniqueCriteria.Add(ows.Criteria);
         }
     }
 }