Skip to content

Spool-Editing-Dialog: Auto weight/length feature #206

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

Merged
merged 14 commits into from
Nov 13, 2021

Conversation

TiziG
Copy link
Contributor

@TiziG TiziG commented Oct 20, 2021

New functionality for the spool editing dialog. Let me know what you think!

New Functionality:

  • Filament weight input values get automatically converted from gram to mm and vice versa. (Requires valid diameter and density)
  • A new dropdown select enables auto updating of different values. This allows for following calculations:
    • Calculate initial/remaining/used filament weight by measuring the combined filament+spool weight and defining the empty spool weight.
    • Calculate empty spool weight by measuring the initial combined filament+spool weight and defining the initial filament weight.

UI Changes

  • Split weight inputs into 3 categories: Filament, Spool, Combined
  • Added inputs for combined weight
  • Added auto calculation dropdown
  • Added info texts for auto calculation and unit conversions
  • Fixed overflow behavior of the editing dialog. Previously some inputs got covered by the gray button section from the bottom (on small screens).

Implementation Details

The new logic is implemented solely in the dialog view model. The new input fields (for combined weight) are derived fields and do not get stored outside the view model (hence no db changes).

Related Tickets

implements #202

Screenshots

dialog

missing diameter

autofilament

dropdown

@TiziG
Copy link
Contributor Author

TiziG commented Nov 4, 2021

@OllisGit
Merge conflicts are now resolved.

The only debatable conflict was the css for the dialog min/max height. Both your version 1.5 and this PR tried to fix the height issues. I chose my solution, as it also prevents the dialog from becoming too high on large displays. Although I'm not quite sure if the now deleted #full-sized-box div had other side effects.

Solution in this PR:

html:

<div class="modal-body hack-flowbreak"  >
  <form  class="form-horizontal" id="spool-form" >
    ...

css:

.hack-flowbreak {
  max-height: calc(100vh - 250px) !important;
}

Solution of Version 1.5:

html

  <div class="modal-body "  >
    <div class="full-sized-box">
      <form  class="form-horizontal" id="spool-form" >
        ...

js

self.spoolDialog.modal({
    minHeight: function() { return Math.max($.fn.modal.defaults.maxHeight() - 180, 250); },
    ...
})

@OllisGit OllisGit merged commit 45bdb52 into OllisGit:master Nov 13, 2021
@OllisGit OllisGit added status: inNextRelease Will be implemented/fixed in next release and removed status: analysing labels Nov 14, 2021
@OllisGit
Copy link
Owner

Fyi: I will try your css solution...the minHeight is taken from OP sourcecode I only adjust the maxheight, e.g. AboutDialog

            self.aboutDialog
                .modal({
                    minHeight: function () {
                        return Math.max($.fn.modal.defaults.maxHeight() - 80, 250);
                    }
                })
                .css({
                    "width": "auto",
                    "margin-left": function () {
                        return -($(this).width() / 2);
                    }
                });

@OllisGit
Copy link
Owner

Hi @TiziG,

I changed the ui a little bit (make it more compact). Smaller headers and replace all "Auto calculation prevents editing." with a single static note on top.

image

... I will change some other stuff (not related to this PR), so it will take a while when I release the next version.

@OllisGit
Copy link
Owner

Btw. which calc.mode should be the default one? and should this be stored in plugins-settings or in each spool?

OllisGit added a commit that referenced this pull request Jan 12, 2022
- E release-channles
- E stale-bot via github-actions
- E #79, #87, #99, #119, #157, #176, #202, weight calculation during editing PR #206, thx al lot @TiziG
- E #106 switching from travis to github-actions
- E #107, #215 database-settings in the log will only be shown, if sql-logging is enabled
- E #170 inform user about switching a spool already selected
- E #213 sort/filter options in spool selection dialog
- E Extrusion-Debugging: Show current extrusion during printing

- B #188 touchUI conflict
- B #193, #196 sorting/showing of remaining weight
- B #205 changed to "browser-native" date/time picker
- B #210 loadCatalogColors when color name is blank
- B #211 button text changed
- B #212 import CSV only if printer in idle-mode
- B #216 FilamentManager and SpoolManager used same viewmodel
- B #217 when print is paused the extruded filament is assigned to the spool and the counter is reseted
@OllisGit
Copy link
Owner

Hi @TiziG,

your merge is now in the latest release. Thanks again, very helpful!

I changed some small things...e.g. remaining field is now in readonly mode. The value is only calculated.

Please test and give a feedback if you found some issues.

@OllisGit OllisGit removed the status: inNextRelease Will be implemented/fixed in next release label Jan 12, 2022
@TiziG
Copy link
Contributor Author

TiziG commented Jan 13, 2022

Awesome, thanks for your work @OllisGit !
I'll check it out in the next few days.

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.

2 participants