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

Add in MachineState to the Control trait, HTTP Endpoint #118

Merged
merged 7 commits into from
Oct 4, 2024

Conversation

paultag
Copy link
Collaborator

@paultag paultag commented Oct 3, 2024

This is a first step as we start to chip away on #68 slash #49 and others.

This will add a standard part of our "Control" trait to check on the state of a printer -- is the printer running? idle? paused mid-print? Broken?

I implemented this for Moonraker (since I was able to test it), and stubbed in Unknown elsewhere. USB is doable here -- and I think we can do Bambu, but that may wait until I get into the office to play with it myself.

this is so i can figure out if we're mid-print to add more surface to
the printers before job queues
@paultag
Copy link
Collaborator Author

paultag commented Oct 3, 2024

example output:

[
  {
    "id": "neptune",
    "make_model": {
      "manufacturer": "Elegoo",
      "model": "Neptune 4",
      "serial": null
    },
    "machine_type": "FusedDeposition",
    "max_part_volume": {
      "width": 250.0,
      "depth": 250.0,
      "height": 250.0
    },
    "state": "Idle",
    "extra": {
      "Moonraker": {}
    }
  },
  {
    "id": "nada",
    "make_model": {
      "manufacturer": "Zoo Corporation",
      "model": "Null Machine",
      "serial": "Cheerios"
    },
    "machine_type": "FusedDeposition",
    "max_part_volume": {
      "width": 500.0,
      "depth": 600.0,
      "height": 700.0
    },
    "state": "Unknown",
    "extra": null
  }
]

@paultag paultag requested a review from iterion October 3, 2024 20:17
Copy link

codecov bot commented Oct 3, 2024

Codecov Report

Attention: Patch coverage is 0% with 48 lines in your changes missing coverage. Please review.

Project coverage is 23.89%. Comparing base (67f6825) to head (db54080).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
moonraker/src/status.rs 0.00% 20 Missing ⚠️
src/moonraker/control.rs 0.00% 11 Missing ⚠️
src/any_machine.rs 0.00% 3 Missing ⚠️
src/bambu/control.rs 0.00% 3 Missing ⚠️
src/noop.rs 0.00% 3 Missing ⚠️
src/sync.rs 0.00% 3 Missing ⚠️
src/usb/control.rs 0.00% 3 Missing ⚠️
src/server/endpoints.rs 0.00% 1 Missing ⚠️
src/traits.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #118      +/-   ##
==========================================
- Coverage   24.35%   23.89%   -0.47%     
==========================================
  Files          46       47       +1     
  Lines        2459     2507      +48     
==========================================
  Hits          599      599              
- Misses       1860     1908      +48     
Flag Coverage Δ
unittests 23.89% <0.00%> (-0.47%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jessfraz
Copy link
Contributor

jessfraz commented Oct 3, 2024

yeah i would be really nice to have the status of the printer in the modeling app

@jessfraz
Copy link
Contributor

jessfraz commented Oct 3, 2024

also i just made a mental note to myself for the hackathon im gunna have to move the printers to the guest network or allow them on the guest network as well as machine api

@jessfraz
Copy link
Contributor

jessfraz commented Oct 3, 2024

will figure out something because i do like the guest network being isolated from the rest of the office

@paultag
Copy link
Collaborator Author

paultag commented Oct 3, 2024

also i just made a mental note to myself for the hackathon im gunna have to move the printers to the guest network or allow them on the guest network as well as machine api

Oh good call

I totally blanked and forgot we were contorting ourselves to drop
"Print" or "Printer" from this. Changed to "Machine".
@paultag paultag changed the title Add in PrinterState to the Control trait, HTTP Endpoint Add in MachineState to the Control trait, HTTP Endpoint Oct 4, 2024
@paultag
Copy link
Collaborator Author

paultag commented Oct 4, 2024

Going to land, happy to do any followups if this PR needs iteration @iterion

@paultag paultag merged commit 65ffc9a into main Oct 4, 2024
6 of 7 checks passed
@paultag paultag deleted the paultag/moonraker-status branch October 4, 2024 01:36
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