Belasoft.Meadow.GraphicsConsole 1.0.3

dotnet add package Belasoft.Meadow.GraphicsConsole --version 1.0.3                
NuGet\Install-Package Belasoft.Meadow.GraphicsConsole -Version 1.0.3                
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="Belasoft.Meadow.GraphicsConsole" Version="1.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Belasoft.Meadow.GraphicsConsole --version 1.0.3                
#r "nuget: Belasoft.Meadow.GraphicsConsole, 1.0.3"                
#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.
// Install Belasoft.Meadow.GraphicsConsole as a Cake Addin
#addin nuget:?package=Belasoft.Meadow.GraphicsConsole&version=1.0.3

// Install Belasoft.Meadow.GraphicsConsole as a Cake Tool
#tool nuget:?package=Belasoft.Meadow.GraphicsConsole&version=1.0.3                

Welcome to Belasoft Graphics Console for Meadow

This library enables you to setup on or more consoles on a graphic display attached to a meadow board from Wilderness Labs.

meadow boards

You can have the whole display being a console, part of the display being a console, or you can even have more than one console on the same display.

example video

Demos on how to use the GraphicsConsole can be found here

Sometimes it's nice to have a console that can show messages, events, commands etc. so that you have an idea of what is going on in your program. A console is like having a small window to a log while it's being written. That can be quite usefull in certain situations and for me, I would have a hard time coding on the meadow without having a console. That's why I made it - but of course it depends on the individual needs and what you are developing.

Anyway, I hope you will find it usefull - Happy coding ☺

Examples of the Console in action

Video showing one Console on St7789 display

Video showing two Consoles on St7789 display

Video showing three Consoles on St7789 display

Installation steps

  1. Add the Nuget package to your project:

     Link to Nuget package: https://www.nuget.org/packages/Belasoft.Meadow.GraphicsConsole
    
  2. In the top of your MeadowApp.cs file add a using for the Belasoft.MeadowLibrary:

     using Belasoft.MeadowLibrary;
    
  3. Setup a display with MicroGraphics, for example the St7789:

     var display = new St7789
     (
         spiBus: MeadowApp.Device.CreateSpiBus(),
         chipSelectPin: Device.Pins.A03,
         dcPin: Device.Pins.A04,
         resetPin: Device.Pins.A05,
         width: 240, height: 240,
         colorMode: ColorMode.Format16bppRgb565
     );
    
     var graphics = new MicroGraphics(display)
     {
         Stroke = 1,
         CurrentFont = new Font8x12(),
         Rotation = RotationType._270Degrees
     };        
    
  4. Setup a Console:

     GraphicsConsole gc = new GraphicsConsole(graphics, false);
     gc.YTop = 0;
     gc.YBottom = graphics.Height / 2;
     gc.Indent = 0;
     gc.IndentRight = 0;
     gc.BorderColor = Color.Violet;
     gc.SetBorder();        
     Thread t = new Thread(gc.Start);
     t.Start();
    
  5. Begin writing texts to the console:

     gc.WriteLine("Initializing", Color.Red, ScaleFactor.X2, true);        
     gc.WriteLine("System starting...", Color.OrangeRed, ScaleFactor.X2, true);        
     gc.WriteLine("Warming up...", Color.Orange, ScaleFactor.X2, true);        
     gc.WriteLine("Comm ready", Color.Yellow, ScaleFactor.X2, true);
     gc.WriteLine("GO", Color.Green, ScaleFactor.X3, true);        
    

Important notes

NB: If writing to the graphics display from different threads, it's important to use the GraphicsWriter that ensures that two or more threads are not writing at the same time. And of course you should not write inside a console area 😃

Use the GraphicsWriter this way:

    GraphicsWriter gWriter = new GraphicsWriter(graphics);
    gWriter.DrawText(X, Y, Text, Color, Meadow.Foundation.Graphics.ScaleFactor.X2);
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. 
.NET Core netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.1 is compatible. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen 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.0.3 682 7/17/2023
1.0.2 652 7/17/2023

Corrected readme