private List <YMeasure> LoadQT(string hwid)
        {
            YQt      qt       = YQt.FindQt(hwid);
            YDataSet dataset  = qt.get_recordedData(0, 0);
            int      progress = 0;

            do
            {
                progress = dataset.loadMore();
            } while(progress < 100);


            Console.WriteLine("Using DataLogger of " + qt.get_friendlyName());
            YMeasure        summary = dataset.get_summary();
            List <YMeasure> res_bad = dataset.get_measures();
            List <YMeasure> res     = new List <YMeasure>();

            foreach (YMeasure m in res_bad)
            {
                if (m.get_startTimeUTC() > 100)
                {
                    res.Add(m);
                }
            }


            String line = String.Format("from {0} to {1} : min={2:0.00} avg={3:0.00}  max={4:0.00}",
                                        summary.get_startTimeUTC_asDateTime().ToString(fmt), summary.get_endTimeUTC_asDateTime().ToString(fmt), summary.get_minValue(), summary.get_averageValue(), summary.get_maxValue()
                                        );

            Console.WriteLine(line);
            return(res);
        }
示例#2
0
        static void dumpSensor(YSensor sensor)
        {
            string fmt = "dd MMM yyyy hh:mm:ss,fff";

            Console.WriteLine("Using DataLogger of " + sensor.get_friendlyName());
            YDataSet dataset = sensor.get_recordedData(0, 0);

            Console.WriteLine("loading summary... ");
            dataset.loadMore();
            YMeasure summary = dataset.get_summary();
            String   line    =
                String.Format("from {0} to {1} : min={2:0.00}{5} avg={3:0.00}{5}  max={4:0.00}{5}",
                              summary.get_startTimeUTC_asDateTime().ToString(fmt),
                              summary.get_endTimeUTC_asDateTime().ToString(fmt), summary.get_minValue(),
                              summary.get_averageValue(), summary.get_maxValue(), sensor.get_unit());

            Console.WriteLine(line);
            Console.Write("loading details :   0%");
            int progress = 0;

            do
            {
                progress = dataset.loadMore();
                Console.Write(String.Format("\b\b\b\b{0,3:##0}%", progress));
            } while(progress < 100);
            Console.WriteLine("");
            List <YMeasure> details = dataset.get_measures();

            foreach (YMeasure m in details)
            {
                Console.WriteLine(
                    String.Format("from {0} to {1} : min={2:0.00}{5} avg={3:0.00}{5}  max={4:0.00}{5}",
                                  m.get_startTimeUTC_asDateTime().ToString(fmt),
                                  m.get_endTimeUTC_asDateTime().ToString(fmt), m.get_minValue(), m.get_averageValue(),
                                  m.get_maxValue(), sensor.get_unit()));
            }
        }
 /**
  * <summary>
  *   Returns an <c>YMeasure</c> object which summarizes the whole
  *   <c>YDataSet</c>.
  * <para>
  *   In includes the following information:
  *   - 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 summary is available as soon as <c>loadMore()</c> has
  *   been called for the first time.
  * </para>
  * <para>
  * </para>
  * </summary>
  * <returns>
  *   an <c>YMeasure</c> object
  * </returns>
  */
 public virtual YMeasure get_summary()
 {
     return(_objref.get_summary());
 }