copy SCI/macros/scicos to SCI/modules/scicos/macros/scicos_scicos
Allan Cornet [Thu, 31 Jan 2008 15:16:17 +0000 (15:16 +0000)]
376 files changed:
scilab/modules/scicos/macros/scicos_scicos/%Block_e.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/%Block_p.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/%b_i_graphics.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/%b_i_model.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/%c_i_block.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/%c_i_graphics.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/%c_i_model.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/%debug_scicos.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/%diagram_p.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/%graphics_e.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/%graphics_i_Block.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/%graphics_p.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/%l_i_block.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/%l_i_graphics.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/%l_i_model.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/%model_e.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/%model_i_Block.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/%model_p.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/%params_p.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/%s_i_block.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/%s_i_graphics.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/%s_i_model.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/AboutScicos_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/ActivateScilabWindow_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Addcolor_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Addnewblock_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Align_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Aspect_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/AvailableParameters_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Backgroundcolor_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/BlockDocumentation_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Branching.cosf [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/BrowseTo_.sci [new file with mode: 0755]
scilab/modules/scicos/macros/scicos_scicos/Browser_.sci [new file with mode: 0755]
scilab/modules/scicos/macros/scicos_scicos/CFORTR.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/CFORTR2.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Calc_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/CodeGeneration_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Color_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Compile_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Context_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Copy_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/CreateMask_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/CtrlSelect_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/CustomizeMask_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Cut_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/DebugLevel_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Defaultlinkcolors_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Defaultwindowparameters_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Delete_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/DemoBlocks.cosf [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Demos_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Details_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/DisableAllMenus.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Documentation_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Duplicate_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Electrical.cosf [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/EnableAllMenus.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Eval_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Events.cosf [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/ExitScicos_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/ExportAll_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Export_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/FORTR.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/FindSBParams.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Find_Next_Step.sci [new file with mode: 0755]
scilab/modules/scicos/macros/scicos_scicos/Fitdiagramtofigure_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Flip_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/GetInfo_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Grid_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Help_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/IDfonts_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/IconEditor_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Icon_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Identification_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Integer.cosf [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Label_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Linear.cosf [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Link_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/LoadasPalette_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/MODCOM.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Matrix.cosf [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Modelica_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/MoveLink_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Move_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Navigator_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/New_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Non_linear.cosf [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Nyquist_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/OldBlocks.cosf [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/OpenSet_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Open_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Others.cosf [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/PalTree_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Paleditor_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Palettes_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Paste_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/PlaceinBrowser_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/PlaceinDiagram_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Popup_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Purge_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/RegiontoSuperBlock_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/RemoveMask_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Rename_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Replot_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Resize_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/RotateLeft_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/RotateRight_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Run_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/SaveAs_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/SaveBlockGUI_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Save_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/SaveasInterfFunc_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/SaveasPalette_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/ScicosDocumentation_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/SelectAll_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/SelectLink_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/SelectRegion_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/SetDiagramInfo_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Setgrid_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Setup_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Shortcuts_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/ShowBlockShadow_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Sinks.cosf [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/SmartMove_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Sources.cosf [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/ThermoHydraulics.cosf [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Threshold.cosf [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/TkPopup_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Undo_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/UpToMainDiagram_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Window_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Zoomin_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/Zoomout_.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/add_palette.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/adjust.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/adjust_in2out2.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/adjust_s_ports.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/analyse.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/bad_connection.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/build_block.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/build_modelica_block.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/build_scs_tree.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/buildmacros.sce [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/buildnewblock.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/c_pass1.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/c_pass2.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/c_pass3.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/change_tree_elt.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/changeports.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/check_edge.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/check_io.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/check_mac.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/choosefile.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/clickin.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/close_inactive_windows.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/color.tst [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/compile_modelica.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/connected_links.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/context_evstr.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/cos2cosf.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/cosclick.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/countblocks.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/create_modelica.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/create_modelica1.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/ctree.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/default_color.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/default_options.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/delete_unconnected.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/dialog.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/dig_bound.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/disablemenus.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/disconnect_ports.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/dist2polyline.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_SaveAs.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_addnew.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_block.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_block_info.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_browser.sci [new file with mode: 0755]
scilab/modules/scicos/macros/scicos_scicos/do_color.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_compile.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_context.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_delete.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_delete1.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_delete2.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_details.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_doc.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_duplicate.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_edit_pal.bug [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_edit_pal.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_eval.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_exit.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_export.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_focus.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_grid.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_help.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_icon_edit.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_ident.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_label.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_load.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_load_as_palette.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_move.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_navigator.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_newblk.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_options.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_pal_tree.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_palettes.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_placeindiagram.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_purge.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_region2block.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_rename.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_replace.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_resize.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_run.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_save.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_saveblockgui.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_scsm_tree.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_select2block.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_set_info.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_setup.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_stupidMultimove.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_stupidmove.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_terminate.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_tild.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_turn.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_update.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_version.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_view.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_window.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_xsetech.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_zoomin.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/do_zoomout.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/drawblock.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/drawgrid.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/drawlink.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/drawobj.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/drawobjs.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/drawtitle.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/enablemenus.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/entity_menu.sce [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/extract_implicit.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/findinlist.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/findinlistcmd.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/findopenchildren.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/gen_modelica.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/genfunc.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/genfunc1.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/genfunc2.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/genmac.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/genmoc.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/get2index.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/get_block_info.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/get_blocks_in_rect.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/get_connected.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/get_errorcmd.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/get_gri.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/get_info.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/get_inside.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/get_inside2.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/get_new_window.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/get_rectangle.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/get_region.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/get_region2.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/get_selection.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/get_subobj_path.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/get_tree_elt.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/getblock.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/getblocklink.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/getblocktext.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/getgeom.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/getinputports.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/getinputs.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/getlink.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/getobj.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/getorigin.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/getoutputports.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/getoutputs.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/getparpath.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/getportsiz.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/getporttyp.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/global_case.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/gridpoint.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/hilite_obj.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/hilite_path.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/init_agenda.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/is_modelica_block.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/is_split.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/lnkptrcomp.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/loadpallibs.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/lstfiles.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/mark_newpars.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/mark_prt.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/menu_stuff.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/message.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/mkvect.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/modelica.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/modipar.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/newc_pass2.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/point2pixel.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/prt_align.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/pwindow_read_size.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/pwindow_set_size.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/replayifnecessary.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/restore.sci [new file with mode: 0755]
scilab/modules/scicos/macros/scicos_scicos/restore_scs_gc.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/rotate_compound.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/rubberbox.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/s_port_names.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/sample_clk.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/save_csuper.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/save_scs_gc.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/save_super.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/sci2tcl.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/scicos_block.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/scicos_block_link.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/scicos_cpr.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/scicos_diagram.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/scicos_flat.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/scicos_graphics.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/scicos_link.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/scicos_model.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/scicos_params.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/scicos_sim.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/scicos_state.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/script2var.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/scs_full_path.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/scs_show.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/selecthilite.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/set_background.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/set_cmap.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/set_io.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/set_viewport.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/setvalue.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/shiftcors.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/show_info.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/split_lasterror.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/splitfilepath_cos.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/splitted_links.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/standard_define.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/standard_define_old.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/standard_document.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/standard_draw.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/standard_draw_ports.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/standard_draw_ports_up.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/standard_etiquette.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/standard_inputs.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/standard_origin.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/standard_outputs.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/stupid_dist2polyline.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/stupid_getobj.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/systexport.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/systshow.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/tabule.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/tk_UXstygetfile.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/tk_UXstysavefile.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/tk_getcolor.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/tk_getdirectory.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/tk_getvalue.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/tk_mdialog.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/tk_message.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/tk_messageW.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/tk_mpopup.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/tk_mpopupX.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/tk_scicos_choose.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/tkscaleblk.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/tree_show.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/unhilite_obj.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/update_gr.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/update_redraw_obj.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/update_scicos_pal.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/validvar.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/value2modelica.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/whereintree.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/width2pixel.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/window_read_size.sci [new file with mode: 0644]
scilab/modules/scicos/macros/scicos_scicos/window_set_size.sci [new file with mode: 0644]

diff --git a/scilab/modules/scicos/macros/scicos_scicos/%Block_e.sci b/scilab/modules/scicos/macros/scicos_scicos/%Block_e.sci
new file mode 100644 (file)
index 0000000..813e26c
--- /dev/null
@@ -0,0 +1,34 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function varargout=%Block_e(i,o)
+//function used only for backward compatibility of scicos blocks gui
+  warning('Obsolete use of o(i) in this scicos block')
+  varargout=list()
+  for k=1:size(i,'*')
+    ik=i(k)
+    if ik==1 then
+      varargout($+1)='Block'
+    else
+      varargout($+1)=getfield(ik,o)
+    end
+  end
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/%Block_p.sci b/scilab/modules/scicos/macros/scicos_scicos/%Block_p.sci
new file mode 100644 (file)
index 0000000..bbfb3ec
--- /dev/null
@@ -0,0 +1,56 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function %Block_p(block)
+  txt=['GUI     : '+block.gui 
+       'Graphics: '
+       '          '+graphics2txt(block.graphics)
+       'Model   : '
+       '          '+model2txt(block.model)]
+  write(%io(2),txt,'(a)')
+endfunction
+
+function txt=graphics2txt(graphics)
+  fn=getfield(1,graphics)
+  txt=[]
+  for k=2:size(fn,'*')
+    txt=[txt
+        sci2exp(graphics(fn(k)),fn(k))]
+  end
+endfunction
+
+function txt=model2txt(model)
+  sim=model.sim
+  if type(sim)==15 then
+    txt=sim(1)+' type: '+string(sim(2))
+  else
+    txt=sim+' type: 0'
+  end
+  fn=getfield(1,model)
+  for k=3:size(fn,'*')
+    if fn(k)=='rpar' & type(model(fn(k)))==15 then
+      txt=[txt;fn(k)+' : SuperBlock'];
+    else
+      txt=[txt
+          sci2exp(model(fn(k)),fn(k))];
+    end
+  end
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/%b_i_graphics.sci b/scilab/modules/scicos/macros/scicos_scicos/%b_i_graphics.sci
new file mode 100644 (file)
index 0000000..2f761b6
--- /dev/null
@@ -0,0 +1,25 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function g=%b_i_graphics(i,b,g)
+//function used only for backward compatibility of scicos blocks gui
+  setfield(i+1,b,g)
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/%b_i_model.sci b/scilab/modules/scicos/macros/scicos_scicos/%b_i_model.sci
new file mode 100644 (file)
index 0000000..42b1f45
--- /dev/null
@@ -0,0 +1,26 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function m=%b_i_model(i,b,m)
+//function used only for backward compatibility of scicos blocks gui
+  if i>13 then warning('Field '+string(i)+' no longer in model, check'),end
+  setfield(i+1,b,m)
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/%c_i_block.sci b/scilab/modules/scicos/macros/scicos_scicos/%c_i_block.sci
new file mode 100644 (file)
index 0000000..fa60209
--- /dev/null
@@ -0,0 +1,25 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function o=%c_i_block(i,b,o)
+//function used only for backward compatibility of scicos blocks gui
+  if i<>1 then setfield(i,b,o),end
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/%c_i_graphics.sci b/scilab/modules/scicos/macros/scicos_scicos/%c_i_graphics.sci
new file mode 100644 (file)
index 0000000..13f0c18
--- /dev/null
@@ -0,0 +1,25 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function g=%c_i_graphics(i,b,g)
+//function used only for backward compatibility of scicos blocks gui
+  setfield(i+1,b,g)
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/%c_i_model.sci b/scilab/modules/scicos/macros/scicos_scicos/%c_i_model.sci
new file mode 100644 (file)
index 0000000..c15fd2d
--- /dev/null
@@ -0,0 +1,26 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function m=%c_i_model(i,b,m)
+//function used only for backward compatibility of scicos blocks gui
+  if i>13 then warning('Field '+string(i)+' no longer in model, check'),end
+  setfield(i+1,b,m)
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/%debug_scicos.sci b/scilab/modules/scicos/macros/scicos_scicos/%debug_scicos.sci
new file mode 100644 (file)
index 0000000..ae6997f
--- /dev/null
@@ -0,0 +1,29 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function [block] = %debug_scicos(block,flag)
+  if execstr('load(TMPDIR+''/debug_scicos'')','errcatch')<>0 then
+    disp('Instantiate the Debug block')
+  else
+    [block] = debug_scicos(block,flag)
+  end
+  
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/%diagram_p.sci b/scilab/modules/scicos/macros/scicos_scicos/%diagram_p.sci
new file mode 100644 (file)
index 0000000..22a26b8
--- /dev/null
@@ -0,0 +1,32 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function %diagram_p(scs_m)
+   %params_p(scs_m.props)
+   nams=[]
+   for o=scs_m.objs
+     if typeof(o)=='Block' then
+       nams=[nams;o.gui]
+     end
+   end
+   nums=part(string(1:size(nams,'*'))',1:6)
+   write(%io(2),nums+nams,'(a)')
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/%graphics_e.sci b/scilab/modules/scicos/macros/scicos_scicos/%graphics_e.sci
new file mode 100644 (file)
index 0000000..f93a440
--- /dev/null
@@ -0,0 +1,29 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function varargout=%graphics_e(i,o)
+//function used only for backward compatibility of scicos blocks gui
+  warning('Obsolete use of graphics(i) in this scicos block')
+  varargout=list()
+  for k=1:size(i,'*')
+    varargout($+1)=getfield(i(k)+1,o)
+  end
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/%graphics_i_Block.sci b/scilab/modules/scicos/macros/scicos_scicos/%graphics_i_Block.sci
new file mode 100644 (file)
index 0000000..f39f332
--- /dev/null
@@ -0,0 +1,24 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function g=%graphics_i_Block(i,b,g)
+setfield(i,b,g)
+endfunction   
diff --git a/scilab/modules/scicos/macros/scicos_scicos/%graphics_p.sci b/scilab/modules/scicos/macros/scicos_scicos/%graphics_p.sci
new file mode 100644 (file)
index 0000000..351df71
--- /dev/null
@@ -0,0 +1,30 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function %graphics_p(graphics)
+  fn=getfield(1,graphics)
+  txt=[]
+  for k=2:size(fn,'*')
+    txt=[txt
+        sci2exp(graphics(fn(k)),fn(k))]
+  end
+  write(%io(2),txt,'(a)')
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/%l_i_block.sci b/scilab/modules/scicos/macros/scicos_scicos/%l_i_block.sci
new file mode 100644 (file)
index 0000000..ce44da5
--- /dev/null
@@ -0,0 +1,25 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function o=%l_i_block(i,b,o)
+//function used only for backward compatibility of scicos blocks gui
+  setfield(i,b,o)
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/%l_i_graphics.sci b/scilab/modules/scicos/macros/scicos_scicos/%l_i_graphics.sci
new file mode 100644 (file)
index 0000000..e160e8c
--- /dev/null
@@ -0,0 +1,25 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function g=%l_i_graphics(i,b,g)
+//function used only for backward compatibility of scicos blocks gui
+  setfield(i+1,b,g)
+endfunction 
diff --git a/scilab/modules/scicos/macros/scicos_scicos/%l_i_model.sci b/scilab/modules/scicos/macros/scicos_scicos/%l_i_model.sci
new file mode 100644 (file)
index 0000000..144fe48
--- /dev/null
@@ -0,0 +1,26 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function m=%l_i_model(i,b,m)
+//function used only for backward compatibility of scicos blocks gui
+  if i>13 then warning('Field '+string(i)+' no longer in model, check'),end
+  setfield(i+1,b,m)
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/%model_e.sci b/scilab/modules/scicos/macros/scicos_scicos/%model_e.sci
new file mode 100644 (file)
index 0000000..2c079ca
--- /dev/null
@@ -0,0 +1,29 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function varargout=%model_e(i,o)
+//function used only for backward compatibility of scicos blocks gui
+  warning('Obsolete use of model(i) in this scicos block')
+  varargout=list()
+  for k=1:size(i,'*')
+    varargout($+1)=getfield(i(k)+1,o)
+  end
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/%model_i_Block.sci b/scilab/modules/scicos/macros/scicos_scicos/%model_i_Block.sci
new file mode 100644 (file)
index 0000000..0670441
--- /dev/null
@@ -0,0 +1,24 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function g=%model_i_Block(i,b,g)
+setfield(i,b,g)
+endfunction   
diff --git a/scilab/modules/scicos/macros/scicos_scicos/%model_p.sci b/scilab/modules/scicos/macros/scicos_scicos/%model_p.sci
new file mode 100644 (file)
index 0000000..38acba0
--- /dev/null
@@ -0,0 +1,40 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function %model_p(model)
+
+  sim=model.sim
+  if type(sim)==15 then
+    if type(sim(1))==13 then
+       txt='scifunc' 
+    else
+      txt=sim(1)+' type: '+string(sim(2))
+    end
+  else 
+    txt=sim+' type: 0'
+  end
+  fn=getfield(1,model)
+  for k=3:size(fn,'*')
+    txt=[txt
+        sci2exp(model(fn(k)),fn(k))]
+  end
+  write(%io(2),txt,'(a)')
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/%params_p.sci b/scilab/modules/scicos/macros/scicos_scicos/%params_p.sci
new file mode 100644 (file)
index 0000000..509c265
--- /dev/null
@@ -0,0 +1,34 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function %params_p(par)
+  write(%io(2),params2txt(par),'(a)')
+endfunction
+  
+function txt=params2txt(par)
+  fn=getfield(1,par)
+  txt=[]
+  for k=2:size(fn,'*')
+    txt=[txt
+        sci2exp(par(fn(k)),fn(k))]
+  end
+endfunction
+
diff --git a/scilab/modules/scicos/macros/scicos_scicos/%s_i_block.sci b/scilab/modules/scicos/macros/scicos_scicos/%s_i_block.sci
new file mode 100644 (file)
index 0000000..fb72ae2
--- /dev/null
@@ -0,0 +1,25 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function o=%s_i_block(i,b,o)
+//function used only for backward compatibility of scicos blocks gui
+   setfield(i,b,o)
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/%s_i_graphics.sci b/scilab/modules/scicos/macros/scicos_scicos/%s_i_graphics.sci
new file mode 100644 (file)
index 0000000..4ad1ef2
--- /dev/null
@@ -0,0 +1,25 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function g=%s_i_graphics(i,b,g)
+//function used only for backward compatibility of scicos blocks gui
+   setfield(i+1,b,g)
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/%s_i_model.sci b/scilab/modules/scicos/macros/scicos_scicos/%s_i_model.sci
new file mode 100644 (file)
index 0000000..bdcb394
--- /dev/null
@@ -0,0 +1,26 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function m=%s_i_model(i,b,m)
+//function used only for backward compatibility of scicos blocks gui
+  if i>13 then warning('Field '+string(i)+' no longer in model, check'),end
+  setfield(i+1,b,m)
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/AboutScicos_.sci b/scilab/modules/scicos/macros/scicos_scicos/AboutScicos_.sci
new file mode 100644 (file)
index 0000000..c949cbe
--- /dev/null
@@ -0,0 +1,42 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function AboutScicos_()
+
+
+  Cmenu=[] ; %pt=[];
+
+  if MSDOS & evstr(TCL_EvalStr('file exists $env(COMSPEC)'))     then
+    num=message([strsubst(get_scicos_version(),"scicos","Scicos -")+"-";...
+             "For more information visit:";...
+            "     www.scicos.org      "],['Open URL','Cancel']);
+
+    if num==1 then
+      TCL_EvalStr('exec $env(COMSPEC) /c start http://www.scicos.org &')
+    end
+    
+  else
+    message([strsubst(get_scicos_version(),"scicos","Scicos -")+"-";...
+             "For more information visit:";...
+            "     www.scicos.org      "]);
+  end
+
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/ActivateScilabWindow_.sci b/scilab/modules/scicos/macros/scicos_scicos/ActivateScilabWindow_.sci
new file mode 100644 (file)
index 0000000..5835913
--- /dev/null
@@ -0,0 +1,35 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function ActivateScilabWindow_()
+
+  Cmenu = [] ;
+  %pt = []   ;
+
+
+
+  if super_block then
+    Scicos_commands=['%diagram_path_objective=[];%scicos_navig=1';
+                    'Cmenu='"Activate Scilab Window'";%scicos_navig=[]']
+  else
+    Cmenu = 'Leave'
+  end
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/Addcolor_.sci b/scilab/modules/scicos/macros/scicos_scicos/Addcolor_.sci
new file mode 100644 (file)
index 0000000..6043bb8
--- /dev/null
@@ -0,0 +1,44 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function Addcolor_()
+//
+    [edited,options] = do_options(scs_m.props.options,'Cmap')
+
+    if edited then
+      scs_m.props.options=options
+      set_cmap(scs_m.props.options('Cmap'))
+      set_background()
+      // Acquire the current clicked window and put to "on" the pixmap mode
+      gh_curwin = scf(%win) ;
+
+      //** Clear the graphic window WITHOUT changing his pamaters ! :)
+      drawlater() ;
+        delete(gh_curwin.children.children) ; //** wipe out all the temp graphics object
+        drawobjs(scs_m, gh_curwin) ;   //** re-create all the graphics object
+      drawnow(); show_pixmap() ;      //** re-draw the graphic object and show on screen
+     Cmenu = [] ; %pt = [];
+
+    else
+      Cmenu=[];%pt=[];
+    end
+
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/Addnewblock_.sci b/scilab/modules/scicos/macros/scicos_scicos/Addnewblock_.sci
new file mode 100644 (file)
index 0000000..8c7e99e
--- /dev/null
@@ -0,0 +1,30 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function Addnewblock_()
+    Cmenu=[]// here because Cmenu Quit can come out
+    [scs_m,%fct]=do_addnew(scs_m)
+    if %fct<>[] then 
+      if %fct<>emptystr() then
+       getf(%fct),  // requires loading function
+      end
+    end
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/Align_.sci b/scilab/modules/scicos/macros/scicos_scicos/Align_.sci
new file mode 100644 (file)
index 0000000..df9dff7
--- /dev/null
@@ -0,0 +1,28 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function Align_()
+//
+  Cmenu=[];
+  %pt1=%pt;%pt=[];
+  scs_m_save=scs_m;nc_save=needcompile;
+  [scs_m]=prt_align(%pt1,scs_m)
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/Aspect_.sci b/scilab/modules/scicos/macros/scicos_scicos/Aspect_.sci
new file mode 100644 (file)
index 0000000..c8d8597
--- /dev/null
@@ -0,0 +1,30 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function Aspect_()
+//
+  Cmenu=[]
+  [edited,options]=do_options(scs_m.props.options,'3D')
+  scs_m.props.options=options
+  
+  if edited then Cmenu='Replot',end
+  
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/AvailableParameters_.sci b/scilab/modules/scicos/macros/scicos_scicos/AvailableParameters_.sci
new file mode 100644 (file)
index 0000000..d45b6b5
--- /dev/null
@@ -0,0 +1,26 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function AvailableParameters_()
+//
+  Cmenu=[]
+  tree_show(%scicos_context,'Available parameters:')
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/Backgroundcolor_.sci b/scilab/modules/scicos/macros/scicos_scicos/Backgroundcolor_.sci
new file mode 100644 (file)
index 0000000..0925bdc
--- /dev/null
@@ -0,0 +1,49 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function Backgroundcolor_()
+//
+    Cmenu=[]
+
+    if curwin==%win then
+      scf(%win);
+    else
+      message("Only current window can be edited.")
+    end
+
+    [edited,options] = do_options(scs_m.props.options,'Background')
+
+    scs_m.props.options = options
+
+    if edited then
+      scs_m.props.options=options
+      set_background()
+      // Acquire the current clicked window and put to "on" the pixmap mode
+      gh_curwin = scf(%win) ;
+      //** Clear the graphic window WITHOUT changing his pamaters ! :)
+      drawlater() ;
+        delete(gh_curwin.children.children) ; //** wipe out all the temp graphics object
+        drawobjs(scs_m, gh_curwin) ;   //** re-create all the graphics object
+      drawnow(); show_pixmap() ;      //** re-draw the graphic object and show on screen
+      Cmenu = [] ; %pt = [];
+    end
+
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/BlockDocumentation_.sci b/scilab/modules/scicos/macros/scicos_scicos/BlockDocumentation_.sci
new file mode 100644 (file)
index 0000000..012709c
--- /dev/null
@@ -0,0 +1,26 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function  BlockDocumentation_()
+// 
+    scs_m = do_doc(scs_m,%pt) ;
+    Cmenu=[];%pt=[]
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/Branching.cosf b/scilab/modules/scicos/macros/scicos_scicos/Branching.cosf
new file mode 100644 (file)
index 0000000..619a65c
--- /dev/null
@@ -0,0 +1,1435 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+scs_m=scicos_diagram(..
+      version="scicos4.2",..
+      props=scicos_params(..
+            wpar=[600,450,0,0,600,450],..
+            Title=["Branching","SCI/macros/scicos/"],..
+            tol=[0.0001,0.000001,1.000E-10,100001,0,0],..
+            tf=100000,..
+            context=[],..
+            void1=[],..
+            options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(%t,33),[8,1],[1,5],..
+            list([5,1],[4,1]),[0.8,0.8,0.8]),..
+            void2=[],..
+            void3=[],..
+            doc=list()))
+scs_m.objs(1)=scicos_block(..
+              gui="DEMUX",..
+              graphics=scicos_graphics(..
+                       orig=[0,0],..
+                       sz=[10,40],..
+                       flip=%t,..
+                       theta=0,..
+                       exprs="2",..
+                       pin=0,..
+                       pout=[0;0],..
+                       pein=[],..
+                       peout=[],..
+                       gr_i=list("",8),..
+                       id="Demux",..
+                       in_implicit="E",..
+                       out_implicit=["E";"E"]),..
+              model=scicos_model(..
+                       sim=list("multiplex",4),..
+                       in=0,..
+                       in2=[],..
+                       intyp=1,..
+                       out=[-1;-2],..
+                       out2=[],..
+                       outtyp=1,..
+                       evtin=[],..
+                       evtout=[],..
+                       state=[],..
+                       dstate=[],..
+                       odstate=list(),..
+                       rpar=[],..
+                       ipar=2,..
+                       opar=list(),..
+                       blocktype="c",..
+                       firing=[],..
+                       dep_ut=[%t,%f],..
+                       label="",..
+                       nzcross=0,..
+                       nmode=0,..
+                       equations=list()),..
+              doc=list())
+scs_m.objs(2)=scicos_block(..
+              gui="MUX",..
+              graphics=scicos_graphics(..
+                       orig=[40,0],..
+                       sz=[10,40],..
+                       flip=%t,..
+                       theta=0,..
+                       exprs="2",..
+                       pin=[0;0],..
+                       pout=0,..
+                       pein=[],..
+                       peout=[],..
+                       gr_i=list(" ",8),..
+                       id="Mux",..
+                       in_implicit=["E";"E"],..
+                       out_implicit="E"),..
+              model=scicos_model(..
+                       sim=list("multiplex",4),..
+                       in=[-1;-2],..
+                       in2=[],..
+                       intyp=1,..
+                       out=0,..
+                       out2=[],..
+                       outtyp=1,..
+                       evtin=[],..
+                       evtout=[],..
+                       state=[],..
+                       dstate=[],..
+                       odstate=list(),..
+                       rpar=[],..
+                       ipar=2,..
+                       opar=list(),..
+                       blocktype="c",..
+                       firing=[],..
+                       dep_ut=[%t,%f],..
+                       label="",..
+                       nzcross=0,..
+                       nmode=0,..
+                       equations=list()),..
+              doc=list())
+scs_m.objs(3)=scicos_block(..
+              gui="NRMSOM_f",..
+              graphics=scicos_graphics(..
+                       orig=[80,0],..
+                       sz=[4,40],..
+                       flip=%t,..
+                       theta=0,..
+                       exprs="2",..
+                       pin=[0;0],..
+                       pout=0,..
+                       pein=[],..
+                       peout=[],..
+                       gr_i=list(" ",8),..
+                       id="",..
+                       in_implicit=["E";"E"],..
+                       out_implicit="E"),..
+              model=scicos_model(..
+                       sim="junk",..
+                       in=[-1;-1],..
+                       in2=[],..
+                       intyp=1,..
+                       out=-1,..
+                       out2=[],..
+                       outtyp=1,..
+                       evtin=[],..
+                       evtout=[],..
+                       state=[],..
+                       dstate=[],..
+                       odstate=list(),..
+                       rpar=[],..
+                       ipar=[],..
+                       opar=list(),..
+                       blocktype="c",..
+                       firing=[],..
+                       dep_ut=[%t,%f],..
+                       label="",..
+                       nzcross=0,..
+                       nmode=0,..
+                       equations=list()),..
+              doc=list())
+scs_m.objs(4)=scicos_block(..
+              gui="EXTRACTOR",..
+              graphics=scicos_graphics(..
+                       orig=[114,0],..
+                       sz=[40,40],..
+                       flip=%t,..
+                       theta=0,..
+                       exprs="1",..
+                       pin=0,..
+                       pout=0,..
+                       pein=[],..
+                       peout=[],..
+                       gr_i=list(..
+                       ["txt=[''Extractor''];";"xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'');"],8),..
+                       id="",..
+                       in_implicit="E",..
+                       out_implicit="E"),..
+              model=scicos_model(..
+                       sim=list("extractor",4),..
+                       in=-1,..
+                       in2=[],..
+                       intyp=1,..
+                       out=1,..
+                       out2=[],..
+                       outtyp=1,..
+                       evtin=[],..
+                       evtout=[],..
+                       state=[],..
+                       dstate=[],..
+                       odstate=list(),..
+                       rpar=[],..
+                       ipar=1,..
+                       opar=list(),..
+                       blocktype="c",..
+                       firing=[],..
+                       dep_ut=[%t,%f],..
+                       label="",..
+                       nzcross=0,..
+                       nmode=0,..
+                       equations=list()),..
+              doc=list())
+scs_m.objs(5)=scicos_block(..
+              gui="SELECT_m",..
+              graphics=scicos_graphics(..
+                       orig=[184,0],..
+                       sz=[40,40],..
+                       flip=%t,..
+                       theta=0,..
+                       exprs=["1";"2";"1"],..
+                       pin=[0;0],..
+                       pout=0,..
+                       pein=[0;0],..
+                       peout=[],..
+                       gr_i=list("xstringb(orig(1),orig(2),''Selector'',sz(1),sz(2),''fill'');",8),..
+                       id="",..
+                       in_implicit=["E";"E"],..
+                       out_implicit="E"),..
+              model=scicos_model(..
+                       sim=list("selector_m",4),..
+                       in=[-1;-1],..
+                       in2=[-2;-2],..
+                       intyp=1,..
+                       out=-1,..
+                       out2=-2,..
+                       outtyp=1,..
+                       evtin=[1;1],..
+                       evtout=[],..
+                       state=[],..
+                       dstate=1,..
+                       odstate=list(),..
+                       rpar=[],..
+                       ipar=[],..
+                       opar=list(),..
+                       blocktype="c",..
+                       firing=[],..
+                       dep_ut=[%t,%f],..
+                       label="",..
+                       nzcross=0,..
+                       nmode=0,..
+                       equations=list()),..
+              doc=list())
+scs_m.objs(6)=scicos_block(..
+              gui="ISELECT_m",..
+              graphics=scicos_graphics(..
+                       orig=[254,0],..
+                       sz=[40,40],..
+                       flip=%t,..
+                       theta=0,..
+                       exprs=["1";"2";"1"],..
+                       pin=0,..
+                       pout=[0;0],..
+                       pein=[0;0],..
+                       peout=[],..
+                       gr_i=list("xstringb(orig(1),orig(2),''Selector'',sz(1),sz(2),''fill'');",8),..
+                       id="",..
+                       in_implicit="E",..
+                       out_implicit=["E";"E"]),..
+              model=scicos_model(..
+                       sim=list("selector_m",4),..
+                       in=-1,..
+                       in2=-2,..
+                       intyp=1,..
+                       out=[-1;-1],..
+                       out2=[-2;-2],..
+                       outtyp=1,..
+                       evtin=[1;1],..
+                       evtout=[],..
+                       state=[],..
+                       dstate=1,..
+                       odstate=list(),..
+                       rpar=[],..
+                       ipar=[],..
+                       opar=list(),..
+                       blocktype="c",..
+                       firing=[],..
+                       dep_ut=[%t,%f],..
+                       label="",..
+                       nzcross=0,..
+                       nmode=0,..
+                       equations=list()),..
+              doc=list())
+scs_m.objs(7)=scicos_block(..
+              gui="RELAY_f",..
+              graphics=scicos_graphics(..
+                       orig=[324,0],..
+                       sz=[40,40],..
+                       flip=%t,..
+                       theta=0,..
+                       exprs=["2";"1"],..
+                       pin=[0;0],..
+                       pout=0,..
+                       pein=[0;0],..
+                       peout=[],..
+                       gr_i=list("xstringb(orig(1),orig(2),''Relay'',sz(1),sz(2),''fill'');",8),..
+                       id="",..
+                       in_implicit=["E";"E"],..
+                       out_implicit="E"),..
+              model=scicos_model(..
+                       sim=list("relay",2),..
+                       in=[-1;-1],..
+                       in2=[],..
+                       intyp=1,..
+                       out=-1,..
+                       out2=[],..
+                       outtyp=1,..
+                       evtin=[1;1],..
+                       evtout=[],..
+                       state=[],..
+                       dstate=0,..
+                       odstate=list(),..
+                       rpar=[],..
+                       ipar=[],..
+                       opar=list(),..
+                       blocktype="c",..
+                       firing=[],..
+                       dep_ut=[%t,%t],..
+                       label="",..
+                       nzcross=0,..
+                       nmode=0,..
+                       equations=list()),..
+              doc=list())
+scs_m.objs(8)=scicos_block(..
+              gui="SWITCH2_m",..
+              graphics=scicos_graphics(..
+                       orig=[394,0],..
+                       sz=[40,40],..
+                       flip=%t,..
+                       theta=0,..
+                       exprs=["1";"0";"0";"1"],..
+                       pin=[0;0;0],..
+                       pout=0,..
+                       pein=[],..
+                       peout=[],..
+                       gr_i=list("xstringb(orig(1),orig(2),[''switch''],sz(1),sz(2),''fill'');",8),..
+                       id="",..
+                       in_implicit=["E";"E";"E"],..
+                       out_implicit="E"),..
+              model=scicos_model(..
+                       sim=list("switch2_m",4),..
+                       in=[-1;1;-1],..
+                       in2=[-2;1;-2],..
+                       intyp=1,..
+                       out=-1,..
+                       out2=-2,..
+                       outtyp=1,..
+                       evtin=[],..
+                       evtout=[],..
+                       state=[],..
+                       dstate=[],..
+                       odstate=list(),..
+                       rpar=0,..
+                       ipar=0,..
+                       opar=list(),..
+                       blocktype="c",..
+                       firing=[],..
+                       dep_ut=[%t,%f],..
+                       label="",..
+                       nzcross=1,..
+                       nmode=1,..
+                       equations=list()),..
+              doc=list())
+scs_m.objs(9)=scicos_block(..
+              gui="IFTHEL_f",..
+              graphics=scicos_graphics(..
+                       orig=[0,70],..
+                       sz=[60,60],..
+                       flip=%t,..
+                       theta=0,..
+                       exprs=["1";"1"],..
+                       pin=0,..
+                       pout=[],..
+                       pein=0,..
+                       peout=[0;0],..
+                       gr_i=list(..
+                       ["txt=[''If in>0'';'' '';'' then    else''];";
+                       "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'');"],8),..
+                       id="",..
+                       in_implicit="E",..
+                       out_implicit=[]),..
+              model=scicos_model(..
+                       sim=list("ifthel",-1),..
+                       in=1,..
+                       in2=1,..
+                       intyp=-1,..
+                       out=[],..
+                       out2=[],..
+                       outtyp=1,..
+                       evtin=1,..
+                       evtout=[1;1],..
+                       state=[],..
+                       dstate=[],..
+                       odstate=list(),..
+                       rpar=[],..
+                       ipar=[],..
+                       opar=list(),..
+                       blocktype="l",..
+                       firing=[-1,-1],..
+                       dep_ut=[%t,%f],..
+                       label="",..
+                       nzcross=1,..
+                       nmode=1,..
+                       equations=list()),..
+              doc=list())
+scs_m.objs(10)=scicos_block(..
+               gui="ESELECT_f",..
+               graphics=scicos_graphics(..
+                        orig=[90,70],..
+                        sz=[60,40],..
+                        flip=%t,..
+                        theta=0,..
+                        exprs=["2";"1";"0"],..
+                        pin=0,..
+                        pout=[],..
+                        pein=0,..
+                        peout=[0;0],..
+                        gr_i=list(..
+                        ["txt=[''event select''];";"xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'');"],..
+                        8),..
+                        id="",..
+                        in_implicit="E",..
+                        out_implicit=[]),..
+               model=scicos_model(..
+                        sim=list("eselect",-2),..
+                        in=1,..
+                        in2=1,..
+                        intyp=-1,..
+                        out=[],..
+                        out2=[],..
+                        outtyp=1,..
+                        evtin=1,..
+                        evtout=[1;1],..
+                        state=[],..
+                        dstate=[],..
+                        odstate=list(),..
+                        rpar=[],..
+                        ipar=[],..
+                        opar=list(),..
+                        blocktype="l",..
+                        firing=[-1;-1],..
+                        dep_ut=[%t,%f],..
+                        label="",..
+                        nzcross=0,..
+                        nmode=0,..
+                        equations=list()),..
+               doc=list())
+scs_m.objs(11)=scicos_block(..
+               gui="M_SWITCH",..
+               graphics=scicos_graphics(..
+                        orig=[180,70],..
+                        sz=[40,40],..
+                        flip=%t,..
+                        theta=0,..
+                        exprs=["2";"1";"3"],..
+                        pin=[0;0;0],..
+                        pout=0,..
+                        pein=[],..
+                        peout=[],..
+                        gr_i=list(..
+                        ["d=sz(2)/(1+evstr(arg1.graphics.exprs(1)))";
+                        "xsegs([orig(1),orig(1)+sz(1)],[orig(2)+sz(2)-d,orig(2)+sz(2)-d])";
+                        "xstringb(orig(1),orig(2)+sz(2)-d,''control'',sz(1),d,''fill'')";
+                        "xstringb(orig(1),orig(2),[''M_Port'';''switch''],sz(1),sz(2)-d,''fill'');"],8),..
+                        id="",..
+                        in_implicit=["E";"E";"E"],..
+                        out_implicit="E"),..
+               model=scicos_model(..
+                        sim=list("mswitch",4),..
+                        in=[1;-1;-1],..
+                        in2=[],..
+                        intyp=1,..
+                        out=-1,..
+                        out2=[],..
+                        outtyp=1,..
+                        evtin=[],..
+                        evtout=[],..
+                        state=[],..
+                        dstate=[],..
+                        odstate=list(),..
+                        rpar=[],..
+                        ipar=[1;3],..
+                        opar=list(),..
+                        blocktype="c",..
+                        firing=[],..
+                        dep_ut=[%t,%f],..
+                        label="",..
+                        nzcross=0,..
+                        nmode=0,..
+                        equations=list()),..
+               doc=list())
+scs_m.objs(12)=scicos_block(..
+               gui="SCALAR2VECTOR",..
+               graphics=scicos_graphics(..
+                        orig=[250,70],..
+                        sz=[40,60],..
+                        flip=%t,..
+                        theta=0,..
+                        exprs="-1",..
+                        pin=0,..
+                        pout=0,..
+                        pein=[],..
+                        peout=[],..
+                        gr_i=list(..
+                        ["txt=[''Scalar'';''  to '';''vector''];";
+                        "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'')"],8),..
+                        id="",..
+                        in_implicit="E",..
+                        out_implicit="E"),..
+               model=scicos_model(..
+                        sim=list("scalar2vector",4),..
+                        in=1,..
+                        in2=[],..
+                        intyp=1,..
+                        out=-1,..
+                        out2=[],..
+                        outtyp=1,..
+                        evtin=[],..
+                        evtout=[],..
+                        state=[],..
+                        dstate=[],..
+                        odstate=list(),..
+                        rpar=[],..
+                        ipar=[],..
+                        opar=list(),..
+                        blocktype="c",..
+                        firing=[],..
+                        dep_ut=[%t,%f],..
+                        label="",..
+                        nzcross=0,..
+                        nmode=0,..
+                        equations=list()),..
+               doc=list())
+scs_m.objs(13)=scicos_block(..
+               gui="SWITCH_f",..
+               graphics=scicos_graphics(..
+                        orig=[320,70],..
+                        sz=[40,40],..
+                        flip=%t,..
+                        theta=0,..
+                        exprs=["2";"1"],..
+                        pin=[0;0],..
+                        pout=0,..
+                        pein=[],..
+                        peout=[],..
+                        gr_i=list(..
+                        "xstringb(orig(1),orig(2),[''switch'';string(model.ipar+1)],sz(1),sz(2),''fill'');",..
+                        8),..
+                        id="",..
+                        in_implicit=["E";"E"],..
+                        out_implicit="E"),..
+               model=scicos_model(..
+                        sim=list("switchn",2),..
+                        in=[-1;-1],..
+                        in2=[],..
+                        intyp=1,..
+                        out=-1,..
+                        out2=[],..
+                        outtyp=1,..
+                        evtin=[],..
+                        evtout=[],..
+                        state=[],..
+                        dstate=[],..
+                        odstate=list(),..
+                        rpar=[],..
+                        ipar=0,..
+                        opar=list(),..
+                        blocktype="c",..
+                        firing=[],..
+                        dep_ut=[%t,%t],..
+                        label="",..
+                        nzcross=0,..
+                        nmode=0,..
+                        equations=list()),..
+               doc=list())
+scs_m_1=scicos_diagram(..
+        version="scicos4.2",..
+        props=scicos_params(..
+              wpar=[600,450,0,0,600,450],..
+              Title=["EDGE_TRIGGER","./"],..
+              tol=[0.0001;0.000001;1.000E-10;100001;0;0;0],..
+              tf=30,..
+              context=" ",..
+              void1=[],..
+              options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(%t,33),[8,1],[1,5],..
+              list([5,1],[4,1]),[0.8,0.8,0.8]),..
+              void2=[],..
+              void3=[],..
+              doc=list()))
+scs_m_1.objs(1)=scicos_block(..
+                gui="EDGETRIGGER",..
+                graphics=scicos_graphics(..
+                         orig=[288.58631,257.1131],..
+                         sz=[60,40],..
+                         flip=%t,..
+                         exprs="0",..
+                         pin=5,..
+                         pout=3,..
+                         pein=[],..
+                         peout=[],..
+                         gr_i=list("xstringb(orig(1),orig(2),[''Edge'';''trigger''],sz(1),sz(2),''fill'');",8),..
+                         id="",..
+                         in_implicit="E",..
+                         out_implicit="E"),..
+                model=scicos_model(..
+                         sim=list("edgetrig",4),..
+                         in=1,..
+                         in2=[],..
+                         intyp=1,..
+                         out=1,..
+                         out2=[],..
+                         outtyp=1,..
+                         evtin=[],..
+                         evtout=[],..
+                         state=[],..
+                         dstate=0,..
+                         odstate=list(),..
+                         rpar=[],..
+                         ipar=0,..
+                         opar=list(),..
+                         blocktype="c",..
+                         firing=[],..
+                         dep_ut=[%t,%f],..
+                         label="",..
+                         nzcross=1,..
+                         nmode=0,..
+                         equations=list()),..
+                doc=list())
+scs_m_1.objs(2)=scicos_block(..
+                gui="IFTHEL_f",..
+                graphics=scicos_graphics(..
+                         orig=[388.28869,247.1131],..
+                         sz=[60,60],..
+                         flip=%t,..
+                         exprs=["0";"0"],..
+                         pin=3,..
+                         pout=[],..
+                         pein=[],..
+                         peout=[7;0],..
+                         gr_i=list(..
+                         ["txt=[''If in>0'';'' '';'' then    else''];";
+                         "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'');"],8),..
+                         id="",..
+                         in_implicit="E",..
+                         out_implicit=[]),..
+                model=scicos_model(..
+                         sim=list("ifthel",-1),..
+                         in=1,..
+                         in2=[],..
+                         intyp=1,..
+                         out=[],..
+                         out2=1,..
+                         outtyp=[],..
+                         evtin=[],..
+                         evtout=[1;1],..
+                         state=[],..
+                         dstate=[],..
+                         odstate=list(),..
+                         rpar=[],..
+                         ipar=[],..
+                         opar=list(),..
+                         blocktype="l",..
+                         firing=[-1,-1],..
+                         dep_ut=[%t,%f],..
+                         label="",..
+                         nzcross=0,..
+                         nmode=0,..
+                         equations=list()),..
+                doc=list())
+scs_m_1.objs(3)=scicos_link(..
+                  xx=[357.15774;362.99107;379.71726],..
+                  yy=[277.1131;277.1131;277.1131],..
+                  id="drawlink",..
+                  thick=[0,0],..
+                  ct=[1,1],..
+                  from=[1,1,0],..
+                  to=[2,1,1])
+scs_m_1.objs(4)=scicos_block(..
+                gui="IN_f",..
+                graphics=scicos_graphics(..
+                         orig=[240.01488,267.1131],..
+                         sz=[20,20],..
+                         flip=%t,..
+                         exprs="1",..
+                         pin=[],..
+                         pout=5,..
+                         pein=[],..
+                         peout=[],..
+                         gr_i=list(" ",8),..
+                         id="",..
+                         in_implicit=[],..
+                         out_implicit="E"),..
+                model=scicos_model(..
+                         sim="input",..
+                         in=[],..
+                         in2=[],..
+                         intyp=1,..
+                         out=-1,..
+                         out2=[],..
+                         outtyp=1,..
+                         evtin=[],..
+                         evtout=[],..
+                         state=[],..
+                         dstate=[],..
+                         odstate=list(),..
+                         rpar=[],..
+                         ipar=1,..
+                         opar=list(),..
+                         blocktype="c",..
+                         firing=[],..
+                         dep_ut=[%f,%f],..
+                         label="",..
+                         nzcross=0,..
+                         nmode=0,..
+                         equations=list()),..
+                doc=list())
+scs_m_1.objs(5)=scicos_link(..
+                  xx=[260.01488;280.01488],..
+                  yy=[277.1131;277.1131],..
+                  id="drawlink",..
+                  thick=[0,0],..
+                  ct=[1,1],..
+                  from=[4,1,0],..
+                  to=[1,1,1])
+scs_m_1.objs(6)=scicos_block(..
+                gui="CLKOUTV_f",..
+                graphics=scicos_graphics(..
+                         orig=[398.28869,181.39881],..
+                         sz=[20,30],..
+                         flip=%t,..
+                         exprs="1",..
+                         pin=[],..
+                         pout=[],..
+                         pein=7,..
+                         peout=[],..
+                         gr_i=list(" ",8),..
+                         id="",..
+                         in_implicit=[],..
+                         out_implicit=[]),..
+                model=scicos_model(..
+                         sim="output",..
+                         in=[],..
+                         in2=[],..
+                         intyp=1,..
+                         out=[],..
+                         out2=[],..
+                         outtyp=1,..
+                         evtin=1,..
+                         evtout=[],..
+                         state=[],..
+                         dstate=[],..
+                         odstate=list(),..
+                         rpar=[],..
+                         ipar=1,..
+                         opar=list(),..
+                         blocktype="d",..
+                         firing=[],..
+                         dep_ut=[%f,%f],..
+                         label="",..
+                         nzcross=0,..
+                         nmode=0,..
+                         equations=list()),..
+                doc=list())
+scs_m_1.objs(7)=scicos_link(..
+                  xx=[408.28869;408.28869],..
+                  yy=[241.39881;211.39881],..
+                  id="drawlink",..
+                  thick=[0,0],..
+                  ct=[5,-1],..
+                  from=[2,1,0],..
+                  to=[6,1,1])
+scs_m.objs(14)=scicos_block(..
+               gui="EDGE_TRIGGER",..
+               graphics=scicos_graphics(..
+                        orig=[390,70],..
+                        sz=[60,40],..
+                        flip=%t,..
+                        theta=0,..
+                        exprs=[],..
+                        pin=0,..
+                        pout=[],..
+                        pein=[],..
+                        peout=0,..
+                        gr_i=list("xstringb(orig(1),orig(2),[''EDGE'';''TRIGGER''],sz(1),sz(2),''fill'')",8),..
+                        id="",..
+                        in_implicit="E",..
+                        out_implicit=[]),..
+               model=scicos_model(..
+                        sim="csuper",..
+                        in=-1,..
+                        in2=[],..
+                        intyp=1,..
+                        out=[],..
+                        out2=[],..
+                        outtyp=1,..
+                        evtin=[],..
+                        evtout=1,..
+                        state=[],..
+                        dstate=[],..
+                        odstate=list(),..
+                        rpar=scs_m_1,..
+                        ipar=[],..
+                        opar=list(),..
+                        blocktype="h",..
+                        firing=[],..
+                        dep_ut=[%f,%f],..
+                        label="",..
+                        nzcross=0,..
+                        nmode=0,..
+                        equations=list()),..
+               doc=list())
+scs_m_1=scicos_diagram(..
+        version="scicos4.2",..
+        props=scicos_params(..
+              wpar=[600,450,0,0,600,450],..
+              Title=["Extract_Activation","./"],..
+              tol=[0.0001;0.000001;1.000E-10;100001;0;0;0],..
+              tf=30,..
+              context=" ",..
+              void1=[],..
+              options=tlist(["scsopt","3D","Background","Link","ID","Cmap"],list(%t,33),[8,1],[1,5],..
+              list([5,1],[4,1]),[0.8,0.8,0.8]),..
+              void2=[],..
+              void3=[],..
+              doc=list()))
+scs_m_1.objs(1)=scicos_block(..
+                gui="IFTHEL_f",..
+                graphics=scicos_graphics(..
+                         orig=[150.65045,143.82208],..
+                         sz=[60,60],..
+                         flip=%t,..
+                         exprs=["0";"0"],..
+                         pin=6,..
+                         pout=[],..
+                         pein=[],..
+                         peout=[3;4],..
+                         gr_i=list(..
+                         ["txt=[''If in>0'';'' '';'' then    else''];";
+                         "xstringb(orig(1),orig(2),txt,sz(1),sz(2),''fill'');"],8),..
+                         id="",..
+                         in_implicit="E",..
+                         out_implicit=[]),..
+                model=scicos_model(..
+                         sim=list("ifthel",-1),..
+                         in=1,..
+                         in2=[],..
+                         intyp=1,..
+                         out=[],..
+                         out2=[],..
+                         outtyp=1,..
+                         evtin=[],..
+                         evtout=[1;1],..
+                         state=[],..
+                         dstate=[],..
+                         odstate=list(),..
+                         rpar=[],..
+                         ipar=[],..
+                         opar=list(),..
+                         blocktype="l",..
+                         firing=[-1,-1],..
+                         dep_ut=[%t,%f],..
+                         label="",..
+                         nzcross=0,..
+                         nmode=0,..
+                         equations=list()),..
+                doc=list())
+scs_m_1.objs(2)=scicos_block(..
+                gui="CLKSOMV_f",..
+                graphics=scicos_graphics(..
+                         orig=[169.82143,96.146231],..
+                         sz=[16.666667,16.666667],..
+                         flip=%t,..
+                         exprs=[],..
+                         pin=[],..
+                         pout=[],..
+                         pein=[3;4;0],..
+                         peout=8,..
+                         gr_i=list(..
+                         ["rx=sz(1)*p/2;ry=sz(2)/2";
+                         "xsegs(orig(1)+rx*[1/2.3 1;2-1/2.3 1],orig(2)+ry*[1 2-1/2.3;1,1/2.3],0)"],8),..
+                         id="",..
+                         in_implicit=[],..
+                         out_implicit=[]),..
+                model=scicos_model(..
+                         sim="sum",..
+                         in=[],..
+                         in2=[],..
+                         intyp=1,..
+                         out=[],..
+                         out2=[],..
+                         outtyp=1,..
+                         evtin=[1;1;1],..
+                         evtout=1,..
+                         state=[],..
+                         dstate=[],..
+                         odstate=list(),..
+                         rpar=[],..
+                         ipar=[],..
+                         opar=list(),..
+                         blocktype="d",..
+                         firing=-1,..
+                         dep_ut=[%f,%f],..
+                         label="",..
+                         nzcross=0,..
+                         nmode=0,..
+                         equations=list()),..
+                doc=list())
+scs_m_1.objs(3)=scicos_link(..
+                  xx=[170.65045;170.65045;150.04302;150.04302;169.82143],..
+                  yy=[138.10779;128.235;128.235;104.47956;104.47956],..
+                  id="drawlink",..
+                  thick=[0,0],..
+                  ct=[5,-1],..
+                  from=[1,1,0],..
+                  to=[2,1,1])
+scs_m_1.objs(4)=scicos_link(..
+                  xx=[190.65045;190.65045;178.15476],..
+                  yy=[138.10779;111.55729;112.8129],..
+                  id="drawlink",..
+                  thick=[0,0],..
+                  ct=[5,-1],..
+                  from=[1,2,0],..
+                  to=[2,2,1])
+scs_m_1.objs(5)=scicos_block(..
+                gui="IN_f",..
+                graphics=scicos_graphics(..
+                         orig=[102.07902,163.82208],..
+                         sz=[20,20],..
+                         flip=%t,..
+                         exprs="1",..
+                         pin=[],..
+                         pout=6,..
+                         pein=[],..
+                         peout=[],..
+                         gr_i=list(" ",8),..
+                         id="",..
+                         in_implicit=[],..
+                         out_implicit="E"),..
+                model=scicos_model(..
+                         sim="input",..
+                         in=[],..
+                         in2=[],..
+                         intyp=1,..
+                         out=-1,..
+                         out2=[],..
+                         outtyp=1,..
+                         evtin=[],..
+                         evtout=[],..
+                         state=[],..
+                         dstate=[],..
+                         odstate=list(),..
+                         rpar=[],..
+                         ipar=1,..
+                         opar=list(),..
+                         blocktype="c",..
+                         firing=[],..
+                         dep_ut=[%f,%f],..
+                         label="",..
+                         nzcross=0,..
+                         nmode=0,..
+                         equations=list()),..
+                doc=list())
+scs_m_1.objs(6)=scicos_link(..
+                  xx=[122.07902;142.07902],..
+                  yy=[173.82208;173.82208],..
+                  id="drawlink",..
+                  thick=[0,0],..
+                  ct=[1,1],..
+                  from=[5,1,0],..
+                  to=[1,1,1])
+scs_m_1.objs(7)=scicos_block(..
+                gui="CLKOUTV_f",..
+                graphics=scicos_graphics(..
+                         orig=[168.15476,38.527183],..
+                         sz=[20,30],..
+                         flip=%t,..
+                         exprs="1",..
+                         pin=[],..
+                         pout=[],..
+                         pein=8,..
+                         peout=[],..
+                         gr_i=list(" ",8),..
+                         id="",..
+                         in_implicit=[],..
+                         out_implicit=[]),..
+                model=scicos_model(..
+                         sim="output",..
+                         in=[],..
+                         in2=[],..
+                         intyp=1,..
+                         out=[],..
+                         out2=[],..
+                         outtyp=1,..
+                         evtin=1,..
+                         evtout=[],..
+                         state=[],..
+                         dstate=[],..
+                         odstate=list(),..
+                         rpar=[],..
+                         ipar=1,..
+                         opar=list(),..
+                         blocktype="d",..
+                         firing=[],..
+                         dep_ut=[%f,%f],..
+                         label="",..
+                         nzcross=0,..
+                         nmode=0,..
+                         equations=list()),..
+                doc=list())
+scs_m_1.objs(8)=scicos_link(..
+                  xx=[178.15476;178.15476],..
+                  yy=[98.527183;68.527183],..
+                  id="drawlink",..
+                  thick=[0,0],..
+                  ct=[5,-1],..
+                  from=[2,1,0],..
+                  to=[7,1,1])
+scs_m.objs(15)=scicos_block(..
+               gui="Extract_Activation",..
+               graphics=scicos_graphics(..
+                        orig=[0,160],..
+                        sz=[60,40],..
+                        flip=%t,..
+                        theta=0,..
+                        exprs=[],..
+                        pin=0,..
+                        pout=[],..
+                        pein=[],..
+                        peout=0,..
+                        gr_i=list(..
+                        "xstringb(orig(1),orig(2),[''Extract'';''Activation''],sz(1),sz(2),''fill'')",8),..
+                        id="",..
+                        in_implicit="E",..
+                        out_implicit=[]),..
+               model=scicos_model(..
+                        sim="csuper",..
+                        in=-1,..
+                        in2=[],..
+                        intyp=1,..
+                        out=[],..
+                        out2=[],..
+                        outtyp=1,..
+                        evtin=[],..
+                        evtout=1,..
+                        state=[],..
+                        dstate=[],..
+                        odstate=list(),..
+                        rpar=scs_m_1,..
+                        ipar=[],..
+                        opar=list(),..
+                        blocktype="h",..
+                        firing=[],..
+                        dep_ut=[%f,%f],..
+                        label="",..
+                        nzcross=0,..
+                        nmode=0,..
+                        equations=list()),..
+               doc=list())
+scs_m.objs(16)=scicos_block(..
+               gui="GOTO",..
+               graphics=scicos_graphics(..
+                        orig=[90,160],..
+                        sz=[30,30],..
+                        flip=%t,..
+                        theta=0,..
+                        exprs=["A";"1"],..
+                        pin=0,..
+                        pout=[],..
+                        pein=[],..
+                        peout=[],..
+                        gr_i=list("",8),..
+                        id="Goto",..
+                        in_implicit="E",..
+                        out_implicit=[]),..
+               model=scicos_model(..
+                        sim="goto",..
+                        in=-1,..
+                        in2=-2,..
+                        intyp=-1,..
+                        out=[],..
+                        out2=[],..
+                        outtyp=1,..
+                        evtin=[],..
+                        evtout=[],..
+                        state=[],..
+                        dstate=[],..
+                        odstate=list(),..
+                        rpar=[],..
+                        ipar=1,..
+                        opar=list("A"),..
+                        blocktype="c",..
+                        firing=[],..
+                        dep_ut=[%f,%f],..
+                        label="",..
+                        nzcross=0,..
+                        nmode=0,..
+                        equations=list()),..
+               doc=list())
+scs_m.objs(17)=scicos_block(..
+               gui="FROM",..
+               graphics=scicos_graphics(..
+                        orig=[150,160],..
+                        sz=[30,30],..
+                        flip=%t,..
+                        theta=0,..
+                        exprs="A",..
+                        pin=[],..
+                        pout=0,..
+                        pein=[],..
+                        peout=[],..
+                        gr_i=list("",8),..
+                        id="From",..
+                        in_implicit=[],..
+                        out_implicit="E"),..
+               model=scicos_model(..
+                        sim="from",..
+                        in=[],..
+                        in2=[],..
+                        intyp=1,..
+                        out=-1,..
+                        out2=-2,..
+                        outtyp=-1,..
+                        evtin=[],..
+                        evtout=[],..
+                        state=[],..
+                        dstate=[],..
+                        odstate=list(),..
+                        rpar=[],..
+                        ipar=[],..
+                        opar=list("A"),..
+                        blocktype="c",..
+                        firing=[],..
+                        dep_ut=[%f,%f],..
+                        label="",..
+                        nzcross=0,..
+                        nmode=0,..
+                        equations=list()),..
+               doc=list())
+scs_m.objs(18)=scicos_block(..
+               gui="GotoTagVisibility",..
+               graphics=scicos_graphics(..
+                        orig=[210,160],..
+                        sz=[40,40],..
+                        flip=%t,..
+                        theta=0,..
+                        exprs="A",..
+                        pin=[],..
+                        pout=[],..
+                        pein=[],..
+                        peout=[],..
+                        gr_i=list(..
+                        "xstringb(orig(1),orig(2),[''{''+arg1.graphics.exprs(1)+''}''],sz(1),sz(2),''fill'');",..
+                        8),..
+                        id=["Goto Tag";"Visibility"],..
+                        in_implicit=[],..
+                        out_implicit=[]),..
+               model=scicos_model(..
+                        sim="gototagvisibility",..
+                        in=[],..
+                        in2=[],..
+                        intyp=1,..
+                        out=[],..
+                        out2=[],..
+                        outtyp=1,..
+                        evtin=[],..
+                        evtout=[],..
+                        state=[],..
+                        dstate=[],..
+                        odstate=list(),..
+                        rpar=[],..
+                        ipar=[],..
+                        opar=list("A"),..
+                        blocktype="c",..
+                        firing=%f,..
+                        dep_ut=[%f,%f],..
+                        label="",..
+                        nzcross=0,..
+                        nmode=0,..
+                        equations=list()),..
+               doc=list())
+scs_m.objs(19)=scicos_block(..
+               gui="CLKGOTO",..
+               graphics=scicos_graphics(..
+                        orig=[280,160],..
+                        sz=[30,30],..
+                        flip=%t,..
+                        theta=0,..
+                        exprs=["A","1"],..
+                        pin=[],..
+                        pout=[],..
+                        pein=0,..
+                        peout=[],..
+                        gr_i=list(" ",8),..
+                        id="Goto",..
+                        in_implicit=[],..
+                        out_implicit=[]),..
+               model=scicos_model(..
+                        sim="clkgoto",..
+                        in=[],..
+                        in2=[],..
+                        intyp=1,..
+                        out=[],..
+                        out2=[],..
+                        outtyp=1,..
+                        evtin=1,..
+                        evtout=[],..
+                        state=[],..
+                        dstate=[],..
+                        odstate=list(),..
+                        rpar=[],..
+                        ipar=1,..
+                        opar=list("A"),..
+                        blocktype="d",..
+                        firing=-1,..
+                        dep_ut=[%f,%f],..
+                        label="",..
+                        nzcross=0,..
+                        nmode=0,..
+                        equations=list()),..
+               doc=list())
+scs_m.objs(20)=scicos_block(..
+               gui="CLKFROM",..
+               graphics=scicos_graphics(..
+                        orig=[340,160],..
+                        sz=[30,30],..
+                        flip=%t,..
+                        theta=0,..
+                        exprs="A",..
+                        pin=[],..
+                        pout=[],..
+                        pein=[],..
+                        peout=0,..
+                        gr_i=list(" ",8),..
+                        id="From",..
+                        in_implicit=[],..
+                        out_implicit=[]),..
+               model=scicos_model(..
+                        sim="clkfrom",..
+                        in=[],..
+                        in2=[],..
+                        intyp=1,..
+                        out=[],..
+                        out2=[],..
+                        outtyp=1,..
+                        evtin=[],..
+                        evtout=1,..
+                        state=[],..
+                        dstate=[],..
+                        odstate=list(),..
+                        rpar=[],..
+                        ipar=[],..
+                        opar=list("A"),..
+                        blocktype="d",..
+                        firing=-1,..
+                        dep_ut=[%f,%f],..
+                        label="",..
+                        nzcross=0,..
+                        nmode=0,..
+                        equations=list()),..
+               doc=list())
+scs_m.objs(21)=scicos_block(..
+               gui="CLKGotoTagVisibility",..
+               graphics=scicos_graphics(..
+                        orig=[400,160],..
+                        sz=[40,40],..
+                        flip=%t,..
+                        theta=0,..
+                        exprs="A",..
+                        pin=[],..
+                        pout=[],..
+                        pein=[],..
+                        peout=[],..
+                        gr_i=list(..
+                        ["xstringb(orig(1),orig(2),[''{''+arg1.graphics.exprs(1)+''}''],sz(1),sz(2),''fill'');";
+                        "wd=xget(''wdim'').*[1.016,1.12];";
+                        "thick=xget(''thickness'');xset(''thickness'',2);";
+                        "p=wd(2)/wd(1);p=1;";
+                        "xarcs([orig(1)+0.05*sz(1);";
+                        "orig(2)+0.95*sz(2);";
+                        "0.9*sz(1)*p;";
+                        "0.9*sz(2);";
+                        "0;";
+                        "360*64],scs_color(5));";
+                        "xset(''thickness'',thick)"],8),..
+                        id=["Goto Tag";"Visibility"],..
+                        in_implicit=[],..
+                        out_implicit=[]),..
+               model=scicos_model(..
+                        sim="clkgototagvisibility",..
+                        in=[],..
+                        in2=[],..
+                        intyp=1,..
+                        out=[],..
+                        out2=[],..
+                        outtyp=1,..
+                        evtin=[],..
+                        evtout=[],..
+                        state=[],..
+                        dstate=[],..
+                        odstate=list(),..
+                        rpar=[],..
+                        ipar=[],..
+                        opar=list("A"),..
+                        blocktype="c",..
+                        firing=%f,..
+                        dep_ut=[%f,%f],..
+                        label="",..
+                        nzcross=0,..
+                        nmode=0,..
+                        equations=list()),..
+               doc=list())
+scs_m.objs(22)=scicos_block(..
+               gui="GOTOMO",..
+               graphics=scicos_graphics(..
+                        orig=[0,230],..
+                        sz=[30,30],..
+                        flip=%t,..
+                        theta=0,..
+                        exprs=["A";"1"],..
+                        pin=0,..
+                        pout=[],..
+                        pein=[],..
+                        peout=[],..
+                        gr_i=list("",8),..
+                        id="",..
+                        in_implicit="I",..
+                        out_implicit=[]),..
+               model=scicos_model(..
+                        sim="gotomo",..
+                        in=-1,..
+                        in2=-2,..
+                        intyp=[],..
+                        out=[],..
+                        out2=[],..
+                        outtyp=1,..
+                        evtin=[],..
+                        evtout=[],..
+                        state=[],..
+                        dstate=[],..
+                        odstate=list(),..
+                        rpar=[],..
+                        ipar=1,..
+                        opar=list("A"),..
+                        blocktype="c",..
+                        firing=[],..
+                        dep_ut=[%f,%f],..
+                        label="",..
+                        nzcross=0,..
+                        nmode=0,..
+                        equations=list()),..
+               doc=list())
+scs_m.objs(23)=scicos_block(..
+               gui="FROMMO",..
+               graphics=scicos_graphics(..
+                        orig=[60,230],..
+                        sz=[30,30],..
+                        flip=%t,..
+                        theta=0,..
+                        exprs="A",..
+                        pin=[],..
+                        pout=0,..
+                        pein=[],..
+                        peout=[],..
+                        gr_i=list("",8),..
+                        id="",..
+                        in_implicit=[],..
+                        out_implicit="I"),..
+               model=scicos_model(..
+                        sim="frommo",..
+                        in=[],..
+                        in2=[],..
+                        intyp=1,..
+                        out=-1,..
+                        out2=-2,..
+                        outtyp=-1,..
+                        evtin=[],..
+                        evtout=[],..
+                        state=[],..
+                        dstate=[],..
+                        odstate=list(),..
+                        rpar=[],..
+                        ipar=[],..
+                        opar=list("A"),..
+                        blocktype="c",..
+                        firing=[],..
+                        dep_ut=[%f,%f],..
+                        label="",..
+                        nzcross=0,..
+                        nmode=0,..
+                        equations=list()),..
+               doc=list())
+scs_m.objs(24)=scicos_block(..
+               gui="GotoTagVisibilityMO",..
+               graphics=scicos_graphics(..
+                        orig=[120,230],..
+                        sz=[40,40],..
+                        flip=%t,..
+                        theta=0,..
+                        exprs="A",..
+                        pin=[],..
+                        pout=[],..
+                        pein=[],..
+                        peout=[],..
+                        gr_i=list(..
+                        ["xstringb(orig(1),orig(2),[''{''+arg1.graphics.exprs(1)+''}''],sz(1),sz(2),''fill'');";
+                        "wd=xget(''wdim'').*[1.016,1.12];";
+                        "thick=xget(''thickness'');xset(''thickness'',2);";
+                        "p=wd(2)/wd(1);p=1;";
+                        "xarcs([orig(1)+0.05*sz(1);";
+                        "orig(2)+0.95*sz(2);";
+                        "0.9*sz(1)*p;";
+                        "0.9*sz(2);";
+                        "0;";
+                        "360*64],scs_color(3));";
+                        "xset(''thickness'',thick)"],8),..
+                        id=["Goto Tag";"Visibility"],..
+                        in_implicit=[],..
+                        out_implicit=[]),..
+               model=scicos_model(..
+                        sim="gototagvisibilitymo",..
+                        in=[],..
+                        in2=[],..
+                        intyp=1,..
+                        out=[],..
+                        out2=[],..
+                        outtyp=1,..
+                        evtin=[],..
+                        evtout=[],..
+                        state=[],..
+                        dstate=[],..
+                        odstate=list(),..
+                        rpar=[],..
+                        ipar=[],..
+                        opar=list("A"),..
+                        blocktype="c",..
+                        firing=%f,..
+                        dep_ut=[%f,%f],..
+                        label="",..
+                        nzcross=0,..
+                        nmode=0,..
+                        equations=list()),..
+               doc=list())
diff --git a/scilab/modules/scicos/macros/scicos_scicos/BrowseTo_.sci b/scilab/modules/scicos/macros/scicos_scicos/BrowseTo_.sci
new file mode 100755 (executable)
index 0000000..eaf3145
--- /dev/null
@@ -0,0 +1,32 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function BrowseTo_()
+global %scicos_navig
+global %diagram_path_objective
+Cmenu=[]
+pa=TCL_GetVar('blkox');
+pa=part(pa,6:length(pa));
+execstr('pa=['+pa+']');       
+%scicos_navig=1
+%diagram_path_objective=pa
+
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/Browser_.sci b/scilab/modules/scicos/macros/scicos_scicos/Browser_.sci
new file mode 100755 (executable)
index 0000000..ac45670
--- /dev/null
@@ -0,0 +1,38 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function Browser_()
+//
+
+Cmenu = [] ; 
+
+if super_path==[] then
+   do_browser(scs_m);
+else        
+      Scicos_commands=['%diagram_path_objective=[];%scicos_navig=1';
+                      'Cmenu='"Browser'";%scicos_navig=[]';
+                      '%diagram_path_objective='+sci2exp(super_path)+';%scicos_navig=1';
+                       'Cmenu='"Place in Browser'";%scicos_navig=[]'
+                     ]  // not really needed to return anymore, may remove last line
+//  message("Browser can only be launched from main diagram.") ;
+end
+
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/CFORTR.sci b/scilab/modules/scicos/macros/scicos_scicos/CFORTR.sci
new file mode 100644 (file)
index 0000000..49a67d9
--- /dev/null
@@ -0,0 +1,84 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function [ok,tt]=CFORTR(funam,tt,inp,out)
+//
+ni=size(inp,'*')
+no=size(out,'*')
+if tt==[] then
+
+  tete1=['#include <machine.h>';'#include <math.h>';...
+         'void '+funam+'(flag,nevprt,t,xd,x,nx,z,nz,tvec,';..
+      '             ntvec,rpar,nrpar,ipar,nipar']
+
+  tete2= '      '
+  decl=''
+  for i=1:ni
+    tete2=tete2+',u'+string(i)+',nu'+string(i)
+    decl=decl+',*nu'+string(i)
+  end
+  for i=1:no
+    tete2=tete2+',y'+string(i)+',ny'+string(i)
+    decl=decl+',*ny'+string(i)
+  end
+  tete2=tete2+')'
+
+  tete3=['      double *t,xd[],x[],z[],tvec[];';..
+    '      integer *flag,*nevprt,*nx,*nz,*ntvec,*nrpar,ipar[],*nipar'+decl+';']
+
+
+  tete4= '      double rpar[]'
+    for i=1:ni
+      tete4=tete4+',u'+string(i)+'[]'
+    end
+    for i=1:no
+      tete4=tete4+',y'+string(i)+'[]'
+    end
+    tetev=[' ';' ']
+    
+  textmp=[tete1;tete2;tetev;tete3;tete4+';';
+          '/* modify below this line */';
+         '{'
+         '}'
+       tetev];
+  else
+    textmp=tt;
+  end
+  
+  while 1==1
+      [txt]=x_dialog(['Function definition in C';
+       'Here is a skeleton of the functions which you shoud edit'],..
+        textmp);
+
+      if txt<>[] then
+       tt=txt
+       [ok]=scicos_block_link(funam,tt,'c')
+       if ok then
+         textmp=txt;
+       end
+       break;
+      else
+       ok=%f;break;
+      end  
+  end
+    
+  
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/CFORTR2.sci b/scilab/modules/scicos/macros/scicos_scicos/CFORTR2.sci
new file mode 100644 (file)
index 0000000..b2ec169
--- /dev/null
@@ -0,0 +1,141 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function [ok,tt]=CFORTR2(funam,tt)
+//
+if tt==[] then
+  
+  textmp=[
+         '#include <math.h>';
+         '#include <stdlib.h>';
+         '#include <scicos/scicos_block.h>';
+         'void '+funam+'(scicos_block *block,int flag)';
+        ];
+  ttext=[];
+  textmp($+1)='{'
+  textmp=[textmp;
+         '  /* ';
+         '  int block->nevprt;'
+         '  int block->nz;'
+         '  double* block->z;'
+         '  int block->nx;'
+         '  double* block->x;'
+         '  double* block->xd;'
+         '  double* block->res;'
+         '  int block->nin;'
+         '  int *block->insz;'
+         '  double **block->inptr;'
+         '  int block->nout;'
+         '  int *block->outsz;'
+         '  double **block->outptr;'
+         '  int block->nevout;'
+         '  int block->nrpar;'
+         '  double *block->rpar;'
+         '  int block->nipar;'
+         '  int *block->ipar;'
+         '  int block->ng;'
+         '  double *block->g;'
+         '  int *block->jroot;'
+         '  char block->label[41];'
+         '  */']
+  
+  textmp($+1)='  if (flag == 4) { /* initialization */'
+  textmp($+1)='   '+funam+"_bloc_init(block,flag);"
+    ttext=[ttext;'int '+funam+"_bloc_init(scicos_block *block,int flag)";
+          "{";
+          "return 0;}"];
+  textmp($+1)=' '
+  if nout<>0 then 
+    textmp($+1)='  } else if(flag == 1) { /* output computation*/'
+    textmp($+1)='   set_block_error('+funam+"_bloc_outputs(block,flag));"
+    ttext=[ttext;'int '+funam+"_bloc_outputs(scicos_block *block,int flag)";
+          "{";
+          "return 0;}"];
+  end
+  
+  if nx<>0 then 
+    textmp($+1)='  } else if(flag == 0) { /* derivative or residual computation*/',
+    textmp($+1)='   set_block_error('+funam+"_bloc_deriv(block,flag));"
+    ttext=[ttext;'int '+funam+"_bloc_deriv(scicos_block *block,int flag)";
+          "{";
+          "return 0;}"];
+  end
+  
+  if ng <>0 then
+    textmp($+1)='  } else if(flag == 9) {/* zero crossing surface and mode computation*/',
+    textmp($+1)='     set_block_error('+funam+"_bloc_zcross(block,flag));";
+    ttext=[ttext;'int '+funam+"_bloc_zcross(scicos_block *block,int flag)";
+          "{";
+          "return 0;}"];
+  end
+  
+  if nz<>0 then 
+    textmp($+1)='  } else if(flag == 2) { /* computation of next discrte state*/ ',
+    textmp($+1)='     set_block_error('+funam+"_bloc_states(block,flag));";
+        ttext=[ttext;'int '+funam+"_bloc_states(scicos_block *block,int flag)";
+          "{";
+          "return 0;}"];
+  elseif min(nx,ng+nevin)>0 then 
+    textmp($+1)='  } else if(flag == 2) { /* computation of jumped state*/ ',
+    textmp($+1)='     set_block_error('+funam+"_bloc_states(block,flag));";
+        ttext=[ttext;'int '+funam+"_bloc_states(scicos_block *block,int flag)";
+          "{";
+          "return 0;}"];
+  end
+   
+  if nevout<>0 then 
+    textmp($+1)='  } else if(flag == 3) { /* computation of output event times*/',
+    textmp($+1)='     set_block_error('+funam+"_bloc_evtout(block,flag));";
+        ttext=[ttext;'int '+funam+"_bloc_evtout(scicos_block *block,int flag)";
+          "{";
+          "return 0;}"];
+  end
+  textmp($+1)='  } else  if (flag == 5) { /* ending */'
+      textmp($+1)='     set_block_error('+funam+"_bloc_ending(block,flag));";
+        ttext=[ttext;'int '+funam+"_bloc_ending(scicos_block *block,int flag)";
+          "{";
+          "return 0;}"];
+  textmp($+1)='  }'
+  textmp($+1)='}'
+  textmp=[textmp;' '; ttext];
+else
+  textmp=tt;
+end
+
+while 1==1
+  [txt]=x_dialog(['Function definition in C';
+                 'Here is a skeleton of the functions which';'you shoud edit'],..
+                textmp);
+  
+  if txt<>[] then
+    tt=txt
+    [ok]=scicos_block_link(funam,tt,'c')
+    if ok then
+      textmp=txt;
+    end
+    break;
+  else
+    ok=%f;break;
+  end  
+end
+
+
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/Calc_.sci b/scilab/modules/scicos/macros/scicos_scicos/Calc_.sci
new file mode 100644 (file)
index 0000000..b9119a7
--- /dev/null
@@ -0,0 +1,36 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+
+function Calc_()
+//**    
+
+    Cmenu = [] ;
+    
+    xinfo("You may enter any Scilab instruction. Enter ''return'' keyword to come back to Scicos")
+    
+    xinfo_flag = 1 ; //** keep the message  
+//    disablemenus(xinfo_flag);
+      pause ; //** recurse in the Scilab command line 
+//    enablemenus(); 
+    
+    Cmenu ="Replot" ; //** force a Replot of the diagram 
+    
+endfunction
diff --git a/scilab/modules/scicos/macros/scicos_scicos/CodeGeneration_.sci b/scilab/modules/scicos/macros/scicos_scicos/CodeGeneration_.sci
new file mode 100644 (file)
index 0000000..695e798
--- /dev/null
@@ -0,0 +1,5889 @@
+//  Scicos\r
+//\r
+//  Copyright (C) INRIA - METALAU Project <scicos@inria.fr>\r
+//                      - Alan Layec <alan.layec@inria.fr>\r
+//                      - Ramine Nikoukhah <ramine.nikoukhah@inria.fr>\r
+//                      - Rachid Djenidi\r
+//\r
+// This program is free software; you can redistribute it and/or modify\r
+// it under the terms of the GNU General Public License as published by\r
+// the Free Software Foundation; either version 2 of the License, or\r
+// (at your option) any later version.\r
+//\r
+// This program is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+// GNU General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU General Public License\r
+// along with this program; if not, write to the Free Software\r
+// Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.\r
+//\r
+// See the file ../license.txt\r
+//\r
+\r
+function CodeGeneration_()\r
+//Input editor function of Scicos code generator\r
+//\r
+//@l@n, 14/10/07\r
+//\r
+//\r
+//** 10 Set 2007 : cleaner startup code by    \r
+\r
+    k = [] ; //** index of the CodeGen source superbloc candidate\r
+\r
+    xc = %pt(1); //** last valid click position \r
+    yc = %pt(2); \r
+    \r
+    %pt = []   ;\r
+    Cmenu = [] ;\r
+\r
+    k  = getobj(scs_m,[xc;yc]) ; //** look for a block\r
+    //** check if we have clicked near an object\r
+    if k==[] then\r
+      return\r
+    //** check if we have clicked near a block\r
+    elseif typeof(scs_m.objs(k))<>'Block' then\r
+      return\r
+    end\r
+\r
+//** If the clicked/selected block is really a superblock \r
+//**             <k>\r
+    if scs_m.objs(k).model.sim(1)=='super' then\r
+      \r
+        XX = scs_m.objs(k);\r
+        [ok, XX, alreadyran, flgcdgen, szclkINTemp, freof] = ...\r
+                        do_compile_superblock42(XX, scs_m, k, alreadyran);\r
+        //**quick fix for sblock that contains scope\r
+        gh_curwin=scf(curwin)\r
+\r
+      if ok then\r
+        scs_m = changeports(scs_m,list('objs',k), XX);  //scs_m.objs(k)=XX\r
+        if flgcdgen <> szclkINTemp then\r
+           // XX.graphics.pein($)=size(scs_m.objs)+2\r
+            XX.graphics.pein = [XX.graphics.pein ; size(scs_m.objs)+2]\r
+            scs_m.objs(k) = XX\r
+            bk = SampleCLK('define');\r
+            [posx,posy] = getinputports(XX)\r
+             posx = posx($); posy = posy($);\r
+             teta = XX.graphics.theta\r
+             pos  = rotate([posx;posy],teta*%pi/180, ...\r
+                           [XX.graphics.orig(1)+XX.graphics.sz(1)/2,...\r
+                            XX.graphics.orig(2)+XX.graphics.sz(2)/2]) ; \r
+             posx = pos(1); posy = pos(2);\r
+             bk.graphics.orig = [posx posy]+[-30 20]\r
+             bk.graphics.sz = [60 40]\r
+             bk.graphics.exprs = [sci2exp(freof(1));sci2exp(freof(2))]\r
+             bk.model.rpar = freof;\r
+             bk.graphics.peout = size(scs_m.objs)+2\r
+             scs_m.objs($+1) = bk;\r
+             [posx2,posy2] = getoutputports(bk);\r
+             lnk    = scicos_link();\r
+             lnk.xx = [posx2;posx];\r
+             lnk.yy = [posy2;posy];\r
+             lnk.ct = [5 -1]\r
+             lnk.from = [size(scs_m.objs) 1 0]\r
+             lnk.to = [k flgcdgen 1]\r
+             scs_m.objs($+1) = lnk;\r
+        end\r
+        edited      = %t ;\r
+        needcompile = 4  ;\r
+        Cmenu = "Replot" ;\r
+      else\r
+        Cmenu = "Open/Set"\r
+      end\r
+    \r
+    else\r
+      //** the clicked/selected block is NOT a superblock \r
+      message("Generation Code only work for a Superblock ! ")\r
+    end\r
+endfunction\r
+//**---------------------------------------------------------------------------------------------------------------------------------\r
+//\r
+//16/06/07 Author : ?, A. Layec\r
+//\r
+function [Code,actt,proto]=call_actuator(i)\r
+  nin=inpptr(i+1)-inpptr(i);  //** number of input ports\r
+  nout=outptr(i+1)-outptr(i); //** number of output ports\r
+\r
+  if funtyp(i)==0 then\r
+    if nin==0 then\r
+      uk    = 0;\r
+      nuk_1 = 0;\r
+      nuk_2 = 0;\r
+      uk_t  = 1;\r
+      //Code($+1)=+'  args[0]=(double *)outtbptr[0]);';\r
+    else\r
+      uk    = inplnk(inpptr(i));\r
+      nuk_1 = size(outtb(uk),1);\r
+      nuk_2 = size(outtb(uk),2);\r
+      uk_t  = mat2scs_c_nb(outtb(uk));\r
+      //Code($+1)=' args[0]=('+mat2scs_c_ptr(outtb(uk))+' *)outtbptr['+string(uk-1)+'];';\r
+    end\r
+  end\r
+  //pour la fonction gui ont a : num de bloc l'adresse dans\r
+  //nouveau  z et la taille du port\r
+  actt=[i uk nuk_1 nuk_2 uk_t bllst(i).ipar]\r
+\r
+  Code($+1)='block_'+rdnom+'['+string(i-1)+'].nevprt=nevprt;'\r
+\r
+  Code=['/* Call of actuator (blk nb '+string(i)+') */'\r
+        Code;\r
+        'nport = '+string(nbact)+';';\r
+        rdnom+'_actuator(&flag, &nport, &block_'+rdnom+'['+string(i-1)+'].nevprt, told, '+..\r
+        '('+mat2scs_c_ptr(outtb(uk))+' *)outtbptr['+string(uk-1)+'], &nrd_'+string(nuk_1)+', &nrd_'+..\r
+        string(nuk_2)+', &nrd_'+string(uk_t)+',bbb);'];\r
+\r
+  proto='void '+rdnom+'_actuator('+..\r
+        'int *, int *, int *, double *, void *, int *, int *,int *,int);'\r
+  proto=cformatline(proto,70);\r
+endfunction\r
+\r
+//CallBlock : generate C calling sequence\r
+//            of a scicos block\r
+//\r
+//inputs : bk   : bloc index\r
+//         pt   : evt activation number\r
+//         flag : flag\r
+//\r
+//output : txt  :\r
+//\r
+//16/06/07 Authors : Alan Layec\r
+function txt=call_block42(bk,pt,flag)\r
+  txt=[]\r
+  //**\r
+  if flag==2 & ((zptr(bk+1)-zptr(bk))+..\r
+                (ozptr(bk+1)-ozptr(bk))+..\r
+                (xptr(bk+1)-xptr(bk)+..\r
+                with_work(bk))==0 |..\r
+                pt<=0) & ~(stalone & or(bk==actt(:,1))) then\r
+    return // block without state or continuously activated\r
+  end\r
+  if flag==0 & ((xptr(bk+1)-xptr(bk))==0) then\r
+    return // block without continuous state\r
+  end\r
+  if flag==9 & ((zcptr(bk+1)-zcptr(bk))==0) then\r
+    return // block without continuous state\r
+  end\r
+  if flag==3 & ((clkptr(bk+1)-clkptr(bk))==0) then\r
+    return\r
+  end\r
+\r
+  //** adjust pt\r
+  if ~(flag==3 & ((zcptr(bk+1)-zcptr(bk))<>0)) then\r
+    pt=abs(pt)\r
+  end\r
+\r
+  //** add comment\r
+  txt=[get_comment('call_blk',list(funs(bk),funtyp(bk),bk));]\r
+\r
+  //** set nevprt and flag for called block\r
+  txt=[txt;\r
+       'block_'+rdnom+'['+string(bk-1)+'].nevprt = '+string(pt)+';'\r
+       'local_flag = '+string(flag)+';']\r
+\r
+  //**see if its bidon, actuator or sensor\r
+  if funs(bk)=='bidon' then\r
+    txt=[];\r
+    return\r
+  elseif funs(bk)=='bidon2' then\r
+    txt=[];\r
+    return\r
+  elseif or(bk==actt(:,1)) then\r
+    ind=find(bk==actt(:,1))\r
+    uk=actt(ind,2)\r
+    nuk_1=actt(ind,3)\r
+    nuk_2=actt(ind,4)\r
+    uk_t=actt(ind,5)\r
+    txt = [txt;\r
+           'nport = '+string(ind)+';']\r
+    txt = [txt;\r
+           rdnom+'_actuator(&local_flag, &nport, &block_'+rdnom+'['+string(bk-1)+'].nevprt, \'\r
+           get_blank(rdnom+'_actuator')+' &t, ('+mat2scs_c_ptr(outtb(uk))+' *)'+rdnom+'_block_outtbptr['+string(uk-1)+'], \'\r
+           get_blank(rdnom+'_actuator')+' &nrd_'+string(nuk_1)+', &nrd_'+string(nuk_2)+', &nrd_'+string(uk_t)+',bbb);']\r
+    txt = [txt;\r
+           'if(local_flag < 0) return(5 - local_flag);']\r
+    return\r
+  elseif or(bk==capt(:,1)) then\r
+    ind=find(bk==capt(:,1))\r
+    yk=capt(ind,2);\r
+    nyk_1=capt(ind,3);\r
+    nyk_2=capt(ind,4);\r
+    yk_t=capt(ind,5);\r
+    txt = [txt;\r
+           'nport = '+string(ind)+';']\r
+    txt = [txt;\r
+           rdnom+'_sensor(&local_flag, &nport, &block_'+rdnom+'['+string(bk-1)+'].nevprt, \'\r
+           get_blank(rdnom+'_sensor')+' &t, ('+mat2scs_c_ptr(outtb(yk))+' *)'+rdnom+'_block_outtbptr['+string(yk-1)+'], \'\r
+           get_blank(rdnom+'_sensor')+' &nrd_'+string(nyk_1)+', &nrd_'+string(nyk_2)+', &nrd_'+string(yk_t)+',aaa);']\r
+    txt = [txt;\r
+           'if(local_flag < 0) return(5 - local_flag);']\r
+    return\r
+  end\r
+\r
+  //**\r
+  nx=xptr(bk+1)-xptr(bk);\r
+  nz=zptr(bk+1)-zptr(bk);\r
+  nrpar=rpptr(bk+1)-rpptr(bk);\r
+  nipar=ipptr(bk+1)-ipptr(bk);\r
+  nin=inpptr(bk+1)-inpptr(bk);  //* number of input ports */\r
+  nout=outptr(bk+1)-outptr(bk); //* number of output ports */\r
+\r
+  //**\r
+  //l'adresse du pointeur de ipar\r
+  if nipar<>0 then ipar=ipptr(bk), else ipar=1;end\r
+  //l'adresse du pointeur de rpar\r
+  if nrpar<>0 then rpar=rpptr(bk), else rpar=1; end\r
+  //l'adresse du pointeur de z attention -1 pas sur\r
+  if nz<>0 then z=zptr(bk)-1, else z=0;end\r
+  //l'adresse du pointeur de x\r
+  if nx<>0 then x=xptr(bk)-1, else x=0;end\r
+\r
+  //**\r
+  ftyp=funtyp(bk)\r
+  if ftyp>2000 then ftyp=ftyp-2000,end\r
+  if ftyp>1000 then ftyp=ftyp-1000,end\r
+\r
+  //** check function type\r
+  if ftyp < 0 then //** ifthenelse eselect blocks\r
+      txt = [];\r
+      return;\r
+  else\r
+    if (ftyp<>0 & ftyp<>1 & ftyp<>2 & ftyp<>3 & ftyp<>4) then\r
+      disp("types other than 0,1,2,3 or 4 are not supported.")\r
+      txt = [];\r
+      return;\r
+    end\r
+  end\r
+\r
+  select ftyp\r
+\r
+    case 0 then\r
+      //**** input/output addresses definition ****//\r
+      if nin>1 then\r
+        for k=1:nin\r
+          uk=inplnk(inpptr(bk)-1+k);\r
+          nuk=size(outtb(uk),'*');\r
+          txt=[txt;\r
+               'rdouttb['+string(k-1)+']=(double *)'+rdnom+'_block_outtbptr['+string(uk-1)+'];']\r
+        end\r
+        txt=[txt;\r
+             'args[0]=&(rdouttb[0]);']\r
+      elseif nin==0\r
+        uk=0;\r
+        nuk=0;\r
+        txt=[txt;\r
+             'args[0]=(double *)'+rdnom+'_block_outtbptr[0];']\r
+      else\r
+        uk=inplnk(inpptr(bk));\r
+        nuk=size(outtb(uk),'*');\r
+        txt=[txt;\r
+             'args[0]=(double *)'+rdnom+'_block_outtbptr['+string(uk-1)+'];']\r
+      end\r
+\r
+      if nout>1 then\r
+        for k=1:nout\r
+          yk=outlnk(outptr(bk)-1+k);\r
+          nyk=size(outtb(yk),'*');\r
+          txt=[txt;\r
+               'rdouttb['+string(k+nin-1)+']=(double *)'+rdnom+'_block_outtbptr['+string(yk-1)+'];'];\r
+        end\r
+        txt=[txt;\r
+             'args[1]=&(rdouttb['+string(nin)+']);'];\r
+      elseif nout==0\r
+        yk=0;\r
+        nyk=0;\r
+        txt=[txt;\r
+             'args[1]=(double *)'+rdnom+'_block_outtbptr[0];'];\r
+      else\r
+        yk=outlnk(outptr(bk));\r
+        nyk=size(outtb(yk),'*'),;\r
+        txt=[txt;\r
+             'args[1]=(double *)'+rdnom+'_block_outtbptr['+string(yk-1)+'];'];\r
+      end\r
+      //*******************************************//\r
+\r
+      //*********** call seq definition ***********//\r
+      txtc=['(&local_flag,&block_'+rdnom+'['+string(bk-1)+'].nevprt,&t,block_'+rdnom+'['+string(bk-1)+'].xd, \';\r
+            'block_'+rdnom+'['+string(bk-1)+'].x,&block_'+rdnom+'['+string(bk-1)+'].nx, \';\r
+            'block_'+rdnom+'['+string(bk-1)+'].z,&block_'+rdnom+'['+string(bk-1)+'].nz,block_'+rdnom+'['+string(bk-1)+'].evout, \';\r
+            '&block_'+rdnom+'['+string(bk-1)+'].nevout,block_'+rdnom+'['+string(bk-1)+'].rpar,&block_'+rdnom+'['+string(bk-1)+'].nrpar, \';\r
+            'block_'+rdnom+'['+string(bk-1)+'].ipar,&block_'+rdnom+'['+string(bk-1)+'].nipar, \';\r
+            '(double *)args[0],&nrd_'+string(nuk)+',(double *)args[1],&nrd_'+string(nyk)+');'];\r
+      if (funtyp(bk)>2000 & funtyp(bk)<3000)\r
+        blank = get_blank(funs(bk)+'( ');\r
+        txtc(1) = funs(bk)+txtc(1);\r
+      elseif (funtyp(bk)<2000)\r
+        txtc(1) = 'C2F('+funs(bk)+')'+txtc(1);\r
+        blank = get_blank('C2F('+funs(bk)+') ');\r
+      end\r
+      txtc(2:$) = blank + txtc(2:$);\r
+      txt = [txt;txtc];\r
+      //*******************************************//\r
+\r
+\r
+    //**\r
+    case 1 then\r
+      //*********** call seq definition ***********//\r
+      txtc=['(&local_flag,&block_'+rdnom+'['+string(bk-1)+'].nevprt,&t,block_'+rdnom+'['+string(bk-1)+'].xd, \';\r
+            'block_'+rdnom+'['+string(bk-1)+'].x,&block_'+rdnom+'['+string(bk-1)+'].nx, \';\r
+            'block_'+rdnom+'['+string(bk-1)+'].z,&block_'+rdnom+'['+string(bk-1)+'].nz,block_'+rdnom+'['+string(bk-1)+'].evout, \';\r
+            '&block_'+rdnom+'['+string(bk-1)+'].nevout,block_'+rdnom+'['+string(bk-1)+'].rpar,&block_'+rdnom+'['+string(bk-1)+'].nrpar, \';\r
+            'block_'+rdnom+'['+string(bk-1)+'].ipar,&block_'+rdnom+'['+string(bk-1)+'].nipar'];\r
+      if (funtyp(bk)>2000 & funtyp(bk)<3000)\r
+        blank = get_blank(funs(bk)+'( ');\r
+        txtc(1) = funs(bk)+txtc(1);\r
+      elseif (funtyp(bk)<2000)\r
+        txtc(1) = 'C2F('+funs(bk)+')'+txtc(1);\r
+        blank = get_blank('C2F('+funs(bk)+') ');\r
+      end\r
+      if nin>=1 | nout>=1 then\r
+        txtc($)=txtc($)+', \'\r
+        txtc=[txtc;'']\r
+        if nin>=1 then\r
+          for k=1:nin\r
+            uk=inplnk(inpptr(bk)-1+k);\r
+            nuk=size(outtb(uk),'*');\r
+            txtc($)=txtc($)+'(double *)'+rdnom+'_block_outtbptr['+string(uk-1)+'],&nrd_'+string(nuk)+',';\r
+          end\r
+          txtc($)=part(txtc($),1:length(txtc($))-1); //remove last ,\r
+        end\r
+        if nout>=1 then\r
+          if nin>=1 then\r
+            txtc($)=txtc($)+', \'\r
+            txtc=[txtc;'']\r
+          end\r
+          for k=1:nout\r
+            yk=outlnk(outptr(bk)-1+k);\r
+            nyk=size(outtb(yk),'*');\r
+            txtc($)=txtc($)+'(double *)'+rdnom+'_block_outtbptr['+string(yk-1)+'],&nrd_'+string(nyk)+',';\r
+          end\r
+          txtc($)=part(txtc($),1:length(txtc($))-1); //remove last ,\r
+        end\r
+      end\r
+\r
+      if ztyp(bk) then\r
+        txtc($)=txtc($)+', \'\r
+        txtc=[txtc;\r
+              'block_'+rdnom+'['+string(bk-1)+'].g,&block_'+rdnom+'['+string(bk-1)+'].ng);']\r
+      else\r
+        txtc($)=txtc($)+');';\r
+      end\r
+\r
+      txtc(2:$) = blank + txtc(2:$);\r
+      txt = [txt;txtc];\r
+      //*******************************************//\r
+\r
+    //**\r
+    case 2 then\r
+\r
+      //*********** call seq definition ***********//\r
+      txtc=[funs(bk)+'(&local_flag,&block_'+rdnom+'['+string(bk-1)+'].nevprt,&t,block_'+rdnom+'['+string(bk-1)+'].xd, \';\r
+            'block_'+rdnom+'['+string(bk-1)+'].x,&block_'+rdnom+'['+string(bk-1)+'].nx, \';\r
+            'block_'+rdnom+'['+string(bk-1)+'].z,&block_'+rdnom+'['+string(bk-1)+'].nz,block_'+rdnom+'['+string(bk-1)+'].evout, \';\r
+            '&block_'+rdnom+'['+string(bk-1)+'].nevout,block_'+rdnom+'['+string(bk-1)+'].rpar,&block_'+rdnom+'['+string(bk-1)+'].nrpar, \';\r
+            'block_'+rdnom+'['+string(bk-1)+'].ipar,&block_'+rdnom+'['+string(bk-1)+'].nipar, \';\r
+            '(double **)block_'+rdnom+'['+string(bk-1)+'].inptr,block_'+rdnom+'['+string(bk-1)+'].insz,&block_'+rdnom+'['+string(bk-1)+'].nin, \';\r
+            '(double **)block_'+rdnom+'['+string(bk-1)+'].outptr,block_'+rdnom+'['+string(bk-1)+'].outsz, &block_'+rdnom+'['+string(bk-1)+'].nout'];\r
+      if ~ztyp(bk) then\r
+        txtc($)=txtc($)+');';\r
+      else\r
+        txtc($)=txtc($)+', \';\r
+        txtc=[txtc;\r
+              'block_'+rdnom+'['+string(bk-1)+'].g,&block_'+rdnom+'['+string(bk-1)+'].ng);']\r
+      end\r
+      blank = get_blank(funs(bk)+'( ');\r
+      txtc(2:$) = blank + txtc(2:$);\r
+      txt = [txt;txtc];\r
+      //*******************************************//\r
+\r
+    //**\r
+    case 4 then\r
+      txt=[txt;\r
+           funs(bk)+'(&block_'+rdnom+'['+string(bk-1)+'],local_flag);'];\r
+\r
+  end\r
+\r
+  txt =[txt;'if(local_flag < 0) return(5 - local_flag);']\r
+\r
+endfunction\r
+\r
+//CallBlock : generate C calling sequence\r
+//            of a scicos block\r
+//\r
+//inputs : bk   : bloc index\r
+//         pt   :\r
+//         flag :block_'+rdnom+'[\r
+//\r
+//output : txt  :\r
+//\r
+//16/06/07 Authors : R.Nikoukhah, A.Layec\r
+function txt=call_block4(bk)\r
+//   if flag==2 & ((zptr(bk+1)-zptr(bk))+(ozptr(bk+1)-ozptr(bk))==0 | pt<=0) then\r
+//     return // block without discrete state or continuously activated\r
+//            // If work allocated in the absence of z and oz, it does not work\r
+//   end\r
+\r
+  //**\r
+  nx=xptr(bk+1)-xptr(bk);\r
+  nz=zptr(bk+1)-zptr(bk);\r
+  nrpar=rpptr(bk+1)-rpptr(bk);\r
+  nipar=ipptr(bk+1)-ipptr(bk);\r
+  nin=inpptr(bk+1)-inpptr(bk);  //* number of input ports */\r
+  nout=outptr(bk+1)-outptr(bk); //* number of output ports */\r
+\r
+  //**\r
+  //l'adresse du pointeur de ipar\r
+  if nipar<>0 then ipar=ipptr(bk), else ipar=1;end\r
+  //l'adresse du pointeur de rpar\r
+  if nrpar<>0 then rpar=rpptr(bk), else rpar=1; end\r
+  //l'adresse du pointeur de z attention -1 pas sur\r
+  if nz<>0 then z=zptr(bk)-1, else z=0;end\r
+  //l'adresse du pointeur de x\r
+  if nx<>0 then x=xptr(bk)-1, else x=0;end\r
+\r
+  //**\r
+  ftyp=funtyp(bk)\r
+  if ftyp>2000 then ftyp=ftyp-2000,end\r
+  if ftyp>1000 then ftyp=ftyp-1000,end\r
+\r
+  //** check function type\r
+  if ftyp < 0 then //** ifthenelse eselect blocks\r
+      txt = [];\r
+      return;\r
+  else\r
+    if (ftyp<>0 & ftyp<>1 & ftyp<>2 & ftyp<>3 & ftyp<>4) then\r
+      disp("types other than 0,1,2,3 or 4 are not supported.")\r
+      txt = [];\r
+      return;\r
+    end\r
+  end\r
+\r
+  //** add comment\r
+  txt=[get_comment('call_blk',list(funs(bk),funtyp(bk),bk));]\r
+\r
+  //** write nevprt activation\r
+//   nclock=abs(pt);\r
+  txt=[txt;\r
+       'block_'+rdnom+'['+string(bk-1)+'].nevprt=nevprt;']\r
+\r
+  select ftyp\r
+    //** zero funtyp\r
+    case 0 then\r
+      //**** input/output addresses definition ****//\r
+      if nin>1 then\r
+        for k=1:nin\r
+          uk=inplnk(inpptr(bk)-1+k);\r
+          nuk=size(outtb(uk),'*');\r
+          TYPE=mat2scs_c_ptr(outtb(uk));//scilab index start from 1\r
+          txt=[txt;\r
+               'rdouttb['+string(k-1)+']=('+TYPE+' *)'+rdnom+'_block_outtbptr['+string(uk-1)+'];']\r
+        end\r
+        txt=[txt;\r
+             'args[0]=&(rdouttb[0]);']\r
+      elseif nin==0\r
+        uk=0;\r
+        nuk=0;\r
+        txt=[txt;\r
+             'args[0]=(SCSREAL_COP *)'+rdnom+'_block_outtbptr[0];']\r
+      else\r
+        uk=inplnk(inpptr(bk));\r
+        nuk=size(outtb(uk),'*');\r
+        TYPE=mat2scs_c_ptr(outtb(uk));//scilab index start from 1\r
+        txt=[txt;\r
+             'args[0]=('+TYPE+' *)'+rdnom+'_block_outtbptr['+string(uk-1)+'];']\r
+      end\r
+\r
+      if nout>1 then\r
+        for k=1:nout\r
+          yk=outlnk(outptr(bk)-1+k);\r
+          nyk=size(outtb(yk),'*');\r
+          TYPE=mat2scs_c_ptr(outtb(yk));//scilab index start from 1\r
+          txt=[txt;\r
+               'rdouttb['+string(k+nin-1)+']=('+TYPE+' *)'+rdnom+'_block_outtbptr['+string(yk-1)+'];'];\r
+        end\r
+        txt=[txt;\r
+             'args[1]=&(rdouttb['+string(nin)+']);'];\r
+      elseif nout==0\r
+        yk=0;\r
+        nyk=0;\r
+        txt=[txt;\r
+             'args[1]=(SCSREAL_COP *)'+rdnom+'_block_outtbptr[0];'];\r
+      else\r
+        yk=outlnk(outptr(bk));\r
+        nyk=size(outtb(yk),'*'),;\r
+        TYPE=mat2scs_c_ptr(outtb(yk));//scilab index start from 1\r
+        txt=[txt;\r
+             'args[1]=('+TYPE+' *)'+rdnom+'_block_outtbptr['+string(yk-1)+'];'];\r
+      end\r
+      //*******************************************//\r
+\r
+      //*********** call seq definition ***********//\r
+      txtc=['(&flag,&block_'+rdnom+'['+string(bk-1)+'].nevprt,told,block_'+rdnom+'['+string(bk-1)+'].xd, \';\r
+            'block_'+rdnom+'['+string(bk-1)+'].x,&block_'+rdnom+'['+string(bk-1)+'].nx, \';\r
+            'block_'+rdnom+'['+string(bk-1)+'].z,&block_'+rdnom+'['+string(bk-1)+'].nz,block_'+rdnom+'['+string(bk-1)+'].evout, \';\r
+            '&block_'+rdnom+'['+string(bk-1)+'].nevout,block_'+rdnom+'['+string(bk-1)+'].rpar,&block_'+rdnom+'['+string(bk-1)+'].nrpar, \';\r
+            'block_'+rdnom+'['+string(bk-1)+'].ipar,&block_'+rdnom+'['+string(bk-1)+'].nipar, \';\r
+            '(double *)args[0],&nrd_'+string(nuk)+',(double *)args[1],&nrd_'+string(nyk)+');'];\r
+      if (funtyp(bk)>2000 & funtyp(bk)<3000)\r
+        blank = get_blank(funs(bk)+'( ');\r
+        txtc(1) = funs(bk)+txtc(1);\r
+      elseif (funtyp(bk)<2000)\r
+        txtc(1) = 'C2F('+funs(bk)+')'+txtc(1);\r
+        blank = get_blank('C2F('+funs(bk)+') ');\r
+      end\r
+      txtc(2:$) = blank + txtc(2:$);\r
+      txt = [txt;txtc];\r
+      //*******************************************//\r
+\r
+\r
+    //**\r
+    case 1 then\r
+      //**** input/output addresses definition ****//\r
+//       if nin>=1 then\r
+//         for k=1:nin\r
+//           uk=inplnk(inpptr(i)-1+k);\r
+//           nuk=size(outtb(uk),'*');\r
+//         end\r
+//       end\r
+//       if nout>=1 then\r
+//         for k=1:nout\r
+//           yk=outlnk(outptr(i)-1+k);\r
+//           nyk=size(outtb(yk),'*');\r
+//         end\r
+//       end\r
+      //*******************************************//\r
+\r
+      //*********** call seq definition ***********//\r
+      txtc=['(&flag,&block_'+rdnom+'['+string(bk-1)+'].nevprt,told,block_'+rdnom+'['+string(bk-1)+'].xd, \';\r
+            'block_'+rdnom+'['+string(bk-1)+'].x,&block_'+rdnom+'['+string(bk-1)+'].nx, \';\r
+            'block_'+rdnom+'['+string(bk-1)+'].z,&block_'+rdnom+'['+string(bk-1)+'].nz,block_'+rdnom+'['+string(bk-1)+'].evout, \';\r
+            '&block_'+rdnom+'['+string(bk-1)+'].nevout,block_'+rdnom+'['+string(bk-1)+'].rpar,&block_'+rdnom+'['+string(bk-1)+'].nrpar, \';\r
+            'block_'+rdnom+'['+string(bk-1)+'].ipar,&block_'+rdnom+'['+string(bk-1)+'].nipar'];\r
+      if (funtyp(bk)>2000 & funtyp(bk)<3000)\r
+        blank = get_blank(funs(bk)+'( ');\r
+        txtc(1) = funs(bk)+txtc(1);\r
+      elseif (funtyp(bk)<2000)\r
+        txtc(1) = 'C2F('+funs(bk)+')'+txtc(1);\r
+        blank = get_blank('C2F('+funs(bk)+') ');\r
+      end\r
+      if nin>=1 | nout>=1 then\r
+        txtc($)=txtc($)+', \'\r
+        txtc=[txtc;'']\r
+        if nin>=1 then\r
+          for k=1:nin\r
+            uk=inplnk(inpptr(bk)-1+k);\r
+            nuk=size(outtb(uk),'*');\r
+            txtc($)=txtc($)+'(SCSREAL_COP *)'+rdnom+'_block_outtbptr['+string(uk-1)+'],&nrd_'+string(nuk)+',';\r
+          end\r
+          txtc($)=part(txtc($),1:length(txtc($))-1); //remove last ,\r
+        end\r
+        if nout>=1 then\r
+          if nin>=1 then\r
+            txtc($)=txtc($)+', \'\r
+            txtc=[txtc;'']\r
+          end\r
+          for k=1:nout\r
+            yk=outlnk(outptr(bk)-1+k);\r
+            nyk=size(outtb(yk),'*');\r
+            txtc($)=txtc($)+'(SCSREAL_COP *)'+rdnom+'_block_outtbptr['+string(yk-1)+'],&nrd_'+string(nyk)+',';\r
+          end\r
+          txtc($)=part(txtc($),1:length(txtc($))-1); //remove last ,\r
+        end\r
+      end\r
+\r
+      if ztyp(bk) then\r
+        txtc($)=txtc($)+', \'\r
+        txtc=[txtc;'w,&nrd_0);'];\r
+      else\r
+        txtc($)=txtc($)+');';\r
+      end\r
+\r
+      txtc(2:$) = blank + txtc(2:$);\r
+      txt = [txt;txtc];\r
+      //*******************************************//\r
+\r
+    //**\r
+    case 2 then\r
+\r
+      //*********** call seq definition ***********//\r
+      txtc=[funs(bk)+'(&flag,&block_'+rdnom+'['+string(bk-1)+'].nevprt,told,block_'+rdnom+'['+string(bk-1)+'].xd, \';\r
+            'block_'+rdnom+'['+string(bk-1)+'].x,&block_'+rdnom+'['+string(bk-1)+'].nx, \';\r
+            'block_'+rdnom+'['+string(bk-1)+'].z,&block_'+rdnom+'['+string(bk-1)+'].nz,block_'+rdnom+'['+string(bk-1)+'].evout, \';\r
+            '&block_'+rdnom+'['+string(bk-1)+'].nevout,block_'+rdnom+'['+string(bk-1)+'].rpar,&block_'+rdnom+'['+string(bk-1)+'].nrpar, \';\r
+            'block_'+rdnom+'['+string(bk-1)+'].ipar,&block_'+rdnom+'['+string(bk-1)+'].nipar, \';\r
+            '(double **)block_'+rdnom+'['+string(bk-1)+'].inptr,block_'+rdnom+'['+string(bk-1)+'].insz,&block_'+rdnom+'['+string(bk-1)+'].nin, \';\r
+            '(double **)block_'+rdnom+'['+string(bk-1)+'].outptr,block_'+rdnom+'['+string(bk-1)+'].outsz, &block_'+rdnom+'['+string(bk-1)+'].nout'];\r
+      if ~ztyp(bk) then\r
+        txtc($)=txtc($)+');';\r
+      else\r
+        txtc($)=txtc($)+', \';\r
+        txtc=[txtc;\r
+              'block_'+rdnom+'['+string(bk-1)+'].g,&block_'+rdnom+'['+string(bk-1)+'].ng);']\r
+      end\r
+      blank = get_blank(funs(bk)+'( ');\r
+      txtc(2:$) = blank + txtc(2:$);\r
+      txt = [txt;txtc];\r
+      //*******************************************//\r
+\r
+    //**\r
+    case 4 then\r
+      txt=[txt;\r
+           funs(bk)+'(&block_'+rdnom+'['+string(bk-1)+'],flag);'];\r
+\r
+  end\r
+endfunction\r
+\r
+//\r
+//16/06/07 Author : ?, A. Layec\r
+//\r
+function [Code,capt,proto]=call_sensor(i)\r
+  nin=inpptr(i+1)-inpptr(i); ///* number of input ports */\r
+  nout=outptr(i+1)-outptr(i); ///* number of output ports */\r
+\r
+  //declaration des I/O des blocs de type 1\r
+  if funtyp(i)==0 then\r
+    if nout==0 then\r
+      yk    = 0;\r
+      nyk_1 = 0;\r
+      nyk_2 = 0;\r
+      yk_t  = 1;\r
+      //Code($+1)=+'  args[1]=(double *)(outtbptr[0]);';\r
+    else\r
+      yk    = outlnk(outptr(i));\r
+      nyk_1 = size(outtb(yk),1);\r
+      nyk_2 = size(outtb(yk),2);\r
+      yk_t  = mat2scs_c_nb(outtb(yk));\r
+      //Code($+1)='  args[1]=('+mat2scs_c_ptr(outtb(yk))+' *)(outtbptr['+string(yk-1)+']);';\r
+    end\r
+\r
+  end\r
+  capt=[i yk nyk_1 nyk_2 yk_t bllst(i).ipar]\r
+  Code($+1)='block_'+rdnom+'['+string(i-1)+'].nevprt=nevprt;'\r
+  Code=['/* Call of sensor (blk nb '+string(i)+') */'\r
+        Code;\r
+        'nport = '+string(nbcap)+';';\r
+        rdnom+'_sensor(&flag, &nport, &block_'+rdnom+'['+string(i-1)+'].nevprt, '+..\r
+        'told, ('+mat2scs_c_ptr(outtb(yk))+' *)(outtbptr['+string(yk-1)+']), &nrd_'+string(nyk_1)+..\r
+        ', &nrd_'+string(nyk_2)+', &nrd_'+string(yk_t)+',aaa);'];\r
+  proto='void '+rdnom+'_sensor('+..\r
+        'int *, int *, int *, double *,void *, int *, int *,int *, int);'\r
+  proto=cformatline(proto,70);\r
+endfunction\r
+\r
+//Generates Code for dynamically linked Fortran and C Blocks\r
+function [CCode,FCode]=gen_blocks()\r
+  CCode=[]\r
+  FCode=[]\r
+\r
+  kdyn=find(funtyp>1000) //dynamically linked blocs\r
+                         //100X : Fortran blocks\r
+                         //200X : C blocks\r
+\r
+  if (size(kdyn,'*') >1)\r
+    kfuns=[]; \r
+    //get the block data structure in the initial scs_m structure\r
+    if size(corinv(kdyn(1)),'*')==1 then\r
+      O=scs_m.objs(corinv(kdyn(1)));\r
+    else\r
+      path=list('objs');\r
+      for l=corinv(kdyn(1))(1:$-1)\r
+        path($+1)=l;\r
+        path($+1)='model';\r
+        path($+1)='rpar';\r
+        path($+1)='objs';\r
+      end\r
+      path($+1)=corinv(kdyn(1))($);\r
+      O=scs_m(path);\r
+    end\r
+    if funtyp(kdyn(1))>2000 then\r
+      //C block\r
+      CCode=[CCode;O.graphics.exprs(2)]\r
+    else\r
+      FCode=[FCode;O.graphics.exprs(2)]\r
+    end\r
+    kfuns=funs(kdyn(1));\r
+    for i=2:size(kdyn,'*')\r
+      //get the block data structure in the initial scs_m structure\r
+      if size(corinv(kdyn(i)),'*')==1 then\r
+        O=scs_m.objs(corinv(kdyn(i)));\r
+      else\r
+        path=list('objs');\r
+         for l=corinv(kdyn(i))(1:$-1)\r
+           path($+1)=l;\r
+           path($+1)='model';\r
+           path($+1)='rpar';\r
+           path($+1)='objs';\r
+        end\r
+        path($+1)=corinv(kdyn(i))($);\r
+        O=scs_m(path);\r
+      end\r
+      if (find(kfuns==funs(kdyn(i))) == [])\r
+        kfuns=[kfuns;funs(kdyn(i))];\r
+        if funtyp(kdyn(i))>2000  then\r
+          //C block\r
+          CCode=[CCode;O.graphics.exprs(2)]\r
+        else\r
+          FCode=[FCode;O.graphics.exprs(2)]\r
+        end\r
+      end\r
+    end\r
+  elseif (size(kdyn,'*')==1)\r
+    //get the block data structure in the initial scs_m structure\r
+    if size(corinv(kdyn),'*')==1 then\r
+      O=scs_m.objs(corinv(kdyn));\r
+    else\r
+      path=list('objs');\r
+      for l=corinv(kdyn)(1:$-1)\r
+        path($+1)=l;\r
+        path($+1)='model';\r
+        path($+1)='rpar';\r
+        path($+1)='objs';\r
+      end\r
+      path($+1)=corinv(kdyn)($);\r
+      O=scs_m(path);\r
+    end\r
+    if funtyp(kdyn)>2000 then\r
+      //C block\r
+      CCode=[CCode;O.graphics.exprs(2)]\r
+    else\r
+      FCode=[FCode;O.graphics.exprs(2)]\r
+    end\r
+  end\r
+  if CCode==[]\r
+    CCode=['void no_ccode()'\r
+           '{'\r
+           '  return;'\r
+           '}']\r
+  end\r
+endfunction\r
+\r
+//** Generates the C code for new block simulation\r
+//\r
+//12/07/07 Alan Layec\r
+function ok=gen_ccode42();\r
+\r
+  //** Generate code for scicos block\r
+  Code=make_computational42()\r
+\r
+  ierr=execstr('mputl(Code,rpat+''/''+rdnom+''.c'')','errcatch')\r
+  if ierr<>0 then\r
+    message(lasterror())\r
+    ok=%f\r
+    return\r
+  end\r
+\r
+  //** Generate files for dynamically linked scicos blocks\r
+  [CCode,FCode]=gen_blocks()\r
+  if FCode<>[] then\r
+    ierr=execstr('mputl(FCode,rpat+''/''+rdnom+''f.f'')','errcatch')\r
+    if ierr<>0 then\r
+      message(lasterror())\r
+      ok=%f\r
+      return\r
+    end\r
+  end\r
+  if CCode<>[] then\r
+    ierr=execstr('mputl(CCode,rpat+''/''+rdnom+''_Cblocks.c'')','errcatch')\r
+    if ierr<>0 then\r
+      message(lasterror())\r
+      ok=%f\r
+      return\r
+    end\r
+  end\r
+\r
+  //** Generate _void_io.c\r
+  Code=['/*---------------------------------------- Actuators */'\r
+        'void '+rdnom+'_actuator(flag,nport,nevprt,t,u,nu1,nu2,ut,flag1)'\r
+             '     int *flag,*nevprt,*nport;'\r
+             '     int *nu1,*nu2,*ut,flag1;'\r
+        '     double *t;'\r
+        '     void *u;'\r
+        '{'\r
+        '  int k,l;'\r
+        '}'\r
+        '/*---------------------------------------- Sensor */'\r
+        'void '+rdnom+'_sensor(flag,nport,nevprt,t,y,ny1,ny2,yt,flag1)'\r
+        '     int *flag,*nevprt,*nport;'\r
+        '     int *ny1,*ny2,*yt,flag1;'\r
+        '     double *t;'\r
+        '     void *y;'\r
+        '{'\r
+        '  int k,l;'\r
+        '}']\r
+\r
+  ierr=execstr('mputl(Code,rpat+''/''+rdnom+''_void_io.c'')','errcatch')\r
+  if ierr<>0 then\r
+    message(lasterror())\r
+    ok=%f\r
+    return\r
+  end\r
+\r
+  //** Generate _standalone.c\r
+  Code=make_standalone42()\r
+\r
+  ierr=execstr('mputl(Code,rpat+''/''+rdnom+''_standalone.c'')','errcatch')\r
+  if ierr<>0 then\r
+    message(lasterror())\r
+    ok=%f\r
+    return\r
+  end\r
+\r
+  //** copy source code of machine.h/scicos_block4.h\r
+  //   in target path\r
+  txt=mgetl(SCI+'/routines/machine.h');\r
+  ierr=execstr('mputl(txt,rpat+''/machine.h'')','errcatch')\r
+  if ierr<>0 then\r
+    message(lasterror())\r
+    ok=%f\r
+    return\r
+  end\r
+\r
+  txt=mgetl(SCI+'/routines/scicos/scicos_block4.h');\r
+  ierr=execstr('mputl(txt,rpat+''/scicos_block4.h'')','errcatch')\r
+  if ierr<>0 then\r
+    message(lasterror())\r
+    ok=%f\r
+    return\r
+  end\r
+\r
+  //** Generate _act_sens_events.c\r
+  Code=['#include <stdio.h>'\r
+        '#include <stdlib.h>'\r
+        '#include <math.h>'\r
+        '#include <string.h>'\r
+        'extern void **'+rdnom+'_block_outtbptr;'\r
+        'extern char input[50],output[50];'\r
+        'FILE *fprr,*fprw;'\r
+        make_outevents()\r
+        make_actuator(%t)\r
+        make_sensor(%t)]\r
+\r
+  created=[];\r
+  reponse=[];\r
+\r
+  created=fileinfo(rpat+'/'+rdnom+'_act_sens_events.c')\r
+  if created~=[] then\r
+    reponse=x_message(['File: ""'+rdnom+'_act_sens_events.c"" already exists,';\r
+                       'do you want to replace it ?'],['Yes','No']);\r
+  end\r
+\r
+  if reponse==1 |  reponse==[] then\r
+    ierr=execstr('mputl(Code,rpat+''/''+rdnom+''_act_sens_events.c'')', ...\r
+                 'errcatch')\r
+    if ierr<>0 then\r
+      message(lasterror())\r
+      ok=%f\r
+      return\r
+    end\r
+  end\r
+endfunction\r
+\r
+//creates the Scicos GUI function associated with the new block\r
+//\r
+//Author : Rachid Djenidi, A.Layec\r
+//\r
+//20/06/07, A.Layec : update with in2,out2,intyp,outtyp\r
+//27/06/07, A.Layec : update opar,oz\r
+//\r
+function ok=gen_gui42();\r
+  clkinput=ones(clkIN)';\r
+  clkoutput=ones(clkOUT)';\r
+  //outtb=outtb;\r
+  oz=cpr.state.oz;\r
+\r
+  new_oz=list();\r
+  for i=1:lstsize(oz)\r
+    new_oz($+1) = oz(i)\r
+  end\r
+  for i=1:lstsize(outtb)\r
+    new_oz($+1) = outtb(i)\r
+  end\r
+\r
+  //outtb($+1) = zeros(nblk,1);\r
+  Code=['function [x,y,typ]='+rdnom+'_c(job,arg1,arg2)';\r
+        '// Copyright INRIA';\r
+        ' x=[];y=[];typ=[];';\r
+        ' select job';\r
+        ' case ''plot'' then';\r
+        '   standard_draw(arg1)';\r
+        ' case ''getinputs'' then';\r
+        '   [x,y,typ]=standard_inputs(arg1)';\r
+        ' case ''getoutputs'' then';\r
+        '   [x,y,typ]=standard_outputs(arg1)';\r
+        ' case ''getorigin'' then';\r
+        '   [x,y]=standard_origin(arg1)';\r
+        ' case ''set'' then';\r
+        '   x=arg1;';\r
+        ' case ''define'' then'\r
+        '   '+sci2exp(capt(:,3),'in',70); //input ports sizes 1\r
+        '   '+sci2exp(capt(:,4),'in2',70); //input ports sizes 2\r
+        '   '+sci2exp(scs_c_nb2scs_nb(capt(:,5)),'intyp',70); //input ports type\r
+        '   '+sci2exp(actt(:,3),'out',70); //output ports sizes 1\r
+        '   '+sci2exp(actt(:,4),'out2',70); //output ports sizes 2\r
+        '   '+sci2exp(scs_c_nb2scs_nb(actt(:,5)),'outtyp',70); //output ports type\r
+        '   '+sci2exp(x,'x',70); //initial continuous state\r
+        '   '+sci2exp(z,'z',70); //initial discrete state\r
+        '   work=zeros('+string(nblk)+',1)';\r
+        '   Z=[z;work]';\r
+        '   '+sci2exp(new_oz,'odstate',70);\r
+        '   '+sci2exp(cpr.sim.rpar,'rpar',70); //real parameters\r
+        '   '+sci2exp(cpr.sim.ipar,'ipar',70); //integer parameters\r
+        '   '+sci2exp(cpr.sim.opar,'opar',70); //object parameters\r
+        '   '+sci2exp(clkinput,'clkinput',70);\r
+        '   '+sci2exp(clkoutput,'clkoutput',70);\r
+        '   '+sci2exp(FIRING,'firing',70);\r
+        '   nzcross='+string(sum(cpr.sim.zcptr(2:$)-cpr.sim.zcptr(1:$-1)))';\r
+        '   nmode='+string(sum(cpr.sim.modptr(2:$)-cpr.sim.modptr(1:$-1)))';]\r
+\r
+  for i=1:length(bllst)\r
+    deput=[%t,%f]\r
+    if (bllst(i).dep_ut(2) == %t) then\r
+      deput(1,2)=%t;\r
+      break;\r
+    end\r
+  end\r
+  Code($+1)='   '+sci2exp(deput,'dep_ut',70);\r
+  Code=[Code\r
+        '   model=scicos_model(sim=list('''+rdnom+''',4),..'\r
+        '                      in=in,..'\r
+        '                      in2=in2,..'\r
+        '                      intyp=intyp,..'\r
+        '                      out=out,..'\r
+        '                      out2=out2,..'\r
+        '                      outtyp=outtyp,..'\r
+        '                      evtin=clkinput,..'\r
+        '                      evtout=clkoutput,..'\r
+        '                      firing=firing,..'\r
+        '                      state=x,..'\r
+        '                      dstate=Z,..'\r
+        '                      odstate=odstate,..'\r
+        '                      rpar=rpar,..'\r
+        '                      ipar=ipar,..'\r
+        '                      opar=opar,..'\r
+        '                      blocktype=''c'',..'\r
+        '                      dep_ut=dep_ut,..'\r
+        '                      nzcross=nzcross,..'\r
+        '                      nmode=nmode)'\r
+        '   gr_i=''xstringb(orig(1),orig(2),'''''+rdnom+''''',sz(1),..'\r
+        '          sz(2),''''fill'''')''';\r
+        '   x=standard_define([2 2],model,[],gr_i)';\r
+        ' end'\r
+        'endfunction'];\r
+  //Create file\r
+  ierr=execstr('mputl(Code,rpat+''/''+rdnom+''_c.sci'')','errcatch')\r
+  if ierr<>0 then\r
+    message(lasterror())\r
+    ok=%f\r
+  end\r
+endfunction\r
+\r
+function  [ok,XX,alreadyran,flgcdgen,szclkINTemp,freof]=do_compile_superblock42(XX,all_scs_m,numk,alreadyran)\r
+// Transforms a given Scicos discrete and continuous SuperBlock into a C defined Block\r
+\r
+  scs_m=XX.model.rpar\r
+  par=scs_m.props;\r
+  if alreadyran then\r
+    //terminate current simulation\r
+    do_terminate()\r
+    alreadyran=%f\r
+  end\r
+  hname=scs_m.props.title(1) //superblock name\r
+  //***********************************************************\r
+  //Check blocks properties and adapt them if necessary\r
+  //***********************************************************\r
+\r
+  IN=[];OUT=[];clkIN=[];clkOUT=[];numa=[];numc=[];\r
+  for i=1:size(scs_m.objs)\r
+    if typeof(scs_m.objs(i))=='Block' then\r
+      if scs_m.objs(i).gui=='CLKOUT_f' then\r
+        ok=%f;%cpr=list()\r
+        message('Superblock should not have any activation output port.')\r
+        return\r
+      elseif scs_m.objs(i).gui=='IN_f' then\r
+        //replace input ports by sensor blocks\r
+        numc=numc+1\r
+        scs_m.objs(i).gui='INPUTPORTEVTS';\r
+        scs_m.objs(i).model.evtin=1\r
+        scs_m.objs(i).model.sim(1)='capteur'+string(numc)\r
+        IN=[IN scs_m.objs(i).model.ipar]\r
+      elseif scs_m.objs(i).gui=='OUT_f' then\r
+        //replace output ports by actuator blocks\r
+        numa=numa+1\r
+        scs_m.objs(i).gui='OUTPUTPORTEVTS';\r
+        scs_m.objs(i).model.sim(1)='actionneur'+string(numa)\r
+        OUT=[OUT  scs_m.objs(i).model.ipar]\r
+      elseif scs_m.objs(i).gui=='CLKINV_f' then\r
+        //replace event input ports by  fictious block\r
+        scs_m.objs(i).gui='EVTGEN_f';\r
+        scs_m.objs(i).model.sim(1)='bidon'\r
+        clkIN=[clkIN scs_m.objs(i).model.ipar];\r
+        //elseif scs_m.objs(i).model.dep_ut(2)==%t then\r
+        //check for time dependency PAS IICI\r
+        //ok=%f;%cpr=list()\r
+        //message('a block have time dependence.')\r
+        //return\r
+      elseif scs_m.objs(i).gui=='CLKOUTV_f' then\r
+        scs_m.objs(i).gui='EVTOUT_f';\r
+        scs_m.objs(i).model.sim(1)='bidon2'\r
+        clkOUT=[clkOUT scs_m.objs(i).model.ipar];\r
+      end\r
+    end\r
+  end\r
+\r
+  //Check if input/output ports are numered properly\r
+  IN=-sort(-IN);\r
+  if or(IN<>[1:size(IN,'*')]) then\r
+    ok=%f;%cpr=list()\r
+    message('Input ports are not numbered properly.')\r
+    return\r
+  end\r
+  OUT=-sort(-OUT);\r
+  if or(OUT<>[1:size(OUT,'*')]) then\r
+    ok=%f;%cpr=list()\r
+    message('Output ports are not numbered properly.')\r
+    return\r
+  end\r
+  clkIN=-sort(-clkIN);\r
+  if or(clkIN<>[1:size(clkIN,'*')]) then\r
+    ok=%f;%cpr=list()\r
+    message('Event input ports are not numbered properly.')\r
+    return\r
+  end\r
+  clkOUT=-sort(-clkOUT);\r
+  if or(clkOUT<>[1:size(clkOUT,'*')]) then\r
+    ok=%f;%cpr=list()\r
+    message('Event output ports are not numbered properly.')\r
+    return\r
+  end\r
+\r
+  //Check if there is more than one clock in the diagram\r
+  szclkIN=size(clkIN,2);\r
+  if szclkIN==0 then\r
+    szclkIN=[]\r
+  end\r
+  flgcdgen=szclkIN;\r
+  [bllst,connectmat,clkconnect,cor,corinv,ok,scs_m,flgcdgen,freof]=c_pass1(scs_m,flgcdgen);\r
+  if flgcdgen<> szclkIN\r
+    clkIN=[clkIN flgcdgen]\r
+  end\r
+  szclkINTemp=szclkIN;\r
+  szclkIN=flgcdgen;\r
+ // [bllst,connectmat,clkconnect,cor,corinv,ok]=c_pass1(scs_m);\r
+\r
+  //Test for  ALWAYS_ACTIVE sblock (RN -25/06/07)\r
+  ALWAYS_ACTIVE=%f;\r
+  for blki=bllst\r
+    if blki.dep_ut($) then\r
+      ALWAYS_ACTIVE=%t;\r
+      break;\r
+    end\r
+  end\r
+  if ALWAYS_ACTIVE then\r
+    CAPTEURS=[];\r
+    for Ii=1:length(bllst)\r
+      if part(bllst(Ii).sim(1),1:7)=='capteur' then\r
+        bllst(Ii).dep_ut($)=%t\r
+//       elseif part(bllst(Ii).sim(1),1:10)=='actionneur' then\r
+//         bllst(Ii).dep_ut($)=%t\r
+      end\r
+    end\r
+  end\r
+\r
+  if ~ok then\r
+    message('Sorry: problem in the pre-compilation step.')\r
+    return\r
+  end\r
+  a=[];\r
+  b=[];\r
+  tt=[];\r
+  howclk=[];\r
+  allhowclk=[];\r
+  allhowclk2=[];\r
+  cap=[];\r
+  act=[];\r
+\r
+  ///**********************************\r
+  for i=1:size(bllst)\r
+    for j=1:size(bllst)\r
+      if (bllst(i).sim(1)=='actionneur'+string(j)) then\r
+        if tt<>i then\r
+          act=[act;i];\r
+          tt=i;\r
+        end\r
+      elseif (bllst(i).sim(1)=='capteur'+string(j)) then\r
+        if tt<>i then\r
+          cap=[cap;i];\r
+          tt=i;\r
+        end\r
+      elseif (bllst(i).sim(1)=='bidon') then\r
+        if tt<>i then\r
+          allhowclk=[allhowclk;i];\r
+          tt=i;\r
+        end\r
+      elseif (bllst(i).sim(1)=='bidon2') then\r
+        if tt<>i then\r
+          allhowclk2=[allhowclk2;i];\r
+          tt=i;\r
+        end\r
+      end\r
+    end\r
+  end\r
+  ///**********************************\r
+\r
+  if szclkIN>1 then\r
+    //replace the N Event inputs by a fictious block with 2^N as many event\r
+    //outputs\r
+    output=ones((2^szclkIN)-1,1)\r
+    bllst($+1)=scicos_model(sim=list('bidon',1),evtout=output,..\r
+                            blocktype='d',..\r
+                            firing=-output',dep_ut=[%f %f])\r
+    corinv(size(bllst))=size(bllst)+1;\r
+    howclk=size(bllst)\r
+    // adjust the links accordingly\r
+    for i=1:(2^szclkIN)-1\r
+      vec=codebinaire(i,szclkIN)\r
+      for j=1:szclkIN\r
+        if vec(j)*allhowclk(j)>=1 then\r
+          for k=1:size(clkconnect,1)\r
+            if clkconnect(k,1)==allhowclk(j) then\r
+              clkconnect=[clkconnect;[howclk i clkconnect(k,3:4)]]\r
+            end\r
+          end\r
+        end\r
+      end\r
+    end\r
+  elseif szclkIN==[]&~ALWAYS_ACTIVE then\r
+    //superblock has no Event input, add a fictious clock\r
+    output=ones((2^(size(cap,'*')))-1,1)\r
+    if (output == []) then\r
+      output=0;\r
+    end\r
+    bllst($+1)=scicos_model(sim=list('bidon',1),evtout=output,..\r
+                            firing=-output,blocktype='d',dep_ut=[%f %f])\r
+    corinv(size(bllst))=size(bllst)+1;\r
+    howclk=size(bllst);\r
+  elseif szclkIN==1  then\r
+    howclk=allhowclk;\r
+  end\r
+\r
+  //mise en ordre de clkconnect\r
+  if szclkIN>1 then\r
+    newclkconnect=clkconnect;\r
+    clkconnect=[];\r
+    for i=1:size(newclkconnect,1)-1\r
+      if or(newclkconnect(i,:)<>newclkconnect(i+1,:)) then\r
+        clkconnect=[clkconnect;newclkconnect(i,:)]\r
+      end\r
+    end\r
+    if or(newclkconnect($-1,:)<>newclkconnect($,:)) then\r
+      clkconnect=[clkconnect;newclkconnect($,:)]\r
+    end\r
+\r
+    //suppression des blocs bidons\r
+    newclkconnect=clkconnect;nkt=[];\r
+    for i=1:szclkIN\r
+      for k=1:size(newclkconnect,1)\r
+        if newclkconnect(k,1)~=allhowclk(i) then\r
+          nkt=[nkt;newclkconnect(k,:)];\r
+        end\r
+      end\r
+      newclkconnect=nkt;\r
+      nkt=[];\r
+    end\r
+    clkconnect=newclkconnect;\r
+  end\r
+\r
+  //**************************************************\r
+  // nouveau clkconnect avec liaisons sur les capteurs\r
+  //**************************************************\r
+  //Test for  ALWAYS_ACTIVE sblock (RN -25/06/07)\r
+  if ~(ALWAYS_ACTIVE&szclkIN==[]) then\r
+    n=size(cap,1)\r
+    for i=1:n\r
+      if szclkIN>1 then\r
+        for j=1:(2^szclkIN)-1\r
+          clkconnect=[clkconnect;[howclk j cap(i) 1]];\r
+        end\r
+      elseif szclkIN==1 then\r
+        clkconnect=[clkconnect;[howclk 1 cap(i) 1]];\r
+      end\r
+    end\r
+\r
+    //codage de l'activation des capteurs dans le cas de l'heritage\r
+    for i=1:2^n-1\r
+      vec=codebinaire(i,n);\r
+      for j=1:n\r
+        if (vec(j)==1) then\r
+          clkconnect=[clkconnect;[howclk i cap(j) 1]];\r
+        end\r
+      end\r
+    end\r
+  end\r
+\r
+  FIRING=[]\r
+  for i=1:size(allhowclk2,1)\r
+    j = find(clkconnect(:,3)==allhowclk2(i))\r
+    if j<>[] then\r
+      FIRING=[FIRING;bllst(clkconnect(j,1)).firing(clkconnect(j,2))]\r
+    end\r
+  end\r
+\r
+  Code_gene_run=[];\r
+\r
+  //** OLD GRAPHICS \r
+  //** %windo=xget('window')\r
+\r
+  cpr=c_pass2(bllst,connectmat,clkconnect,cor,corinv)\r
+\r
+  if cpr==list() then ok=%f,return, end\r
+\r
+  //** Alan's patch 5/07/07: try to solve\r
+  //   which blocks use work\r
+  funs_save=cpr.sim.funs;\r
+  funtyp_save=cpr.sim.funtyp;\r
+  with_work = zeros(cpr.sim.nblk,1)\r
+  for i=1:lstsize(cpr.sim.funs)\r
+    if part(cpr.sim.funs(i),1:10)=='actionneur' then\r
+       cpr.sim.funs(i) ='bidon'\r
+       cpr.sim.funtyp(i) = 1\r
+    elseif part(cpr.sim.funs(i),1:7)=='capteur' then\r
+       cpr.sim.funs(i) ='bidon'\r
+       cpr.sim.funtyp(i) = 1\r
+    end\r
+  end\r
+\r
+  //**\r
+  //** retrieve all open Scilab windows with winsid()\r
+  //**\r
+\r
+  BeforeCG_WinList = winsid(); \r
+\r
+  ierr=execstr('[state,t]=scicosim(cpr.state,0,0,cpr.sim,'+..\r
+               '''start'',scs_m.props.tol)','errcatch')\r
+  if ierr==0 then\r
+    for i=1:cpr.sim.nblk\r
+       if state.iz(i)<>0 then\r
+          with_work(i)=%t\r
+       end\r
+    end\r
+    ierr=execstr('[state,t]=scicosim(state,0,0,cpr.sim,'+..\r
+                 '''finish'',scs_m.props.tol)','errcatch')\r
+  end\r
+\r
+  //**\r
+  //** retrieve all open Scilab windows with winsid\r
+  //** and close the additional windows open since first\r
+  //** \r
\r
+  //** This code does not cover 100% of the possible situations because the user can \r
+  //** destroy one or more Scicos wins manually during this intermediate phase\r
+  //** This code is 100% functional if the the user does not close manually any win.\r
+  //** TO BE updated in Scilab 5.0\r
+\r
+  AfterCG_WinList = winsid();\r
+  \r
+  AfterCG_size = size(AfterCG_WinList); //** matrix\r
+  AfterCG_size = AfterCG_size(2) ; //** vector lenght \r
+\r
+  BeforeCG_size = size(BeforeCG_WinList); //** matrix\r
+  BeforeCG_size = BeforeCG_size(2) ; //** vector lenght\r
+\r
+  if (or(AfterCG_WinList<>BeforeCG_WinList)) & (AfterCG_size>BeforeCG_size) then\r
+     //** means that a scope or other scicos object has created some\r
+     //** output window\r
+\r
+     DiffCG_Winlist = AfterCG_WinList<>BeforeCG_WinList ; //** T/F mismatch \r
+     DiffCG_Index = find(DiffCG_Winlist); //** recover the mismatched indexes only \r
+\r
+     for win_idx = DiffCG_Index\r
+         delete( scf( AfterCG_WinList(win_idx) ) ) ; //** clear the spurious windows   \r
+     end \r
+     \r
+  end  \r
+  //**------------- end of windows cleaning ----------------------------------------\r
+\r
+  cpr.sim.funs=funs_save;\r
+  cpr.sim.funtyp=funtyp_save;\r
+\r
+  //** OLD GRAPHICS \r
+  //** xset('window',%windo)\r
+\r
+  ///////////////////\r
+  //les pointeurs de cpr :\r
+  x=cpr.state.x;\r
+  z=cpr.state.z;\r
+  outtb=cpr.state.outtb;\r
+\r
+  //RN\r
+  zcptr=cpr.sim.zcptr;\r
+  ozptr=cpr.sim.ozptr;\r
+  rpptr=cpr.sim.rpptr;\r
+  ipptr=cpr.sim.ipptr;\r
+  opptr=cpr.sim.opptr;\r
+  funs=cpr.sim.funs;\r
+  xptr=cpr.sim.xptr;\r
+  zptr=cpr.sim.zptr;\r
+  inpptr=cpr.sim.inpptr;\r
+  inplnk=cpr.sim.inplnk;\r
+  outptr=cpr.sim.outptr;\r
+  outlnk=cpr.sim.outlnk;\r
+  //@l@n lnkptr=cpr.sim.lnkptr;\r
+  ordclk=cpr.sim.ordclk;\r
+  funtyp=cpr.sim.funtyp;\r
+  cord=cpr.sim.cord;\r
+  ncord=size(cord,1);\r
+  nblk=cpr.sim.nb;\r
+  ztyp=cpr.sim.ztyp;\r
+  clkptr=cpr.sim.clkptr\r
+  //taille totale de z : nztotal\r
+  nztotal=size(z,1);\r
+\r
+  //*******************************\r
+  //Checking if superblock is valid\r
+  //*******************************\r
+  msg=[]\r
+  for i=1:length(funs)-1\r
+    if funtyp(i)==3 then\r
+      msg=[msg;'Type 3 block''s not allowed']\r
+//RN   elseif ztyp(i)<>0 then\r
+    //elseif (zcptr(i+1)-zcptr(i))<>0 then\r
+//\r
+      //msg=[msg;'Active zero crossing block''s not allowed']\r
+    elseif (clkptr(i+1)-clkptr(i))<>0 &funtyp(i)>-1 &funs(i)~='bidon' then\r
+      msg=[msg;'Regular block generating activation not allowed yet']\r
+    end\r
+    if msg<>[] then message(msg),ok=%f,return,end\r
+  end\r
+\r
+  //********************************************************\r
+  // Change logical units for readf and writef blocks if any ???\r
+  //********************************************************\r
+  lunit=0\r
+  for d=1:length(funs)\r
+    if funs(d)=='readf'  then\r
+      z(zptr(d)+2)=lunit\r
+      lunit=lunit+1;\r
+    elseif funs(d)=='writef'\r
+      z(zptr(d)+1)=lunit\r
+      lunit=lunit+1;\r
+    end\r
+  end\r
+\r
+  //***********************************\r
+  // Get the name of the file\r
+  //***********************************\r
+  foo=3;\r
+  okk=%f;\r
+  rdnom='foo';\r
+  rpat=getcwd();\r
+  libs='';\r
+  label1=[hname;getcwd()+'/'+hname;''];\r
+\r
+  while %t do\r
+    ok=%t  // to avoid infinite loop\r
+    [okk,..\r
+     rdnom,..\r
+     rpat,..\r
+     libs,..\r
+     label1]=getvalue('Set code generator parameters :',..\r
+                      ['New block''s name :';\r
+                       'Created files Path :';\r
+                       'Other object files to link with (if any)'],..\r
+                       list('str',1,'str',1,'str',1),label1);\r
+    if okk==%f then\r
+      ok=%f\r
+      return\r
+    end\r
+    rpat=stripblanks(rpat);\r
+\r
+    //** 1/07/06 Alan trying to solve multiple libraries during week-end\r
+    if strindex(libs,'''')<>[] | strindex(libs,'""')<>[] then\r
+      ierr=execstr('libs=evstr(libs)','errcatch')\r
+      if ierr<>0  then\r
+        message(['Can''t solve other files to link'])\r
+        ok=%f;\r
+        return\r
+      end\r
+    end\r
+\r
+    //** Alan, I put a warning here in order to inform the user\r
+    //** that the name of the superblock will change\r
+    //** because the space char in name isn't allowed.\r
+    if grep(rdnom," ")<>[] then\r
+      message(['Superblock name cannot contains space characters.';\r
+               'space chars will be automatically substituted by ""_"" '])\r
+    end\r
+    rdnom = strsubst(rdnom,' ','_');\r
+\r
+    //** Put a warning here in order to inform the user\r
+    //** that the name of the superblock will change\r
+    //** because the "-" char could generate GCC problems\r
+    //** (the C functions contains the name of the superblock).\r
+    if grep(rdnom,"-")<>[] then\r
+      message(['For full C compiler compatibility ';\r
+               'Superblock name cannot contains ""-"" characters';\r
+               '""-"" chars will be automatically substituted by ""_"" '])\r
+    end\r
+\r
+    rdnom = strsubst(rdnom,'-','_');\r
+\r
+    //**\r
+    //** rpat=strsubst(rpat,'-','_');\r
+    //**\r
+\r
+    dirinfo=fileinfo(rpat)\r
+    if dirinfo==[] then\r
+      [pathrp,fnamerp,extensionrp]=fileparts(rpat)\r
+      ok=mkdir(pathrp,fnamerp+extensionrp)\r
+      if ~ok then \r
+        x_message('Directory '+rpat+' cannot be created');\r
+      end\r
+    elseif filetype(dirinfo(2))<>'Directory' then\r
+      ok=%f;\r
+      x_message(rpat+' is not a directory');\r
+    end\r
+\r
+    if stripblanks(rdnom)==emptystr() then \r
+      ok=%f;\r
+      x_message('sorry C file name not defined');\r
+    end\r
+    if ok then break,end\r
+  end\r
+\r
+  //////////////////////////////////////////////////\r
+  maxnrpar=max(rpptr(2:$)-rpptr(1:$-1))\r
+  maxnipar=max(ipptr(2:$)-ipptr(1:$-1))\r
+  maxnx=max(xptr(2:$)-xptr(1:$-1))\r
+  maxnz=max(zptr(2:$)-zptr(1:$-1))\r
+  maxnin=max(inpptr(2:$)-inpptr(1:$-1))\r
+  maxnout=max(outptr(2:$)-outptr(1:$-1))\r
+  maxdim=[];\r
+  for i=1:lstsize(cpr.state.outtb)\r
+    maxdim=max(size(cpr.state.outtb(i)))\r
+  end\r
+  maxtotal=max([maxnrpar;maxnipar;maxnx;maxnz;maxnin;maxnout;maxdim]);\r
+\r
+  //************************************************************************\r
+  //generate the call to the blocks and blocs simulation function prototypes\r
+  //************************************************************************\r
+  wfunclist=list();\r
+  nbcap=0;nbact=0;capt=[];actt=[];Protostalone=[];Protos=[];\r
+  dfuns=[]\r
+  for i=1:length(funs)\r
+    if or(i==act) then //block is an actuator\r
+      nbact=nbact+1;\r
+      [Code,actti,protoi]=call_actuator(i)\r
+      wfunclist($+1)=[Code;'if(flag < 0 ) return(5 - flag);']\r
+      if nbact==1 then Protostalone=[Protostalone;'';protoi],end\r
+      actt=[actt;actti]\r
+    elseif or(i==cap) then //block is a sensor\r
+      nbcap=nbcap+1;\r
+      [Code,capti,protoi]=call_sensor(i)\r
+      wfunclist($+1)=[Code;'if(flag < 0 ) return(5 - flag);']\r
+      if nbcap==1 then Protostalone=[Protostalone;'';protoi] ,end\r
+      capt=[capt;capti]\r
+    elseif funs(i)=='bidon'\r
+      wfunclist($+1)=' '\r
+    elseif funs(i)=='bidon2'\r
+      wfunclist($+1)=' '\r
+    else\r
+      ki=find(funs(i)==dfuns)\r
+      dfuns=[dfuns;funs(i)]\r
+      //[Code,protoi]=call_block(i)\r
+      [Code]=call_block4(i)\r
+      if Code<>[] then\r
+        wfunclist($+1)=[Code;'if(flag < 0 ) return(5 - flag);']\r
+      else\r
+        wfunclist($+1)=' ';\r
+      end\r
+      if ki==[] then\r
+        Protos=[Protos;'';BlockProto(i)];\r
+        Protostalone=[Protostalone;'';BlockProto(i)];\r
+      end\r
+    end\r
+  end\r
+\r
+  //**************************************\r
+  //on prend en compte l'ordre des numerotation graphique des\r
+  //capteur et des actionneur\r
+  [junk,index]=sort(-actt(:,$));\r
+  actt=actt(index,1:$) ;\r
+  [junk,index]=sort(-capt(:,$));\r
+  capt=capt(index,1:$) ;\r
+\r
+  //***************************************************\r
+  //Compute the initial state and outtb (links)  values\r
+  //***************************************************\r
+  //petite modification pour uniformiser les fichiers capteurs\r
+  //et actionneurs ???\r
+  rdcpr=cpr.sim.funs;\r
+  for r=1:length(cap),rdcpr(cap(r))='bidon';end\r
+  for r=1:length(act),rdcpr(act(r))='bidon';end\r
+  Total_rdcpr=cpr.sim;Total_rdcpr.funs=rdcpr;\r
+  //\r
+  tcur=0;\r
+  tf=scs_m.props.tf;\r
+  tolerances=scs_m.props.tol;\r
+  //[state,t]=scicosim(cpr.state,tcur,tf,Total_rdcpr,'start',tolerances);\r
+  //cpr.state=state;\r
+  z=cpr.state.z;\r
+  outtb=cpr.state.outtb;\r
+  //[junk_state,t]=scicosim(cpr.state,tcur,tf,Total_rdcpr,'finish',tolerances);\r
+\r
+  //***********************************\r
+  // Scilab and C files generation\r
+  //***********************************\r
+\r
+  //** generate scilab interfacing funtion \r
+  //   of the generated scicos block\r
+  ok=gen_gui42();\r
+\r
+\r
+  //** generate C files\r
+  //   of the generated scicos block\r
+  if ok then\r
+    ok=gen_ccode42()\r
+  end\r
+\r
+  //** Generates Makefile, loader\r
+  //   and compile and link C files\r
+\r
+  //** def files to build\r
+  files=[rdnom rdnom+'_void_io' rdnom+'_Cblocks']\r
+\r
+  //** def files to build for standalone\r
+  filestan=[rdnom+'_standalone' rdnom+'_act_sens_events' rdnom+'_Cblocks']\r
+\r
+  if ok then\r
+    ok=buildnewblock(rdnom,files,filestan,libs,rpat,'','')\r
+  end\r
+\r
+  //**\r
+  //if ok then ok=gen_loader(),end\r
+\r
+  if ok then\r
+    //load the gui function\r
+    getf(rpat+'/'+rdnom+'_c.sci');\r
+    //Change diagram superblock to new generated block\r
+    XX=update_block(XX);\r
+    execstr(rdnom+'_c=resume('+rdnom+'_c)')\r
+  end\r
+endfunction\r
+\r
+//BlockProto : generate prototype\r
+//            of a scicos block\r
+//\r
+//inputs : bk   : bloc index\r
+//\r
+//output : txt  :\r
+//\r
+//16/06/07 Author : A.Layec\r
+function [txt]=BlockProto(bk)\r
+\r
+  nin=inpptr(bk+1)-inpptr(bk);  //* number of input ports */\r
+  nout=outptr(bk+1)-outptr(bk); //* number of output ports */\r
+\r
+  //**\r
+  ftyp=funtyp(bk)\r
+  if ftyp>2000 then ftyp=ftyp-2000,end\r
+  if ftyp>1000 then ftyp=ftyp-1000,end\r
+\r
+  //** check function type\r
+  if ftyp < 0 then //** ifthenelse eselect blocks\r
+      txt = [];\r
+      return;\r
+  else\r
+    if (ftyp<>0 & ftyp<>1 & ftyp<>2 & ftyp<>3 & ftyp<>4) then\r
+      disp("types other than 0,1,2,3 or 4 are not yet supported.")\r
+      txt = [];\r
+      return;\r
+    end\r
+  end\r
+\r
+  //** add comment\r
+  txt=[get_comment('proto_blk',list(funs(bk),funtyp(bk),bk));]\r
+\r
+  select ftyp\r
+    //** zero funtyp\r
+    case 0 then\r
+\r
+      //*********** prototype definition ***********//\r
+      txtp=['(int *, int *, double *, double *, double *, int *, double *, \';\r
+            ' int *, double *, int *, double *, int *,int *, int *, \';\r
+            ' double *, int *, double *, int *);'];\r
+      if (funtyp(bk)>2000 & funtyp(bk)<3000)\r
+        blank = get_blank('void '+funs(bk)+'(');\r
+        txtp(1) = 'void '+funs(bk)+txtp(1);\r
+      elseif (funtyp(bk)<2000)\r
+        txtp(1) = 'void C2F('+funs(bk)+')'+txtp(1);\r
+        blank = get_blank('void C2F('+funs(bk)+')');\r
+      end\r
+      txtp(2:$) = blank + txtp(2:$);\r
+      txt = [txt;txtp];\r
+      //*******************************************//\r
+\r
+\r
+    //**\r
+    case 1 then\r
+\r
+      //*********** prototype definition ***********//\r
+      txtp=['(int *, int *, double *, double *, double *, int *, double *, \';\r
+            ' int *, double *, int *, double *, int *,int *, int *';]\r
+      if (funtyp(bk)>2000 & funtyp(bk)<3000)\r
+        blank = get_blank('void '+funs(bk)+'(');\r
+        txtp(1) = 'void '+funs(bk)+txtp(1);\r
+      elseif (funtyp(bk)<2000)\r
+        txtp(1) = 'void C2F('+funs(bk)+')'+txtp(1);\r
+        blank = get_blank('void C2F('+funs(bk)+')');\r
+      end\r
+      if nin>=1 | nout>=1 then\r
+        txtp($)=txtp($)+', \'\r
+        txtp=[txtp;'']\r
+        if nin>=1 then\r
+          for k=1:nin\r
+            txtp($)=txtp($)+' double *, int * ,'\r
+          end\r
+          txtp($)=part(txtp($),1:length(txtp($))-1); //remove last ,\r
+        end\r
+        if nout>=1 then\r
+          if nin>=1 then\r
+            txtp($)=txtp($)+', \'\r
+            txtp=[txtp;'']\r
+          end\r
+          for k=1:nout\r
+            txtp($)=txtp($)+' double *, int * ,'\r
+          end\r
+          txtp($)=part(txtp($),1:length(txtp($))-1); //remove last ,\r
+        end\r
+      end\r
+\r
+      if ztyp(bk) then\r
+        txtp($)=txtp($)+', \'\r
+        txtp=[txtp;' double *,int *);'];\r
+      else\r
+        txtp($)=txtp($)+');';\r
+      end\r
+\r
+      txtp(2:$) = blank + txtp(2:$);\r
+      txt = [txt;txtp];\r
+      //*******************************************//\r
+\r
+    //**\r
+    case 2 then\r
+\r
+      //*********** prototype definition ***********//\r
+\r
+      txtp=['void '+funs(bk)+...\r
+            '(int *, int *, double *, double *, double *, int *, double *, \';\r
+            ' int *, double *, int *, double *, int *, int *, int *, \'\r
+            ' double **, int *, int *, double **,int *, int *'];\r
+      if ~ztyp(bk) then\r
+        txtp($)=txtp($)+');';\r
+      else\r
+        txtp($)=txtp($)+', \';\r
+        txtp=[txtp;\r
+              ' double *,int *);']\r
+      end\r
+      blank = get_blank('void '+funs(bk));\r
+      txtp(2:$) = blank + txtp(2:$);\r
+      txt = [txt;txtp];\r
+      //********************************************//\r
+\r
+    //**\r
+    case 4 then\r
+      txt=[txt;\r
+           'void '+funs(bk)+'(scicos_block *, int );'];\r
+\r
+  end\r
+endfunction\r
+\r
+//Generating the routine for actuators interfacing\r
+//\r
+//\r
+//Authors : R. Djenid, R. Nikoukhah, A. Layec\r
+//\r
+//actt=[i uk nuk_1 nuk_2 uk_t bllst(i).ipar]\r
+function Code=make_actuator(standalone)\r
+  Call=['/*'+part('-',ones(1,40))+' Actuators */';\r
+        'void '+rdnom+'_actuator(flag,nport,nevprt,t,u,nu1,nu2,ut,flag1)']\r
+\r
+  comments=['     /*'\r
+            '      * To be customized for standalone execution';\r
+            '      * flag  : specifies the action to be done'\r
+            '      * nport : specifies the  index of the Super Bloc'\r
+            '      *         regular input (The input ports are numbered'\r
+            '      *         from the top to the bottom )'\r
+            '      * nevprt: indicates if an activation had been received'\r
+            '      *         0 = no activation'\r
+            '      *         1 = activation'\r
+            '      * t     : the current time value'\r
+            '      * u     : the vector inputs value'\r
+            '      * nu1   : the input size 1'\r
+            '      * nu2   : the input size 2'\r
+            '      * ut    : the input type'\r
+            '      * flag1 : learn mode (0 from terminal,1 from input file'\r
+            '      */']\r
+\r
+  dcl=['     int *flag,*nevprt,*nport;'\r
+       '     int *nu1,*nu2,*ut,flag1;'\r
+       ''\r
+       '     double *t;'\r
+       '     void *u;'\r
+       '{'\r
+       '  int j,k,l;'];\r
+\r
+  if standalone then\r
+    a_actuator=['  /* skeleton to be customized */'\r
+                '    switch (*flag) {'\r
+                '    case 2 :'\r
+                '      /*if(*nevprt>0) { get the input value */'\r
+                '        switch (*ut) {'\r
+                '        case 10 :'\r
+                '          for (l=0;l<*nu2;l++) {'\r
+                '            for (k=0;k<*nu1;k++) {'\r
+                '              printf(""Actuator: time=%f, '+...\r
+                                  'u(%d,%d) of actuator %d is %f '+...\r
+                                  '\n"", \'\r
+                '                     *t, k, l, *nport,'+...\r
+                                      '*((double *) u+(k+l*(*nu1))));'\r
+                '            }'\r
+                '          }'\r
+                '          break;'\r
+                ''\r
+                '        case 11 :'\r
+                '          for (l=0;l<*nu2;l++) {'\r
+                '            for (k=0;k<*nu1;k++) {'\r
+                '              printf(""Actuator: time=%f, '+...\r
+                                  'u(%d,%d) of actuator %d is %f,%f '+...\r
+                                  '\n"", \'\r
+                '                     *t, k, l, *nport,'+...\r
+                                      '*((double *) u+(k+l*(*nu1))),'+...\r
+                                      '*((double *) u+((*nu1)*(*nu2)+k+l*(*nu1))));'\r
+                '            }'\r
+                '          }'\r
+                '          break;'\r
+                ''\r
+                '        case 81 :'\r
+                '          for (l=0;l<*nu2;l++) {'\r
+                '            for (k=0;k<*nu1;k++) {'\r
+                '              printf(""Actuator: time=%f, '+...\r
+                                  'u(%d,%d) of actuator %d is %i '+...\r
+                                  '\n"", \'\r
+                '                     *t, k, l, *nport,'+...\r
+                                      '*((char *) u+(k+l*(*nu1))));'\r
+                '            }'\r
+                '          }'\r
+                '          break;'\r
+                ''\r
+                '        case 82 :'\r
+                '          for (l=0;l<*nu2;l++) {'\r
+                '            for (k=0;k<*nu1;k++) {'\r
+                '              printf(""Actuator: time=%f, '+...\r
+                                  'u(%d,%d) of actuator %d is %hd '+...\r
+                                  '\n"", \'\r
+                '                     *t, k, l, *nport,'+...\r
+                                      '*((short *) u+(k+l*(*nu1))));'\r
+                '            }'\r
+                '          }'\r
+                '          break;'\r
+                ''\r
+                '        case 84 :'\r
+                '          for (l=0;l<*nu2;l++) {'\r
+                '            for (k=0;k<*nu1;k++) {'\r
+                '              printf(""Actuator: time=%f, '+...\r
+                                  'u(%d,%d) of actuator %d is %ld '+...\r
+                                  '\n"", \'\r
+                '                     *t, k, l, *nport,'+...\r
+                                      '*((long *) u+(k+l*(*nu1))));'\r
+                '            }'\r
+                '          }'\r
+                '          break;'\r
+                ''\r
+                '        case 811 :'\r
+                '          for (l=0;l<*nu2;l++) {'\r
+                '            for (k=0;k<*nu1;k++) {'\r
+                '              printf(""Actuator: time=%f, '+...\r
+                                  'u(%d,%d) of actuator %d is %d '+...\r
+                                  '\n"", \'\r
+                '                     *t, k, l, *nport,'+...\r
+                                      '*((unsigned char *) u+(k+l*(*nu1))));'\r
+                '            }'\r
+                '          }'\r
+                '          break;'\r
+                ''\r
+                '        case 812 :'\r
+                '          for (l=0;l<*nu2;l++) {'\r
+                '            for (k=0;k<*nu1;k++) {'\r
+                '              printf(""Actuator: time=%f, '+...\r
+                                  'u(%d,%d) of actuator %d is %hu '+...\r
+                                  '\n"", \'\r
+                '                     *t, k, l, *nport,'+...\r
+                                      '*((unsigned short *) u+(k+l*(*nu1))));'\r
+                '            }'\r
+                '          }'\r
+                '          break;'\r
+                ''\r
+                '        case 814 :'\r
+                '          for (l=0;l<*nu2;l++) {'\r
+                '            for (k=0;k<*nu1;k++) {'\r
+                '              printf(""Actuator: time=%f, '+...\r
+                                  'u(%d,%d) of actuator %d is %lu '+...\r
+                                  '\n"", \'\r
+                '                     *t, k, l, *nport,'+...\r
+                                      '*((unsigned long *) u+(k+l*(*nu1))));'\r
+                '            }'\r
+                '          }'\r
+                '          break;'\r
+                '        }'\r
+                '      /*} */'\r
+                '      break;'\r
+                '    case 4 : /* actuator initialisation */'\r
+                '      /* do whatever you want to initialize the actuator */'\r
+                '      break;'\r
+                '    case 5 : /* actuator ending */'\r
+                '      /* do whatever you want to end the actuator */'\r
+                '      break;'\r
+                '    }']\r
+  else\r
+    a_actuator=[]\r
+  end\r
+\r
+  // pour fprintf\r
+  nc=size(act,'*') // Alan : d'o� viens act ?????\r
+                   // reponse : de do_compile_superblock!\r
+  typ=['""%f ']; //time\r
+  for i=1:nc\r
+    typ($)=typ($)+'"" \'\r
+    typ=[typ;'""'];\r
+    for j=1:sum(actt(i,3)*actt(i,4))\r
+      //typ=typ+'%f ';\r
+      typ($)=typ($)+scs_c_n2c_fmt(actt(i,5))+' ';\r
+    end\r
+  end\r
+  typ($)=typ($)+'\n"", \'\r
+  typ(1)='    fprintf(fprw,'+typ(1);\r
+  bl    ='                 ';\r
+  if size(typ,1) <> 1 then\r
+    typ(2:$) = bl+typ(2:$);\r
+  end\r
+  //Code1='    fprintf(fprw, '"'+typ+' \n'",*t'\r
+  Code1=[typ;bl+'*t'];\r
+  //actt=[i uk nuk_1 nuk_2 uk_t bllst(i).ipar]\r
+  for i=1:size(actt,1)\r
+    ni=actt(i,3)*actt(i,4) // dimension of ith output\r
+    Code1($)=Code1($)+','\r
+    Code1=[Code1;bl];\r
+    for j=1:ni\r
+      if actt(i,5)<>11 then\r
+        Code1($)=Code1($)+...\r
+                  '*((('+scs_c_n2c_typ(actt(i,5))+' *)('+...\r
+                   rdnom+'_block_outtbptr+'+string(actt(i,2)-1)+'))'+...\r
+                   '+'+string(j-1)+')';\r
+      else //CAS CMPLX\r
+        Code1($)=Code1($)+...\r
+                  '*((('+scs_c_n2c_typ(actt(i,5))+' *)('+...\r
+                   rdnom+'_block_outtbptr+'+string(actt(i,2)-1)+'))'+...\r
+                   '+'+string((j-1))+'), '+...\r
+                  '*((('+scs_c_n2c_typ(actt(i,5))+' *)('+...\r
+                   rdnom+'_block_outtbptr+'+string(actt(i,2)-1)+'))'+...\r
+                   '+'+string(ni+(j-1))+')';\r
+      end\r
+      if j<>ni then\r
+       Code1($)=Code1($)+', ';\r
+      end\r
+    end\r
+  end\r
+  Code1($)=Code1($)+');'\r
+\r
+  Code=[]\r
+\r
+  if nc==1|~standalone then\r
+    Code=[Call\r
+          comments\r
+          dcl\r
+          '  if (flag1 == 0) {'\r
+          a_actuator\r
+          '  }'\r
+          '  else if (flag1 == 1) {'\r
+          '    if (*flag == 4 && *nport == 1) {'\r
+          '      fprw=fopen(output,'"wt'");'\r
+          '      if( fprw == NULL )'\r
+          '        {'\r
+          '          printf('"Error opening file: %s\n'", output);'\r
+          '          return;'\r
+          '        }'\r
+          '    }else if (*flag == 2 /* && *nevprt>0 */) {'\r
+          Code1\r
+          '    }else if (*flag == 5 && *nport == 1) {'\r
+          '      fclose(fprw);'\r
+          '    }'\r
+          '  }'\r
+          '}']\r
+  elseif nc>1 then\r
+    S='  switch (*nport) {'\r
+    for k=1:nc\r
+      S=[S;\r
+         '  case '+string(k)+' :/* Port number '+string(k)+' ----------*/'\r
+         '  '+a_actuator\r
+         '  break;']\r
+    end\r
+    S=[S;'  }']\r
+\r
+    Code=[Code\r
+          Call\r
+          comments\r
+          dcl\r
+          '  if (flag1 == 0){'\r
+          S\r
+          '  }'\r
+          '  else if (flag1 == 1) {'\r
+          '    if (*flag == 4 && *nport == 1) {'\r
+          '      fprw=fopen(output,'"wt'");'\r
+          '      if( fprw == NULL ) {'\r
+          '        printf('"Error opening file: %s\n'", output);'\r
+          '        return;'\r
+          '        }'\r
+          '    }'\r
+          '    else if (*flag == 2 /*&& *nevprt>0*/ ) {'\r
+          Code1\r
+          '    }'\r
+          '    else if (*flag == 5 && *nport == 1) {'\r
+          '      fclose(fprw);'\r
+          '    }'\r
+          '  }'\r
+          '}']\r
+  end\r
+endfunction\r
+\r
+//** Generates the scicos computational function\r
+//   associated with the block\r
+//12/07/07 Alan Layec\r
+function Code=make_computational42()\r
+  z=cpr.state.z;\r
+  oz=cpr.state.oz;\r
+  outtb=cpr.state.outtb;\r
+  tevts=cpr.state.tevts;\r
+  evtspt=cpr.state.evtspt;\r
+  outptr=cpr.sim.outptr;\r
+  funtyp=cpr.sim.funtyp;\r
+  clkptr=cpr.sim.clkptr;\r
+  ordptr=cpr.sim.ordptr;\r
+  pointi=cpr.state.pointi;\r
+  ztyp=cpr.sim.ztyp;\r
+  zcptr=cpr.sim.zcptr;\r
+  zptr=cpr.sim.zptr;\r
+  ozptr=cpr.sim.ozptr;\r
+  opptr=cpr.sim.opptr;\r
+  opar=cpr.sim.opar;\r
+  rpptr=cpr.sim.rpptr;\r
+  ipptr=cpr.sim.ipptr;\r
+  inpptr=cpr.sim.inpptr;\r
+  funs=cpr.sim.funs;\r
+  xptr=cpr.sim.xptr;\r
+  modptr=cpr.sim.modptr;\r
+  inplnk=cpr.sim.inplnk;\r
+  nblk=cpr.sim.nb;\r
+  outlnk=cpr.sim.outlnk;\r
+  oord=cpr.sim.oord;\r
+  zord=cpr.sim.zord;\r
+  iord=cpr.sim.iord;\r
+  noord=size(cpr.sim.oord,1);\r
+  nzord=size(cpr.sim.zord,1);\r
+  niord=size(cpr.sim.iord,1);\r
+\r
+  Indent='  ';\r
+  Indent2=Indent+Indent;\r
+  BigIndent='          ';\r
+\r
+  nZ=size(z,'*'); //** index of work in z\r
+  nO=lstsize(oz); //** index of outtb in oz\r
+\r
+  stalone=%f\r
+\r
+  Code=['/* SCILAB Computational function  */'\r
+        '/*     Copyright INRIA */'\r
+        '/*     Generated by Code_Generation toolbox of Scicos with '+ ..\r
+        getversion()+' */';\r
+        '/*     date : '+date(getdate())+' */'\r
+        ''\r
+        '/* ---- Headers ---- */'\r
+        '#include <stdio.h>'\r
+        '#include <memory.h>'\r
+        '#include <string.h>'\r
+        '#include '"'+SCI+'/routines/machine.h'"'\r
+        '#include '"'+SCI+'/routines/os_specific/link.h'"'\r
+        '#include '"'+SCI+'/routines/scicos/scicos.h'"'\r
+        '']\r
+\r
+  if MSDOS then\r
+   Code=[Code;\r
+         ' '\r
+         '#define max(a,b) ((a) >= (b) ? (a) : (b))'\r
+         '#define min(a,b) ((a) <= (b) ? (a) : (b))'\r
+         ' '\r
+        ]\r
+  end\r
+\r
+  Code=[Code;\r
+        Protos\r
+        '']\r
+\r
+  Code=[Code;\r
+        '/* Table of constant values */'\r
+        'static integer nrd_'+string(0:maxtotal)'+' = '+string(0:maxtotal)'+';']\r
+\r
+  if maxtotal<10 then\r
+    Code=[Code;\r
+          'static integer nrd_10 = 10;']\r
+  end\r
+  if maxtotal<11 then\r
+    Code=[Code;\r
+          'static integer nrd_11 = 11;']\r
+  end\r
+\r
+  if maxtotal<81 then\r
+    Code=[Code;\r
+          'static integer nrd_81 = 81;']\r
+  end\r
+  if maxtotal<82 then\r
+    Code=[Code;\r
+          'static integer nrd_82 = 82;']\r
+  end\r
+  if maxtotal<84 then\r
+    Code=[Code;\r
+          'static integer nrd_84 = 84;']\r
+  end\r
+  if maxtotal<811 then\r
+    Code=[Code;\r
+          'static integer nrd_811 = 811;']\r
+  end\r
+  if maxtotal<812 then\r
+    Code=[Code;\r
+          'static integer nrd_812 = 812;']\r
+  end\r
+  if maxtotal<814 then\r
+    Code=[Code;\r
+          'static integer nrd_814 = 814;']\r
+  end\r
+\r
+  Code=[Code;\r
+        ''\r
+        '/* Some general static variables */'\r
+        'static double zero=0;'\r
+        'static double w[1];'\r
+        'static int aaa=0, bbb=0;']\r
+\r
+  Code=[Code;\r
+        ''\r
+        '/*'+part('-',ones(1,40))+' Block Computational function */ ';\r
+        'int  '+rdnom+'(scicos_block *block, int flag)'\r
+        '{'\r
+        '  /* declaration of local variables for that block struct */'\r
+        '  double* z      = block->z;'\r
+        '  void **ozptr   = block->ozptr;'\r
+        '  void **oparptr = block->oparptr;'\r
+        '  int nopar      = block->nopar;'\r
+        '  double* x      = block->x;'\r
+        '  double* xd     = block->xd;'\r
+        '  double* res    = block->res;'\r
+        '  void** u       = block->inptr;'\r
+        '  void** y       = block->outptr;'\r
+        '  int nevprt     = block->nevprt;'\r
+        '  double* rpar   = block->rpar;'\r
+        '  int nrpar      = block->nrpar;'\r
+        '  int* ipar      = block->ipar;'\r
+        '  int nipar      = block->nipar;'\r
+        '  double* g      = block->g;'\r
+        '  int* mode      = block->mode;'\r
+        '  void **work    = block->work;'\r
+        ''\r
+        '  double t     = get_scicos_time();'\r
+        '  int    phase = get_phase_simulation();'\r
+        ''\r
+        '  int kf;'\r
+        '  int i;'\r
+        '  int* reentryflag;'\r
+        ''\r
+        '  double *args[100];'\r
+        '  int local_flag;'\r
+        '  int nport;'\r
+        '  void **'+rdnom+'_block_outtbptr;'\r
+        '  scicos_block *block_'+rdnom+';'\r
+        ''\r
+        '  /*  work of blocks are catenated at the end of z */'\r
+        '  work = (void **)(z+'+string(nZ)+');'\r
+        ''\r
+        '  /*  '+rdnom+'_block_outtbptr is catenated at the end of oz */'\r
+        '  '+rdnom+'_block_outtbptr = (void **)(ozptr+'+string(nO)+');'\r
+        ''\r
+        '  /* struct of all blocks are stored in work of that block struct */'\r
+        '  block_'+rdnom+'=(scicos_block*) *block->work;'\r
+        ''];\r
+\r
+  Code=[Code;\r
+        '  /* Copy inputs in the block outtb */'];\r
+\r
+  for i=1:size(capt,1)\r
+    ni=capt(i,3)*capt(i,4); //** dimension of ith input\r
+    if capt(i,5)<>11 then\r
+      Code=[Code;\r
+            '  memcpy(*('+rdnom+'_block_outtbptr+'+string(capt(i,2)-1)+'),'+...\r
+            '*(u+'+string(capt(i,6)-1)+'),'+...\r
+             string(ni)+'*sizeof('+mat2c_typ(capt(i,5))+'));']\r
+    else //** Cas cmplx\r
+      Code=[Code;\r
+            '  memcpy(*('+rdnom+'_block_outtbptr+'+string(capt(i,2)-1)+'),'+...\r
+            '*(u+'+string(capt(i,6)-1)+'),'+...\r
+             string(2*ni)+'*sizeof('+mat2c_typ(capt(i,5))+'));']\r
+    end\r
+  end\r
+\r
+  Code=[Code;\r
+        ''\r
+        '  if (flag != 4 && flag != 6 && flag != 5){'\r
+        '    reentryflag=(int*) ((scicos_block *)(*block->work)+'+string(nblk)+');'\r
+        '    if (*reentryflag==0){'\r
+        '      *reentryflag=1;']\r
+\r
+  for kf=1:nblk\r
+    nin=inpptr(kf+1)-inpptr(kf);  //** number of input ports\r
+    nout=outptr(kf+1)-outptr(kf); //** number of output ports\r
+    nx=xptr(kf+1)-xptr(kf);\r
+    ng=zcptr(kf+1)-zcptr(kf);\r
+    nmode=modptr(kf+1)-modptr(kf);\r
+\r
+    //** add comment\r
+    txt=[get_comment('set_blk',list(funs(kf),funtyp(kf),kf));]\r
+\r
+    Code=[Code;\r
+          ''\r
+          '      '+txt];\r
+\r
+    for k=1:nin\r
+      lprt=inplnk(inpptr(kf)-1+k);\r
+      Code=[Code;\r
+            '      block_'+rdnom+'['+string(kf-1)+'].inptr['+string(k-1)+']  = '+...\r
+            rdnom+'_block_outtbptr['+string(lprt-1)+'];']\r
+    end\r
+    for k=1:nout\r
+       lprt=outlnk(outptr(kf)-1+k);\r
+       Code=[Code\r
+             '      block_'+rdnom+'['+string(kf-1)+'].outptr['+string(k-1)+'] = '+...\r
+             rdnom+'_block_outtbptr['+string(lprt-1)+'];']\r
+    end\r
+    Code=[Code\r
+          '      block_'+rdnom+'['+string(kf-1)+'].z         = &(z['+...\r
+          string(zptr(kf)-1)+']);']\r
+    if nx <> 0 then\r
+      Code=[Code;\r
+            '      block_'+rdnom+'['+string(kf-1)+'].x         = &(x['+...\r
+            string(xptr(kf)-1)+']);']\r
+    else\r
+      Code=[Code;\r
+            '      block_'+rdnom+'['+string(kf-1)+'].x         = &(zero);'\r
+            '      block_'+rdnom+'['+string(kf-1)+'].xd        = w;']\r
+    end\r
+    if ng <> 0 then\r
+      Code=[Code;\r
+            '      block_'+rdnom+'['+string(kf-1)+'].g         = &(g['+...\r
+            string(zcptr(kf)-1)+']);']\r
+    else\r
+      Code=[Code;\r
+            '      block_'+rdnom+'['+string(kf-1)+'].g         = &(zero);';]\r
+    end\r
+    if nmode <> 0 then\r
+      Code=[Code;\r
+            '      block_'+rdnom+'['+string(kf-1)+'].mode      = &(mode['+...\r
+            string(modptr(kf)-1)+']);']\r
+    end\r
+    if (part(funs(kf),1:7) ~= 'capteur' &...\r
+        part(funs(kf),1:10) ~= 'actionneur' &...\r
+        funs(kf) ~= 'bidon' &...\r
+        funs(kf) ~= 'bidon2') then\r
+      //** rpar **//\r
+      if (rpptr(kf+1)-rpptr(kf)>0) then\r
+        Code=[Code;\r
+              '      block_'+rdnom+'['+string(kf-1)+'].rpar      = &(rpar['+...\r
+              string(rpptr(kf)-1)+']);']\r
+      end\r
+      //** ipar **//\r
+      if (ipptr(kf+1)-ipptr(kf)>0) then\r
+         Code=[Code;\r
+               '      block_'+rdnom+'['+string(kf-1)+'].ipar      = &(ipar['+...\r
+               string(ipptr(kf)-1)+']);']\r
+      end\r
+      //** opar **//\r
+      if (opptr(kf+1)-opptr(kf)>0) then\r
+        nopar = opptr(kf+1)-opptr(kf);\r
+        for k=1:nopar\r
+          Code=[Code;\r
+                '      block_'+rdnom+'['+string(kf-1)+'].oparptr['+string(k-1)+...\r
+                '] = oparptr['+string(opptr(kf)-1+k-1)+'];'];\r
+        end\r
+      end\r
+      //** oz **//\r
+      if (ozptr(kf+1)-ozptr(kf)>0) then\r
+        noz = ozptr(kf+1)-ozptr(kf);\r
+        for k=1:noz\r
+          Code=[Code;\r
+                '      block_'+rdnom+'['+string(kf-1)+'].ozptr['+string(k-1)+...\r
+                ']  = ozptr['+string(ozptr(kf)-1+k-1)+'];'];\r
+        end\r
+      end\r
+    end\r
+    Code=[Code;\r
+          '      block_'+rdnom+'['+string(kf-1)+'].work      ='+...\r
+          ' (void **)(((double *)work)+'+string(kf-1)+');']\r
+  end\r
+  Code=[Code\r
+        '    }'\r
+        '  }'\r
+        ''\r
+       ]\r
+\r
+  /////////////////////////////////////////////\r
+\r
+\r
+  //** find activation number\r
+  blks=find(funtyp>-1);\r
+  evs=[];\r
+\r
+  for blk=blks\r
+    for ev=clkptr(blk):clkptr(blk+1)-1\r
+      if funs(blk)=='bidon' then\r
+        if ev > clkptr(howclk) -1\r
+         evs=[evs,ev];\r
+        end\r
+      end\r
+    end\r
+  end\r
+\r
+  //** flag 0\r
+  flag = 0;\r
+\r
+  block_has_output=%f\r
+  txt   = [];\r
+  txt22 = [];\r
+\r
+  for kf=1:nblk\r
+     nx=xptr(kf+1)-xptr(kf);\r
+     if nx <> 0 then\r
+          txt=[txt;\r
+               '    block_'+rdnom+'['+string(kf-1)+'].xd=&(xd['+...\r
+                string(xptr(kf)-1)+']);']\r
+     end\r
+     if part(funs(kf),1:10) == 'actionneur' then\r
+       block_has_output=%t\r
+     end\r
+  end\r
+  if txt<>[] then\r
+    txt22=[txt22;\r
+           '    '+get_comment('update_xd',list())\r
+           txt\r
+           ''\r
+          ]\r
+  end\r
+  txt22=[txt22;\r
+         write_code_odoit(1) //** first pass\r
+         write_code_odoit(0) //** second pass\r
+        ]\r
+\r
+  if txt22<>[] then\r
+    Code=[Code;\r
+          '  if (flag == 0) { '+get_comment('flag',list(flag))\r
+          txt22\r
+          '  }'];\r
+  end\r
+\r
+  //** flag 1,2,3\r
+  for flag=[1,2,3]\r
+\r
+    txt3=[]\r
+\r
+    //** continuous time blocks must be activated\r
+    //** for flag 1\r
+    if flag==1 then\r
+      txt = write_code_cdoit(flag);\r
+\r
+      if txt <> [] then\r
+        txt3=[txt3;\r
+             Indent+'  switch (nevprt) {'\r
+            ];\r
+        txt3=[txt3;\r
+              Indent2+'  case '+string(0)+' : '+...\r
+              get_comment('ev',list(0))\r
+              '    '+txt;\r
+             ];\r
+        txt3=[txt3;'      break;';'']\r
+      end\r
+    else\r
+      txt=[];\r
+    end\r
+\r
+    //** blocks with input discrete event must be activated\r
+    //** for flag 1, 2 and 3\r
+    if size(evs,2)>=1 then\r
+      txt4=[]\r
+      //**\r
+      for ev=evs\r
+        txt2=write_code_doit(ev,flag);\r
+        if txt2<>[] then\r
+          //** adjust event number because of bidon block\r
+          new_ev=ev-(clkptr(howclk)-1)\r
+          //**\r
+          txt4=[txt4;\r
+                Indent2+['  case '+string(new_ev)+' : '+...\r
+                get_comment('ev',list(new_ev))\r
+                   txt2];\r
+                '      break;';'']\r
+        end\r
+      end\r
+\r
+      //**\r
+      if txt == [] then\r
+        if txt4 <> [] then\r
+          txt3=[txt3;\r
+                Indent+'  switch (nevprt) {'\r
+                txt4\r
+                '    }'];\r
+        end\r
+      else\r
+        txt3=[txt3;\r
+              txt4]\r
+      end\r
+    end\r
+\r
+    //**\r
+    if txt <> [] then\r
+      txt3=[txt3;\r
+            '    }'];\r
+    end\r
+\r
+    //**\r
+    if txt3<>[] then\r
+      if flag==1 & txt22==[] then\r
+        Code=[Code;\r
+              '  if (flag == '+string(flag)+') { '+...\r
+              get_comment('flag',list(flag))\r
+              txt3\r
+              '  }'];\r
+      else\r
+        Code=[Code;\r
+              '  else if (flag == '+string(flag)+') { '+...\r
+              get_comment('flag',list(flag))\r
+              txt3\r
+              '  }'];\r
+      end\r
+    end\r
+  end\r
+\r
+  //** flag 9\r
+  ng=zcptr($)-1;\r
+  if (ng ~= 0) then\r
+    flag = 9;\r
+    Code=[Code;\r
+          '  else if (flag == '+string(flag)+') { '+...\r
+           get_comment('flag',list(flag))\r
+         ];\r
+\r
+    txt=[]\r
+    for kf=1:nblk\r
+      if zcptr(kf+1)-zcptr(kf) <> 0 then\r
+         txt=[txt;\r
+              '    block_'+rdnom+'['+string(kf-1)+'].g='+...\r
+              '&(g['+string(zcptr(kf)-1)+']);']\r
+      end\r
+    end\r
+\r
+    Code=[Code;\r
+          '    '+get_comment('update_g',list())\r
+          txt\r
+          ''\r
+          write_code_zdoit()\r
+         ]\r
+\r
+    Code=[Code;\r
+          '  }'];\r
+  end\r
+\r
+  //** flag 4\r
+  Code=[Code;\r
+        '  else if (flag == 4) { '+get_comment('flag',list(4))\r
+        '    if ((*block->work=scicos_malloc(sizeof(scicos_block)*'+...\r
+         string(nblk)+'+sizeof(int)))== NULL) return 0;';\r
+        '    reentryflag=(int*) ((scicos_block *)(*block->work)+'+string(nblk)+');'\r
+        '    *reentryflag=0;'\r
+        '    block_'+rdnom+'=(scicos_block*) *block->work;'];\r
+\r
+  for kf=1:nblk\r
+    nin=inpptr(kf+1)-inpptr(kf);  //* number of input ports */\r
+    nout=outptr(kf+1)-outptr(kf); //* number of output ports */\r
+    nx=xptr(kf+1)-xptr(kf);\r
+    ng=zcptr(kf+1)-zcptr(kf);\r
+    nmode=modptr(kf+1)-modptr(kf);\r
+\r
+    //** add comment\r
+    txt=[get_comment('set_blk',list(funs(kf),funtyp(kf),kf));]\r
+\r
+    Code=[Code;\r
+          ''\r
+          '    '+txt];\r
+\r
+    Code=[Code;\r
+          '    block_'+rdnom+'['+string(kf-1)+'].type   = '+...\r
+            string(funtyp(kf))+';';\r
+          '    block_'+rdnom+'['+string(kf-1)+'].ztyp   = '+...\r
+            string(ztyp(kf))+';';\r
+          '    block_'+rdnom+'['+string(kf-1)+'].ng     = '+...\r
+            string(zcptr(kf+1)-zcptr(kf))+';']\r
+\r
+    if nx <> 0 then\r
+      Code=[Code;\r
+            '    block_'+rdnom+'['+string(kf-1)+'].nx     = '+...\r
+             string(nx)+';';\r
+            '    block_'+rdnom+'['+string(kf-1)+'].x      = &(x['+...\r
+             string(xptr(kf)-1)+']);']\r
+    else\r
+      Code=[Code;\r
+            '    block_'+rdnom+'['+string(kf-1)+'].nx     = 1;';\r
+            '    block_'+rdnom+'['+string(kf-1)+'].x      = &(zero);'\r
+            '    block_'+rdnom+'['+string(kf-1)+'].xd     = w;']\r
+    end\r
+\r
+    if ng <> 0 then\r
+      Code=[Code;\r
+            '    block_'+rdnom+'['+string(kf-1)+'].g      = &(g['+...\r
+            string(zcptr(kf)-1)+']);']\r
+    else\r
+      Code=[Code;\r
+            '    block_'+rdnom+'['+string(kf-1)+'].g      = &(zero);';]\r
+    end\r
+    if nmode <> 0 then\r
+      Code=[Code;\r
+            '    block_'+rdnom+'['+string(kf-1)+'].mode   = &(mode['+...\r
+            string(modptr(kf)-1)+']);']\r
+    end\r
+    Code=[Code;\r
+          '    block_'+rdnom+'['+string(kf-1)+'].nz     = '+...\r
+            string(zptr(kf+1)-zptr(kf))+';';\r
+          '    block_'+rdnom+'['+string(kf-1)+'].noz    = '+...\r
+            string(ozptr(kf+1)-ozptr(kf))+';';\r
+          '    block_'+rdnom+'['+string(kf-1)+'].nrpar  = '+...\r
+            string(rpptr(kf+1)-rpptr(kf))+';';\r
+          '    block_'+rdnom+'['+string(kf-1)+'].nopar  = '+...\r
+            string(opptr(kf+1)-opptr(kf))+';';\r
+          '    block_'+rdnom+'['+string(kf-1)+'].nipar  = '+...\r
+            string(ipptr(kf+1)-ipptr(kf))+';'\r
+          '    block_'+rdnom+'['+string(kf-1)+'].nin    = '+...\r
+            string(inpptr(kf+1)-inpptr(kf))+';';\r
+          '    block_'+rdnom+'['+string(kf-1)+'].nout   = '+...\r
+            string(outptr(kf+1)-outptr(kf))+';';\r
+          '    block_'+rdnom+'['+string(kf-1)+'].nevout = '+...\r
+            string(clkptr(kf+1)-clkptr(kf))+';';\r
+          '    block_'+rdnom+'['+string(kf-1)+'].nmode  = '+...\r
+            string(modptr(kf+1)-modptr(kf))+';'];\r
+\r
+    Code=[Code;\r
+          '    if ((block_'+rdnom+'['+string(kf-1)+'].evout  = '+...\r
+          'calloc(block_'+rdnom+'['+string(kf-1)+'].nevout,sizeof(double)))== NULL) return 0;'];\r
+\r
+    //***************************** input port *****************************//\r
+    //** alloc insz/inptr **//\r
+    Code=[Code;\r
+          '    if ((block_'+rdnom+'['+string(kf-1)+'].insz   = '+...\r
+          'malloc(3*sizeof(int)*block_'+rdnom+'['+string(kf-1)+'].nin))== NULL) return 0;';\r
+          '    if ((block_'+rdnom+'['+string(kf-1)+'].inptr  = '+...\r
+          'malloc(sizeof(void *)*block_'+rdnom+'['+string(kf-1)+'].nin))== NULL) return 0;'];\r
+\r
+    //** inptr **//\r
+    for k=1:nin\r
+       lprt=inplnk(inpptr(kf)-1+k);\r
+       Code=[Code\r
+             '    block_'+rdnom+'['+string(kf-1)+'].inptr['+string(k-1)+']  = '+...\r
+             rdnom+'_block_outtbptr['+string(lprt-1)+'];']\r
+    end\r
+\r
+    //** 1st dim **//\r
+    for k=1:nin\r
+       lprt=inplnk(inpptr(kf)-1+k);\r
+       Code=[Code\r
+             '    block_'+rdnom+'['+string(kf-1)+'].insz['+string((k-1))+']   = '+...\r
+              string(size(outtb(lprt),1))+';']\r
+    end\r
+\r
+    //** 2dn dim **//\r
+    for k=1:nin\r
+       lprt=inplnk(inpptr(kf)-1+k);\r
+       Code=[Code\r
+             '    block_'+rdnom+'['+string(kf-1)+'].insz['+string((k-1)+nin)+']   = '+...\r
+              string(size(outtb(lprt),2))+';']\r
+    end\r
+\r
+    //** typ **//\r
+    for k=1:nin\r
+       lprt=inplnk(inpptr(kf)-1+k);\r
+       Code=[Code\r
+             '    block_'+rdnom+'['+string(kf-1)+'].insz['+string((k-1)+2*nin)+']   = '+...\r
+              mat2scs_c_typ(outtb(lprt))+';'];\r
+    end\r
+    //**********************************************************************//\r
+\r
+    //***************************** output port *****************************//\r
+    //** alloc outsz/outptr **//\r
+    Code=[Code\r
+          '    if ((block_'+rdnom+'['+string(kf-1)+'].outsz  = '+...\r
+           'malloc(3*sizeof(int)*block_'+rdnom+'['+string(kf-1)+'].nout))== NULL) return 0;';\r
+          '    if ((block_'+rdnom+'['+string(kf-1)+'].outptr = '+...\r
+           'malloc(sizeof(void*)*block_'+rdnom+'['+string(kf-1)+'].nout))== NULL) return 0;'];\r
+\r
+    //** outptr **//\r
+    for k=1:nout\r
+       lprt=outlnk(outptr(kf)-1+k);\r
+       Code=[Code\r
+             '    block_'+rdnom+'['+string(kf-1)+'].outptr['+string(k-1)+'] = '+...\r
+              rdnom+'_block_outtbptr['+string(lprt-1)+'];']\r
+    end\r
+\r
+    //** 1st dim **//\r
+    for k=1:nout\r
+       lprt=outlnk(outptr(kf)-1+k);\r
+       Code=[Code\r
+             '    block_'+rdnom+'['+string(kf-1)+'].outsz['+string((k-1))+...\r
+             ']  = '+string(size(outtb(lprt),1))+';']\r
+    end\r
+\r
+    //** 2dn dim **//\r
+    for k=1:nout\r
+       lprt=outlnk(outptr(kf)-1+k);\r
+       Code=[Code\r
+             '    block_'+rdnom+'['+string(kf-1)+'].outsz['+string((k-1)+nout)+...\r
+             ']  = '+string(size(outtb(lprt),2))+';']\r
+    end\r
+\r
+    //** typ **//\r
+    for k=1:nout\r
+       lprt=outlnk(outptr(kf)-1+k);\r
+       Code=[Code\r
+             '    block_'+rdnom+'['+string(kf-1)+'].outsz['+string((k-1)+2*nout)+...\r
+             ']  = '+mat2scs_c_typ(outtb(lprt))+';'];\r
+    end\r
+    //**********************************************************************//\r
+\r
+    Code=[Code\r
+          '    block_'+rdnom+'['+string(kf-1)+'].z         = &(z['+...\r
+          string(zptr(kf)-1)+']);']\r
+\r
+    //***************************** object state *****************************//\r
+    if (ozptr(kf+1)-ozptr(kf)>0) then\r
+      noz = ozptr(kf+1)-ozptr(kf);\r
+      Code=[Code\r
+            '    if ((block_'+rdnom+'['+string(kf-1)+'].ozptr = '+...\r
+            'malloc(sizeof(void *)*block_'+rdnom+'['+string(kf-1)+'].noz))== NULL) return 0;';\r
+            '    if ((block_'+rdnom+'['+string(kf-1)+'].ozsz  = '+...\r
+            'malloc(2*sizeof(int)*block_'+rdnom+'['+string(kf-1)+'].noz))== NULL) return 0;';\r
+            '    if ((block_'+rdnom+'['+string(kf-1)+'].oztyp = '+...\r
+            'malloc(sizeof(int)*block_'+rdnom+'['+string(kf-1)+'].noz))== NULL) return 0;';]\r
+\r
+      //** ozptr **//\r
+      for k=1:noz\r
+        Code=[Code;\r
+              '    block_'+rdnom+'['+string(kf-1)+'].ozptr['+string(k-1)+...\r
+              ']  = ozptr['+string(ozptr(kf)-1+k-1)+'];'];\r
+      end\r
+\r
+      //** 1st dim **//\r
+      for k=1:noz\r
+        Code=[Code;\r
+              '    block_'+rdnom+'['+string(kf-1)+'].ozsz['+string(k-1)+...\r
+              ']   = '+string(size(oz(ozptr(kf)-1+k),1))+';'];\r
+      end\r
+\r
+      //** 2nd dim **//\r
+      for k=1:noz\r
+        Code=[Code;\r
+              '    block_'+rdnom+'['+string(kf-1)+'].ozsz['+string(k-1)+...\r
+              ']   = '+string(size(oz(ozptr(kf)-1+k),2))+';'];\r
+      end\r
+\r
+      //** typ **//\r
+      for k=1:noz\r
+        Code=[Code;\r
+              '    block_'+rdnom+'['+string(kf-1)+'].oztyp['+string(k-1)+...\r
+              ']  = '+mat2scs_c_typ(oz(ozptr(kf)-1+k))+';'];\r
+      end\r
+    end\r
+    //************************************************************************//\r
+\r
+    if (part(funs(kf),1:7) ~= 'capteur' &...\r
+        part(funs(kf),1:10) ~= 'actionneur' &...\r
+        funs(kf) ~= 'bidon' &...\r
+        funs(kf) ~= 'bidon2') then\r
+      if (rpptr(kf+1)-rpptr(kf)>0) then\r
+        Code=[Code;\r
+              '    block_'+rdnom+'['+string(kf-1)+...\r
+              '].rpar      = &(rpar['+string(rpptr(kf)-1)+']);']\r
+      end\r
+      if (ipptr(kf+1)-ipptr(kf)>0) then\r
+        Code=[Code;\r
+              '    block_'+rdnom+'['+string(kf-1)+...\r
+              '].ipar      = &(ipar['+string(ipptr(kf)-1)+']);'] \r
+      end\r
+      //** opar\r
+      if (opptr(kf+1)-opptr(kf)>0) then\r
+        Code=[Code;\r
+              '    if ((block_'+rdnom+'['+string(kf-1)+'].oparptr = '+...\r
+               'malloc(sizeof(void *)*block_'+rdnom+'['+string(kf-1)+'].nopar))== NULL) return 0;';\r
+              '    if ((block_'+rdnom+'['+string(kf-1)+'].oparsz  = '+...\r
+               'malloc(2*sizeof(int)*block_'+rdnom+'['+string(kf-1)+'].nopar))== NULL) return 0;';\r
+              '    if ((block_'+rdnom+'['+string(kf-1)+'].opartyp = '+...\r
+               'malloc(sizeof(int)*block_'+rdnom+'['+string(kf-1)+'].nopar))== NULL) return 0;';\r
+              ]\r
+        nopar = opptr(kf+1)-opptr(kf);\r
+        //** oparptr **//\r
+        for k=1:nopar\r
+          Code=[Code;\r
+                '    block_'+rdnom+'['+string(kf-1)+'].oparptr['+string(k-1)+...\r
+                 ']  = oparptr['+string(opptr(kf)-1+k-1)+'];'];\r
+        end\r
+        //** 1st dim **//\r
+        for k=1:nopar\r
+          Code=[Code;\r
+                '    block_'+rdnom+'['+string(kf-1)+'].oparsz['+string(k-1)+...\r
+                 ']   = '+string(size(opar(opptr(kf)-1+k),1))+';'];\r
+        end\r
+        //** 2dn dim **//\r
+        for k=1:nopar\r
+          Code=[Code;\r
+                '    block_'+rdnom+'['+string(kf-1)+'].oparsz['+string(nopar+(k-1))+...\r
+                 ']   = '+string(size(opar(opptr(kf)-1+k),2))+';'];\r
+        end\r
+        //** typ **//\r
+        for k=1:nopar\r
+          Code=[Code;\r
+                '    block_'+rdnom+'['+string(kf-1)+'].opartyp['+string(k-1)+...\r
+                 ']  = '+mat2scs_c_typ(opar(opptr(kf)-1+k))+';'];\r
+        end\r
+      end\r
+    end\r
+\r
+    Code=[Code;\r
+          '    block_'+rdnom+'['+string(kf-1)+...\r
+           '].work      = (void **)(((double *)work)+'+string(kf-1)+');'\r
+          '    block_'+rdnom+'['+string(kf-1)+...\r
+           '].nevprt    = nevprt;']\r
+\r
+  end //for kf=1:nblk\r
+\r
+  //** init\r
+  for kf=1:nblk\r
+//     if or(kf==act) | or(kf==cap) then\r
+//       if stalone then\r
+//         txt = call_block42(kf,0,4);\r
+//         if txt <> [] then\r
+//           Code=[Code;\r
+//                 '';\r
+//                 '    '+txt];\r
+//         end\r
+//       end\r
+//     else\r
+      txt = call_block42(kf,0,4);\r
+      if txt <> [] then\r
+        Code=[Code;\r
+              '';\r
+              '    '+txt];\r
+      end\r
+//     end\r
+  end\r
+\r
+  //** cst blocks and it's dep\r
+  txt=write_code_idoit()\r
+\r
+  if txt<>[] then\r
+    Code=[Code;\r
+          ''\r
+          '    /* initial blocks must be called with flag 1 */'\r
+          txt];\r
+  end\r
+//   for kf=iord(:,1)'\r
+// //     if or(kf==act) then\r
+// //       if stalone then\r
+// //         txt = call_block42(kf,0,1);\r
+// //         if txt <> [] then\r
+// //           Code=[Code;\r
+// //                 '';\r
+// //                 '    '+txt];\r
+// //         end\r
+// //       end\r
+// //     else\r
+//       txt = call_block42(kf,0,1);\r
+//       if txt <> [] then\r
+//         Code=[Code;\r
+//               '';\r
+//               '    '+txt];\r
+//       end\r
+// //     end\r
+//   end\r
+\r
+  Code=[Code;\r
+        '  }'];\r
+\r
+  //** flag 5\r
+  Code=[Code;\r
+        '  else if (flag == 5) { '+get_comment('flag',list(5))\r
+        '    block_'+rdnom+'=*block->work;']\r
+\r
+  for kf=1:nblk\r
+     nin=inpptr(kf+1)-inpptr(kf);  //* number of input ports */\r
+     nout=outptr(kf+1)-outptr(kf); //* number of output ports */\r
+\r
+     //** add comment\r
+     txt=[get_comment('set_blk',list(funs(kf),funtyp(kf),kf));]\r
+\r
+     Code=[Code;\r
+           ''\r
+           '    '+txt];\r
+\r<