Ejemplo n.º 1
0
 /**
  * Moves the item with index down (if index >= 0 and index < count-1)
  * */
 public void moveItemDown(int index)
 {
     if (index >= 0 && index < temperatureProfilesList.Count() - 1)
     {
         TemperatureProfileFunction itemA = temperatureProfilesList[index];
         temperatureProfilesList[index]     = temperatureProfilesList[index + 1];
         temperatureProfilesList[index + 1] = itemA;
         OnUpdatedList();
     }
 }
Ejemplo n.º 2
0
        /**
         * Adds a profile to the current list of profiles based on the index matching the availableProfiles() method
         * */
        public void addProfileFunction(int index, double cA, double cB, double cC, double deltaTime)
        {
            List <TemperatureProfileFunction> availProf = availableProfiles();

            if (checkIndex(index, availProf))
            {
                //make new object with the given profile and parameters
                TemperatureProfileFunction prof = availProf.ElementAt(index);
                prof.coeffA = cA;
                prof.coeffB = cB;
                prof.coeffC = cC;
                prof.setDeltaTime(deltaTime);

                //add the allowed profile to the list
                temperatureProfilesList.Add(prof);
                //fire event that the list has changed
                OnUpdatedList();
            }
        }