protected void preload_DoWork(object sender, DoWorkEventArgs e)
        {
            if (_mustStopNow)
            {
                return;
            }

            recordedData = _sensor.get_recordedData(0, 0);

            try
            {
                recordedDataLoadProgress = recordedData.loadMore();
            }
            catch (Exception ex) { LogManager.Log(_hwdName + ": preload more caused an exception " + ex.ToString()); }


            globalDataLoadProgress = recordedDataLoadProgress;
            ((BackgroundWorker)sender).ReportProgress(recordedDataLoadProgress);
            List <YMeasure> measures = recordedData.get_preview();

            previewCurData = new List <pointXY>();


            int startIndex = 0;

            for (int i = startIndex; i < measures.Count; i++)
            {
                double t = measures[i].get_endTimeUTC();
                previewCurData.Add(new pointXY()
                {
                    x = t, y = measures[i].get_averageValue()
                });
            }
        }
Exemplo n.º 2
0
        internal YDataloggerContext(YSensor s, int start, int stop)
        {
            if (start < 0)
            {
                start = 0;
            }
            if (stop < 0)
            {
                stop = 0;
            }

            _sensor   = s;
            _dataset  = _sensor.get_recordedData(start, stop);
            _progress = _dataset.loadMore();
            _preview  = _dataset.get_preview();
        }
 /**
  * <summary>
  *   Returns a condensed version of the measures that can
  *   retrieved in this <c>YDataSet</c>, as a list of <c>YMeasure</c>
  *   objects.
  * <para>
  *   Each item includes:
  *   - the start of a time interval
  *   - the end of a time interval
  *   - the minimal value observed during the time interval
  *   - the average value observed during the time interval
  *   - the maximal value observed during the time interval
  * </para>
  * <para>
  *   This preview is available as soon as <c>loadMore()</c> has
  *   been called for the first time.
  * </para>
  * <para>
  * </para>
  * </summary>
  * <returns>
  *   a table of records, where each record depicts the
  *   measured values during a time interval
  * </returns>
  * <para>
  *   On failure, throws an exception or returns an empty array.
  * </para>
  */
 public virtual YMeasure[] get_preview()
 {
     return(_objref.get_preview().ToArray());
 }