SVGHMI: Make an error when pages are nested svghmi
authorEdouard Tisserant
Mon, 25 Jan 2021 14:02:08 +0100
branchsvghmi
changeset 3117 f058542d0caa
parent 3116 6da94ec04325
child 3118 e704b0487515
SVGHMI: Make an error when pages are nested
svghmi/detachable_pages.ysl2
--- a/svghmi/detachable_pages.ysl2	Fri Jan 22 11:30:37 2021 +0100
+++ b/svghmi/detachable_pages.ysl2	Mon Jan 25 14:02:08 2021 +0100
@@ -12,12 +12,12 @@
         choose {
             when "$hmi_pages_descs/arg[1]/@value = 'Home'" > Home
             otherwise {
-                error "No Home page defined!";
+                error > No Home page defined!
             }
         }
     }
     when "count($hmi_pages) = 0" {
-        error "No page defined!";
+        error > No page defined!
     }
     otherwise > «func:widget($hmi_pages/@id)/arg[1]/@value»
 }
@@ -113,6 +113,8 @@
 const "in_forEach_widget_ids", "func:refered_elements($forEach_widgets)[not(@id = $forEach_widgets_ids)]/@id";
 
 template "svg:*", mode="page_desc" {
+    if "ancestor::*[@id = $hmi_pages/@id]" error > HMI:Page «@id» is nested in another HMI:Page
+
     const "desc", "func:widget(@id)";
     const "page", ".";
     const "p", "$geometry[@Id = $page/@id]";