Upstreaming Python based UX functionality to FreeCAD
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Upstreaming Python based UX functionality to FreeCAD
I created some UX related modules/functionality for FreeCAD in the past. Occasionally i get asked if upstreaming the work done will be done at some point in the future. I am currently in transition phase where this pieces of functionality are ironed out, code simplification is being pursued and missing pieces of functionality are being added based on the user feedback gathered in the past. Once that process will be done i am guessing up to 10 standalone UX related pieces of functionalities will be the result. Things like NavigationIndicator, PieMenu, ShortCuts ...
Now as for the original question. This pieces of functionality (once finished from my point of view) can continue to have a place on my GitHub or they can in addition be upstreamed to FreeCAD. If upstreamed i see 2 possibilities.
1.) Upstream individual piece of functionality as an individual module:
Likely slightly easier to maintain as everything is basically included in a self contained module. Code duplication is possible and module count inflation would happen.
2.) Creating a single new UX related module with some name and put everything in there:
In FreeCAD terms this comes down to UX related module/workbench. But instead of listed in workbench selector it provides UX related commands/functionality. Likely slightly harder to maintain and to figure out (other developers) due to code de-duplication. As changing one function can affect multiple pieces of functionality.
This can serve as a reference piece of functionality. As only some further UI related work is needed to finish the work:
https://github.com/triplus/NavigationIndicator
Opinions?
Now as for the original question. This pieces of functionality (once finished from my point of view) can continue to have a place on my GitHub or they can in addition be upstreamed to FreeCAD. If upstreamed i see 2 possibilities.
1.) Upstream individual piece of functionality as an individual module:
Likely slightly easier to maintain as everything is basically included in a self contained module. Code duplication is possible and module count inflation would happen.
2.) Creating a single new UX related module with some name and put everything in there:
In FreeCAD terms this comes down to UX related module/workbench. But instead of listed in workbench selector it provides UX related commands/functionality. Likely slightly harder to maintain and to figure out (other developers) due to code de-duplication. As changing one function can affect multiple pieces of functionality.
This can serve as a reference piece of functionality. As only some further UI related work is needed to finish the work:
https://github.com/triplus/NavigationIndicator
Opinions?
Re: Upstreaming Python based UX functionality to FreeCAD
My instinct would be to go with this option - keep modules mapped to functionality.triplus wrote:Upstream individual piece of functionality as an individual module:
But this seems to be a software architecture question better answered by a more experienced dev than me.
Re: Upstreaming Python based UX functionality to FreeCAD
I did some further tests and i am now leaning towards the idea of creating a new single module with some arbitrary name. As for example having NavigationIndicator.py, PieMenu.py (PieMenuGui.py)... in it should work out OK. Mixing code functionality won't happen beyond some basic functions like getting workbench icon or unique commands and things like that. Where it makes sense to do it in that way instead of duplicating the code.
Therefore the main question is does anybody have any objections to upstream some UX work i have done in the past in such way in the future?
P.S. And any other suggestions and thoughts are welcomed.
Therefore the main question is does anybody have any objections to upstream some UX work i have done in the past in such way in the future?
P.S. And any other suggestions and thoughts are welcomed.
Re: Upstreaming Python based UX functionality to FreeCAD
Do you mean putting it in /src/Gui ?
Given the generic (applies to all workbenches) nature of your projects, that seems to make some sense to me. (Though as I said I'm no expert on software architecture)
Given the generic (applies to all workbenches) nature of your projects, that seems to make some sense to me. (Though as I said I'm no expert on software architecture)
- kkremitzki
- Veteran
- Posts: 2517
- Joined: Thu Mar 03, 2016 9:52 pm
- Location: Illinois
Re: Upstreaming Python based UX functionality to FreeCAD
I just made a PR on FreeCAD/FreeCAD-addons here to add NavigationIndicator "workbench" to the addon manager. Assuming that tool will be included in master soon, it's a good way to make it easy and optional for people to install. I tested it and it worked great!
Re: Upstreaming Python based UX functionality to FreeCAD
Thanks for testing.kkremitzki wrote:I just made a PR on FreeCAD/FreeCAD-addons here to add NavigationIndicator "workbench" to the addon manager. Assuming that tool will be included in master soon, it's a good way to make it easy and optional for people to install. I tested it and it worked great!
If navigation indicator module will be upstreamed i will likely make the one on my GitHub to support FreeCAD 0.16 only. Therefore it won't start in FreeCAD 0.17 if installed manually and the default one should start instead. Indeed it can always be installed from my GitHub but some users expressed the desire for such UX functionality to be provided by default in FreeCAD. And in the past the same question was asked for some other modules. All in all things happened and i said i will ask for more feedback and will think about the possible strategy and provide one for upstreming the work. That is what this thread is about.
The place is src/Mod/ and in it a list of FreeCAD modules can be located:agryson wrote:Do you mean putting it in /src/Gui ?
Given the generic (applies to all workbenches) nature of your projects, that seems to make some sense to me. (Though as I said I'm no expert on software architecture)
https://github.com/FreeCAD/FreeCAD/tree/master/src/Mod
If there won't be any objections i will add a new module in it and the module will contain some Python based UX related functionality for FreeCAD. Like for example mentioned navigation indicator. And that i guess should be it.
Re: Upstreaming Python based UX functionality to FreeCAD
OK, looking forward to pulling!triplus wrote:The place is src/Mod/ and in it a list of FreeCAD modules can be located
Re: Upstreaming Python based UX functionality to FreeCAD
My first thought was that many of these should be Preferences that each individual user could enable.triplus wrote:Things like NavigationIndicator, PieMenu, ShortCuts ...
IMO Navigation Indicator in particular should be in master (with default = On).
Re: Upstreaming Python based UX functionality to FreeCAD
+1bejant wrote:IMO Navigation Indicator in particular should be in master (with default = On).
Need help? Feel free to ask, but please read the guidelines first
Re: Upstreaming Python based UX functionality to FreeCAD
OK therefore when the work will be finished i will test the waters with the navigation indicator.
P.S. Providing choice to use something or not to use it makes sense. I will try to achieve and provide to user the ability to do that in a straightforward fashion!
P.S. Providing choice to use something or not to use it makes sense. I will try to achieve and provide to user the ability to do that in a straightforward fashion!