public Sensor(string name, string nameshort, string unity, float min, float max) { this.Name = name; //Assign name this.NameShort = nameshort; //Assign short name this.Unity = unity; //Set unity this.Min = min; //Set min this.Max = max; //Set max //Add first Value Values = new ValueData[1]; Values[0] = new ValueData((min+max)/ 2); }
/// <summary> /// Add Value to Data Array, Create new List /// </summary> /// <param name="valdata"></param> public void AddValueDataToArray(ValueData valdata) { int newLength = 0; ValueData[] newList; if (Values != null) { newLength = Values.Length; newList = new ValueData[newLength + 1]; Values.CopyTo(newList, 0); } else { newList = new ValueData[1]; } newList[newList.GetUpperBound(0)] = valdata; Values = newList; }