* [#15185](http://bugzilla.scilab.org/show_bug.cgi?id=15185): "Region to Superblock" did not restore broken links.
* [#15188](http://bugzilla.scilab.org/show_bug.cgi?id=15188): Failed to load hdf5_is_file function.
* [#15205](http://bugzilla.scilab.org/show_bug.cgi?id=15205): `get_scicos_version` returned the previous version.
+* [#15207](http://bugzilla.scilab.org/show_bug.cgi?id=15207): `xcos(scs_m)` did not work for sub-systems.
### Bugs fixed in 6.0.0:
* [#592](http://bugzilla.scilab.org/show_bug.cgi?id=592): `linspace(a, b, n<=0)` returned `b` instead of `[]`
if (in.size() == 1 && in[0]->isUserType())
{
const model::BaseObject* o = view_scilab::Adapters::instance().descriptor(in[0]);
- if (o == nullptr || o->kind() != DIAGRAM)
+ if (o == nullptr)
+ {
+ Scierror(77, _("%s: Wrong type for input argument #%d: ""%s"" expected.\n"), funname, 1, "diagram");
+ return types::Function::Error;
+ }
+ if (o->kind() != DIAGRAM && o->kind() != BLOCK)
{
Scierror(77, _("%s: Wrong type for input argument #%d: ""%s"" expected.\n"), funname, 1, "diagram");
return types::Function::Error;
/*
* Allocate and setup a new diagram
*/
- diag = new XcosDiagram(controller, currentId, Kind.DIAGRAM, "");
+ diag = new XcosDiagram(controller, currentId, controller.getKind(currentId), "");
diag.installListeners();
- root = new ScicosObjectOwner(controller, diag.getUID(), Kind.DIAGRAM);
+ root = findRoot(controller, diag);
addDiagram(root, diag);
/*
// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
// Copyright (C) 2009 - DIGITEO
// Copyright (C) 2012 - Scilab Enterprises - Clement DAVID
+// Copyright (C) 2017 - ESI Group - Clement DAVID
//
// This file is distributed under the same license as the Scilab package.
// ============================================================================
-// <-- TEST WITH GRAPHIC -->
-// <-- NOT FIXED -->
-
-// libs are not loaded at startup
-if isdef("BIGSOM_f") then pause, end
+// <-- TEST WITH XCOS -->
+// <-- INTERACTIVE TEST -->
// we launch xcos then libs should be loaded
xcos();
-sleep(500);
-if ~isdef("BIGSOM_f") then pause, end
// we launch xcos with an xcos demo file
xcos(SCI + "/modules/xcos/demos/Simple_Demo.zcos");
-sleep(500);
// we launch xcos with an xcos demo file with full path resolution
xcos("SCI/modules/xcos/demos/Simple_Demo.zcos");
-sleep(500);
// we launch xcos with cosf file
xcos(SCI + "/modules/scicos/palettes/Branching.cosf");
-sleep(500);
// we launch xcos with a scs_m instance
scs_m = scicos_diagram();
scs_m.objs($+1) = BIGSOM_f("define");
xcos(scs_m);
-sleep(500);
+
+// we launch xcos with a full scs_m
+importXcosDiagram(SCI+"/modules/xcos/demos/Discrete-KalmanFilter.zcos");
+xcos(scs_m);
+
+// we launch xcos with a scs_m subsystem
+assert_checkequal(typeof(scs_m.objs(1).model.rpar), "diagram");
+xcos(scs_m.objs(1).model.rpar);