From 6528a9c9c72640b2fa9b83a5ea18c0cb23fdcf7c Mon Sep 17 00:00:00 2001 From: Clement DAVID Date: Mon, 29 Oct 2018 09:02:31 +0100 Subject: [PATCH] Xcos CURVE_c: avoid figure popup on error when edit window mode is off. Change-Id: Idb19adc793d98a736d85b0053e8d8e34917a4897 --- scilab/CHANGES.md | 4 +-- .../scicos_blocks/macros/Sources/CURVE_c.sci | 38 ++++++++++++++++---- .../scicos_blocks/macros/Sources/Sigbuilder.sci | 6 ++++ 3 files changed, 40 insertions(+), 8 deletions(-) diff --git a/scilab/CHANGES.md b/scilab/CHANGES.md index 92e3dfe..7cefb74 100644 --- a/scilab/CHANGES.md +++ b/scilab/CHANGES.md @@ -134,8 +134,8 @@ User Interface improvements: Xcos ---- -* Default ending time reduced from 100000 to 30, to fit default scope block - +* Default ending time reduced from 100000 to 30, to fit default scope block. +* `CURVE_c` settings did not always display a window. API modification ---------------- diff --git a/scilab/modules/scicos_blocks/macros/Sources/CURVE_c.sci b/scilab/modules/scicos_blocks/macros/Sources/CURVE_c.sci index fe8fb1f..60b8ac2 100644 --- a/scilab/modules/scicos_blocks/macros/Sources/CURVE_c.sci +++ b/scilab/modules/scicos_blocks/macros/Sources/CURVE_c.sci @@ -54,6 +54,12 @@ function [x,y,typ]=CURVE_c(job,arg1,arg2) exprs(4)="n"; PO=0; end + if graf=="y" | graf=="Y" then + gui=1; + else + exprs(5)="n"; + gui=0; + end mtd=int(Method); if mtd<0 then @@ -83,7 +89,7 @@ function [x,y,typ]=CURVE_c(job,arg1,arg2) N= size(xy,"r"); exprs(5)="n";// exprs.graf='n' - if graf=="y" | graf=="Y" then //_______Graphic editor___________ + if gui then //_______Graphic editor___________ ipar=[N;mtd;PO]; rpar=[]; @@ -1207,7 +1213,11 @@ function [X,Y,orpar]=Do_Spline(N,order,x,y) Y = interp(X, x, y, d); orpar=d(:); catch - gcf().info_message = "ERROR in SPLINE: "+METHOD + if gui then + gcf().info_message = "ERROR in SPLINE: "+METHOD + else + messagebox(lasterror(), "ERROR in SPLINE: "+METHOD); + end end end @@ -1221,7 +1231,11 @@ function [X,Y,orpar]=Do_Spline(N,order,x,y) Y = interp(X, x, y, d); orpar=d(:); catch - gcf().info_message = "ERROR in SPLINE: " + METHOD + if gui then + gcf().info_message = "ERROR in SPLINE: "+METHOD + else + messagebox(lasterror(), "ERROR in SPLINE: "+METHOD); + end end end //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -1231,7 +1245,11 @@ function [X,Y,orpar]=Do_Spline(N,order,x,y) Y = interp(X, x, y, d); orpar=d(:); catch - gcf().info_message = "ERROR in SPLINE: " + METHOD + if gui then + gcf().info_message = "ERROR in SPLINE: "+METHOD + else + messagebox(lasterror(), "ERROR in SPLINE: "+METHOD); + end end end @@ -1242,7 +1260,11 @@ function [X,Y,orpar]=Do_Spline(N,order,x,y) Y = interp(X, x, y, d); orpar=d(:); catch - gcf().info_message = "ERROR in SPLINE: " + METHOD + if gui then + gcf().info_message = "ERROR in SPLINE: "+METHOD + else + messagebox(lasterror(), "ERROR in SPLINE: "+METHOD); + end end end //!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -1252,7 +1274,11 @@ function [X,Y,orpar]=Do_Spline(N,order,x,y) Y = interp(X, x, y, d); orpar=d(:); catch - gcf().info_message = "ERROR in SPLINE: " + METHOD + if gui then + gcf().info_message = "ERROR in SPLINE: "+METHOD + else + messagebox(lasterror(), "ERROR in SPLINE: "+METHOD); + end end end diff --git a/scilab/modules/scicos_blocks/macros/Sources/Sigbuilder.sci b/scilab/modules/scicos_blocks/macros/Sources/Sigbuilder.sci index cf930ca..8fd7110 100644 --- a/scilab/modules/scicos_blocks/macros/Sources/Sigbuilder.sci +++ b/scilab/modules/scicos_blocks/macros/Sources/Sigbuilder.sci @@ -103,6 +103,12 @@ function [x,y,typ] = Sigbuilder(job,arg1,arg2) end //parameter or states changed arg1(spath)=xxn// Update + label = xxn.graphics.exprs(3); + if grep(label, "/[a-zA-Z][a-zA-Z0-9_]*/", 'r') then + arg1.graphics.style = "Sigbuilder;displayedLabel="+label; + else + arg1.graphics.style = "Sigbuilder"; + end newpar(size(newpar)+1)=path// Notify modification y=max(y,needcompile) end -- 1.7.9.5