public override IList <long> GetUnknownVariantIds(EcuConfiguration ecus)
        {
            List <long> list = new List <long>();

            if (ecus.UnknownEcuVariants.ToList <long>().BinarySearch(this.value) >= 0)
            {
                list.Add(this.value);
            }
            return(list);
        }
Beispiel #2
0
 public override IList <long> GetUnknownVariantIds(EcuConfiguration ecus)
 {
     return(this.missingVariants);
 }
Beispiel #3
0
        public override EEvaluationResult EvaluateVariantRule(ClientDefinition client, CharacteristicSet baseConfiguration, EcuConfiguration ecus)
        {
            bool flag = false;

            this.missingCharacteristics.Clear();
            this.missingVariants.Clear();
            EEvaluationResult result = EEvaluationResult.INVALID;

            foreach (RuleExpression ruleExpression in this.operands)
            {
                EEvaluationResult eevaluationResult = ruleExpression.EvaluateVariantRule(client, baseConfiguration, ecus);
                switch (eevaluationResult)
                {
                case EEvaluationResult.VALID:
                    this.missingCharacteristics.Clear();
                    this.missingVariants.Clear();
                    return(eevaluationResult);

                case EEvaluationResult.INVALID:
                    break;

                case EEvaluationResult.MISSING_CHARACTERISTIC:
                    this.missingCharacteristics.AddRange(ruleExpression.GetUnknownCharacteristics(baseConfiguration));
                    if (!flag)
                    {
                        flag   = true;
                        result = eevaluationResult;
                    }
                    break;

                case EEvaluationResult.MISSING_VARIANT:
                    this.missingVariants.AddRange(ruleExpression.GetUnknownVariantIds(ecus));
                    if (!flag)
                    {
                        flag   = true;
                        result = eevaluationResult;
                    }
                    break;

                default:
                    throw new Exception("Unknown result");
                }
            }
            return(result);
        }
Beispiel #4
0
 public override EEvaluationResult EvaluateVariantRule(ClientDefinition client, CharacteristicSet baseConfiguration, EcuConfiguration ecus)
 {
     if (client.AccessSiFa)
     {
         if (this.value == 0L)
         {
             return(EEvaluationResult.INVALID);
         }
         return(EEvaluationResult.VALID);
     }
     else
     {
         if (this.value == 0L)
         {
             return(EEvaluationResult.VALID);
         }
         return(EEvaluationResult.INVALID);
     }
 }
 public override EEvaluationResult EvaluateVariantRule(ClientDefinition client, CharacteristicSet baseConfiguration, EcuConfiguration ecus)
 {
     if (ecus.EcuVariants.ToList <long>().BinarySearch(this.value) >= 0)
     {
         return(EEvaluationResult.VALID);
     }
     if (ecus.UnknownEcuVariants.ToList <long>().BinarySearch(this.value) >= 0)
     {
         return(EEvaluationResult.MISSING_VARIANT);
     }
     return(EEvaluationResult.INVALID);
 }
        public override EEvaluationResult EvaluateVariantRule(ClientDefinition client, CharacteristicSet baseConfiguration, EcuConfiguration ecus)
        {
            long num;

            if (!baseConfiguration.Characteristics.TryGetValue(this.dataclassId, out num))
            {
                return(EEvaluationResult.MISSING_CHARACTERISTIC);
            }
            if (num == this.datavalueId)
            {
                return(EEvaluationResult.VALID);
            }
            return(EEvaluationResult.INVALID);
        }
Beispiel #7
0
        public override EEvaluationResult EvaluateVariantRule(ClientDefinition client, CharacteristicSet baseConfiguration, EcuConfiguration ecus)
        {
            if (baseConfiguration.ProdDates.Count == 0)
            {
                return(EEvaluationResult.MISSING_CHARACTERISTIC);
            }
            int num = baseConfiguration.ProdDates.BinarySearch(this.datevalue);

            switch (this.compareOperator)
            {
            case CompareExpression.ECompareOperator.EQUAL:
                if (num < 0)
                {
                    return(EEvaluationResult.INVALID);
                }
                return(EEvaluationResult.VALID);

            case CompareExpression.ECompareOperator.NOT_EQUAL:
                if (num >= 0)
                {
                    return(EEvaluationResult.INVALID);
                }
                return(EEvaluationResult.VALID);

            case CompareExpression.ECompareOperator.GREATER:
                if (num >= 0 && num < baseConfiguration.ProdDates.Count - 1)
                {
                    return(EEvaluationResult.VALID);
                }
                if (baseConfiguration.ProdDates.Count > 0 && baseConfiguration.ProdDates[0] > this.datevalue)
                {
                    return(EEvaluationResult.VALID);
                }
                return(EEvaluationResult.INVALID);

            case CompareExpression.ECompareOperator.GREATER_EQUAL:
                if (num >= 0)
                {
                    return(EEvaluationResult.VALID);
                }
                if (baseConfiguration.ProdDates.Count > 0 && baseConfiguration.ProdDates[0] > this.datevalue)
                {
                    return(EEvaluationResult.VALID);
                }
                return(EEvaluationResult.INVALID);

            case CompareExpression.ECompareOperator.LESS:
                if (num > 0)
                {
                    return(EEvaluationResult.VALID);
                }
                if (baseConfiguration.ProdDates.Count > 0 && baseConfiguration.ProdDates[baseConfiguration.ProdDates.Count - 1] < this.datevalue)
                {
                    return(EEvaluationResult.VALID);
                }
                return(EEvaluationResult.INVALID);

            case CompareExpression.ECompareOperator.LESS_EQUAL:
                if (num >= 0)
                {
                    return(EEvaluationResult.VALID);
                }
                if (baseConfiguration.ProdDates.Count > 0 && baseConfiguration.ProdDates[baseConfiguration.ProdDates.Count - 1] < this.datevalue)
                {
                    return(EEvaluationResult.VALID);
                }
                return(EEvaluationResult.INVALID);

            default:
                throw new Exception("Unknown logical operator");
            }
        }
Beispiel #8
0
        public override EEvaluationResult EvaluateVariantRule(ClientDefinition client, CharacteristicSet baseConfiguration, EcuConfiguration ecus)
        {
            EEvaluationResult eevaluationResult = this.operand.EvaluateVariantRule(client, baseConfiguration, ecus);

            if (eevaluationResult == EEvaluationResult.VALID)
            {
                return(EEvaluationResult.INVALID);
            }
            if (eevaluationResult == EEvaluationResult.INVALID)
            {
                return(EEvaluationResult.VALID);
            }
            return(eevaluationResult);
        }
Beispiel #9
0
 public override EEvaluationResult EvaluateVariantRule(ClientDefinition client, CharacteristicSet baseConfiguration, EcuConfiguration ecus)
 {
     if (ecus.IStufe != this.value && ecus.IStufe != 0L)
     {
         return(EEvaluationResult.INVALID);
     }
     return(EEvaluationResult.VALID);
 }
Beispiel #10
0
 public override IList <long> GetUnknownVariantIds(EcuConfiguration ecus)
 {
     return(this.operand.GetUnknownVariantIds(ecus));
 }
Beispiel #11
0
 public override EEvaluationResult EvaluateVariantRule(ClientDefinition client, CharacteristicSet baseConfiguration, EcuConfiguration ecus)
 {
     if (client.ClientDate >= DateTime.FromBinary(this.value))
     {
         return(EEvaluationResult.VALID);
     }
     return(EEvaluationResult.INVALID);
 }
Beispiel #12
0
 public override EEvaluationResult EvaluateVariantRule(ClientDefinition client, CharacteristicSet baseConfiguration, EcuConfiguration ecus)
 {
     if (ecus.SaLaPas.Count != 0 && ecus.SaLaPas.ToList <long>().BinarySearch(this.value) < 0)
     {
         return(EEvaluationResult.INVALID);
     }
     return(EEvaluationResult.VALID);
 }
Beispiel #13
0
 public override EEvaluationResult EvaluateVariantRule(ClientDefinition client, CharacteristicSet baseConfiguration, EcuConfiguration ecus)
 {
     return(EEvaluationResult.INVALID);
 }
Beispiel #14
0
 public virtual IList <long> GetUnknownVariantIds(EcuConfiguration ecus)
 {
     return(new List <long>());
 }