Skip to content

Remove the Code enum#229

Merged
sophiedeziel merged 1 commit intov3.xfrom
10-16-remove_the_code_enum
Oct 17, 2024
Merged

Remove the Code enum#229
sophiedeziel merged 1 commit intov3.xfrom
10-16-remove_the_code_enum

Conversation

@sophiedeziel
Copy link
Collaborator

@sophiedeziel sophiedeziel commented Oct 16, 2024

Follow-up to #211

The Code enum bothered me a lot. I figured how to make the interpreter work with a magic function without having to use an enum. I think Typescript did not complain in the previous implementation because enum values are the same type or subtype of the index method. I had to add an index signature to make it work with strings.

Now, to define a new gcode implementation there's only one file to touch (excluding tests). We only have to define the new method!

@sophiedeziel
Copy link
Collaborator Author

sophiedeziel commented Oct 16, 2024

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @sophiedeziel and the rest of your teammates on Graphite Graphite

@github-actions
Copy link

Visit the preview URL for this PR (updated for commit c724090):

https://gcode-preview--pr229-10-16-remove-the-cod-c3ji4tzq.web.app

(expires Fri, 15 Nov 2024 05:25:16 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 59bd114ae4847b32c2bba0b68620b9069a3e3531

@sophiedeziel sophiedeziel changed the title Remove the code enum Remove the Code enum Oct 16, 2024
@sophiedeziel sophiedeziel marked this pull request as ready for review October 16, 2024 05:32
@sophiedeziel sophiedeziel merged commit 7ac2f43 into v3.x Oct 17, 2024
@sophiedeziel sophiedeziel deleted the 10-16-remove_the_code_enum branch October 17, 2024 23:22
@remcoder
Copy link
Member

nice an DRY!

we could now generate the methods for T0 .. Tx! Metaprogramming! :-)

sophiedeziel added a commit that referenced this pull request Oct 19, 2024
sophiedeziel added a commit that referenced this pull request Oct 19, 2024
sophiedeziel added a commit that referenced this pull request Oct 19, 2024
* Remove the code enum (#229)

* Bring back a representation of layers

* No need to expose isPlanar now

* Make layers 100% progressive rendering ready

* Layer number, height and z

* fix the splitting logic
sophiedeziel added a commit that referenced this pull request Oct 24, 2024
sophiedeziel added a commit that referenced this pull request Oct 24, 2024
* Remove the code enum (#229)

* Bring back a representation of layers

* No need to expose isPlanar now

* Make layers 100% progressive rendering ready

* Layer number, height and z

* fix the splitting logic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants