示例#1
0
        public void Deserialize()
        {
            _unitUnderTest.CreateDb(DbRootDir, TestDbName);

            var secondManagement = new DbManagement(true);
            secondManagement.GetDbNames().Count.Should().Be(1);
        }
示例#2
0
 public void DewPointTest()
 {
     var db = new DbManagement().GetDb("f*x");
     var queryTable = db.GetTable<float>("Aussen.Wetterstation.(?<k>.*?)$", "time > now() - 1y");
     var result = queryTable
         .Transform(i => i.GroupByHours(1, o => o.Mean()))
         .DewPoint("Temperatur", "Feuchtigkeit", "Taupunkt");
 }
示例#3
0
 public void DynamicTableInScript()
 {
     var db = new DbManagement().GetDb("f*x");
     var result =
         new ScriptingEngine(db,
             @"db.GetTable<float>(""Aussen.Wetterstation.(?<k>[TF]).*?$"", ""time > now() - 1M"")
     .Transform(i => i.GroupByHours(1, o => o.Mean()))
     .ZipAndAdd(""Sum"", t => t.T + t.F)").Execute();
 }
示例#4
0
        public void FixFromTo()
        {
            var dbm = new DbManagement();
            var db = dbm.GetDb("f*x");

            var sw = Stopwatch.StartNew();
            var mix = db.Collect(db.GetSerie<float>("Aussen.Wetterstation.Temperatur", "time > now() - 2d")
                .GroupBy("6h", a => a.Mean()),
                db.GetTable<float>(".*Feuchtigkeit", "time > now() - 2d"));
            sw.Stop();
        }
示例#5
0
        public void MovingAverage()
        {
            var db = new DbManagement().GetDb("f*x");
            var time = "time < now() - 14d and time > now() - 21d";

            var serie = db.GetSerie<float>("Aussen.Wetterstation.Temperatur", time)
                .Group(
                    g =>
                        g.ByTime.Minutes(10)
                            .TimeStampIsMiddle()
                            .ExpandTimeRangeByFactor(20)
                            .Aggregate(a => a.MeanByTime()));
        }
示例#6
0
 public void AllCalcTempValuesTest()
 {
     var db = new DbManagement().GetDb("f*x");
     var queryTable = db.GetTable<float>("Aussen.Wetterstation.(?<k>.*?)$", "time > now() - 1M");
     var result = queryTable
         .Transform(i => i.GroupByHours(1, o => o.Mean()))
         .AddDewPoint("Temperatur", "Feuchtigkeit")
         .AddAbsoluteHumidity("Temperatur", "Feuchtigkeit")
         .AddHumidex("Temperatur", "Feuchtigkeit")
         .AddHeatIndex("Temperatur", "Feuchtigkeit")
         .AddSleetLine("Temperatur", "Feuchtigkeit", 440)
         .AddSnowLine("Temperatur", "Feuchtigkeit", 440)
         .RemoveSerie("Feuchtigkeit");
 }
示例#7
0
 public void Setup()
 {
     _unitUnderTest = new DbManagement(true);
     _unitUnderTest.DetachAllDbs();
 }
示例#8
0
        public void DynamicWithRealDb()
        {
            var db = new DbManagement().GetDb("f*x");
            var queryTable = db.GetTable<float>("Aussen.Wetterstation.(?<k>[TF]).*?$", "time > now() - 1M");
            var result = queryTable
                .Group(g => g.ByTime.Hours(1).Aggregate(o => o.Mean()))
                .Calc(t => t.Sum = t.T + t.F);

            result.Series.Count().Should().Be(3);

            result = result.RemoveDbSeries();

            result.Series.Count().Should().Be(1);
        }
示例#9
0
 public void MultipleTableGroups()
 {
     var db = new DbManagement().GetDb("f*x");
     var queryTable = db.GetTable<float>("Innen.(?<g>.*).(?<k>Temperatur|Feuchtigkeit)$", "time > now() - 1M");
     var result = queryTable
         .Transform(i => i.GroupByHours(1, o => o.Mean()))
         .ZipToNew("Sum", t => t.Temperatur + t.Feuchtigkeit);
 }
示例#10
0
 public void MultipleAbsoluteHumidityTableGroups()
 {
     var db = new DbManagement().GetDb("f*x");
     var result =
         db.GetTable<float>("Innen.(?<g>.*).(?<k>Temperatur|Feuchtigkeit)$", "time > now() - 1M")
             .Transform(g => g.Group(i => i.ByTime.Hours(1).ExpandTimeRangeByFactor(7).Aggregate(o => o.Mean())))
             .GroupSeries().Transform(t => t.AbsoluteHumidity("Temperatur", "Feuchtigkeit")).MergeTables();
 }
示例#11
0
 public void SchneefallTest()
 {
     var db = new DbManagement().GetDb("Haus");
     var result = db.Schneefallgrenze("time > now() - 1d", "1m", 50);
 }
示例#12
0
 public void DewPoinTest()
 {
     var db = new DbManagement().GetDb("Haus");
     var result = db.DewPoint("Hm.*(?<g>(EG|OG).*)(?<k>Temp|Hum)","time > now() - 1d", "1m", "Temp", "Hum", 50);
 }