GTT38 text insertion doesn't clear
Posted: Sat Dec 05, 2015 9:19 pm
by Brian
I've tried everything I can think of to replace text with new text, and all it does it overwrite what's there. I've tried outputting spaces to the same area, and also flushing the area before writing the new text. But it won't clear the area. It all juts piles up on top of itself.
Here's a sample of the data:
Setup:
$FE,$58 (clear screen)
$FE,$28,1,"Aero.ttf",0 (load font [null terminated string - Aero.ttf] into index 1)
$FE,$31,1 (set font to index 1)
Repeated:
$FE,$5C,0,0,0,0,1,94,0,80 (flush 0,0 to 350,80)
$FE,$48 (home)
$FE,$33,40 (font size = 40)
"14025." (text)
$FE,$33,30 (font size = 30)
"000" (text)
The result should be 14025.000 and it is.
I repeat this with a new number and it just writes on top of it.
Also, why are some parameters shown as signed short? With a display that starts at 0,0 and increments positively to the right and down, why would you ever use negative numbers? Is this just for compatibility with past or future devices?
I'm using I2C, and it's been an adventure getting it to work. How do I know when a command is done? Can I rely on clock stretching to hold off the I2C bus when it's not ready? Or do I have to figure out how long everything takes and wait that long?
Brian
Re: GTT38 text insertion doesn't clear
Posted: Sun Dec 06, 2015 11:45 am
by Brian
Had another idea - tried creating 9 labels, one for each character position, then outputting a null to that label to clear it, followed by the new data. Not real sure how many pixels to allow for the font, but took a guess. There doesn't appear to be a way to set the font size when writing the text into the label. Anyway, that only works twice ("14" in display) and flickers when updated. Not sure if the display is just too slow to keep up, but it is acknowledging every byte correctly. Just doesn't display it.
$FE,$10,1,0, 0,0,0,0,35,0,50,0,0,2,2,1,255,128,64
$FE,$10,2,0, 36,0,0,0,35,0,50,0,0,2,2,1,255,128,64
$FE,$10,3,0, 71,0,0,0,35,0,50,0,0,2,2,1,255,128,64
$FE,$10,4,0,106,0,0,0,35,0,50,0,0,2,2,1,255,128,64
$FE,$10,5,0,141,0,0,0,35,0,50,0,0,2,2,1,255,128,64
$FE,$10,6,0,176,0,0,0,35,0,50,0,0,2,2,1,255,128,64
$FE,$10,7,0,211,0,0,0,35,0,50,0,0,2,2,1,255,128,64
$FE,$10,8,0,246,0,0,0,35,0,50,0,0,2,2,1,255,128,64
$FE,$10,9,1,$18,0,0,0,35,0,50,0,0,2,2,1,255,128,64
$FE,$11,6,0,".",0
$FE,$11,1,0,0
$FE,$11,1,0,"1",0
$FE,$11,2,0,0
$FE,$11,2,0,"4",0
$FE,$11,3,0,0
$FE,$11,3,0,"0",0
$FE,$11,4,0,0
$FE,$11,4,0,"2",0
$FE,$11,5,0,0
$FE,$11,5,0,"5",0
$FE,$11,7,0,0
$FE,$11,7,0,"0",0
$FE,$11,8,0,0
$FE,$11,8,0,"0",0
$FE,$11,9,0,0
$FE,$11,9,0,"0",0
Brian
Re: GTT38 text insertion doesn't clear
Posted: Mon Dec 07, 2015 4:34 pm
by Daniel Divino
Hello Brian,
I understand you are having issues displaying data the way you prefer on your GTT38A. In order to get your display to show data the way you want, there are a couple things you'll have to do.
--First, for ease of use, I suggest saving two "Aero" style fonts in different indexes. One will be font size 40, while the other will be font size 30.
You're on the right track using labels. I suggest using two labels, as you cannot have two different font sizes in one label.
--Use the Create a label" command to create two labels both in different positions on the display. You'll have to play around with the dimensions of the labels in order to ensure that they are the correct size for the font sizes you are using.
--The first label will display the integer-part of your data and will use the 40pt font saved previously.
--The second label will display the fractional-part of the data using the 30pt font.
Once the data is updated, you require a method of erasing the data. The "Flush region" you attempted to use previously is actually used to purge all bitmaps stored in the bitmap buffer to one region of the screen. It is used in conjunction with the "Manual Update" command. Also, as of now there is no command that can clear a specific region of the display. So here is a work around.
If you are using a single color back ground, drawing a rectangle will work perfectly for you.
--Use the "Draw rectangle" command to draw a rectangle of appropriate width and height over the labels you have updated. You can change the color of the rectangle drawn in order to blend with your back ground.
If you are using a more complex background, you may have to use the "Copy Rectangle" command.
--Specify a region of the display that you would like to copy, and that region will be copied and stored as a bitmap in your bitmap buffer.
--Use the "display bitmap" command and display the stored image over top of your labels to "erase" the data. Since the background is copied over from another region, it may be easier to blend in with the rest of the background.
When necessary, just use the update label command to update the data displayed on the screen.
As for your question regarding signed shorts, you've pinned the tail on the donkey! The reason we use signed shorts is so the firmware is compatible with previous products that used signed shorts.
As for knowing when the command is done, I believe my colleague Raquel has offered some advice. I'll post it here again just in case anyone who stumbles upon this thread is curious as well.
As per how long a command is processed, what I can suggest it to have a
'synchronization' command.
Say you have sent a command to write/update your label, follow it with a
'synchronization' command -
ie any command that would report back some expected data, for eg 254 3
Get Display Metrics, which in your case would always return 252 3 0 7 1
224 0 74 5 6 5 (Width=480 Height=116 and RGB bits =5, 6, 5).
As soon as you are able to read the expected data from your
'synchronization' command, then for sure you know that the previous
command sent has been processed.
-Raquel
I suggest giving this method a shot and seeing what you can do with it.
-Daniel