Xcos macros: replace unhandled 'doc' property with handled 'model.uid' 60/15960/3
Paul Bignier [Tue, 17 Feb 2015 09:02:54 +0000 (10:02 +0100)]
Change-Id: I218ecc5407d3b0b66835e6b54a08788086b629f3

scilab/modules/scicos/macros/scicos_scicos/c_pass2.sci
scilab/modules/scicos/macros/scicos_scicos/do_eval.sci
scilab/modules/scicos/macros/scicos_scicos/hilite_path.sci
scilab/modules/scicos/macros/scicos_scicos/setvalue.sci

index 04cf4f1..a48c2d9 100644 (file)
@@ -2050,8 +2050,8 @@ function id = getBlockIds(path)
     k = path(:);
     for i = k
         b = scs_m.objs(i);
-        if typeof(b) == "Block" &  size(scs_m.objs(i).doc) >= 1 then
-            id($ + 1) = scs_m.objs(i).doc(1);
+        if typeof(b) == "Block" &  length(scs_m.objs(i).model.uid) >= 1 then
+            id($ + 1) = scs_m.objs(i).model.uid;
         end
         if typeof(b.model.rpar) == "diagram" then
             scs_m = b.model.rpar;
index 3c53551..8135608 100644 (file)
@@ -41,8 +41,8 @@ function [scs_m,cpr,needcompile,ok]=do_eval(scs_m,cpr,%scicos_context)
     // This function is used to alert the user on setvalue
     // (invalid exprs we keep the previous parameters)
     function message(str)
-        if length(arg1.doc) >= 1 then
-            uid = arg1.doc(1);
+        if length(arg1.model.uid) >= 1 then
+            uid = arg1.model.uid;
             uid = [full_uids uid];
 
             html = "<html><body>";
@@ -105,8 +105,8 @@ function [scs_m,cpr,needcompile,ok]=do_eval(scs_m,cpr,%scicos_context)
                     xset("window",%now_win)
                 else
                     previous_full_uids = full_uids;
-                    if length(o.doc) >= 1 then
-                        full_uids = [full_uids o.doc(1)];
+                    if length(o.model.uid) >= 1 then
+                        full_uids = [full_uids o.model.uid];
                     end
                     [sblock,%w,needcompile2,ok]=do_eval(sblock,list(),scicos_context1)
                     needcompile1=max(needcompile1,needcompile2)
@@ -121,8 +121,8 @@ function [scs_m,cpr,needcompile,ok]=do_eval(scs_m,cpr,%scicos_context)
             else
                 model=o.model
                 if ~isdef(o.gui) | ~or(type(evstr(o.gui) == [13 11])) then
-                    if length(o.doc) >= 1 then
-                        uid = [full_uids o.doc(1)];
+                    if length(o.model.uid) >= 1 then
+                        uid = [full_uids o.model.uid];
 
                         html = "<html><body>";
                         html = html + "<em>" + gettext("Evaluation problem: Unknown block") + "</em><br/>";
index ab1320f..d52853e 100644 (file)
@@ -44,14 +44,14 @@ function hilite_path(path,mess,with_intermediates)
             o = diagram.objs(index);
 
             // masked superblock case
-            if isempty(o.doc) then
+            if isempty(o.model.uid) then
                 // we abort because blocks do not have uuid inside
                 // masked superblocks
                 break;
             end
 
             // normal case
-            uid($+1) = diagram.objs(index).doc(1) + "";
+            uid($+1) = diagram.objs(index).model.uid + "";
 
             if diagram.objs(index).model.sim == "super" then
                 diagram = diagram.objs(index).model.rpar;
index 742c1aa..594dfa9 100644 (file)
@@ -255,8 +255,8 @@ function [%ok,%1,%2,%3,%4,%5,...
         if %noooo>0 then
             str = gettext("%s: Wrong size for block parameter ''%s'': %s expected, getting %s");
             mess = msprintf(str, arg1.gui + "(''set'')", %lables(%noooo), %ssss, %ini(%noooo));
-            if length(arg1.doc) > 0 then
-                warnBlockByUID(arg1.doc(1), mess); // arg1 is from the block interface function
+            if length(arg1.model.uid) > 0 then
+                warnBlockByUID(arg1.model.uid, mess); // arg1 is from the block interface function
             else
                 disp(mess);
             end
@@ -265,8 +265,8 @@ function [%ok,%1,%2,%3,%4,%5,...
         elseif %noooo<0 then
             str = gettext("%s: Wrong type for block parameter ''%s'': %s(%s) expected, getting %s");
             mess = msprintf(str, arg1.gui + "(''set'')", %lables(-%noooo), %typ(-2*%noooo-1), strcat(string(%typ(-2*%noooo))," by "), %ini(-%noooo));
-            if length(arg1.doc) > 0 then
-                warnBlockByUID(arg1.doc(1), mess); // arg1 is from the block interface function
+            if length(arg1.model.uid) > 0 then
+                warnBlockByUID(arg1.model.uid, mess); // arg1 is from the block interface function
             else
                 disp(mess);
             end