private void StatisticSubscriptionNewMeasurements(object sender, EventArgs<ICollection<IMeasurement>> e)
        {
            foreach (IMeasurement measurement in e.Argument)
            {
                int index = m_statistics.IndexOf(m => m.ID == measurement.ID);

                if (index < 0)
                {
                    MeasurementValue statistic = new MeasurementValue
                    {
                        ID = measurement.ID,
                        Value = measurement.Value,
                        Timestamp = GetUnixMilliseconds(measurement.Timestamp)
                    };

                    m_statistics.Add(statistic);
                }
                else
                {
                    m_statistics[index].Value = measurement.Value;
                    m_statistics[index].Timestamp = GetUnixMilliseconds(measurement.Timestamp);
                }
            }
        }
 private void DataSubscriptionNewMeasurements(object sender, EventArgs<ICollection<IMeasurement>> e)
 {
     lock (m_measurementLock)
     {
         foreach (IMeasurement measurement in e.Argument)
         {
             MeasurementValue value = new MeasurementValue();
             value.Timestamp = GetUnixMilliseconds(measurement.Timestamp);
             value.Value = measurement.Value;
             value.ID = measurement.ID;
             m_measurements.Add(value);
         }
     }
 }