mcdu-dotnet 1.4.0

dotnet add package mcdu-dotnet --version 1.4.0
                    
NuGet\Install-Package mcdu-dotnet -Version 1.4.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="mcdu-dotnet" Version="1.4.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="mcdu-dotnet" Version="1.4.0" />
                    
Directory.Packages.props
<PackageReference Include="mcdu-dotnet" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add mcdu-dotnet --version 1.4.0
                    
#r "nuget: mcdu-dotnet, 1.4.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package mcdu-dotnet@1.4.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=mcdu-dotnet&version=1.4.0
                    
Install as a Cake Addin
#tool nuget:?package=mcdu-dotnet&version=1.4.0
                    
Install as a Cake Tool

MCDU-DOTNET

The NuGet package for the library can be found here:

https://www.nuget.org/packages/mcdu-dotnet/

PRELIMINARY DOCUMENTATION

To instantiate a CDU object call the CduFactory static:

using(var mcdu = CduFactory.ConnectLocal())

You can pass an override to specify which CDU product to instantiate. There is also a function that enumerates the CDU USB devices that are currently active.

The ConnectLocal function returns an instance of an ICdu interface.

Reading from the CDU

The ICdu interface exposes two events, KeyDown and KeyUp. These are passed an event args that tells you which key was pressed or released. There are extension methods on the Key enum to convert keys into different formats.

Writing to the CDU

This is a two-step process. The ICdu exposes a Screen property which lets you set the content of the display. Setting the content of a screen does not update the CDU's display.

The ICdu exposes a function called RefreshDisplay. This function sends the current content of Screen to the device.

By default RefreshDisplay will not refresh the display if nothing has changed since the last update.

Composing Output

The Screen class can be cumbersome to work with. There is a higher-level compositing class called Compositor that is exposed on the ICdu via the Output property. It offers a fluent interface for setting the content of a screen.

Screen Buffers

Screens are not tied to an CDU, and they can be instantiated just like any other object. There are a pair of functions, CopyFrom and CopyTo, that can be used to copy the content of a screen buffer into the CDU's screen buffer.

LEDs

Same process as per screen buffers - there is an Led class that carries the state and brightness of the LED lights. The class is copyable.

There is a RefreshLeds function on the CDU object to copy the current state of the Led buffer to the device. If nothing has changed since the last refresh then, by default, nothing is sent.

Display, LED and Backlight Brightness

There are properties for each of these on the ICdu interface that let you specify the brightness levels as a percentage from 0 to 100. Note that if you set the display or LED brightness to 0% then you can't see anything.

The brightness properties will not send commands to the device if it detects no change from what was last sent. If you want to force the library to send brightness levels then you can call RefreshBrightnesses.

Colours

The display supports a palette of ten colours. The names and default values of the colours follow WinWing's defaults, but you are free to reassign the colours to anything you like via the Palette property. After changing the palette you need to call RefreshPalette to send your changes to the device.

Cleanup

The CDU device will retain its state after your program stops driving it - I.E. it will continue to show whatever you last wrote to the screen.

There is a function called Cleanup that will clear the screen, turn off all of the LEDs and set the brightness levels to 0 (overridable).

Fonts

The CDU device supports 1BPP bitmap fonts at varying widths and heights. However mcdu-dotnet only supports fonts of either 29 or 31 pixels high and between 17 and 23 pixels wide.

Fonts are described by an McduFontFile object:

https://github.com/vradarserver/cduhub/blob/main/library/mcdu-dotnet/McduFontFile.cs

Examples of font files can be found in the cduhub library's resources folder:

https://github.com/vradarserver/cduhub/tree/main/library/cduhub/Resources

Events

Besides the KeyDown and KeyUp events referenced elsewhere there is also the Disconnected event, which is raised when the library detects that the device has been disconnected.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.4.0 11 8/16/2025
1.4.0-beta-0002 88 8/13/2025
1.4.0-beta-0001 88 8/12/2025
1.1.0 41 8/2/2025
1.0.0 103 7/30/2025
1.0.0-alpha-0019 79 7/12/2025
1.0.0-alpha-0018 114 7/6/2025
1.0.0-alpha-0017 115 7/1/2025
1.0.0-alpha-0016 116 6/26/2025
1.0.0-alpha-0013 111 6/24/2025
1.0.0-alpha-0011 110 6/15/2025
1.0.0-alpha-0010 134 6/14/2025
1.0.0-alpha-0006 256 6/10/2025
1.0.0-alpha-0005 168 6/8/2025
1.0.0-alpha-0004 114 6/6/2025
1.0.0-alpha-0003 120 6/3/2025
1.0.0-alpha-0002 116 6/3/2025