示例#1
0
 public TireDataConstrain Copy()
 {
     return(StaticFunctions.DeepCopy(this));
 }
示例#2
0
        virtual public void ExtractData(int NumSearch)
        {
            var maxmin = new TireDataMaxmin();

            ExtractedData.Clear();
            NotExtractedData.Clear();

            int i = 0;

            foreach (var data in Target)
            {
                /*
                 * bool add = true;
                 * foreach (TireDataColumn column in Enum.GetValues(typeof(TireDataColumn)))
                 * {
                 *  if (column == TireDataColumn.NT) continue;
                 *
                 *
                 *
                 *  bool add_EvalNot = true;
                 *  bool add_EvalOrd = false;
                 *  if (Constrains[column].Count != 0)
                 *  {
                 *      foreach (var constrain in Constrains[column])
                 *      {
                 *          if(!constrain.Not)
                 *          {
                 *              add_EvalOrd = add_EvalOrd || constrain.Evaluate(data);
                 *          }
                 *          else
                 *          {
                 *              add_EvalNot = constrain.Evaluate(data);
                 *          }
                 *          if (!add_EvalNot) break;
                 *      }
                 *  }
                 *  else
                 *  {
                 *      add_EvalNot = true;
                 *      add_EvalOrd = true;
                 *  }
                 *  add = add && (add_EvalNot && add_EvalOrd);
                 *  if (!add) break;
                 * }
                 *
                 *
                 *
                 *
                 * if (add)
                 * {
                 *  ExtractedData.Add(data);
                 * }
                 * else
                 * {
                 *  NotExtractedData.Add(data);
                 * }
                 */
                if (NumSearch > 0 && i >= NumSearch)
                {
                    break;
                }
                ++i;
                bool add = true;
                foreach (TireDataColumn column in Enum.GetValues(typeof(TireDataColumn)))
                {
                    if (column == TireDataColumn.NT)
                    {
                        continue;
                    }
                    bool remove = false;
                    foreach (var constrain in Constrains[column])
                    {
                        if (!constrain.Not)
                        {
                            continue;
                        }
                        if (!constrain.Evaluate(data))
                        {
                            remove = true;
                            break;
                        }
                    }
                    if (remove == true)
                    {
                        add = false;
                        break;
                    }
                    if (!remove)
                    {
                        remove = true;
                        int counttemp = 0;

                        if (column == TireDataColumn.NT)
                        {
                            continue;
                        }
                        foreach (var constrain in Constrains[column])
                        {
                            if (constrain.Not)
                            {
                                continue;
                            }
                            ++counttemp;
                            if (constrain.Evaluate(data))
                            {
                                remove = false;
                                break;
                            }
                        }

                        if (counttemp == 0)
                        {
                            remove = false;
                        }
                    }
                    add = add && !remove;
                }


                if (add)
                {
                    ExtractedData.Add(data);
                }
                else
                {
                    NotExtractedData.Add(data);
                }
            }
            State = TireDataSelectorState.Changed;
            ExtractedDataMaxmin = StaticFunctions.GetLimitData(ExtractedData);
        }
示例#3
0
        public override void ExtractData(int NumSearch)
        {
            var maxmin = new TireDataMaxmin();

            ExtractedData.Clear();
            NotExtractedData.Clear();
            IndexHolder.Clear();
            IndexHolder.Add(0);
            for (int i = 0; i < IndexHolderParent.Count - 1; ++i)
            {
                if (NumSearch > 0 && i >= NumSearch)
                {
                    break;
                }
                var  list = SplitedTransientTable(i);
                bool add  = true;
                foreach (var data in list)
                {
                    foreach (TireDataColumn column in Enum.GetValues(typeof(TireDataColumn)))
                    {
                        if (column == TireDataColumn.NT)
                        {
                            continue;
                        }
                        bool remove = false;
                        foreach (var constrain in Constrains[column])
                        {
                            if (!constrain.Not)
                            {
                                continue;
                            }
                            if (!constrain.Evaluate(data))
                            {
                                remove = true;
                                break;
                            }
                        }
                        if (remove == true)
                        {
                            add = false;
                            break;
                        }
                        if (!remove)
                        {
                            remove = true;
                            int counttemp = 0;

                            if (column == TireDataColumn.NT)
                            {
                                continue;
                            }
                            foreach (var constrain in Constrains[column])
                            {
                                if (constrain.Not)
                                {
                                    continue;
                                }
                                ++counttemp;
                                if (constrain.Evaluate(data))
                                {
                                    remove = false;
                                    break;
                                }
                                else
                                {
                                }
                            }

                            if (counttemp == 0)
                            {
                                remove = false;
                            }
                        }
                        add = add && !remove;
                    }
                }


                if (add)
                {
                    ExtractedData.AddRange(list);
                    IndexHolder.Add(ExtractedData.Count);
                }
                else
                {
                    NotExtractedData.AddRange(list);
                }
            }


            State = TireDataSelectorState.Changed;
            ExtractedDataMaxmin = StaticFunctions.GetLimitData(ExtractedData);
        }
示例#4
0
 public TireDataSet Copy()
 {
     return(StaticFunctions.DeepCopy(this));
 }