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.
82 lines
2.5 KiB
82 lines
2.5 KiB
using Microsoft.AspNetCore.Mvc;
|
|
using Module.EMeter.ModbusTcp;
|
|
using Module.FireCtrl.ModBusTcp;
|
|
using Module.HMeter.ModBusTcp;
|
|
using Module.UpsEqm.ModBusTcp;
|
|
using Module.UpsEqm.ModBusTcp.Models;
|
|
|
|
namespace Monitor.EqmMgr.WebApi.Controllers
|
|
{
|
|
public class UpsEqmParamController : ControllerBase
|
|
{
|
|
private readonly ILogger<UpsEqmParamController> _logger;
|
|
|
|
public UpsEqmParamController(ILogger<UpsEqmParamController> logger)
|
|
{
|
|
_logger = logger;
|
|
}
|
|
|
|
/// <summary>
|
|
/// UPS设备参数值
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("/api/[controller]/GetUpsParamValue")]
|
|
public MUpsParamsVal GetUpsParamValue()
|
|
{
|
|
return CmnUpsBaseInfo.UPS01.F_UpsParamsVal;
|
|
}
|
|
|
|
/// <summary>
|
|
/// UPS设备通讯重新连接
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpPost]
|
|
[Route("/api/[controller]/SetUpsNetReConnect")]
|
|
public void UpsNetReConnect()
|
|
{
|
|
new UpsEqmManger().UpsNetReConnectThread();
|
|
}
|
|
|
|
/// <summary>
|
|
/// UPS前端页面展示信息类
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[Route("/api/[controller]/upsInfoShow")]
|
|
public UpsPageShowInfo UpsInfoShow()
|
|
{
|
|
CmnUpsBaseInfo.upsPageShowInfo.update = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss");
|
|
return CmnUpsBaseInfo.upsPageShowInfo;
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// UPS、电表、温湿度、消防连接状态展示
|
|
/// </summary>
|
|
/// <returns></returns>
|
|
[HttpGet]
|
|
[Route("/api/[controller]/eqipConnState")]
|
|
public List<bool> EqipConnState()
|
|
{
|
|
List<bool> list = new List<bool>
|
|
{
|
|
CmnUpsBaseInfo.UPS01.F_NetConnected,
|
|
CmnElecMeterBaseInfo.EBC01.F_NetConnected,
|
|
CmnElecMeterBaseInfo.EBC02.F_NetConnected,
|
|
CmnElecMeterBaseInfo.EBC03.F_NetConnected,
|
|
CmnElecMeterBaseInfo.EBC04.F_NetConnected,
|
|
CmnElecMeterBaseInfo.EBC05.F_NetConnected,
|
|
CmnElecMeterBaseInfo.EBC06.F_NetConnected,
|
|
CmnElecMeterBaseInfo.EBC07.F_NetConnected,
|
|
CmnHumiMeterBaseInfo.HUM01.F_NetConnected,
|
|
CmnHumiMeterBaseInfo.HUM02.F_NetConnected,
|
|
CmnHumiMeterBaseInfo.HUM03.F_NetConnected,
|
|
CmnFireBaseInfo.FRC01.F_NetConnected,
|
|
};
|
|
return list;
|
|
}
|
|
|
|
}
|
|
}
|