|
|
Visio Stencil
One of the main goals of Quantum Leaps is to provide a lightweight alternative to heavyweight and expensive design automation tools. Such tools typically come with a drawing package to create various diagrams. In fact, most of the tools, if they are used at all, end up as overpriced drawing packages. To this end, a good drawing program does as much for you as a fancy CASE tool.
Visio™ (now Microsoft Visio™) is an excellent such drawing program that should satisfy even the most sophisticated drawing needs. You can find literally thousands of Visio™ templates and stencils online. A few examples of good Visio™ resources are:
Pavel Hruby offers Visio Stencil and Template for UML 2.0 for various versions of Microsoft Visio™.
Allen Holub offers Visio™ stencils as well as UML Quick Reference in his goody bag.
Visio Cafe lists a lot of resources and links related to Visio™.
Microsoft Most Valuable Professional (MVP) program website has whole section devoted to Visio™.
|
According to the Quantum Leaps philosophy, the Visio™ stencil that we offer is minimal, simple, and practical. It is an improved version of the stencil used to generate all diagrams in the book Practical Statecharts in C/C++. You can download the stencil by clicking on the following link:
The stencil contains all the shapes necessary to create the most important UML diagrams: Static-model diagrams, State diagrams, and Sequence diagrams. A few shapes in this stencil (Class, Object, State, Inheritance tree) are hacked-up versions of standard Visio™ shapes. Some other shapes have their origin from Navision Software's UML website (now available from Pavel Hruby's page). |
|
Here is a short description of the shapes in the Quantum Leaps stencil:
|
Note By default, the note has one sticking out pointer that you can attach to any object. If you don't want to point to anything, just drag the pointer back to the center of the note. Also, you can use more than one pointer. Just drag as many pointers as you need from the center of the note. The "Quick UML Reference" below provides many examples of using this shape. |
|
Note (with ball) This note has a "ball" at the end of the pointer, which is useful to attach, for example, snippets of code. You can find an example of this in the "Quick UML Reference" below (top-middle class diagram). |
|
State This state shape is specifically designed for drawing hierarchical states. For example, the main compartment of the shape has no fill to avoid obscuring of the grid and allow easy manipulation of the shapes nested inside. Please note that you can extend the name compartment to the bottom of the shape by dragging all the way down the handle of the name-compartment division line. Some new users have difficulty adding text to the internal-transition compartment. Perhaps the best way to activate this compartment is to first click anywhere on the state to activate the whole shape, and then to click on one of the side lines of the internal transition compartment. As always in Visio, press F2 to start editing the text. |
|
Transition This transition shape aligns itself neatly horizontally or vertically with up to two rounded angles between begin and end. You can arrange the horizontal and vertical segments by dragging the handles. The transition has an opaque label that you can also position by dragging on the label-handle. |
|
Initial Transition The initial transition is just like the regular one, except the beginning point is a black ball. |
|
Final State The shape has four connection points (up, down, left, right) for incoming transitions. |
|
Junction The shape has four connection points (up, down, left, right) for incoming or outgoing transitions. |
|
Dynamic Choice The shape has four connection points (up, down, left, right) for incoming or outgoing transitions. |
|
Label (opaque) Text with white opaque rectangular background to label anything. The shape has two handles: the reference handle, and the text handle. The relative position of these handles can be changed by selecting the text (F2) and changing text justification (left, center, right). |
|
Label (transparent) Transparent text to label anything. The shape has two handles: the reference handle, and the text handle. The relative position of these handles can be changed by selecting the text (F2) and changing text justification (left, center, right). |
|
Class Class shape with name compartment and resizable attribute and method compartments. The size of compartments can be changed by dragging the handles on the compartment division lines. Dragging the lines all the way to the bottom of the shape changes the number of compartments (and you can create more than three compartments). |
|
Object Just like the Class shape, except that the name is underlined. |
|
Generalization Tree Allows to build generalization trees with up to 6 branches, which you drag out of the center of the shape. |
|
Association (inheritance, agregation, ...) This shape has a right-click popup menu to select inheritance, aggregation, composition, and navigability (bidirectional or unidirectional). The shape has also one opaque label that can be useful for denoting cardinality at one end. You can position the label arbitrarily (with the label-handle) relative to the shape. |
|
Angled Association Just like the Association shape, except the shape aligns itself always horizontally or vertically with up to two corners between the beginning and the end. |
|
Design Pattern Similar to the Note shape. You can drag out pointers from the center of the shape. Please see example in the "Quick UML Reference" below (bottom-right class diagram) |
|
Package |
|
Component |
|
Node |
Top of pageQuick UML Reference
|
The "Quick UML Reference" has been created with the Visio™ UML Stencil described above. You can download the reference, both in Visio™ and in PDF formats, by clicking on the links below:
Most of the diagrams in the "Quick UML Reference" come from Appendix B of the book Practical Statecharts in C/C++. The reference summarizes the most important, in our opinion, UML aspects for real-time embedded (RTE) systems. The Visio™ version, demonstrates, in addition the use of the Visio™ stencil described above in simple, but non-trivial diagrams. |
|
Top of pageHierarchical State Machine Exhaustive Example
The semantics of Hierarchical State Machines (UML statecharts) is rich and can raise many questions. The exhaustive QHsmTst example can answer all such questions in an interactive and fun way.
To use the tool, you launch the qhsmtst.exe Win32 executable (see the code download below) and inject events to the state machine by typing letters a..i on your keyboard (the Esc key terminates the application). You correlate the instrumented printouts from every event action, entry/exit actions, initial transitions, and regular transitions with the state diagram shown above.
Hierarchical State Machine Example in QEP/C (24kB)
|
Hierarchical State Machine Example in QEP/C++ (25kB)
|
Hierarchical State Machine Example in QEP-nano (22kB)
|
QHsmTst console application:![]() |
|
The QHsmTst state machine contains all possible transition topologies up to 4-level of state nesting. ![]() |
|
QHsmTst code in QEP/C: |
|
QHsmTst code in QEP/C++: |
|
QHsmTst code in QEP-nano: |
Top of pageQuantum Leaps C/C++ Coding Standard
If you write code without a documented coding standard, you shouldn't. Adopting a reasonable coding standard is perhaps the first and easiest step towards improving quality of code, increasing maturity level, or achiveing any code certification. The following coding guidelines are intended to improve code portability, readability, uniformity and maintainability for software. The primary objective of this Coding Standard is to boost software productivity and lower maintenance cost by promoting commonality and avoiding misinterpretations and guessing. This Standard is mostly concerned with C/C++ programming languages. However, many conventions and the spirit of the Standard can easily be extended to other programming or scripting languages like Java, Tcl/Tk, Perl, make scripts, shell scripts, and others.
You can download the Coding Standard, both in PDF and Microsoft Word™ formats, by clicking on the links below:
Quantum Leaps C/C++ Coding Standard in PDF (341kB)
|
Quantum Leaps C/C++ Coding Standard in Microsoft Word™ (zipped); (153kB)
|
The document is made here available under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with the copyright notice being preserved. The copy of the license is available from the Free Software Foundation at: www.gnu.org/copyleft/fdl.html.
Starting from QP 3.0, Quantum Leaps consistently applies this Coding Standard in all products.
Other Coding Standards geared toward embedded systems programming available online include:
Micrium C Coding Standard by Jean Labrosse. (Micrium has a framed webiste, which is difficult to bookmark. To get to the Coding Standard, follow the links Support->Application Notes->AN-2xxx-Standards->AN-2000 (C Coding Standard).
A Firmware Development Standard by Jack Ganssle
Top of pageLast updated: May 13, 2009


Visio™ Technical 5.X UML Stencil (91KB)
"Quick UML Reference" in PDF (138KB)

