diff --git a/CHANGELOG.md b/CHANGELOG.md index 409aa23..7a1bf83 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added + - Added SPlusUtils with ConvertToInt method taking LowWord/HighWord ushorts ## [9.2.0] - 2019-03-01 ### Added diff --git a/ICD.Common.Utils/ICD.Common.Utils_SimplSharp.csproj b/ICD.Common.Utils/ICD.Common.Utils_SimplSharp.csproj index 58798fb..80364f1 100644 --- a/ICD.Common.Utils/ICD.Common.Utils_SimplSharp.csproj +++ b/ICD.Common.Utils/ICD.Common.Utils_SimplSharp.csproj @@ -186,6 +186,7 @@ + diff --git a/ICD.Common.Utils/SPlusUtils.cs b/ICD.Common.Utils/SPlusUtils.cs new file mode 100644 index 0000000..5ee6339 --- /dev/null +++ b/ICD.Common.Utils/SPlusUtils.cs @@ -0,0 +1,23 @@ +using ICD.Common.Properties; + +namespace ICD.Common.Utils +{ + /// + /// Static class containing useful utilities for use in S+ programs + /// + [PublicAPI("S+")] + public static class SPlusUtils + { + /// + /// Convert two ushort's to an int + /// + /// ushort for the least significant 16 bits + /// ushort for the most significant 1 bits + /// + [PublicAPI("S+")] + public static int ConvertToInt(ushort lowWord, ushort highWord) + { + return (highWord << 16) + lowWord; + } + } +} \ No newline at end of file