Updating Data

Once you have initially added the data sources into the project, the Imagix 4D database may become unsynchronized with your software, due to changes you make in your source code. Symptoms of this include symbols no longer being colored in the Imagix 4D File Editor, due to changes in line numbers. In resynchronizing the project database to your source code, you have options about whether to force the analysis of your source code or have the update first check whether any source files have changed. In addition, there are both manual and automatic alternatives for keeping the information in the project current with the actual state of your changing software.

You may choose to combine these approaches. For example, you can manually invoke the Update Project Data function during the day when you're unsure whether someone has changed a source file, and then automatically run the forced data collection commands as part of a nightly cron job to insure that the database information is current.

Conditional vs. Forced Update

Conditional data collection, where data is recollected only if the data source has changed, is available through the Project > Update Project Data menu item.

The checking for this is based on the source files that are currently recorded in the database of the project. The timestamp for each of those source files is compared to the project's timestamp for when the source code was last analyzed. If any of the source files has a newer modification date, or if any of those source files is not found in the location recorded in the project database, then the source code for the full project is re-analyzed.

There are some situations where a software change might not be detected by this check. If you've added any source files to your software, if you're importing as a Visual Studio data source and have changed your Visual Studio project or solution definition, or if you've modified a system header file that is included by your source files but which you're not storing in the project, the check will not detect the software as having changed. For these cases, the Project > Regenerate Project Data menu item, which forces re-analysis of the source code, ensures that your software is fully re-analyzed.

The tradeoff for this certainty is that Update Project Data can avoid potentially unnecessary re-analysis, and thus prevent an unnecessary interruption in your workflow, but may miss changes in your code. If you do run Update Project Data, and its check indicates that no source code has changed but finds that the files loaded as Profile Data or Other data sources are out of date, your project data will be reloaded without re-analyzing the source code.

Manual vs. Automated Update

The manual approach for updating Imagix 4D project data is through the Project menu items, (Project > Update Project Data) and (Project > Regenerate Project Data). Alternatively, you can automatically recollect the data sources as part of your recompilation or nightly build processes. This enables the recollection to occur off-line, while no one is waiting.

The easiest technique for automated data collection is to use the -cmmd option for invoking Imagix 4D itself. This causes Imagix 4D to operate via command line in batch mode, where Imagix 4D starts up, runs whatever series of commands you have specified, and then exits. You can specify a set of commands that cause Imagix 4D to open a (series of) project and regenerate all the project data each project. This will cause the project data to resynchronize with your software.

Under this approach, you'd add a command along the lines of `imagix -cmmd cmmdfile' to your cron job or nightly build script. Refer to Appendix B. Batch Mode Commands for more information on batch mode, and the format of the cmmdfile.

If you happen to be using the Add Targets to Makefile alternative for loading in your code, and for some reason you want to avoid the batch command approach, there is an alternative. In the make targets that have been added to your makefile, there will be a target of the form `imagix'. This will cause the full re-analysis of your code. Under this approach, you'd add a command something like `make -f makefile imagix' to your cron job or nightly build script.