using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BPASmartClient.MorkCL.Server
{
///
/// 压力锅服务类
///
internal class PressureCookerServer : PressureCookerSet, IModbus
{
public PressureCookerServer()
{
//MyModbus = new ModbusTcp();
}
public void Init(string IP = "", int Port = 502, string PortName = "")
{
CommHelper.CreateModbusTcp(IP, Port).OnSuccess(S =>
{
MyModbus = S.Content;
});
//MyModbus = new ModbusTcp();
//MyModbus.WithModbusTcp(IP, Port).UseConnected(() =>
//{
// ((ModbusTcp)MyModbus).master.Transport.ReadTimeout = 3000;
// ((ModbusTcp)MyModbus).master.Transport.WriteTimeout = 3000;
// TaskManage.GetInstance.StartLong(new Action(() =>
// {
// Thread.Sleep(100);
// }), $"压力锅服务-{IP}", true);
//});
}
public void WriteValue(string address, T value)
{
throw new NotImplementedException();
}
}
}