Hi sgrogan, you could try from my github account https://github.com/vejmarie/FreeCAD.git -> the branch is named cloud, it does contain an initial writer implementation I liked to push upstream. Roughly libCURL is needed into Base for Writer.cpp where the connection happens now. I created a new Writer class as mentionned by wmayer.
Interfacing FreeCAD with Object Storage solutions
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
- vejmarie
- Posts: 713
- Joined: Mon Jan 04, 2016 4:52 pm
- Location: Somewhere between France, USA and Taiwan
- Contact:
Re: Interfacing FreeCAD with Object Storage solutions
- vejmarie
- Posts: 713
- Joined: Mon Jan 04, 2016 4:52 pm
- Location: Somewhere between France, USA and Taiwan
- Contact:
Re: Interfacing FreeCAD with Object Storage solutions
I made it. Thanks a lot for the guidance ! Any hints for the reader side ? I wrote a writer which I published into the cloud branch of my freecad github account fork ( https://github.com/vejmarie/FreeCAD)wmayer wrote: ↑Wed Jun 05, 2019 4:54 pm If you want to have your custom writer class then simply inherit from Base::Writer or any of its subclasses and re-implement the method writeFiles(). It's up to you to define in the constructor to what kind of storage you want to save.
Then you need a new command class where you can invoke the writer class to save the document into.FYI:Code: Select all
App::Dcoument* doc = ... MyWriter writer(stream); writer.putNextEntry("Document.xml"); doc->Save(writer); // Special handling for Gui document. doc->signalSaveDocument(writer); writer.writeFiles();
For FreeCAD's autosave/recovery function we use the class RecoveryWriter that doesn't write into a zip file but into a directory that creates an extra file for each touched property.
https://github.com/FreeCAD/FreeCAD/blob ... r.cpp#L161
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Interfacing FreeCAD with Object Storage solutions
realthunder is attacking this territory as well!
https://forum.freecadweb.org/viewtopic.php?f=10&t=38353
https://forum.freecadweb.org/viewtopic.php?f=10&t=38353
- vejmarie
- Posts: 713
- Joined: Mon Jan 04, 2016 4:52 pm
- Location: Somewhere between France, USA and Taiwan
- Contact:
Re: Interfacing FreeCAD with Object Storage solutions
Thanks for the pointer !DeepSOIC wrote: ↑Mon Aug 05, 2019 11:26 pm realthunder is attacking this territory as well!
https://forum.freecadweb.org/viewtopic.php?f=10&t=38353
- vejmarie
- Posts: 713
- Joined: Mon Jan 04, 2016 4:52 pm
- Location: Somewhere between France, USA and Taiwan
- Contact:
Re: Interfacing FreeCAD with Object Storage solutions
Ok, good news, I got a writer / reader which works. I didn't really followed realthunder proposale, but more wmayer's one. The issue is that changing the reader/writeer really needs to be inside the core currently. My only current showstopper to push changes as PoC (other than cleaning up the code), is to be sure we can compile on Windows. @sgrogan what is your opinion ?
Re: Interfacing FreeCAD with Object Storage solutions
I haven't successfully built your branch. I tried quickly with some pre-compiled binaries on-line. I think I need to try to build libcurl with VS?
Time is tight, so progress is slow
"fight the good fight"
- vejmarie
- Posts: 713
- Joined: Mon Jan 04, 2016 4:52 pm
- Location: Somewhere between France, USA and Taiwan
- Contact:
Re: Interfacing FreeCAD with Object Storage solutions
Thanks for the update ! Time is tight also on my side. What was the error you met ? Was it with CMake libcurl detection or during build or link phase ? I am jsut curious to see if I could help. You need libCURL and libOpenSSL.
Re: Interfacing FreeCAD with Object Storage solutions
After having a quick look at your code I think it's better to move all the functionality to its own application module. Especially putting all the functions to the Document class directly makes little sense and only makes the class fatter.
Then the CMake configuration should add a parameter to make the support of saving to a cloud optional as recently a new libpack was built and people maybe don't want to change their setup again.
Then the CMake configuration should add a parameter to make the support of saving to a cloud optional as recently a new libpack was built and people maybe don't want to change their setup again.
- vejmarie
- Posts: 713
- Joined: Mon Jan 04, 2016 4:52 pm
- Location: Somewhere between France, USA and Taiwan
- Contact:
Re: Interfacing FreeCAD with Object Storage solutions
No problem. I will try to do it. I have updated my branch with the Reader. It works with min.io servers.
I never wrote a FreeCAD workbench, time to learn something new. I still might have to change the Document class as I do not see how to implement some part of the code while being out of the class especially the GUI reader, but I will see.
At least it works currently as a very basic first implementation. The thing is that I have nothing to really display into such module, and believed that cloud storage might have been in some way some unique feature which could be extremely useful for end user data sharing and versioning management.
My worries are more related on the fact that we might be ending up having too much modules. If we manage versioning, cloud storage and additional storage stuff within modules, end user might have to install a lot of add-on to get these new features which are I/O related.
I also understand realthunder argument and the need to keep our dependancy as low as we can, but I am not fully convinced (yet) by the need to split all of these addon within workbenches instead of standard features.
I never wrote a FreeCAD workbench, time to learn something new. I still might have to change the Document class as I do not see how to implement some part of the code while being out of the class especially the GUI reader, but I will see.
At least it works currently as a very basic first implementation. The thing is that I have nothing to really display into such module, and believed that cloud storage might have been in some way some unique feature which could be extremely useful for end user data sharing and versioning management.
My worries are more related on the fact that we might be ending up having too much modules. If we manage versioning, cloud storage and additional storage stuff within modules, end user might have to install a lot of add-on to get these new features which are I/O related.
I also understand realthunder argument and the need to keep our dependancy as low as we can, but I am not fully convinced (yet) by the need to split all of these addon within workbenches instead of standard features.
Re: Interfacing FreeCAD with Object Storage solutions
We have a Python script fcbt.py that simplifies this task a lot. It basically copies the files from the _TEMPLATE_ directory with the specified name.I never wrote a FreeCAD workbench, time to learn something new.
Hmm, from the quick look I couldn't see where the Document really needs to be touched but maybe I overlooked something.I still might have to change the Document class as I do not see how to implement some part of the code while being out of the class especially the GUI reader, but I will see.
Actually I want to avoid to clutter up classes with functions that better should go into a separate class. The suggestion to move this to an external is because it's easier to make libcurl and openssl optional. Btw, I wonder if the boost library offers something in this regard.My worries are more related on the fact that we might be ending up having too much modules.
Avoiding too many dependencies e.g. makes life much easier of packaging for the various Linux distributions. When we just take Ubuntu then we permanently have to support three or four versions at the same time.I also understand realthunder argument and the need to keep our dependancy as low as we can
And there must be a good reason when adding the dependency to a further library.