Exemplo n.º 1
0
        internal DataPointDto CreateDto()
        {
            DataPointDto dto = new DataPointDto();

            dto.Dao       = this.dao;
            dto.Value     = this.value;
            dto.Timestamp = this.timestamp;
            return(dto);
        }
Exemplo n.º 2
0
        private DataPointCircularQueueDto ReadDataPoints(int sequenceNumber)
        {
            DataPointCircularQueueDto dto = new DataPointCircularQueueDto();

            Debug.Assert(this.archiveTemplateIndex.ContainsKey(sequenceNumber));

            dto.MaxDataPoints = this.archiveTemplateIndex[sequenceNumber].MaxDataPoints;

            if (this.reader.IsEmptyElement != true)
            {
                this.reader.Read();

                do
                {
                    this.reader.Read();

                    DataPointDto dataPoint = new DataPointDto();

                    // Value
                    this.reader.ReadStartElement("Value");
                    dataPoint.Value = this.reader.ReadContentAsDouble();
                    this.reader.ReadEndElement();

                    // Timestamp
                    this.reader.ReadStartElement("Timestamp");
                    dataPoint.Timestamp = this.reader.ReadContentAsDateTime();
                    this.reader.ReadEndElement();

                    dto.Add(dataPoint);
                } while (this.reader.ReadToNextSibling("DataPoint"));

                this.reader.ReadEndElement();
            }
            else
            {
                this.reader.Read();
            }

            return(dto);
        }
Exemplo n.º 3
0
 internal void FixupFromDto(DataPointDto dto)
 {
     this.dao       = dto.Dao;
     this.value     = dto.Value;
     this.timestamp = dto.Timestamp;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Add a data point to the queue
 /// </summary>
 /// <param name="newDataPointDto">New data point to add</param>
 public void Add(DataPointDto newDataPointDto)
 {
     this.dataPoints.Add(newDataPointDto);
 }