The Weighing Machine Project has been developed as a case study in the use of UML
and Enterprise Architect for real-time embedded software development in C and C++. It is used actively
on CRaG Systems courses and workshops for embedded software development and is offered free of charge
to all under the GNU Lesser General Public Licence V3
including all the UML models, model files, source code and supporting documentation.
The software runs on a standard Arduino Uno R3 with a prototyping shield and some simple custom hardware attached. It uses the Arduino libraries which sit on top of the libraries that come with the AVR-GCC compiler that is part of the standard Arduino software. However, instead of using the Arduino environment for development, the code is generated directly from the UML model in Enterprise Architect using the tool's own IDE configured to use the AVR-GCC compiler and utilities.
The UML model in Enterprise Architect includes use cases, an analysis level class diagram, sequence diagrams and state machine diagrams. The design section includes a layered architecture model with package diagrams, class diagrams, sequence diagrams, state machine diagrams, component and deployment diagrams, the weighing machine application classes and all the supporting Arduino, AVR and GCC libraries. Access to all the code is provided directly from the classes in the model.
If you would like to download the Enterprise Architect file, the Arduino environment including all the open source compilers and tools and the project code and all supporting documentation, then please use the following links. You will need to install the Arduino Software first, preferably in root, and then install the 'ea_projects' directory from the WeighingMachine.zip file inside the top-level directory 'arduino-1.6.5-r5' (or similar). Once you have done this the build, clean and deploy scripts in the Enterprise Architect models should all work without modification. If not, then try adjusting the local pathing in Enterprise Architect to suit. Once you are happy that the code builds, you can try changing the model and regenerating the code. You can also change the code and re-synchronise the model with the code including comments. You might want to adjust the code generation options, and even the code generation templates, to get it generating and synchronising exactly the way you would like.
If you use Subversion for your change management, then you might like to download the project from the project repository instead of the above project file. This will give you the very latest state of the trunk rather than the earlier version in the Weighing Machine Project file. If you do not already have a Subversion client then we recommend TortoiseSVN. It is proposed that later versions of the project will support Subversion directly from within the Enterprise Architect tool. The setup for this, however, is more complex and may only be suitable for advanced users of EA. Access the project repository here installing it in a new directory called 'ea_projects' inside the top-level 'arduino-1.6.5-r5' (or similar) directory. Read the readme.txt file first for full instructions:
If you do not have it already, download the 30-Day evaluation version of Enterprise Architect and install it in the default installation directory. Then you will be able to open the EA project files from within the ea_project directories and explore them:
PLEASE NOTE: You do not need an Arduino or the custom project hardware to explore the project, generate, reverse engineer or compile the project code. However, if you would like to see the Weighing Machine working, then most, but not currently all, of the information you need to build the custom hardware is available from within the project model files. Enjoy!