From a0f6ddd8348ea224d8b3ad334187ec419c2884a0 Mon Sep 17 00:00:00 2001
From: Illia Solovei <i.solovei@sprinteins.com>
Date: Mon, 18 Nov 2024 14:27:54 +0100
Subject: [PATCH] bugfix: simplify the logic

---
 packages/plugins/src/menu/VirtualTemplateIED.ts | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/packages/plugins/src/menu/VirtualTemplateIED.ts b/packages/plugins/src/menu/VirtualTemplateIED.ts
index 0d942af82d..46b6c0fe64 100644
--- a/packages/plugins/src/menu/VirtualTemplateIED.ts
+++ b/packages/plugins/src/menu/VirtualTemplateIED.ts
@@ -58,20 +58,16 @@ function getLDeviceDescriptions(
 			)!;
 			const lnType = lLN0?.split(": ")[1];
 
-			// Map to ensure unique prefixes based on node attributes
 			const anyLNs = [
 				{ prefix: null, lnClass: "LLN0", inst: "", lnType },
 				...selectedLNodes.map((lNode, index) => {
 					const lnClass = lNode.getAttribute("lnClass")!;
 					const inst = lNode.getAttribute("lnInst")!;
 					const lnType = lNode.getAttribute("lnType")!;
-					const existingPrefix = lNode.getAttribute("prefix") || "";
-
-					// Generate unique prefix if not already provided
-					const uniquePrefix = existingPrefix || `${lnClass}-${index + 1}`; // Prefix includes class and unique index
+					const prefix = lNode.getAttribute("prefix") || "";
 
 					return {
-						prefix: uniquePrefix,
+						prefix: prefix || `CSWI-${index}`,
 						lnClass,
 						inst,
 						lnType,