Skip to content

Commit

Permalink
Merge pull request #29 from WildernessLabs/v1.3.4
Browse files Browse the repository at this point in the history
V1.3.4
  • Loading branch information
jorgedevs authored Sep 26, 2023
2 parents f2bf555 + c0efd2e commit a56e29f
Show file tree
Hide file tree
Showing 7 changed files with 207 additions and 213 deletions.
1 change: 0 additions & 1 deletion .github/workflows/develop-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ jobs:
uses: actions/checkout@v3
with:
path: GNSS_Sensor_Tracker
ref: develop

- name: Setup .NET SDK
uses: actions/setup-dotnet@v1
Expand Down
28 changes: 28 additions & 0 deletions Contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Contribute to GNSS_Sensor_Tracker

**GNSS_Sensor_Tracker** is an open-source project by [Wilderness Labs](https://www.wildernesslabs.co/) and we encourage community feedback and contributions.

## How to Contribute

- **Found a bug?** [Report an issue](https://github.com/WildernessLabs/Meadow_Issues/issues)
- Have a **feature idea or driver request?** [Open a new feature request](https://github.com/WildernessLabs/Meadow_Issues/issues)
- Want to **contribute code?** Fork the [GNSS_Sensor_Tracker](https://github.com/WildernessLabs/GNSS_Sensor_Tracker) repository and submit a pull request against the `develop` branch

## Pull Requests

1. All PRs should target the `develop` branch on the GNSS_Sensor_Tracker repository.
2. All new public or protected classes, methods, and properties need XML comment documentation.
3. Please try to follow the existing coding patterns and practices.

## Pull Request Steps

1. Fork the repository
2. Clone your fork locally: `git clone https://github.com/WildernessLabs/GNSS_Sensor_Tracker`
3. Switch to the `develop` branch
4. Create a new branch: `git checkout -b feature/your-contribution`
5. Make your changes and commit: `git commit -m 'Added/Updated [feature/fix]`
6. Push to your fork: `git push origin feature/your-contribution`
7. Open a pull request at [GNSS_Sensor_Tracker/pulls](https://github.com/WildernessLabs/GNSS_Sensor_Tracker/pulls) targetting the `develop` branch
## Need Help?

If you have questions or need assistance, please join the Wilderness Labs [community on Slack](http://slackinvite.wildernesslabs.co/).
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
using Meadow.Foundation.Graphics;
using Meadow.Foundation.Graphics.MicroLayout;
using Meadow.Logging;
using System;

namespace GnssTracker_SQLite_Demo.Controllers
{
Expand All @@ -14,128 +13,119 @@ public class DisplayController
protected Logger Log { get => Resolver.Log; }
protected DisplayScreen DisplayScreen { get; set; }

protected Font12x20 largeFont { get; set; }
protected Font4x8 smallFont { get; set; }
protected AbsoluteLayout SplashLayout { get; set; }
protected AbsoluteLayout DataLayout { get; set; }

protected DisplayLabel TempLabel { get; set; }
protected DisplayLabel HumidityLabel { get; set; }
protected DisplayLabel PressureLabel { get; set; }
protected DisplayLabel LatitudeLabel { get; set; }
protected DisplayLabel LongitudeLabel { get; set; }
protected DisplayLabel CounterLabel { get; set; }
protected Font12x20 LargeFont { get; set; }
protected Font4x8 SmallFont { get; set; }

protected Label TemperatureLabel { get; set; }
protected Label HumidityLabel { get; set; }
protected Label PressureLabel { get; set; }
protected Label LatitudeLabel { get; set; }
protected Label LongitudeLabel { get; set; }
protected Label CounterLabel { get; set; }

public DisplayController(IGraphicsDisplay display)
{
largeFont = new Font12x20();
smallFont = new Font4x8();
LargeFont = new Font12x20();
SmallFont = new Font4x8();

DisplayScreen = new DisplayScreen(display, RotationType._270Degrees);
}

public void ShowSplashScreen()
{
var image = Image.LoadFromResource("GnssTracker_SQLite_Demo.gnss_tracker.bmp");
SplashLayout = new AbsoluteLayout(DisplayScreen, 0, 0, DisplayScreen.Width, DisplayScreen.Height);

var displayImage = new DisplayImage(0, 0, 250, 122, image)
var image = Image.LoadFromResource("GnssTracker_SQLite_Demo.gnss_tracker.bmp");
var displayImage = new Picture(0, 0, 250, 122, image)
{
BackColor = Color.FromHex("#23ABE3"),
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Center,
};

DisplayScreen.Controls.Add(displayImage);
}
SplashLayout.Controls.Add(displayImage);

public void LoadDataScreen()
{
try
DataLayout = new AbsoluteLayout(DisplayScreen, 0, 0, DisplayScreen.Width, DisplayScreen.Height);

var box = new Box(0, 0, DisplayScreen.Width, DisplayScreen.Height)
{
DisplayScreen.Controls.Clear();

var box = new DisplayBox(0, 0, DisplayScreen.Width, DisplayScreen.Height)
{
ForeColor = Color.White,
Filled = true
};

var frame = new DisplayBox(5, 5, 240, 112)
{
ForeColor = Color.Black,
Filled = false
};

TempLabel = new DisplayLabel(10, 10, DisplayScreen.Width - 20, largeFont.Height)
{
Text = $"Temp: 0.00°C",
TextColor = Color.Black,
BackColor = Color.White,
Font = largeFont,
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Left
};

HumidityLabel = new DisplayLabel(10, 30, DisplayScreen.Width - 20, largeFont.Height)
{
Text = $"Humidity: 0.00%",
TextColor = Color.Black,
BackColor = Color.White,
Font = largeFont,
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Left
};

PressureLabel = new DisplayLabel(10, 50, DisplayScreen.Width - 20, largeFont.Height)
{
Text = $"Pressure: 0.00atm",
TextColor = Color.Black,
BackColor = Color.White,
Font = largeFont,
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Left
};

LatitudeLabel = new DisplayLabel(10, 72, DisplayScreen.Width - 20, largeFont.Height)
{
Text = $"Lat: 0°0'0.0\"",
TextColor = Color.White,
BackColor = Color.Red,
Font = largeFont,
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Left
};

LongitudeLabel = new DisplayLabel(10, 92, DisplayScreen.Width - 20, largeFont.Height)
{
Text = $"Lon: 0°0'0.0\"",
TextColor = Color.White,
BackColor = Color.Red,
Font = largeFont,
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Left
};

counter++;
CounterLabel = new DisplayLabel(222, 113, 20, 8)
{
Text = $"{counter.ToString("D4")}",
TextColor = Color.Black,
BackColor = Color.White,
Font = smallFont,
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Center
};

DisplayScreen.Controls.Add(box, frame, TempLabel, HumidityLabel, PressureLabel, LatitudeLabel, LongitudeLabel, CounterLabel);
}
catch (Exception e)
ForeColor = Color.White,
Filled = true
};
var frame = new Box(5, 5, 240, 112)
{
ForeColor = Color.Black,
Filled = false
};
TemperatureLabel = new Label(10, 10, DisplayScreen.Width - 20, LargeFont.Height)
{
Text = $"Temp: 0.00°C",
TextColor = Color.Black,
BackColor = Color.White,
Font = LargeFont,
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Left
};
HumidityLabel = new Label(10, 30, DisplayScreen.Width - 20, LargeFont.Height)
{
Text = $"Humidity: 0.00%",
TextColor = Color.Black,
BackColor = Color.White,
Font = LargeFont,
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Left
};
PressureLabel = new Label(10, 50, DisplayScreen.Width - 20, LargeFont.Height)
{
Log?.Error($"err while rendering: {e.Message}");
}
Text = $"Pressure: 0.00atm",
TextColor = Color.Black,
BackColor = Color.White,
Font = LargeFont,
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Left
};
LatitudeLabel = new Label(10, 72, DisplayScreen.Width - 20, LargeFont.Height)
{
Text = $"Lat: 0°0'0.0\"",
TextColor = Color.White,
BackColor = Color.Red,
Font = LargeFont,
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Left
};
LongitudeLabel = new Label(10, 92, DisplayScreen.Width - 20, LargeFont.Height)
{
Text = $"Lon: 0°0'0.0\"",
TextColor = Color.White,
BackColor = Color.Red,
Font = LargeFont,
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Left
};
counter++;
CounterLabel = new Label(222, 113, 20, 8)
{
Text = $"{counter.ToString("D4")}",
TextColor = Color.Black,
BackColor = Color.White,
Font = SmallFont,
VerticalAlignment = VerticalAlignment.Center,
HorizontalAlignment = HorizontalAlignment.Center
};

DataLayout.Controls.Add(box, frame, TemperatureLabel, HumidityLabel, PressureLabel, LatitudeLabel, LongitudeLabel, CounterLabel);

DisplayScreen.Controls.Add(SplashLayout, DataLayout);

DataLayout.Visible = false;
}

public void UpdateDisplay(AtmosphericModel conditions, LocationModel locationInfo)
{
TempLabel.Text = $"Temp: {conditions.Temperature?.Celsius:n2}°C";
SplashLayout.Visible = false;
DataLayout.Visible = true;

TemperatureLabel.Text = $"Temp: {conditions.Temperature?.Celsius:n2}°C";
HumidityLabel.Text = $"Humidity: {conditions.RelativeHumidity?.Percent:n2}%";
PressureLabel.Text = $"Pressure: {conditions.Pressure?.StandardAtmosphere:n2}atm";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public async Task Initialize(IGnssTrackerHardware gnssTracker)
if (gnssTracker.Display is { } display)
{
DisplayController = new DisplayController(display);
DisplayController.ShowSplashScreen();
await Task.Delay(TimeSpan.FromSeconds(20));
}

Expand All @@ -47,8 +46,6 @@ public async Task Initialize(IGnssTrackerHardware gnssTracker)

public void Start()
{
DisplayController.LoadDataScreen();

if (GnssTracker.AtmosphericSensor is { } bme)
{
bme.Updated += AtmosphericSensorUpdated;
Expand Down
7 changes: 0 additions & 7 deletions Source/GnssTracker/GnssTracker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,4 @@
<PackageReference Include="Meadow.Foundation.Sensors.Atmospheric.Bme68x" Version="*" />
<PackageReference Include="Meadow.Foundation.Sensors.Gnss.NeoM8" Version="*" />
</ItemGroup>
<!--<ItemGroup>
<PackageReference Include="Meadow.F7" Version="*" />
<PackageReference Include="Meadow.Foundation" Version="*" />
<PackageReference Include="Meadow.Foundation.Displays.ePaper" Version="*" />
<PackageReference Include="Meadow.Foundation.Sensors.Atmospheric.Bme68x" Version="*" />
<PackageReference Include="Meadow.Foundation.Sensors.Gnss.NeoM8" Version="*" />
</ItemGroup>-->
</Project>
Loading

0 comments on commit a56e29f

Please sign in to comment.