[Contents] [TitleIndex] [WordIndex

Xcos Private API

This is the list of the Xcos private API. This Scilab functions/macros will *not* be preserved across each Xcos release. This is for documentation only and may change without warns.

Evaluation utilities

xcosBlockEval

function xcosBlockEval(hdf5FileToLoad, hdf5FileToSave, interfaceAlias, hdf5ContextFile)

hdf5FileToLoad

String

path to the input hdf5 file

hdf5FileToSave

String

path to the output hdf5 file

interfaceAlias

String

block class name (eg "IN_F")

hdf5ContextFile

array of String

The applicable context

Evaluate a block on scilab.

xcosBlockInterface

function xcosBlockInterface(hdf5FileToLoad, hdf5FileToSave, ...
                            interfaceAlias, job, hdf5ContextFile)

hdf5FileToLoad

String

path to the input hdf5 file

hdf5FileToSave

String

path to the output hdf5 file

interfaceAlias

String

block class name (eg "IN_F")

job

String

job name ("set", "define", etc...)

hdf5ContextFile

array of String

The applicable context

Call the block job.

xcosCodeGeneration

function xcosCodeGeneration(hdf5FileToLoad, hdf5FileToSave)

hdf5FileToLoad

String

path to the input hdf5 file

hdf5FileToSave

String

path to the output hdf5 file

Generate code for the objects.

xcos_compile

function  [%cpr,ok] = xcos_compile(scs_m)

scs_m

diagram mlist

the diagram to compile

%cpr

scicos status

The new simulation status

ok

Boolean

status of the operation

Compile the whole diagram

xcos_simulate

function xcos_simulate(scs_m)

scs_m

diagram mlist

the diagram to simulate

Simulate the whole diagram

Highlight utilities

closeDiagramPath

function closeDiagramPath(path, highlighted_blocks, close_opened)

path

path array

win path to the blocks (used with superblocks)

highlighted_blocks

array of block index

the previously highlighted blocks

close_opened

Boolean

true if the opened window will be closed after highlight

Close and unhighlight the blocks.

errorDiagramPath

function ret = errorDiagramPath(path, highlighted_blocks, msg, field, show_intermediate, close_opened)

path

path array

win path to the blocks (used with superblocks)

highlighted_blocks

array of block index

the blocks to highlight

msg

String

the message to display

field

String

the erroneous field

show_intermediate

Boolean

true, if path window must be opened, false if not

close_opened

Boolean

true if the opened window will be closed after highlight

Show an error for the block

openDiagramPath

function ret = openDiagramPath(path, highlighted_blocks, msg, field, show_intermediate)

path

path array

win path to the blocks (used with superblocks)

highlighted_blocks

array of block index

the blocks to highlight

msg

String

the message to display

field

String

the erroneous field

show_intermediate

Boolean

true, if path window must be opened, false if not

Open the windows on the path and highlight blocks on the path.

xcosClearBlockWarning

function xcosClearBlockWarning(k, win)

k

obj index

reference the object to be cleared

win

window index

reference the object container

Clear the highlight on the block.

xcosShowBlockWarning

function xcosShowBlockWarning(k, win)

k

obj index

reference the object to be set

win

window index

reference the object container

Set the highlight on the block.

xcos_close

function xcos_close(blockId)

blockId

obj index

the block index

Close the associated block window.

xcos_open

function xcos_open(blockId, show)

blockId

obj index

the block index

show

Boolean

If true set the window visible

Open the associated block window.

Compile-time utilities

generateBlockImages

function generateBlockImages(palFiles, outPath)

palFiles

array of String

Path to the palette files

outPath

String

Path to an output dir

Render blocks into a GIF file. This will generate block icons for all the named palettes.

importScicosPal

function importScicosPal(palFiles, outPath)

palFiles

array of String

Path to the palette files

outPath

String

Path to an output dir

Export each block in palette files to the out path as HDF5 blocks.

Use

To export all the scicos palettes into "/tmp/pals/".

pals = ls(SCI + "/modules/scicos/palettes/*.cosf");
importScicosPal(pals , "/tmp/pals/");

Others

%diagram_xcos

function %diagram_xcos(scs_m)

scs_m

diagram mlist

current diagram

/!\ TODO: document

getDiagramVersion

function version = getDiagramVersion(diagram)

diagram

diagram mlist

the current diagram

version

String

the diagram version

Get the version of the diagram.

importScicosDiagram

function out = importScicosDiagram(source)

source

String or diagram mlist

the diagram to import (it may be a path to a COS or a COSF file or an already loaded diagram)

out

diagram list

the loaded diagram

Load a diagram on the Scilab interpreter.

xcosConfigureModelica

/!\ TODO: document


CategoryXcos


2022-09-08 09:27