From 331ac9c2d2b25c6761c2166030d8f1233461e9ef Mon Sep 17 00:00:00 2001 From: Roman Buryan Date: Wed, 18 Nov 2026 21:15:31 +0300 Subject: [PATCH] [PRISM] Heatmap: room/mic/FOV coverage tool --- ops/work/web/studio.html | 45 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/ops/work/web/studio.html b/ops/work/web/studio.html index 55dd563..9cc3657 100644 --- a/ops/work/web/studio.html +++ b/ops/work/web/studio.html @@ -52,6 +52,7 @@ main{max-width:1560px;margin:0 auto;padding:22px 26px 70px}.view{display:none}.v + @@ -124,6 +125,16 @@ main{max-width:1560px;margin:0 auto;padding:22px 26px 70px}.view{display:none}.v +
+
+

Тепловая карта покрытия

+
Оценка по подтверждённым pickup/FOV. Без данных — честно «нет данных», без красивой картинки.
+
×
+ +
+
+
+

Разбор LLM-извлечения

@@ -173,6 +184,7 @@ function setView(v){ if(v==='telephony') loadTelephony(); if(v==='materials') loadMaterials(); if(v==='quality') loadCoverage(); + if(v==='heat') loadHeat(); if(v==='inbox') loadInbox(); if(v==='archive') loadArchive(); if(v==='room') loadRoomOptions(); @@ -195,6 +207,37 @@ async function loadMaterials(){ const rows=ms.map(x=>`${esc(x.title||x.model||'')}${esc(x.vendor||'')}${esc(x.model||'')}${esc(x.type||'')}${esc(x.source_level||'')}${x.url?`открыть`:'—'}`).join(''); $('#materialsbox').innerHTML=`${rows}
МатериалВендорМодельТипL
`; } +function heatNum(v){ if(v===null||v===undefined||v==='') return null; if(typeof v==='number') return v; const m=String(v).replace(',', '.').match(/-?\d+(\.\d+)?/); return m?parseFloat(m[0]):null; } +async function loadHeat(){ + const sel=$('#heatdevice'); + if(sel.options.length<=1){ + const r=await api('/api/search?q=&domain=vcs'); + S.heatItems=r.items||[]; + sel.innerHTML=''+S.heatItems.map(x=>``).join(''); + if(S.product) sel.value=S.product.name; + } + drawHeat(); +} +function showHeat(){ if(!S.product) return; setView('heat'); setTimeout(()=>{ const sel=$('#heatdevice'); if(sel) sel.value=S.product.name; drawHeat(); },50); } +function drawHeat(){ + const c=$('#heatcanvas'); if(!c) return; const ctx=c.getContext('2d'); + const W=Math.max(2,parseFloat($('#heatw').value)||6), D=Math.max(2,parseFloat($('#heatd').value)||5); + const name=$('#heatdevice').value; const p=(S.heatItems||[]).find(x=>x.name===name) || (S.product&&S.product.name===name?S.product:null); + const pad=36, availW=c.width-pad*2, availH=c.height-pad*2; + const scale=Math.min(availW/W, availH/D); const rw=W*scale, rh=D*scale, x0=(c.width-rw)/2, y0=(c.height-rh)/2; + ctx.clearRect(0,0,c.width,c.height); ctx.fillStyle='#0d1117'; ctx.fillRect(0,0,c.width,c.height); + ctx.strokeStyle='#30363d'; ctx.lineWidth=2; ctx.strokeRect(x0,y0,rw,rh); + ctx.fillStyle='#8b949e'; ctx.font='12px system-ui'; ctx.fillText(W+' × '+D+' м',x0,y0-10); + if(!p){ $('#heatnote').textContent='Выберите модель — без неё карта не строится.'; return; } + const spec=p.specs||{}; const pickup=heatNum(spec.pickup_m); const fov=heatNum(spec.fov_h); + if(pickup){ const r=Math.min(pickup*scale, rw*0.55); const cx=x0+rw/2, cy=y0+rh/2; const g=ctx.createRadialGradient(cx,cy,4,cx,cy,r); g.addColorStop(0,'rgba(88,166,255,.35)'); g.addColorStop(1,'rgba(88,166,255,0)'); ctx.fillStyle=g; ctx.beginPath(); ctx.arc(cx,cy,r,0,Math.PI*2); ctx.fill(); ctx.strokeStyle='rgba(88,166,255,.7)'; ctx.beginPath(); ctx.arc(cx,cy,r,0,Math.PI*2); ctx.stroke(); } + if(fov){ const cx=x0+rw/2, cy=y0+6; const half=fov*Math.PI/360; const len=Math.min(rw,rh)*0.9; ctx.fillStyle='rgba(63,185,80,.16)'; ctx.beginPath(); ctx.moveTo(cx,cy); ctx.lineTo(cx+Math.sin(-half)*len,cy+Math.cos(-half)*len); ctx.arc(cx,cy,len,Math.PI/2-half,Math.PI/2+half); ctx.closePath(); ctx.fill(); } + const notes=[]; notes.push(p.vendor+' · '+p.name); + notes.push(pickup?'Микрофоны: ~'+pickup+' м':'Pickup: нет данных'); + notes.push(fov?'Камера: '+fov+'°':'FOV: нет данных'); + if(!pickup&&!fov) notes.push('Недостаточно подтверждённых specs — карта условная.'); + $('#heatnote').innerHTML=notes.map(esc).join(' · '); +} async function loadInbox(){ $('#inboxbox').innerHTML='загрузка…'; const r=await api('/api/staging'); const xs=r.items||[]; const es=r.edges||[]; @@ -303,7 +346,7 @@ async function openProduct(key){ $('#detailbox').innerHTML = `

${esc(p.name)}

${esc(p.vendor)} · ${esc(p.solution_class)}
${kv.map(([k,v])=>`${k}${esc(v)}`).join('')}
${p.components?.length?`
Компоненты: ${esc(p.components.join(', '))}
`:''} -
${p.archived?'':''}
+
${p.archived?'':''}
${p.archived?'
Снято с продажи · купить нельзя · в проекте можно как замену/существующий парк
':''}
${skv.map(([k,v])=>`${k}${esc(v)}`).join('')}
${comp.length?`

Совместимость (${comp.length})

${comp.map(e=>``).join('')}
С устройствомТипМакс.Условие
${e.supported===false?'×':'✓'} ${esc(e.to)}${esc(e.kind||'')}${esc(e.max_qty??'')}${esc(e.condition||'')}
`:''}