Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/images/displays/GDEQ031T10_display.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions lib/constants/asset_paths.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ class ImageAssets {
static const String blackBoard = 'assets/canvas/black.png';
static const String epaper37Bwr =
'assets/images/displays/epaper_3.7_bwr.webp';
static const String GDEQ031T10Display =
'assets/images/displays/GDEQ031T10_display.png';
Comment on lines +8 to +9
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Maintain consistent naming conventions for asset constants.

Consider renaming 'GDEQ031T10Display' to 'gdeq031t10Display' to match the existing lowerCamelCase convention and Dart guidelines.

Suggested implementation:

  static const String gdeq031t10Display =
      'assets/images/displays/GDEQ031T10_display.png';

If GDEQ031T10Display is referenced elsewhere in your codebase, update those references to use gdeq031t10Display for consistency.

static const String epaper37Bw = 'assets/images/displays/epaper_3.7_bw.webp';
static const String customExport = 'assets/images/displays/export_image.webp';
static const String waveshare2_9 = 'assets/images/displays/waveshare_2.9.png';
Expand Down
3 changes: 3 additions & 0 deletions lib/image_library/utils/epd_utils.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'package:magicepaperapp/util/epd/display_device.dart';
import 'package:magicepaperapp/util/epd/gdeq031t10.dart';
import 'package:magicepaperapp/util/epd/gdey037z03.dart';
import 'package:magicepaperapp/util/epd/gdey037z03bw.dart';
import 'package:magicepaperapp/util/epd/waveshare_2in9.dart';
Expand All @@ -18,6 +19,8 @@ class EpdUtils {
return Gdey037z03BW();
case 'waveshare-2.9':
return Waveshare2in9();
case 'GDEQ031T10':
return GDEQ031T10();
default:
return Gdey037z03();
}
Expand Down
38 changes: 38 additions & 0 deletions lib/util/epd/gdeq031t10.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import 'package:flutter/material.dart';
import 'package:magicepaperapp/constants/asset_paths.dart';
import 'package:magicepaperapp/util/epd/driver/uc8253.dart';
import 'package:magicepaperapp/util/image_processing/image_processing.dart';
import 'package:image/image.dart' as img;
import 'driver/driver.dart';
import 'epd.dart';

class GDEQ031T10 extends Epd {
@override
get width => 320;

@override
get height => 240;

@override
String get name => 'E-Paper 3.1"';
@override
String get modelId => 'GDEQ031T10';
@override
String get imgPath => ImageAssets.GDEQ031T10Display;

@override
get colors => [Colors.white, Colors.black];

@override
get controller => Uc8253() as Driver;
Comment on lines +26 to +27
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Avoid unnecessary type casting if Uc8253 already implements Driver.

The explicit cast can be removed for cleaner code and to prevent issues if the class hierarchy changes.

Suggested change
@override
get controller => Uc8253() as Driver;
@override
get controller => Uc8253();


@override
List<img.Image Function(img.Image)> get processingMethods => [
ImageProcessing.bwFloydSteinbergDither,
ImageProcessing.bwFalseFloydSteinbergDither,
ImageProcessing.bwStuckiDither,
ImageProcessing.bwAtkinsonDither,
ImageProcessing.bwHalftoneDither,
ImageProcessing.bwThreshold,
];
}
2 changes: 2 additions & 0 deletions lib/view/display_selection_screen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:magicepaperapp/constants/string_constants.dart';
import 'package:magicepaperapp/provider/getitlocator.dart';
import 'package:magicepaperapp/util/epd/configurable_editor.dart';
import 'package:magicepaperapp/util/epd/display_device.dart';
import 'package:magicepaperapp/util/epd/gdeq031t10.dart';
import 'package:magicepaperapp/util/epd/gdey037z03.dart';
import 'package:magicepaperapp/util/epd/gdey037z03bw.dart';
import 'package:magicepaperapp/util/epd/waveshare_2in9.dart';
Expand All @@ -26,6 +27,7 @@ class _DisplaySelectionScreenState extends State<DisplaySelectionScreen> {
Gdey037z03(),
Gdey037z03BW(),
Waveshare2in9(),
GDEQ031T10(),
ConfigurableEpd(
width: 400,
height: 300,
Expand Down
Loading