Closed martinbudden closed 2 years ago
You seem to have got rid of the pseudo polymorphism. That would break my current 3D printer which has multiple extruders that vary by hotend type and I will also add two more types soon.
You seem to have got rid of the pseudo polymorphism.
Yes, that was deliberate, since I don't really think hotends form a polymorphic class. I've also been doing work on using multiple hotends with my printers and I find there is little in common between hotends. If I want to support e3d, micro swiss, mosquito etc I basically have to deal with each on a case by case basis
It really needs module literals, like function literals, and then we could get rid of the type enum. But while there isn't I use it to do the case by case switching.
But while there isn't I use it to do the case by case switching.
When I need to do this sort of thing I just a string literal rather than an enum. So "e3d"
and "jhead"
rather than e3d
and jhead
.
if (hot_end_style(type) == "jhead")
is just as readable as if (hot_end_style(type) == jhead)
Yes it is just as readable but you don't get an error if it you spell it wrong.
Yes it is just as readable but you don't get an error if it you spell it wrong.
You do if you spell check your code.
True, but I don't.
I have no objection to making them strings though. Although it is breaking I doubt anybody else is using it.
Now updated as per discussion.
Got rid of the global enums
jhead
ande3d
. A global hotend enum is not very desirable.