Added S+ event args classes

This commit is contained in:
Heath Volmer
2016-09-02 11:20:34 -06:00
parent 364d70d97d
commit f46f305c2b
6 changed files with 115 additions and 4 deletions

View File

@@ -0,0 +1,110 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Crestron.SimplSharp;
namespace PepperDash.Core
{
//**************************************************************************************************//
public delegate void SPlusValuesDelegate();
public class SPlusValueWrapper
{
public SPlusType ValueType { get; private set; }
public ushort Index { get; private set; }
public ushort BoolUShortValue { get; set; }
public string StringValue { get; set; }
public SPlusValueWrapper() { }
public SPlusValueWrapper(SPlusType type, ushort index)
{
ValueType = type;
Index = index;
}
}
public enum SPlusType
{
Digital, Analog, String
}
//**************************************************************************************************//
public class BoolChangeEventArgs : EventArgs
{
public bool State { get; set; }
public ushort IntValue { get { return (ushort)(State ? 1 : 0); } }
public ushort Type { get; set; }
public ushort Index { get; set; }
public BoolChangeEventArgs()
{
}
public BoolChangeEventArgs(bool state, ushort type)
{
State = state;
Type = type;
}
public BoolChangeEventArgs(bool state, ushort type, ushort index)
{
State = state;
Type = type;
Index = index;
}
}
//**************************************************************************************************//
public class UshrtChangeEventArgs : EventArgs
{
public ushort IntValue { get; set; }
public ushort Type { get; set; }
public ushort Index { get; set; }
public UshrtChangeEventArgs()
{
}
public UshrtChangeEventArgs(ushort intValue, ushort type)
{
IntValue = intValue;
Type = type;
}
public UshrtChangeEventArgs(ushort intValue, ushort type, ushort index)
{
IntValue = intValue;
Type = type;
Index = index;
}
}
//**************************************************************************************************//
public class StringChangeEventArgs : EventArgs
{
public string StringValue { get; set; }
public ushort Type { get; set; }
public ushort Index { get; set; }
public StringChangeEventArgs()
{
}
public StringChangeEventArgs(string stringValue, ushort type)
{
StringValue = stringValue;
Type = type;
}
public StringChangeEventArgs(string stringValue, ushort type, ushort index)
{
StringValue = stringValue;
Type = type;
Index = index;
}
}
}

View File

@@ -72,6 +72,7 @@
<Compile Include="Device.cs" />
<Compile Include="EthernetHelper.cs" />
<Compile Include="Comm\GenericTcpIpClient.cs" />
<Compile Include="EventArgs and Constants.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<None Include="Properties\ControlSystem.cfg" />
</ItemGroup>
@@ -84,7 +85,7 @@
<Programmer />
<ArchiveFilename>C:\Users\hvolm\Desktop\working\pepperdash-simplsharp-core\Pepperdash Core\Pepperdash Core\bin\PepperDash_Core.clz</ArchiveFilename>
<MinFirmwareVersion>1.007.0017</MinFirmwareVersion>
<CompiledOn>8/15/2016 1:54:57 PM</CompiledOn>
<CompiledOn>9/2/2016 11:13:46 AM</CompiledOn>
<AdditionalInfo />
<EmbedSourceArchive>False</EmbedSourceArchive>
<CopyTo />

View File

@@ -10,7 +10,7 @@
<ArchiveName />
</RequiredInfo>
<OptionalInfo>
<CompiledOn>8/15/2016 1:54:57 PM</CompiledOn>
<CompilerRev>1.0.0.23247</CompilerRev>
<CompiledOn>9/2/2016 11:13:46 AM</CompiledOn>
<CompilerRev>1.0.0.18412</CompilerRev>
</OptionalInfo>
</ProgramInfo>

View File

@@ -1,4 +1,4 @@
MainAssembly=PepperDash_Core.dll:cedcf6ddcb42b121da13ff559d7178d3
MainAssembly=PepperDash_Core.dll:1b8fe52abb2cd78b374987bb89064191
MainAssemblyMinFirmwareVersion=1.007.0017
ü
DependencySource=Newtonsoft.Json.Compact.dll:ea996aa2ec65aa1878e7c9d09e37a896