Esempio n. 1
0
        public Receptor AddReceptor(String name)
        {
            ListOfReceptors = new List <Receptor>();
            Max             = new Receptor();
            Min             = new Receptor();

            foreach (Receptor receptor in ListOfReceptors) // odwołanie do obiektu nie zostału na wystapienie obiektu
            {
                if (receptor.Text == name)
                {
                    return(receptor);
                }
            }

            Receptor newReceptor = new Receptor(name);

            ListOfReceptors.Add(newReceptor);
            return(newReceptor);
        }
Esempio n. 2
0
        public Receptor AddReceptor(double interval)
        {
            ListOfReceptors = new List <Receptor>();
            Max             = new Receptor();
            Min             = new Receptor();

            if (ListOfReceptors.Count == 0)
            {
                Max.ReceptorValue = interval;
                Min.ReceptorValue = interval;
                Interval          = Max.ReceptorValue;
            }
            else
            {
                if (Interval > Max.ReceptorValue)
                {
                    Max.ReceptorValue = interval;
                    Interval          = Max.ReceptorValue - Min.ReceptorValue;
                }
                else if (Interval < Min.ReceptorValue)
                {
                    Min.ReceptorValue = interval;
                    Interval          = Max.ReceptorValue - Min.ReceptorValue;
                }
            }
            foreach (Receptor receptor in ListOfReceptors)
            {
                if (receptor.ReceptorValue == interval)
                {
                    return(receptor);
                }
            }
            Receptor newReceptor = new Receptor(interval);

            ListOfReceptors.Add(newReceptor);
            return(newReceptor);
        }
Esempio n. 3
0
 public void ConnectReceptor(Receptor receptor)
 {
     ListOfReceptors = new List <Receptor>();
     ListOfReceptors.Add(receptor);
 }