From 75ff6675482a6e8c29148214f4b53bd4d8bed4d4 Mon Sep 17 00:00:00 2001 From: nico-dev Date: Mon, 8 Jan 2024 18:33:44 +0100 Subject: [PATCH] kinect manager class --- KinectConnection/KinectConnection.csproj | 60 ++++++++++++++++++++ KinectConnection/KinectManager.cs | 44 ++++++++++++++ KinectConnection/Properties/AssemblyInfo.cs | 36 ++++++++++++ KinectConnection/packages.config | 4 ++ KinectSensor/Class1.cs | 12 ++++ KinectSensor/KinectSensor.csproj | 54 ++++++++++++++++++ KinectSensor/Properties/AssemblyInfo.cs | 36 ++++++++++++ KinectSensorStreams.sln | 8 ++- KinnectConnection/Class1.cs | 12 ++++ KinnectConnection/KinnectConnection.csproj | 54 ++++++++++++++++++ KinnectConnection/Properties/AssemblyInfo.cs | 36 ++++++++++++ 11 files changed, 355 insertions(+), 1 deletion(-) create mode 100644 KinectConnection/KinectConnection.csproj create mode 100644 KinectConnection/KinectManager.cs create mode 100644 KinectConnection/Properties/AssemblyInfo.cs create mode 100644 KinectConnection/packages.config create mode 100644 KinectSensor/Class1.cs create mode 100644 KinectSensor/KinectSensor.csproj create mode 100644 KinectSensor/Properties/AssemblyInfo.cs create mode 100644 KinnectConnection/Class1.cs create mode 100644 KinnectConnection/KinnectConnection.csproj create mode 100644 KinnectConnection/Properties/AssemblyInfo.cs diff --git a/KinectConnection/KinectConnection.csproj b/KinectConnection/KinectConnection.csproj new file mode 100644 index 0000000..5d284f2 --- /dev/null +++ b/KinectConnection/KinectConnection.csproj @@ -0,0 +1,60 @@ + + + + + Debug + AnyCPU + {E527438A-DFA2-4EC6-9891-D4956152B093} + Library + Properties + KinectConnection + KinectConnection + v4.8 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\Microsoft.Kinect.2.0.1410.19000\lib\net45\Microsoft.Kinect.dll + + + + + + + + + + + + + + + + + {7004f18c-b43f-4111-a7fa-d803217d5474} + KinectSensorStreams + + + + + + + \ No newline at end of file diff --git a/KinectConnection/KinectManager.cs b/KinectConnection/KinectManager.cs new file mode 100644 index 0000000..bd7c0d6 --- /dev/null +++ b/KinectConnection/KinectManager.cs @@ -0,0 +1,44 @@ +using Microsoft.Kinect; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Resources; +using System.Security.Policy; +using System.Text; +using System.Threading.Tasks; + +namespace KinectConnection +{ + public class KinectManager + { + + KinectManager() + { + this.kinectSensor = KinectSensor.GetDefault(); + } + + // properties + public KinectSensor kinectSensor; + + public bool Status; + + public string StatusText; + + // methods + public void StartSensor() + { + this.kinectSensor.Open(); + } + + public void StopSensor() + { + this.kinectSensor.Close(); + } + + private void KinectSensor_IsAvailableChanged(object sender, IsAvailableChangedEventArgs args) + { + this.StatusText = this.kinectSensor.IsAvailable ? "Kinect Available" : "Kinect Not Available"; + } + + } +} diff --git a/KinectConnection/Properties/AssemblyInfo.cs b/KinectConnection/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..fab162b --- /dev/null +++ b/KinectConnection/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Les informations générales relatives à un assembly dépendent de +// l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations +// associées à un assembly. +[assembly: AssemblyTitle("KinectConnection")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("KinectConnection")] +[assembly: AssemblyCopyright("Copyright © 2024")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly +// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de +// COM, affectez la valeur true à l'attribut ComVisible sur ce type. +[assembly: ComVisible(false)] + +// Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM +[assembly: Guid("e527438a-dfa2-4ec6-9891-d4956152b093")] + +// Les informations de version pour un assembly se composent des quatre valeurs suivantes : +// +// Version principale +// Version secondaire +// Numéro de build +// Révision +// +// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut +// en utilisant '*', comme indiqué ci-dessous : +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/KinectConnection/packages.config b/KinectConnection/packages.config new file mode 100644 index 0000000..6350273 --- /dev/null +++ b/KinectConnection/packages.config @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/KinectSensor/Class1.cs b/KinectSensor/Class1.cs new file mode 100644 index 0000000..dcdb6d8 --- /dev/null +++ b/KinectSensor/Class1.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace KinectSensor +{ + public class Class1 + { + } +} diff --git a/KinectSensor/KinectSensor.csproj b/KinectSensor/KinectSensor.csproj new file mode 100644 index 0000000..61e4742 --- /dev/null +++ b/KinectSensor/KinectSensor.csproj @@ -0,0 +1,54 @@ + + + + + Debug + AnyCPU + cef75546-05f1-41a2-91ab-b4016a5436c4 + Library + Properties + KinectSensor + KinectSensor + v4.8 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + diff --git a/KinectSensor/Properties/AssemblyInfo.cs b/KinectSensor/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..0da80af --- /dev/null +++ b/KinectSensor/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Les informations générales relatives à un assembly dépendent de +// l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations +// associées à un assembly. +[assembly: AssemblyTitle("KinectSensor")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("KinectSensor")] +[assembly: AssemblyCopyright("Copyright © 2024")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly +// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de +// COM, affectez la valeur true à l'attribut ComVisible sur ce type. +[assembly: ComVisible(false)] + +// Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM +[assembly: Guid("cef75546-05f1-41a2-91ab-b4016a5436c4")] + +// Les informations de version pour un assembly se composent des quatre valeurs suivantes : +// +// Version principale +// Version secondaire +// Numéro de build +// Révision +// +// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut +// en utilisant '*', comme indiqué ci-dessous : +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/KinectSensorStreams.sln b/KinectSensorStreams.sln index 3e85fbd..ca21d97 100644 --- a/KinectSensorStreams.sln +++ b/KinectSensorStreams.sln @@ -3,7 +3,9 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.8.34330.188 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KinectSensorStreams", "KinectSensorStreams\KinectSensorStreams.csproj", "{7004F18C-B43F-4111-A7FA-D803217D5474}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "KinectSensorStreams", "KinectSensorStreams\KinectSensorStreams.csproj", "{7004F18C-B43F-4111-A7FA-D803217D5474}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KinectConnection", "KinectConnection\KinectConnection.csproj", "{E527438A-DFA2-4EC6-9891-D4956152B093}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -15,6 +17,10 @@ Global {7004F18C-B43F-4111-A7FA-D803217D5474}.Debug|Any CPU.Build.0 = Debug|Any CPU {7004F18C-B43F-4111-A7FA-D803217D5474}.Release|Any CPU.ActiveCfg = Release|Any CPU {7004F18C-B43F-4111-A7FA-D803217D5474}.Release|Any CPU.Build.0 = Release|Any CPU + {E527438A-DFA2-4EC6-9891-D4956152B093}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E527438A-DFA2-4EC6-9891-D4956152B093}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E527438A-DFA2-4EC6-9891-D4956152B093}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E527438A-DFA2-4EC6-9891-D4956152B093}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/KinnectConnection/Class1.cs b/KinnectConnection/Class1.cs new file mode 100644 index 0000000..9555f99 --- /dev/null +++ b/KinnectConnection/Class1.cs @@ -0,0 +1,12 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace KinnectConnection +{ + public class Class1 + { + } +} diff --git a/KinnectConnection/KinnectConnection.csproj b/KinnectConnection/KinnectConnection.csproj new file mode 100644 index 0000000..80b5043 --- /dev/null +++ b/KinnectConnection/KinnectConnection.csproj @@ -0,0 +1,54 @@ + + + + + Debug + AnyCPU + 570a503f-20af-47cd-809f-646d6de12d43 + Library + Properties + KinnectConnection + KinnectConnection + v4.8 + 512 + true + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + diff --git a/KinnectConnection/Properties/AssemblyInfo.cs b/KinnectConnection/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..4a6d647 --- /dev/null +++ b/KinnectConnection/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// Les informations générales relatives à un assembly dépendent de +// l'ensemble d'attributs suivant. Changez les valeurs de ces attributs pour modifier les informations +// associées à un assembly. +[assembly: AssemblyTitle("KinnectConnection")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("KinnectConnection")] +[assembly: AssemblyCopyright("Copyright © 2024")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// L'affectation de la valeur false à ComVisible rend les types invisibles dans cet assembly +// aux composants COM. Si vous devez accéder à un type dans cet assembly à partir de +// COM, affectez la valeur true à l'attribut ComVisible sur ce type. +[assembly: ComVisible(false)] + +// Le GUID suivant est pour l'ID de la typelib si ce projet est exposé à COM +[assembly: Guid("570a503f-20af-47cd-809f-646d6de12d43")] + +// Les informations de version pour un assembly se composent des quatre valeurs suivantes : +// +// Version principale +// Version secondaire +// Numéro de build +// Révision +// +// Vous pouvez spécifier toutes les valeurs ou indiquer les numéros de build et de révision par défaut +// en utilisant '*', comme indiqué ci-dessous : +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")]