More minor tweaks

This commit is contained in:
2019-02-21 15:59:38 -06:00
parent fca6ebedd6
commit ffb891b04b
6 changed files with 13 additions and 15 deletions

View File

@ -15,7 +15,7 @@ namespace ScreenLogicConnect
public byte m_flags; public byte m_flags;
public byte m_function; public byte m_function;
public byte m_interface; public byte m_interface;
public String m_name; public string m_name;
public byte m_nameIndex; public byte m_nameIndex;
} }
} }

View File

@ -48,7 +48,7 @@ namespace ScreenLogicConnect
this.millisecond = millisecond; this.millisecond = millisecond;
} }
public String toString() public string toString()
{ {
return "" + this.month + "/" + this.day + "/" + this.year; return "" + this.month + "/" + this.day + "/" + this.year;
} }

View File

@ -10,7 +10,7 @@ namespace ScreenLogicConnect.Messages
public int m_int; public int m_int;
public int m_procID; public int m_procID;
public int m_schema; public int m_schema;
public String m_version; public string m_version;
public const short HLM_CLIENT_LOGIN = 27; public const short HLM_CLIENT_LOGIN = 27;

View File

@ -22,7 +22,7 @@ namespace ScreenLogicConnect.Messages
public byte[] m_MinSetPoint { get; private set; } = new byte[2]; public byte[] m_MinSetPoint { get; private set; } = new byte[2];
public byte[] m_PumpCircArray { get; private set; } = new byte[PUM_CIRC_COUNT]; public byte[] m_PumpCircArray { get; private set; } = new byte[PUM_CIRC_COUNT];
public int m_ShowAlarms { get; private set; } public int m_ShowAlarms { get; private set; }
public String m_genCircuitName { get; private set; } public string m_genCircuitName { get; private set; }
public const short HLM_POOL_GETCTLRCONFIGQ = 12532; public const short HLM_POOL_GETCTLRCONFIGQ = 12532;

View File

@ -29,24 +29,22 @@ namespace ScreenLogicConnect.Messages
public HLMessage(byte[] headerArray, byte[] dataArray) public HLMessage(byte[] headerArray, byte[] dataArray)
{ {
headerByteStream = new MemoryStream(header); if (headerArray != null)
using (var bw = new BinaryWriter(headerByteStream))
{ {
bw.Write(headerArray); header = new byte[headerArray.Length];
Array.Copy(headerArray, header, headerArray.Length);
} }
if (dataArray != null)
this.data = new byte[dataArray.Length];
dataByteStream = new MemoryStream(data);
using (var bw = new BinaryWriter(dataByteStream))
{ {
bw.Write(dataArray); data = new byte[dataArray.Length];
Array.Copy(dataArray, data, dataArray.Length);
} }
Decode(); Decode();
} }
public HLMessage(HLMessage msg) public HLMessage(HLMessage msg)
: this(msg.header, msg.data) : this(msg != null ? msg.header : null, msg != null ? msg.data : null)
{ {
} }

View File

@ -5,9 +5,9 @@ namespace ScreenLogicConnect
public class PentLightColor public class PentLightColor
{ {
public RgbColor color { get; private set; } public RgbColor color { get; private set; }
public String name { get; private set; } public string name { get; private set; }
public PentLightColor(String name, RgbColor color) public PentLightColor(string name, RgbColor color)
{ {
this.name = name; this.name = name;
this.color = color; this.color = color;