|
|
@@ -548,7 +548,7 @@
|
|
|
for(let f=0;f<64;f++)for(let x=0;x<44;x++){
|
|
|
const noise=18+((Math.sin(f*3.2+x*1.7+t*5)+Math.cos(f*.8-x*2.1+t*3))*8)+((f*11+x*7)%17);
|
|
|
const band=(f>=5&&f<=13)?12*Math.max(0,Math.sin(x*.8+t*2)):0;
|
|
|
- const harmonic=fade*(f===9||f===18||f===27||f===36?100:((f%9===0)?45:0)) + falseCue*((f%9===0)?38:0);
|
|
|
+ const harmonic=fade*(f===9||f===18||f===27||f===36?220:((f%9===0)?115:((f%3===0)?42:0))) + falseCue*((f%9===0)?78:((f%3===0)?30:0));
|
|
|
const gust=(t<18||t>34)?22*Math.max(0,Math.sin(t*1.4+f*.5)):8;
|
|
|
bytes[f*44+x]=Math.max(0,Math.min(255,Math.round(noise+band+harmonic+gust)));
|
|
|
}
|
|
|
@@ -565,6 +565,18 @@
|
|
|
ctx.strokeStyle='rgba(230,215,185,.25)';ctx.lineWidth=1;
|
|
|
for(let i=1;i<4;i++){ctx.beginPath();ctx.moveTo(0,H*i/4);ctx.lineTo(W,H*i/4);ctx.stroke();}
|
|
|
}
|
|
|
+ function drawMiniSpectrum(t){
|
|
|
+ const canvas=$('miniSpectrum'); if(!canvas)return; const ctx=canvas.getContext('2d');
|
|
|
+ const W=canvas.width,H=canvas.height; ctx.clearRect(0,0,W,H);ctx.fillStyle='#293d41';ctx.fillRect(0,0,W,H);
|
|
|
+ const fade=(t>=18&&t<34)?Math.max(0,Math.min(1,(t-18)/4,(34-t)/4)):0;
|
|
|
+ const weak=(t>=7&&t<9)?0.34:0; const n=64,barW=W/n;
|
|
|
+ for(let i=0;i<n;i++){
|
|
|
+ const base=5+((Math.sin(i*.53+t*.4)+1)*4);
|
|
|
+ const drone=fade*(i===9||i===18||i===27||i===36?42:(i%9===0?25:(i%3===0?12:0)))+weak*(i%9===0?18:0);
|
|
|
+ const h=Math.min(H-5,base+drone);ctx.fillStyle=drone>12?'#b4422f':'#d0b78c';ctx.fillRect(i*barW+1,H-h,Math.max(1,barW-2),h);
|
|
|
+ }
|
|
|
+ ctx.strokeStyle='#c7b99c';ctx.globalAlpha=.35;ctx.beginPath();ctx.moveTo(0,H-1);ctx.lineTo(W,H-1);ctx.stroke();ctx.globalAlpha=1;
|
|
|
+ }
|
|
|
function statsFor(which){
|
|
|
let tp=0,fp=0,fn=0,tn=0;
|
|
|
for(const row of demoScoring){const pred=which==='manual'?row.manual:row.auto; if(row.truth&&pred)tp++;else if(!row.truth&&pred)fp++;else if(row.truth&&!pred)fn++;else tn++;}
|
|
|
@@ -584,7 +596,7 @@
|
|
|
function updateDemo(t){
|
|
|
const sec=Math.floor(t); if(sec===demoSecond)return;demoSecond=sec;
|
|
|
const audible=truthAt(t),auto=autoAt(t),p=autoConfidence(t);
|
|
|
- drawRollingSpec(t);$('specSource').textContent=`СЦЕНАРИЙ · ${sec+1}/40`;
|
|
|
+ drawRollingSpec(t);drawMiniSpectrum(t);$('specSource').textContent=`СЦЕНАРИЙ · ${sec+1}/40`;
|
|
|
$('demoClock').textContent=`00:${String(sec).padStart(2,'0')}`;
|
|
|
$('demoCaption').textContent= t<14?'ФОНОВАЯ ОБСТАНОВКА · ВЕТЕР И ЛЁД':t<18?'СЛАБЫЙ АКУСТИЧЕСКИЙ СИГНАЛ · ОБЪЕКТ НЕ ВИДЕН':t<24?'СИГНАЛ ВИНТОВ · ОЖИДАНИЕ ВИЗУАЛЬНОГО ПОДТВЕРЖДЕНИЯ':t<30?'БПЛА В СЕКТОРЕ · СИГНАЛ ОТЧЁТЛИВ':t<34?'БПЛА УДАЛЯЕТСЯ · СИГНАЛ ЗАТУХАЕТ':'ФОН · СИГНАЛ ИСЧЕЗ';
|
|
|
// Reveal the aircraft silhouette gradually after the alarm window begins.
|
|
|
@@ -606,7 +618,7 @@
|
|
|
evaluateSecond(sec);
|
|
|
}
|
|
|
function stopDemo(){demoRunning=false;clearInterval(demoTimer);demoTimer=null;demoStart.textContent='▶ ЗАПУСК';demoAudio.pause();}
|
|
|
- function resetDemo(){stopDemo();demoAudio.currentTime=0;manualToggle.checked=false;demoScoring=[];demoSecond=-1;drone.style.opacity=0;updateScoreboard();drawRollingSpec(0);updateDemo(0);$('demoClock').textContent='00:00';$('scenarioStatus').textContent='СЦЕНАРИЙ ГОТОВ · ОЖИДАНИЕ';}
|
|
|
+ function resetDemo(){stopDemo();demoAudio.currentTime=0;manualToggle.checked=false;demoScoring=[];demoSecond=-1;drone.style.opacity=0;updateScoreboard();drawRollingSpec(0);drawMiniSpectrum(0);updateDemo(0);$('demoClock').textContent='00:00';$('scenarioStatus').textContent='СЦЕНАРИЙ ГОТОВ · ОЖИДАНИЕ';}
|
|
|
demoStart?.addEventListener('click',async()=>{
|
|
|
if(demoRunning){stopDemo();$('scenarioStatus').textContent='СЦЕНАРИЙ ПРИОСТАНОВЛЕН';return;}
|
|
|
demoRunning=true;demoStart.textContent='Ⅱ ПАУЗА';demoSecond=-1;demoScoring=[];manualToggle.checked=false;demoAudio.currentTime=0;
|