Skip to content

Instantly share code, notes, and snippets.

@triffid
Created May 24, 2012 10:26
Show Gist options
  • Save triffid/2780735 to your computer and use it in GitHub Desktop.
Save triffid/2780735 to your computer and use it in GitHub Desktop.
netrap object model
Object Model for a netrap server, exposed via AJAX
server-server protocol may substitute a server object for TOP so tree-walk can be performed.
listPrintersWithCapabilities() is the major function to be implemented, this should also cause a broadcast amongst any server-server networks where all other functions are server-local
TOP
+- Printers[]
| +- Printer
| +- capabilities
| | +- PLA/ABS
| | +- color
| | +- size
| | +- fine or fast
| | +- other arbitrary name/value pairs
| +- listCapabilities() => string_pair capability_pair_list[]
| +- getCapability(string capability_name) => string capability_value
| +- setCapability(string capability_name, string new_value)
| |
| +- properties
| | +- temperature
| | | +- nozzle
| | | +- bed
| | +- position
| | | +- X
| | | +- Y
| | | +- Z
| | | +- E
| | +- fan speed
| +- listProperties() => string property_name[]
| +- getProperty(string property_name) => string property_value
| +- setProperty(string property_name, string property_value)
|
+- listPrinters() => string printer_names[]
|
+- getCurrentPrinter() => string printer_name
+- setCurrentPrinter(string printer_name)
|
+- listPrinterCapabilities() => string capability_names[]
+- listPrintersWithCapabilities(string_pair capability_pair_list[])
@canadaduane
Copy link

  • Where do printer names come from? Are they GUIDs?
  • What is the scope of "current printer"? Does each "socket" that communicates with NetRap get a "current printer" context?
  • Capabilities as imagined may not have considered the following cases:
    • Multiple individual colors, and possibly "all colors" i.e. full-color 3D printers
    • Querying for a printer that has "at least this volume" (i.e the most common case. Perhaps just create listPrintersWithVolume(w,h,d)?)
  • Perhaps rename "size" capability to maxPrintVolume
  • What does it mean to setCapability on a printer? What is the duration of this setting? i.e. does a printer "learn" about itself in this manner, or is its self-knowledge going to overwrite a capability once set, on reboot for example?
  • Can we have a "percent complete" property for when gcode files are sent?
  • How do we know if the printer is in an error state? e.g. if the bed is not level, or it's out of plastic, or some other error (overheat?)

@triffid
Copy link
Author

triffid commented May 29, 2012 via email

@canadaduane
Copy link

canadaduane commented May 29, 2012 via email

@triffid
Copy link
Author

triffid commented May 29, 2012 via email

@canadaduane
Copy link

canadaduane commented May 29, 2012 via email

@triffid
Copy link
Author

triffid commented May 29, 2012 via email

@canadaduane
Copy link

canadaduane commented May 29, 2012 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment