using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Monitor.Models;
using DataBase.MySql.Tool;
using Monitor.LogService;
namespace Module.EMeter.ModbusTcp
{
///
/// 电表值存储到MySQL
///
public class ElecMeterParamToMySQL
{
///
/// 新增电表能耗累计值信息到数据表
///
/// 仪表编码
/// 能耗累计值
/// 采集时刻
public async void AddTotalEnergyToMySql(string eqmNo,UInt32 val,DateTime time)
{
TEgEmeterTotalEnergyValue mdlVal = new TEgEmeterTotalEnergyValue()
{
FEmeterNo = eqmNo,
FTotalValue = val,
FTime = time
};
await new SEgEMeterTotalEnergyValue().AddEMeterTotalEnergyValue(mdlVal);
}
///
/// 新增电表小时能耗信息到数据表
///
/// 仪表编码
/// 小时能耗值
/// 开始时刻
/// 结束时刻
public async void AddHourEnergyToMySql(string eqmNo, UInt32 val, DateTime startTime,DateTime endTime)
{
TEgEmeterHourEnergyValue mdlVal = new TEgEmeterHourEnergyValue()
{
FEmeterNo = eqmNo,
FHourValue = val,
FStartTime = startTime,
FEndTime = endTime
};
await new SEgEMeterHourEnergyValue().AddEMeterHourEnergyValue(mdlVal);
}
}
}