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

Adding new storage_device plugin #18

Closed
ad1217 opened this issue Jun 1, 2015 · 2 comments
Closed

Adding new storage_device plugin #18

ad1217 opened this issue Jun 1, 2015 · 2 comments
Assignees

Comments

@ad1217
Copy link
Contributor

ad1217 commented Jun 1, 2015

I was trying to write a write a device that implemented StorageDevice (for uploading to Octoprint), but it seems that everything is hard-coded to use LocalFileStorage. Is this temporary? Or should I be doing this some other way?

@nallath
Copy link
Member

nallath commented Jun 3, 2015

Storage device is indeed the way to go for uploading to OctoPrint (or atleast, you understood correctly with regards that is was intended to be used like that ;)). Due to time constraints on our end, we did a bit of a nasty by hardcoding it.
We definitely should be handling this better.

@awhiemstra
Copy link
Contributor

The entire storage device API is rather broken at the moment unfortunately. Originally, the idea behind it was that you can implement different types of devices that can then handle the specifics of file uploads etc. However, during development it turned out that the way this is currently implemented is pretty broken. For starters, it should be the storage device that decides what file formats to support, whereas this is currently reversed. Additionally, there should be plugins that provide a list of files that can be loaded as well as plugins that can write files somewhere.

To have something that at least mostly works for Cura, I implemented the output_device related functions in CuraApplication.py . These are currently used by the Save button to determine where to save the file. It has a reasonably limited API that eventually I would like to extend so it can be the generic API for output plugins. This is probably what you want to use for the OctoPrint plugin as well, this is also what the USB printing plugin uses at the moment.

Of course, it would be even better to revamp the entire storage_device API, but that takes quite a bit of time and effort. I have some plans for this, but I will not have time to do it soon I'm afraid.

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