properly changing internal modules such Arch
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
properly changing internal modules such Arch
Hello,
(do not know if I am right, though.)
I am interested in analysing maybe modifying some modules. Already managed it to import some external modules by copying the files to ~/.FreeCAD/Mod/.
Now I am interest lets say the Arch module. How should I handle this properly?
Should I move the folder /git/freecad/src/Mod/Arch/ to ~/.FreeCAD/Mod/ and restart after modifying the sources
- or should I modify the /git/freecad/src/Mod/Arch/ directly and then recompile and restart freecad? Do I need to change something in the make settings for it?
Tia
(do not know if I am right, though.)
I am interested in analysing maybe modifying some modules. Already managed it to import some external modules by copying the files to ~/.FreeCAD/Mod/.
Now I am interest lets say the Arch module. How should I handle this properly?
Should I move the folder /git/freecad/src/Mod/Arch/ to ~/.FreeCAD/Mod/ and restart after modifying the sources
- or should I modify the /git/freecad/src/Mod/Arch/ directly and then recompile and restart freecad? Do I need to change something in the make settings for it?
Tia
Re: properly changing internal modules such as Arch
Hi,
after some trying I got something solved:
I moved the Arch folder
mv src/Mod/Arch/ /home/user/.FreeCAD/Mod/
and then after each change restarted Freecad. Would be fine if Freecad reread the sources, though.
Would it be better to test the code firstly as macros?
after some trying I got something solved:
I moved the Arch folder
mv src/Mod/Arch/ /home/user/.FreeCAD/Mod/
and then after each change restarted Freecad. Would be fine if Freecad reread the sources, though.
Would it be better to test the code firstly as macros?
Re: properly changing internal modules such Arch
Note that you don't need to move the folder, you can simply copy it. If there is a folder with the same name in .FreeCAD/Mod and /installed/path/to/FreeCAD/Mod, the first one is used and overrides the installed one.
If you plan to just play, you can do like you say (you can always compare your changes with the original one with tools liek diff), but if you plan to make more permanent changes, then you should consider using a tool like git, which helps you much to keep track of the changes you do...
If you plan to just play, you can do like you say (you can always compare your changes with the original one with tools liek diff), but if you plan to make more permanent changes, then you should consider using a tool like git, which helps you much to keep track of the changes you do...
Re: properly changing internal modules such Arch
thanks.
What would be the way to reload the code for testing let us say changes with the survey command. I did it that way,
.
proper?
What would be the way to reload the code for testing let us say changes with the survey command. I did it that way,
.
Code: Select all
>>> import sys
>>> sys.path.append('~/.FreeCAD/Mod/Arch')
>>> reload(ArchCommands)
>>> Arch.survey()
Re: properly changing internal modules such Arch
Where should I preferably put this git directory?yorik wrote:Note that you don't need to move the folder, you can simply copy it. If there is a folder with the same name in .FreeCAD/Mod and /installed/path/to/FreeCAD/Mod, the first one is used and overrides the installed one.
If you plan to just play, you can do like you say (you can always compare your changes with the original one with tools liek diff), but if you plan to make more permanent changes, then you should consider using a tool like git, which helps you much to keep track of the changes you do...
at .FreeCAD/Mod/
at .FreeCAD/
at .FreeCAD/Mod/Arch/
at the source tree?
at a ../Dir/Arch sym-linked to .FreeCAD/Mod/
tia
Re: properly changing internal modules such Arch
It depends. If you are mainly planning things for yourself, start the git repo anywhere you like. If you are planning to do changes that you will propose for inclusion in FreeCAD (remember that there is no guarantee that you changes get accepted out of the box, okay?) then it's better to use the freecad source folder itself, so your changes are easy to merge later. You can then create a new branch, do all your work there, and keep the master branch intact so you can sync with the official freecad repo, then push your branch on a public repo like github.
Re: properly changing internal modules such Arch
you mean a personal separate github repo? Just for interest: How gets it then "accepted" and into the official tree?yorik wrote: so you can sync with the official freecad repo, then push your branch on a public repo like github.
Re: properly changing internal modules such Arch
Basically you put your work in a separate branch (so it can be compared with the master code), you upload that branch somewhere (github or any other), and, when you are ready, you post the link to that branch here in the "pull requests" section of the forum. Someone (Jürgen, Werner or me) will review it. If you do something small, that is easy to review, and that clearly benefits freecad, for example you fix a bug, it will be easy for us to review and we'll probably be able to merge it quickly.
If you do something bigger, and especially if you are going to modify some existing functionality, causing current users to need to change their behaviour, then it is safer to discuss your work before submitting a feature request, and let other people test your code. If people like what you have done, then there will be no problems merging it.
If you do something bigger, and especially if you are going to modify some existing functionality, causing current users to need to change their behaviour, then it is safer to discuss your work before submitting a feature request, and let other people test your code. If people like what you have done, then there will be no problems merging it.
Re: properly changing internal modules such Arch
How the testing is organized? Should I send a testing request of let us say a certain module to a forum? Together with installing or/and compiling instructions?yorik wrote: and let other people test your code. If people like what you have done, then there will be no problems merging it.
Re: properly changing internal modules such Arch
Just open a new thread in the "open discussion" section, and explain what your changes do, give the link to your branch, and tell people you want feedback!