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

When starting a print, the selected spool from Spool manager shows initial total spool weight not current spool weight #178

Closed
clarkiej opened this issue May 27, 2021 · 11 comments

Comments

@clarkiej
Copy link

clarkiej commented May 27, 2021

Previous versions showed current spool weight when selecting the spool for printing. For V1.4.3, now when you select the spool the spool choice shows the initial spool weight (1000 gms) instead of the current spool weight (854 gms) as it did previously. It makes it difficult to choose spools if you have more than one spool of the same type/colour of differing remains in your spool catalogue.

@clarkiej clarkiej changed the title When starting a print, the selected spool from Spool manager shows initial totyal spool weight not currenbt spool weight When starting a print, the selected spool from Spool manager shows initial total spool weight not current spool weight May 27, 2021
@OllisGit
Copy link
Owner

@clarkiej please attach a screenshot of the selected spool-dialog and also the popup.
Btw. the poup before print, shows the same weight as in the selection-box, rigth?

@OllisGit OllisGit added the status: waitingForFeedback Wating for Customers feedback label May 27, 2021
@clarkiej
Copy link
Author

clarkiej commented May 27, 2021 via email

@codingcatgirl
Copy link
Contributor

I might have the same problem here, but it looks different. There is different data displayed for the same spool. I'm not shown the initial weight of the spool but something is definitely wrong
Bildschirmfoto von 2021-05-28 12-56-35

  • The print i'm trying to start uses 58g of filament so… it doesn't make sense to be related to that.
  • I do not have a spool that currently has 276g left, so it can't be mistaking it for a different spool.

In loadSpoolsByQuery, the following data is returned:

      "remainingLength": "-256064",
      "remainingLengthPercentage": "",
      "remainingPercentage": "19.2",
      "remainingWeight": "191.8",

but then, in the allowedToPrint call, the following data is returned:

    "reminderSpoolSelection": [
      {
        "bedOffset": null,
        "enclosureOffset": null,
        "material": "PETG",
        "remainingWeight": 276.3485105427127,
        "spoolName": "Prusament Jet Black 3",
        "toolIndex": 0,
        "toolOffset": null
      }
    ]

If i try to edit the spool, the value displayed it 191.8, so i assume that's the correct one… or is it?

The key difference seems to be that loadSpoolsByQuery runs it through transformSpoolModelToDict, and allowedToPrint doesn't. allowedToPrint calculates the remaining weight based on the total and used values from the database, while allowedToPrint just reads the remaining value from the database. That might cause an inconsistency, but it makes me wonder… why is the remaining value not in sync with the value of total weight and used weight? Could there be something wrong with how the multi-tool code commits the usage data to the database?

I don't know what your database is supposed to hold and store precisely, so it's for you to find out @OllisGit :) Hope this helps.

PS: Wondering if this might be ralted to #175 but it probably isn't.

@codingcatgirl
Copy link
Contributor

Ok, i had toi look some more into it:

The culprit is here:
https://github.com/OllisGit/OctoPrint-SpoolManager/blob/master/octoprint_SpoolManager/__init__.py#L377

After the print, only used filament is updated, not remaining filament. And i'm to blame, since this code was introduced by my pull request.

Question: why are used filament and remaining filament stored as seperate values at all. Wouldn't it be a good idea to drop one of them from the database and always calculate it and if the user puts in a new value, just convert it into a new value for used filament instead?

@codingcatgirl
Copy link
Contributor

Okay, apparently i'm no to blame after all, because before my edits, the previous code also didn't update the remainingWeight field:

spoolModel.usedWeight = newUsedWeight
So something else must be going on?

It looks like you just mistakenly added code to read the remainingWeight value from the spool model isntead of calculating it:
3dbd15c#diff-4963735b757dd922fea5143ec41a3b92d3464e9d242cbc11f8f243f716bc303aR324

Which is an easy mistake to make, since it seems like an obvious thing to do, but that begs the question even more why that field exists if you are not supposed to read data from it?

@clarkiej
Copy link
Author

clarkiej commented May 28, 2021 via email

@clarkiej
Copy link
Author

clarkiej commented May 28, 2021

Update:

This is only happening with a new spool I added AFTER I performed the update:
image

image

With a spool in the system prior to the update, it displays correctly:

image
image

The only setup difference I can see is that one showing incorrectly has spool weight set to 0.0:
image

while the other has spool weight as blank:
image

I went back in and blanked out the spool weight and now on the next print the displayed info is working as previous:

image

Looks like the problem is that the spool weight defaults to a 0.0 value when you add a new spool causing the issue. If the spool weight is blank, all is good.

@clarkiej
Copy link
Author

Update.: If the spool weight is left blank, the spool weight does display when you go to start a print, BUT, the spool weight shown is the spool weight remaining after the previous print -n. It has not updated the total remaining after the previous print, but the filament remaining displayed in the spool catalogue is correct:

image

Filament remaining in spool catalogue showing correctly.

Start the next print and the filament remaining is the amount that was left at the START of the previous print, not the end:

image

@OllisGit OllisGit added status: inNextRelease Will be implemented/fixed in next release and removed status: waitingForFeedback Wating for Customers feedback labels Oct 24, 2021
OllisGit added a commit that referenced this issue Oct 24, 2021
- PR #204, #201 redesign of the Spool-Selection in the sidebar. Huge thanks to @TiziG @MarloSM
- E #125 New field "Serialnumber"
- E Spool selection from Edit-Dialog
- E #141 New Filter: Material, Vendor and Color
- E #44 Sidebar filament usage in grams instead of volume

- B #199, #198, #163, #156 some QR-Code optimisations
- B #197, #196, #188, #181, #178, #177, #172, #162, #142,  Some UI optimisations
- B #194 CSV import, behind reverse proxy
- B #175 Confirm dialog not shown
@OllisGit
Copy link
Owner

Hi @clarkiej ,
in latest release 1.5.0 I change the behaviour. The dialog should now present the correct values.

Please try and give me a feedback.
Olli

@OllisGit OllisGit added status: waitingForTestFeedback and removed status: inNextRelease Will be implemented/fixed in next release labels Oct 24, 2021
@clarkiej
Copy link
Author

clarkiej commented Oct 26, 2021 via email

@clarkiej
Copy link
Author

clarkiej commented Oct 29, 2021 via email

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

No branches or pull requests

3 participants