To help pairing components, the encoder and the paired decoder are of the same colour.
When the user wants to build a new circuit, the first thing to do is dragging the Generator into the grid under the components. To drag a component the user must double click the component without releasing the mouse button. To release the component the user must release the mouse button.
For a correct cosntruction of the circuit there are some constrains to respect:
the pipeline is started by a generator, there cannot be other generators
a decoder must be followed by an encoder, channel, decoder or comparator
the pipeline is ended by a comparator, there cannot be other comparators
When a constraint is violated, a dialog box appears that shows the error
type; the component will be repositioned in the default position.(Fig.4.6)
Fig. 4.6 During the construction of the circuit, a decoder can’t be inserted if its paired encoder hasn’t been inserted before and an encoder can’t be inserted if its paired decoder hasn’t been inserted before. In case of this type of error a dialog box will appear (at the end of the circuit construction).(Fig.4.7)
When the user insert a new components he doesn’t need to put the component in the same line and in the same height of the previous one ; in fact the class “WxDragImage5” automatically place the components side by side.