Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

Commit

Permalink
Merge pull request #25 from WildernessLabs/jorge-display-updates
Browse files Browse the repository at this point in the history
Fix Display API changes
  • Loading branch information
adrianstevens authored Feb 8, 2024
2 parents b8a1403 + 03a2b1e commit 4e9795a
Show file tree
Hide file tree
Showing 13 changed files with 46 additions and 30 deletions.
6 changes: 3 additions & 3 deletions Source/CrossPlatform/MauiMeadow/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using Meadow;
using Meadow.Foundation.Displays;
using Meadow.Foundation.Graphics;
using Meadow.Foundation.ICs.IOExpanders;
using Meadow.Peripherals.Displays;
using Meadow.UI;

namespace MauiMeadow
Expand All @@ -18,7 +18,7 @@ public App()
MainPage = new AppShell();
}

protected Task MeadowInitialize()
protected Task MeadowInitialize()
{
var expander = new Ft232h();

Expand All @@ -30,7 +30,7 @@ protected Task MeadowInitialize()
resetPin: expander.Pins.C2
);

Resolver.Services.Add<IGraphicsDisplay>(display);
Resolver.Services.Add<IPixelDisplay>(display);

return Task.CompletedTask;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Meadow;
using Meadow.Foundation.Graphics;
using Meadow.Peripherals.Displays;
using System.ComponentModel;
using System.Runtime.CompilerServices;
using System.Windows.Input;
Expand All @@ -10,7 +11,7 @@ public class MainPageViewModel : INotifyPropertyChanged
{
private MicroGraphics graphics;

private IGraphicsDisplay _display;
private IPixelDisplay _display;

public ICommand CountCommand { get; set; }

Expand All @@ -27,7 +28,7 @@ private async Task WaitForDisplay()
{
while (_display == null)
{
_display = Resolver.Services.Get<IGraphicsDisplay>();
_display = Resolver.Services.Get<IPixelDisplay>();
await Task.Delay(100);
}

Expand Down
4 changes: 2 additions & 2 deletions Source/Linux/Amg8833_Sample/MeadowApp.cs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
using Meadow;
using Meadow.Foundation.Displays;
using Meadow.Foundation.Graphics;
using Meadow.Foundation.Graphics.MicroLayout;
using Meadow.Foundation.Sensors.Camera;
using Meadow.Peripherals.Displays;
using Meadow.Pinouts;

public class MeadowApp : App<Linux<RaspberryPi>>
{
private IGraphicsDisplay _display;
private IPixelDisplay _display;
private DisplayScreen _screen;
private Amg8833 _camera;
private Box[] _pixelBoxes;
Expand Down
9 changes: 9 additions & 0 deletions Source/Linux/Meadow.Linux.Samples.sln
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Cloud", "Cloud", "{7E2108C1
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CloudCommandReceiver", "Cloud\CloudCommandReceiver\CloudCommandReceiver.csproj", "{1B5A6F9A-D905-454F-895D-C7A06FD98D7B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Meadow.Foundation.Core", "..\..\..\Meadow.Foundation\Source\Meadow.Foundation.Core\Meadow.Foundation.Core.csproj", "{DEC506C7-85AC-4381-AECA-B71E7CA03D05}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -251,6 +253,12 @@ Global
{1B5A6F9A-D905-454F-895D-C7A06FD98D7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1B5A6F9A-D905-454F-895D-C7A06FD98D7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1B5A6F9A-D905-454F-895D-C7A06FD98D7B}.Release|Any CPU.Build.0 = Release|Any CPU
{DEC506C7-85AC-4381-AECA-B71E7CA03D05}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DEC506C7-85AC-4381-AECA-B71E7CA03D05}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DEC506C7-85AC-4381-AECA-B71E7CA03D05}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{DEC506C7-85AC-4381-AECA-B71E7CA03D05}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DEC506C7-85AC-4381-AECA-B71E7CA03D05}.Release|Any CPU.Build.0 = Release|Any CPU
{DEC506C7-85AC-4381-AECA-B71E7CA03D05}.Release|Any CPU.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -291,6 +299,7 @@ Global
{0CB462BC-EC1D-4EE2-BDB8-884CA9308F30} = {7E2108C1-60C2-45AF-8C00-29275D81AB50}
{7E2108C1-60C2-45AF-8C00-29275D81AB50} = {AF3F2B7E-D0AC-4418-8E9E-5515874092C7}
{1B5A6F9A-D905-454F-895D-C7A06FD98D7B} = {7E2108C1-60C2-45AF-8C00-29275D81AB50}
{DEC506C7-85AC-4381-AECA-B71E7CA03D05} = {0E9EB1DB-A564-465B-9CE9-5E1CDD7306C6}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {E3F002EA-1A25-487F-9A5D-93D1E7EC6E31}
Expand Down
26 changes: 13 additions & 13 deletions Source/Linux/ST7789_Sample/MeadowApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -411,37 +411,37 @@ void ColorFontTest()

_graphics.Clear();

_graphics.DrawTriangle(120, 20, 200, 100, 120, 100, Meadow.Foundation.Color.Red, false);
_graphics.DrawTriangle(120, 20, 200, 100, 120, 100, Meadow.Color.Red, false);

_graphics.DrawRectangle(140, 30, 40, 90, Meadow.Foundation.Color.Yellow, false);
_graphics.DrawRectangle(140, 30, 40, 90, Meadow.Color.Yellow, false);

_graphics.DrawCircle(160, 80, 40, Meadow.Foundation.Color.Cyan, false);
_graphics.DrawCircle(160, 80, 40, Meadow.Color.Cyan, false);

int indent = 5;
int spacing = 14;
int y = indent;

_graphics.DrawText(indent, y, "Meadow F7 SPI ST7789!!");

_graphics.DrawText(indent, y += spacing, "Red", Meadow.Foundation.Color.Red);
_graphics.DrawText(indent, y += spacing, "Red", Color.Red);

_graphics.DrawText(indent, y += spacing, "Purple", Meadow.Foundation.Color.Purple);
_graphics.DrawText(indent, y += spacing, "Purple", Color.Purple);

_graphics.DrawText(indent, y += spacing, "BlueViolet", Meadow.Foundation.Color.BlueViolet);
_graphics.DrawText(indent, y += spacing, "BlueViolet", Color.BlueViolet);

_graphics.DrawText(indent, y += spacing, "Blue", Meadow.Foundation.Color.Blue);
_graphics.DrawText(indent, y += spacing, "Blue", Color.Blue);

_graphics.DrawText(indent, y += spacing, "Cyan", Meadow.Foundation.Color.Cyan);
_graphics.DrawText(indent, y += spacing, "Cyan", Color.Cyan);

_graphics.DrawText(indent, y += spacing, "LawnGreen", Meadow.Foundation.Color.LawnGreen);
_graphics.DrawText(indent, y += spacing, "LawnGreen", Color.LawnGreen);

_graphics.DrawText(indent, y += spacing, "GreenYellow", Meadow.Foundation.Color.GreenYellow);
_graphics.DrawText(indent, y += spacing, "GreenYellow", Color.GreenYellow);

_graphics.DrawText(indent, y += spacing, "Yellow", Meadow.Foundation.Color.Yellow);
_graphics.DrawText(indent, y += spacing, "Yellow", Color.Yellow);

_graphics.DrawText(indent, y += spacing, "Orange", Meadow.Foundation.Color.Orange);
_graphics.DrawText(indent, y += spacing, "Orange", Color.Orange);

_graphics.DrawText(indent, y += spacing, "Brown", Meadow.Foundation.Color.Brown);
_graphics.DrawText(indent, y += spacing, "Brown", Color.Brown);

_graphics.Show();

Expand Down
3 changes: 1 addition & 2 deletions Source/Windows/SPI/MeadowApp.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
using Meadow;
using Meadow.Foundation;
using Meadow.Foundation.Displays;
using Meadow.Foundation.Graphics;
using Meadow.Foundation.ICs.IOExpanders;
using Meadow.Peripherals.Displays;

public class MeadowApp : App<Windows>
{
Expand Down
5 changes: 3 additions & 2 deletions Source/Windows/WifiWeather/Views/DisplayView.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Meadow.Foundation.Graphics;
using Meadow.Foundation.Graphics.MicroLayout;
using Meadow.Foundation.Graphics.MicroLayout;
using Meadow.Peripherals.Displays;

namespace WifiWeather.Views
{
Expand Down Expand Up @@ -40,7 +41,7 @@ public class DisplayView
Font12x16 font12X16 = new Font12x16();
Font8x16 font8X16 = new Font8x16();

public DisplayView(IGraphicsDisplay display)
public DisplayView(IPixelDisplay display)
{
DisplayScreen = new DisplayScreen(display)
{
Expand Down
3 changes: 2 additions & 1 deletion Source/Windows/WinForms/Views/AtmosphericHMI.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Meadow.Foundation.Graphics;
using Meadow.Foundation.Graphics.MicroLayout;
using Meadow.Peripherals.Displays;
using System;
using System.Threading.Tasks;

Expand All @@ -25,7 +26,7 @@ public class AtmosphericHMI

Font12x20 font12X20 = new Font12x20();

public AtmosphericHMI(IGraphicsDisplay display)
public AtmosphericHMI(IPixelDisplay display)
{
DisplayScreen = new DisplayScreen(display)
{
Expand Down
3 changes: 2 additions & 1 deletion Source/Windows/WinForms/Views/CultivarView.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Meadow.Foundation.Graphics;
using Meadow.Foundation.Graphics.MicroLayout;
using Meadow.Peripherals.Displays;
using System;
using System.Threading.Tasks;

Expand Down Expand Up @@ -37,7 +38,7 @@ public class CultivarView

protected Picture ledHeater { get; set; }

public CultivarView(IGraphicsDisplay _display)
public CultivarView(IPixelDisplay _display)
{
screen = new DisplayScreen(_display);

Expand Down
3 changes: 2 additions & 1 deletion Source/Windows/WinForms/Views/HomeWidget.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Meadow;
using Meadow.Foundation.Graphics;
using Meadow.Foundation.Graphics.MicroLayout;
using Meadow.Peripherals.Displays;
using System;
using System.Threading.Tasks;

Expand Down Expand Up @@ -45,7 +46,7 @@ public class HomeWidget
Font12x20 font12X20 = new Font12x20();
Font6x8 font6x8 = new Font6x8();

public HomeWidget(IGraphicsDisplay display)
public HomeWidget(IPixelDisplay display)
{
DisplayScreen = new DisplayScreen(display)
{
Expand Down
3 changes: 2 additions & 1 deletion Source/Windows/WinForms/Views/ProjectLabDemoView.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Meadow.Foundation.Graphics;
using Meadow.Foundation.Graphics.MicroLayout;
using Meadow.Peripherals.Displays;
using System;
using System.Threading.Tasks;

Expand Down Expand Up @@ -92,7 +93,7 @@ internal class ProjectLabDemoView
private Font8x16 font8x16 = new Font8x16();
private Font6x8 font6x8 = new Font6x8();

public ProjectLabDemoView(IGraphicsDisplay display)
public ProjectLabDemoView(IPixelDisplay display)
{
DisplayScreen = new DisplayScreen(display)
{
Expand Down
3 changes: 2 additions & 1 deletion Source/Windows/WinForms/Views/WiFiWeather.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using Meadow.Foundation.Graphics;
using Meadow.Foundation.Graphics.MicroLayout;
using Meadow.Peripherals.Displays;
using System;
using System.Threading.Tasks;

Expand Down Expand Up @@ -42,7 +43,7 @@ public class WiFiWeather
Font12x16 font12X16 = new Font12x16();
Font8x16 font8X16 = new Font8x16();

public WiFiWeather(IGraphicsDisplay display)
public WiFiWeather(IPixelDisplay display)
{
DisplayScreen = new DisplayScreen(display)
{
Expand Down
3 changes: 2 additions & 1 deletion Source/Windows/WinForms/Views/WifiWeatherV2.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using Meadow;
using Meadow.Foundation.Graphics;
using Meadow.Foundation.Graphics.MicroLayout;
using Meadow.Peripherals.Displays;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
Expand Down Expand Up @@ -56,7 +57,7 @@ internal class WifiWeatherV2
protected Label Sunrise { get; set; }
protected Label Sunset { get; set; }

public WifiWeatherV2(IGraphicsDisplay display)
public WifiWeatherV2(IPixelDisplay display)
{
DisplayScreen = new DisplayScreen(display)
{
Expand Down

0 comments on commit 4e9795a

Please sign in to comment.