Xcos MVC: allow lists in 'exprs' (not dummy ones) 72/15772/12
Paul Bignier [Thu, 8 Jan 2015 16:50:40 +0000 (17:50 +0100)]
 * Added an element to 'exprs' in the model by default (worth "String") to ease its processing
 * Concerns Superblocks ("SUPER_f", "DSUPER), "CBLOCK", "c_block", "fortran_block" and "scifunc_block_m"

--> loadXcosLibs();
--> exec("SCI/test/xcos/susp.cosf", -1);
--> scs_m.objs(31).graphics.exprs
--> exec("SCI/test/xcos/pendulum_anim5.cosf", -1);
--> scs_m.objs(4).model.rpar.objs(1).graphics.exprs
--> exec("SCI/test/xcos/bug_4715.cosf", -1);
--> scs_m.objs(15).graphics.exprs

Change-Id: I2efbb25a12e04f87d79bca1e0a2b371b3078ef03

scilab/modules/scicos/src/cpp/model/Block.hxx
scilab/modules/scicos/src/cpp/view_scilab/GraphicsAdapter.cpp
scilab/modules/scicos/tests/unit_tests/model/Block.dia.ref
scilab/modules/scicos/tests/unit_tests/model/Block.tst
scilab/modules/scicos/tests/unit_tests/model/Deep_cloning.dia.ref
scilab/modules/scicos/tests/unit_tests/model/SuperBlock.dia.ref
scilab/modules/scicos/tests/unit_tests/model/SuperBlock_in_SuperBlock.dia.ref

index aabf9fa..8aee913 100644 (file)
@@ -101,7 +101,7 @@ class Block: public BaseObject
 {
 public:
     Block() : BaseObject(BLOCK), m_parentDiagram(0), m_interfaceFunction(), m_geometry(), m_angle(),
-        m_exprs(), m_label(), m_style(), m_nzcross(0), m_nmode(0), m_equations(), m_uid(), m_sim(), m_in(), m_out(), m_ein(), m_eout(),
+        m_exprs(std::vector<std::string> (1, "String")), m_label(), m_style(), m_nzcross(0), m_nmode(0), m_equations(), m_uid(), m_sim(), m_in(), m_out(), m_ein(), m_eout(),
         m_parameter(), m_state(), m_parentBlock(0), m_children(), m_portReference(0)
     {
         m_sim.blocktype  = BLOCKTYPE_C;
index 81a8c63..d973955 100644 (file)
@@ -225,22 +225,206 @@ struct exprs
         std::vector<std::string> exprs;
         controller.getObjectProperty(adaptee, BLOCK, EXPRS, exprs);
 
-        if (exprs.size() < 10 || (!exprs.empty() && exprs[0] != "MBLOCK"))
+        if (exprs.empty())
         {
-            // Simple case
-            types::String* o = new types::String((int)exprs.size(), 1);
-            for (int i = 0; i < (int)exprs.size(); ++i)
+            return 0;
+        }
+        else if (exprs[0] == "List_fortran")
+        {
+            // Get and return a list
+            types::List* o = new types::List();
+
+            // Element #1: Block parameters
+            std::istringstream nParamsStr (exprs[1]);
+            int nParams;
+            nParamsStr >> nParams;
+            if (nParams == 0)
             {
-                o->set(i, exprs[i].data());
+                types::Double* paramsField = types::Double::Empty();
+                o->append(paramsField);
             }
+            else
+            {
+                types::String* paramsField = new types::String(nParams, 1);
+                for (int i = 0; i < nParams; ++i)
+                {
+                    paramsField->set(i, exprs[2 + i].c_str());
+                }
+                o->append(paramsField);
+            }
+
+            // Element #2: List containing an empty matrix (default value)
+            types::List* emptyMatrixList = new types::List();
+            types::Double* emptyMatrix = types::Double::Empty();
+            emptyMatrixList->append(emptyMatrix);
+            o->append(emptyMatrixList);
+
             return o;
         }
-        else
+        else if (exprs[0] == "List_scifunc")
+        {
+            // Get and return a list
+            types::List* o = new types::List();
+
+            // Element #1: Block parameters
+            std::istringstream nParamsStr (exprs[1]);
+            int nParams;
+            nParamsStr >> nParams;
+            if (nParams == 0)
+            {
+                types::Double* paramsField = types::Double::Empty();
+                o->append(paramsField);
+            }
+            else
+            {
+                types::String* paramsField = new types::String(nParams, 1);
+                for (int i = 0; i < nParams; ++i)
+                {
+                    paramsField->set(i, exprs[2 + i].c_str());
+                }
+                o->append(paramsField);
+            }
+
+            // Element #2: Code parts
+            types::List* codePartsField = new types::List();
+
+            for (int i = 0; i < 7; ++i)
+            {
+                std::istringstream nLinesStr (exprs[2 + nParams]);
+                int nLines;
+                nLinesStr >> nLines;
+                if (nLines == 0)
+                {
+                    // Null 'nLines' signals an empty matrix
+                    types::Double* empty_matrix = types::Double::Empty();
+                    codePartsField->append(empty_matrix);
+                }
+                else
+                {
+                    types::String* part = new types::String(nLines, 1);
+                    for (int j = 0; j < nLines; ++j)
+                    {
+                        part->set(j, exprs[2 + nParams + 1 + j].c_str());
+                    }
+                    codePartsField->append(part);
+                }
+
+                nParams += nLines + 1;
+            }
+            o->append(codePartsField);
+
+            return o;
+        }
+        else if (exprs[0] == "List_code" || exprs[0] == "List_super")
+        {
+            // Get and return a list
+            types::List* o = new types::List();
+
+            // Element #1: Default values
+            std::istringstream nParamsStr (exprs[1]);
+            int nParams;
+            nParamsStr >> nParams;
+            if (nParams == 0)
+            {
+                types::Double* defaultValuesField = types::Double::Empty();
+                o->append(defaultValuesField);
+            }
+            else
+            {
+                types::String* defaultValuesField = new types::String(nParams, 1);
+                for (int i = 0; i < nParams; ++i)
+                {
+                    defaultValuesField->set(i, exprs[2 + i].c_str());
+                }
+                o->append(defaultValuesField);
+            }
+
+            // Element #2 depends on the block kind
+            if (exprs[0] == "List_code")
+            {
+                std::istringstream nLinesStr (exprs[2 + nParams]);
+                int nLines;
+                nLinesStr >> nLines;
+                if (nLines == 0)
+                {
+                    types::Double* functionBodyField = types::Double::Empty();
+                    o->append(functionBodyField);
+                }
+                else
+                {
+                    types::String* functionBodyField = new types::String(nLines, 1);
+                    for (int i = 0; i < nLines; ++i)
+                    {
+                        functionBodyField->set(i, exprs[2 + nParams + 1 + i].c_str());
+                    }
+                    o->append(functionBodyField);
+                }
+            }
+            else // List_super
+            {
+                types::List* secondElement = new types::List();
+
+                // Paramaters names
+                if (nParams == 0)
+                {
+                    types::Double* namesField = types::Double::Empty();
+                    secondElement->append(namesField);
+                }
+                else
+                {
+                    types::String* namesField = new types::String(nParams, 1);
+                    for (int i = 0; i < nParams; ++i)
+                    {
+                        namesField->set(i, exprs[2 + nParams + i].c_str());
+                    }
+                    secondElement->append(namesField);
+                }
+
+                // Title message and paramaters decriptions
+                types::String* titleField = new types::String(nParams + 1, 1);
+                for (int i = 0; i < nParams + 1; ++i)
+                {
+                    titleField->set(i, exprs[2 + 2 * nParams + i].c_str());
+                }
+                secondElement->append(titleField);
+
+                // Parameters types and sizes
+                types::List* typesAndSizes = new types::List();
+
+                if (nParams == 0)
+                {
+                    types::Double* typeSizeField = types::Double::Empty();
+                    typesAndSizes->append(typeSizeField);
+                }
+                else
+                {
+                    for (int i = 0; i < nParams; ++i)
+                    {
+                        // Read type
+                        types::String* Type = new types::String(exprs[2 + 3 * nParams + 1 + i].c_str());
+                        typesAndSizes->append(Type);
+
+                        // Read size
+                        std::istringstream sizeStr (exprs[2 + 4 * nParams + 1 + i]);
+                        int size;
+                        sizeStr >> size;
+                        types::Double* Size = new types::Double(size);
+                        typesAndSizes->append(Size);
+                    }
+                }
+                secondElement->append(typesAndSizes);
+
+                o->append(secondElement);
+            }
+
+            return o;
+        }
+        else if (exprs[0] == "List_MBLOCK")
         {
             // Get and return a Modelica tlist
             types::TList* o = new types::TList();
 
-            // Header, starting with "MBLOCK"
+            // Header, starting with "List_MBLOCK"
             types::String* header = new types::String(1, 10);
             header->set(0, MBLOCK.c_str());
             header->set(1, in.c_str());
@@ -252,27 +436,27 @@ struct exprs
             header->set(7, pprop.c_str());
             header->set(8, nameF.c_str());
             header->set(9, funtxt.c_str());
-            o->set(0, header);
+            o->append(header);
 
             // 'in'
             types::String* inField = new types::String(exprs[1].c_str());
-            o->set(1, inField);
+            o->append(inField);
 
             // 'intype'
             types::String* intypeField = new types::String(exprs[2].c_str());
-            o->set(2, intypeField);
+            o->append(intypeField);
 
             // 'out'
             types::String* outField = new types::String(exprs[3].c_str());
-            o->set(3, outField);
+            o->append(outField);
 
             // 'outtype'
             types::String* outtypeField = new types::String(exprs[4].c_str());
-            o->set(4, outtypeField);
+            o->append(outtypeField);
 
             // 'param'
             types::String* paramField = new types::String(exprs[5].c_str());
-            o->set(5, paramField);
+            o->append(paramField);
 
             // 'paramv'
             types::List* paramvField = new types::List();
@@ -284,15 +468,15 @@ struct exprs
                 types::String* paramvElement = new types::String(exprs[7 + i].c_str());
                 paramvField->set(i, paramvElement);
             }
-            o->set(6, paramvField);
+            o->append(paramvField);
 
             // 'pprop'
             types::String* ppropField = new types::String(exprs[7 + paramvSize].c_str());
-            o->set(7, ppropField);
+            o->append(ppropField);
 
             // 'nameF'
             types::String* nameFField = new types::String(exprs[7 + paramvSize + 1].c_str());
-            o->set(8, nameFField);
+            o->append(nameFField);
 
             // 'funtxt'
             std::istringstream funtxtSizeStr (exprs[7 + paramvSize + 2]);
@@ -302,7 +486,7 @@ struct exprs
             if (funtxtSize == 0)
             {
                 // An empty 'funtxt' field returns an empty matrix
-                o->set(9, types::Double::Empty());
+                o->append(types::Double::Empty());
                 return o;
             }
             types::String* funtxtField = new types::String(funtxtSize, 1);
@@ -310,30 +494,48 @@ struct exprs
             {
                 funtxtField->set(i, exprs[7 + paramvSize + 3 + i].c_str());
             }
-            o->set(9, funtxtField);
+            o->append(funtxtField);
 
             return o;
         }
+        else if (exprs[0] == "String")
+        {
+            // Simple case, 'exprs' is a string matrix (can be empty)
+            if (exprs.size() == 1)
+            {
+                return types::Double::Empty();
+            }
+            types::String* o = new types::String((int)exprs.size() - 1, 1);
+            for (int i = 0; i < (int)exprs.size() - 1; ++i)
+            {
+                o->set(i, exprs[i + 1].data());
+            }
+            return o;
+        }
+        else
+        {
+            return 0;
+        }
     }
 
     static bool set(GraphicsAdapter& adaptor, types::InternalType* v, Controller& controller)
     {
         ScicosID adaptee = adaptor.getAdaptee()->id();
 
+        std::vector<std::string> exprs (1); // First element will contain "String", "List_code", "List_super, "List_scifunc", "List_fortran" or "List_MBLOCK"
+
         if (v->getType() == types::InternalType::ScilabString)
         {
             types::String* current = v->getAs<types::String>();
 
-            std::vector<std::string> exprs (current->getSize());
-            for (int i = 0; i < (int)exprs.size(); ++i)
+            exprs[0] = "String";
+            exprs.resize(1 + current->getSize());
+            for (int i = 1; i < (int)exprs.size(); ++i)
             {
-                char* c_str = wide_string_to_UTF8(current->get(i));
+                char* c_str = wide_string_to_UTF8(current->get(i - 1));
                 exprs[i] = std::string(c_str);
                 FREE(c_str);
             }
-
-            controller.setObjectProperty(adaptee, BLOCK, EXPRS, exprs);
-            return true;
         }
         else if (v->getType() == types::InternalType::ScilabDouble)
         {
@@ -343,15 +545,287 @@ struct exprs
                 return false;
             }
 
-            std::vector<std::string> exprs;
-            controller.setObjectProperty(adaptee, BLOCK, EXPRS, exprs);
-            return true;
+            exprs[0] = "String";
         }
         else if (v->getType() == types::InternalType::ScilabList)
         {
-            std::vector<std::string> exprs;
-            controller.setObjectProperty(adaptee, BLOCK, EXPRS, exprs);
-            return true;
+            types::List* initial_list = v->getAs<types::List>();
+
+            // Leave 'exprs[0]' empty for the moment, because we don't know yet what we are going to deal with
+            char* c_str; // Buffer
+
+            // Both blocks have two elements in 'exprs'
+            if (initial_list->getSize() != 2)
+            {
+                return false;
+            }
+
+            size_t nParams = 0;
+            // Whatever the block kind, the first element is necessarily a string matrix (can be empty)
+            if (initial_list->get(0)->getType() == types::InternalType::ScilabDouble)
+            {
+                types::Double* empty_matrix_expected = initial_list->get(0)->getAs<types::Double>();
+                if (empty_matrix_expected->getSize() != 0)
+                {
+                    return false;
+                }
+                exprs.resize(2);
+                exprs[1] = "0"; // Indicating empty matrix
+            }
+            else if (initial_list->get(0)->getType() == types::InternalType::ScilabString)
+            {
+                types::String* initial_string = initial_list->get(0)->getAs<types::String>();
+
+                nParams = initial_string->getSize();
+                exprs.resize(exprs.size() + 1 + nParams); // Allocation for the first string
+                std::ostringstream strSize;
+                strSize << nParams;
+                std::string sizeStr = strSize.str();
+                exprs[1] = sizeStr; // Saving the size of the initial string
+
+                for (size_t i = 0; i < nParams; ++i)
+                {
+                    c_str = wide_string_to_UTF8(initial_string->get(i));
+                    std::string stringElement(c_str);
+                    FREE(c_str);
+                    exprs[2 + i] = stringElement;
+                }
+            }
+            else
+            {
+                return false;
+            }
+
+            // The second element determines the block kind
+            if (initial_list->get(1)->getType() == types::InternalType::ScilabDouble)
+            {
+                types::Double* empty_matrix_expected = initial_list->get(1)->getAs<types::Double>();
+                if (empty_matrix_expected->getSize() != 0)
+                {
+                    return false;
+                }
+
+                exprs[0] = "List_code"; // List coming from a C block
+                exprs.push_back("0"); // Indicating empty matrix
+            }
+            else if (initial_list->get(1)->getType() == types::InternalType::ScilabString)
+            {
+                types::String* second_string = initial_list->get(1)->getAs<types::String>();
+
+                exprs[0] = "List_code"; // List coming from a "user-defined function" block
+                size_t second_size = second_string->getSize();
+                int exprsSize = exprs.size(); // Saving last index before resizing
+                exprs.resize(exprs.size() + 1 + second_size); // Allocation for the first string
+                std::ostringstream strSize2;
+                strSize2 << second_size;
+                std::string sizeStr2 = strSize2.str();
+                exprs[exprsSize] = sizeStr2; // Saving the size of the second string
+
+                for (size_t i = 0; i < second_size; ++i)
+                {
+                    c_str = wide_string_to_UTF8(second_string->get(i));
+                    std::string stringElement(c_str);
+                    FREE(c_str);
+                    exprs[exprsSize + 1 + i] = stringElement;
+                }
+            }
+            else if (initial_list->get(1)->getType() == types::InternalType::ScilabList)
+            {
+                types::List* second_list = initial_list->get(1)->getAs<types::List>();
+
+                if (second_list->getSize() == 1)
+                {
+                    // Default fortran_block value: must contain an empty matrix
+                    if (second_list->get(0)->getType() != types::InternalType::ScilabDouble)
+                    {
+                        return false;
+                    }
+                    types::Double* empty = second_list->get(0)->getAs<types::Double>();
+                    if (!empty->isEmpty())
+                    {
+                        return false;
+                    }
+                    exprs[0] = "List_fortran"; // List coming from a fortran_block
+                }
+                else if (second_list->getSize() == 3)
+                {
+                    // Parameter names, Title message and Parameters types & sizes
+                    exprs[0] = "List_super"; // List coming from a SuperBlock (masked or not)
+
+                    // Parameters Names (string matrix, can be empty)
+                    if (second_list->get(0)->getType() == types::InternalType::ScilabDouble)
+                    {
+                        types::Double* empty_matrix_expected = second_list->get(0)->getAs<types::Double>();
+                        if (empty_matrix_expected->getSize() != 0)
+                        {
+                            return false;
+                        }
+                        // No parameters are present, so nothing needs to be saved
+                    }
+                    else if (second_list->get(0)->getType() == types::InternalType::ScilabString)
+                    {
+                        types::String* second_string = second_list->get(0)->getAs<types::String>();
+
+                        if (second_string->getSize() != static_cast<int>(nParams))
+                        {
+                            return false;
+                        }
+
+                        int exprsSize = exprs.size(); // Saving last index before resizing
+                        exprs.resize(exprs.size() + nParams); // Allocation for the first string
+
+                        for (size_t i = 0; i < nParams; ++i)
+                        {
+                            c_str = wide_string_to_UTF8(second_string->get(i));
+                            std::string stringElement(c_str);
+                            FREE(c_str);
+                            exprs[exprsSize + i] = stringElement;
+                        }
+                    }
+                    else
+                    {
+                        return false;
+                    }
+
+                    // Title message (string matrix, can be empty)
+                    if (second_list->get(1)->getType() == types::InternalType::ScilabDouble)
+                    {
+                        types::Double* empty_matrix_expected = second_list->get(1)->getAs<types::Double>();
+                        if (empty_matrix_expected->getSize() != 0 || nParams != 0)
+                        {
+                            return false;
+                        }
+                        // No parameters are present, so nothing needs to be saved
+                    }
+                    else if (second_list->get(1)->getType() == types::InternalType::ScilabString)
+                    {
+                        types::String* title_message = second_list->get(1)->getAs<types::String>();
+                        if (title_message->getSize() != static_cast<int>(nParams + 1))
+                        {
+                            // There must be as many parameter descriptions as there are parameters, plus the title message
+                            return false;
+                        }
+
+                        int exprsSize = exprs.size(); // Saving last index before resizing
+                        exprs.resize(exprs.size() + nParams + 1); // Allocation for the first string, minding the title message
+
+                        for (size_t i = 0; i < nParams + 1; ++i)
+                        {
+                            c_str = wide_string_to_UTF8(title_message->get(i));
+                            std::string stringElement(c_str);
+                            FREE(c_str);
+                            exprs[exprsSize + i] = stringElement;
+                        }
+                    }
+                    else
+                    {
+                        return false;
+                    }
+
+                    // Parameters types & sizes (list mixing strings and integers, can be empty)
+                    if (second_list->get(2)->getType() != types::InternalType::ScilabList)
+                    {
+                        return false;
+                    }
+                    types::List* third_list = second_list->get(2)->getAs<types::List>();
+
+                    if (third_list->getSize() != static_cast<int>(2 * nParams))
+                    {
+                        // There must be one type and one size for each parameter, so '2*nParams' elements
+                        if (!(third_list->getSize() == 1 && nParams == 0))
+                        {
+                            // Allow third_list != 2*params only for the dummy case 'third_list=list([])'. Do nothing then
+                            return false;
+                        }
+                    }
+
+                    // First, read all types
+                    for (size_t i = 0; i < nParams; ++i)
+                    {
+                        if (third_list->get(2 * i)->getType() != types::InternalType::ScilabString)
+                        {
+                            return false;
+                        }
+                        types::String* paramType = third_list->get(2 * i)->getAs<types::String>();
+                        if (!paramType->isScalar())
+                        {
+                            return false;
+                        }
+                        c_str = wide_string_to_UTF8(paramType->get(0));
+                        std::string paramTypeStored(c_str);
+                        FREE(c_str);
+
+                        exprs.push_back(paramTypeStored);
+                    }
+                    // Then, read all sizes
+                    for (size_t i = 0; i < nParams; ++i)
+                    {
+                        if (third_list->get(2 * i + 1)->getType() != types::InternalType::ScilabDouble)
+                        {
+                            return false;
+                        }
+                        types::Double* paramSize = third_list->get(2 * i + 1)->getAs<types::Double>();
+                        if (!paramSize->isScalar())
+                        {
+                            return false;
+                        }
+
+                        std::ostringstream paramSizeStored;
+                        paramSizeStored << paramSize->get(0);
+                        std::string paramSizeStr = paramSizeStored.str();
+                        exprs.push_back(paramSizeStr);
+                    }
+                }
+                else if (second_list->getSize() == 7)
+                {
+                    exprs[0] = "List_scifunc"; // List coming from a scifunc block
+
+                    // Code parts (string matrices)
+                    for (int i = 0; i < 7; ++i)
+                    {
+                        if (second_list->get(i)->getType() == types::InternalType::ScilabDouble)
+                        {
+                            types::Double* ith_double = second_list->get(i)->getAs<types::Double>();
+                            if (!ith_double->isEmpty())
+                            {
+                                return false;
+                            }
+                            exprs.push_back(std::string("0"));
+                        }
+                        else if (second_list->get(i)->getType() == types::InternalType::ScilabString)
+                        {
+                            types::String* ith_string = second_list->get(i)->getAs<types::String>();
+                            size_t stringSize = ith_string->getSize();
+                            int exprsSize = exprs.size(); // Saving last index before resizing
+                            exprs.resize(exprs.size() + 1 + stringSize); // Allocation for the first string
+                            std::ostringstream strSizeIth;
+                            strSizeIth << stringSize;
+                            std::string sizeStrIth = strSizeIth.str();
+                            exprs[exprsSize] = sizeStrIth; // Saving the size of the ith string
+
+                            for (size_t j = 0; j < stringSize; ++j)
+                            {
+                                c_str = wide_string_to_UTF8(ith_string->get(j));
+                                std::string ithStringElement(c_str);
+                                FREE(c_str);
+                                exprs[exprsSize + 1 + j] = ithStringElement;
+                            }
+                        }
+                        else
+                        {
+                            return false;
+                        }
+                    }
+                }
+                else
+                {
+                    return false;
+                }
+            }
+            else
+            {
+                return false;
+            }
         }
         else if (v->getType() == types::InternalType::ScilabTList)
         {
@@ -404,7 +878,7 @@ struct exprs
                 return false;
             }
 
-            std::vector<std::string> exprs (1, "MBLOCK");
+            exprs[0] = "List_MBLOCK"; // TList coming from an MBLOCK
             char* c_str; // Buffer
 
             // 'in'
@@ -413,7 +887,7 @@ struct exprs
                 return false;
             }
             types::String* inField = current->get(1)->getAs<types::String>();
-            if (inField->getSize() != 1)
+            if (!inField->isScalar())
             {
                 return false;
             }
@@ -428,7 +902,7 @@ struct exprs
                 return false;
             }
             types::String* intypeField = current->get(2)->getAs<types::String>();
-            if (intypeField->getSize() != 1)
+            if (!intypeField->isScalar())
             {
                 return false;
             }
@@ -443,7 +917,7 @@ struct exprs
                 return false;
             }
             types::String* outField = current->get(3)->getAs<types::String>();
-            if (inField->getSize() != 1)
+            if (!inField->isScalar())
             {
                 return false;
             }
@@ -458,7 +932,7 @@ struct exprs
                 return false;
             }
             types::String* outtypeField = current->get(4)->getAs<types::String>();
-            if (outtypeField->getSize() != 1)
+            if (!outtypeField->isScalar())
             {
                 return false;
             }
@@ -473,7 +947,7 @@ struct exprs
                 return false;
             }
             types::String* paramField = current->get(5)->getAs<types::String>();
-            if (paramField->getSize() != 1)
+            if (!paramField->isScalar())
             {
                 return false;
             }
@@ -515,7 +989,7 @@ struct exprs
                 return false;
             }
             types::String* ppropField = current->get(7)->getAs<types::String>();
-            if (ppropField->getSize() != 1)
+            if (!ppropField->isScalar())
             {
                 return false;
             }
@@ -530,7 +1004,7 @@ struct exprs
                 return false;
             }
             types::String* nameFField = current->get(8)->getAs<types::String>();
-            if (nameFField->getSize() != 1)
+            if (!nameFField->isScalar())
             {
                 return false;
             }
@@ -578,12 +1052,14 @@ struct exprs
                     exprs[exprsSize + 1 + i] = funtxtElement;
                 }
             }
-
-            controller.setObjectProperty(adaptee, BLOCK, EXPRS, exprs);
-            return true;
+        }
+        else
+        {
+            return false;
         }
 
-        return false;
+        controller.setObjectProperty(adaptee, BLOCK, EXPRS, exprs);
+        return true;
     }
 };
 
@@ -682,7 +1158,7 @@ struct id
         }
 
         types::String* current = v->getAs<types::String>();
-        if (current->getSize() != 1)
+        if (!current->isScalar())
         {
             return false;
         }
@@ -801,7 +1277,7 @@ struct style
         if (v->getType() == types::InternalType::ScilabString)
         {
             types::String* current = v->getAs<types::String>();
-            if (current->getSize() != 1)
+            if (!current->isScalar())
             {
                 return false;
             }
index e1971ad..5daeb9c 100644 (file)
@@ -1872,8 +1872,33 @@ o.model.equations
     0.1
                            ans(5)(2)(2)
     0.0001
-// Check that all the model items are freed
-clear
+// Test 'exprs' with SuperBlock, CBLOCK, scifunc_block_m and default fortran_block
+// SuperBlock with no parameter
+lS = list([],list([],"Configuration des Paramètres du bloc",list([])));
+o = scicos_block(gui="SUPER", graphics=scicos_graphics(exprs=lS));
+objectCreated( 43 , BLOCK )
+propertyUpdated( 43 , BLOCK , GEOMETRY ) : NO_CHANGES
+propertyUpdated( 43 , BLOCK , GEOMETRY ) : NO_CHANGES
+propertyUpdated( 43 , BLOCK , ANGLE ) : NO_CHANGES
+propertyUpdated( 43 , BLOCK , ANGLE ) : NO_CHANGES
+propertyUpdated( 43 , BLOCK , EXPRS ) : SUCCESS
+propertyUpdated( 43 , BLOCK , LABEL ) : NO_CHANGES
+propertyUpdated( 43 , BLOCK , STYLE ) : NO_CHANGES
+propertyUpdated( 43 , BLOCK , SIM_FUNCTION_NAME ) : NO_CHANGES
+propertyUpdated( 43 , BLOCK , SIM_FUNCTION_API ) : NO_CHANGES
+propertyUpdated( 43 , BLOCK , STATE ) : NO_CHANGES
+propertyUpdated( 43 , BLOCK , DSTATE ) : NO_CHANGES
+propertyUpdated( 43 , BLOCK , ODSTATE ) : NO_CHANGES
+propertyUpdated( 43 , BLOCK , RPAR ) : NO_CHANGES
+propertyUpdated( 43 , BLOCK , IPAR ) : NO_CHANGES
+propertyUpdated( 43 , BLOCK , OPAR ) : NO_CHANGES
+propertyUpdated( 43 , BLOCK , SIM_BLOCKTYPE ) : NO_CHANGES
+propertyUpdated( 43 , BLOCK , SIM_DEP_UT ) : NO_CHANGES
+propertyUpdated( 43 , BLOCK , LABEL ) : NO_CHANGES
+propertyUpdated( 43 , BLOCK , NZCROSS ) : NO_CHANGES
+propertyUpdated( 43 , BLOCK , NMODE ) : NO_CHANGES
+propertyUpdated( 43 , BLOCK , UID ) : NO_CHANGES
+propertyUpdated( 43 , BLOCK , INTERFACE_FUNCTION ) : SUCCESS
 propertyUpdated( 39 , BLOCK , INPUTS ) : SUCCESS
 propertyUpdated( 39 , BLOCK , OUTPUTS ) : NO_CHANGES
 propertyUpdated( 39 , BLOCK , EVENT_INPUTS ) : NO_CHANGES
@@ -1890,3 +1915,218 @@ propertyUpdated( 39 , BLOCK , EVENT_INPUTS ) : NO_CHANGES
 propertyUpdated( 39 , BLOCK , EVENT_OUTPUTS ) : NO_CHANGES
 objectDeleted( 42 , PORT )
 objectDeleted( 39 , BLOCK )
+assert_checkequal(o.graphics.exprs, lS);
+// Masked SuperBlock with one parameter
+lDS = list("3",list("J",["Configuration des Paramètres du bloc"; "mon_param"],list("pol", -1)));
+o = scicos_block(gui="DSUPER", graphics=scicos_graphics(exprs=lDS));
+objectCreated( 44 , BLOCK )
+propertyUpdated( 44 , BLOCK , GEOMETRY ) : NO_CHANGES
+propertyUpdated( 44 , BLOCK , GEOMETRY ) : NO_CHANGES
+propertyUpdated( 44 , BLOCK , ANGLE ) : NO_CHANGES
+propertyUpdated( 44 , BLOCK , ANGLE ) : NO_CHANGES
+propertyUpdated( 44 , BLOCK , EXPRS ) : SUCCESS
+propertyUpdated( 44 , BLOCK , LABEL ) : NO_CHANGES
+propertyUpdated( 44 , BLOCK , STYLE ) : NO_CHANGES
+propertyUpdated( 44 , BLOCK , SIM_FUNCTION_NAME ) : NO_CHANGES
+propertyUpdated( 44 , BLOCK , SIM_FUNCTION_API ) : NO_CHANGES
+propertyUpdated( 44 , BLOCK , STATE ) : NO_CHANGES
+propertyUpdated( 44 , BLOCK , DSTATE ) : NO_CHANGES
+propertyUpdated( 44 , BLOCK , ODSTATE ) : NO_CHANGES
+propertyUpdated( 44 , BLOCK , RPAR ) : NO_CHANGES
+propertyUpdated( 44 , BLOCK , IPAR ) : NO_CHANGES
+propertyUpdated( 44 , BLOCK , OPAR ) : NO_CHANGES
+propertyUpdated( 44 , BLOCK , SIM_BLOCKTYPE ) : NO_CHANGES
+propertyUpdated( 44 , BLOCK , SIM_DEP_UT ) : NO_CHANGES
+propertyUpdated( 44 , BLOCK , LABEL ) : NO_CHANGES
+propertyUpdated( 44 , BLOCK , NZCROSS ) : NO_CHANGES
+propertyUpdated( 44 , BLOCK , NMODE ) : NO_CHANGES
+propertyUpdated( 44 , BLOCK , UID ) : NO_CHANGES
+propertyUpdated( 44 , BLOCK , INTERFACE_FUNCTION ) : SUCCESS
+objectDeleted( 43 , BLOCK )
+assert_checkequal(o.graphics.exprs, lDS);
+// CBLOCK, default has empty function body
+o = CBLOCK("define");
+objectCreated( 45 , BLOCK )
+propertyUpdated( 45 , BLOCK , GEOMETRY ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , GEOMETRY ) : SUCCESS
+propertyUpdated( 45 , BLOCK , ANGLE ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , ANGLE ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , EXPRS ) : SUCCESS
+objectCreated( 46 , PORT )
+propertyUpdated( 46 , PORT , SOURCE_BLOCK ) : SUCCESS
+propertyUpdated( 46 , PORT , PORT_KIND ) : SUCCESS
+propertyUpdated( 45 , BLOCK , INPUTS ) : SUCCESS
+objectCreated( 47 , PORT )
+propertyUpdated( 47 , PORT , SOURCE_BLOCK ) : SUCCESS
+propertyUpdated( 47 , PORT , PORT_KIND ) : SUCCESS
+propertyUpdated( 45 , BLOCK , OUTPUTS ) : SUCCESS
+propertyUpdated( 45 , BLOCK , LABEL ) : NO_CHANGES
+propertyUpdated( 46 , PORT , IMPLICIT ) : NO_CHANGES
+propertyUpdated( 47 , PORT , IMPLICIT ) : NO_CHANGES
+propertyUpdated( 46 , PORT , STYLE ) : NO_CHANGES
+propertyUpdated( 47 , PORT , STYLE ) : NO_CHANGES
+propertyUpdated( 46 , PORT , LABEL ) : NO_CHANGES
+propertyUpdated( 47 , PORT , LABEL ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , STYLE ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , SIM_FUNCTION_NAME ) : SUCCESS
+propertyUpdated( 45 , BLOCK , SIM_FUNCTION_API ) : SUCCESS
+propertyUpdated( 46 , PORT , DATATYPE ) : SUCCESS
+propertyUpdated( 47 , PORT , DATATYPE ) : SUCCESS
+propertyUpdated( 45 , BLOCK , STATE ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , DSTATE ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , ODSTATE ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , RPAR ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , IPAR ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , OPAR ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , SIM_BLOCKTYPE ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , SIM_DEP_UT ) : SUCCESS
+propertyUpdated( 45 , BLOCK , LABEL ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , NZCROSS ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , NMODE ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , UID ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , INTERFACE_FUNCTION ) : SUCCESS
+objectDeleted( 44 , BLOCK )
+lCB = list(["toto"; "n"; "1"; "1"; "[]"; "[]"; "[]"; "0"; "[]"; "[]"; "[]"; "[]"; "y"; "n"], []);
+assert_checkequal(o.graphics.exprs, lCB);
+// Add a function body
+lCB2 = list(["toto"; "n"; "1"; "1"; "[]"; "[]"; "[]"; "0"; "[]"; "[]"; "[]"; "[]"; "y"; "n"], ["Function body"]);
+o.graphics.exprs = lCB2;
+propertyUpdated( 45 , BLOCK , GEOMETRY ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , GEOMETRY ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , ANGLE ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , ANGLE ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , EXPRS ) : SUCCESS
+propertyUpdated( 45 , BLOCK , LABEL ) : NO_CHANGES
+propertyUpdated( 46 , PORT , IMPLICIT ) : NO_CHANGES
+propertyUpdated( 47 , PORT , IMPLICIT ) : NO_CHANGES
+propertyUpdated( 46 , PORT , STYLE ) : NO_CHANGES
+propertyUpdated( 47 , PORT , STYLE ) : NO_CHANGES
+propertyUpdated( 46 , PORT , LABEL ) : NO_CHANGES
+propertyUpdated( 47 , PORT , LABEL ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , STYLE ) : NO_CHANGES
+assert_checkequal(o.graphics.exprs, lCB2);
+// scifunc_block_m
+o = scifunc_block_m("define");
+objectCreated( 48 , BLOCK )
+propertyUpdated( 48 , BLOCK , GEOMETRY ) : NO_CHANGES
+propertyUpdated( 48 , BLOCK , GEOMETRY ) : SUCCESS
+propertyUpdated( 48 , BLOCK , ANGLE ) : NO_CHANGES
+propertyUpdated( 48 , BLOCK , ANGLE ) : NO_CHANGES
+propertyUpdated( 48 , BLOCK , EXPRS ) : SUCCESS
+objectCreated( 49 , PORT )
+propertyUpdated( 49 , PORT , SOURCE_BLOCK ) : SUCCESS
+propertyUpdated( 49 , PORT , PORT_KIND ) : SUCCESS
+propertyUpdated( 48 , BLOCK , INPUTS ) : SUCCESS
+objectCreated( 50 , PORT )
+propertyUpdated( 50 , PORT , SOURCE_BLOCK ) : SUCCESS
+propertyUpdated( 50 , PORT , PORT_KIND ) : SUCCESS
+propertyUpdated( 48 , BLOCK , OUTPUTS ) : SUCCESS
+propertyUpdated( 48 , BLOCK , LABEL ) : NO_CHANGES
+propertyUpdated( 49 , PORT , IMPLICIT ) : NO_CHANGES
+propertyUpdated( 50 , PORT , IMPLICIT ) : NO_CHANGES
+propertyUpdated( 49 , PORT , STYLE ) : NO_CHANGES
+propertyUpdated( 50 , PORT , STYLE ) : NO_CHANGES
+propertyUpdated( 49 , PORT , LABEL ) : NO_CHANGES
+propertyUpdated( 50 , PORT , LABEL ) : NO_CHANGES
+propertyUpdated( 48 , BLOCK , STYLE ) : NO_CHANGES
+propertyUpdated( 48 , BLOCK , SIM_FUNCTION_NAME ) : SUCCESS
+propertyUpdated( 48 , BLOCK , SIM_FUNCTION_API ) : SUCCESS
+propertyUpdated( 49 , PORT , DATATYPE ) : SUCCESS
+propertyUpdated( 49 , PORT , DATATYPE ) : NO_CHANGES
+propertyUpdated( 49 , PORT , DATATYPE ) : NO_CHANGES
+propertyUpdated( 50 , PORT , DATATYPE ) : SUCCESS
+propertyUpdated( 50 , PORT , DATATYPE ) : NO_CHANGES
+propertyUpdated( 50 , PORT , DATATYPE ) : NO_CHANGES
+propertyUpdated( 48 , BLOCK , STATE ) : NO_CHANGES
+propertyUpdated( 48 , BLOCK , DSTATE ) : NO_CHANGES
+propertyUpdated( 48 , BLOCK , ODSTATE ) : NO_CHANGES
+propertyUpdated( 48 , BLOCK , RPAR ) : NO_CHANGES
+propertyUpdated( 48 , BLOCK , IPAR ) : SUCCESS
+propertyUpdated( 48 , BLOCK , OPAR ) : NO_CHANGES
+propertyUpdated( 48 , BLOCK , SIM_BLOCKTYPE ) : NO_CHANGES
+propertyUpdated( 48 , BLOCK , SIM_DEP_UT ) : SUCCESS
+propertyUpdated( 48 , BLOCK , LABEL ) : NO_CHANGES
+propertyUpdated( 48 , BLOCK , NZCROSS ) : NO_CHANGES
+propertyUpdated( 48 , BLOCK , NMODE ) : NO_CHANGES
+propertyUpdated( 48 , BLOCK , UID ) : NO_CHANGES
+propertyUpdated( 48 , BLOCK , INTERFACE_FUNCTION ) : SUCCESS
+propertyUpdated( 45 , BLOCK , INPUTS ) : SUCCESS
+propertyUpdated( 45 , BLOCK , OUTPUTS ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , EVENT_INPUTS ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , EVENT_OUTPUTS ) : NO_CHANGES
+objectDeleted( 46 , PORT )
+propertyUpdated( 45 , BLOCK , INPUTS ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , OUTPUTS ) : SUCCESS
+propertyUpdated( 45 , BLOCK , EVENT_INPUTS ) : NO_CHANGES
+propertyUpdated( 45 , BLOCK , EVENT_OUTPUTS ) : NO_CHANGES
+objectDeleted( 47 , PORT )
+objectDeleted( 45 , BLOCK )
+lsci = list(["[1,1]";"[1,1]";"[]";"[]";"[]";"[]";"[]";"[]";"0"],list("y1=sin(u1)"," "," ","y1=sin(u1)"," "," "," "));
+assert_checkequal(o.graphics.exprs, lsci);
+// fortran_block
+o = fortran_block("define");
+objectCreated( 51 , BLOCK )
+propertyUpdated( 51 , BLOCK , GEOMETRY ) : NO_CHANGES
+propertyUpdated( 51 , BLOCK , GEOMETRY ) : SUCCESS
+propertyUpdated( 51 , BLOCK , ANGLE ) : NO_CHANGES
+propertyUpdated( 51 , BLOCK , ANGLE ) : NO_CHANGES
+propertyUpdated( 51 , BLOCK , EXPRS ) : SUCCESS
+objectCreated( 52 , PORT )
+propertyUpdated( 52 , PORT , SOURCE_BLOCK ) : SUCCESS
+propertyUpdated( 52 , PORT , PORT_KIND ) : SUCCESS
+propertyUpdated( 51 , BLOCK , INPUTS ) : SUCCESS
+objectCreated( 53 , PORT )
+propertyUpdated( 53 , PORT , SOURCE_BLOCK ) : SUCCESS
+propertyUpdated( 53 , PORT , PORT_KIND ) : SUCCESS
+propertyUpdated( 51 , BLOCK , OUTPUTS ) : SUCCESS
+propertyUpdated( 51 , BLOCK , LABEL ) : NO_CHANGES
+propertyUpdated( 52 , PORT , IMPLICIT ) : NO_CHANGES
+propertyUpdated( 53 , PORT , IMPLICIT ) : NO_CHANGES
+propertyUpdated( 52 , PORT , STYLE ) : NO_CHANGES
+propertyUpdated( 53 , PORT , STYLE ) : NO_CHANGES
+propertyUpdated( 52 , PORT , LABEL ) : NO_CHANGES
+propertyUpdated( 53 , PORT , LABEL ) : NO_CHANGES
+propertyUpdated( 51 , BLOCK , STYLE ) : NO_CHANGES
+propertyUpdated( 51 , BLOCK , SIM_FUNCTION_NAME ) : SUCCESS
+propertyUpdated( 51 , BLOCK , SIM_FUNCTION_API ) : SUCCESS
+propertyUpdated( 52 , PORT , DATATYPE ) : SUCCESS
+propertyUpdated( 53 , PORT , DATATYPE ) : SUCCESS
+propertyUpdated( 51 , BLOCK , STATE ) : NO_CHANGES
+propertyUpdated( 51 , BLOCK , DSTATE ) : NO_CHANGES
+propertyUpdated( 51 , BLOCK , ODSTATE ) : NO_CHANGES
+propertyUpdated( 51 , BLOCK , RPAR ) : NO_CHANGES
+propertyUpdated( 51 , BLOCK , IPAR ) : SUCCESS
+propertyUpdated( 51 , BLOCK , OPAR ) : NO_CHANGES
+propertyUpdated( 51 , BLOCK , SIM_BLOCKTYPE ) : NO_CHANGES
+propertyUpdated( 51 , BLOCK , SIM_DEP_UT ) : SUCCESS
+propertyUpdated( 51 , BLOCK , LABEL ) : NO_CHANGES
+propertyUpdated( 51 , BLOCK , NZCROSS ) : NO_CHANGES
+propertyUpdated( 51 , BLOCK , NMODE ) : NO_CHANGES
+propertyUpdated( 51 , BLOCK , UID ) : NO_CHANGES
+propertyUpdated( 51 , BLOCK , INTERFACE_FUNCTION ) : SUCCESS
+propertyUpdated( 48 , BLOCK , INPUTS ) : SUCCESS
+propertyUpdated( 48 , BLOCK , OUTPUTS ) : NO_CHANGES
+propertyUpdated( 48 , BLOCK , EVENT_INPUTS ) : NO_CHANGES
+propertyUpdated( 48 , BLOCK , EVENT_OUTPUTS ) : NO_CHANGES
+objectDeleted( 49 , PORT )
+propertyUpdated( 48 , BLOCK , INPUTS ) : NO_CHANGES
+propertyUpdated( 48 , BLOCK , OUTPUTS ) : SUCCESS
+propertyUpdated( 48 , BLOCK , EVENT_INPUTS ) : NO_CHANGES
+propertyUpdated( 48 , BLOCK , EVENT_OUTPUTS ) : NO_CHANGES
+objectDeleted( 50 , PORT )
+objectDeleted( 48 , BLOCK )
+lfort = list(["1";"1";"[]";"forty"],list([]));
+assert_checkequal(o.graphics.exprs, lfort);
+// Check that all the model items are freed
+clear
+propertyUpdated( 51 , BLOCK , INPUTS ) : SUCCESS
+propertyUpdated( 51 , BLOCK , OUTPUTS ) : NO_CHANGES
+propertyUpdated( 51 , BLOCK , EVENT_INPUTS ) : NO_CHANGES
+propertyUpdated( 51 , BLOCK , EVENT_OUTPUTS ) : NO_CHANGES
+objectDeleted( 52 , PORT )
+propertyUpdated( 51 , BLOCK , INPUTS ) : NO_CHANGES
+propertyUpdated( 51 , BLOCK , OUTPUTS ) : SUCCESS
+propertyUpdated( 51 , BLOCK , EVENT_INPUTS ) : NO_CHANGES
+propertyUpdated( 51 , BLOCK , EVENT_OUTPUTS ) : NO_CHANGES
+objectDeleted( 53 , PORT )
+objectDeleted( 51 , BLOCK )
index 68a0598..695432a 100644 (file)
@@ -126,6 +126,32 @@ o.graphics
 o.graphics.exprs
 o.model.equations
 
+// Test 'exprs' with SuperBlock, CBLOCK, scifunc_block_m and default fortran_block
+// SuperBlock with no parameter
+lS = list([],list([],"Configuration des Paramètres du bloc",list([])));
+o = scicos_block(gui="SUPER", graphics=scicos_graphics(exprs=lS));
+assert_checkequal(o.graphics.exprs, lS);
+// Masked SuperBlock with one parameter
+lDS = list("3",list("J",["Configuration des Paramètres du bloc"; "mon_param"],list("pol", -1)));
+o = scicos_block(gui="DSUPER", graphics=scicos_graphics(exprs=lDS));
+assert_checkequal(o.graphics.exprs, lDS);
+// CBLOCK, default has empty function body
+o = CBLOCK("define");
+lCB = list(["toto"; "n"; "1"; "1"; "[]"; "[]"; "[]"; "0"; "[]"; "[]"; "[]"; "[]"; "y"; "n"], []);
+assert_checkequal(o.graphics.exprs, lCB);
+// Add a function body
+lCB2 = list(["toto"; "n"; "1"; "1"; "[]"; "[]"; "[]"; "0"; "[]"; "[]"; "[]"; "[]"; "y"; "n"], ["Function body"]);
+o.graphics.exprs = lCB2;
+assert_checkequal(o.graphics.exprs, lCB2);
+// scifunc_block_m
+o = scifunc_block_m("define");
+lsci = list(["[1,1]";"[1,1]";"[]";"[]";"[]";"[]";"[]";"[]";"0"],list("y1=sin(u1)"," "," ","y1=sin(u1)"," "," "," "));
+assert_checkequal(o.graphics.exprs, lsci);
+// fortran_block
+o = fortran_block("define");
+lfort = list(["1";"1";"[]";"forty"],list([]));
+assert_checkequal(o.graphics.exprs, lfort);
+
 
 // Check that all the model items are freed
 clear
index feb657a..a7f05b4 100644 (file)
@@ -287,7 +287,7 @@ Graphics:
           sz = [20,20]
           flip = %t
           theta = 0
-          exprs = 
+          exprs = []
           pin = 2
           pout = 2
           pein = []
@@ -461,7 +461,7 @@ Graphics:
           sz = [20,20]
           flip = %t
           theta = 0
-          exprs = 
+          exprs = []
           pin = 2
           pout = 2
           pein = []
index 55ec0f6..63c711f 100644 (file)
@@ -270,7 +270,7 @@ Graphics:
           sz = [2,2]
           flip = %t
           theta = 0
-          exprs = 
+          exprs = []
           pin = 0
           pout = 0
           pein = []
@@ -314,7 +314,7 @@ orig = [0,0]
 sz = [2,2]
 flip = %t
 theta = 0
-exprs = 
+exprs = []
 pin = 0
 pout = 0
 pein = []
@@ -1284,7 +1284,7 @@ Graphics:
           sz = [2,2]
           flip = %t
           theta = 0
-          exprs = 
+          exprs = []
           pin = []
           pout = []
           pein = []
@@ -1328,7 +1328,7 @@ orig = [0,0]
 sz = [2,2]
 flip = %t
 theta = 0
-exprs = 
+exprs = []
 pin = []
 pout = []
 pein = []
@@ -1356,7 +1356,7 @@ evtout = 1
 state = []
 dstate = []
 odstate = list()
-rpar = mlist(["diagram","props","objs","version","contrib"],tlist(["params","wpar","title","tol","tf","context","void1","options","void2","void3","doc"],[],["Untitled";""],[0.000001,0.000001,1.000D-10,100001,0,1,0],100000,[],[],tlist("scsopt"),[],[],list()),list(mlist(["Block","graphics","model","gui","doc"],mlist(["graphics","orig","sz","flip","theta","exprs","pin","pout","pein","peout","gr_i","id","in_implicit","out_implicit","in_style","out_style","in_label","out_label","style"],[399,162],[20,20],%t,0,"1",[],[],5,[],[],"",[],[],..,..,..,..,""),mlist(["model","sim","in","in2","intyp","out","out2","outtyp","evtin","evtout","state","dstate","odstate","rpar","ipar","opar","blocktype","firing","dep_ut","label","nzcross","nmode","equations","uid"],"output",[],[],1,[],[],1,1,[],[],[],list(),[],1,list(),"d",[],[%f,%f],"",0,0,list(),""),"CLKOUT_f",list()),mlist(["Block","graphics","model","gui","doc"],mlist(["graphics","orig","sz","flip","theta","exprs","pin","pout","pein","peout","gr_i","id","in_implicit","out_implicit","in_style","out_style","in_label","out_label","style"],[320,232],[40,40],%t,0,["0.1";"0.1"],[],[],6,3,[],"",[],[],..,..,..,..,""),mlist(["model","sim","in","in2","intyp","out","out2","outtyp","evtin","evtout","state","dstate","odstate","rpar","ipar","opar","blocktype","firing","dep_ut","label","nzcross","nmode","equations","uid"],list("evtdly4",4),[],[],1,[],[],1,1,1,[],[],list(),[0.1;0.1],[],list(),"d",0.1,[%f,%f],"",0,0,list(),""),"EVTDLY_c",list()),mlist(["Link","xx","yy","id","thick","ct","from","to"],[340;340;380.71],[226.29;172;172],"",[0,0],[5,-1],[2,1,0],[4,1,1]),mlist(["Block","graphics","model","gui","doc"],mlist(["graphics","orig","sz","flip","theta","exprs","pin","pout","pein","peout","gr_i","id","in_implicit","out_implicit","in_style","out_style","in_label","out_label","style"],[380.71066,172],[0.3333333,0.3333333],%t,0,..,[],[],3,[5;6],[],"",[],[],..,..,..,..,""),mlist(["model","sim","in","in2","intyp","out","out2","outtyp","evtin","evtout","state","dstate","odstate","rpar","ipar","opar","blocktype","firing","dep_ut","label","nzcross","nmode","equations","uid"],"split",[],[],1,[],[],1,1,[1;1],[],[],list(),[],[],list(),"d",[0;0],[%f,%f],"",0,0,list(),""),"CLKSPLIT_f",list()),mlist(["Link","xx","yy","id","thick","ct","from","to"],[380.71;399],[172;172],"",[0,0],[5,-1],[4,1,0],[1,1,1]),mlist(["Link","xx","yy","id","thick","ct","from","to"],[380.71;380.71;340;340],[172;302;302;277.71],"",[0,0],[5,-1],[4,2,0],[2,1,1])),"",list())
+rpar = mlist(["diagram","props","objs","version","contrib"],tlist(["params","wpar","title","tol","tf","context","void1","options","void2","void3","doc"],[],["Untitled";""],[0.000001,0.000001,1.000D-10,100001,0,1,0],100000,[],[],tlist("scsopt"),[],[],list()),list(mlist(["Block","graphics","model","gui","doc"],mlist(["graphics","orig","sz","flip","theta","exprs","pin","pout","pein","peout","gr_i","id","in_implicit","out_implicit","in_style","out_style","in_label","out_label","style"],[399,162],[20,20],%t,0,"1",[],[],5,[],[],"",[],[],..,..,..,..,""),mlist(["model","sim","in","in2","intyp","out","out2","outtyp","evtin","evtout","state","dstate","odstate","rpar","ipar","opar","blocktype","firing","dep_ut","label","nzcross","nmode","equations","uid"],"output",[],[],1,[],[],1,1,[],[],[],list(),[],1,list(),"d",[],[%f,%f],"",0,0,list(),""),"CLKOUT_f",list()),mlist(["Block","graphics","model","gui","doc"],mlist(["graphics","orig","sz","flip","theta","exprs","pin","pout","pein","peout","gr_i","id","in_implicit","out_implicit","in_style","out_style","in_label","out_label","style"],[320,232],[40,40],%t,0,["0.1";"0.1"],[],[],6,3,[],"",[],[],..,..,..,..,""),mlist(["model","sim","in","in2","intyp","out","out2","outtyp","evtin","evtout","state","dstate","odstate","rpar","ipar","opar","blocktype","firing","dep_ut","label","nzcross","nmode","equations","uid"],list("evtdly4",4),[],[],1,[],[],1,1,1,[],[],list(),[0.1;0.1],[],list(),"d",0.1,[%f,%f],"",0,0,list(),""),"EVTDLY_c",list()),mlist(["Link","xx","yy","id","thick","ct","from","to"],[340;340;380.71],[226.29;172;172],"",[0,0],[5,-1],[2,1,0],[4,1,1]),mlist(["Block","graphics","model","gui","doc"],mlist(["graphics","orig","sz","flip","theta","exprs","pin","pout","pein","peout","gr_i","id","in_implicit","out_implicit","in_style","out_style","in_label","out_label","style"],[380.71066,172],[0.3333333,0.3333333],%t,0,[],[],[],3,[5;6],[],"",[],[],..,..,..,..,""),mlist(["model","sim","in","in2","intyp","out","out2","outtyp","evtin","evtout","state","dstate","odstate","rpar","ipar","opar","blocktype","firing","dep_ut","label","nzcross","nmode","equations","uid"],"split",[],[],1,[],[],1,1,[1;1],[],[],list(),[],[],list(),"d",[0;0],[%f,%f],"",0,0,list(),""),"CLKSPLIT_f",list()),mlist(["Link","xx","yy","id","thick","ct","from","to"],[380.71;399],[172;172],"",[0,0],[5,-1],[4,1,0],[1,1,1]),mlist(["Link","xx","yy","id","thick","ct","from","to"],[380.71;380.71;340;340],[172;302;302;277.71],"",[0,0],[5,-1],[4,2,0],[2,1,1])),"",list())
 ipar = []
 opar = list()
 blocktype = "h"
@@ -1502,7 +1502,7 @@ Graphics:
           sz = [0.3333333,0.3333333]
           flip = %t
           theta = 0
-          exprs = 
+          exprs = []
           pin = []
           pout = []
           pein = 3
@@ -1660,7 +1660,7 @@ orig = [380.71066,172]
 sz = [0.3333333,0.3333333]
 flip = %t
 theta = 0
-exprs = 
+exprs = []
 pin = []
 pout = []
 pein = 3
index edffbf0..a8d5e73 100644 (file)
@@ -117,7 +117,7 @@ Graphics:
           sz = [20,20]
           flip = %t
           theta = 0
-          exprs = 
+          exprs = []
           pin = []
           pout = []
           pein = []
@@ -233,7 +233,7 @@ evtout = []
 state = []
 dstate = []
 odstate = list()
-rpar = mlist(["diagram","props","objs","version","contrib"],tlist(["params","wpar","title","tol","tf","context","void1","options","void2","void3","doc"],[],["Untitled";""],[0.000001,0.000001,1.000D-10,100001,0,1,0],100000,[],[],tlist("scsopt"),[],[],list()),list(mlist(["Block","graphics","model","gui","doc"],mlist(["graphics","orig","sz","flip","theta","exprs","pin","pout","pein","peout","gr_i","id","in_implicit","out_implicit","in_style","out_style","in_label","out_label","style"],[0,0],[20,20],%t,0,..,[],[],[],[],[],"Quat_Conj",[],[],..,..,..,..,""),mlist(["model","sim","in","in2","intyp","out","out2","outtyp","evtin","evtout","state","dstate","odstate","rpar","ipar","opar","blocktype","firing","dep_ut","label","nzcross","nmode","equations","uid"],"super",[],[],1,[],[],1,[],[],[],[],list(),mlist(["diagram","props","objs","version","contrib"],tlist(["params","wpar","title","tol","tf","context","void1","options","void2","void3","doc"],[],["Untitled";""],[0.000001,0.000001,1.000D-10,100001,0,1,0],100000,[],[],tlist("scsopt"),[],[],list()),list(mlist(["Link","xx","yy","id","thick","ct","from","to"],[],[],"",[0,0],[1,1],[2,1,0],[3,1,1])),"",list()),[],list(),"h",[],[%f,%f],"Quat_Conj",0,0,list(),""),"",list())),"",list())
+rpar = mlist(["diagram","props","objs","version","contrib"],tlist(["params","wpar","title","tol","tf","context","void1","options","void2","void3","doc"],[],["Untitled";""],[0.000001,0.000001,1.000D-10,100001,0,1,0],100000,[],[],tlist("scsopt"),[],[],list()),list(mlist(["Block","graphics","model","gui","doc"],mlist(["graphics","orig","sz","flip","theta","exprs","pin","pout","pein","peout","gr_i","id","in_implicit","out_implicit","in_style","out_style","in_label","out_label","style"],[0,0],[20,20],%t,0,[],[],[],[],[],[],"Quat_Conj",[],[],..,..,..,..,""),mlist(["model","sim","in","in2","intyp","out","out2","outtyp","evtin","evtout","state","dstate","odstate","rpar","ipar","opar","blocktype","firing","dep_ut","label","nzcross","nmode","equations","uid"],"super",[],[],1,[],[],1,[],[],[],[],list(),mlist(["diagram","props","objs","version","contrib"],tlist(["params","wpar","title","tol","tf","context","void1","options","void2","void3","doc"],[],["Untitled";""],[0.000001,0.000001,1.000D-10,100001,0,1,0],100000,[],[],tlist("scsopt"),[],[],list()),list(mlist(["Link","xx","yy","id","thick","ct","from","to"],[],[],"",[0,0],[1,1],[2,1,0],[3,1,1])),"",list()),[],list(),"h",[],[%f,%f],"Quat_Conj",0,0,list(),""),"",list())),"",list())
 ipar = []
 opar = list()
 blocktype = "h"
@@ -265,7 +265,7 @@ Graphics:
           sz = [20,20]
           flip = %t
           theta = 0
-          exprs = 
+          exprs = []
           pin = []
           pout = []
           pein = []