|
| 1 | +## C# Fluigent Software Development Kit |
| 2 | + |
| 3 | +C# Fluigent SDK wrapper is a multi-platform middleware built with .NET Core 3.1 for the fgt_SDK library, compatible with Windows (x86 and x64), Linux (x64) and macOS (x64). |
| 4 | +* [Repository content](#repository-content) |
| 5 | +* [Quick start](#quick-start) |
| 6 | + * [Install nuget using Visual Studio](#install-nuget-using-visual-studio) |
| 7 | + * [Install nuget using terminal](#install-nuget-using-terminal) |
| 8 | +* [Building instructions](#building-instructions) |
| 9 | + * [Build using Visual Studio](#build-using-visual-studio) |
| 10 | + * [Build using dotnet command-line interface](#build-using-dotnet-command-line-interface) |
| 11 | +* [FAQ](#faq) |
| 12 | + |
| 13 | +## Repository content |
| 14 | + |
| 15 | +This repository consists of the following directories: |
| 16 | + |
| 17 | ++ **fgt_sdk_csharp** with the middleware source code |
| 18 | ++ **StaticFiles** with compiled fgt_SDK libraries for each supported platform and architecture |
| 19 | ++ **UnitTests** project with a couple of low level test cases |
| 20 | ++ **Examples** of how to use the wrapper: |
| 21 | + + **Basic Get Instruments Info** - retrieve information example about Fluigent instruments: type, controller, serial number and unique ID |
| 22 | + + **Basic Read Sensor Data** - a basic example to show how to retrieve the data from the sensor channel |
| 23 | + + **Basic Sensor Regulation** - simple example to set a flowrate and sinusoidal profile |
| 24 | + + **Basic Set Pressure** - simple example to set a pressure and ramp profile |
| 25 | + + **Basic Set Valve Position** - simple example to set the positions of valves |
| 26 | + + **Advanced Custom Sensor Regulation** - use a custom sensor example different from Fluigent ones and regulate pressure |
| 27 | + + **Advanced Features** - advanced features example such as limits, units and calibration |
| 28 | + + **Advanced Parallel Pressure Control** - advanced example using threads in order to apply pressure asynchronously |
| 29 | + + **Advanced Specific Multiple Instruments** - example use of specific channels ID and multiple connected instruments |
| 30 | + |
| 31 | +## Quick start |
| 32 | +The fastest and easiest way to start working with the C# wrapper for Fluigent SDK is to use the NuGeT dependency. However, you can also build the wrapper source with examples by yourself (for that check the [Building instructions](#building-instructions) section). |
| 33 | + |
| 34 | +### Install nuget using Visual Studio |
| 35 | +In order to install **fgt_sdk** package you have right-click your project in the solution explorer and choose **Manage NuGeT packages...**. In the search input type **fgt_sdk**, set **nuget.org** as a package source and click install. If you cannot find the package, you can alternatively download the latest **release** from GitHub that contains the NuGeT. Then you can install the package locally by adding a new **package source** that points to a folder containing **fgt_sdk.X.X.X.nupkg** archive. |
| 36 | + |
| 37 | +Useful links: |
| 38 | + |
| 39 | + - [Create a .NET console application using Visual Studio](https://docs.microsoft.com/en-us/dotnet/core/tutorials/with-visual-studio) |
| 40 | + - [Manage NuGet packages in Visual Studio for Windows](https://docs.microsoft.com/en-us/nuget/consume-packages/install-use-packages-visual-studio) |
| 41 | + - [Manage NuGet packages in Visual Studio for Mac](https://docs.microsoft.com/en-us/visualstudio/mac/nuget-walkthrough?toc=/nuget/toc.json&view=vsmac-2019) |
| 42 | + |
| 43 | +### Install nuget using terminal |
| 44 | +Alternatively, you can use the terminal in order to install the **fgt_sdk** package. Here are the links to the tutorials on how to manage packages using: |
| 45 | + |
| 46 | + - [dotnet command-line interface](https://docs.microsoft.com/en-us/nuget/consume-packages/install-use-packages-dotnet-cli) |
| 47 | + - [nuget command-line interface](https://docs.microsoft.com/en-us/nuget/consume-packages/install-use-packages-nuget-cli) |
| 48 | + |
| 49 | +## Building instructions |
| 50 | + |
| 51 | +In order to build the project make sure you have **.NET Core 3.1 SDK and .NET Core Runtime** installed. You can download the missing platform [here](https://dotnet.microsoft.com/download). |
| 52 | + |
| 53 | +### Build using Visual Studio |
| 54 | + |
| 55 | +Open the `fgt_sdk_csharp.sln` file in Visual Studio. From the `Build` menu choose `Build Solution` option. In order to run an example change the startup item in the toolbar menu to the chosen project and from the `Debug` menu choose `Start Debugging`. |
| 56 | +You can find compiled package under a following path: |
| 57 | +`\fgt_sdk_csharp\bin\{build type}\fgt_sdk.X.X.X.nupkg` |
| 58 | + |
| 59 | +### Build using dotnet command-line interface |
| 60 | +Open the terminal in the root directory (where the file `fgt-sdk-csharp.sln` is located). Build the project using a command below |
| 61 | +```sh |
| 62 | +dotnet build |
| 63 | +``` |
| 64 | +This command will build the middleware project, produce a nuget package and compile all the examples. |
| 65 | +In order to run the example execute the `dotnet run` command with the `project` parameter: |
| 66 | +```sh |
| 67 | +dotnet run --project ./Examples/{example folder}/{example name}.csproj |
| 68 | +``` |
| 69 | + |
| 70 | +## FAQ |
| 71 | +Are you stuck with an error in your code? Find a couple of useful tips below! If it does not help to solve your problem and you think that you found a bug, consider adding a new issue on our [GitHub repository](https://github.com/Fluigent/fgt-SDK "GitHub repository"). |
| 72 | + |
| 73 | ++ *Why Fluigent class `fgtSdk` is undefined?* |
| 74 | + |
| 75 | +Make sure that you include the namespace with the `using` directive |
| 76 | +```csharp |
| 77 | +using fgt_sdk; |
| 78 | +``` |
0 commit comments