54 lines
1.6 KiB
C#
54 lines
1.6 KiB
C#
using Aurora.Api;
|
|
using Aurora.Api.DataType;
|
|
using Aurora.Api.Devices;
|
|
using PropertyTools.DataAnnotations;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO.Ports;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace AuroraChiller {
|
|
public abstract class DongShinChillerBase : SerialPortDevice
|
|
{
|
|
|
|
public DongShinChillerBase(string deviceId) : base(deviceId) {
|
|
}
|
|
|
|
public abstract bool SetCooling(bool bOn);
|
|
public abstract bool SetTargetTemp(double temp);
|
|
public abstract bool SetLowTemp1(double temp);
|
|
public abstract bool SetLowTemp2(double temp);
|
|
public abstract bool SetHighTemp1(double temp);
|
|
public abstract bool SetHighTemp2(double temp);
|
|
|
|
public abstract int GetCoolingOnStatus();
|
|
public abstract double GetTargetTemp();
|
|
public abstract double GetLowTemp1();
|
|
public abstract double GetLowTemp2();
|
|
public abstract double GetHighTemp1();
|
|
public abstract double GetHighTemp2();
|
|
public abstract double GetCurrentTemp();
|
|
public abstract int GetError();
|
|
|
|
public class Config : IDeviceConfig
|
|
{
|
|
public IConnConfig ConnConfig { get; set; }
|
|
public Config()
|
|
{
|
|
ConnConfig = new SerialConnConfig() {
|
|
BaudRate = 19200,
|
|
Parity = Parity.None,
|
|
StopBits = StopBits.One,
|
|
DataBits = 8
|
|
};
|
|
}
|
|
|
|
public static Config CreateDefault() {
|
|
return new Config();
|
|
}
|
|
}
|
|
}
|
|
}
|