Merge remote-tracking branch 'origin/6.0' 72/19572/2
Antoine ELIAS [Sun, 3 Dec 2017 17:23:52 +0000 (18:23 +0100)]
Change-Id: Iab2ffc4250a97ef45d7ca156b6d127d4c2c89442

16 files changed:
1  2 
scilab/bin/scilab
scilab/configure
scilab/modules/ast/ast.vcxproj
scilab/modules/ast/src/cpp/ast/visitor_common.cpp
scilab/modules/core/help/en_US/1_keywords/brackets.xml
scilab/modules/fileio/src/cpp/mgetl.cpp
scilab/modules/helptools/data/configuration/scilab_macros.txt
scilab/modules/scicos/macros/scicos_scicos/c_pass2.sci
scilab/modules/scicos/macros/scicos_scicos/create_modelica.sci
scilab/modules/scicos/sci_gateway/cpp/sci_scicos_log.cpp
scilab/modules/scicos/src/cpp/view_scilab/BaseAdapter.hxx
scilab/modules/scicos/src/cpp/view_scilab/GraphicsAdapter.cpp
scilab/modules/scicos/src/cpp/view_scilab/ModelAdapter.cpp
scilab/modules/scicos/src/cpp/view_scilab/ParamsAdapter.cpp
scilab/modules/slint/src/cpp/DeprecatedChecker.cpp
scilab/modules/string/src/c/strsubst.c

Simple merge
Simple merge
Simple merge
@@@ -78,46 -77,6 +78,46 @@@ types::Function::ReturnValue sci_scicos
          return types::Function::Error;
      }
  
 +    /*
 +     * specific usages :
 +     */
 +
 +    // "refCounters" will return reference counters per object, per kind
 +    if (std::wstring(L"refCounters") == strLevel->get(0))
 +    {
 +        Controller controller;
 +
 +        std::vector<ScicosID> objects;
 +        std::vector<ScicosID> tmp;
 +
 +        tmp = controller.getAll(BLOCK);
 +        objects.insert(objects.end(), tmp.begin(), tmp.end());
 +        tmp = controller.getAll(DIAGRAM);
 +        objects.insert(objects.end(), tmp.begin(), tmp.end());
 +        tmp = controller.getAll(LINK);
 +        objects.insert(objects.end(), tmp.begin(), tmp.end());
 +        tmp = controller.getAll(ANNOTATION);
 +        objects.insert(objects.end(), tmp.begin(), tmp.end());
 +
 +        types::Double* refCounts = new types::Double((int) objects.size(), 3);
 +
 +        for (int i = 0; i < objects.size(); ++i)
 +        {
-             model::BaseObject* o = controller.getObject(objects[i]);
++            model::BaseObject* o = controller.getBaseObject(objects[i]);
 +
 +            refCounts->set(i, 0, o->id());
 +            refCounts->set(i, 1, o->kind());
 +            refCounts->set(i, 2, o->refCount());
 +        }
 +
 +        out.push_back(refCounts);
 +        return types::Function::OK;
 +    }
 +
 +    /*
 +     * default usage: log level setting
 +     */
 +
      enum LogLevel logLevel = LoggerView::indexOf(strLevel->get(0));
      if (logLevel < 0)
      {
@@@ -65,29 -68,13 +68,33 @@@ public
      typedef std::vector< property<Adaptor> > props_t;
      typedef typename props_t::iterator props_t_it;
  
+     /*
+      * Static properties accessors
+      */
+     static props_t fields;
  
      property(const std::wstring& prop, getter_t g, setter_t s) : original_index(fields.size()), name(prop), get(g), set(s) {};
 +    property(const property& p) :
 +        original_index(p.original_index),
 +        name(p.name),
 +        get(p.get),
 +        set(p.set)
 +    {};
      ~property() {};
 +    property(property&& p) :
 +        original_index(std::move(p.original_index)),
 +        name(std::move(p.name)),
 +        get(std::move(p.get)),
 +        set(std::move(p.set))
 +    {};
 +    property<Adaptor>& operator= (property<Adaptor>&& p)
 +    {
 +        original_index = std::move(p.original_index);
 +        name = std::move(p.name);
 +        get = std::move(p.get);
 +        set = std::move(p.set);
 +        return *this;
 +    };
  
      size_t original_index;
      std::wstring name;
@@@ -56,12 -56,18 +56,12 @@@ namespace view_scila
  namespace
  {
  
 -const std::wstring modelica (L"modelica");
 -const std::wstring model (L"model");
 -const std::wstring inputs (L"inputs");
 -const std::wstring outputs (L"outputs");
 -const std::wstring parameters (L"parameters");
 -
  types::InternalType* get_with_vec2var(const ModelAdapter& adaptor, const Controller& controller, object_properties_t p)
  {
-     ScicosID adaptee = adaptor.getAdaptee()->id();
+     model::Block* adaptee = adaptor.getAdaptee();
  
      std::vector<double> prop_content;
-     controller.getObjectProperty(adaptee, BLOCK, p, prop_content);
+     controller.getObjectProperty(adaptee, p, prop_content);
  
      // Corner-case, the empty content is an empty double
      if (prop_content.empty())
@@@ -179,8 -186,12 +186,8 @@@ struct to
          types::Double* o = new types::Double(1, 7, &data);
  
          std::vector<double> tol;
-         controller.getObjectProperty(adaptee, DIAGRAM, PROPERTIES, tol);
+         controller.getObjectProperty(adaptee, PROPERTIES, tol);
 -#ifdef _MSC_VER
 -        std::copy(tol.begin() + 1, tol.end(), stdext::checked_array_iterator<double*>( data, 7 ));
 -#else
          std::copy(tol.begin() + 1, tol.end(), data);
 -#endif
  
          return o;
      }
@@@ -92,12 -92,8 +92,13 @@@ std::unordered_map<std::wstring, std::w
  {
      // TODO: get this list from a conf file
      std::unordered_map<std::wstring, std::wstring> map;
 +
 +    // Scilab 6.0.0 => 6.1.0
 +    map.emplace(L"hypermat", L"matrix");
 +    map.emplace(L"square", L"replot");
 +
      // Scilab 6.0.x => 6.1.0
+     map.emplace(L"lstsize", L"size");
      map.emplace(L"nanmin", L"min");
      map.emplace(L"nanmax", L"max");
      map.emplace(L"square", L"replot");