[WORK] BOM-генератор: хост+микрофоны+камера+панель+презентация с количеством; роли 23->6 unknown; уточнение про Dante

This commit is contained in:
root committed 2026-11-06 15:18:16 +03:00
1 parent fb7b92cdc2
commit f1864ed1b7
4 files changed
+365 -24

No files matched your search

+99
View File
@@ -0,0 +1,99 @@
# Генератор BOM: конфигурация с количеством и обоснованием
Дата: 06.11.2026. Только официальные данные.
## Команда
```bash
bom.py --host "MeetingBar A50" --seats 10
bom.py --host "MeetingEye 500" --seats 20 --need "Auto Framing"
```
## Пример 1: A50, 10 мест
```
BOM для: MeetingBar A50
мест: 10 | требуется захват: 6 м
Роль Модель Кол Обоснование
Хост (кодек/бар) MeetingBar A50 1 основа системы
Микрофон встроенный 1 захват 10.0 м ≥ 6 м
Камера UVC86 1 совместима, до 3 шт
Панель управления CTP25 1 совместима, до 1 шт
Презентация WPP30 1 pairing up to 4, одновременно 1
```
**5 позиций, 5 единиц.** Встроенного микрофона хватает — расширение не нужно.
## Пример 2: MeetingEye 500, 20 мест
```
мест: 20 | требуется захват: 10 м
Хост MeetingEye 500 1
Микрофон (внешний) CPE40 2 встроенного нет; 6 м × 2 = 12 м ≥ 10 м
Камера UVC30 1
Панель управления CTP18 1
Презентация WPP30 1
```
**5 позиций, 6 единиц.** Микрофоны посчитаны: 10 м / 6 м = 2 шт, лимит 4 — проходит.
## Логика подбора
1. **Хост** — из каталога, проверка требуемых функций
2. **Покрытие** — нужно `pickup_need(места)`:
- ≤6 мест → 3 м
- ≤12 → 6 м
- ≤16 → 8 м
- >16 → 10 м
3. **Микрофон** — встроенный, или внешний с расчётом количества и проверкой лимита
4. **Камера** — приоритет по зуму; content-камеры (UVC30) не выбираются как основные
5. **Панель, презентация** — первая совместимая с учётом лимита
## Роли: 23 → 6 unknown
После расширения правил ролей:
| Роль | Устройств |
|---|---|
| codec | 37 |
| audio | 24 |
| camera | 23 |
| sharing_or_hub | 10 |
| touch | 10 |
| display | 6 |
| remote | 6 |
| accessory | 3 |
| speaker | 3 |
| sensor | 2 |
| mount | 1 |
| power | 1 |
| **unknown** | **6** |
Добавлены роли: `display` (ETV65/86, MeetingDisplay), `sensor` (RoomSensor),
`mount` (MTower), `power` (YPS20), `software` (Room Designer, RoomConnect).
## 🔴 Найденный пробел в данных
**У UVC86 нет значения зума** — в разобранном даташите нет слова «zoom».
При этом в документации Yealink UVC86 — «36× hybrid zoom».
Следствие: движок выбирает камеру по имеющимся данным, а UVC86 попадает
в «нет данных» и проигрывает. Это ошибка извлечения, а не выбора.
## Про Dante (уточнение)
В листе аксессуаров есть строки:
- `Third-Party Dante or Analog Microphone`
- `Third-Party Dante or Analog Speaker`
То есть **Dante поддерживается через сторонние устройства**, подключаемые
к Yealink. Ранее я писал «Dante нет» — правильнее: **своих Dante-устройств
у Yealink нет, но подключение сторонних Dante-микрофонов/динамиков предусмотрено**.
## Что дальше
1. Доизвлечь зум UVC86 (и подобные пропуски)
2. Полный BOM с ценами (когда будет прайс)
3. Панель дисплеев и кронштейнов в BOM
+51 -17
View File
@@ -25,7 +25,7 @@ devices:
- accessories_list
aliases: []
- name: BYOD-BOX
role: unknown
role: sharing_or_hub
seen_in:
- accessories_list
- name: CM20
@@ -135,33 +135,41 @@ devices:
- accessories_list
aliases: []
- name: ETV65/ETV86
role: unknown
role: display
seen_in:
- accessories_list
- name: Host Wi-Fi
role: unknown
role: accessory
seen_in:
- accessories_list
- name: MB-12X Pro
role: unknown
role: camera
seen_in:
- product_family
- accessories_list
aliases: []
- name: MB-CAM-12X
role: unknown
role: camera
seen_in:
- product_family
- accessories_list
aliases: []
- name: MB-CAM-6X
role: unknown
role: camera
seen_in:
- product_family
- accessories_list
aliases: []
- name: MB-CAM-6X/MB-CAM-12X
role: unknown
role: camera
seen_in:
- accessories_list
- name: MB-Remote
role: unknown
role: remote
seen_in:
- product_family
- accessories_list
aliases: []
- name: MCore
role: codec
seen_in:
@@ -269,9 +277,29 @@ devices:
- product_family
aliases: []
- name: MeetingDisplay
role: unknown
role: display
seen_in:
- accessories_list
- name: MeetingDisplay 55
role: display
seen_in:
- product_family
aliases: []
- name: MeetingDisplay 65
role: display
seen_in:
- product_family
aliases: []
- name: MeetingDisplay 75
role: display
seen_in:
- product_family
aliases: []
- name: MeetingDisplay 86
role: display
seen_in:
- product_family
aliases: []
- name: MeetingEye 400
role: codec
seen_in:
@@ -309,9 +337,11 @@ devices:
- matrix
aliases: []
- name: MSketch
role: unknown
role: accessory
seen_in:
- product_family
- accessories_list
aliases: []
- name: MSpeaker
role: speaker
seen_in:
@@ -379,7 +409,7 @@ devices:
- accessories_list
aliases: []
- name: MTower
role: unknown
role: mount
seen_in:
- accessories_list
- name: MVC-BYOD-Extender (Only work with MTR bundle)
@@ -414,7 +444,7 @@ devices:
- matrix
aliases: []
- name: Remote Control (included in the MeetingDisplay package)
role: unknown
role: remote
seen_in:
- accessories_list
- name: Roomcast
@@ -430,13 +460,17 @@ devices:
- product_family
aliases: []
- name: RoomSensor
role: unknown
role: sensor
seen_in:
- product_family
- accessories_list
aliases: []
- name: RoomSensor Pro
role: unknown
role: sensor
seen_in:
- product_family
- accessories_list
aliases: []
- name: SmartVision 40
role: camera
seen_in:
@@ -462,7 +496,7 @@ devices:
seen_in:
- accessories_list
- name: USB Connector
role: unknown
role: accessory
seen_in:
- accessories_list
- name: UVC20
@@ -648,7 +682,7 @@ devices:
seen_in:
- accessories_list
- name: Wireless Microphone
role: unknown
role: audio
seen_in:
- accessories_list
- name: WPP20
@@ -678,6 +712,6 @@ devices:
seen_in:
- accessories_list
- name: YPS20
role: unknown
role: power
seen_in:
- accessories_list
+203
View File
@@ -0,0 +1,203 @@
#!/usr/bin/env python3
"""Генератор BOM: хост + аксессуары с количеством, обоснованием и проверкой лимитов.
Только официальные данные. Каждая позиция — с причиной и источником.
"""
import argparse
import os
import re
import sys
BASE = "/opt/work-hub/compat"
def strip_marks(t):
return re.sub(r"^[\u221a\u2713\u2714\u00d7\u2717\u2718\u2022\s]+", "",
str(t or "")).strip()
def norm(s):
return re.sub(r"[^a-z0-9]", "", str(s).lower())
def load():
import yaml
g = yaml.safe_load(open(os.path.join(BASE, "graph.yaml"), encoding="utf-8"))
c = yaml.safe_load(open(os.path.join(BASE, "catalog.yaml"), encoding="utf-8"))
cat = {norm(d["name"]): d for d in c.get("devices") or []}
vals = {}
f = os.path.join(BASE, "values.yaml")
if os.path.exists(f):
d = yaml.safe_load(open(f, encoding="utf-8")) or {}
vals = {norm(x["device"]): x["attributes"] for x in d.get("devices") or []}
feats = {}
f = os.path.join(BASE, "features.yaml")
if os.path.exists(f):
d = yaml.safe_load(open(f, encoding="utf-8")) or {}
feats = {norm(x["device"]): set(x.get("features") or [])
for x in d.get("devices") or []}
edges = {}
for e in g.get("edges") or []:
edges.setdefault(norm(e["from"]), []).append(e)
return cat, vals, feats, edges
def pickup_need(seats):
if seats <= 6:
return 3
if seats <= 12:
return 6
if seats <= 16:
return 8
return 10
def main():
ap = argparse.ArgumentParser()
ap.add_argument("--host", required=True)
ap.add_argument("--seats", type=int, default=8)
ap.add_argument("--need", default="", help="требуемые функции через запятую")
args = ap.parse_args()
cat, vals, feats, edges = load()
hk = norm(args.host)
if hk not in edges and hk not in cat:
print("хост не найден:", args.host)
return 1
host = cat.get(hk, {}).get("name", args.host)
need = [x.strip() for x in args.need.split(",") if x.strip()]
print("=" * 60)
print("BOM для: %s" % host)
print("мест: %d | требуется захват: %d м" % (args.seats, pickup_need(args.seats)))
if need:
print("требуемые функции: %s" % ", ".join(need))
print("=" * 60)
bom = []
problems = []
# 1. хост
bom.append({"role": "Хост (кодек/бар)", "model": host, "qty": 1,
"why": "основа системы", "src": "каталог"})
# 2. функции
have = {norm(f) for f in feats.get(hk, set())}
for n in need:
if norm(n) not in have:
problems.append("хост НЕ имеет функции «%s»" % n)
# 3. встроенный захват
built_in = vals.get(hk, {}).get("audio.pickup_m")
need_m = pickup_need(args.seats)
if built_in:
if built_in >= need_m:
bom.append({"role": "Микрофон", "model": "встроенный в " + host, "qty": 1,
"why": "захват %s м ≥ %s м" % (built_in, need_m), "src": "даташит"})
else:
# ищем расширительные микрофоны
cands = []
for e in edges.get(hk, []):
if not e.get("supported") or not e.get("usable", True):
continue
r = cat.get(norm(e["to"]), {}).get("role")
if r != "audio":
continue
p = vals.get(norm(e["to"]), {}).get("audio.pickup_m")
if p:
cands.append((p, e))
cands.sort(key=lambda x: -x[0])
if cands:
p, e = cands[0]
qty = e.get("max_qty") or 1
bom.append({"role": "Микрофон (расширение)", "model": e["to"],
"qty": min(qty, max(1, (need_m + p - 1) // int(p))),
"why": "встроенный %s м < %s м; у %s захват %s м, до %s шт"
% (built_in, need_m, e["to"], p, qty),
"src": "матрица"})
else:
problems.append("встроенного захвата %s м мало, расширительных нет в данных"
% built_in)
else:
mics = []
for e in edges.get(hk, []):
if not e.get("supported") or not e.get("usable", True):
continue
if cat.get(norm(e["to"]), {}).get("role") != "audio":
continue
p = vals.get(norm(e["to"]), {}).get("audio.pickup_m") or 0
mics.append((p, e))
# coverage_fix: нужное число устройств с учётом лимита
best = None
for p, e in sorted(mics, key=lambda x: -x[0]):
cap = e.get("max_qty") or 99
need_n = max(1, -(-int(need_m) // max(int(p), 1))) if p else 1
if need_n <= cap:
best = (p, e, need_n)
break
if best:
p, e, need_n = best
qty = need_n
bom.append({"role": "Микрофон (внешний)", "model": e["to"], "qty": qty,
"why": "встроенного нет; у %s захват %s м, нужно %d шт (лимит %s)"
% (e["to"], p or "—", qty, e.get("max_qty") or "—"),
"src": "матрица"})
else:
problems.append("нет данных о микрофонах для этого хоста")
# 4. камера (если у хоста роль codec и нет встроенной)
cam_edges = [e for e in edges.get(hk, [])
if e.get("supported") and e.get("usable", True)
and cat.get(norm(e["to"]), {}).get("role") == "camera"]
if cam_edges:
def cam_score(e):
v = vals.get(norm(e["to"]), {})
zoom = (v.get("camera.zoom_optical") or 0) + (v.get("camera.zoom_hybrid") or 0)
# content-камеры (UVC30) отодвигаем: они не для основного вида
content = 1 if "content camera" in (e.get("condition") or "").lower() else 0
return (zoom - content * 100, e.get("max_qty") or 0)
cam_edges.sort(key=cam_score, reverse=True)
e = cam_edges[0]
bom.append({"role": "Камера", "model": e["to"], "qty": 1,
"why": "совместима с хостом, до %s шт" % (e.get("max_qty") or "—"),
"src": "матрица"})
# 5. панель управления
touch = [e for e in edges.get(hk, [])
if e.get("supported") and e.get("usable", True)
and cat.get(norm(e["to"]), {}).get("role") == "touch"]
if touch:
touch.sort(key=lambda e: (e.get("max_qty") or 0))
e = touch[0]
bom.append({"role": "Панель управления", "model": e["to"], "qty": 1,
"why": "совместима, до %s шт" % (e.get("max_qty") or "—"),
"src": "матрица"})
# 6. презентация
share = [e for e in edges.get(hk, [])
if e.get("supported") and e.get("usable", True)
and cat.get(norm(e["to"]), {}).get("role") == "sharing_or_hub"]
if share:
e = share[0]
bom.append({"role": "Презентация", "model": e["to"], "qty": 1,
"why": "совместима: %s" % (strip_marks(e.get("condition"))[:60] or "—"),
"src": "матрица"})
# вывод
print("\n%-24s %-22s %-4s %s" % ("Роль", "Модель", "Кол", "Обоснование"))
print("-" * 100)
for b in bom:
print("%-24s %-22s %-4s %s" % (b["role"][:24], b["model"][:22], b["qty"], b["why"][:44]))
if problems:
print("\n⚠ ТРЕБУЕТ ВНИМАНИЯ:")
for p in problems:
print(" -", p)
else:
print("\n✓ Конфигурация собрана без замечаний")
print("\nПозиций: %d | всего единиц: %d" % (len(bom), sum(b["qty"] for b in bom)))
return 0
if __name__ == "__main__":
sys.exit(main())
+12 -7
View File
@@ -15,16 +15,21 @@ import sys
BASE = "/opt/work-hub/compat"
OUT = "/opt/work-hub/compat"
ROLE_RULES = [
ROLE_RULES = [ # ROLE_RULES2
(r"^MeetingEye|^MeetingBar|^MeetingBoard|^MCore|^MVC|^PVB|^PVT|^Roomcast|^A\d{2}$", "codec"),
(r"^UVC\d|VCC\d|^SmartVision", "camera"),
(r"^VCM\d|^CM\d|^CS\d|^CPW\d|^MSpeech|^CPE\d|^CP\d{2,3}|^PA\d", "audio"),
(r"^MSpeaker", "speaker"),
(r"^UVC\d|VCC\d|^SmartVision|^MB-CAM|^MB-12X", "camera"),
(r"^VCM\d|^CM\d|^CS\d|^CPW\d|^MSpeech|^CPE\d|^CP\d{2,3}|^PA\d|Wireless Microphone|Dante or Analog Microphone", "audio"),
(r"^MSpeaker|Dante or Analog Speaker", "speaker"),
(r"^CTP\d|^MTouch", "touch"),
(r"^WPP\d|^VCH\d|^AVBridge|^AP\d|^AVHub", "sharing_or_hub"),
(r"^VCR\d", "remote"),
(r"Wall|Mount|Bracket|Stand", "mount"),
(r"^WPP\d|^VCH\d|^AVBridge|^AP\d|^AVHub|^BYOD-BOX|Content Sharing Dongle", "sharing_or_hub"),
(r"^VCR\d|^MB-Remote|Remote Control", "remote"),
(r"^ETV\d|MeetingDisplay", "display"),
(r"^RoomSensor|Sensor", "sensor"),
(r"^YPS\d|^Power", "power"),
(r"Room Designer|RoomConnect", "software"),
(r"^MTower|Wall|Mount|Bracket|Stand|Lift", "mount"),
(r"^WH\d|^YHS\d|^UH\d", "headset"),
(r"^USB Connector|^Host Wi-Fi|^MSketch", "accessory"),
]