Topics

More Nextion 3.5" tweaks to do

Ted
 

If you're good with C++, here's a good way to spend a rainy morning on a weekend if you know how to do this.  I've done some graphic resizing, as have others, and yet I have not gotten into the nuts and bolts of chart placement with regard to where the programming itself wants to display an image.  I see the subroutine most likely to control this but have been a bit slow on the uptake with regard to results expected.

Here's what I'm trying to do, to complete the full 3.5 " screen polishing:   The CEC screen .htm file for the 3.5" screen was really just a 2.8" screen compiled for a 3.5" window, with unfilled space around it. Likewise, the 3.2" screen was a 2.8" screen that's top-to-bottom the same height but has wasted space to the right of it  That wasn't so difficult to remedy so far as background graphics and button placement, sizing, etc. The sticky point is that, in the cases of spectrum scope displays and such, active graph displays show up on the 3.5" screen where they would have showed up if the 2.8" drawings were still around them.  This is where I've stopped, inasmuch as I can only seem to handle a couple of potentially hemmorage-inducing stressors at once in this hobby.

See these, and consider if your skills in programming might help to expand,relocate, and/or shift the red rectangles into the green ones.





Full credit will be given when I post the result - or if you post, I'll be happy to download them from your repository :)  Tnx in advance.



Later,

Ted
K3RTA

Joe Puma
 

I too am working on a 5” layout. Working on background images and moving items are trivial. The graphs are tricky. I was able to move around the lines for the band analyzer from top to bottom. I can’t find where I need to adjust for left and right. I have a email I have to draft to KD8CEC in hopes he can help me. 

image1.jpeg

image2.jpeg

image3.jpeg


Didn’t adjust the height or width here yet. 
image4.jpeg

image5.jpeg

image6.jpeg

image7.jpeg

image8.jpeg


On Apr 20, 2019, at 7:32 AM, Ted via Groups.Io <k3rta@...> wrote:

If you're good with C++, here's a good way to spend a rainy morning on a weekend if you know how to do this.  I've done some graphic resizing, as have others, and yet I have not gotten into the nuts and bolts of chart placement with regard to where the programming itself wants to display an image.  I see the subroutine most likely to control this but have been a bit slow on the uptake with regard to results expected.

Here's what I'm trying to do, to complete the full 3.5 " screen polishing:   The CEC screen .htm file for the 3.5" screen was really just a 2.8" screen compiled for a 3.5" window, with unfilled space around it. Likewise, the 3.2" screen was a 2.8" screen that's top-to-bottom the same height but has wasted space to the right of it  That wasn't so difficult to remedy so far as background graphics and button placement, sizing, etc. The sticky point is that, in the cases of spectrum scope displays and such, active graph displays show up on the 3.5" screen where they would have showed up if the 2.8" drawings were still around them.  This is where I've stopped, inasmuch as I can only seem to handle a couple of potentially hemmorage-inducing stressors at once in this hobby.

See these, and consider if your skills in programming might help to expand,relocate, and/or shift the red rectangles into the green ones.



<Spectrum 35.jpg><SpecCW_35.jpg><Main Screen 35.jpg>

Full credit will be given when I post the result - or if you post, I'll be happy to download them from your repository :)  Tnx in advance.



Later,

Ted
K3RTA

Sam Tedesco
 

I can get the resizing done...but, I'm not running a second nano. Ted, should I use your hmi file saved in the archive?

Sam Tedesco
 

On the pspectrum page, tm0 and tmrDisplay populate the empty boxes that show up on full display. If you go thru the nextion code for those two, you'll see a few commands 'fill' and 'xstr' followed by comma delimeted sets of numbers. The main command structure for 'fill' is (x,y,w,h) and the fifth num is a color code. You'll have to run the 2.4" hmi in the editor and figure out the smaller horizontal boxes above and below the graph area. From there, you'll have to calculate your new dimensions based on the 480x320 pixels and subtract out your existing controls to get your new coordinates.

I have to look up the parameters for the 'xstr'...but, probably similar
PITA, but not bad at all. I don't have the i2c setup on my machine so I'm running blind. It's all Nextion code.

Joe Puma
 

Thanks Sam, I will give it another look. There is where i was adjusting the lines for vertical positioning I believe,  Its hard to run a test to check if you properly stretched the graph unless you put the code in your Nextion. The simulation mode goes not give you data for the graph. I see Nextion editor has a generator, I was thinking that maybe its signal generator so you can simulate a signal for the graph. 

Joe
KD2NFC

 

On Apr 20, 2019, at 2:52 PM, Sam Tedesco <stedesco619@...> wrote:

On the pspectrum page, tm0 and tmrDisplay populate the empty boxes that show up on full display. If you go thru the nextion code for those two, you'll see a few commands 'fill' and 'xstr' followed by comma delimeted sets of numbers. The main command structure for 'fill' is (x,y,w,h) and the fifth num is a color code. You'll have to run the 2.4" hmi in the editor and figure out the smaller horizontal boxes above and below the graph area. From there, you'll have to calculate your new dimensions based on the 480x320 pixels and subtract out your existing controls to get your new coordinates.

I have to look up the parameters for the 'xstr'...but, probably similar
PITA, but not bad at all. I don't have the i2c setup on my machine so I'm running blind. It's all Nextion code.

Ted
 

Sam,

"subtract existing controls".....  Please explain, as I'm willing to dive into it and try.

I've attached my latest tweaks though I'm not at all ready to post it until I check it out in the field and get the graphs right. 



73,

Ted

Sam Tedesco
 

Hi Ted,

Joe is actually on the right path. If you look at his pspectrum page pic, he has opened up the vertical lines to extend across the 'black canvas' portion of the page. I looked around and added comments to the code from tmrDisplay so you can get an idea of what Ian is doing. tm0 is going to be a bit more difficult to get going for the graph portion.

sys2=0

if(nBeforeBase.val!=nFreq.val)

{

sys2+=1

}

if(nBeforePos.val!=hViewFreq.val)

{

sys2+=1

}

if(sys2>0)

{

nBeforeBase.val=nFreq.val

nBeforePos.val=hViewFreq.val

fill 0,0,247,52,10565

fill 0,25,247,2,16959 //horizontal line between top boxes

fill 120,10,2,15,16959 //small vertical line top box middle

cov nFreq.val,tmpS.txt,0

xstr 126,4,90,18,0,WHITE,10565,0,1,1,tmpS.txt //top right value

sys0=nFreq.val

sys0=2000*nADCCount.val/2 //2k step fixed

sys0=nFreq.val-sys0

nStartFreq.val=sys0

cov nStartFreq.val,tmpS.txt,0

xstr 2,4,90,18,0,WHITE,10565,0,1,1,tmpS.txt

//fill 0,160,247,20,31727

fill 0,164,247,14,10565 //background of bottom slider

fill 0,173,247,2,16959 //blue line on bottom slider

sys0=hViewFreq.val

sys0=sys0*1000

sys1=sys0+nStartFreq.val

nSelectFreq.val=sys1

cov nSelectFreq.val,tmpS.txt,0

//xstr 150,26,90,24,2,64520,GRAY,2,1,1,tmpS.txt

if(hViewFreq.val>120)

{

xstr hViewFreq.val-92,28,90,24,2,64520,10565,2,1,1,tmpS.txt

}else

{

xstr hViewFreq.val+2,28,90,24,2,64520,10565,0,1,1,tmpS.txt

}

fill hViewFreq.val,0,2,50,64520 //vertical line on top left

fill hViewFreq.val,164,2,14,64520 //small vert slider bottom box

}

Sam Tedesco
 

Fill command is fill x,y,w,h. So, if you want to draw a WHITE box across the 'black canvas' just to the spot where your controls are on the right hand side (h0,etc.), you could use

fill 0,184,409,5,WHITE    (the 409 is 480 - 71 (my control width of h0)).






Joe Puma
 

Thanks Sam. I’ll try this out today. 


On Apr 21, 2019, at 11:09 AM, Sam Tedesco <stedesco619@...> wrote:

Fill command is fill x,y,w,h. So, if you want to draw a WHITE box across the 'black canvas' just to the spot where your controls are on the right hand side (h0,etc.), you could use

fill 0,184,409,5,WHITE    (the 409 is 480 - 71 (my control width of h0)).






Joe Puma
 

I’m in the editor.

 

This code in tm0 will adjust the white lies, red line and black boarder for each band.  I’m programming it for a 5” screen so we’re working with 800x480 resulution. All the numbers are pixel positions except for the ending number which is a color by number or word.

 

 

//BAND1

  draw 0,30,610,80,WHITE

  fill 1,31,608,48,BLACK

  line 2,45,609,45,31727

  line 2,55,609,55,RED

  line 2,65,609,65,31727

  //BAND2

  draw 0,130,610,180,WHITE

  fill 1,131,608,48,BLACK

  line 2,145,609,145,31727

  line 2,155,609,155,RED

  line 2,165,609,165,31727

  //BAND3

  draw 0,240,610,290,WHITE

  fill 1,241,608,48,BLACK

  line 2,255,609,255,31727

  line 2,265,609,265,RED

  line 2,275,609,275,31727

 

 

 

 

 

 

Sent from Mail for Windows 10

 

From: Sam Tedesco
Sent: Sunday, April 21, 2019 11:09 AM
To: BITX20@groups.io
Subject: Re: [BITX20] More Nextion 3.5" tweaks to do

 

Fill command is fill x,y,w,h. So, if you want to draw a WHITE box across the 'black canvas' just to the spot where your controls are on the right hand side (h0,etc.), you could use

fill 0,184,409,5,WHITE    (the 409 is 480 - 71 (my control width of h0)).