TX meter: add minor tick marks between main scale labels

Power bar: minor ticks every 5% (between 0/25/50/75/100% main marks)
SWR bar: minor ticks at integer values 2,3,4,6,7,8,9 (between 1/2.5/5/10)
Applied to both desktop (SpectrumView) and web (paintTXMeter JS)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-05-15 14:27:00 +03:00
co-authored by Claude Sonnet 4.6
parent 76e5c5514a
commit e8561dcc18
2 changed files with 32 additions and 4 deletions
+8 -1
View File
@@ -504,12 +504,19 @@ begin
'mctx.beginPath();mctx.moveTo(BX,PY1+1);mctx.lineTo(BX,PY2-1);mctx.stroke();' +
'mctx.beginPath();mctx.moveTo(BX,SY1+1);mctx.lineTo(BX,SY2-1);mctx.stroke();' +
// тики мощности выше power-бара
'mctx.font="8px Courier New";' +
'mctx.font="8px Courier New";const TICK_MED=3;' +
// промежуточные тики каждые 5%, пропуская кратные 25%
'for(let p=5;p<100;p+=5){if(p%25!==0){const x=pwrX(p/100);' +
'mctx.strokeStyle="#708070";mctx.lineWidth=1;mctx.beginPath();mctx.moveTo(x,PY1-TICK_MED);mctx.lineTo(x,PY1-1);mctx.stroke();}}' +
// главные тики с подписями
'const pwrMarks=[0,0.25,0.5,0.75,1.0];' +
'for(let i=0;i<pwrMarks.length;i++){const x=pwrX(pwrMarks[i]);' +
'mctx.strokeStyle="#DCE0E0";mctx.lineWidth=1;mctx.beginPath();mctx.moveTo(x,PY1-TICK_LONG);mctx.lineTo(x,PY1-1);mctx.stroke();' +
'const t=(pwrMarks[i]*maxW).toFixed(0),tw=mctx.measureText(t).width;' +
'mctx.fillStyle="#DCDCD0";mctx.fillText(t,Math.round(x-tw/2),PY1-TICK_LONG-3);}' +
// промежуточные тики КСВ на целых 2,3,4,6,7,8,9
'for(let s=2;s<=9;s++){if(s===5)continue;const x=swrX(s),isW=s>=3;' +
'mctx.strokeStyle=isW?"#90A070":"#708070";mctx.lineWidth=1;mctx.beginPath();mctx.moveTo(x,SY2+1);mctx.lineTo(x,SY2+TICK_MED);mctx.stroke();}' +
// тики КСВ ниже SWR-бара
'const swrMarks=[1,2.5,5,10],swrLbls=["1","2.5","5","10"];' +
'for(let i=0;i<swrMarks.length;i++){const x=swrX(swrMarks[i]),isW=swrMarks[i]>=SWR_HIGH;' +