Bitmap2LCD is a tool for programming small Graphic LCDs in embedded systems and a programmable graphic and text processing tool.
Tag Archives: search and replace program
Text Processing Example : Modify a Hex value on every source code line
Bitmap2LCD is a tool for programming small Graphic LCDs in embedded systems and a programmable text processing tool.
Text Processing Batch Example
Target : Modifying a Hex value on every source code line
- Convert an image to code : The code array then is visible in the Text editor ( see below )
Example here see the two first hex values : 0x01 and 0x70
In the Text Processing Window, create a new batch and write this program, using the choice comboboxes and the editors located upwards the program lines :
if ‘0x’
then get hex (0) –> Hex value prefix is already 0x in the configuration settings
shift left (1)
then overwrite (index)’ ‘ –> 4 x space inside the string
then insert hex (index)
Remark : Everything between two “if conditions” is one block of functions for this “if condition” !
On every text editor line, checks if ‘0x’ is found and if condition is “true”, gets the first hex value (index 0) , shifts left the hex value of 1 bit to the left , overwrites source from the index where the ‘0x’ was found with four space chars, and finally inserts the shifted hex value at the index position…
Activate the new batch and run it over the text editor.
The source file in the Text Editor has been modified (red arrow)
You can read the processing report journal (blue arrow)
Bitmap2LCD : Running a Processing Batch
Bitmap2LCD is a tool for programming small Graphic LCDs in embedded systems and a programmable text processing tool.
Running Processing Batch
Article updated for V3.7c
There a many ways to run a Processing Batch :
- Loading a Batch Program file into the text editor, start the active text processing batch for a single run
- Manually running a batch after conversion of a GLCD image or after conversion of a GLCD font, data being present in the text editor.
- Chain an automatic post-processing after every image or font conversion.
- Running a Processing batch on multiple defined files in a defined folder
The active batch (blue arrow) will be started in case of “manual” starts
if the Silent checkbox is checked (green arrow fig 2) , the message on screen with the number of processing occurrences found at the end of the text processing will not be displayed. ( Not needed in case of multiple file text processing )
fig 2)
Bitmap2LCD : Activate a Processing Batch
Bitmap2LCD is a tool for programming small Graphic LCDs in embedded systems and a programmable text processing tool.
Activate a Processing Batch
1. List the existing batches (blue arrow)
2. Click the selected Processing batch in the list inside the File Explorer
3. The selected Batch Processing Program appears in the editor window
4. Activate the present Text Processing Batch (red arrow)
5. The activated batch filename appears in the menu (green arrow)
Another way to select a batch is to right-click in the batch list after having selected the wanted batch. In the pop-up menu, there’s an item to do that.