-
Notifications
You must be signed in to change notification settings - Fork 15
feat: added 3.1 inch ePaper Display 320x240 UC8253 SPI E Ink screen, GDEQ031T10 . #121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's GuideAdds support for the 3.1" GDEQ031T10 ePaper display by introducing a new Epd subclass that reuses the UC8253 driver, registering it in core utilities and the UI selection screen, and defining its image asset. ER diagram for display image assetserDiagram
IMAGE_ASSETS {
string GDEQ031T10Display
string epaper37Bwr
string epaper37Bw
}
GDEQ031T10 ||--|| IMAGE_ASSETS : uses
Gdey037z03 ||--|| IMAGE_ASSETS : uses
Gdey037z03BW ||--|| IMAGE_ASSETS : uses
Class diagram for new GDEQ031T10 Epd subclassclassDiagram
class Epd {
<<abstract>>
+int width
+int height
+String name
+String modelId
+String imgPath
+List<Color> colors
+Driver controller
+List<Function> processingMethods
}
class GDEQ031T10 {
+width = 320
+height = 240
+name = "E-Paper 3.1\""
+modelId = "GDEQ031T10"
+imgPath = ImageAssets.GDEQ031T10Display
+colors = [Colors.white, Colors.black]
+controller = Uc8253()
+processingMethods: [bwrFloydSteinbergDither, bwrFalseFloydSteinbergDither, bwrStuckiDither, bwrTriColorAtkinsonDither, bwrHalftone, bwrThreshold]
}
class Uc8253
class Driver
class ImageAssets {
+GDEQ031T10Display
}
class ImageProcessing {
+bwrFloydSteinbergDither
+bwrFalseFloydSteinbergDither
+bwrStuckiDither
+bwrTriColorAtkinsonDither
+bwrHalftone
+bwrThreshold
}
Epd <|-- GDEQ031T10
GDEQ031T10 --> Uc8253 : uses
GDEQ031T10 --> ImageAssets : uses
GDEQ031T10 --> ImageProcessing : uses
Uc8253 --|> Driver
Class diagram for EpdUtils and DisplaySelectionScreen display registrationclassDiagram
class EpdUtils {
+static Epd getEpdFromMetadata(Map<String, dynamic>?)
}
class DisplaySelectionScreen {
+List<Epd> displays
}
class GDEQ031T10
class Gdey037z03
class Gdey037z03BW
EpdUtils --> GDEQ031T10 : registers
EpdUtils --> Gdey037z03 : registers
EpdUtils --> Gdey037z03BW : registers
DisplaySelectionScreen --> GDEQ031T10 : lists
DisplaySelectionScreen --> Gdey037z03 : lists
DisplaySelectionScreen --> Gdey037z03BW : lists
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @Dhruv1797 - I've reviewed your changes and they look great!
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location> `lib/util/epd/gdeq031t10.dart:26` </location>
<code_context>
+ get colors => [Colors.white, Colors.black];
+
+ @override
+ get controller => Uc8253() as Driver;
+
+ GDEQ031T10() {
</code_context>
<issue_to_address>
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.
</issue_to_address>
<suggested_fix>
<<<<<<< SEARCH
@override
get controller => Uc8253() as Driver;
=======
@override
get controller => Uc8253();
>>>>>>> REPLACE
</suggested_fix>
### Comment 2
<location> `lib/util/epd/gdeq031t10.dart:32` </location>
<code_context>
+ processingMethods.add(ImageProcessing.bwrFloydSteinbergDither);
+ processingMethods.add(ImageProcessing.bwrFalseFloydSteinbergDither);
+ processingMethods.add(ImageProcessing.bwrStuckiDither);
+ processingMethods.add(ImageProcessing.bwrTriColorAtkinsonDither);
+ processingMethods.add(ImageProcessing.bwrHalftone);
+ processingMethods.add(ImageProcessing.bwrThreshold);
</code_context>
<issue_to_address>
Review inclusion of tri-color dithering for a two-color display.
Since only black and white are supported, using a tri-color dithering method may be misleading or produce unintended results. Please verify if this method is suitable for a two-color display.
</issue_to_address>
### Comment 3
<location> `lib/constants/asset_paths.dart:7` </location>
<code_context>
static const String redBoard = 'assets/canvas/red.png';
static const String blackBoard = 'assets/canvas/black.png';
static const String epaper37Bwr = 'assets/images/displays/epaper_3.7_bwr.png';
+ static const String GDEQ031T10Display =
+ 'assets/images/displays/GDEQ031T10_display.png';
static const String epaper37Bw = 'assets/images/displays/epaper_3.7_bw.PNG';
static const String tempIcon = 'assets/icons/icon.png';
</code_context>
<issue_to_address>
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.
</issue_to_address>
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
@override | ||
get controller => Uc8253() as Driver; |
There was a problem hiding this comment.
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.
@override | |
get controller => Uc8253() as Driver; | |
@override | |
get controller => Uc8253(); |
static const String GDEQ031T10Display = | ||
'assets/images/displays/GDEQ031T10_display.png'; |
There was a problem hiding this comment.
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.
Build StatusBuild successful. APKs to test: https://github.com/fossasia/magic-epaper-app/actions/runs/17101633609/artifacts/3809920521. |
@Vishveshwara please review this |
@Dhruv1797 please address Vish's comments |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
@Dhruv1797 resolve conflicts please |
@hpdang @Vishveshwara resolves conflicts with main branch. please review it once. |
Fixes: #105
https://www.good-display.com/product/426.html
added this E Ink Technology 3.1 inch ePaper Display 320x240 UC8253 SPI E Ink screen, GDEQ031T10 using same the
UC8253
display driver.Here is the demo video:
WhatsApp.Video.2025-07-30.at.5.55.15.PM.mp4
Summary by Sourcery
Add a new EPD implementation for the GDEQ031T10 3.1-inch E Ink display, integrate it into selection utilities and UI, and include its image asset.
New Features:
Enhancements: