If you followed my previous blog post you will know that merging ISO Designer project files is something desirable when multiple developers are working on an ISOBUS project, but is tricky to do in practice. Please refer to Part 1 if you’d like more information about the reasons why. Since Part 1 was published, I have developed a python script that can be used to merge the largest and most complicated of ISO Designer files – the .JOP file.
ISO Designer stores project information about objects in a file called <your-project-name>.jop. The JOP file in the project I am currently working on is over 100k lines long, so merging it manually is not very practical! It’s also recorded in an XML file format so your standard merge or compare tool doesn’t usually do a very good job detecting the correct differences between an old and new file.
I wrote a script called ISODesigner_Merge.py to help facilitate merging JOP files from two different developers or two different revisions of work. How the script works is it reads in all the object information from two different versions of the file and prompts the user as to which version of each change they would like to keep. It’s basically the same decisions you would normally make if you were using a merge tool, but the script is smart enough to know how to read and compare objects; whereas, your standard merge tool is not. If there are a lot of changes it can still be a lot of prompting, but its still much quicker and easier than trying to do it manually in a code editor.
To use the script, you need Python v3.10+ installed. My script was tested with version 3.11.4 of Python and 5.6.2.5533 of ISO Designer. All you have to do is download it and open a command shell to run the script. Call the script with two mandatory arguments – two different JOP file paths.
Once you do that, the script will begin prompting you about changes in the script. As you can see above, there is a NumberVariable that only exists in the second file. You can enter K for keep or D for discard.
Here is an example of the script prompting about how to handle an object that exists in both files but has some value changes:
Keep working through the prompts until the script is finished. Whichever file is listed as the first argument (File 1) will be used as the default for each conflict, so if you don’t want to type “1” every time. You can simply hit Enter over and over, as needed.
Once the files are finished merging, you will have an output TXT file named <file1>_MERGED.TXT. You should be able to simply rename that to <yourname>.jop and put it back in your project and re-open ISO Designer.
You may still need to manually merge some other smaller ISO Designer files if you are version controlling them. However; fortunately most, if not all of the other files other than the JVW project file, don’t generally need to be version controlled or the changes are very minor.
I hope this is helpful to anyone who is looking to collaborate on ISO Designer files without too much pain. The script is listed on our public gitlab page. Feel free to leave any suggestions or report any issues you encounter and we will also continue to publish updates to anything we find and fix or improve down the line.
Hi,
The link to the script seems to link to a project in GitLab that does not exist.
Thanks for reading our blog, Peter, and for pointing out this error. This should now be corrected. Enjoy.