export interface PointKeyInfo { description: string pointId: string unit?: string Lower?: string Upper?: string } export function parsePointKey(key: string | number | undefined | null): PointKeyInfo { const safeKey = key !== undefined && key !== null ? String(key) : '' const [description = '', pointId = '', unit = '', Lower = '', Upper = ''] = safeKey.split('|') return { description, pointId, unit, Lower, Upper } } export function buildPointKeyFromInfo(info: Partial): string { const { description = '', pointId = '', unit = '', Lower = '', Upper = '' } = info || {} return [description, pointId, unit, Lower, Upper].join('|') } export function buildPointTitle(info: PointKeyInfo, fallback: string): string { if (info.description && info.pointId) return `${info.description} (${info.pointId})` if (info.description) return info.description return fallback }