You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

59 lines
2.4 KiB

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;
/// <summary>
/// 温湿度
/// </summary>
[ApiController]
[Route("api/[controller]")]
public class HumitureController : ControllerBase
{
private static readonly ILog Log = LogManager.GetLogger(typeof(HumitureController));
/// <summary>
/// 获取温湿度
/// </summary>
/// <returns></returns>
[HttpGet("LstGetHumiture")]
public List<HumitureResp> LstGetHumiture()
{
List<HumitureResp> 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;
}
}