Skip to content
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

feat: Tool changer buttons in extruder control panel #1561

Conversation

TypQxQ
Copy link

@TypQxQ TypQxQ commented Sep 19, 2023

Description

  • Added a button for Tool Droppoff if there exists a macro named "TOOL_DROPOFF".
  • Added a button for Tool Lock if there exists a macro named "TOOL_LOCK".
  • Added a button for Tool Unlock if there exists a macro named "TOOL_UNLOCK".
  • Swedish translation for Extruder Control Panel.

Not sure of the aesthetics as I have never before worked with Vue.

Related Tickets & Documents

Mobile & Desktop Screenshots/Recordings

image

[optional] Are there any post-deployment tasks we need to perform?

- Added a button for Tool Droppoff if there exists a macro named "TOOL_DROPOFF".
- Added a button for Tool Lock if there exists a macro named "TOOL_LOCK".
- Added a button for Tool Unlock if there exists a macro named "TOOL_UNLOCK".
- Swedish translation for Extruder Control Panel
@github-actions
Copy link
Contributor

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 3
sv.json 324 9

@github-actions
Copy link
Contributor

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 3
sv.json 324 9

@meteyou
Copy link
Member

meteyou commented Sep 20, 2023

Thx for your PR! Are these macro names a "standard"?

@TypQxQ
Copy link
Author

TypQxQ commented Sep 20, 2023

Thx for your PR! Are these macro names a "standard"?

This are the commands I use in KTCC and that reflects the functionality. Same macros names are also used in JubileeKlipper. I can't find different names used in Klipper for them.

`TOOL_DROPOFFis used by KTCC and in Xonman macros for Jubilee. I can't find any alternative names. The standard for it in RRF isT-1`` in Marlin it is ``G27``. T-1 is most logical but incompatible with Klipper naming.

The TOOL_LOCK is named tool_lock in the RRF Jubilee reference while in e3d RRF it is named Coupler - Lock.

@meteyou
Copy link
Member

meteyou commented Sep 20, 2023

Are there any current efforts to merge this code into Klipper?

Fix the UI of the buttons and changed from looking only for macros to looking for macros or commands.
@github-actions
Copy link
Contributor

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 3
sv.json 324 9

@github-actions
Copy link
Contributor

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 3
sv.json 324 9

@TypQxQ
Copy link
Author

TypQxQ commented Sep 20, 2023

Are there any current efforts to merge this code into Klipper?

Not that I am aware.

I changed a little so the code looks for macros or commands now.
Also got the UI to look like I want:
image

@meteyou
Copy link
Member

meteyou commented Sep 20, 2023

I don't think, that the word Tool- is necessary here. Is there also a state behind these buttons? That you can highlight the current state?

@TypQxQ
Copy link
Author

TypQxQ commented Sep 20, 2023

I don't think, that the word Tool- is necessary here. Is there also a state behind these buttons? So you can highlight the current state?

Something like this when known tool is selected vs. not selected:
image
image

This is based on existing toolchangeMacros.

Because the toollock can be locked with an unknown tool, manualy selected, mostly while testing, the unlock should allways be available.

@TypQxQ
Copy link
Author

TypQxQ commented Sep 20, 2023

I do have a way to know if tool is unlocked for KTCC because when unlocked:
printer.ktcc.tool_current : -1

But that is only valid for KTCC.

@TypQxQ
Copy link
Author

TypQxQ commented Sep 20, 2023

Something like this is posible:
image
image

@HelgeKeck
Copy link

you could make the lock/unlock buttons as one bistate button with a state icon in it

@TypQxQ
Copy link
Author

TypQxQ commented Sep 20, 2023

you could make the lock/unlock buttons as one bistate button with a state icon in it

It's really hard to see if that lock is open or closed. I believe it is much better having text buttons and always having the option to unlock, In essence that is how most locks initialize so it doubles as a reset, init of the lock.

As a sidenote I have the same pictogram in my electric car to lock or unlock the charger cable. It's a pain to see if it's locked or unlocked so by that experience I would not recommend it. Not without a better pictogram.

I still like this the best 😄
image

@HelgeKeck
Copy link

you could make the lock/unlock buttons as one bistate button with a state icon in it

It's really hard to see if that lock is open or closed. I believe it is much better having text buttons

colors

@TypQxQ
Copy link
Author

TypQxQ commented Sep 20, 2023

you could make the lock/unlock buttons as one bistate button with a state icon in it

It's really hard to see if that lock is open or closed. I believe it is much better having text buttons

colors

Has to follow the same design language as the rest of Mainsail. So colors would be bad idea but I found the alternative lock icon 😃
image

@TypQxQ
Copy link
Author

TypQxQ commented Sep 20, 2023

And like this with tooltips and a divider:
image
image

@github-actions
Copy link
Contributor

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 4
sv.json 324 10

@github-actions
Copy link
Contributor

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 4
sv.json 324 10

@meteyou
Copy link
Member

meteyou commented Sep 21, 2023

Are there any current efforts to merge this code into Klipper?

Not that I am aware.

What is the reason for this? Usually, we only merge default klipper functions. Would it be possible to have a tool-changer printer with klipper without this "plugin"?

@TypQxQ
Copy link
Author

TypQxQ commented Sep 21, 2023

Are there any current efforts to merge this code into Klipper?

Not that I am aware.

What is the reason for this? Usually, we only merge default klipper functions. Would it be possible to have a tool-changer printer with klipper without this "plugin"?

This would work with any toolchanger using those commands. For example the klipper macros from Xon would work with this just as well as with the KTCC plugin.
This uses functionality from the current toolchangeMacros and adds possibility to use the "TOOL_DROPOFF", "TOOL_LOCK" and "TOOL_UNLOCK" macros or commands if available.

Had I been able to make plugins for Mainsail, I would but I am submitting pull requests as we discussed on Discord.

And I was planing to add more functionality specific to KTCC later.

@meteyou
Copy link
Member

meteyou commented Sep 21, 2023

@TypQxQ but what is stopping you from merging this "plugin" into klipper now?

Do you know how to create Vue "plugins" for a precompiled app?

@TypQxQ
Copy link
Author

TypQxQ commented Sep 21, 2023

@meteyou I have no idea 🤷 how to make a "plugin" for Vue. Because it is all precompiled, I see that it lacks flexibility. This is regrettable. I was confused because I've never worked with precompiled web projects and although I see the benefits of it being faster on a small computer like the Pi, it's verry constrictive.
First I heard of it was when I looked into Mainsail project 😄.
All my former web programming has been about extending the functionality 😃. First trough Perl in the '90s and later Java and .Net in the early '00s. I'm feeling old... 👴

Reason of not merging the KTCC plugin to Klipper mainstream is because it changes some of the core functionality in Klipper.

Klipper revolves around the Extruder. You can't not have an extruder active. In KTCC every tool can have or not have an extruder or partcooling fan. An extruder can be shared between multiple tools or no extruder being used at all.

Temperature is in Klipper one temperature for every extruder while in KTCC one Tool has Active temperature, Standby temperature and HeaterState (Active, Standby and Off). Switching tools needs to switch Active to Standby on previous tool and to Active on Next Tool. Also, Standby temperature has configurable timeout. For example, if a tool is used only in the beginning of print it is prudent to have it shut down to off after 10 minutes in Standby than having it at Standby temperature for the rest of the print.

Partcooling fan is carried over when possible and it's possible to control the fan of an unused tool.

Log and Statistics like for HappyHare, per print and persisitent for tool unlocks, locks, and individual tool mounts, unmounts.

@github-actions
Copy link
Contributor

Language file analysis report:

File Missing Keys Unused Keys
en.json 0 4
sv.json 326 10

@meteyou
Copy link
Member

meteyou commented Sep 21, 2023

I have no idea 🤷 how to make a "plugin" for Vue. Because it is all precompiled, I see that it lacks flexibility. This is regrettable. I was confused because I've never worked with precompiled web projects and although I see the benefits of it being faster on a small computer like the Pi, it's verry constrictive.
First I heard of it was when I looked into Mainsail project 😄.
All my former web programming has been about extending the functionality 😃. First trough Perl in the '90s and later Java and .Net in the early '00s. I'm feeling old... 👴

It sounds like you have a lot more experience than me in web programming 😅. In my experience, Vue unfortunately doesn't offer any real possibility of modularly loading something that hasn't been compiled with the main app.

Reason of not merging the KTCC plugin to Klipper mainstream is because it changes some of the core functionality in Klipper.
Klipper revolves around the Extruder. You can't not have an extruder active. In KTCC every tool can have or not have an extruder or partcooling fan. An extruder can be shared between multiple tools or no extruder being used at all.
Temperature is in Klipper one temperature for every extruder while in KTCC one Tool has Active temperature, Standby temperature and HeaterState (Active, Standby and Off). Switching tools needs to switch Active to Standby on previous tool and to Active on Next Tool. Also, Standby temperature has configurable timeout. For example, if a tool is used only in the beginning of print it is prudent to have it shut down to off after 10 minutes in Standby than having it at Standby temperature for the rest of the print.
Partcooling fan is carried over when possible and it's possible to control the fan of an unused tool.

I have no influence on what will be merged in Klipper, but to me it all sounds like a good addition/further development of Klipper. Have you already had a conversation about this with Kevin?

@meteyou
Copy link
Member

meteyou commented Feb 3, 2024

I am closing this PR because no response. Please create a new (up-to-date) PR if you want to continue working on this feature.

@meteyou meteyou closed this Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants