DMR, t0.txt and t2.txt

All things relating to the Nextion Screen(s)

Moderator: PD0DIB

Post Reply
ae4ml
Posts: 4
Joined: Thu Apr 12, 2018 10:56 am

DMR, t0.txt and t2.txt

Post by ae4ml » Sun Apr 15, 2018 2:29 pm

from what I have read these two values change the font size depending t\on the string length. How can I can this to a fixed font ?
This is the only problem I have with my screen. I have tried setting another variable . t10.txt = t0.txt and t12.txt = t2.txt. This action only locks the "listening" to the space.

Any thoughts ?

PD0DIB
Posts: 24
Joined: Wed Apr 11, 2018 1:34 pm
Location: Uden, The Netherlands

Re: DMR, t0.txt and t2.txt

Post by PD0DIB » Sun Apr 15, 2018 2:38 pm

This is due to the 'variable' string-size for Talker Alias information. It is work in progress, within some time I'm going to update this subject in the tutorial..
-------------------------------
PD0DIB
Moderator Nextion sub-forum
Playing around with all types of hotspots (simplex & duplex) for DMR and D-Star.
Most of them has a Nextion screen ...

73 de PD0DIB (since 1977 8-) )

User avatar
kh6hz
Posts: 31
Joined: Tue May 08, 2018 2:43 pm
Location: Rehoboth, MA
Contact:

Re: DMR, t0.txt and t2.txt

Post by kh6hz » Tue May 29, 2018 5:34 pm

Any forward momentum on this? Admittedly, this is the only annoying aspect of my display which drives me nuts.
Signature on File
Haunts: 310, 2350, 3115, 3125

WA6HXG
Posts: 37
Joined: Sun Apr 29, 2018 10:09 pm

Re: DMR, t0.txt and t2.txt

Post by WA6HXG » Wed May 30, 2018 10:31 pm

That code is in the “SoTouch” (attribute) area. Just delete it all out unless your trying to keep last heard code (if it is in there) or the text color change code for t2

WA6HXG
Posts: 37
Joined: Sun Apr 29, 2018 10:09 pm

Re: DMR, t0.txt and t2.txt

Post by WA6HXG » Sat Jun 02, 2018 3:41 am

Open your HMI File in Nextion editor
Hit "File" "Save As" and make a copy in case something goes sideways!
Click the DMR Page on Top right of App
Click the attribute drop down
Select "SO(TouchArea)"
On bottom of App in "Touch Press Event" area click in it and then cntrl on keyboard, hold it and hit a to select all the code.
Now hold cntrl and hit c to copy it all.
Open Notepad, right click in empty area and press paste.
Now you see all the code.
To get rid of the text resize code delete the exact text section below between the lines and leave the rest so you still have last heard etc.
That will keep the text from changing colors and font sizing will be gone.
Now do a select all by holding cntrl then hit "A" then go back to nextion code window and cntrl a there and right click paste.

The text resize is actually a good feature and if you look at the code it is easy to grasp (If you want to deal with it)
You have to calculate how many characters fit in a text window depending on a font size etc. It can take a long time to get a file together and this is just a little bit of the Nextion programming.
There is A LOT more we can do with Nextion screens and it is in my future project list. I am looking at the ability to touch the screen and drop calls static and dynamic and that is just the start of what these screens can do... (TY) has already done some of these things and
ON7LDS on Github has done a lot of code work as well but no one has implemented it into the screens yet :( That is what I want to work on :)

To grasp the Nextion programming the text box needs the pixel width and height to match the font in it and max characters set. You can put temp temporarily in the txt field to make sure you got it right then delete out when you figure out how many characters fit etc.
The font resizer code looks at how many characters are there and adjusts the font size to get them all in the text box.
It is tedious and time consuming to use Nextion editor, everything is in pixel numbers. X and y are where on the layout, w and h are width and height of the text box etc.
Hope this helps!!!
----------------------------------------------
// the DMRID/TA field will be processed
// depending on type (ID, TA, call end) color and font size are set
//choose font size
t2.font=7
strlen t2.txt,tmp1.val
if(tmp1.val>16)
{
t2.font=7
}
if(tmp1.val>20)
{
t2.font=6
}
if(tmp1.val>26)
{
t2.font=5
}
//text color (for slot 2)
if(MMDVM.status.val>68)
{
if(MMDVM.status.val<73)
{
//status 69=listening, 70=ID, 71=TA, 72=call end
if(MMDVM.status.val==69)
{
t2.pco=0
}
//ID
if(MMDVM.status.val==70)
{
t2.pco=0
}
//TA
if(MMDVM.status.val==71)
{
t2.pco=0
}
//Call end
if(MMDVM.status.val==72)
{
t2.pco=0
}
}
}

----------------------------------------------------------------

Post Reply