* Bug #14586 - Xcos simulation stop button did not work. 50/18250/4
Clément DAVID [Tue, 14 Jun 2016 14:34:52 +0000 (16:34 +0200)]
Change-Id: I4965b683f23dd6f522c727b51f270701c4ff22a2

29 files changed:
scilab/CHANGES.md
scilab/modules/scicos/Makefile.am
scilab/modules/scicos/Makefile.in
scilab/modules/scicos/includes/Controller.hxx
scilab/modules/scicos/includes/gw_scicos.hxx
scilab/modules/scicos/locales/scicos.pot
scilab/modules/scicos/macros/scicos_scicos/haltscicos.sci [deleted file]
scilab/modules/scicos/sci_gateway/cpp/sci_haltscicos.cpp [deleted file]
scilab/modules/scicos/sci_gateway/scicos_gateway.xml
scilab/modules/scicos/src/c/cli/scicos-cli.vcxproj
scilab/modules/scicos/src/c/cli/scicos-cli.vcxproj.filters
scilab/modules/scicos/src/c/noscicos/noscicos.h
scilab/modules/scicos/src/c/scicos.vcxproj
scilab/modules/scicos/src/c/scicos.vcxproj.filters
scilab/modules/scicos/src/cpp/Controller.cpp
scilab/modules/scicos/src/cpp/view_scilab/ports_management.hxx
scilab/modules/scicos/tests/unit_tests/sci_haltscicos.dia.ref [deleted file]
scilab/modules/scicos/tests/unit_tests/sci_haltscicos.tst [deleted file]
scilab/modules/xcos/Makefile.am
scilab/modules/xcos/Makefile.in
scilab/modules/xcos/macros/xcos_run.sci
scilab/modules/xcos/src/java/org/scilab/modules/xcos/Controller.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/JavaControllerJNI.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/Xcos.java
scilab/modules/xcos/src/java/org/scilab/modules/xcos/actions/StopAction.java
scilab/modules/xcos/src/jni/JavaController.i
scilab/modules/xcos/src/jni/JavaController_wrap.cxx
scilab/modules/xcos/tests/nonreg_tests/bug_6797.dia.ref
scilab/modules/xcos/tests/nonreg_tests/bug_6797.tst

index 06b80d9..d6779c5 100644 (file)
@@ -225,9 +225,9 @@ Bug Fixes
 * [Bug #13597](http://bugzilla.scilab.org/show_bug.cgi?id=13597) fixed - `help format` claimed setting a number of digits instead of characters
 * [Bug #14192](http://bugzilla.scilab.org/show_bug.cgi?id=14192) fixed - `g_margin` error-ed for double integrator.
 * [Bug #14557](http://bugzilla.scilab.org/show_bug.cgi?id=14557) fixed - csim failed when the system has no state.
+* [Bug #14586](http://bugzilla.scilab.org/show_bug.cgi?id=14586) fixed - Xcos simulation stop button did not work.
 * [Bug #14587](http://bugzilla.scilab.org/show_bug.cgi?id=14587) fixed - Datatip textbox wrong clipping when loaded from *.scg file.
 * [Bug #14557](http://bugzilla.scilab.org/show_bug.cgi?id=14557) fixed - csim failed when the system has no state.
 
 ### In 6.0.0 beta-2 and earlier:
 
index 46ece51..3055584 100644 (file)
@@ -82,7 +82,6 @@ sci_gateway/cpp/sci_duplicate.cpp \
 sci_gateway/cpp/sci_end_scicosim.cpp \
 sci_gateway/cpp/sci_getblocklabel.cpp \
 sci_gateway/cpp/sci_getscicosvars.cpp \
-sci_gateway/cpp/sci_haltscicos.cpp \
 sci_gateway/cpp/sci_phase_simulation.cpp \
 sci_gateway/cpp/sci_pointer_xproperty.cpp \
 sci_gateway/cpp/sci_scicos_new.cpp \
index 8748418..bb39dd0 100644 (file)
@@ -312,7 +312,6 @@ am__libsciscicos_cli_la_SOURCES_DIST =  \
        sci_gateway/cpp/sci_end_scicosim.cpp \
        sci_gateway/cpp/sci_getblocklabel.cpp \
        sci_gateway/cpp/sci_getscicosvars.cpp \
-       sci_gateway/cpp/sci_haltscicos.cpp \
        sci_gateway/cpp/sci_phase_simulation.cpp \
        sci_gateway/cpp/sci_pointer_xproperty.cpp \
        sci_gateway/cpp/sci_scicos_new.cpp \
@@ -348,7 +347,6 @@ am__objects_5 =  \
        sci_gateway/cpp/libsciscicos_cli_la-sci_end_scicosim.lo \
        sci_gateway/cpp/libsciscicos_cli_la-sci_getblocklabel.lo \
        sci_gateway/cpp/libsciscicos_cli_la-sci_getscicosvars.lo \
-       sci_gateway/cpp/libsciscicos_cli_la-sci_haltscicos.lo \
        sci_gateway/cpp/libsciscicos_cli_la-sci_phase_simulation.lo \
        sci_gateway/cpp/libsciscicos_cli_la-sci_pointer_xproperty.lo \
        sci_gateway/cpp/libsciscicos_cli_la-sci_scicos_new.lo \
@@ -396,7 +394,6 @@ am__libsciscicos_la_SOURCES_DIST =  \
        sci_gateway/cpp/sci_end_scicosim.cpp \
        sci_gateway/cpp/sci_getblocklabel.cpp \
        sci_gateway/cpp/sci_getscicosvars.cpp \
-       sci_gateway/cpp/sci_haltscicos.cpp \
        sci_gateway/cpp/sci_phase_simulation.cpp \
        sci_gateway/cpp/sci_pointer_xproperty.cpp \
        sci_gateway/cpp/sci_scicos_new.cpp \
@@ -431,7 +428,6 @@ am__objects_8 = sci_gateway/cpp/libsciscicos_la-sci_scicos_debug.lo \
        sci_gateway/cpp/libsciscicos_la-sci_end_scicosim.lo \
        sci_gateway/cpp/libsciscicos_la-sci_getblocklabel.lo \
        sci_gateway/cpp/libsciscicos_la-sci_getscicosvars.lo \
-       sci_gateway/cpp/libsciscicos_la-sci_haltscicos.lo \
        sci_gateway/cpp/libsciscicos_la-sci_phase_simulation.lo \
        sci_gateway/cpp/libsciscicos_la-sci_pointer_xproperty.lo \
        sci_gateway/cpp/libsciscicos_la-sci_scicos_new.lo \
@@ -1010,7 +1006,6 @@ sci_gateway/cpp/sci_duplicate.cpp \
 sci_gateway/cpp/sci_end_scicosim.cpp \
 sci_gateway/cpp/sci_getblocklabel.cpp \
 sci_gateway/cpp/sci_getscicosvars.cpp \
-sci_gateway/cpp/sci_haltscicos.cpp \
 sci_gateway/cpp/sci_phase_simulation.cpp \
 sci_gateway/cpp/sci_pointer_xproperty.cpp \
 sci_gateway/cpp/sci_scicos_new.cpp \
@@ -1625,9 +1620,6 @@ sci_gateway/cpp/libsciscicos_cli_la-sci_getblocklabel.lo:  \
 sci_gateway/cpp/libsciscicos_cli_la-sci_getscicosvars.lo:  \
        sci_gateway/cpp/$(am__dirstamp) \
        sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
-sci_gateway/cpp/libsciscicos_cli_la-sci_haltscicos.lo:  \
-       sci_gateway/cpp/$(am__dirstamp) \
-       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
 sci_gateway/cpp/libsciscicos_cli_la-sci_phase_simulation.lo:  \
        sci_gateway/cpp/$(am__dirstamp) \
        sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
@@ -1754,9 +1746,6 @@ sci_gateway/cpp/libsciscicos_la-sci_getblocklabel.lo:  \
 sci_gateway/cpp/libsciscicos_la-sci_getscicosvars.lo:  \
        sci_gateway/cpp/$(am__dirstamp) \
        sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
-sci_gateway/cpp/libsciscicos_la-sci_haltscicos.lo:  \
-       sci_gateway/cpp/$(am__dirstamp) \
-       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
 sci_gateway/cpp/libsciscicos_la-sci_phase_simulation.lo:  \
        sci_gateway/cpp/$(am__dirstamp) \
        sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
@@ -2036,7 +2025,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_end_scicosim.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_getblocklabel.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_getscicosvars.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_haltscicos.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_model2blk.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_phase_simulation.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_pointer_xproperty.Plo@am__quote@
@@ -2066,7 +2054,6 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_end_scicosim.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_getblocklabel.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_getscicosvars.Plo@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_haltscicos.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_model2blk.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_phase_simulation.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_pointer_xproperty.Plo@am__quote@
@@ -2755,13 +2742,6 @@ sci_gateway/cpp/libsciscicos_cli_la-sci_getscicosvars.lo: sci_gateway/cpp/sci_ge
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciscicos_cli_la-sci_getscicosvars.lo `test -f 'sci_gateway/cpp/sci_getscicosvars.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_getscicosvars.cpp
 
-sci_gateway/cpp/libsciscicos_cli_la-sci_haltscicos.lo: sci_gateway/cpp/sci_haltscicos.cpp
-@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciscicos_cli_la-sci_haltscicos.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_haltscicos.Tpo -c -o sci_gateway/cpp/libsciscicos_cli_la-sci_haltscicos.lo `test -f 'sci_gateway/cpp/sci_haltscicos.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_haltscicos.cpp
-@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_haltscicos.Tpo sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_haltscicos.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/sci_haltscicos.cpp' object='sci_gateway/cpp/libsciscicos_cli_la-sci_haltscicos.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciscicos_cli_la-sci_haltscicos.lo `test -f 'sci_gateway/cpp/sci_haltscicos.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_haltscicos.cpp
-
 sci_gateway/cpp/libsciscicos_cli_la-sci_phase_simulation.lo: sci_gateway/cpp/sci_phase_simulation.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_cli_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciscicos_cli_la-sci_phase_simulation.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_phase_simulation.Tpo -c -o sci_gateway/cpp/libsciscicos_cli_la-sci_phase_simulation.lo `test -f 'sci_gateway/cpp/sci_phase_simulation.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_phase_simulation.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_phase_simulation.Tpo sci_gateway/cpp/$(DEPDIR)/libsciscicos_cli_la-sci_phase_simulation.Plo
@@ -2965,13 +2945,6 @@ sci_gateway/cpp/libsciscicos_la-sci_getscicosvars.lo: sci_gateway/cpp/sci_getsci
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciscicos_la-sci_getscicosvars.lo `test -f 'sci_gateway/cpp/sci_getscicosvars.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_getscicosvars.cpp
 
-sci_gateway/cpp/libsciscicos_la-sci_haltscicos.lo: sci_gateway/cpp/sci_haltscicos.cpp
-@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciscicos_la-sci_haltscicos.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_haltscicos.Tpo -c -o sci_gateway/cpp/libsciscicos_la-sci_haltscicos.lo `test -f 'sci_gateway/cpp/sci_haltscicos.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_haltscicos.cpp
-@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_haltscicos.Tpo sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_haltscicos.Plo
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/sci_haltscicos.cpp' object='sci_gateway/cpp/libsciscicos_la-sci_haltscicos.lo' libtool=yes @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libsciscicos_la-sci_haltscicos.lo `test -f 'sci_gateway/cpp/sci_haltscicos.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_haltscicos.cpp
-
 sci_gateway/cpp/libsciscicos_la-sci_phase_simulation.lo: sci_gateway/cpp/sci_phase_simulation.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libsciscicos_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libsciscicos_la-sci_phase_simulation.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_phase_simulation.Tpo -c -o sci_gateway/cpp/libsciscicos_la-sci_phase_simulation.lo `test -f 'sci_gateway/cpp/sci_phase_simulation.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_phase_simulation.cpp
 @am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_phase_simulation.Tpo sci_gateway/cpp/$(DEPDIR)/libsciscicos_la-sci_phase_simulation.Plo
index ee80e65..9e4c434 100644 (file)
@@ -44,6 +44,8 @@ public:
     static View* unregister_view(const std::string& name);
     static View* look_for_view(const std::string& name);
 
+    static void end_simulation();
+
     Controller();
     ~Controller();
 
index 6a3829a..fe4b818 100644 (file)
@@ -31,7 +31,6 @@ CPP_GATEWAY_PROTOTYPE_EXPORT(sci_duplicate, SCICOS_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_end_scicosim, SCICOS_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_getblocklabel, SCICOS_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_getscicosvars, SCICOS_IMPEXP);
-CPP_GATEWAY_PROTOTYPE_EXPORT(sci_haltscicos, SCICOS_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_phase_simulation, SCICOS_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_pointer_xproperty, SCICOS_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_scicos_debug, SCICOS_IMPEXP);
index c4dd041..85c31c0 100644 (file)
@@ -188,7 +188,6 @@ msgstr ""
 
 #
 # File: modules/scicos/sci_gateway/cpp/sci_curblock.cpp, line: 50
-# File: modules/scicos/sci_gateway/cpp/sci_haltscicos.cpp, line: 48
 # File: modules/scicos/sci_gateway/cpp/sci_phase_simulation.cpp, line: 57
 # File: modules/scicos/sci_gateway/cpp/sci_scicos_debug.cpp, line: 56
 # File: modules/scicos/sci_gateway/cpp/sci_scicos_debug_count.cpp, line: 55
diff --git a/scilab/modules/scicos/macros/scicos_scicos/haltscicos.sci b/scilab/modules/scicos/macros/scicos_scicos/haltscicos.sci
deleted file mode 100644 (file)
index b4c082a..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-//  Scicos
-//
-//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>
-//
-// This program is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2 of the License, or
-// (at your option) any later version.
-//
-// This program is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-// GNU General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program; if not, write to the Free Software
-// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-//
-// See the file ../license.txt
-//
-
-function haltscicos(menus, win_id)
-    //** This is just a *CLEVER* function used for the "halt" button that
-    //** stop the Scicos simulation
-    sleep(1); //** DO NOT REMOVE IT
-    sci_haltscicos();
-endfunction
diff --git a/scilab/modules/scicos/sci_gateway/cpp/sci_haltscicos.cpp b/scilab/modules/scicos/sci_gateway/cpp/sci_haltscicos.cpp
deleted file mode 100644 (file)
index 6a59221..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- *  Copyright (C) 2015 - Scilab Enterprises - Paul Bignier
- *
- * Copyright (C) 2012 - 2016 - Scilab Enterprises
- *
- * This file is hereby licensed under the terms of the GNU GPL v2.0,
- * pursuant to article 5.3.4 of the CeCILL v.2.1.
- * This file was originally licensed under the terms of the CeCILL v2.1,
- * and continues to be available under such terms.
- * For more information, see the COPYING file which you should have received
- * along with this program.
- *
- */
-
-#include <string>
-
-#include "gw_scicos.hxx"
-
-#include "types.hxx"
-#include "function.hxx"
-
-extern "C"
-{
-#include "machine.h" /* C2F */
-#include "scicos-def.h"
-
-#include "localization.h"
-#include "Scierror.h"
-    /*--------------------------------------------------------------------------*/
-    // Variable defined in scicos.c
-    extern COSHLT_struct C2F(coshlt);
-    /*--------------------------------------------------------------------------*/
-}
-
-static const std::string funname = "sci_haltscicos";
-
-types::Function::ReturnValue sci_haltscicos(types::typed_list &in, int _iRetCount, types::typed_list &/*out*/)
-{
-    if (in.size() != 0)
-    {
-        Scierror(999, _("%s: Wrong number of input arguments: %d expected.\n"), funname.c_str(), 0);
-        return types::Function::Error;
-    }
-
-    if (_iRetCount != 1)
-    {
-        Scierror(999, _("%s: Wrong number of output arguments: %d expected.\n"), funname.c_str(), 1);
-        return types::Function::Error;
-    }
-
-    // MAGIC VALUE: 0 is used to continue the simulation
-    // MAGIC VALUE: 1 is used to halt the simulator
-    // MAGIC VALUE: 2 is used to switch to the final time
-    //                        then halt the simulator
-    C2F(coshlt).halt = 2;
-
-    return types::Function::OK;
-}
index 73bc2d8..5148ba9 100644 (file)
@@ -41,7 +41,6 @@
     <gateway type="1" name="sci_end_scicosim" function="end_scicosim"/>
     <gateway type="1" name="sci_getblocklabel" function="getblocklabel"/>
     <gateway type="1" name="sci_getscicosvars" function="getscicosvars"/>
-    <gateway type="1" name="sci_haltscicos" function="sci_haltscicos"/>
     <gateway type="1" name="sci_phase_simulation" function="phase_simulation"/>
     <gateway type="1" name="sci_pointer_xproperty" function="pointer_xproperty"/>
     <gateway type="1" name="sci_scicos_debug" function="scicos_debug"/>
index 284b7b9..45b9f8e 100644 (file)
@@ -243,7 +243,6 @@ lib /DEF:"$(ProjectDir)../differential_equations_f_Import.def" /SUBSYSTEM:WINDOW
     <ClCompile Include="..\..\..\sci_gateway\cpp\sci_end_scicosim.cpp" />
     <ClCompile Include="..\..\..\sci_gateway\cpp\sci_getblocklabel.cpp" />
     <ClCompile Include="..\..\..\sci_gateway\cpp\sci_getscicosvars.cpp" />
-    <ClCompile Include="..\..\..\sci_gateway\cpp\sci_haltscicos.cpp" />
     <ClCompile Include="..\..\..\sci_gateway\cpp\sci_scicosim.cpp" />
     <ClCompile Include="..\..\..\sci_gateway\cpp\sci_phase_simulation.cpp" />
     <ClCompile Include="..\..\..\sci_gateway\cpp\sci_pointer_xproperty.cpp" />
@@ -412,4 +411,4 @@ lib /DEF:"$(ProjectDir)../differential_equations_f_Import.def" /SUBSYSTEM:WINDOW
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
index 2b579cd..2cf66e7 100644 (file)
     <ClCompile Include="..\..\..\sci_gateway\cpp\sci_getscicosvars.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\..\sci_gateway\cpp\sci_haltscicos.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\..\sci_gateway\cpp\sci_phase_simulation.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
       <Filter>Resource Files</Filter>
     </ResourceCompile>
   </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
index 90b6e2f..3da3ea6 100644 (file)
@@ -7,7 +7,6 @@
 
 
 int gw_scicos(void);
-int haltscicos(char *name, int *win, int *entry, long int name_len);
 
 #endif
 /*--------------------------------------------------------------------------*/
index c9c538a..ea2884b 100644 (file)
@@ -247,7 +247,6 @@ lib /DEF:"$(ProjectDir)Scicos_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platfo
     <ClCompile Include="..\..\sci_gateway\cpp\sci_curblock.cpp" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_getblocklabel.cpp" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_getscicosvars.cpp" />
-    <ClCompile Include="..\..\sci_gateway\cpp\sci_haltscicos.cpp" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_phase_simulation.cpp" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_pointer_xproperty.cpp" />
     <ClCompile Include="..\..\sci_gateway\cpp\sci_scicosim.cpp" />
@@ -422,4 +421,4 @@ lib /DEF:"$(ProjectDir)Scicos_f_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platfo
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
   <ImportGroup Label="ExtensionTargets">
   </ImportGroup>
-</Project>
\ No newline at end of file
+</Project>
index 5ce1c44..eddd8f2 100644 (file)
     <ClCompile Include="..\..\sci_gateway\cpp\sci_getscicosvars.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
-    <ClCompile Include="..\..\sci_gateway\cpp\sci_haltscicos.cpp">
-      <Filter>Source Files</Filter>
-    </ClCompile>
     <ClCompile Include="..\..\sci_gateway\cpp\sci_pointer_xproperty.cpp">
       <Filter>Source Files</Filter>
     </ClCompile>
       <Filter>Resource Files</Filter>
     </ResourceCompile>
   </ItemGroup>
-</Project>
\ No newline at end of file
+</Project>
index 354d7f5..452315c 100644 (file)
 
 #include "LoggerView.hxx"
 
+extern "C" {
+#include "scicos.h"
+}
+
 namespace org_scilab_modules_scicos
 {
 
@@ -153,6 +157,11 @@ View* Controller::look_for_view(const std::string& name)
     return view;
 }
 
+void Controller::end_simulation()
+{
+    end_scicos_sim();
+}
+
 Controller::Controller()
 {
 }
index c23891d..372b7bf 100644 (file)
@@ -327,15 +327,15 @@ bool set_ports_property(const Adaptor& adaptor, const object_properties_t port_k
                     return false;
                 }
 
-                std::wstring E = L"E";
-                std::wstring I = L"I";
+                std::wstring Explicit = L"E";
+                std::wstring Implicit = L"I";
                 for (std::vector<ScicosID>::iterator it = ids.begin(); it != ids.end(); ++it, ++i)
                 {
-                    if (current->get(i) == I)
+                    if (current->get(i) == Implicit)
                     {
                         controller.setObjectProperty(*it, PORT, p, true);
                     }
-                    else if (current->get(i) == E)
+                    else if (current->get(i) == Explicit)
                     {
                         controller.setObjectProperty(*it, PORT, p, false);
                     }
diff --git a/scilab/modules/scicos/tests/unit_tests/sci_haltscicos.dia.ref b/scilab/modules/scicos/tests/unit_tests/sci_haltscicos.dia.ref
deleted file mode 100644 (file)
index 331e5d4..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2015 - Scilab Enterprises - Paul Bignier
-// Copyright (C) ????-2008 - INRIA
-//
-//  This file is distributed under the same license as the Scilab package.
-// =============================================================================
-//
-// <-- CLI SHELL MODE -->
-// sci_haltscicos runs internally, without input or output.
-sci_haltscicos();
diff --git a/scilab/modules/scicos/tests/unit_tests/sci_haltscicos.tst b/scilab/modules/scicos/tests/unit_tests/sci_haltscicos.tst
deleted file mode 100644 (file)
index 066b90f..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-// =============================================================================
-// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
-// Copyright (C) 2015 - Scilab Enterprises - Paul Bignier
-// Copyright (C) ????-2008 - INRIA
-//
-//  This file is distributed under the same license as the Scilab package.
-// =============================================================================
-//
-// <-- CLI SHELL MODE -->
-
-// sci_haltscicos runs internally, without input or output.
-sci_haltscicos();
index 562842c..c27cfc2 100644 (file)
@@ -96,6 +96,8 @@ libscixcos_la_CPPFLAGS = \
     -I$(srcdir)/src/cpp/ \
     -I$(srcdir)/src/c/ \
     -I$(top_srcdir)/modules/scicos/includes/ \
+    -I$(top_srcdir)/modules/scicos_blocks/includes/ \
+    -I$(top_srcdir)/modules/scicos_blocks/src/jni/ \
     -I$(top_srcdir)/modules/dynamic_link/includes/ \
     -I$(top_srcdir)/modules/string/includes/ \
     -I$(top_srcdir)/modules/ast/includes/ast/ \
@@ -113,7 +115,6 @@ libscixcos_la_CPPFLAGS = \
     -I$(top_srcdir)/modules/commons/src/jni/ \
     -I$(top_srcdir)/modules/localization/includes/ \
     -I$(top_srcdir)/modules/fileio/includes/ \
-    -I$(top_srcdir)/modules/scicos_blocks/src/jni/ \
     -I$(top_srcdir)/modules/api_scilab/includes/ \
     $(JAVA_JNI_INCLUDE) \
     $(AM_CPPFLAGS)
index 066d50b..dc51598 100644 (file)
@@ -681,6 +681,8 @@ libscixcos_la_CPPFLAGS = \
     -I$(srcdir)/src/cpp/ \
     -I$(srcdir)/src/c/ \
     -I$(top_srcdir)/modules/scicos/includes/ \
+    -I$(top_srcdir)/modules/scicos_blocks/includes/ \
+    -I$(top_srcdir)/modules/scicos_blocks/src/jni/ \
     -I$(top_srcdir)/modules/dynamic_link/includes/ \
     -I$(top_srcdir)/modules/string/includes/ \
     -I$(top_srcdir)/modules/ast/includes/ast/ \
@@ -698,7 +700,6 @@ libscixcos_la_CPPFLAGS = \
     -I$(top_srcdir)/modules/commons/src/jni/ \
     -I$(top_srcdir)/modules/localization/includes/ \
     -I$(top_srcdir)/modules/fileio/includes/ \
-    -I$(top_srcdir)/modules/scicos_blocks/src/jni/ \
     -I$(top_srcdir)/modules/api_scilab/includes/ \
     $(JAVA_JNI_INCLUDE) \
     $(AM_CPPFLAGS)
index eaafce8..091c0d0 100644 (file)
 //
 function xcos_run(xcosFile)
 
-    // Check that the Scicos libs are loaded
-    if isdef("haltscicos") <> %t then
-        error(msprintf(gettext("The Scicos libraries are not loaded")));
-        return;
-    end
-
     // import the file
     result = importXcosDiagram(xcosFile);
     if result <> %t then
index fbf70fd..7b6b6a7 100644 (file)
@@ -40,6 +40,10 @@ public class Controller {
     return (cPtr == 0) ? null : new View(cPtr, false);
   }
 
+  public static void end_simulation() {
+    JavaControllerJNI.Controller_end_simulation();
+  }
+
   public Controller() {
     this(JavaControllerJNI.new_Controller(), true);
   }
index 5c1de18..bd79760 100644 (file)
@@ -19,6 +19,7 @@ public class JavaControllerJNI {
   public final static native void View_director_connect(View obj, long cptr, boolean mem_own, boolean weak_global);
   public final static native void View_change_ownership(View obj, long cptr, boolean take_or_release);
   public final static native long Controller_look_for_view(String jarg1);
+  public final static native void Controller_end_simulation();
   public final static native long new_Controller();
   public final static native void delete_Controller(long jarg1);
   public final static native long Controller_createObject(long jarg1, Controller jarg1_, int jarg2);
index 4a6e136..3e2ae66 100644 (file)
@@ -727,8 +727,7 @@ public final class Xcos {
         }
 
         if (openedDiagrams().size() <= 0) {
-            /* halt scicos (stop the simulation) */
-            InterpreterManagement.requestScilabExec("if isdef('haltscicos'), haltscicos(), end;");
+            JavaController.end_simulation();
         }
     }
 
@@ -823,7 +822,7 @@ public final class Xcos {
             instance.diagrams.keySet().clear();
 
             /* terminate any remaining simulation */
-            InterpreterManagement.putCommandInScilabQueue("if isdef('haltscicos'), haltscicos(), end;");
+            JavaController.end_simulation();
 
             /* Saving modified data */
             instance.palette.saveConfig();
index 093b42a..8ce954e 100644 (file)
@@ -22,12 +22,12 @@ import java.awt.event.ActionEvent;
 
 import javax.swing.JButton;
 
-import org.scilab.modules.action_binding.highlevel.ScilabInterpreterManagement;
 import org.scilab.modules.graph.ScilabComponent;
 import org.scilab.modules.graph.ScilabGraph;
 import org.scilab.modules.graph.actions.base.DefaultAction;
 import org.scilab.modules.graph.actions.base.GraphActionManager;
 import org.scilab.modules.gui.menuitem.MenuItem;
+import org.scilab.modules.xcos.JavaController;
 import org.scilab.modules.xcos.graph.XcosDiagram;
 import org.scilab.modules.xcos.utils.XcosMessages;
 
@@ -90,7 +90,7 @@ public final class StopAction extends DefaultAction {
         }
 
         if (!GraphActionManager.getEnable(StartAction.class)) {
-            ScilabInterpreterManagement.requestScilabExec("haltscicos");
+            JavaController.end_simulation();
 
             graph.info(XcosMessages.EMPTY_INFO);
             GraphActionManager.setEnable(StartAction.class, true);
index 6d24c3f..7be3c80 100644 (file)
@@ -29,6 +29,8 @@
 #include "utilities.hxx"
 #include "View.hxx"
 #include "Controller.hxx"
+
+#include "scicos.h"
 %}
 
 %include <enums.swg>
index 0552529..97529c4 100644 (file)
@@ -668,6 +668,8 @@ namespace Swig {
 #include "View.hxx"
 #include "Controller.hxx"
 
+#include "scicos.h"
+
 
 #include <stdexcept>
 
@@ -1288,6 +1290,13 @@ SWIGEXPORT jlong JNICALL Java_org_scilab_modules_xcos_JavaControllerJNI_Controll
 }
 
 
+SWIGEXPORT void JNICALL Java_org_scilab_modules_xcos_JavaControllerJNI_Controller_1end_1simulation(JNIEnv *jenv, jclass jcls) {
+  (void)jenv;
+  (void)jcls;
+  org_scilab_modules_scicos::Controller::end_simulation();
+}
+
+
 SWIGEXPORT jlong JNICALL Java_org_scilab_modules_xcos_JavaControllerJNI_new_1Controller(JNIEnv *jenv, jclass jcls) {
   jlong jresult = 0 ;
   org_scilab_modules_scicos::Controller *result = 0 ;
index bfdcba5..9513339 100644 (file)
@@ -14,7 +14,7 @@
 // The call of importXcosDiagram must not load scicos libs.
 // Are scicos libs loaded ?
 function result = isScicosLibLoaded()
-       result = isdef('haltscicos');
+       result = isdef('scicosim');
 endfunction
 // Check that the simulation libraries are not loaded at startup
 if isScicosLibLoaded() <> %f then bugmes();quit;end
index 87dd734..a41121b 100644 (file)
@@ -17,7 +17,7 @@
 
 // Are scicos libs loaded ?
 function result = isScicosLibLoaded()
-       result = isdef('haltscicos');
+    result = isdef("scicosim");
 endfunction
 
 // Check that the simulation libraries are not loaded at startup