Spool weight now counts upwards instead

The used filament weight is now kept track of instead of remaining weight. This adds robustness to measurement errors which could accumulate and then the filament usage wouldn't get tracked anymore once the weight hit 0. Now it will just keep going.
This commit is contained in:
Donkie
2023-04-06 20:06:03 +02:00
parent 1a148c0991
commit 8a5d2e220b
4 changed files with 83 additions and 31 deletions

View File

@@ -50,7 +50,7 @@ class Spool(Base):
last_used: Mapped[Optional[datetime]] = mapped_column()
filament_id: Mapped[int] = mapped_column(ForeignKey("filament.id"))
filament: Mapped["Filament"] = relationship(back_populates="spools")
weight: Mapped[float] = mapped_column()
used_weight: Mapped[float] = mapped_column()
location: Mapped[Optional[str]] = mapped_column(String(64))
lot_nr: Mapped[Optional[str]] = mapped_column(String(64))
comment: Mapped[Optional[str]] = mapped_column(String(1024))