fix(builder): AnalogPoint 보조 A1~A4 일반 어드레싱 + 폴링 대상화

이전(PR#5)은 비루프 AnalogPoint에만, 또 realtime=False로 보조를 넣어 적산 QV가
크롤러 폴링집합(is_active AND realtime_enabled)에서 빠져 라이브로 흐르지 않았다.

- is_analog 판정을 분기 앞으로 올려 모든 AnalogPoint(루프 포함)에 보조 처리 적용.
  루프 엔트리와 겹치면 seen_tags가 중복 흡수.
- 슬롯명 있는 A1~A4를 일반적으로 모두 어드레싱(공백 슬롯만 제외).
- realtime 기본값(True) 사용 → 보조도 폴링 대상. QV=연속 누적값만 archive 유지.
- FlexibleParameter(사용자정의)는 기존대로 realtime=False(폴링 제외) 유지.

맵 재생성(c1~c4): 순수 추가. C3 +6(FICQ-8118/LICA-5113 GAIN/RATE/RESET 등 루프
보조 누락분), 리포트 스팀적산 FIQ-*.QV 전부 포함, 제거 0.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
windpacer
2026-06-19 05:20:12 +09:00
parent f969cbb4a6
commit c7a115c928
5 changed files with 152 additions and 31 deletions

View File

@@ -467,6 +467,7 @@ def build_registers(sinam_path: Path, controller: str,
sp_src = gv(row, 'SourceAddressSP')
op_src = gv(row, 'SourceAddressOP')
md_src = gv(row, 'SourceAddressMD')
is_analog = (cls == 'AnalogPoint')
# 루프 판정 + mnemonic 수집은 행의 모든 셀을 스캔(scan_point)한다. GAIN1/RESET1/
# RATE1 등 SourceAddressPV/SP/OP/MD 외 컬럼에 흩어진 파라미터까지 포착해 doc 5.2
@@ -485,7 +486,6 @@ def build_registers(sinam_path: Path, controller: str,
# 신호/상태 포인트: PV=bare(태그명 자체), SP/OP/MD=suffix 엔트리.
# 빈칸이면 생성 안 함, 주소가 있으면 생성(빈칸/주소 판정은 소스 컬럼 유무).
produced = False
is_analog = (cls == 'AnalogPoint')
if pv_src:
r = resolve_one(pv_src, controller_num)
if r:
@@ -516,29 +516,30 @@ def build_registers(sinam_path: Path, controller: str,
r['type'], access, f'{cls} {attr}', is_analog)
produced = True
# 보조 파라미터 A1~A4: FIQ 류 적산기는 QV(적산)가 FlexibleParameter가 아니라
# AnalogPoint 보조슬롯(AuxiliaryNameA{n}=QV ↔ SourceAddressA{n})에 노출된다.
# FICQ 류(QV=FlexibleParameter)와 달리 빌더가 놓쳤던 부분. QV=연속 누적값→archive.
if is_analog:
for n in (1, 2, 3, 4):
aux_name = gv(row, f'AuxiliaryNameA{n}')
aux_src = gv(row, f'SourceAddressA{n}')
if not aux_name or not aux_src:
continue
r = resolve_one(aux_src, controller_num)
if not r:
continue
dst = gv(row, f'DestinationAddressA{n}')
access = 'RW' if dst else r['access']
write_addr = r['addr']
if dst:
dres = resolve_one(dst, controller_num)
if dres:
write_addr = dres['addr']
aux_archive = (aux_name.upper() == 'QV')
add_entry(f'{item_name}.{aux_name}', r['addr'], write_addr, r['count'],
r['type'], access, f'{cls} aux {aux_name}', aux_archive, realtime=False)
produced = True
# ── 보조 파라미터 A1~A4 (모든 AnalogPoint, 루프 포함) ──────────────────────
# FIQ 류 적산기는 QV(적산)가 FlexibleParameter가 아니라 AnalogPoint 보조슬롯
# (AuxiliaryNameA{n} ↔ SourceAddressA{n})에 노출된다. 슬롯명이 있는 A1~A4를
# 일반적으로 모두 어드레싱(공백 슬롯만 제외). 루프 엔트리와 겹치면 seen_tags가
# 중복을 흡수. QV=연속 누적값→archive. 보조도 폴링 대상(realtime 기본 True).
if is_analog:
for n in (1, 2, 3, 4):
aux_name = gv(row, f'AuxiliaryNameA{n}')
aux_src = gv(row, f'SourceAddressA{n}')
if not aux_name or not aux_src: # 공백 슬롯 제외
continue
r = resolve_one(aux_src, controller_num)
if not r:
continue
dst = gv(row, f'DestinationAddressA{n}')
access = 'RW' if dst else r['access']
write_addr = r['addr']
if dst:
dres = resolve_one(dst, controller_num)
if dres:
write_addr = dres['addr']
add_entry(f'{item_name}.{aux_name}', r['addr'], write_addr, r['count'],
r['type'], access, f'{cls} aux {aux_name}', aux_name.upper() == 'QV')
produced = True
# 베이스 태그 메타데이터 (이 컨트롤러에 속해 엔트리가 생성된 경우 1회)
if produced and db_conn and item_name not in meta_upserted: