public virtual void GetLastValues_for_sensorType_filters_on_station_and_sensor() { var dataPoint = CreateDataPoint("s1", "st1"); _repository.Save(dataPoint); _repository.Save(CreateDataPoint("s2", "st1")); _repository.Save(CreateDataPoint("s1", "st2")); var foundDataPoint = _repository.GetLastValues("s1", "st1"); DataPoint.IdentityEquals(dataPoint, foundDataPoint).Should().BeTrue(); }
private List <DataPoint> GetLatestDataPoints(string stationId) { if (stationId == null) { return(new List <DataPoint>()); } return(_repository.GetLastValues(stationId)); }
public GetDataPointsResponse GetLastStationDataPoints(string stationId) { var lastValues = _repository.GetLastValues(stationId); return(new GetDataPointsResponse { DataPoints = lastValues.Select(ToDataPointApi).ToList() }); }
public JsonResult <StationLastValues> GetStationLastValues(string stationId) { var lastValues = _repository.GetLastValues(stationId); var stationData = new StationLastValues { StationId = stationId, LastValues = ToLastValues(lastValues) }; return(ToJson(stationData)); }
// GET: Sensor public ActionResult Details(string stationId, string sensorType, int size = 300, int?reloadSeconds = null) { var dataPoint = _repository.GetLastValues(stationId, sensorType); var model = new SensorDetailsModel { StationId = stationId, SensorType = sensorType, GuageHtml = CreateTempratureGuageHtml(dataPoint, size), Timestamp = dataPoint.SensorTimestampUtc.ToString("s"), ReloadTimeSpan = GetReloadTimeSpan(reloadSeconds) }; return(View(model)); }