sbrin / lopaka

Lopaka - Stunning graphics for embedded systems displays
https://lopaka.app
Apache License 2.0
315 stars 18 forks source link

Importing source code #125

Closed deadlink closed 4 months ago

deadlink commented 4 months ago

Importing source code based on regular expressions Fully supported platforms: u8g2 (arduino/esp-idf), adafruit, flipper All layers are supported, xbmp image import is supported, and non-computable values from variables and definitions are supported.

todo:

codesandbox[bot] commented 4 months ago

Review or Edit in CodeSandbox

Open the branch in Web EditorVS CodeInsiders
Open Preview

cloudflare-pages[bot] commented 4 months ago

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 948440d
Status: ✅  Deploy successful!
Preview URL: https://c198e2ff.lopaka-dev.pages.dev
Branch Preview URL: https://import-source-code.lopaka-dev.pages.dev

View logs

deadlink commented 4 months ago

@Gaai Hi, are you interested in this feature? I would appreciate it if you can try it on some real code, I only tested what we generate and on some examples from the web

Gaai commented 4 months ago

I tried importing lopaka code a few hours ago and nothing happened. How should I try?

Gaai commented 4 months ago

Alright. Just tried again. And cpp seems to work. Awesome already. All the icons are named "paint" though. I've tried a layout with strings, lines, icons and a custom image. All imports fine. Only the names of the strings are kept. Lines are called ' line' and icons and custom image are all called 'paint'. Already quite workable though

deadlink commented 4 months ago

We'll figure out with icons later, now the main thing is that it works correctly, all the layers are in place etc

Gaai commented 4 months ago

@deadlink You're on a roll! Just tested idf-style import. Looking good. Thank you!

Gaai commented 4 months ago

Only the fonts fell back to 4x6. Where I used 5x8 and 6x10 in the export

deadlink commented 4 months ago

@Gaai If you try to import the code exported from lopaka, make sure that there is setFont instead of setFont )

github-actions[bot] commented 4 months ago

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 52.8% 3111 / 5891
🔵 Statements 52.8% 3111 / 5891
🔵 Functions 22.81% 112 / 491
🔵 Branches 86.53% 212 / 245
File Coverage
File Stmts % Branch % Funcs % Lines Uncovered Lines
Changed Files
src/utils.ts 27.23% 78.94% 31.03% 27.23% 10-20, 22-32, 34-42, 44-50, 61-62, 70-75, 83-133, 136-155, 158-162, 173-174, 185-188, 205-217, 223-243, 246-295, 302-305, 309-312, 316-326, 329-336, 339-342, 352-364, 367-379, 382-395, 398-414, 417-426
src/core/session.ts 53.71% 76% 57.89% 53.71% 79-88, 90-113, 115-128, 130-137, 194-195, 198-204, 207-225, 238-295, 305-308, 315-325, 336-337, 341-343
src/core/decorators/mapping.ts 68.87% 78.12% 71.42% 68.87% 32-33, 49-71, 90, 103-123
src/core/layers/abstract-image.layer.ts 66.03% 100% 33.33% 66.03% 58-60, 66-68, 74-78, 84-86, 92-95, 101-102, 109-114, 119-136, 139-148
src/core/layers/paint.layer.ts 47.4% 100% 5.88% 47.4% 14-17, 23-26, 40-43, 49-51, 57-59, 76-86, 89-122, 125-128, 131-134
src/platforms/adafruit.ts 98.64% 70% 100% 98.64% 43
src/platforms/flipper.ts 98.92% 90.9% 100% 98.92% 69
src/platforms/layers.mock.ts 100% 100% 100% 100%
src/platforms/platform.ts 85.29% 100% 44.44% 85.29% 38-39, 42-43, 46-47, 62-63, 66-67
src/platforms/u8g2.ts 98.96% 70% 100% 98.96% 67
src/platforms/parsers/abstract-parser.ts 25.39% 100% 20% 25.39% 8-36, 39-45, 48-56, 59-60
src/platforms/parsers/adafruit.parser.ts 6.03% 100% 0% 6.03% 7-115
src/platforms/parsers/flipper.parser.ts 9.91% 100% 33.33% 9.91% 10-16, 19-120
src/platforms/parsers/source-map-parser.ts 25% 100% 50% 25% 8-31
src/platforms/parsers/u8g2.parser.ts 6.03% 100% 0% 6.03% 7-115
Generated in workflow #10