Xcos MVC: support old diagrams 56/18856/1
Paul Bignier [Fri, 6 Jan 2017 16:03:04 +0000 (17:03 +0100)]
 * Improves sciblk2.tst. Doesn't pass yet because of a new issue:
when a blocks parameter inside a superblock refers to a context value in the top diagram, the warning shows in NWNI or NW mode since 8d378092

Change-Id: I2a5e710f385e6ddca88ac3ba6175dafeb0b129cd

scilab/modules/scicos/src/cpp/view_scilab/ParamsAdapter.cpp

index 5661e0f..3bec757 100644 (file)
@@ -203,6 +203,11 @@ struct tol
         }
 
         types::Double* current = v->getAs<types::Double>();
+        if (current->isEmpty())
+        {
+            // Do nothing in this case to support old diagrams
+            return false;
+        }
         if (current->getSize() != 6 && current->getSize() != 7)
         {
             get_or_allocate_logger()->log(LOG_ERROR, _("Wrong dimension for field %s.%s: %d-by-%d expected.\n"), "params", "tol", 7, 1);