Add EPC-specific bindings and fix EPC tag path

EPC bindings: elements[0].stroke.paint (polyline) and
elements[1].elements[1].fill.paint (icon inner path) get color.
EPC tag path: Station/Emergency_Pull_Cord (not VFD/APF).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
igurielidze 2026-04-01 19:20:45 +04:00
parent 1cd4c9dc44
commit ba9b45a43e
2 changed files with 10 additions and 2 deletions

View File

@ -104,7 +104,7 @@ export function exportJSON() {
const TAG_PATH_RULES: Array<{ pattern: RegExp; path: string }> = [
// VFD / EPC
{ pattern: /_VFD\d*$/i, path: 'VFD/APF' },
{ pattern: /_EPC\d*$/i, path: 'VFD/APF' },
{ pattern: /_EPC\d*$/i, path: 'Station/Emergency_Pull_Cord' },
// Sensors
{ pattern: /_TPE\d*$/i, path: 'Sensor/Tracking' },
{ pattern: /_LPE\d*$/i, path: 'Sensor/Long_Range' },

View File

@ -315,9 +315,17 @@ function generateElementBindings(elements: SvgElement[]): Record<string, any> {
// Sub-element fill bindings — varies by device type
const isButton = /_(?:JR|S|SS|EN)\d/i.test(elName);
const isDpm = /_DPM\d*/i.test(elName);
const isEpc = /_EPC\d*/i.test(elName);
if (el.elements && el.elements.length > 0) {
if (isDpm) {
if (isEpc) {
// EPC: elements[0] is polyline (stroke.paint gets color),
// elements[1] is icon group (elements[1].elements[1].fill.paint gets color)
propConfig[`${prefix}.elements[0].stroke.paint`] = fillPaintBinding(n);
if (el.elements.length > 1 && el.elements[1].elements && el.elements[1].elements.length > 1) {
propConfig[`${prefix}.elements[1].elements[1].fill.paint`] = fillPaintBinding(n);
}
} else if (isDpm) {
// DPM: only elements[1] gets color binding (the black triangle)
// elements[0] stays as-is, elements[2] is transparent
if (el.elements.length > 1) {