//Create a Recorded Session public Session(string vehicle_Name, Sensor[] sensors, DateTime start, DateTime end) { this.Vehicle_Name = vehicle_Name; this.Sensors = sensors; this.StartTime = start; this.EndTime = end; }
/// <summary> /// Add Sensor to Array (new Sensor(...)) /// </summary> /// <param name="s"></param> public void AddSensorToArray(Sensor s) { int newLength = 0; Sensor[] newList; if (Sensors != null) { newLength = Sensors.Length; newList = new Sensor[newLength + 1]; Sensors.CopyTo(newList, 0); } else { newList = new Sensor[1]; } newList[newList.GetUpperBound(0)] = s; Sensors = newList; }
//Create a Live Session! public Session(string vehicle_Name, Sensor[] sensors) { this.Vehicle_Name = vehicle_Name; this.Sensors = sensors; this.StartTime = DateTime.Now; }