forked from IntelRealSense/librealsense
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+Separate Intel.Realsense.Net library for network devices. It is bein…
…g created on BUILD_NETWORK_DEVICE=ON cmake flag as well as cs-tutorial-7-net-dev example tutorial tha uses this library.
- Loading branch information
Showing
14 changed files
with
193 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
wrappers/csharp/Intel.RealSense.Net/.nuget/Intel.RealSense.targets
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<ItemGroup Condition=" '$(Platform)' == 'x64' "> | ||
<NativeLibs Include="$(MSBuildThisFileDirectory)..\runtimes\win-x64\native\*.dll" /> | ||
<None Include="@(NativeLibs)"> | ||
<Link>%(FileName)%(Extension)</Link> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
<ItemGroup Condition=" '$(Platform)' == 'x86' OR '$(Platform)' == 'AnyCPU' "> | ||
<NativeLibs Include="$(MSBuildThisFileDirectory)..\runtimes\win-x86\native\*.dll" /> | ||
<None Include="@(NativeLibs)"> | ||
<Link>%(FileName)%(Extension)</Link> | ||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | ||
</None> | ||
</ItemGroup> | ||
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
cmake_minimum_required( VERSION 3.8.0 ) | ||
|
||
project(Intel.RealSense.Net) | ||
|
||
set(LRS_DOTNET_TARGET ${PROJECT_NAME}) | ||
|
||
add_library(${PROJECT_NAME} | ||
NativeMethods.cs | ||
.nuget/Intel.RealSense.targets | ||
GlobalSuppressions.cs | ||
Properties/AssemblyInfo.cs | ||
packages.config | ||
stylecop.json | ||
) | ||
|
||
include(Devices/CMakeLists.txt) | ||
|
||
csharp_set_designer_cs_properties( | ||
.nuget/Intel.RealSense.Net.targets | ||
) | ||
|
||
|
||
set_property(SOURCE App.xaml PROPERTY VS_XAML_TYPE "ApplicationDefinition") | ||
|
||
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DOTNET_TARGET_FRAMEWORK_VERSION "v${DOTNET_VERSION_LIBRARY}") | ||
|
||
add_dependencies(${PROJECT_NAME} Intel.RealSense) | ||
|
||
set_target_properties (${PROJECT_NAME} PROPERTIES | ||
FOLDER Wrappers/csharp | ||
) | ||
|
||
set_property(TARGET ${PROJECT_NAME} PROPERTY VS_DOTNET_REFERENCES | ||
"System" | ||
) | ||
|
||
target_compile_options(${PROJECT_NAME} PRIVATE /define:${CMAKE_SYSTEM_NAME}) | ||
|
||
set_source_files_properties(stylecop.json PROPERTIES VS_TOOL_OVERRIDE "AdditionalFiles") | ||
|
||
install(TARGETS ${PROJECT_NAME} | ||
EXPORT realsense2Targets | ||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} | ||
#LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
#ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
target_sources(${LRS_DOTNET_TARGET} | ||
PRIVATE | ||
"${CMAKE_CURRENT_LIST_DIR}/NetDevice.cs" | ||
) |
6 changes: 3 additions & 3 deletions
6
...harp/Intel.RealSense/Devices/NetDevice.cs → .../Intel.RealSense.Net/Devices/NetDevice.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// This file is used by Code Analysis to maintain SuppressMessage | ||
// attributes that are applied to this project. | ||
// Project-level suppressions either have no target or are given | ||
// a specific target and scoped to a namespace, type, member, etc. | ||
|
||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.ReadabilityRules", "SA1101:Prefix local calls with this", Justification = "Pending")] | ||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1201:Elements must appear in the correct order", Justification = "Pending")] | ||
[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.OrderingRules", "SA1202:Elements must be ordered by access", Justification = "Pending")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// License: Apache 2.0. See LICENSE file in root directory. | ||
// Copyright(c) 2017 Intel Corporation. All Rights Reserved. | ||
|
||
#pragma warning disable SA1600 // Elements must be documented | ||
#pragma warning disable SA1124 // Do not use regions | ||
|
||
namespace Intel.RealSense.Net | ||
{ | ||
using System; | ||
using System.Reflection.Emit; | ||
using System.Runtime.InteropServices; | ||
using System.Security; | ||
using System.Security.Permissions; | ||
|
||
[SuppressUnmanagedCodeSecurity] | ||
[SecurityPermission(SecurityAction.LinkDemand, Flags = SecurityPermissionFlag.UnmanagedCode)] | ||
internal static class NativeMethods | ||
{ | ||
|
||
#if DEBUG | ||
private const string dllName = "realsense2d"; | ||
private const string dllNetName = "realsense2-netd"; | ||
#else | ||
private const string dllName = "realsense2"; | ||
private const string dllNetName = "realsense2-net"; | ||
#endif | ||
|
||
[DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern void rs2_context_add_software_device(ContextHandle ctx, IntPtr device, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); | ||
|
||
[DllImport(dllName, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern int rs2_get_api_version([MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); | ||
|
||
#region rs_net_device | ||
[DllImport(dllNetName, CallingConvention = CallingConvention.Cdecl)] | ||
internal static extern IntPtr rs2_create_net_device(int api_version, string address, [MarshalAs(UnmanagedType.CustomMarshaler, MarshalTypeRef = typeof(ErrorMarshaler))] out object error); | ||
#endregion | ||
} | ||
} | ||
|
||
#pragma warning restore SA1600 // Elements must be documented | ||
#pragma warning restore SA1124 // Do not use regions |
36 changes: 36 additions & 0 deletions
36
wrappers/csharp/Intel.RealSense.Net/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// License: Apache 2.0. See LICENSE file in root directory. | ||
// Copyright(c) 2017 Intel Corporation. All Rights Reserved. | ||
|
||
using System.Reflection; | ||
using System.Runtime.CompilerServices; | ||
using System.Runtime.InteropServices; | ||
|
||
// General Information about an assembly is controlled through the following | ||
// set of attributes. Change these attribute values to modify the information | ||
// associated with an assembly. | ||
[assembly: AssemblyTitle("Intel(R) RealSense(TM) SDK C# Net Wrapper")] | ||
[assembly: AssemblyDescription("Intel(R) RealSense(TM) SDK C# Net Wrapper")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("Intel(R) Corporation")] | ||
[assembly: AssemblyProduct("Intel(R) RealSense(TM) SDK C# Net Wrapper")] | ||
[assembly: AssemblyCopyright("Copyright © 2021, Intel Corporation. All rights reserved")] | ||
[assembly: AssemblyTrademark("Intel(R) RealSense(TM)")] | ||
[assembly: AssemblyCulture("")] | ||
|
||
// Setting ComVisible to false makes the types in this assembly not visible | ||
// to COM components. If you need to access a type in this assembly from | ||
// COM, set the ComVisible attribute to true on that type. | ||
[assembly: ComVisible(false)] | ||
|
||
// The following GUID is for the ID of the typelib if this project is exposed to COM | ||
[assembly: Guid("71c85ee0-c7c2-4e2e-8020-6af818537a15")] | ||
|
||
// Version information for an assembly consists of the following four values: | ||
// | ||
// Major Version | ||
// Minor Version | ||
// Build Number | ||
// Revision | ||
// | ||
[assembly: AssemblyVersion("1.0.0.0")] | ||
[assembly: AssemblyFileVersion("1.0.0.0")] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="StyleCop.Analyzers" version="1.0.2" targetFramework="net35" developmentDependency="true" /> | ||
</packages> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// License: Apache 2.0. See LICENSE file in root directory. | ||
// Copyright(c) 2017 Intel Corporation. All Rights Reserved. | ||
// | ||
// This proxy device is for accessing Device constructor that is internal, by successors in different namespaces and assemblies | ||
// This way is more controllable for accessing base Device object instead of making it's constructors public | ||
// Example of usage: NetDevice in Intel.Realsense.Net.dll that is a successor of ProxyDevice | ||
|
||
namespace Intel.RealSense | ||
{ | ||
using System; | ||
using System.Collections; | ||
using System.Collections.Generic; | ||
using System.Runtime.InteropServices; | ||
|
||
|
||
public class ProxyDevice : Device | ||
{ | ||
public ProxyDevice(IntPtr ptr) : base(ptr) | ||
{ | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters