Tag Archives: search and replace program

Search And Replace

Bitmap2LCD is a tool for programming small Graphic LCDs in embedded systems and a programmable graphic and text processing tool.

Search And Replace Text searchandrepl

Bitmap2lcd includes a Search and Replace functionality.

In the Graphic Preview and Editors Window , click on S+R (orange arrow) and a programming grid appears next to the Auxiliary Editor.

  • In the S+R grid, you can define the character string to search (blue) inside the text editor, and define the character string that will replace it (red)
  • The columns Function and Condition2 are not yet implemented (V3.7f)

bitmap2lcd-search-and-replace_1

  • You can immediately apply the search and replace scan to the content of the Main Editor (purple arrow) or to the content of the Aux Editor

bitmap2lcd-search-and-replace_2

  • The Search And Replace Program can automatically be run after all exports by checking the Run Search And Replace Grid checkbox of the data export dialog (green).

bitmap2lcd-search-and-replace_3

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

Bitmap2LCD Batch Text Processing 1

 

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 :

Bitmap2LCD Batch Text Processing 2

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.

Bitmap2LCD Batch Text Processing 3

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 run runx

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 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 runx

The active batch (blue arrow) will be started in case of “manual” starts

bitmap2lcd-batch-processing-menu_2

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 )

Bitmap2CLD Running Text Processing 2

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.

bitmap2lcd-batch-processing-activate