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