示例#1
0
 public static void _SCALE(List <Scale> _Scales, ref int i, ref string line)
 {
     try{
         string temp = "";
         for (; i < line.Length && line[i] != ']'; i++)
         {
             temp += line[i];
         }
         for (; i < line.Length && line[i] != '<'; i++)
         {
             temp += line[i];
         }
         temp = temp.Trim();
         int   k     = 0;
         Scale scale = new Scale(
             Additional_functions.Trim(temp, ref k, '[', ']').Replace('\n', ' ').Replace('\r', ' ').Replace(" ", ""),
             Additional_functions.Trim(temp, ref k, '(', ')'),
             Additional_functions.ClearLine(ref i, line)
             );
         _Scales.Add(scale);
     }
     catch {
         Stored_Exceptions.Add(new Exception("Error: _Scales exception, Scale number " + _Scales.Count + 1));
     }
 }
示例#2
0
        public static void _LINK(List <Group> Groups, ref int i, ref string line)
        {
            string temp = Additional_functions.ClearLine(ref i, line);

            try
            {
                string[] links = temp.Split('&');
                int      k     = 0;
                Link     L     = new Link();
                foreach (var l in links)
                {
                    L.Add(
                        Additional_functions.Trim(l, ref k, '{', '}'),
                        Additional_functions.Trim(l, ref k, '{', '}'),
                        Convert.ToInt32(Additional_functions.Trim(l, ref k, '[', ']'))
                        );
                    k = 0;
                }
                Groups[Groups.Count - 1].Links.Add(L);
            }
            catch
            {
                Stored_Exceptions.Add(new Exception("Error: Link exception, in Group " + Groups.Count));
            }
        }
示例#3
0
        public static void _FUZZY_SETS(List <Fuzzy_sets> _Fuzzy_sets, ref int i, ref string line)
        {
            Fuzzy_sets F_s = new Fuzzy_sets
            {
                Name = (Additional_functions.Trim(line, ref i, '(', ')')).Trim()
            };
            string temp = Additional_functions.ClearLine(ref i, line).Replace('\n', ' ').Replace('\r', ' ').Replace(" ", "");

            try{
                string[] Functions = temp.Split(',');
                int      k         = 0;
                foreach (var f in Functions)
                {
                    F_s.Functions.Add(new Trapeze(
                                          Additional_functions.ToLine(Additional_functions.Trim(f, ref k, '[', ']'), Additional_functions.Trim(f, ref k, '[', ']')),
                                          Additional_functions.ToLine(Additional_functions.Trim(f, ref k, '[', ']'), Additional_functions.Trim(f, ref k, '[', ']'))
                                          ));
                    k = 0;
                }
                _Fuzzy_sets.Add(F_s);
            }
            catch {
                Stored_Exceptions.Add(new Exception("Error: _Fuzzy_sets exception, fuzzy sets number " + _Fuzzy_sets.Count + 1));
            }
        }
示例#4
0
        public static void _KEY(List <Key> _Keys, ref int i, ref string line)
        {
            string temp = Additional_functions.ClearLine(ref i, line);

            temp = temp.Replace('\n', ' ').Replace('\r', ' ').Replace(" ", "");
            try{
                Key      key  = new Key();
                string[] rows = temp.Split('+');
                foreach (var row in rows)
                {
                    int k = 0;
                    key.Add(new Element(
                                Convert.ToInt32(Additional_functions.Trim(row, ref k, '[', ']')),
                                Convert.ToInt32(Additional_functions.Trim(row, ref k, '(', ')')),
                                Convert.ToSingle(Additional_functions.Trim(row, ref k, '=', '*').Replace('.', ','))
                                ));
                }
                _Keys.Add(key);
            }
            catch {
                Stored_Exceptions.Add(new Exception("Error: _Keys exception, key number " + _Keys.Count + 1));
            }
        }