Create A SlideCommand

GTT TFT Support

Moderator: Mods

Bob
LCD?
Posts: 9
Joined: Tue Jun 07, 2016 2:36 pm

Create A SlideCommand

Post by Bob »

Hello,
I have a problem to create a slider on a GTT43A. It would be very nice if someone can help.
I tried it by creating two 9slices. one for the track region an one for the botton region as requiered in the FE A1 (create slider) Funktion.
I used the manual-discribtion to ceate the 9slices.

BITMAP \9Slice\9slice1.jpg
TOP 2
BOTTOM 2
LEFT 2
RIGHT 2
VSCLAE
HSCALE
TRANS-R 55
TRANS-G 55
TRANS-B 55

In the FE A1 Command I then typed in (in addition to some other things in this script)
FE 90 01 39 53 6C 69 63 65 5C 74 72 61 63 6B 2E 74 78 74 00
FE 90 02 39 53 6C 69 63 65 5C 62 75 74 74 6F 6E 2E 74 78 74 00
FE A1 00 00 C6 00 4A 00 00 00 FF 00 B6 00 12 00 1A 00 14 01 02 01
FE A6 00 00 55

This (hopefully) is like the command is discribed in the manual.
Maybe someone can call my attention to a mistake I missed.

I already loaded the Upgrades from the support site to the GTT43A. Maybe there is some special thing I didn't recognize with loading the Upgrade and thereby accidentally caused a bug.
All other parts in this project work as they should.

Thanks
Bob

please give me a hint when you see it.

Daniel Divino
Matrix Orbital
Matrix Orbital
Posts: 247
Joined: Thu Sep 24, 2015 9:38 am

Re: Create A SlideCommand

Post by Daniel Divino »

Hello Bob,

Welcome to the forums!

I understand that you are having a few difficulties with the Slider command, and slider function offered by the GTT.

Your code format seems to be fine. Please make sure your 9-slice images, and your 9 slice text file are in their proper path names.
Could you tell me what message the GTT returns when you send the Create a Slider command?

Cheers,
Daniel
Daniel Divino
Technical Support
Matrix Orbital

Bob
LCD?
Posts: 9
Joined: Tue Jun 07, 2016 2:36 pm

Re: Create A SlideCommand

Post by Bob »

Hi,
thanks for help.
I get the answer FC A1 00 01 (252 161 0 1). According to the eStatusCodes it is "invalid Bitmap file Format" I gues (lenght =0 ?). I tried to Change some " \ " characters in the binary script file and also in the 9slice.txt. I did it step by step and tried out multiple times but always the same answer. In the 9slice file I also changed the file format of the track- and button-picture to .bmp instead .jpg that I used before, same result. I have no idea :/
I had to try how to read out the answer first. I didn't mind than I could use this for debugging.
(I want the slider for backlight Settings (first try this and use it for some other regulations later). so I added it to a "seetings"-script. I already can change backlight settings by "up" and "down" buttons but a slider is a smarter option.
I put the FE A1 command after the FE 90 commands to the script because I wantet the slider to be created when the script starts.) Maybe I have to say that I connected the Display to a MCU for my Project!? I took the FE A1 command out of the script and let the MCU send the command to make reading out the answer more easy.

If the display-answer means FC A1 00 (nothing more) and the eStatusCode is "FileNotFound" I coultn'd imagine why the file is not found. Are there important space characters which I have to add or some reverse backflash ( " \" ). I also do not realy know when I have to add a "00" -character between two commands.

Sorry if my questions are confusing. I am confused about some commands either. I tried so many options and become lightly frustrated about the slide command. I could try to send a zip file of the mentioned files if this helps?

I am looking forward to your help, again.
thanks

Daniel Divino
Matrix Orbital
Matrix Orbital
Posts: 247
Joined: Thu Sep 24, 2015 9:38 am

Re: Create A SlideCommand

Post by Daniel Divino »

Hello Bob,

I understand you've done quite a bit of work to try and troubleshoot the slider issues you're experiencing. The return message reading code you made may definitely be beneficial during your development.

I should let you know that for return messages, 5 bytes are expected to be returned. This is explained on page 1 of the GTT Protocol manual. The Protocol Manual can be found here : http://matrixorbital.ca/manuals/gtt-series

252 The prefix is 1 byte
161 The Message ID is 1 byte
0 1 The Length is a short, thus 2 bytes are returned
0 The eStatusCode value is 1 byte

Since you only read 4 of the 5 expected bytes, you may have been confused as to why the Length was 0.

I suggest you adjust your code again to read the 5 byte return message, and that will allow us to properly diagnose what may be going wrong.

Also, the GTT Support Tool software found on our support site has a debugging window, allowing a user to see what is being sent and received from the GTT. If you can connect your GTT and communicate directly to your PC, you may be able to use Support tool to send commands, allowing you to see exactly how they work, as well as see what is being sent, and received. The GTT Support Software can be found here: http://matrixorbital.ca/gtt-software

Please try the suggestion above, and let me know what the display returns. We an then proceed and find out what may be going wrong.

Cheers,
Daniel
Daniel Divino
Technical Support
Matrix Orbital

Bob
LCD?
Posts: 9
Joined: Tue Jun 07, 2016 2:36 pm

Re: Create A SlideCommand

Post by Bob »

Hi daniel, thank you very mich for your effort.
I totally missed that length is a short ;) I did read the script several times but surely run over some passages to fast)
I only used the design tool to create some scripts and then added the code for slider in a hex editor (there is no slider-drag-and-drop-feature in the design tool, isn't it?). I didn't mind using the support tool (although I downloaded it), yet.
I report about the results as soon as I can

Bob

Daniel Divino
Matrix Orbital
Matrix Orbital
Posts: 247
Joined: Thu Sep 24, 2015 9:38 am

Re: Create A SlideCommand

Post by Daniel Divino »

No worries Bob,

Even I miss these details sometimes.

We will be releasing a build of the GTT designer that allows a user to create a slider, but that will be a little while from now. We are still refining the software to eliminate any bugs that we find.

I look forward to hearing what the display returns.

Cheers,
Daniel
Daniel Divino
Technical Support
Matrix Orbital

Bob
LCD?
Posts: 9
Joined: Tue Jun 07, 2016 2:36 pm

Re: Create A SlideCommand

Post by Bob »

Hi,
still no success. But yes, I know that there is a way. I am used to such problems.
Display says "Invalid 9Slices Index" now. So I read out the answer of the FE 90 (load 9Slice) command. It says "File not found". I again tried some changes - without success. Is there an example of how to exactly use the commands? I added ".txt" to the filepath. I am not sure if the 9slices files have to be in the root folder or if they have to be all in the same folder to be found by the display. Or if there are some errors with numbers and letters mixed in the path-name!?

I hope you can help
thanks

(My support tool doesn't seem to be an option for me now. there is some exception handling when I want to start by klicking on the play symbol. It's the work for another day to reinstall the support tool and read the help files ;) )

Daniel Divino
Matrix Orbital
Matrix Orbital
Posts: 247
Joined: Thu Sep 24, 2015 9:38 am

Re: Create A SlideCommand

Post by Daniel Divino »

Hello Bob,

I'm glad you were able to properly read the return message from the GTT. By the sounds of it, it seems like you aren't directing the GTT to the proper pathnamess/files.

I've attached a 9slizeExample.zip file that contains two 9slice example .txt files, and an Assets folder containing the bitmaps used for said 9slices.
You can use these files as an example for how to properly set up a 9 slice.

I've provided a list of steps that can guide you on how to load you 9Slice onto your display, and use it for your slider.

1. Boot up your GTT in Mass Storage mode(please consult your Hardware manual on how to boot your display in Mass storage mode)
2. Copy the three files (Assets folder, button.txt, and slider.txt) into the root of your SD card.
3. Restart the GTT display in normal operating mode
4. Send the Load9Slice command to the GTT. Set the index as 1.For the Filename parameter, specify "button.txt"
5. Send the Load9Slice command to the GTT. Set the index as 2. For the Filename parameter, specify "slider.txt"
6. Send the Create A Slider command to the GTT. Set the BtnID parameter as 1, and the TrkID parameter as 2. TrkWth should be at least 12, TrkHgt 18, should be at least BtnWth 10 should be at least and BtnHgt should be at least 10.

Follwing the above steps should create a proper slider on your GTT.

Some tips for formatting your files:
If you open up the button.txt or the slider.txt, you'll see how each 9slice text file points to their appropriate bitmap image. For the BITMAP parameter, the entire path name to where the bitmap is located must be written (i.e BITMAP Assets\Bitmaps\SELECT_FRAME.bmp).

When you use the Load9Slice command, you will have to specify the path\file name of where you stored the 9Slice file. If you saved the 9Slice text files in the root of your SD card, you can simply specify "button.txt" or "slider.txt" for the filename parameter.

If you move these two files into another folder, for example, the asset folder, you will have to specify that when using the Load9Slice command. So instead, you will have to use "Assets\button.txt" and "Assets\slider.txt" as the filename parameters.

When specifying file or path names, please ensure that your names are exactly the same. For example, if you specified "BUTTON.TXT" in the Load9Slice command, instead of "button.txt", the GTT will not be able to find the file.

The reason for the minimum values for TrkWth, TrkHgt, BtnWth, and BtnHgt are due to how a 9Slice is setup.
A general rule of thumb is to:
-make the TrkHgt equal to or greater than the sum of your 9Slice's Top and Bottom value (9+9 =18).
-make the TrkWth equal to or greater than the sum of your 9Slice's Right and Left value (6+6 =12).
-make the BtnHgt equal to or greater than the sum of your 9Slice's Top and Bottom value (5+5 =10).
-make the BtnWth equal to or greater than the sum of your 9Slice's Right and Left value (5+5 =10).

Please give this a shot, and see what you may be doing differently with your files. I believe it is due to the path names you are using when specifying your 9Slice filenames.

If you need clarification on any of the steps or tips above, or if you are still having troubles getting your slider command to work properly please let me know.
Attachments
9SliceExample.zip
(7.81 KiB) Downloaded 500 times
Daniel Divino
Technical Support
Matrix Orbital

Bob
LCD?
Posts: 9
Joined: Tue Jun 07, 2016 2:36 pm

Re: Create A SlideCommand

Post by Bob »

Hi daniel,
Thank you very much for the help. I will try to load the example files and will see what I did wrong with my files. Your description of the steps rings a bell. I will process it step by step again with special attention to the pathnames. I allready checked the filenames/pathnames several times and I know that means nothing. It's typical for me that the mistake is very obvious and I'm blind for it..
I will let you know if I am successful with your hints

Thanks
Bob

Bob
LCD?
Posts: 9
Joined: Tue Jun 07, 2016 2:36 pm

Re: Create A SlideCommand

Post by Bob »

Hi,
just to keep you updated:
I got a little bit of time in this moment to test your example. I don't realy know the exact mistake in my files, yet but I'm glad to see the slider function displayed. The dimensions I used for the slider seem to be larger than they should be. At the moment the slider seems to non-visibly overlap two buttons and they don't work now. There has to be a greater distance between them, hasn't it?
To get the slider alive I gues I have to use the "get"- and "set slider position" together with the touch-return message, right?

An additional question: does MO offer front covers (metallic or plastics) for the gtt series?

kind regards
Bob

Daniel Divino
Matrix Orbital
Matrix Orbital
Posts: 247
Joined: Thu Sep 24, 2015 9:38 am

Re: Create A SlideCommand

Post by Daniel Divino »

Hello Bob,

I'm glad you were able to get the slider example working. If you only used the minimum suggested values, the slider will appear as two buttons overlapping. See image below:
Minimum Slider
Minimum Slider
IMAG0193.jpg (37.15 KiB) Viewed 15826 times
Adjusting the TrkWth will determine how long you slider is. The image below has a TrkWth of 200.
TrkWth 200
TrkWth 200
IMAG0194.jpg (42.79 KiB) Viewed 15826 times
Adjusting the TrkHgt will determine the height of your slider. The image below has a TrkHgt of 200.
TrkHgt 20
TrkHgt 20
IMAG0195.jpg (39.64 KiB) Viewed 15826 times
Adjusting the BtnWth will determine how wide your button is, while BtnHgt determines the height of your button. The image below has a BtnWth and BtnHgt of 20.
BtnWth and BtnHgt 20
BtnWth and BtnHgt 20
IMAG0196.jpg (41.73 KiB) Viewed 15826 times
The longer your slider is, the easier it is to see how it performs, and what it does.

When creating a slider, you specify the Value returned from the left/topmost(LT) position of the slider, and the Value returned from the right/bottomost(RB) position of the slider. This will be the range of values returned by the slider.

For example, lets say you have a horizontal slider, and you set your LT to 0, while your RB is set to 100. As you move the button on your slider from the left to the right, the slider position will gradually increase from 0-100. If you place the button on the center of your slider, then use the get slider position command, the GTT will tell you the slider is at postion 50. Your controller can determine what to do with these values. For example, you can use a slider as a volume control. As you adjust the slider, the host will gradually decrease or increase the volume based on the values returned by the GTT. You can also use the set slider position to achieve this.

With regards to your question about front covers, right now we don't officially have any mounts or bezels for GTT displays.

Cheers,
Daniel
Daniel Divino
Technical Support
Matrix Orbital

Bob
LCD?
Posts: 9
Joined: Tue Jun 07, 2016 2:36 pm

Re: Create A SlideCommand

Post by Bob »

Hi,
Oh thanks for the pictures and the effort. I understand how to adjust the widh and the high of the buttons and so on. I think you missunderstood me. I had two buttons next to the slider feature from my former project with the display (The two buttons were there to adjust display brightness because I wasn't able to do this with the slider due to my problems with it) I tried to put the slider between them. I thought the space was big enough to put the slider between. There also was no visible overlapping but I couldn't slide the button of the slider feature.. Maybe it was an error due to some non-visible overlapping of the to buttons I put there before and the slider. I will try if I properly can slide when I increase the distance between the two outer buttons or if I delete them.

Daniel Divino
Matrix Orbital
Matrix Orbital
Posts: 247
Joined: Thu Sep 24, 2015 9:38 am

Re: Create A SlideCommand

Post by Daniel Divino »

Hello Bob,

I apologize for the misunderstanding.

If the slider is overlapping the buttons (or vice versa) I believe the GTT will read it as input to whichever object was drawn first.

In your situation it sounds like the slider and the button shouldn't be overlapping at all. I'll play around with the sliders and see what I can find. I also noticed if your slider is of small length, it can be a little difficult to properly move it.

Cheers,
Daniel
Daniel Divino
Technical Support
Matrix Orbital

Daniel Divino
Matrix Orbital
Matrix Orbital
Posts: 247
Joined: Thu Sep 24, 2015 9:38 am

Re: Create A SlideCommand

Post by Daniel Divino »

Hello Bob,

I have done a couple tests using the sliders and the buttons and it does indeed seem like there are a few issues when both are on screen together. I will let the Design team know about these bugs.

I did find that if my screen wasn't calibrated properly the display wouldn't respond as expected. Please try to re-calibrate your display and see if that resolves some of your issues..

Cheers,
Daniel
Daniel Divino
Technical Support
Matrix Orbital

Bob
LCD?
Posts: 9
Joined: Tue Jun 07, 2016 2:36 pm

Re: Create A SlideCommand

Post by Bob »

Hi,
I also played a little bit with the slider and just got that the "leftmost/ topmost value returned by the slider region" has to be equal or smaller than the width of the slider region. (My sliders width was 176 and I wanted to return values between 0 and 255. that is why it didn't work I think) Maybe it's a logical issue. when the slider-button moves "one" pixel there only a value can be returned diverging from "one". I first thought the LT-value is just about the returned value (and it's not associated with the moved pixel distance) and that the display somehow internaly splits the moving distance or double send the same return value even when the slider has been moved 1 pixel. It's all clear now. so whatever ;)
I checked my 9Slices files and found that there was a very-hard-to-find upper and lower case mistake.
thank you very much for your help.

with regards
Bob

Post Reply