Generate Xcos block template sci code

Generate Xcos block template sci code

function mdaq_block_add(block_def)

    if type(block_def) <> 17 then
        disp("ERROR: Wrong type of input argument!");
        if type(block_def) == 13 then
            disp("Input argument type is function - use ''block = mdaq_block()'' instead of ''block = mdaq_block''")
        else
            disp("Use mdaq_block() function to create initialized block sctructure!")
        end
        return;
    end

    if size(block_def.in, 'r' ) > 1 then
        if size(block_def.in, 'c' ) > 1 then
            disp("ERROR: Wrong block ''in'' parameter - one dimentional array expected!");
            return;
        end
        block_def.in = block_def.in';
    end

    if size(block_def.out, 'r' ) > 1 then
        if size(block_def.out, 'c' ) > 1 then
            disp("ERROR: Wrong block ''out'' parameter - one dimentional array expected!")
            return;
        end
        block_def.out = block_def.out';
    end

    if length(block_def.name) > 20 then
        disp("ERROR: Block name too long!");
        return;
    end

    path = dirname(get_function_path('mdaq_block_add')) + filesep();
    module_path = part(path,1:length(path)-length("macros") - 1 );
    SCRIPT_FILE_ROOT = path + 'user_blocks' + filesep();
    C_FILE_ROOT = module_path+'src'+filesep()+'c'+ filesep()+'userlib'+filesep();
    IMAGE_FILE_ROOT = module_path + filesep() + 'images' + filesep();

    // =============================PREPARE INPUT=====================================
    params_size = max(size(block_def.param_name));
    params_size_size = max(size(block_def.param_size));
    params_def_val_size = max(size(block_def.param_def_val));
    in_size = max(size(block_def.in));
    out_size = max(size(block_def.out));

    if block_def.in(1) < 1 then
        in_size = 0;
    end

    if block_def.out(1) < 1 then
        out_size = 0;
    end

    //If user did not enter enough information about size of parameters then
    //we set it to default 1.
    if params_size > params_size_size then
        sizes = ones(1:params_size)';
        sizes(1:params_size_size) = block_def.param_size;
        block_def.param_size = sizes;
    end

    //If user did not enter enough information about default parameters value then
    //we set it to default 0.
    def_val = list();
    for i=1:params_size
        def_val(i) = zeros(1:block_def.param_size(i))';

        if i <= params_def_val_size then
            i_params_def_val_size = max(size(block_def.param_def_val(i)));
            def_val(i)(1:i_params_def_val_size) = block_def.param_def_val(i);
        end
    end

    block_def.param_def_val = def_val;

    // if block name changed without desc - change block name in desc
    if block_def.desc == "Set new_block parameters" then
        block_def.desc = strsubst(block_def.desc, "new_block", block_def.name);
    end

    // =============================GENERATE STRINGS=====================================
    // converted params
    params_converted = [];

    // script file
    params_string1 = [];
    params_string2 = [];
    params_string3 = [];
    params_string4 = [];
    params_string5 = [];

    //default values string
    params_string6 = [];

    // C file
    in_ports_string = [];
    out_ports_string = [];
    params_c_string = [];
    params_sci_string = [];

    name_converted = convstr(block_def.name,'l');
    name_converted = strsubst(name_converted, ' ', '_');
    name_converted = 'mdaq_' + name_converted;

    for i = 1:params_size
        // Remove spaces and convert to lower case
        params_converted(i) = convstr(block_def.param_name(i),'l')
        params_converted(i) = strsubst(params_converted(i), ' ', '_')
        params_converted(i) = strsubst(params_converted(i), ';', '_')
        params_converted(i) = strsubst(params_converted(i), ':', '_')
        params_converted(i) = strsubst(params_converted(i), ',', '_')
        params_converted(i) = strsubst(params_converted(i), '.', '_')

        params_string1 = params_string1 + params_converted(i)+',';
        params_string2 = params_string2 + ''''+block_def.param_name(i)+':'';';
        params_string3 = params_string3 + '''vec'','+ string(block_def.param_size(i)) + ',';
        params_string4 = params_string4 + 'sci2exp(' + params_converted(i) + ');';
        params_string5 = params_string5 + params_converted(i)+';';

        i_def_param_size = max(size(block_def.param_def_val(i)));
        i_param_def_string = [];

        for j = 1:block_def.param_size(i)
            i_param_def_string = i_param_def_string + string(block_def.param_def_val(i)(j))+';';
        end

        //default values string
        params_string6(i) = '       '+params_converted(i)+' = ['+i_param_def_string+'];';

    end

    //delete last character ','
    params_string3 = part(params_string3, 1:(length(params_string3)-1) );

    in_string = '';
    out_string = '';

    if  in_size > 0 then
        for i = 1:(in_size-1)
            in_string = in_string + string(block_def.in(i)) + ';';
        end
        in_string = in_string + string(block_def.in(in_size));
    end

    if  out_size > 0 then
        for i = 1:(out_size-1)
            out_string = out_string + string(block_def.out(i)) + ';';
        end
        out_string = out_string + string(block_def.out(out_size));
    end

    block_v_size = 3;
    if max([out_size in_size]) > 2 then
        block_v_size = block_v_size + (max([out_size in_size]) - 2);
    end

    block_h_size = 4;
    if length(block_def.name) > 8 then
        block_h_size = block_h_size + ((length(block_def.name) - 8) * 0.2);
    end

    // =============================GENERATE SCRIPT=====================================
    // TODO define default params value
    //  (block_def.name).sci script generator
    block_script = [
    '// Generated with MicroDAQ toolbox ver: ' + mdaq_version() + '';
    'function [x,y,typ] = '+ name_converted + '(job,arg1,arg2)';
    '   block_desc = [''' + block_def.desc + ''';';
    '   '''';]';
    '';
    '   x=[];y=[];typ=[];';
    '   select job';
    '   case ''set'' then';
    '       x=arg1;';];
    if params_size > 0 then
        block_script = [block_script;
        '       model=arg1.model;';
        '       graphics=arg1.graphics;';
        '       exprs=graphics.exprs;';
        '';
        '       while %t do';
        '           try';
        '               getversion(''scilab'');';
        '               [ok,'+params_string1+'exprs]=..'
        '               scicos_getvalue( block_desc,..';
        '               ['+params_string2+'],..';
        '               list('+params_string3+'), exprs)';
        '           catch';
        '               [ok,'+params_string1+'exprs]=..'
        '               getvalue(block_desc,..';
        '               ['+params_string2+'],..';
        '               list('+params_string3+'), exprs);';
        '           end;';
        '';
        '       if ~ok then';
        '              break';
        '       end';
        '';
        '       if ok then';
        '           [model,graphics,ok] = check_io(model,graphics, ['+in_string+'], ['+out_string+'], 1, []);';
        '           graphics.exprs = exprs;';
        '           model.rpar = ['+params_string5+'];';
        '           model.ipar = [];';
        '           model.dstate = [];';
        '           x.graphics = graphics;';
        '           x.model = model;';
        '           break';
        '       end';
        '';
        '   end'];
    end
    block_script = [block_script; '   case ''define'' then';
    params_string6;
    '       model=scicos_model();'
    '       model.sim=list('''+name_converted+'_sim'',5);';
    '       model.in=['+in_string+'];';
    '       model.in2=1;';
    '       model.out=['+out_string+'];';
    '       model.out2=1;';
    '       model.outtyp=1;';
    '       model.intyp=1;';
    '       model.evtin=1;';
    '       model.rpar=['+params_string5+'];';
    '       model.ipar=[];';

    '       model.dstate=[];';
    '       model.blocktype=''d'';';
    '       model.dep_ut=[%t %f];';
    '       exprs=['+params_string4+'];';
    '       gr_i=[''xstringb(orig(1),orig(2),['''''''' ; ],sz(1),sz(2),''''fill'''');''];';
    '       x=standard_define([' + string(block_h_size) + ' '+string(block_v_size)+'],model,exprs,gr_i);';
    '       x.graphics.in_implicit=[];';
    '       x.graphics.exprs=exprs;';
    '       x.graphics.style=[""blockWithLabel;verticalLabelPosition=center;displayedLabel=' + block_def.name + '""]';
    '   end';
    'endfunction';
    ];

    // =============================GENERATE SIM SCRIPT=====================================

    index = 0;
    n_lines = 1;
    l = 1;
    for i = 1:n_lines:(params_size*n_lines)
        params_sci_string(i+1) =  '    '+params_converted(l)+' = block.rpar('+string(index + 1)+');';
        index = index + block_def.param_size(l);
        l = l + 1;
    end
    //  (block_def.name)_sim.sci script generator
    block_script_sim = [
    '// Generated with MicroDAQ toolbox ver: ' + mdaq_version() + '';
    'function block='+name_converted+'_sim(block,flag)';
    '';
    '    global %microdaq';
    '    if %microdaq.dsp_loaded == %F then';
    params_sci_string;
    '    select flag';
    '       case -5 // Error';
    '       case 0 // Derivative State Update';
    '       case 1 // Output Update';
    '       case 2 // State Update';
    '       case 3 // OutputEventTiming';
    '       case 4 // Initialization';
    '       case 5 // Ending';
    '       case 6 // Re-Initialisation';
    '       case 9 // ZeroCrossing';
    '       else // Unknown flag';
    '       break';
    '    end';
    'end';
    'endfunction';
    ];

    // save scripts
    file_name = SCRIPT_FILE_ROOT+name_converted+'.sci';
    save_string(file_name, block_script);

    file_name = SCRIPT_FILE_ROOT+name_converted+'_sim.sci';
    save_string(file_name, block_script_sim);

    // =============================GENERATE C FILE =====================================
    l = 1;
    n_lines = 3;
    index = 0;

    if in_size > 0 then
        in_ports_string(1) = '    /* Block input ports */';
        for i = 2:n_lines:(in_size*n_lines+1)
            in_ports_string(i) = '    double *u'+string(l)+' = GetRealInPortPtrs(block,'+string(l)+');';
            in_ports_string(i+1) = '    int u' +string(l)+ '_size = GetInPortRows(block,'+ string(l)+');'+...
            '    /* u' + string(l)+ '_size = '+string(block_def.in(l))+' */';
            in_ports_string(i+2) = '';
            l = l + 1;
        end
    end

    l = 1;

    if out_size > 0 then
        out_ports_string(1) = '    /* Block output ports */';
        for i = 2:n_lines:(out_size*n_lines+1)
            out_ports_string(i) = '    double *y'+string(l)+' = GetRealOutPortPtrs(block,'+string(l)+');';
            out_ports_string(i+1) = '    int y'+string(l)+'_size = GetOutPortRows(block,'+string(l)+');'+....
            '    /* y' + string(l)+ '_size = '+string(block_def.out(l))+' */';
            out_ports_string(i+2) = '';
            l = l + 1;
        end
    end

    index = 0;
    n_lines = 2;
    l = 1;
    for i = 1:n_lines:(params_size*n_lines)
        if  block_def.param_size(l) == 1 then
            params_c_string(i) = '    /* param size = 1 */';
            params_c_string(i+1) =  '    double '+params_converted(l)+' = params['+string(index)+'];';
        else
            params_c_string(i) = '    int '+params_converted(l)+'_size = '+string(block_def.param_size(l))+';';
            params_c_string(i+1) =  '    double *'+params_converted(l)+' = &params['+string(index)+'];';
        end

        index = index + block_def.param_size(l);
        l = l + 1;
    end

    block_c_file = [
    '/* Generated with MicroDAQ toolbox ver: ' + mdaq_version() + ' */';
    '#include '"scicos_block4.h'"';
    '';
    '';
    'extern double get_scicos_time( void );';
    '';
    '/* This function will executed once at the beginning of model execution */'
    'static void init(scicos_block *block)';
    '{';
    '    /* Block parameters */';
    '    double *params = GetRparPtrs(block);';
    '';
    params_c_string;
    '';
    '    /* Add block init code here */';
    '}';
    '';
    '/* This function will be executed on every model step */';
    'static void inout(scicos_block *block)';
    '{';
    '    /* Block parameters */';
    '    double *params = GetRparPtrs(block);';
    params_c_string;
    '';
    in_ports_string;
    out_ports_string;
    '';
    '    /* Add block code here (executed every model step) */';
    '';
    '}';
    '';
    '/* This function will be executed once at the end of model execution (only in Ext mode) */'
    'static void end(scicos_block *block)';
    '{';
    '    /* Prameters */';
    '    double *params = GetRparPtrs(block);';
    '';
    params_c_string;
    '';
    '    /* Add block end code here */';
    '}';
    '';
    'void '+name_converted+'(scicos_block *block,int flag)';
    '{';
    '    if (flag == 1){            /* set output */';
    '        inout(block);';
    '    }';
    '    else if (flag == 5){       /* termination */';
    '        end(block);';
    '    }';
    '    else if (flag == 4){       /* initialisation */';
    '        init(block);';
    '    }';
    '}';
    ]

    file_name = C_FILE_ROOT+name_converted+'.c';
    save_string(file_name, block_c_file);

    svg_path = IMAGE_FILE_ROOT + 'svg' + filesep();
    gen_svg(svg_path, name_converted, block_def.name);

    // build macros and compile C code
    mdaq_block_build();

endfunction

function res = save_string(filename, content)
    [f,res] = mopen(filename,'w');
    if res == 0 then
        mprintf(" ### Generating %s\n", filename);
        mputl(content,f)
        mclose(f)
    end
endfunction

function gen_svg(path,filename,label);
    doc = xmlRead(path+'mdaq_template.svg');

    // Label handle
    node = doc.root.children(13).children(1);
    node.content = "";
    xmlDump(node);
    xmlWrite(doc,path+filename+'.svg');
    xmlDelete(doc);
endfunction

function mdaq_block_add(block_def)

    if type(block_def) <> 17 then
        disp("ERROR: Wrong type of input argument!");
        if type(block_def) == 13 then
            disp("Input argument type is function - use ''block = mdaq_block()'' instead of ''block = mdaq_block''")
        else
            disp("Use mdaq_block() function to create initialized block sctructure!")
        end
        return;
    end

    if size(block_def.in, 'r' ) > 1 then
        if size(block_def.in, 'c' ) > 1 then
            disp("ERROR: Wrong block ''in'' parameter - one dimentional array expected!");
            return;
        end
        block_def.in = block_def.in';
    end

    if size(block_def.out, 'r' ) > 1 then
        if size(block_def.out, 'c' ) > 1 then
            disp("ERROR: Wrong block ''out'' parameter - one dimentional array expected!")
            return;
        end
        block_def.out = block_def.out';
    end

    if length(block_def.name) > 20 then
        disp("ERROR: Block name too long!");
        return;
    end

    path = dirname(get_function_path('mdaq_block_add')) + filesep();
    module_path = part(path,1:length(path)-length("macros") - 1 );
    SCRIPT_FILE_ROOT = path + 'user_blocks' + filesep();
    C_FILE_ROOT = module_path+'src'+filesep()+'c'+ filesep()+'userlib'+filesep();
    IMAGE_FILE_ROOT = module_path + filesep() + 'images' + filesep();

    // =============================PREPARE INPUT=====================================
    params_size = max(size(block_def.param_name));
    params_size_size = max(size(block_def.param_size));
    params_def_val_size = max(size(block_def.param_def_val));
    in_size = max(size(block_def.in));
    out_size = max(size(block_def.out));

    if block_def.in(1) < 1 then
        in_size = 0;
    end

    if block_def.out(1) < 1 then
        out_size = 0;
    end

    //If user did not enter enough information about size of parameters then
    //we set it to default 1.
    if params_size > params_size_size then
        sizes = ones(1:params_size)';
        sizes(1:params_size_size) = block_def.param_size;
        block_def.param_size = sizes;
    end

    //If user did not enter enough information about default parameters value then
    //we set it to default 0.
    def_val = list();
    for i=1:params_size
        def_val(i) = zeros(1:block_def.param_size(i))';

        if i <= params_def_val_size then
            i_params_def_val_size = max(size(block_def.param_def_val(i)));
            def_val(i)(1:i_params_def_val_size) = block_def.param_def_val(i);
        end
    end

    block_def.param_def_val = def_val;

    // if block name changed without desc - change block name in desc
    if block_def.desc == "Set new_block parameters" then
        block_def.desc = strsubst(block_def.desc, "new_block", block_def.name);
    end

    // =============================GENERATE STRINGS=====================================
    // converted params
    params_converted = [];

    // script file
    params_string1 = [];
    params_string2 = [];
    params_string3 = [];
    params_string4 = [];
    params_string5 = [];

    //default values string
    params_string6 = [];

    // C file
    in_ports_string = [];
    out_ports_string = [];
    params_c_string = [];

    name_converted = convstr(block_def.name,'l');
    name_converted = strsubst(name_converted, ' ', '_');
    name_converted = 'mdaq_' + name_converted;

    for i = 1:params_size
        // Remove spaces and convert to lower case
        params_converted(i) = convstr(block_def.param_name(i),'l')
        params_converted(i) = strsubst(params_converted(i), ' ', '_')
        params_converted(i) = strsubst(params_converted(i), ';', '_')
        params_converted(i) = strsubst(params_converted(i), ':', '_')
        params_converted(i) = strsubst(params_converted(i), ',', '_')
        params_converted(i) = strsubst(params_converted(i), '.', '_')

        params_string1 = params_string1 + params_converted(i)+',';
        params_string2 = params_string2 + ''''+block_def.param_name(i)+':'';';
        params_string3 = params_string3 + '''vec'','+ string(block_def.param_size(i)) + ',';
        params_string4 = params_string4 + 'sci2exp(' + params_converted(i) + ');';
        params_string5 = params_string5 + params_converted(i)+';';

        i_def_param_size = max(size(block_def.param_def_val(i)));
        i_param_def_string = [];

        for j = 1:block_def.param_size(i)
            i_param_def_string = i_param_def_string + string(block_def.param_def_val(i)(j))+';';
        end

        //default values string
        params_string6(i) = '       '+params_converted(i)+' = ['+i_param_def_string+'];';

    end

    //delete last character ','
    params_string3 = part(params_string3, 1:(length(params_string3)-1) );

    in_string = '';
    out_string = '';

    if  in_size > 0 then
        for i = 1:(in_size-1)
            in_string = in_string + string(block_def.in(i)) + ';';
        end
        in_string = in_string + string(block_def.in(in_size));
    end

    if  out_size > 0 then
        for i = 1:(out_size-1)
            out_string = out_string + string(block_def.out(i)) + ';';
        end
        out_string = out_string + string(block_def.out(out_size));
    end

    block_v_size = 3;
    if max([out_size in_size]) > 2 then
        block_v_size = block_v_size + (max([out_size in_size]) - 2);
    end

    block_h_size = 4;
    if length(block_def.name) > 8 then
        block_h_size = block_h_size + ((length(block_def.name) - 8) * 0.2);
    end

    // =============================GENERATE SCRIPT=====================================
    // TODO define default params value
    //  (block_def.name).sci script generator
    block_script = [
    '// Generated with MicroDAQ toolbox ver: ' + mdaq_version() + '';
    'function [x,y,typ] = '+ name_converted + '(job,arg1,arg2)';
    '   block_desc = [''' + block_def.desc + ''';';
    '   '''';]';
    '';
    '   x=[];y=[];typ=[];';
    '   select job';
    '   case ''set'' then';
    '       x=arg1;';];
    if params_size > 0 then
        block_script = [block_script;
        '       model=arg1.model;';
        '       graphics=arg1.graphics;';
        '       exprs=graphics.exprs;';
        '';
        '       while %t do';
        '           try';
        '               getversion(''scilab'');';
        '               [ok,'+params_string1+'exprs]=..'
        '               scicos_getvalue( block_desc,..';
        '               ['+params_string2+'],..';
        '               list('+params_string3+'), exprs)';
        '           catch';
        '               [ok,'+params_string1+'exprs]=..'
        '               getvalue(block_desc,..';
        '               ['+params_string2+'],..';
        '               list('+params_string3+'), exprs);';
        '           end;';
        '';
        '       if ~ok then';
        '              break';
        '       end';
        '';
        '       if ok then';
        '           [model,graphics,ok] = check_io(model,graphics, ['+in_string+'], ['+out_string+'], 1, []);';
        '           graphics.exprs = exprs;';
        '           model.rpar = ['+params_string5+'];';
        '           model.ipar = [];';
        '           model.dstate = [];';
        '           x.graphics = graphics;';
        '           x.model = model;';
        '           break';
        '       end';
        '';
        '   end'];
    end
    block_script = [block_script; '   case ''define'' then';
    params_string6;
    '       model=scicos_model();'
    '       model.sim=list('''+name_converted+'_sim'',5);';
    '       model.in=['+in_string+'];';
    '       model.in2=1;';
    '       model.out=['+out_string+'];';
    '       model.out2=1;';
    '       model.outtyp=1;';
    '       model.intyp=1;';
    '       model.evtin=1;';
    '       model.rpar=['+params_string5+'];';
    '       model.ipar=[];';
    '       model.dstate=[];';
    '       model.blocktype=''d'';';
    '       model.dep_ut=[%t %f];';
    '       exprs=['+params_string4+'];';
    '       gr_i=[''xstringb(orig(1),orig(2),['''''''' ; ],sz(1),sz(2),''''fill'''');''];';
    '       x=standard_define([' + string(block_h_size) + ' '+string(block_v_size)+'],model,exprs,gr_i);';
    '       x.graphics.in_implicit=[];';
    '       x.graphics.exprs=exprs;';
    '       x.graphics.style=[""blockWithLabel;verticalLabelPosition=center;displayedLabel=' + block_def.name + '""]';
    '   end';
    'endfunction';
    ];

    // =============================GENERATE SIM SCRIPT=====================================
    //  (block_def.name)_sim.sci script generator
    block_script_sim = [
    '// Generated with MicroDAQ toolbox ver: ' + mdaq_version() + '';
    'function block='+name_converted+'_sim(block,flag)';
    'select flag';

    '   case -5 // Error';
    '   case 0 // Derivative State Update';
    '   case 1 // Output Update';
    '   case 2 // State Update';
    '   case 3 // OutputEventTiming';
    '   case 4 // Initialization';
    '   case 5 // Ending';
    '   case 6 // Re-Initialisation';
    '   case 9 // ZeroCrossing';
    '   else // Unknown flag';
    'end';
    'endfunction';
    ];

    // save scripts
    file_name = SCRIPT_FILE_ROOT+name_converted+'.sci';
    save_string(file_name, block_script);

    file_name = SCRIPT_FILE_ROOT+name_converted+'_sim.sci';
    save_string(file_name, block_script_sim);

    // =============================GENERATE C FILE =====================================
    l = 1;
    n_lines = 3;

    if in_size > 0 then
        in_ports_string(1) = '    /* Block input ports */';
        for i = 2:n_lines:(in_size*n_lines+1)
            in_ports_string(i) = '    double *u'+string(l)+' = GetRealInPortPtrs(block,'+string(l)+');';
            in_ports_string(i+1) = '    int u' +string(l)+ '_size = GetInPortRows(block,'+ string(l)+');'+...
            '    /* u' + string(l)+ '_size = '+string(block_def.in(l))+' */';
            in_ports_string(i+2) = '';
            l = l + 1;
        end
    end

    l = 1;

    if out_size > 0 then
        out_ports_string(1) = '    /* Block output ports */';
        for i = 2:n_lines:(out_size*n_lines+1)
            out_ports_string(i) = '    double *y'+string(l)+' = GetRealOutPortPtrs(block,'+string(l)+');';
            out_ports_string(i+1) = '    int y'+string(l)+'_size = GetOutPortRows(block,'+string(l)+');'+....
            '    /* y' + string(l)+ '_size = '+string(block_def.out(l))+' */';
            out_ports_string(i+2) = '';
            l = l + 1;
        end
    end

    index = 0;
    n_lines = 2;
    l = 1;
    for i = 1:n_lines:(params_size*n_lines)
        if  block_def.param_size(l) == 1 then
            params_c_string(i) = '    /* param size = 1 */';
            params_c_string(i+1) =  '    double '+params_converted(l)+' = params['+string(index)+'];';
        else
            params_c_string(i) = '    int '+params_converted(l)+'_size = '+string(block_def.param_size(l))+';';
            params_c_string(i+1) =  '    double *'+params_converted(l)+' = &params['+string(index)+'];';
        end

        index = index + block_def.param_size(l);
        l = l + 1;
    end

    block_c_file = [
    '/* Generated with MicroDAQ toolbox ver: ' + mdaq_version() + ' */';
    '#include '"scicos_block4.h'"';
    '';
    '';
    'extern double get_scicos_time( void );';
    '';
    '/* This function will executed once at the beginning of model execution */'
    'static void init(scicos_block *block)';
    '{';
    '    /* Block parameters */';
    '    double *params = GetRparPtrs(block);';
    '';
    params_c_string;
    '';
    '    /* Add block init code here */';
    '}';
    '';
    '/* This function will be executed on every model step */';
    'static void inout(scicos_block *block)';
    '{';
    '    /* Block parameters */';
    '    double *params = GetRparPtrs(block);';
    params_c_string;
    '';
    in_ports_string;
    out_ports_string;
    '';
    '    /* Add block code here (executed every model step) */';
    '';
    '}';
    '';
    '/* This function will be executed once at the end of model execution (only in Ext mode) */'
    'static void end(scicos_block *block)';
    '{';
    '    /* Prameters */';
    '    double *params = GetRparPtrs(block);';
    '';
    params_c_string;
    '';
    '    /* Add block end code here */';
    '}';
    '';
    'void '+name_converted+'(scicos_block *block,int flag)';
    '{';
    '    if (flag == 1){            /* set output */';
    '        inout(block);';
    '    }';
    '    else if (flag == 5){       /* termination */';
    '        end(block);';
    '    }';
    '    else if (flag == 4){       /* initialisation */';
    '        init(block);';
    '    }';
    '}';
    ]

    file_name = C_FILE_ROOT+name_converted+'.c';
    save_string(file_name, block_c_file);

    svg_path = IMAGE_FILE_ROOT + 'svg' + filesep();
    gen_svg(svg_path, name_converted, block_def.name);

    // build macros and compile C code
    mdaq_block_build();

endfunction

function res = save_string(filename, content)
    [f,res] = mopen(filename,'w');
    if res == 0 then
        mprintf(" ### Generating %s\n", filename);
        mputl(content,f)
        mclose(f)
    end
endfunction

function gen_svg(path,filename,label);
    doc = xmlRead(path+'mdaq_template.svg');

    // Label handle
    node = doc.root.children(13).children(1);
    node.content = "";
    xmlDump(node);
    xmlWrite(doc,path+filename+'.svg');
    xmlDelete(doc);
endfunction


Delete VWFA_Localizer_MRI.sce

Delete VWFA_Localizer_MRI.sce

#######################################################
# Visual Word Form Area Localizer - blocked fMRI 	  #
# O. Colizoli 	2011								  #
#                                                     #
# Presentation SCE file                               #
# Dutch vs. Chinese words (ABAB)                      #
# 16 seconds active, 16 sec baseline (fixation cross) #
# Only 4-letter/character words used                  #
# Instructions - passive viewing, maintain fixation   #
# 9 blocks per condition                              #
#######################################################

scenario = "VWFA_Localizer_MRI";

default_background_color = 255, 255, 255;
default_font = "courier new";
default_font_size = 60;
default_text_color = 0,0,0;
response_matching = simple_matching;
response_logging = log_all;
active_buttons = 4;
button_codes = 1,2,3,4;

#scenario_type = fMRI_emulation; # only here to make emulation possible if desired
#scan_period = 2000;   # (ms) only here to make emulation possible if desired
scenario_type = fMRI;
pulses_per_scan = 1;
pulse_code = 255;

begin;

################ STIMULUS DEFINITIONS ################

array{ # 144 words
text	{caption	=	"TIEN"	;	description	=	"	TIEN	"	;}	;
text	{caption	=	"ECHT"	;	description	=	"	ECHT	"	;}	;
text	{caption	=	"ENIG"	;	description	=	"	ENIG	"	;}	;
text	{caption	=	"OVER"	;	description	=	"	OVER	"	;}	;
text	{caption	=	"STOF"	;	description	=	"	STOF	"	;}	;
text	{caption	=	"LUST"	;	description	=	"	LUST	"	;}	;
text	{caption	=	"DANK"	;	description	=	"	DANK	"	;}	;
text	{caption	=	"VORM"	;	description	=	"	VORM	"	;}	;
text	{caption	=	"NAME"	;	description	=	"	NAME	"	;}	;
text	{caption	=	"UREN"	;	description	=	"	UREN	"	;}	;
text	{caption	=	"BOEK"	;	description	=	"	BOEK	"	;}	;
text	{caption	=	"VELD"	;	description	=	"	VELD	"	;}	;
text	{caption	=	"WANG"	;	description	=	"	WANG	"	;}	;
text	{caption	=	"ZULT"	;	description	=	"	ZULT	"	;}	;
text	{caption	=	"KANS"	;	description	=	"	KANS	"	;}	;
text	{caption	=	"ETEN"	;	description	=	"	ETEN	"	;}	;
text	{caption	=	"ALLE"	;	description	=	"	ALLE	"	;}	;
text	{caption	=	"GOLF"	;	description	=	"	GOLF	"	;}	;
text	{caption	=	"REIS"	;	description	=	"	REIS	"	;}	;
text	{caption	=	"DOEN"	;	description	=	"	DOEN	"	;}	;
text	{caption	=	"VLUG"	;	description	=	"	VLUG	"	;}	;
text	{caption	=	"HUID"	;	description	=	"	HUID	"	;}	;
text	{caption	=	"HEMD"	;	description	=	"	HEMD	"	;}	;
text	{caption	=	"TERM"	;	description	=	"	TERM	"	;}	;
text	{caption	=	"PIJN"	;	description	=	"	PIJN	"	;}	;
text	{caption	=	"STEM"	;	description	=	"	STEM	"	;}	;
text	{caption	=	"GAST"	;	description	=	"	GAST	"	;}	;
text	{caption	=	"LIED"	;	description	=	"	LIED	"	;}	;
text	{caption	=	"ZORG"	;	description	=	"	ZORG	"	;}	;
text	{caption	=	"ARME"	;	description	=	"	ARME	"	;}	;
text	{caption	=	"FLES"	;	description	=	"	FLES	"	;}	;
text	{caption	=	"ACHT"	;	description	=	"	ACHT	"	;}	;
text	{caption	=	"MOND"	;	description	=	"	MOND	"	;}	;
text	{caption	=	"RING"	;	description	=	"	RING	"	;}	;
text	{caption	=	"GRAS"	;	description	=	"	GRAS	"	;}	;
text	{caption	=	"MELK"	;	description	=	"	MELK	"	;}	;
text	{caption	=	"DOCH"	;	description	=	"	DOCH	"	;}	;
text	{caption	=	"BANG"	;	description	=	"	BANG	"	;}	;
text	{caption	=	"TONG"	;	description	=	"	TONG	"	;}	;
text	{caption	=	"ONZE"	;	description	=	"	ONZE	"	;}	;
text	{caption	=	"OPEN"	;	description	=	"	OPEN	"	;}	;
text	{caption	=	"JURK"	;	description	=	"	JURK	"	;}	;
text	{caption	=	"TRAP"	;	description	=	"	TRAP	"	;}	;
text	{caption	=	"ZAND"	;	description	=	"	ZAND	"	;}	;
text	{caption	=	"STAD"	;	description	=	"	STAD	"	;}	;
text	{caption	=	"SLOT"	;	description	=	"	SLOT	"	;}	;
text	{caption	=	"PLUS"	;	description	=	"	PLUS	"	;}	;
text	{caption	=	"FASE"	;	description	=	"	FASE	"	;}	;
text	{caption	=	"BLAD"	;	description	=	"	BLAD	"	;}	;
text	{caption	=	"CHEF"	;	description	=	"	CHEF	"	;}	;
text	{caption	=	"RIJK"	;	description	=	"	RIJK	"	;}	;
text	{caption	=	"EIND"	;	description	=	"	EIND	"	;}	;
text	{caption	=	"CAFE"	;	description	=	"	CAFE	"	;}	;
text	{caption	=	"MOED"	;	description	=	"	MOED	"	;}	;
text	{caption	=	"HALF"	;	description	=	"	HALF	"	;}	;
text	{caption	=	"PERS"	;	description	=	"	PERS	"	;}	;
text	{caption	=	"LEUK"	;	description	=	"	LEUK	"	;}	;
text	{caption	=	"ERIN"	;	description	=	"	ERIN	"	;}	;
text	{caption	=	"VALT"	;	description	=	"	VALT	"	;}	;
text	{caption	=	"OLIE"	;	description	=	"	OLIE	"	;}	;
text	{caption	=	"AUTO"	;	description	=	"	AUTO	"	;}	;
text	{caption	=	"NAUW"	;	description	=	"	NAUW	"	;}	;
text	{caption	=	"AARD"	;	description	=	"	AARD	"	;}	;
text	{caption	=	"JUNI"	;	description	=	"	JUNI	"	;}	;
text	{caption	=	"SOMS"	;	description	=	"	SOMS	"	;}	;
text	{caption	=	"GEUR"	;	description	=	"	GEUR	"	;}	;
text	{caption	=	"LAST"	;	description	=	"	LAST	"	;}	;
text	{caption	=	"IETS"	;	description	=	"	IETS	"	;}	;
text	{caption	=	"DIER"	;	description	=	"	DIER	"	;}	;
text	{caption	=	"KOUD"	;	description	=	"	KOUD	"	;}	;
text	{caption	=	"SPEL"	;	description	=	"	SPEL	"	;}	;
text	{caption	=	"MEID"	;	description	=	"	MEID	"	;}	;
text	{caption	=	"WILD"	;	description	=	"	WILD	"	;}	;
text	{caption	=	"ZIEK"	;	description	=	"	ZIEK	"	;}	;
text	{caption	=	"BEST"	;	description	=	"	BEST	"	;}	;
text	{caption	=	"LUID"	;	description	=	"	LUID	"	;}	;
text	{caption	=	"HAND"	;	description	=	"	HAND	"	;}	;
text	{caption	=	"HOGE"	;	description	=	"	HOGE	"	;}	;
text	{caption	=	"MATE"	;	description	=	"	MATE	"	;}	;
text	{caption	=	"ZELF"	;	description	=	"	ZELF	"	;}	;
text	{caption	=	"GAUW"	;	description	=	"	GAUW	"	;}	;
text	{caption	=	"ELKE"	;	description	=	"	ELKE	"	;}	;
text	{caption	=	"WIER"	;	description	=	"	WIER	"	;}	;
text	{caption	=	"ZOEK"	;	description	=	"	ZOEK	"	;}	;
text	{caption	=	"FIJN"	;	description	=	"	FIJN	"	;}	;
text	{caption	=	"FLAT"	;	description	=	"	FLAT	"	;}	;
text	{caption	=	"WERK"	;	description	=	"	WERK	"	;}	;
text	{caption	=	"KAMP"	;	description	=	"	KAMP	"	;}	;
text	{caption	=	"TYPE"	;	description	=	"	TYPE	"	;}	;
text	{caption	=	"LOOP"	;	description	=	"	LOOP	"	;}	;
text	{caption	=	"SOEP"	;	description	=	"	SOEP	"	;}	;
text	{caption	=	"HALS"	;	description	=	"	HALS	"	;}	;
text	{caption	=	"RODE"	;	description	=	"	RODE	"	;}	;
text	{caption	=	"OOIT"	;	description	=	"	OOIT	"	;}	;
text	{caption	=	"NEUS"	;	description	=	"	NEUS	"	;}	;
text	{caption	=	"MOOI"	;	description	=	"	MOOI	"	;}	;
text	{caption	=	"THEE"	;	description	=	"	THEE	"	;}	;
text	{caption	=	"RUST"	;	description	=	"	RUST	"	;}	;
text	{caption	=	"ROZE"	;	description	=	"	ROZE	"	;}	;
text	{caption	=	"DORP"	;	description	=	"	DORP	"	;}	;
text	{caption	=	"KENT"	;	description	=	"	KENT	"	;}	;
text	{caption	=	"HOEK"	;	description	=	"	HOEK	"	;}	;
text	{caption	=	"BLIJ"	;	description	=	"	BLIJ	"	;}	;
text	{caption	=	"RIEP"	;	description	=	"	RIEP	"	;}	;
text	{caption	=	"WARM"	;	description	=	"	WARM	"	;}	;
text	{caption	=	"PAUS"	;	description	=	"	PAUS	"	;}	;
text	{caption	=	"JONG"	;	description	=	"	JONG	"	;}	;
text	{caption	=	"JAAR"	;	description	=	"	JAAR	"	;}	;
text	{caption	=	"JOUW"	;	description	=	"	JOUW	"	;}	;
text	{caption	=	"OREN"	;	description	=	"	OREN	"	;}	;
text	{caption	=	"FEIT"	;	description	=	"	FEIT	"	;}	;
text	{caption	=	"BANK"	;	description	=	"	BANK	"	;}	;
text	{caption	=	"PLEK"	;	description	=	"	PLEK	"	;}	;
text	{caption	=	"TAXI"	;	description	=	"	TAXI	"	;}	;
text	{caption	=	"LAGE"	;	description	=	"	LAGE	"	;}	;
text	{caption	=	"DEUR"	;	description	=	"	DEUR	"	;}	;
text	{caption	=	"KUST"	;	description	=	"	KUST	"	;}	;
text	{caption	=	"FOUT"	;	description	=	"	FOUT	"	;}	;
text	{caption	=	"BIER"	;	description	=	"	BIER	"	;}	;
text	{caption	=	"NIET"	;	description	=	"	NIET	"	;}	;
text	{caption	=	"KEUS"	;	description	=	"	KEUS	"	;}	;
text	{caption	=	"EVEN"	;	description	=	"	EVEN	"	;}	;
text	{caption	=	"PLAT"	;	description	=	"	PLAT	"	;}	;
text	{caption	=	"NOCH"	;	description	=	"	NOCH	"	;}	;
text	{caption	=	"KLAP"	;	description	=	"	KLAP	"	;}	;
text	{caption	=	"IDEE"	;	description	=	"	IDEE	"	;}	;
text	{caption	=	"GIDS"	;	description	=	"	GIDS	"	;}	;
text	{caption	=	"OUWE"	;	description	=	"	OUWE	"	;}	;
text	{caption	=	"HEBT"	;	description	=	"	HEBT	"	;}	;
text	{caption	=	"CLUB"	;	description	=	"	CLUB	"	;}	;
text	{caption	=	"PUNT"	;	description	=	"	PUNT	"	;}	;
text	{caption	=	"ARTS"	;	description	=	"	ARTS	"	;}	;
text	{caption	=	"WELK"	;	description	=	"	WELK	"	;}	;
text	{caption	=	"RAND"	;	description	=	"	RAND	"	;}	;
text	{caption	=	"GELD"	;	description	=	"	GELD	"	;}	;
text	{caption	=	"VIJF"	;	description	=	"	VIJF	"	;}	;
text	{caption	=	"FILM"	;	description	=	"	FILM	"	;}	;
text	{caption	=	"MIJN"	;	description	=	"	MIJN	"	;}	;
text	{caption	=	"NIKS"	;	description	=	"	NIKS	"	;}	;
text	{caption	=	"LIJN"	;	description	=	"	LIJN	"	;}	;
text	{caption	=	"DRIE"	;	description	=	"	DRIE	"	;}	;
text	{caption	=	"NEST"	;	description	=	"	NEST	"	;}	;
text	{caption	=	"VOEL"	;	description	=	"	VOEL	"	;}	;
text	{caption	=	"ADEM"	;	description	=	"	ADEM	"	;}	;
} dutch;

array{		# 144
text	{caption	=	"TIEN"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	TIEN	"	;}	;
text	{caption	=	"ECHT"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	ECHT	"	;}	;
text	{caption	=	"ENIG"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	ENIG	"	;}	;
text	{caption	=	"OVER"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	OVER	"	;}	;
text	{caption	=	"STOF"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	STOF	"	;}	;
text	{caption	=	"LUST"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	LUST	"	;}	;
text	{caption	=	"DANK"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	DANK	"	;}	;
text	{caption	=	"VORM"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	VORM	"	;}	;
text	{caption	=	"NAME"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	NAME	"	;}	;
text	{caption	=	"UREN"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	UREN	"	;}	;
text	{caption	=	"BOEK"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	BOEK	"	;}	;
text	{caption	=	"VELD"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	VELD	"	;}	;
text	{caption	=	"WANG"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	WANG	"	;}	;
text	{caption	=	"ZULT"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	ZULT	"	;}	;
text	{caption	=	"KANS"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	KANS	"	;}	;
text	{caption	=	"ETEN"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	ETEN	"	;}	;
text	{caption	=	"ALLE"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	ALLE	"	;}	;
text	{caption	=	"GOLF"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	GOLF	"	;}	;
text	{caption	=	"REIS"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	REIS	"	;}	;
text	{caption	=	"DOEN"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	DOEN	"	;}	;
text	{caption	=	"VLUG"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	VLUG	"	;}	;
text	{caption	=	"HUID"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	HUID	"	;}	;
text	{caption	=	"HEMD"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	HEMD	"	;}	;
text	{caption	=	"TERM"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	TERM	"	;}	;
text	{caption	=	"PIJN"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	PIJN	"	;}	;
text	{caption	=	"STEM"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	STEM	"	;}	;
text	{caption	=	"GAST"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	GAST	"	;}	;
text	{caption	=	"LIED"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	LIED	"	;}	;
text	{caption	=	"ZORG"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	ZORG	"	;}	;
text	{caption	=	"ARME"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	ARME	"	;}	;
text	{caption	=	"FLES"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	FLES	"	;}	;
text	{caption	=	"ACHT"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	ACHT	"	;}	;
text	{caption	=	"MOND"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	MOND	"	;}	;
text	{caption	=	"RING"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	RING	"	;}	;
text	{caption	=	"GRAS"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	GRAS	"	;}	;
text	{caption	=	"MELK"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	MELK	"	;}	;
text	{caption	=	"DOCH"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	DOCH	"	;}	;
text	{caption	=	"BANG"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	BANG	"	;}	;
text	{caption	=	"TONG"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	TONG	"	;}	;
text	{caption	=	"ONZE"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	ONZE	"	;}	;
text	{caption	=	"OPEN"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	OPEN	"	;}	;
text	{caption	=	"JURK"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	JURK	"	;}	;
text	{caption	=	"TRAP"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	TRAP	"	;}	;
text	{caption	=	"ZAND"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	ZAND	"	;}	;
text	{caption	=	"STAD"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	STAD	"	;}	;
text	{caption	=	"SLOT"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	SLOT	"	;}	;
text	{caption	=	"PLUS"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	PLUS	"	;}	;
text	{caption	=	"FASE"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	FASE	"	;}	;
text	{caption	=	"BLAD"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	BLAD	"	;}	;
text	{caption	=	"CHEF"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	CHEF	"	;}	;
text	{caption	=	"RIJK"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	RIJK	"	;}	;
text	{caption	=	"EIND"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	EIND	"	;}	;
text	{caption	=	"CAFE"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	CAFE	"	;}	;
text	{caption	=	"MOED"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	MOED	"	;}	;
text	{caption	=	"HALF"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	HALF	"	;}	;
text	{caption	=	"PERS"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	PERS	"	;}	;
text	{caption	=	"LEUK"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	LEUK	"	;}	;
text	{caption	=	"ERIN"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	ERIN	"	;}	;
text	{caption	=	"VALT"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	VALT	"	;}	;
text	{caption	=	"OLIE"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	OLIE	"	;}	;
text	{caption	=	"AUTO"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	AUTO	"	;}	;
text	{caption	=	"NAUW"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	NAUW	"	;}	;
text	{caption	=	"AARD"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	AARD	"	;}	;
text	{caption	=	"JUNI"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	JUNI	"	;}	;
text	{caption	=	"SOMS"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	SOMS	"	;}	;
text	{caption	=	"GEUR"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	GEUR	"	;}	;
text	{caption	=	"LAST"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	LAST	"	;}	;
text	{caption	=	"IETS"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	IETS	"	;}	;
text	{caption	=	"DIER"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	DIER	"	;}	;
text	{caption	=	"KOUD"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	KOUD	"	;}	;
text	{caption	=	"SPEL"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	SPEL	"	;}	;
text	{caption	=	"MEID"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	MEID	"	;}	;
text	{caption	=	"WILD"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	WILD	"	;}	;
text	{caption	=	"ZIEK"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	ZIEK	"	;}	;
text	{caption	=	"BEST"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	BEST	"	;}	;
text	{caption	=	"LUID"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	LUID	"	;}	;
text	{caption	=	"HAND"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	HAND	"	;}	;
text	{caption	=	"HOGE"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	HOGE	"	;}	;
text	{caption	=	"MATE"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	MATE	"	;}	;
text	{caption	=	"ZELF"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	ZELF	"	;}	;
text	{caption	=	"GAUW"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	GAUW	"	;}	;
text	{caption	=	"ELKE"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	ELKE	"	;}	;
text	{caption	=	"WIER"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	WIER	"	;}	;
text	{caption	=	"ZOEK"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	ZOEK	"	;}	;
text	{caption	=	"FIJN"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	FIJN	"	;}	;
text	{caption	=	"FLAT"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	FLAT	"	;}	;
text	{caption	=	"WERK"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	WERK	"	;}	;
text	{caption	=	"KAMP"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	KAMP	"	;}	;
text	{caption	=	"TYPE"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	TYPE	"	;}	;
text	{caption	=	"LOOP"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	LOOP	"	;}	;
text	{caption	=	"SOEP"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	SOEP	"	;}	;
text	{caption	=	"HALS"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	HALS	"	;}	;
text	{caption	=	"RODE"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	RODE	"	;}	;
text	{caption	=	"OOIT"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	OOIT	"	;}	;
text	{caption	=	"NEUS"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	NEUS	"	;}	;
text	{caption	=	"MOOI"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	MOOI	"	;}	;
text	{caption	=	"THEE"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	THEE	"	;}	;
text	{caption	=	"RUST"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	RUST	"	;}	;
text	{caption	=	"ROZE"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	ROZE	"	;}	;
text	{caption	=	"DORP"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	DORP	"	;}	;
text	{caption	=	"KENT"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	KENT	"	;}	;
text	{caption	=	"HOEK"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	HOEK	"	;}	;
text	{caption	=	"BLIJ"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	BLIJ	"	;}	;
text	{caption	=	"RIEP"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	RIEP	"	;}	;
text	{caption	=	"WARM"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	WARM	"	;}	;
text	{caption	=	"PAUS"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	PAUS	"	;}	;
text	{caption	=	"JONG"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	JONG	"	;}	;
text	{caption	=	"JAAR"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	JAAR	"	;}	;
text	{caption	=	"JOUW"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	JOUW	"	;}	;
text	{caption	=	"OREN"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	OREN	"	;}	;
text	{caption	=	"FEIT"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	FEIT	"	;}	;
text	{caption	=	"BANK"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	BANK	"	;}	;
text	{caption	=	"PLEK"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	PLEK	"	;}	;
text	{caption	=	"TAXI"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	TAXI	"	;}	;
text	{caption	=	"LAGE"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	LAGE	"	;}	;
text	{caption	=	"DEUR"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	DEUR	"	;}	;
text	{caption	=	"KUST"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	KUST	"	;}	;
text	{caption	=	"FOUT"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	FOUT	"	;}	;
text	{caption	=	"BIER"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	BIER	"	;}	;
text	{caption	=	"NIET"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	NIET	"	;}	;
text	{caption	=	"KEUS"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	KEUS	"	;}	;
text	{caption	=	"EVEN"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	EVEN	"	;}	;
text	{caption	=	"PLAT"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	PLAT	"	;}	;
text	{caption	=	"NOCH"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	NOCH	"	;}	;
text	{caption	=	"KLAP"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	KLAP	"	;}	;
text	{caption	=	"IDEE"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	IDEE	"	;}	;
text	{caption	=	"GIDS"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	GIDS	"	;}	;
text	{caption	=	"OUWE"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	OUWE	"	;}	;
text	{caption	=	"HEBT"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	HEBT	"	;}	;
text	{caption	=	"CLUB"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	CLUB	"	;}	;
text	{caption	=	"PUNT"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	PUNT	"	;}	;
text	{caption	=	"ARTS"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	ARTS	"	;}	;
text	{caption	=	"WELK"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	WELK	"	;}	;
text	{caption	=	"RAND"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	RAND	"	;}	;
text	{caption	=	"GELD"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	GELD	"	;}	;
text	{caption	=	"VIJF"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	VIJF	"	;}	;
text	{caption	=	"FILM"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	FILM	"	;}	;
text	{caption	=	"MIJN"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	MIJN	"	;}	;
text	{caption	=	"NIKS"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	NIKS	"	;}	;
text	{caption	=	"LIJN"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	LIJN	"	;}	;
text	{caption	=	"DRIE"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	DRIE	"	;}	;
text	{caption	=	"NEST"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	NEST	"	;}	;
text	{caption	=	"VOEL"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	VOEL	"	;}	;
text	{caption	=	"ADEM"	;	font_size = 35;	font=	"Hanzi Kaishu";	description	=	"	ADEM	"	;}	;
} chinese;

array{
text {caption = "+"; font_color= 0,0,0; font_size = 30; font = "Times New Roman"; description = "rest1";} ;
} rest;

#Instructions for participants
picture { text {caption = "The experiment will start at any moment.
Make sure that you stay still.

Look at the middle of the screen while the words appear.

There will be periods when no words appear.
please keep looking at the screen during this time.

You do not have to push any buttons.";
font_color = 0,0,0; font_size = 24; font = "Times New Roman";
}; x = 0; y = 0; } startTrialPicture;

# Blank and fixation screens
picture {background_color = 255,255,255;} white_screen;
picture {text {caption = "+"; font_color= 0,0,0; font_size=30; font = "Times New Roman";} fix_text; x = 0; y = 0; }  pic_fix;

# Placeholder for variables
bitmap {filename = "red.bmp";  description = "placeholder"; } placeholder;

############ Start fMRI Trial ####################
trial {
   picture startTrialPicture;
   time = 0;
   duration = next_picture;
   picture startTrialPicture;
   mri_pulse = 1;
   duration = 1000;
} startTrial;

################# Button Trial ################################
trial {
		all_responses = false;	           # Does not log all responses, only those during active events #
		trial_type = fixed;

	stimulus_event {
					picture white_screen;
					time = 0;
					duration = 245;
					code = "isi_blank";
					response_active = false;
					}isi_blank;

	stimulus_event {
					picture pic_fix;
					deltat = 245;
					duration = 245;
					code = "isi_fix";
					response_active = false;
					}isi_fix;

	stimulus_event {
					picture {
						bitmap placeholder;
						x = 0; y = 0;
					} word_stim;
					deltat = 245;
					duration = 495;
					code = "word";
					response_active = false;
					}word_event;

} word_trial;

################# Baseline ################################
trial {
		all_responses = false;	           # Does not log all responses, only those during active events #
		trial_type = fixed;

	stimulus_event {
					picture {
						bitmap placeholder;
						x = 0; y = 0;
					} rest_stim;
					time = 0;
					duration = 15995;
					code = "rest";
					response_active = false;
					}rest_event;

} rest_trial;

################################## START PCL ####################################

begin_pcl;

############# DECLARATIONS ##############

int start_time = clock.time();

string subnr = logfile.subject();
output_file output = new output_file;
output.open( "VWFA_Localizer_16s_" + subnr + "_output.txt" );
output.print(start_time);output.print("\n");

string word = "";
int isi = 0;
int j = 1;
int k = 1;
int m = 1;
int c = 1;
int r = 1;

string baseline = "0";
string nederlands = "1";
string china = "2";

###############################################################################

### START OF THE TRIALS LOOPS ###

###################
sub condition1 begin

output.print( "block\ttrialnr\tword\n" );

int trial_number = 1;

#dutch.shuffle();

loop j = 1 until j > 16  begin;

		word_stim.set_part( 1, dutch[k] );

		word = dutch[k].description();

		word_event.set_event_code(nederlands);

		word_trial.present();

		output.print("dutch");output.print("\t");
		output.print(trial_number);output.print("\t");
		output.print(word);output.print("\n");

		trial_number = trial_number + 1;

		k = k + 1;

		j = j + 1;
		end;

	# Baseline block

		rest_event.set_event_code(baseline);

		rest_stim.set_part( 1, rest[1] );
		rest_trial.present();

end;

###################
sub condition2 begin

output.print( "block\ttrialnr\tword\n" );

int trial_number = 1;

#chinese.shuffle();

loop j = 1 until j > 16  begin;

		word_stim.set_part( 1, chinese[c] );

		word = chinese[c].description();

		word_event.set_event_code(china);

		word_trial.present();

		output.print("chinese");output.print("\t");
		output.print(trial_number);output.print("\t");
		output.print(word);output.print("\n");

		trial_number = trial_number + 1;

		c = c + 1;

		j = j + 1;
		end;

	# Baseline block

		rest_event.set_event_code(baseline);

		rest_stim.set_part( 1, rest[1] );
		rest_trial.present();

end;

######### Define subject conditions
preset int subjectCondition = 1;

array <int> conditions [18] =
{1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2,1,2};

if subjectCondition == 1 then

		dutch.shuffle();
		chinese.shuffle();

		startTrial.present();

		# Begin with rest - Baseline block

		rest_event.set_event_code(baseline);
		rest_event.set_duration(17995);

		rest_stim.set_part( 1, rest[1] );
		rest_trial.present();

		loop k = 1 until k > dutch.count() begin;
		loop c = 1 until c > chinese.count() begin;

		loop r = 1 until r > conditions.count() begin;
		# 32 seconds each * 18 = 576 s = 9.6 minutes

			if conditions[r] == 1
			then condition1();
			elseif conditions[r] == 2
			then condition2();
			end;

		r=r+1;

		end;

		end;
		end;

		int end_time = clock.time();
		output.print(end_time);output.print("\n");

end;


These two tests are now ported to cppunit.

Change-Id: Ifce4c2a6f0f81a9b206795d915cac6705087c2d1

# i84653 -o sc.ScPageObj
# i84554 -o sc.AccessibleEditableTextPara_PreviewNote
# i88241 -o sc.AccessibleEditableTextPara_HeaderFooter
-o sc.AccessibleEditableTextPara_PreviewCell
-o sc.ScAccessibleCell
# i91044 -o sc.ScAccessibleCsvCell
# i91044 -o sc.ScAccessibleCsvGrid
# i84641 -o sc.ScAccessibleCsvRuler
# i88330 -o sc.ScAccessibleDocument
# i91045 -o sc.ScAccessibleDocumentPagePreview
-o sc.ScAccessiblePageHeader
-o sc.ScAccessiblePageHeaderArea
-o sc.ScAccessiblePreviewCell
-o sc.ScAccessiblePreviewHeaderCell
-o sc.ScAccessiblePreviewTable
# fdo#45337 -o sc.ScAccessibleSpreadsheet
-o sc.ScAnnotationObj
-o sc.ScAnnotationShapeObj
-o sc.ScAnnotationsObj
-o sc.ScAreaLinkObj
-o sc.ScAreaLinksObj
-o sc.ScAutoFormatFieldObj
-o sc.ScAutoFormatObj
-o sc.ScAutoFormatsObj
-o sc.ScCellCursorObj
# ported to cppunit -o sc.ScCellFieldObj
-o sc.ScCellFieldsObj
-o sc.ScCellFormatsEnumeration
-o sc.ScCellFormatsObj
-o sc.ScCellObj
-o sc.ScCellRangeObj
-o sc.ScCellRangesObj
-o sc.ScCellSearchObj
-o sc.ScCellTextCursor
-o sc.ScCellsEnumeration
-o sc.ScCellsObj
-o sc.ScChartObj
-o sc.ScChartsObj
-o sc.ScConsolidationDescriptor
-o sc.ScDDELinkObj
-o sc.ScDDELinksObj
-o sc.ScDataPilotFieldGroupItemObj
-o sc.ScDataPilotFieldGroupObj
-o sc.ScDataPilotFieldGroupsObj
-o sc.ScDataPilotFieldObj
-o sc.ScDataPilotFieldsObj
-o sc.ScDataPilotItemObj
-o sc.ScDataPilotItemsObj
-o sc.ScDataPilotTableObj
-o sc.ScDataPilotTablesObj
-o sc.ScDatabaseRangeObj
# -o sc.ScDatabaseRangesObj
-o sc.ScDocumentConfiguration
-o sc.ScDrawPageObj
-o sc.ScDrawPagesObj
-o sc.ScFilterDescriptorBase
-o sc.ScFunctionListObj
# ported to cppunit -o sc.ScHeaderFieldObj
-o sc.ScHeaderFieldsObj
-o sc.ScHeaderFooterContentObj
-o sc.ScHeaderFooterTextCursor
-o sc.ScHeaderFooterTextObj
-o sc.ScIndexEnumeration_CellAnnotationsEnumeration
-o sc.ScIndexEnumeration_CellAreaLinksEnumeration
-o sc.ScIndexEnumeration_DDELinksEnumeration
-o sc.ScIndexEnumeration_DataPilotFieldsEnumeration
-o sc.ScIndexEnumeration_DataPilotItemsEnumeration
-o sc.ScIndexEnumeration_DataPilotTablesEnumeration
-o sc.ScIndexEnumeration_DatabaseRangesEnumeration
-o sc.ScIndexEnumeration_FunctionDescriptionEnumeration
-o sc.ScIndexEnumeration_LabelRangesEnumeration
-o sc.ScIndexEnumeration_NamedRangesEnumeration
-o sc.ScIndexEnumeration_ScenariosEnumeration
-o sc.ScIndexEnumeration_SheetCellRangesEnumeration
-o sc.ScIndexEnumeration_SheetLinksEnumeration
-o sc.ScIndexEnumeration_SpreadsheetViewPanesEnumeration
-o sc.ScIndexEnumeration_SpreadsheetsEnumeration
-o sc.ScIndexEnumeration_SubTotalFieldsEnumeration
-o sc.ScIndexEnumeration_TableAutoFormatEnumeration
-o sc.ScIndexEnumeration_TableChartsEnumeration
-o sc.ScIndexEnumeration_TableColumnsEnumeration
-o sc.ScIndexEnumeration_TableConditionalEntryEnumeration
# fdo#45337 -o sc.ScIndexEnumeration_TableRowsEnumeration
-o sc.ScIndexEnumeration_TextFieldEnumeration
-o sc.ScLabelRangeObj
-o sc.ScLabelRangesObj
-o sc.ScModelObj
-o sc.ScNamedRangeObj
-o sc.ScNamedRangesObj
-o sc.ScRecentFunctionsObj
# -o sc.ScScenariosObj
# -o sc.ScShapeObj
# -o sc.ScSheetLinkObj
-o sc.ScSheetLinksObj
-o sc.ScSpreadsheetSettings
-o sc.ScSpreadsheetSettingsObj
-o sc.ScStyleFamiliesObj
-o sc.ScStyleFamilyObj
# -o sc.ScStyleObj
-o sc.ScSubTotalDescriptorBase
-o sc.ScSubTotalFieldObj
# # i84656 -o sc.ScTabViewObj
# -o sc.ScTableColumnObj
-o sc.ScTableColumnsObj
-o sc.ScTableConditionalEntry
-o sc.ScTableConditionalFormat
# -o sc.ScTableRowObj
-o sc.ScTableRowsObj
# -o sc.ScTableSheetObj
-o sc.ScUniqueCellFormatsEnumeration
-o sc.ScUniqueCellFormatsObj
# -o sc.ScTableSheetsObj
-o sc.ScTableValidationObj
#-o sc.ScViewPaneObj
# #i89411 -o sc.XMLContentExporter
# #i89411 -o sc.XMLContentImporter
# #i89411 -o sc.XMLExporter
# #i89411 -o sc.XMLImporter
# #i89411 -o sc.XMLMetaExporter
# #i89411 -o sc.XMLMetaImporter
-o sc.XMLSettingsExporter
-o sc.XMLSettingsImporter
-o sc.XMLStylesExporter
-o sc.XMLStylesImporter
-o sc.XMLExporter

# i84653 -o sc.ScPageObj
# i84554 -o sc.AccessibleEditableTextPara_PreviewNote
# i88241 -o sc.AccessibleEditableTextPara_HeaderFooter
-o sc.AccessibleEditableTextPara_PreviewCell
-o sc.ScAccessibleCell
# i91044 -o sc.ScAccessibleCsvCell
# i91044 -o sc.ScAccessibleCsvGrid
# i84641 -o sc.ScAccessibleCsvRuler
# i88330 -o sc.ScAccessibleDocument
# i91045 -o sc.ScAccessibleDocumentPagePreview
-o sc.ScAccessiblePageHeader
-o sc.ScAccessiblePageHeaderArea
-o sc.ScAccessiblePreviewCell
-o sc.ScAccessiblePreviewHeaderCell
-o sc.ScAccessiblePreviewTable
# fdo#45337 -o sc.ScAccessibleSpreadsheet
-o sc.ScAnnotationObj
-o sc.ScAnnotationShapeObj
-o sc.ScAnnotationsObj
-o sc.ScAreaLinkObj
-o sc.ScAreaLinksObj
-o sc.ScAutoFormatFieldObj
-o sc.ScAutoFormatObj
-o sc.ScAutoFormatsObj
-o sc.ScCellCursorObj
# TODO crash on exit. -o sc.ScCellFieldObj
-o sc.ScCellFieldsObj
-o sc.ScCellFormatsEnumeration
-o sc.ScCellFormatsObj
-o sc.ScCellObj
-o sc.ScCellRangeObj
-o sc.ScCellRangesObj
-o sc.ScCellSearchObj
-o sc.ScCellTextCursor
-o sc.ScCellsEnumeration
-o sc.ScCellsObj
-o sc.ScChartObj
-o sc.ScChartsObj
-o sc.ScConsolidationDescriptor
-o sc.ScDDELinkObj
-o sc.ScDDELinksObj
-o sc.ScDataPilotFieldGroupItemObj
-o sc.ScDataPilotFieldGroupObj
-o sc.ScDataPilotFieldGroupsObj
-o sc.ScDataPilotFieldObj
-o sc.ScDataPilotFieldsObj
-o sc.ScDataPilotItemObj
-o sc.ScDataPilotItemsObj
-o sc.ScDataPilotTableObj
-o sc.ScDataPilotTablesObj
-o sc.ScDatabaseRangeObj
# -o sc.ScDatabaseRangesObj
-o sc.ScDocumentConfiguration
-o sc.ScDrawPageObj
-o sc.ScDrawPagesObj
-o sc.ScFilterDescriptorBase
-o sc.ScFunctionListObj
# TODO crash on exit -o sc.ScHeaderFieldObj
-o sc.ScHeaderFieldsObj
-o sc.ScHeaderFooterContentObj
-o sc.ScHeaderFooterTextCursor
-o sc.ScHeaderFooterTextObj
-o sc.ScIndexEnumeration_CellAnnotationsEnumeration
-o sc.ScIndexEnumeration_CellAreaLinksEnumeration
-o sc.ScIndexEnumeration_DDELinksEnumeration
-o sc.ScIndexEnumeration_DataPilotFieldsEnumeration
-o sc.ScIndexEnumeration_DataPilotItemsEnumeration
-o sc.ScIndexEnumeration_DataPilotTablesEnumeration
-o sc.ScIndexEnumeration_DatabaseRangesEnumeration
-o sc.ScIndexEnumeration_FunctionDescriptionEnumeration
-o sc.ScIndexEnumeration_LabelRangesEnumeration
-o sc.ScIndexEnumeration_NamedRangesEnumeration
-o sc.ScIndexEnumeration_ScenariosEnumeration
-o sc.ScIndexEnumeration_SheetCellRangesEnumeration
-o sc.ScIndexEnumeration_SheetLinksEnumeration
-o sc.ScIndexEnumeration_SpreadsheetViewPanesEnumeration
-o sc.ScIndexEnumeration_SpreadsheetsEnumeration
-o sc.ScIndexEnumeration_SubTotalFieldsEnumeration
-o sc.ScIndexEnumeration_TableAutoFormatEnumeration
-o sc.ScIndexEnumeration_TableChartsEnumeration
-o sc.ScIndexEnumeration_TableColumnsEnumeration
-o sc.ScIndexEnumeration_TableConditionalEntryEnumeration
# fdo#45337 -o sc.ScIndexEnumeration_TableRowsEnumeration
-o sc.ScIndexEnumeration_TextFieldEnumeration
-o sc.ScLabelRangeObj
-o sc.ScLabelRangesObj
-o sc.ScModelObj
-o sc.ScNamedRangeObj
-o sc.ScNamedRangesObj
-o sc.ScRecentFunctionsObj
# -o sc.ScScenariosObj
# -o sc.ScShapeObj
# -o sc.ScSheetLinkObj
-o sc.ScSheetLinksObj
-o sc.ScSpreadsheetSettings
-o sc.ScSpreadsheetSettingsObj
-o sc.ScStyleFamiliesObj
-o sc.ScStyleFamilyObj
# -o sc.ScStyleObj
-o sc.ScSubTotalDescriptorBase
-o sc.ScSubTotalFieldObj
# # i84656 -o sc.ScTabViewObj
# -o sc.ScTableColumnObj
-o sc.ScTableColumnsObj
-o sc.ScTableConditionalEntry
-o sc.ScTableConditionalFormat
# -o sc.ScTableRowObj
-o sc.ScTableRowsObj
# -o sc.ScTableSheetObj
-o sc.ScUniqueCellFormatsEnumeration
-o sc.ScUniqueCellFormatsObj
# -o sc.ScTableSheetsObj
-o sc.ScTableValidationObj
#-o sc.ScViewPaneObj
# #i89411 -o sc.XMLContentExporter
# #i89411 -o sc.XMLContentImporter
# #i89411 -o sc.XMLExporter
# #i89411 -o sc.XMLImporter
# #i89411 -o sc.XMLMetaExporter
# #i89411 -o sc.XMLMetaImporter
-o sc.XMLSettingsExporter
-o sc.XMLSettingsImporter
-o sc.XMLStylesExporter
-o sc.XMLStylesImporter
-o sc.XMLExporter


INTEGRATION: CWS unoapi3 (1.3.48); FILE MERGED 2008/02/28 20:32:01 cn 1.3.48.1: #i84995 update lists with issues

#i86007 -o toolkit.AccessibleButton
-o toolkit.AccessibleCheckBox
#i86008 -o toolkit.AccessibleComboBox
-o toolkit.AccessibleDropDownComboBox
-o toolkit.AccessibleDropDownListBox
#i86110 -o toolkit.AccessibleEdit
-o toolkit.AccessibleFixedText
#i86110 -o toolkit.AccessibleList
#i86110 -o toolkit.AccessibleListBox
#i86110 -o toolkit.AccessibleListItem
-o toolkit.AccessibleMenu
-o toolkit.AccessibleMenuBar
#i86009 -o toolkit.AccessibleMenuItem
-o toolkit.AccessibleMenuSeparator
#i52607 -o toolkit.AccessiblePopupMenu
#i86107,i86110 -o toolkit.AccessibleRadioButton
-o toolkit.AccessibleScrollBar
-o toolkit.AccessibleStatusBar
-o toolkit.AccessibleStatusBarItem
-o toolkit.AccessibleTabControl
-o toolkit.AccessibleTabPage
#i86287 -o toolkit.AccessibleToolBox
-o toolkit.AccessibleToolBoxItem
-o toolkit.AccessibleWindow
-o toolkit.MutableTreeDataModel
-o toolkit.MutableTreeNode
-o toolkit.TabController
-o toolkit.TabControllerModel
#i80788 -o toolkit.Toolkit
-o toolkit.UnoControlButton
-o toolkit.UnoControlButtonModel
-o toolkit.UnoControlCheckBox
-o toolkit.UnoControlCheckBoxModel
-o toolkit.UnoControlComboBox
-o toolkit.UnoControlComboBoxModel
-o toolkit.UnoControlContainer
-o toolkit.UnoControlContainerModel
-o toolkit.UnoControlCurrencyField
-o toolkit.UnoControlCurrencyFieldModel
-o toolkit.UnoControlDateField
-o toolkit.UnoControlDateFieldModel
#i80788 -o toolkit.UnoControlDialog
-o toolkit.UnoControlDialogModel
-o toolkit.UnoControlEdit
-o toolkit.UnoControlEditModel
#i86011 -o toolkit.UnoControlFileControl
-o toolkit.UnoControlFileControlModel
-o toolkit.UnoControlFixedLineModel
-o toolkit.UnoControlFixedText
-o toolkit.UnoControlFixedTextModel
#i86013 -o toolkit.UnoControlFormattedField
-o toolkit.UnoControlFormattedFieldModel
-o toolkit.UnoControlGroupBox
-o toolkit.UnoControlGroupBoxModel
-o toolkit.UnoControlImageControl
-o toolkit.UnoControlImageControlModel
#i86019 -o toolkit.UnoControlListBox
-o toolkit.UnoControlListBoxModel
-o toolkit.UnoControlNumericField
-o toolkit.UnoControlNumericFieldModel
-o toolkit.UnoControlPatternField
-o toolkit.UnoControlPatternFieldModel
-o toolkit.UnoControlProgressBarModel
-o toolkit.UnoControlRadioButton
-o toolkit.UnoControlRadioButtonModel
-o toolkit.UnoControlScrollBarModel
-o toolkit.UnoControlTimeField
-o toolkit.UnoControlTimeFieldModel
-o toolkit.UnoScrollBarControl
#i86020 -o toolkit.UnoSimpleAnimationControl
#i86021 -o toolkit.UnoSimpleAnimationControlModel
-o toolkit.UnoSpinButtonControl
-o toolkit.UnoSpinButtonControlModel
#i86022 -o toolkit.UnoThrobberControl
#i86023 -o toolkit.UnoThrobberControlModel
#i86298 -o toolkit.UnoTreeControl
-o toolkit.UnoTreeModel

#-o toolkit.AccessibleButton
#-o toolkit.AccessibleCheckBox
#-o toolkit.AccessibleComboBox
#-o toolkit.AccessibleDropDownComboBox
-o toolkit.AccessibleDropDownListBox
#-o toolkit.AccessibleEdit
-o toolkit.AccessibleFixedText
-o toolkit.AccessibleList
#-o toolkit.AccessibleListBox
#-o toolkit.AccessibleListItem
#-o toolkit.AccessibleMenu
#-o toolkit.AccessibleMenuBar
#-o toolkit.AccessibleMenuItem
#-o toolkit.AccessibleMenuSeparator
#-o toolkit.AccessiblePopupMenu
#-o toolkit.AccessibleRadioButton
-o toolkit.AccessibleScrollBar
-o toolkit.AccessibleStatusBar
#-o toolkit.AccessibleStatusBarItem
#-o toolkit.AccessibleTabControl
-o toolkit.AccessibleTabPage
#-o toolkit.AccessibleToolBox
#-o toolkit.AccessibleToolBoxItem
-o toolkit.AccessibleWindow
-o toolkit.MutableTreeDataModel
-o toolkit.MutableTreeNode
-o toolkit.TabController
-o toolkit.TabControllerModel
#-o toolkit.Toolkit
#-o toolkit.UnoControlButton
-o toolkit.UnoControlButtonModel
#-o toolkit.UnoControlCheckBox
-o toolkit.UnoControlCheckBoxModel
#-o toolkit.UnoControlComboBox
#-o toolkit.UnoControlComboBoxModel
-o toolkit.UnoControlContainer
#-o toolkit.UnoControlContainerModel
#-o toolkit.UnoControlCurrencyField
#-o toolkit.UnoControlCurrencyFieldModel
#-o toolkit.UnoControlDateField
#-o toolkit.UnoControlDateFieldModel -> FREEZE in awt.XControlContainer
#-o toolkit.UnoControlDialog
-o toolkit.UnoControlDialogModel
# -o toolkit.UnoControlEdit
-o toolkit.UnoControlEditModel
#-o toolkit.UnoControlFileControl
-o toolkit.UnoControlFileControlModel
-o toolkit.UnoControlFixedLineModel
#-o toolkit.UnoControlFixedText
#-o toolkit.UnoControlFixedTextModel
#-o toolkit.UnoControlFormattedField
#-o toolkit.UnoControlFormattedFieldModel
#-o toolkit.UnoControlGroupBox
-o toolkit.UnoControlGroupBoxModel
#-o toolkit.UnoControlImageControl
-o toolkit.UnoControlImageControlModel
#-o toolkit.UnoControlListBox
-o toolkit.UnoControlListBoxModel
#-o toolkit.UnoControlNumericField
-o toolkit.UnoControlNumericFieldModel
#-o toolkit.UnoControlPatternField
-o toolkit.UnoControlPatternFieldModel
-o toolkit.UnoControlProgressBarModel
#-o toolkit.UnoControlRadioButton
-o toolkit.UnoControlRadioButtonModel
-o toolkit.UnoControlScrollBarModel
#-o toolkit.UnoControlTimeField
-o toolkit.UnoControlTimeFieldModel
#-o toolkit.UnoScrollBarControl
#-o toolkit.UnoSimpleAnimationControl
#-o toolkit.UnoSimpleAnimationControlModel
#-o toolkit.UnoSpinButtonControl
-o toolkit.UnoSpinButtonControlModel
#-o toolkit.UnoThrobberControl
#-o toolkit.UnoThrobberControlModel
-o toolkit.UnoTreeControl
-o toolkit.UnoTreeModel


INTEGRATION: CWS unoapi2 (1.3.6); FILE MERGED 2007/12/10 17:28:46 cn 1.3.6.2: #i83871# update lists 2007/12/10 16:48:31 cn 1.3.6.1: #i83871# update lists

-o lng.LinguProps
-o lng.LngSvcMgr
-o lng.DicList

-o lng.DicList
-o lng.LinguProps
#-o lng.LngSvcMgr


Change type of message to messagebox

Change type of message to messagebox

function continueSimulation=pre_xcos_simulate(scs_m, needcompile)
    global %microdaq;
    %microdaq.private.has_mdaq_block = %F;
    continueSimulation = %T;
    look_for_mdaq_blocks = %T;
    runFromMainScheme = %F;

    for i = 1:size(scs_m.objs)
        curObj= scs_m.objs(i);
        if (typeof(curObj) == "Block" & curObj.gui == "mdaq_setup")
            runFromMainScheme = %T;

            if scs_m.objs(i).model.rpar(1) == (-1) then
                scs_m.props.tf= 1.000D+12;
            else
                scs_m.props.tf=scs_m.objs(i).model.rpar(1);
            end

            // if model has microdaq block set real-time scaling to 1
            tmp = scs_m;

            perform_scan(tmp);
            if %microdaq.private.has_mdaq_block then
                scs_m.props.tol(5) = 1;
            end

            if %microdaq.dsp_loaded == %T then
                look_for_mdaq_blocks = %F;
                // if dsp is loaded set real-time scaling to 1
                scs_m.props.tol(5) = 1;

                [mdaq_ip_addr, result] = mdaq_get_ip();
                if result < 0 then
                    disp("Unable to get MicroDAQ IP address - run microdaq_setup!");
                    continueSimulation = %F;
                    %microdaq.dsp_loaded = %F;
                    break;
                end

                result = client_connect(mdaq_ip_addr, 4344);
                if result < 0 then
                    con = mdaq_open();
                    result = mlink_set_obj(con, "ext_mode", 1);
                    mdaq_close(con);
                    if result == -25 then
                        message("ERROR: Unable to connect - your are running model in Standalone mode!");
                    else
                        message("ERROR: Unable to connect to MicroDAQ - reboot device!")
                        %microdaq.dsp_loaded = %F;
                    end
                    continueSimulation = %F;
                    break;
                end
                disp('### Starting model in Ext mode...');

                perform_scan(tmp);
                if %microdaq.private.has_mdaq_param_sim then
                    result = mdaq_open();
                    if result > -1 then
                        %microdaq.private.connection_id = result;
                    else
                        message("ERROR: Unable to connect to MicroDAQ device!");
                        continueSimulation = %F;
                        %microdaq.private.connection_id = -1;
                    end
                end
            end
        end
    end

    if runFromMainScheme == %F then
        messagebox("Please start model from root diagram (the one which contains mdaq_setup block).");
        continueSimulation = %F;
        return;
    end

    if look_for_mdaq_blocks then
        tmp = scs_m;
        perform_scan(tmp);
        if %microdaq.private.has_mdaq_block then
            disp("### Running model in simulation mode... ")
            result = mdaq_open();
            if result > -1 then
                %microdaq.private.connection_id = result;
            else
                message("ERROR: Unable to connect to MicroDAQ device!");
                continueSimulation = %F;
                %microdaq.private.connection_id = -1;
            end
        end

        %microdaq.private.mdaq_signal_id = 0;
    end

    scs_m=resume(scs_m)
endfunction

function continueSimulation=pre_xcos_simulate(scs_m, needcompile)
    global %microdaq;
    %microdaq.private.has_mdaq_block = %F;
    continueSimulation = %T;
    look_for_mdaq_blocks = %T;
    runFromMainScheme = %F;

    for i = 1:size(scs_m.objs)
        curObj= scs_m.objs(i);
        if (typeof(curObj) == "Block" & curObj.gui == "mdaq_setup")
            runFromMainScheme = %T;

            if scs_m.objs(i).model.rpar(1) == (-1) then
                scs_m.props.tf= 1.000D+12;
            else
                scs_m.props.tf=scs_m.objs(i).model.rpar(1);
            end

            // if model has microdaq block set real-time scaling to 1
            tmp = scs_m;

            perform_scan(tmp);
            if %microdaq.private.has_mdaq_block then
                scs_m.props.tol(5) = 1;
            end

            if %microdaq.dsp_loaded == %T then
                look_for_mdaq_blocks = %F;
                // if dsp is loaded set real-time scaling to 1
                scs_m.props.tol(5) = 1;

                [mdaq_ip_addr, result] = mdaq_get_ip();
                if result < 0 then
                    disp("Unable to get MicroDAQ IP address - run microdaq_setup!");
                    continueSimulation = %F;
                    %microdaq.dsp_loaded = %F;
                    break;
                end

                result = client_connect(mdaq_ip_addr, 4344);
                if result < 0 then
                    con = mdaq_open();
                    result = mlink_set_obj(con, "ext_mode", 1);
                    mdaq_close(con);
                    if result == -25 then
                        message("ERROR: Unable to connect - your are running model in Standalone mode!");
                    else
                        message("ERROR: Unable to connect to MicroDAQ - reboot device!")
                        %microdaq.dsp_loaded = %F;
                    end
                    continueSimulation = %F;
                    break;
                end
                disp('### Starting model in Ext mode...');

                perform_scan(tmp);
                if %microdaq.private.has_mdaq_param_sim then
                    result = mdaq_open();
                    if result > -1 then
                        %microdaq.private.connection_id = result;
                    else
                        message("ERROR: Unable to connect to MicroDAQ device!");
                        continueSimulation = %F;
                        %microdaq.private.connection_id = -1;
                    end
                end
            end
        end
    end

    if runFromMainScheme == %F then
        disp("Please start model from root diagram (the one which contains mdaq_setup block).");
        continueSimulation = %F;
        return;
    end

    if look_for_mdaq_blocks then
        tmp = scs_m;
        perform_scan(tmp);
        if %microdaq.private.has_mdaq_block then
            disp("### Running model in simulation mode... ")
            result = mdaq_open();
            if result > -1 then
                %microdaq.private.connection_id = result;
            else
                message("ERROR: Unable to connect to MicroDAQ device!");
                continueSimulation = %F;
                %microdaq.private.connection_id = -1;
            end
        end

        %microdaq.private.mdaq_signal_id = 0;
    end

    scs_m=resume(scs_m)
endfunction


Fixed variable typo

Fixed variable typo

function result = mdaq_get_file_data(filename, filetype, rows, cols)
    result = [];

    if (argn(2) > 4 | argn(2) < 2) | (filetype == 2 & argn(2) <> 4) then
        mprintf("Description:\n");
        mprintf("\tReads data from file created with MicroDAQ ''To File'' block\n");
        mprintf("Usage:\n");
        mprintf("\tmdaq_get_file_data(name, type, rows, cols);\n")
        mprintf("\tname - name of file from user-disk/dsp/data\n");
        mprintf("\ttype - (1 - text | 2 - binary)\n");
        mprintf("\trows - number of rows (optinal for text filetype)\n");
        mprintf("\tcols - number of rows (optinal for text filetype)\n");
        return;
    end

    [mdaq_ip_address, res] = mdaq_get_ip();
    if res < 0 then
        disp("ERROR: Unable to get IP address!")
        return;
    end
    tmp_file = getURL('http://' + mdaq_ip_address + '/user-disk/dsp/data/' + filename, TMPDIR);

    if isfile(tmp_file) then
        if filetype == 1 then
            result = fscanfMat(tmp_file);
            if argn(2) == 4 then
                nrows = rows;
                if nrows > size(result, 1) then
                    nrows = size(result, 1);
                end
                ncols = cols;
                if ncols > size(result, 2) then
                    ncols = size(result, 2)
                end
                result = resize_matrix(result, nrows, ncols);
            end

        elseif filetype == 2 then
            fd1 = mopen(tmp_file,'rb');
            data_count = rows*cols;
            data = mget(rows*cols,'d',fd1);

            if size(data, 2) < data_count then
                //disp("ERROR: !");
                data_count = size(data, 2);
            end

            for i=1:cols
                result = [result; data(i:cols:data_count)];
            end
            result = result';
            mclose(fd1)
        else
            disp("ERROR: Invalid filetype! (1 - text, 2 - binary)");
        end
        mdelete(tmp_file);
    else
        disp("ERROR: File not found!");
    end

endfunction

function result = mdaq_get_file_data(filename, filetype, rows, cols)
    result = [];

    if (argn(2) > 4 | argn(2) < 2) | (filetype == 2 & argn(2) <> 4) then
        mprintf("Description:\n");
        mprintf("\tReads data from file created with MicroDAQ ''To File'' block\n");
        mprintf("Usage:\n");
        mprintf("\tmdaq_get_file_data(name, type, rows, cols);\n")
        mprintf("\tname - name of file from user-disk/dsp/data\n");
        mprintf("\ttype - (1 - text | 2 - binary)\n");
        mprintf("\trows - number of rows (optinal for text filetype)\n");
        mprintf("\tcols - number of rows (optinal for text filetype)\n");
        return;
    end

    [mdaq_ip_address, res] = mdaq_get_ip();
    if res < 0 then
        disp("ERROR: Unable to get IP address!")
        return;
    end
    tmp_file = getURL('http://' + mdaq_ip_address + '/user-disk/dsp/data/' + filename, TMPDIR);

    if isfile(tmp_file) then
        if filetype == 1 then
            result = fscanfMat(tmp_file);
            if argn(2) == 4 then
                nrows = rows;
                if nrows > size(result, 1) then
                    nrwos = size(result, 1);
                end
                ncols = cols;
                if ncols > size(result, 2) then
                    ncols = size(result, 2)
                end
                result = resize_matrix(result, nrows, ncols);
            end

        elseif filetype == 2 then
            fd1 = mopen(tmp_file,'rb');
            data_count = rows*cols;
            data = mget(rows*cols,'d',fd1);

            if size(data, 2) < data_count then
                //disp("ERROR: !");
                data_count = size(data, 2);
            end

            for i=1:cols
                result = [result; data(i:cols:data_count)];
            end
            result = result';
            mclose(fd1)
        else
            disp("ERROR: Invalid filetype! (1 - text, 2 - binary)");
        end
        mdelete(tmp_file);
    else
        disp("ERROR: File not found!");
    end

endfunction


tdf#55065 try to re-enable the test

tdf#55065 try to re-enable the test

It works for me at least.

Change-Id: Ib4128ace7b218d55a72dddd50666fe75faee7d34

#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This file incorporates work covered by the following license notice:
#
#   Licensed to the Apache Software Foundation (ASF) under one or more
#   contributor license agreements. See the NOTICE file distributed
#   with this work for additional information regarding copyright
#   ownership. The ASF licenses this file to you under the Apache
#   License, Version 2.0 (the "License"); you may not use this file
#   except in compliance with the License. You may obtain a copy of
#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
# fdo#FOO -o sc.ScAccessiblePageHeaderArea
-o sc.ScAccessiblePreviewCell
-o sc.ScAccessiblePreviewHeaderCell
-o sc.ScAccessiblePreviewTable
# fdo#45337 -o sc.ScAccessibleSpreadsheet
# FIXME_REMOVE_WHEN_RE_BASE_COMPLETE
# -o sc.ScAnnotationObj
# -o sc.ScAnnotationShapeObj
-o sc.ScAnnotationsObj
-o sc.ScAreaLinkObj
-o sc.ScAreaLinksObj
-o sc.ScAutoFormatFieldObj
-o sc.ScAutoFormatObj
-o sc.ScAutoFormatsObj
-o sc.ScCellCursorObj
# ported to cppunit -o sc.ScCellFieldObj
-o sc.ScCellFieldsObj
-o sc.ScCellFormatsEnumeration
-o sc.ScCellFormatsObj
-o sc.ScCellObj

#
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This file incorporates work covered by the following license notice:
#
#   Licensed to the Apache Software Foundation (ASF) under one or more
#   contributor license agreements. See the NOTICE file distributed
#   with this work for additional information regarding copyright
#   ownership. The ASF licenses this file to you under the Apache
#   License, Version 2.0 (the "License"); you may not use this file
#   except in compliance with the License. You may obtain a copy of
#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
#
# fdo#FOO -o sc.ScAccessiblePageHeaderArea
-o sc.ScAccessiblePreviewCell
-o sc.ScAccessiblePreviewHeaderCell
-o sc.ScAccessiblePreviewTable
# fdo#45337 -o sc.ScAccessibleSpreadsheet
# FIXME_REMOVE_WHEN_RE_BASE_COMPLETE
# -o sc.ScAnnotationObj
# -o sc.ScAnnotationShapeObj
-o sc.ScAnnotationsObj
-o sc.ScAreaLinkObj
-o sc.ScAreaLinksObj
-o sc.ScAutoFormatFieldObj
-o sc.ScAutoFormatObj
-o sc.ScAutoFormatsObj
# fdo#55065 -o sc.ScCellCursorObj
# ported to cppunit -o sc.ScCellFieldObj
-o sc.ScCellFieldsObj
-o sc.ScCellFormatsEnumeration
-o sc.ScCellFormatsObj
-o sc.ScCellObj


sb120: #i111047# disabled failing tests for now

#i86007 -o toolkit.AccessibleButton
#i88332 -o toolkit.AccessibleCheckBox
#i86008 -o toolkit.AccessibleComboBox
-o toolkit.AccessibleDropDownComboBox
-o toolkit.AccessibleDropDownListBox
#i86110 -o toolkit.AccessibleEdit
-o toolkit.AccessibleFixedText
#i86110 -o toolkit.AccessibleList
#i86110 -o toolkit.AccessibleListBox
#i86110 -o toolkit.AccessibleListItem
#i111047# -o toolkit.AccessibleMenu
#i111047# -o toolkit.AccessibleMenuBar
#i86009 -o toolkit.AccessibleMenuItem
#i111047# -o toolkit.AccessibleMenuSeparator
#i52607 -o toolkit.AccessiblePopupMenu
#i86107,i86110 -o toolkit.AccessibleRadioButton
-o toolkit.AccessibleScrollBar
-o toolkit.AccessibleStatusBar
-o toolkit.AccessibleStatusBarItem
#i109643 -o toolkit.AccessibleTabControl
#i109643 -o toolkit.AccessibleTabPage
#i86287 -o toolkit.AccessibleToolBox
#i88605 -o toolkit.AccessibleToolBoxItem
-o toolkit.AccessibleWindow
-o toolkit.MutableTreeDataModel
-o toolkit.MutableTreeNode
-o toolkit.TabController
-o toolkit.TabControllerModel
-o toolkit.Toolkit
-o toolkit.UnoControlButton
-o toolkit.UnoControlButtonModel
-o toolkit.UnoControlCheckBox
-o toolkit.UnoControlCheckBoxModel
-o toolkit.UnoControlComboBox
-o toolkit.UnoControlComboBoxModel
-o toolkit.UnoControlContainer
-o toolkit.UnoControlContainerModel
-o toolkit.UnoControlCurrencyField
-o toolkit.UnoControlCurrencyFieldModel
-o toolkit.UnoControlDateField
-o toolkit.UnoControlDateFieldModel
#allegedly was i80788, but still broken: -o toolkit.UnoControlDialog
-o toolkit.UnoControlDialogModel
-o toolkit.UnoControlEdit
-o toolkit.UnoControlEditModel
#i86011 -o toolkit.UnoControlFileControl
-o toolkit.UnoControlFileControlModel
-o toolkit.UnoControlFixedLineModel
-o toolkit.UnoControlFixedText
-o toolkit.UnoControlFixedTextModel
#i86013 -o toolkit.UnoControlFormattedField
-o toolkit.UnoControlFormattedFieldModel
-o toolkit.UnoControlGroupBox
-o toolkit.UnoControlGroupBoxModel
-o toolkit.UnoControlImageControl
-o toolkit.UnoControlImageControlModel
#i86019 -o toolkit.UnoControlListBox
-o toolkit.UnoControlListBoxModel
-o toolkit.UnoControlNumericField
-o toolkit.UnoControlNumericFieldModel
-o toolkit.UnoControlPatternField
-o toolkit.UnoControlPatternFieldModel
-o toolkit.UnoControlProgressBarModel
-o toolkit.UnoControlRadioButton
-o toolkit.UnoControlRadioButtonModel
-o toolkit.UnoControlScrollBarModel
-o toolkit.UnoControlTimeField
-o toolkit.UnoControlTimeFieldModel
-o toolkit.UnoScrollBarControl
#i86020 -o toolkit.UnoSimpleAnimationControl
#i86021 -o toolkit.UnoSimpleAnimationControlModel
-o toolkit.UnoSpinButtonControl
-o toolkit.UnoSpinButtonControlModel
#i86022 -o toolkit.UnoThrobberControl
#i86023 -o toolkit.UnoThrobberControlModel
#i86298 -o toolkit.UnoTreeControl
-o toolkit.UnoTreeModel

#i86007 -o toolkit.AccessibleButton
#i88332 -o toolkit.AccessibleCheckBox
#i86008 -o toolkit.AccessibleComboBox
-o toolkit.AccessibleDropDownComboBox
-o toolkit.AccessibleDropDownListBox
#i86110 -o toolkit.AccessibleEdit
-o toolkit.AccessibleFixedText
#i86110 -o toolkit.AccessibleList
#i86110 -o toolkit.AccessibleListBox
#i86110 -o toolkit.AccessibleListItem
-o toolkit.AccessibleMenu
-o toolkit.AccessibleMenuBar
#i86009 -o toolkit.AccessibleMenuItem
-o toolkit.AccessibleMenuSeparator
#i52607 -o toolkit.AccessiblePopupMenu
#i86107,i86110 -o toolkit.AccessibleRadioButton
-o toolkit.AccessibleScrollBar
-o toolkit.AccessibleStatusBar
-o toolkit.AccessibleStatusBarItem
#i109643 -o toolkit.AccessibleTabControl
#i109643 -o toolkit.AccessibleTabPage
#i86287 -o toolkit.AccessibleToolBox
#i88605 -o toolkit.AccessibleToolBoxItem
-o toolkit.AccessibleWindow
-o toolkit.MutableTreeDataModel
-o toolkit.MutableTreeNode
-o toolkit.TabController
-o toolkit.TabControllerModel
-o toolkit.Toolkit
-o toolkit.UnoControlButton
-o toolkit.UnoControlButtonModel
-o toolkit.UnoControlCheckBox
-o toolkit.UnoControlCheckBoxModel
-o toolkit.UnoControlComboBox
-o toolkit.UnoControlComboBoxModel
-o toolkit.UnoControlContainer
-o toolkit.UnoControlContainerModel
-o toolkit.UnoControlCurrencyField
-o toolkit.UnoControlCurrencyFieldModel
-o toolkit.UnoControlDateField
-o toolkit.UnoControlDateFieldModel
#allegedly was i80788, but still broken: -o toolkit.UnoControlDialog
-o toolkit.UnoControlDialogModel
-o toolkit.UnoControlEdit
-o toolkit.UnoControlEditModel
#i86011 -o toolkit.UnoControlFileControl
-o toolkit.UnoControlFileControlModel
-o toolkit.UnoControlFixedLineModel
-o toolkit.UnoControlFixedText
-o toolkit.UnoControlFixedTextModel
#i86013 -o toolkit.UnoControlFormattedField
-o toolkit.UnoControlFormattedFieldModel
-o toolkit.UnoControlGroupBox
-o toolkit.UnoControlGroupBoxModel
-o toolkit.UnoControlImageControl
-o toolkit.UnoControlImageControlModel
#i86019 -o toolkit.UnoControlListBox
-o toolkit.UnoControlListBoxModel
-o toolkit.UnoControlNumericField
-o toolkit.UnoControlNumericFieldModel
-o toolkit.UnoControlPatternField
-o toolkit.UnoControlPatternFieldModel
-o toolkit.UnoControlProgressBarModel
-o toolkit.UnoControlRadioButton
-o toolkit.UnoControlRadioButtonModel
-o toolkit.UnoControlScrollBarModel
-o toolkit.UnoControlTimeField
-o toolkit.UnoControlTimeFieldModel
-o toolkit.UnoScrollBarControl
#i86020 -o toolkit.UnoSimpleAnimationControl
#i86021 -o toolkit.UnoSimpleAnimationControlModel
-o toolkit.UnoSpinButtonControl
-o toolkit.UnoSpinButtonControlModel
#i86022 -o toolkit.UnoThrobberControl
#i86023 -o toolkit.UnoThrobberControlModel
#i86298 -o toolkit.UnoTreeControl
-o toolkit.UnoTreeModel


INTEGRATION: CWS unoapi1 (1.2.700); FILE MERGED 2007/07/11 13:04:10 cn 1.2.700.1: #i79479# update exclusion list

# -o xmloff.Chart.XMLContentExporter
# -o xmloff.Chart.XMLContentImporter
# -o xmloff.Chart.XMLExporter
# -o xmloff.Chart.XMLImporter
# -o xmloff.Chart.XMLStylesExporter
# -o xmloff.Chart.XMLStylesImporter
-o xmloff.Draw.XMLContentExporter
-o xmloff.Draw.XMLContentImporter
-o xmloff.Draw.XMLExporter
-o xmloff.Draw.XMLImporter
-o xmloff.Draw.XMLMetaExporter
-o xmloff.Draw.XMLMetaImporter
-o xmloff.Draw.XMLSettingsExporter
-o xmloff.Draw.XMLSettingsImporter
-o xmloff.Draw.XMLStylesExporter
-o xmloff.Draw.XMLStylesImporter
-o xmloff.Impress.XMLContentExporter
-o xmloff.Impress.XMLContentImporter
-o xmloff.Impress.XMLExporter
-o xmloff.Impress.XMLImporter
-o xmloff.Impress.XMLMetaExporter
-o xmloff.Impress.XMLMetaImporter
-o xmloff.Impress.XMLSettingsExporter
-o xmloff.Impress.XMLSettingsImporter
-o xmloff.Impress.XMLStylesExporter
-o xmloff.Impress.XMLStylesImporter

-o xmloff.Chart.XMLContentExporter
-o xmloff.Chart.XMLContentImporter
-o xmloff.Chart.XMLExporter
-o xmloff.Chart.XMLImporter
-o xmloff.Chart.XMLStylesExporter
-o xmloff.Chart.XMLStylesImporter
-o xmloff.Draw.XMLContentExporter
-o xmloff.Draw.XMLContentImporter
-o xmloff.Draw.XMLExporter
-o xmloff.Draw.XMLImporter
-o xmloff.Draw.XMLMetaExporter
-o xmloff.Draw.XMLMetaImporter
-o xmloff.Draw.XMLSettingsExporter
-o xmloff.Draw.XMLSettingsImporter
-o xmloff.Draw.XMLStylesExporter
-o xmloff.Draw.XMLStylesImporter
-o xmloff.Impress.XMLContentExporter
-o xmloff.Impress.XMLContentImporter
-o xmloff.Impress.XMLExporter
-o xmloff.Impress.XMLImporter
-o xmloff.Impress.XMLMetaExporter
-o xmloff.Impress.XMLMetaImporter
-o xmloff.Impress.XMLSettingsExporter
-o xmloff.Impress.XMLSettingsImporter
-o xmloff.Impress.XMLStylesExporter
-o xmloff.Impress.XMLStylesImporter


INTEGRATION: CWS calcuno01 (1.4.26); FILE MERGED 2005/03/14 13:08:52 sw 1.4.26.1: #i23114#

### 114242 ### -o sc.ScPageObj
### 111147 ### -o sc.AccessibleEditableTextPara_PreviewNote
-o sc.AccessibleEditableTextPara_HeaderFooter
-o sc.AccessibleEditableTextPara_PreviewCell
-o sc.ScAccessibleCell
-o sc.ScAccessibleCsvCell
-o sc.ScAccessibleCsvGrid
-o sc.ScAccessibleCsvRuler
-o sc.ScAccessibleDocument
-o sc.ScAccessiblePageHeader
-o sc.ScAccessiblePageHeaderArea
-o sc.ScAccessiblePreviewCell
-o sc.ScAccessiblePreviewHeaderCell
-o sc.ScAccessiblePreviewTable
-o sc.ScAccessibleSpreadsheet
-o sc.ScAnnotationObj
-o sc.ScAnnotationShapeObj
-o sc.ScAnnotationsObj
-o sc.ScAreaLinkObj
-o sc.ScAreaLinksObj
-o sc.ScAutoFormatFieldObj
-o sc.ScAutoFormatObj
-o sc.ScAutoFormatsObj
-o sc.ScCellCursorObj
-o sc.ScCellFieldObj
-o sc.ScCellFieldsObj
-o sc.ScCellFormatsEnumeration
-o sc.ScCellFormatsObj
-o sc.ScCellObj
-o sc.ScCellRangeObj
-o sc.ScCellRangesObj
-o sc.ScCellSearchObj
-o sc.ScCellTextCursor
-o sc.ScCellsEnumeration
-o sc.ScCellsObj
-o sc.ScChartObj
-o sc.ScChartsObj
-o sc.ScConsolidationDescriptor
-o sc.ScDDELinkObj
-o sc.ScDDELinksObj
-o sc.ScDataPilotFieldObj
-o sc.ScDataPilotFieldsObj
-o sc.ScDataPilotItemObj
-o sc.ScDataPilotItemsObj
-o sc.ScDataPilotTableObj
-o sc.ScDataPilotTablesObj
-o sc.ScDatabaseRangeObj
-o sc.ScDatabaseRangesObj
-o sc.ScDocumentConfiguration
-o sc.ScDrawPageObj
-o sc.ScDrawPagesObj
-o sc.ScFilterDescriptorBase
-o sc.ScFunctionListObj
-o sc.ScHeaderFieldObj
-o sc.ScHeaderFieldsObj
-o sc.ScHeaderFooterContentObj
-o sc.ScHeaderFooterTextCursor
-o sc.ScHeaderFooterTextObj
-o sc.ScIndexEnumeration_CellAnnotationsEnumeration
-o sc.ScIndexEnumeration_CellAreaLinksEnumeration
-o sc.ScIndexEnumeration_DDELinksEnumeration
-o sc.ScIndexEnumeration_DataPilotFieldsEnumeration
-o sc.ScIndexEnumeration_DataPilotItemsEnumeration
-o sc.ScIndexEnumeration_DataPilotTablesEnumeration
-o sc.ScIndexEnumeration_DatabaseRangesEnumeration
-o sc.ScIndexEnumeration_FunctionDescriptionEnumeration
-o sc.ScIndexEnumeration_LabelRangesEnumeration
-o sc.ScIndexEnumeration_NamedRangesEnumeration
-o sc.ScIndexEnumeration_ScenariosEnumeration
-o sc.ScIndexEnumeration_SheetCellRangesEnumeration
-o sc.ScIndexEnumeration_SheetLinksEnumeration
-o sc.ScIndexEnumeration_SpreadsheetViewPanesEnumeration
-o sc.ScIndexEnumeration_SpreadsheetsEnumeration
-o sc.ScIndexEnumeration_SubTotalFieldsEnumeration
-o sc.ScIndexEnumeration_TableAutoFormatEnumeration
-o sc.ScIndexEnumeration_TableChartsEnumeration
-o sc.ScIndexEnumeration_TableColumnsEnumeration
-o sc.ScIndexEnumeration_TableConditionalEntryEnumeration
-o sc.ScIndexEnumeration_TableRowsEnumeration
-o sc.ScIndexEnumeration_TextFieldEnumeration
-o sc.ScLabelRangeObj
-o sc.ScLabelRangesObj
-o sc.ScModelObj
-o sc.ScNamedRangeObj
-o sc.ScNamedRangesObj
-o sc.ScRecentFunctionsObj
-o sc.ScScenariosObj
-o sc.ScShapeObj
-o sc.ScSheetLinkObj
-o sc.ScSheetLinksObj
-o sc.ScSpreadsheetSettings
-o sc.ScSpreadsheetSettingsObj
-o sc.ScStyleFamiliesObj
-o sc.ScStyleFamilyObj
-o sc.ScStyleObj
-o sc.ScSubTotalDescriptorBase
-o sc.ScSubTotalFieldObj
-o sc.ScTabViewObj
-o sc.ScTableColumnObj
-o sc.ScTableColumnsObj
-o sc.ScTableConditionalEntry
-o sc.ScTableConditionalFormat
-o sc.ScTableRowObj
-o sc.ScTableRowsObj
-o sc.ScTableSheetObj
-o sc.ScTableSheetsObj
-o sc.ScTableValidationObj
-o sc.ScViewPaneObj
-o sc.XMLContentExporter
-o sc.XMLContentImporter
-o sc.XMLExporter
-o sc.XMLImporter
-o sc.XMLMetaExporter
-o sc.XMLMetaImporter
-o sc.XMLSettingsExporter
-o sc.XMLSettingsImporter
-o sc.XMLStylesExporter
-o sc.XMLStylesImporter
-o sc.ScAccessibleDocumentPagePreview

### 114242 ### -o sc.ScPageObj
### 111147 ### -o sc.AccessibleEditableTextPara_PreviewNote
-o sc.ScIndexEnumeration_DataPilotItemsEnumeration
-o sc.ScDataPilotItemsObj
-o sc.ScDataPilotItemObj
-o sc.ScSpreadsheetSettings
-o sc.ScTabViewObj
-o sc.ScAccessibleCell
-o sc.ScSpreadsheetSettingsObj
-o sc.ScShapeObj
-o sc.ScDocumentConfiguration
-o sc.ScCellCursorObj
-o sc.ScCellRangeObj
-o sc.ScCellRangesObj
-o sc.ScTableSheetObj
-o sc.AccessibleEditableTextPara_HeaderFooter
-o sc.AccessibleEditableTextPara_PreviewCell
-o sc.ScAccessibleDocumentPagePreview
-o sc.ScAccessiblePageHeader
-o sc.ScAccessiblePageHeaderArea
-o sc.ScAccessiblePreviewCell
-o sc.ScAccessiblePreviewHeaderCell
-o sc.ScAccessiblePreviewTable
-o sc.ScAnnotationObj
-o sc.ScAnnotationsObj
-o sc.ScAreaLinkObj
-o sc.ScAreaLinksObj
-o sc.ScAutoFormatFieldObj
-o sc.ScAutoFormatObj
-o sc.ScAutoFormatsObj
-o sc.ScCellFieldObj
-o sc.ScCellFieldsObj
-o sc.ScCellFormatsEnumeration
-o sc.ScCellFormatsObj
-o sc.ScCellObj
-o sc.ScCellSearchObj
-o sc.ScCellTextCursor
-o sc.ScCellsEnumeration
-o sc.ScCellsObj
-o sc.ScChartObj
-o sc.ScChartsObj
-o sc.ScConsolidationDescriptor
-o sc.ScDDELinkObj
-o sc.ScDDELinksObj
-o sc.ScDataPilotFieldObj
-o sc.ScDataPilotFieldsObj
-o sc.ScDataPilotTableObj
-o sc.ScDataPilotTablesObj
-o sc.ScDatabaseRangeObj
-o sc.ScDatabaseRangesObj
-o sc.ScDrawPageObj
-o sc.ScDrawPagesObj
-o sc.ScFilterDescriptorBase
-o sc.ScFunctionListObj
-o sc.ScHeaderFieldObj
-o sc.ScHeaderFieldsObj
-o sc.ScHeaderFooterContentObj
-o sc.ScHeaderFooterTextCursor
-o sc.ScHeaderFooterTextObj
-o sc.ScIndexEnumeration_CellAnnotationsEnumeration
-o sc.ScIndexEnumeration_CellAreaLinksEnumeration
-o sc.ScIndexEnumeration_DDELinksEnumeration
-o sc.ScIndexEnumeration_DataPilotFieldsEnumeration
-o sc.ScIndexEnumeration_DataPilotTablesEnumeration
-o sc.ScIndexEnumeration_DatabaseRangesEnumeration
-o sc.ScIndexEnumeration_FunctionDescriptionEnumeration
-o sc.ScIndexEnumeration_LabelRangesEnumeration
-o sc.ScIndexEnumeration_NamedRangesEnumeration
-o sc.ScIndexEnumeration_ScenariosEnumeration
-o sc.ScIndexEnumeration_SheetCellRangesEnumeration
-o sc.ScIndexEnumeration_SheetLinksEnumeration
-o sc.ScIndexEnumeration_SpreadsheetViewPanesEnumeration
-o sc.ScIndexEnumeration_SpreadsheetsEnumeration
-o sc.ScIndexEnumeration_SubTotalFieldsEnumeration
-o sc.ScIndexEnumeration_TableAutoFormatEnumeration
-o sc.ScIndexEnumeration_TableChartsEnumeration
-o sc.ScIndexEnumeration_TableColumnsEnumeration
-o sc.ScIndexEnumeration_TableConditionalEntryEnumeration
-o sc.ScIndexEnumeration_TableRowsEnumeration
-o sc.ScIndexEnumeration_TextFieldEnumeration
-o sc.ScLabelRangeObj
-o sc.ScLabelRangesObj
-o sc.ScModelObj
-o sc.ScNamedRangeObj
-o sc.ScNamedRangesObj
-o sc.ScRecentFunctionsObj
-o sc.ScScenariosObj
-o sc.ScSheetLinkObj
-o sc.ScSheetLinksObj
-o sc.ScStyleFamiliesObj
-o sc.ScStyleFamilyObj
-o sc.ScStyleObj
-o sc.ScSubTotalDescriptorBase
-o sc.ScSubTotalFieldObj
-o sc.ScTableColumnObj
-o sc.ScTableColumnsObj
-o sc.ScTableConditionalEntry
-o sc.ScTableConditionalFormat
-o sc.ScTableRowObj
-o sc.ScTableRowsObj
-o sc.ScTableSheetsObj
-o sc.ScTableValidationObj
-o sc.ScViewPaneObj
-o sc.XMLContentExporter
-o sc.XMLContentImporter
-o sc.XMLExporter
-o sc.XMLImporter
-o sc.XMLMetaExporter
-o sc.XMLMetaImporter
-o sc.XMLSettingsExporter
-o sc.XMLSettingsImporter
-o sc.XMLStylesExporter
-o sc.XMLStylesImporter
-o sc.ScAccessibleSpreadsheet
-o sc.ScAccessibleCsvGrid
-o sc.ScAccessibleCsvCell
-o sc.ScAccessibleCsvRuler
-o sc.ScAccessibleDocument


INTEGRATION: CWS unoapi1 (1.3.826); FILE MERGED 2007/08/14 13:17:00 cn 1.3.826.1: #i79479# update files

-o sfx.AppDispatchProvider
-o sfx.DocumentTemplates
-o sfx.FrameLoader
-o sfx.SfxMacroLoader
-o sfx.StandaloneDocumentInfo

-o sfx.AppDispatchProvider
-o sfx.DocumentTemplates
-o sfx.FrameLoader
-o sfx.SfxMacroLoader
#i36993#-o sfx.StandaloneDocumentInfo


Add parameter to mdaqAIScanStop

Add parameter to mdaqAIScanStop

function mdaqAIScanStop(arg1)
  if argn(2) == 1 then
        link_id = arg1;
        if link_id < 0 then
            disp("ERROR: Invalid link ID!")
            return;
        end
    end

    if argn(2) <> 1 then
        link_id = mdaqOpen();
        if link_id < 0 then
            disp("ERROR: Unable to connect to MicroDAQ device!");
            return;
        end
    end

    result = call("sci_mlink_ai_scan_stop",..
            link_id, 1, "i",..
        "out",..
            [1, 1], 2, "i");

    if argn(2) == 0 then
        mdaqClose(link_id);
    end

    if result < 0  then
        error(mdaq_error2(result), 10000 + abs(result));
    end

endfunction

function mdaqAIScanStop()
    result = call("sci_mlink_ai_scan_stop", "out", [1, 1], 1, "i");
    if  result < 0  then
        mdaq_error(result)
    end
endfunction


echo off and on

echo off and on

mode(-1)

//stacksize(40000000)
location = 'C:\cygwin\home\Zhan\repository\graph-classifier\dataset\'
edgelists = [
  'er-8-8.txt',
  'er-9-8.txt',
  'er-10-8.txt',
  'er-11-8.txt',
//  'er-12-8.txt',
  'ba-8-8.txt',
  'ba-9-8.txt',
  'ba-10-8.txt',
  'ba-11-8.txt',
//  'ba-12-8.txt',
  'sw-8-8.txt',
  'sw-9-8.txt',
  'sw-10-8.txt',
  'sw-11-8.txt',
//  'sw-12-8.txt',
  'rmat-8-8.txt',
  'rmat-9-8.txt',
  'rmat-10-8.txt',
  'rmat-11-8.txt'
//  'rmat-12-8.txt'
]

for i = 1:size(edgelists, 1)
  edges = fscanfMat(location + edgelists(i))
  for e = 1:size(edges, 1)
    u = edges(e, 1)
    v = edges(e, 2)
    m(u + 1, v + 1) = 1
  end
  sv = svd(m)
  mprintf("% 16s %16f %16f %16f\n", edgelists(i), sv(1:3)')
  clear edges m e u v sv
end

mode(0)

//stacksize(40000000)
location = 'C:\cygwin\home\Zhan\repository\graph-classifier\dataset\'
edgelists = [
  'er-8-8.txt',
  'er-9-8.txt',
  'er-10-8.txt',
  'er-11-8.txt',
//  'er-12-8.txt',
  'ba-8-8.txt',
  'ba-9-8.txt',
  'ba-10-8.txt',
  'ba-11-8.txt',
//  'ba-12-8.txt',
  'sw-8-8.txt',
  'sw-9-8.txt',
  'sw-10-8.txt',
  'sw-11-8.txt',
//  'sw-12-8.txt',
  'rmat-8-8.txt',
  'rmat-9-8.txt',
  'rmat-10-8.txt',
  'rmat-11-8.txt'
//  'rmat-12-8.txt'
]

mode(-1)

for i = 1:size(edgelists, 1)
  edges = fscanfMat(location + edgelists(i))
  for e = 1:size(edges, 1)
    u = edges(e, 1)
    v = edges(e, 2)
    m(u + 1, v + 1) = 1
  end
  sv = svd(m)
  mprintf("% 16s %16f %16f %16f\n", edgelists(i), sv(1:3)')
  clear edges m e u v sv
end