-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Restructuring of the CSharp library #2394
Restructuring of the CSharp library #2394
Conversation
Hi @Gallimathias |
I know this isn't part of this PR per se, but why is a c# project being built with cmake? This seems like a duplication of the job the csproj is supposed to be doing in the first place. |
Hi @Gallimathias @sebandraos |
@dorodnic Thanks for the comment. I'm trying to merge #2559 into my branch tonight. @sebandraos Thanks for your support. Just like you, me and a two buddy were confused about cmake. In my case, i get trouble with the cmake generated sln. But I also understand @dorodnic with his argument. I think we should actually think about an sln check in. |
@Gallimathias thanks for this PR. |
@matkatz Thanks for the hint, I just restarted merging now ;) I'm hurrying to get the PR up and running as soon as possible. |
…alsense into feature/restructuring_csharp Resolved Conflicts: wrappers/csharp/Intel.RealSense/CMakeLists.txt wrappers/csharp/Intel.RealSense/Device.cs wrappers/csharp/Intel.RealSense/Frame.cs wrappers/csharp/Intel.RealSense/FrameQueue.cs wrappers/csharp/Intel.RealSense/FrameSet.cs wrappers/csharp/Intel.RealSense/Helpers.cs wrappers/csharp/Intel.RealSense/Pipeline.cs wrappers/csharp/Intel.RealSense/Processing.cs wrappers/csharp/Intel.RealSense/Sensor.cs wrappers/csharp/Intel.RealSense/SoftwareDevice.cs wrappers/csharp/Intel.RealSense/StreamProfile.cs wrappers/csharp/Intel.RealSense/Types.cs
So after hours I made it. I hope other PR's will be separate. :D Good night together zzzz |
* Update CMakeLists.txt
Thanks again. |
Unity will always slow down. I suggest compiler statements. So there would be two compiled versions for Unity and for the industry as I need it for example. But there are supposedly ways to add a newer version to unity. |
I did some research on Unity. Since version 2018.1 .NET Standard 2.0 and DotNet 4.x are supported. (Current Unity version: 2018.2) If you want to support the older versions (.NET 3.5 (Unity< 2018.1) ) Then please let me know and I will include compiler statements in the release. I think this is the most sensible compromise between industry and Unity development. |
For Unity versions lower than 2018.1 preprocessor instructions (NET 3.5) have been added. These should only be used for Unity compatibility.
Thanks @Gallimathias |
…csharp Resolved Conflicts: wrappers/csharp/Intel.RealSense/CMakeLists.txt
First of all, good job with this PR. Everyone likes sugar with their code, and the fat arrow syntax does more than just that I think, it reduces syntactic noise helping focus on what's important, and can make it easier to draw in more contributors. Having said that, a prerequisite for these arrow functions to compile with this PR, is support for Being just sugar, compiled code will still run on older frameworks. So the question I guess is what compilers and frameworks are we going to support. As for compilers, I vote for ditching everything but the .NET Core SDK.
Had an issue targeting 3.5 with core sdk, this solved it for me. |
Thanks for the compliments. I have not made any logic changes. As I said there are pure structure changes. (I don't like it when there are too many changes in a PR at once) (Ok I made the pooling threadsafe) If you ignore CMake like other C# developers, the wrapper will compile to the .NET standard. Which should be the goal by now. If you don't have csproj and sln checked in you can compile the project as you like. Currently I always keep the PR up to date. It is a pity that it is not merged because I still have some todos for the wrapper on my list which I would like to contribute. I'm currently thinking about two posibilitys. One: opening more PR's that have this PR as their origin or Two: I'm create a hard fork of the c# wrapper. |
.NET Standard is the way to go I agree, and hang in there with the PR it could take a while... I suggest you share your plans in this discussion or as new feature request issues if you deem them important. BTW, pooling was already thread safe, |
I'd be happy to merge this given an approval from either @ogoshen or @matkatz, as I'm not sufficiently fluent in .NET myself. |
Resolved Conflicts: wrappers/csharp/Intel.RealSense/CMakeLists.txt wrappers/csharp/Intel.RealSense/FrameSet.cs wrappers/csharp/Intel.RealSense/Processing.cs
…csharp Resolved Conflicts: wrappers/csharp/Intel.RealSense/FrameSet.cs wrappers/csharp/Intel.RealSense/Processing.cs
If I correctly follow the discussion: a. Transition to .NET core requires further evaluation. Getting away from CMake would be a big downgrade IMHO. On the other hand, @matkatz did manage to build the wrapper with .NET core on Linux (but not the WPF examples), which it is nice. b. File structure - each class in a separate file, better naming and style, etc.. - I believe agreed by all that's a good thing for the project. c. Language bump to C# 7 - we need the C# wrapper to be functional with .NET 3.5 to enable Unity, and I prefer to keep support for Visual Studio 2015. I might be mixing up the framework / language / VS versions, but this is something that could prevent a merge. @Gallimathias - perhaps you could create a PR with just (b)? I don't see a reason not to merge it. |
@dorodnic You didn't take some things right out of the discussion: a) No evaluation to the .NET standard is required as the library is already .NET standard compatible. I have compiled the library several times as .NET standard. The discussion was only about checking in the sln because cmake makes no sense here at C#. But the sln and cmake are not mutually exclusive. WPF will never run on Linux, (at least not for a while) because WPF uses DirectX which is not available on Linux. b) Well, that's a relief for everyone. c) This point tends to conflict with a). We don't need a separate wrapper for 3.5 - that's nonsense, there are corresponding tools in C# for that. These two lines of code for the compiler instructions are built in. Conclusion: You want a PR only for point B. I've been making it available the whole time because that's exactly what this PR is, which is why I don't understand the whole discussion. Yes, the compiler statment is already available here (that means the PR is 3.5 capable). I made the fix because of the thread security which was not considered with the Pool PR in the assumption. The pool error has already been mentioned in PR #2810 and the fix there was only moderately viewed because the fix was also only half-hearted. That is by the way quite annoying for not hobby projects. |
That's a little disrespectful, don't you think? I reinvested quite a lot of time and took part in the discussion. My questions were ignored. Now @matkatz simply copies my code, he doesn't even merge my repo and adjusts things. No he COPERS. And that will be merged without a discussion without an ifs or buts. I have neither the Contribute flag nor a thank you. It is a pity how you deal with "voluntary" work from other people. And that's not the way Open Source works. That's just disrespectful. By the way, I can't just copy Intel code without mentioning Intel. Or do you think that this is the new way of using work by third parties? Even if there is little creative work involved in restructuring. It was work, it took me time and patience. And if you have work from third parties you should never, never, never step on them. I hope you can read from this that I'm pissed how you've been handling my time. And I hope for others that they will be treated more respectfully. |
Resolved Conflicts: wrappers/csharp/Intel.RealSense/CMakeLists.txt wrappers/csharp/Intel.RealSense/Devices/AdvancedDevice.cs wrappers/csharp/Intel.RealSense/Devices/Device.cs wrappers/csharp/Intel.RealSense/Devices/DeviceList.cs wrappers/csharp/Intel.RealSense/Devices/PlaybackDevice.cs wrappers/csharp/Intel.RealSense/Devices/RecordDevice.cs wrappers/csharp/Intel.RealSense/Devices/SoftwareDevice.cs wrappers/csharp/Intel.RealSense/Frames/DepthFrame.cs wrappers/csharp/Intel.RealSense/Frames/Frame.cs wrappers/csharp/Intel.RealSense/Frames/FramePool.cs wrappers/csharp/Intel.RealSense/Frames/FrameSet.cs wrappers/csharp/Intel.RealSense/Frames/Points.cs wrappers/csharp/Intel.RealSense/Frames/VideoFrame.cs wrappers/csharp/Intel.RealSense/Helpers.cs wrappers/csharp/Intel.RealSense/Pipeline.cs wrappers/csharp/Intel.RealSense/Processing/Align.cs wrappers/csharp/Intel.RealSense/Processing/Colorizer.cs wrappers/csharp/Intel.RealSense/Processing/CustomProcessingBlock.cs wrappers/csharp/Intel.RealSense/Processing/DecimationFilter.cs wrappers/csharp/Intel.RealSense/Processing/DisparityTransform.cs wrappers/csharp/Intel.RealSense/Processing/FrameSource.cs wrappers/csharp/Intel.RealSense/Processing/HoleFillingFilter.cs wrappers/csharp/Intel.RealSense/Processing/PointCloud.cs wrappers/csharp/Intel.RealSense/Processing/ProcessingBlock.cs wrappers/csharp/Intel.RealSense/Processing/SpatialFilter.cs wrappers/csharp/Intel.RealSense/Processing/Syncer.cs wrappers/csharp/Intel.RealSense/Processing/TemporalFilter.cs wrappers/csharp/Intel.RealSense/Sensors/Sensor.cs wrappers/csharp/Intel.RealSense/Sensors/SoftwareSensor.cs wrappers/csharp/Intel.RealSense/Types/CameraInfo.cs wrappers/csharp/Intel.RealSense/Types/Delegates.cs wrappers/csharp/Intel.RealSense/Types/Distortion.cs wrappers/csharp/Intel.RealSense/Types/ExceptionType.cs wrappers/csharp/Intel.RealSense/Types/Extension.cs wrappers/csharp/Intel.RealSense/Types/Extrinsics.cs wrappers/csharp/Intel.RealSense/Types/Format.cs wrappers/csharp/Intel.RealSense/Types/FrameMetadataValue.cs wrappers/csharp/Intel.RealSense/Types/Intrinsics.cs wrappers/csharp/Intel.RealSense/Types/LogSeverity.cs wrappers/csharp/Intel.RealSense/Types/Matchers.cs wrappers/csharp/Intel.RealSense/Types/NotificationCategory.cs wrappers/csharp/Intel.RealSense/Types/Option.cs wrappers/csharp/Intel.RealSense/Types/PlaybackStatus.cs wrappers/csharp/Intel.RealSense/Types/RecordingMode.cs wrappers/csharp/Intel.RealSense/Types/Rs400VisualPreset.cs wrappers/csharp/Intel.RealSense/Types/SoftwareVideoFrame.cs wrappers/csharp/Intel.RealSense/Types/SoftwareVideoStream.cs wrappers/csharp/Intel.RealSense/Types/Sr300VisualPreset.cs wrappers/csharp/Intel.RealSense/Types/Stream.cs wrappers/csharp/Intel.RealSense/Types/TimestampDomain.cs wrappers/csharp/Intel.RealSense/Types/VideoStream.cs
Resolved Conflicts: wrappers/csharp/Intel.RealSense/CMakeLists.txt
Hi @Gallimathias |
I have restructured the CSharp library. Now the lib structure is more like other CSharp projects.
This makes the work on this library much easier.