6
fdssfdfdfffdgfggfggg USER INTERFACE SOFTWARE IN VISUAL BASIC v 6.1. This is the software at the PC side of the project. Its main task is to provide a graphic user interface, enabling interaction with the user, receive the text the user enters in a text box (with the necessary font adjustments), convert the text to bitmap format of device matched resolution, perform all the necessary binary to decimal and numeric to ASCII conversion of the bitmapped text initialize the serial communications port of the host computer and send the bitmapped and properly converted display data along with other variables such as scroll speed value through the port. TECHNICAL BACKGROUND TEXT TO PIXEL CONVERSION FUNCTION This specialized subroutine is responsible for converting the windows based ‘true type’ font graphic figures to a custom resolution bitmap matrix. The subroutine scans the text box (a container control) at a predefined interval downwards each row. The scan function detects a black pixel color to register it in a bitmap holding double array as ‘ON’, else it would be registered ‘OFF’. In this way all elements of the text box matrix are scanned (in a way – bitmapped). The resolution of the scan is readily adjustable but is hardware dependent, as the bitmapped fonts are directly transferred to the display hardware and mapped to the LED board of the same matrix size. BINARY TO DECIMAL CONVERTER . As discussed earlier the hardware I/O ports are so mapped that each column in the display matrix is considered one port. Hence the data characters from the interface should come as data for a port. Also the interface port transfers files through the serial port in forms for characters (numeric). This necessitates the use of a binary to decimal converter routine in order to convert the data of each column to decimal. The matrix type arrangement helps in this - 1 -

Part iii software.doc

Embed Size (px)

Citation preview

Page 1: Part iii   software.doc

fdssfdfdfffdgfggfggg

USER INTERFACE SOFTWARE IN VISUAL BASIC v 6.1.

This is the software at the PC side of the project. Its main task is to provide a graphic user interface, enabling interaction with the user, receive the text the user enters in a text box (with the necessary font adjustments), convert the text to bitmap format of device matched resolution, perform all the necessary binary to decimal and numeric to ASCII conversion of the bitmapped text initialize the serial communications port of the host computer and send the bitmapped and properly converted display data along with other variables such as scroll speed value through the port. TECHNICAL BACKGROUND

TEXT TO PIXEL CONVERSION FUNCTION This specialized subroutine is responsible for converting the windows based ‘true type’ font graphic figures to a custom resolution bitmap matrix. The subroutine scans the text box (a container control) at a predefined interval downwards each row. The scan function detects a black pixel color to register it in a bitmap holding double array as ‘ON’, else it would be registered ‘OFF’. In this way all elements of the text box matrix are scanned (in a way – bitmapped). The resolution of the scan is readily adjustable but is hardware dependent, as the bitmapped fonts are directly transferred to the display hardware and mapped to the LED board of the same matrix size.BINARY TO DECIMAL CONVERTER.As discussed earlier the hardware I/O ports are so mapped that each column in the display matrix is considered one port. Hence the data characters from the interface should come as data for a port. Also the interface port transfers files through the serial port in forms for characters (numeric). This necessitates the use of a binary to decimal converter routine in order to convert the data of each column to decimal. The matrix type arrangement helps in this part since the bitmap conversion of each column puts it readily in binary format.NUMERIC TO ASCII CONVERSION The popular IBM compatible PC communicates to the outside world in the language of ASCII. These are a set of predefined numeric values for the common alphanumeric and editing characters (both upper and lower cases). The extended ASCII set supports 256 characters by 8 bit binary values. Thus in order to transfer any numeric value through the port it first has to be converted to the corresponding ASCII character. Visual Basic has a ready made function to produce theses characters from a given integer value given it lies between 0 & 255 (inclusive). The syntax is: -

[ASCII character] = chr( [integer value] )

SERIAL PORT ACCESS & CHARACTER TRANSFER. For such a purpose, just like any of the others, VB supports a serial communication control named ‘MSComm’ (Microsoft communication control). This control is easily dragged and added to the active form previous to using it. It represents directly the serial port and so by setting or monitoring its properties one can do the same to the actual port.

- 1 -

Page 2: Part iii   software.doc

fdssfdfdfffdgfggfggg

FLOWCHARTS OF KEY SUBROUTINES

TEXT TO BITMAP CONVERSION

- 2 -

Point to column 1

Point to row 1

Is pixel color

=black?

Set element flag = 1

Set preview simulator element ON

Move to next row

End of rows?

Move to next column

End of columns?

END

START

YES

YES

YES

NO

NO

NO

Page 3: Part iii   software.doc

fdssfdfdfffdgfggfggg

BINARY COLUMN DATA TO DECIMAL CONVERSION

- 3 -

START

Point to column 1

Set column value = 0

End of columns?

Point to column 1

Point to row 1

Is element flag ON?

add 2^[row #] to column value

Move to next row

End of rows?

Move to next column

End of columns?

END

YES

NO

NO

NO

NO

YES

YES

YES

Page 4: Part iii   software.doc

fdssfdfdfffdgfggfggg

THE USER INTERFACE The diagram below shows what the user interface looks like on the host computer screen. The various buttons and input / output objects on the graphic user interface are explained with sufficient depth in the user manual of the device. Even though most of the features shown on the diagram are not visible on the GUI of the final software, for the purpose of more illustrative approach they are included here. For instance the port access and monitor buttons and the bitmap binary to decimal conversion button are not required since the functions they initiate are a necessity by default and should be taken care of automatically. Note that once the control is passed through operating variables to the computer via the interface, the whole control becomes easily upgradeable. Hence apart from the features found sufficient for the completion of this project many additional features including image mapping and other types of animations like blink (only scroll was implemented for the project) could be added.

- 4 -

Page 5: Part iii   software.doc

fdssfdfdfffdgfggfggg

- 5 -