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 _logger; public UpsEqmParamController(ILogger logger) { _logger = logger; } /// /// UPS设备参数值 /// /// [HttpPost] [Route("/api/[controller]/GetUpsParamValue")] public MUpsParamsVal GetUpsParamValue() { return CmnUpsBaseInfo.UPS01.F_UpsParamsVal; } /// /// UPS设备通讯重新连接 /// /// [HttpPost] [Route("/api/[controller]/SetUpsNetReConnect")] public void UpsNetReConnect() { new UpsEqmManger().UpsNetReConnectThread(); } /// /// UPS前端页面展示信息类 /// /// [HttpGet] [Route("/api/[controller]/upsInfoShow")] public UpsPageShowInfo UpsInfoShow() { CmnUpsBaseInfo.upsPageShowInfo.update = DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"); return CmnUpsBaseInfo.upsPageShowInfo; } /// /// UPS、电表、温湿度、消防连接状态展示 /// /// [HttpGet] [Route("/api/[controller]/eqipConnState")] public List EqipConnState() { List list = new List { 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; } } }