using System;
|
using Shared.SimpleControl;
|
|
namespace Shared
|
{
|
/// <summary>
|
/// 空调
|
/// </summary>
|
[System.Serializable]
|
public class FreshAir : Common
|
{
|
public FreshAir ()
|
{
|
Type = DeviceType.FreshAir;
|
DeviceTextID = SimpleControl.R.MyInternationalizationString.FreshAir;
|
}
|
//新风通道号(1 - 200) + 开关(1,0) + 风速(0 关,1低,2中,3高) + 模式(0手动,1 自动,2 智能,3 定时)
|
|
/// <summary>
|
/// 开关(1,0)
|
/// </summary>
|
public byte SwitchStatus;
|
|
/// <summary>
|
/// 风速(0 关,1低,2中,3高)
|
/// </summary>
|
public byte WindSpeed;
|
|
/// <summary>
|
/// 模式(0--(智能模式/模式0), 1--(新风模式/模式1) 2--(内循环模式/模式2), 3--(恒温模式/模式3))
|
/// </summary>
|
public byte SetPattern;
|
|
/// <summary>
|
/// 模拟量 2个byte
|
/// 0启用1不启用
|
/// </summary>
|
public byte EnableValue1;
|
public byte EnableValue2;
|
|
/// <summary>
|
/// 室内温度
|
/// </summary>
|
public float InTemp;
|
|
/// <summary>
|
/// 室外温度
|
/// </summary>
|
public float OutTemp;
|
|
/// <summary>
|
/// 室内湿度
|
/// </summary>
|
public float Humidity;
|
|
/// <summary>
|
/// PM2.5
|
/// </summary>
|
public float PM25;
|
|
/// <summary>
|
/// The tvoc.
|
/// </summary>
|
public float TVOC;
|
|
/// <summary>
|
/// The CO2.
|
/// </summary>
|
public float CO2;
|
|
|
|
#region BLL
|
public bool EditRemark (string remake)
|
{
|
bool result = false;
|
byte [] remakeBytes = CommonPage.MyEncodingGB2312.GetBytes (remake);
|
byte [] resultBytes = Control.ControlBytesSendHasReturn (Command.ReadDeviceLoopInfo, this.SubnetID, this.DeviceID, new byte [] { this.BigClass, this.MinClass, this.LoopID });
|
if (resultBytes != null) {
|
byte [] uBytes = new byte [20];
|
Array.Copy (remakeBytes, 0, uBytes, 0, remakeBytes.Length < 20 ? remakeBytes.Length : 20);
|
Array.Copy (uBytes, 0, resultBytes, 3, 20 < uBytes.Length ? 20 : uBytes.Length);
|
var reBytes = Control.ControlBytesSendHasReturn (Command.SetDeviceLoopInfo, this.SubnetID, this.DeviceID, resultBytes);
|
if (reBytes != null) {
|
IO.FileUtils.SaveEquipmentMessage (this, this.LoopID.ToString ());
|
this.Name = remake;
|
result = true;
|
}
|
}
|
return result;
|
}
|
#endregion
|
}
|
}
|