From 829c24b6676dde1ed7cba55953d3190b8150e1a3 Mon Sep 17 00:00:00 2001 From: Drew Tingen Date: Tue, 9 Apr 2019 15:46:10 -0400 Subject: [PATCH 1/2] feat: Adding SPlusUtils to convert ushort's to int --- .../ICD.Common.Utils_SimplSharp.csproj | 1 + ICD.Common.Utils/SPlusUtils.cs | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 ICD.Common.Utils/SPlusUtils.cs 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..8e43542 --- /dev/null +++ b/ICD.Common.Utils/SPlusUtils.cs @@ -0,0 +1,20 @@ +using ICD.Common.Properties; + +namespace ICD.Common.Utils +{ + [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 From 1dac1bfb67fee9ed28332a7874cead3c709620ad Mon Sep 17 00:00:00 2001 From: Drew Tingen Date: Tue, 9 Apr 2019 15:57:10 -0400 Subject: [PATCH 2/2] chore: Changelog + Docs --- CHANGELOG.md | 2 ++ ICD.Common.Utils/SPlusUtils.cs | 3 +++ 2 files changed, 5 insertions(+) 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/SPlusUtils.cs b/ICD.Common.Utils/SPlusUtils.cs index 8e43542..5ee6339 100644 --- a/ICD.Common.Utils/SPlusUtils.cs +++ b/ICD.Common.Utils/SPlusUtils.cs @@ -2,6 +2,9 @@ namespace ICD.Common.Utils { + /// + /// Static class containing useful utilities for use in S+ programs + /// [PublicAPI("S+")] public static class SPlusUtils {