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

Revamp time cost feature #4392

Closed
wants to merge 52 commits into from
Closed

Revamp time cost feature #4392

wants to merge 52 commits into from

Conversation

cochcoder
Copy link
Contributor

@cochcoder cochcoder commented Mar 9, 2024

I revamped the time cost feature, so that it would be easier and more accessible for beginners to pros. Besides having to estimate the cost per hour, now you'll need to give your wattage per hour and price per kWh instead. I am open to having this as a separate feature from the current time cost system, however, I don't currently know how to do this as I am new to C++.

Any feedback would be appreciated!

To Do:

  • Add electric consumption & electric price to system options
  • Add electric cost calculation
  • Rename total_cost to total_filament_cost for easier to understand code
  • Add electric cost & filament cost to Line Type sub-menu in legend
  • Add filament cost to Filament sub-menu in legend
  • Add total cost to Line Type sub-menu in legend
  • Add electric cost, filament cost, and total cost in All Plates menu
  • Add a button/other costs field for a substitute of the current cost per hour field

@cochcoder cochcoder marked this pull request as ready for review March 9, 2024 04:36
@Eldenroot
Copy link
Contributor

I need to split the cost - to see coat for filament amd cost for others (electricity etc)

@cochcoder
Copy link
Contributor Author

Do you mean that the standard time cost feature is the best for you? Or do you mean that you'd like to see the cost of filament and electricity separately in the statistics?

@Eldenroot
Copy link
Contributor

Separately, because sometimes I need to know the proce for filament, electricity and time stabdalone

@cochcoder
Copy link
Contributor Author

Do you have any idea where the file for the Total Estimation menu would be?

@Eldenroot
Copy link
Contributor

In the legend (where you can see filament used etc.)

@cochcoder
Copy link
Contributor Author

In the legend (where you can see filament used etc.)

I was wondering what the file that controls the legend would be located (I haven't dealt with GitHub repos this complex). I think I found the file under src/slic3r/GUI/GCodeViewer.cpp?

Rename total_cost to total_filament_cost
Add electric_cost to print_statistics
Rename Cost in legend to Filament cost as well as changing print statistic used
@SoftFever
Copy link
Owner

@cochcoder
do you mind to share some screenshots?

@cochcoder
Copy link
Contributor Author

@cochcoder do you mind to share some screenshots?

Sure!

In the printer settings I replaced time cost with electric consumption and electric cost:
Screenshot_electric_cost
I am currently trying to change the cost value in the legend to instead be two separate values, filament cost & energy cost:
Screenshot_wanttochange

@Eldenroot
Copy link
Contributor

Anyway, just a note. I know that my buddy use time cost feature in a different way.

He just set some value (includes electricity cost, maintance cost, cost of his work). So all is cobered by one value.

With thia PR this ability is lost. It could be solve with another field and settings.

@cochcoder
Copy link
Contributor Author

Anyway, just a note. I know that my buddy use time cost feature in a different way.

He just set some value (includes electricity cost, maintance cost, cost of his work). So all is cobered by one value.

With thia PR this ability is lost. It could be solve with another field and settings.

I was thinking about having a button so that the user could choose between either the current system or the system I am currently making for this exact reason. However, I'm not sure how I would do this, I'll start looking into it after I get this system working, any pointers on how I would do this would be great! Also, I am marking this PR as a Draft as I didn't realize there would be this many changes. Thank you for all the great feedback!

@cochcoder cochcoder marked this pull request as draft March 10, 2024 15:45
@cochcoder
Copy link
Contributor Author

cochcoder commented Mar 12, 2024

I can't figure out how to add a currency option to the code, I may try to add it in a different PR

@cochcoder
Copy link
Contributor Author

cochcoder commented Mar 12, 2024

Everything should be good now. This might close the issue #3502

@Eldenroot
Copy link
Contributor

So currency request will be added later? Thank you

@cochcoder
Copy link
Contributor Author

Yes, I'll add try to add currency later, once I understand more of C++. Thank you for your feedback!

@EdwardChamberlain
Copy link

Would it be preferable to simply reduce this to a "running cost / hr" metric and allow the user to roll in their energy costs / depreciation themselves. While it offer less specific functionality and detail it does reduce the complexity for the user while still providing the same benefit of exposing them to more accurate cost data in the slicer.

@cochcoder
Copy link
Contributor Author

If the user wants to, they can only fill out the other costs field, and it will work the same as the current time cost system.

@cochcoder
Copy link
Contributor Author

@SoftFever Are there any changes you think need to be implemented?

@bwstandard
Copy link

This would be cool to have in the main program. Hopefully it gets approved.

@Eldenroot
Copy link
Contributor

I hope so

@pedrohbraga
Copy link

Thank you so much for making this feature! What is missing for it to be incorporated into a future build? I am looking forward to using it!

@cochcoder
Copy link
Contributor Author

Thank you so much for making this feature! What is missing for it to be incorporated into a future build? I am looking forward to using it!

Nothing should be missing for this to be merged. It is all up to timing now and when it would be best implement a new feature that could have unforeseen bugs. I'm sure that SoftFever has it all planned out.

Thank you all for the support, I would have never thought that one of my first PRs would be so liked!

@vgdh
Copy link
Contributor

vgdh commented Mar 26, 2024

But the printer consumption is not a static thing. You need to measure it average consumption and with that you can already know the cost per hour: electricity_price_per_watt * printer_average_consumption_watt_in_hour

@cochcoder
Copy link
Contributor Author

But the printer consumption is not a static thing.

Yes, that is true, the system that is from this PR aims to make it easier for others to get a more detailed cost breakdown if they so wish, even though it could be wildly inaccurate, it depends on the print. However, this PR does open the pathway for someone to make an accurate electric consumption calculator and only have to edit one value in this PR while getting all the other features it adds.

You need to measure it average consumption and with that you can already know the cost per hour: electricity_price_per_watt * printer_average_consumption_watt_in_hour

That is true, however, most people won't want to go to that extent to get an estimation of their electric cost. Again, this PR is meant to be more of a stepping stone to open the current time cost feature to either being more complex & accurate or just getting the job done (even if it comes at the cost of accuracy)

@cochcoder cochcoder deleted the branch SoftFever:main April 1, 2024 22:57
@cochcoder cochcoder closed this Apr 1, 2024
@cochcoder cochcoder deleted the main branch April 1, 2024 22:57
@cochcoder cochcoder restored the main branch April 1, 2024 23:56
@cochcoder
Copy link
Contributor Author

For whatever reason this PR was closed by GitHub, I reopened it at #4840

@cochcoder cochcoder deleted the main branch April 1, 2024 23:59
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.

None yet

7 participants