using SHJX.Service.Model.Dao;
using System.Collections.Generic;
using SHJX.Service.Common.ReadXML;
using SHJX.Service.Model.Control;
using SHJX.Service.ServerClient.Interface;
using SHJX.Service.ServerClient.TempController;
using SHJX.Service.Common.Logging;
using Microsoft.Extensions.Logging;
namespace SHJX.Service.ServerClient.RS485Control
{
///
/// 加热
///
public class HeatingControl : DeltaDtc, PortControlImp
{
private static readonly ILogger logger = LogFactory.BuildLogger(typeof(HeatingControl));
///
/// 加热
///
/// 日志
/// 配置
public HeatingControl( ReadConfigUtil config)
: base( config) { }
public object Read(PortArgs args)
{
double pv = 0;
double sv = 0;
ReadPVnSV(ref pv, ref sv);
Dictionary temp = new()
{
{ "pv", pv },
{ "sv", sv }
};
return temp;
}
public bool Write(PortArgs args)
{
var pid = args.Reserve as PID;
var res = WritePid(pid.Ratio, pid.Integral, pid.Differential, pid.DifferentialDeafult) && WriteSV(args.Distance);
return res;
}
}
}