1 Introduzione

Fig. 4. 5 4.1.2 The class “WxDragImage5”

Scaricare 459.5 Kb.
Dimensione del file459.5 Kb.
1   ...   7   8   9   10   11   12   13   14   15
Fig. 4. 5

4.1.2 The class “WxDragImage5” :
The class”WxDragImage5” implements the project window.

In the top of the project window there are the components of the circuit:

Pseudorandom generator: Rsencoder encoder:

Enpuncture encoder: Cencoder encoder:

Depuncture decoder: Rsdecoder decoder:

Vdecoder decoder: The channel:

The comparator:

Every encoder is paired with a decoder, the only one able to decode its signal:









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 generator must be followed by an encoder, channel or comparator

  • an encoder must be followed by an encoder, channel or decoder

  • a channel must be followed by an encoder, channel, decoder or comparator

  • 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)

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.

Once the circuit is correctly built, a notification box appears (Fig. 4.8)and text frames

to insert parametres and values will appear succesfully.(Fig.4.9)

Fig. 4. 8

Fig. 4. 9
The result of insection is buffered in the standard output of the program”Boa Constructor”at the end of the execution of the program.(Fig.4.10)

Fig. 4.10


Per scaricare Python e wxPython:


Per imparare a programmare in Python:

Guido Van Rossum, “Python tutorial, release 2.3.4”, Fred L. Drake Jr. Editor, May 20, 2004 .

Manuale introduttivo a Python”, www.python.it.

Condividi con i tuoi amici:
1   ...   7   8   9   10   11   12   13   14   15

©astratto.info 2019
invia messaggio

    Pagina principale