using Entity.Dto.Resp; using HybirdFrameworkDriver.Session; using log4net; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; using Service.Api.Resp; using Service.Car.Msg.Car.Req; using Service.Car.Msg.Host.Req; using Service.Car.Server; using Service.Humiture; using Service.Humiture.Client; using Service.TBox.Service; using WebStarter.Dto.Req; namespace WebStarter.Controllers; /// /// 温湿度 /// [ApiController] [Route("[controller]")] public class HumitureController : ControllerBase { private static readonly ILog Log = LogManager.GetLogger(typeof(HumitureController)); /// /// 获取温湿度 /// /// [HttpGet("GetHumiture")] public HumitureResp GetHumiture() { HumitureResp humitureResp = new HumitureResp(); if (HumiturePlcMgr.HumitureMsg!=null) { humitureResp = new HumitureResp() { Humidness = HumiturePlcMgr.HumitureMsg.Humidness.Value, Temperature = HumiturePlcMgr.HumitureMsg.Temperature.Value, EquipmentType = HumiturePlcMgr.HumitureMsg.EquipmentType.Value, VersionNumber = HumiturePlcMgr.HumitureMsg.VersionNumber.Value, DeviceIdHigh = HumiturePlcMgr.HumitureMsg.DeviceIdHigh.Value, DeviceIdLower = HumiturePlcMgr.HumitureMsg.DeviceIdLower.Value, UpperTemperatureAlarm = HumiturePlcMgr.HumitureMsg.UpperTemperatureAlarm.Value, UpperTemperatureAlarmEnabled = HumiturePlcMgr.HumitureMsg.UpperTemperatureAlarmEnabled.Value, LowerTemperatureAlarm = HumiturePlcMgr.HumitureMsg.LowerTemperatureAlarm.Value, LowerTemperatureAlarmEnabled = HumiturePlcMgr.HumitureMsg.LowerTemperatureAlarmEnabled.Value, HumidityUpperAlarm = HumiturePlcMgr.HumitureMsg.HumidityUpperAlarm.Value, HumidityUpperAlarmEnabled = HumiturePlcMgr.HumitureMsg.HumidityUpperAlarmEnabled.Value, HumidityLowerLimitAlarm = HumiturePlcMgr.HumitureMsg.HumidityLowerLimitAlarm.Value, HumidityLowerLimitAlarmEnabled = HumiturePlcMgr.HumitureMsg.HumidityLowerLimitAlarmEnabled.Value, TemperatureUpdated = HumiturePlcMgr.HumitureMsg.TemperatureUpdated.Value, HumidityValueUpdated = HumiturePlcMgr.HumitureMsg.HumidityValueUpdated.Value, }; } return humitureResp; } }