public void temperatureInfo(TemperatureInfo val) { msclPINVOKE.DeviceStatusData_temperatureInfo__SWIG_1(swigCPtr, TemperatureInfo.getCPtr(val)); if (msclPINVOKE.SWIGPendingException.Pending) { throw msclPINVOKE.SWIGPendingException.Retrieve(); } }
public NullWeatherForecastResponse() : base() { Main = new TemperatureInfo(); Weather = new WeatherInfo[] { new WeatherInfo() { Main = "Not found" } }; }
public Temperature(Decimal temperature, Decimal tolerance) { current = temperature; TemperatureInfo ti = new TemperatureInfo(); ti.Temperature = temperature; tis.Add(ti); ti.Recorded = DateTimeOffset.UtcNow; this.tolerance = tolerance; }
public TemperatureInfo temperatureInfo() { TemperatureInfo ret = new TemperatureInfo(msclPINVOKE.DeviceStatusData_temperatureInfo__SWIG_0(swigCPtr), true); if (msclPINVOKE.SWIGPendingException.Pending) { throw msclPINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
public ActionResult Post([FromBody] TemperatureInfo temperatureInfo) { _postCounter++; if (_postCounter % 4 == 0) { // save the data return(Created("", null)); } return(StatusCode((int)HttpStatusCode.InternalServerError, "Something went wrong when saving the temperature info.")); }
public NullWeatherResponse() : base() { Name = "Not found"; Weather = new WeatherInfo() { Main = "Not found" }; Main = new TemperatureInfo(); Sys = new CountryInfo() { Country = "Not found" }; }
public async Task <List <Entry> > initAvgTempAllEntries() { List <Entry> entries = new List <Entry>(); TemperatureInfo avgTemp = new TemperatureInfo(); var apiResponse = RestService.For <TestApi>(http); for (int j = 0; j < devices.Count; j++) { Task.Run(async() => { avgTemp = await apiResponse.GetTempInfoPerDevice(devices[j].Id); }).Wait(); entries.Add(new Entry(avgTemp.Average) { Color = getPointColor(), Label = devices[j].Name, ValueLabel = avgTemp.Average.ToString() }); } return(entries); }
public async Task <ActionResult> Post([FromBody] WeatherInfo weatherModel) { var temperatureInfo = new TemperatureInfo { LocationId = weatherModel.LocationId, Temperature = weatherModel.Temperature, DateMeasured = weatherModel.DateTemperatureMeasured }; string temperatureJson = JsonConvert.SerializeObject(temperatureInfo); HttpContent httpContent = new StringContent(temperatureJson, Encoding.UTF8, "application/json"); var httpResponseMessage = await _httpClient.PostAsync("temperature", httpContent); return(StatusCode((int)httpResponseMessage.StatusCode)); }
protected async override void UpdateDeviceStatus(KDData data) { if (IsBackgroundRunning) { TemperatureInfo = new TemperatureInfo(data.MaxTemperatureHighLow); CurrentLeftTemperature = data.TemperatureReturnLeft; CurrentRightTemperature = data.TemperatureReturnRight; SetupLeftTemperature = data.TemperatureSettingLeft; SetupRightTemperature = data.TemperatureSettingRight; IsLeftPartsPowerOn = (data.Status == 2 || data.Status == 3); IsRightPartsPowerOn = (data.Status == 2 || data.Status == 4); Status = (DeviceStatus)data.Status; VolumeLevel = (VolumeLevels)data.Volume; WaterCapacity = (WaterCapacities)data.WaterCapacity; IsLock = Convert.ToBoolean(data.KeyLock); IsPowerOn = Convert.ToBoolean(data.Power); } else { await DispatcherHelper.ExecuteOnUIThreadAsync(() => { TemperatureInfo = new TemperatureInfo(data.MaxTemperatureHighLow); CurrentLeftTemperature = data.TemperatureReturnLeft; CurrentRightTemperature = data.TemperatureReturnRight; SetupLeftTemperature = data.TemperatureSettingLeft; SetupRightTemperature = data.TemperatureSettingRight; IsLeftPartsPowerOn = (data.Status == 2 || data.Status == 3); IsRightPartsPowerOn = (data.Status == 2 || data.Status == 4); Status = (DeviceStatus)data.Status; VolumeLevel = (VolumeLevels)data.Volume; WaterCapacity = (WaterCapacities)data.WaterCapacity; IsLock = Convert.ToBoolean(data.KeyLock); IsPowerOn = Convert.ToBoolean(data.Power); }); } }
private TemperatureInfo GetCityInfo(string city) { try { var temperature = new TemperatureInfo { DaySnapshots = CallWeekTemperatureApiAsync(city).Result, Snapshot = CallTemperatureApiAsync(city).Result }; return(temperature); } catch (HttpRequestException ex) { throw ex; } catch { throw; } }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(TemperatureInfo obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }