
cd ("SCI\contrib\scicos_ee\scicos_flex\dspic");

//** Some "alias" variables are re-defined for easy compatibility 
s  = %s; //** Laplace for continous systems
z  = %z; //** Z for discrete systems
pi = %pi; //** 3.14.. etc..

ieee(2) ; //** NO ERROR in case of division by zero
lines(0); //** infinite scroll on Scilab console 

//** Load additional Interfacing function library 
exec("SCI/contrib/scicos_ee/scicos_flex/dspic/loader.sce"); 

//** update the Scicos palettes 

//** Add a menu to Scicos
%scicos_menu($+1)=['CodeGen','FlexCodeGen','Set Target']

//** add short help line for the menu  
%CmenuTypeOneVector($+1,:)=['FlexCodeGen','Click on a Superblock (without activation output) to obtain a coded block!']
%CmenuTypeOneVector($+1,:)=['Set Target','Click on a Superblock (without activation output) to set the Target!']

%scicos_gif($+1)=[SCI+"/contrib/scicos_ee/scicos_flex/dspic/macros/man/amazing/"];
%scicos_gif($+1)=[SCI+"/contrib/scicos_ee/scicos_flex/dspic/macros/man/easylab/"];
%scicos_gif($+1)=[SCI+"/contrib/scicos_ee/scicos_flex/dspic/macros/man/flex/"];
%scicos_gif($+1)=[SCI+"/contrib/scicos_ee/scicos_flex/dspic/macros/man/flex_com/"];
%scicos_gif($+1)=[SCI+"/contrib/scicos_ee/scicos_flex/dspic/macros/man/flex_dmb/"];
%scicos_gif($+1)=[SCI+"/contrib/scicos_ee/scicos_flex/dspic/macros/man/flex_mtb/"];
%scicos_gif($+1)=[SCI+"/contrib/scicos_ee/scicos_flex/dspic/macros/man/rt_data_exchange/"];
%scicos_gif($+1)=[SCI+"/contrib/scicos_ee/scicos_flex/dspic/macros/man/misc/"];
%scicos_gif($+1)=[SCI+"/contrib/scicos_ee/scicos_flex/dspic/macros/man/NativeInteger/"];
%scicos_gif($+1)=[SCI+"/contrib/scicos_ee/scicos_flex/dspic/macros/man/easylab/"];

PALETTE_DIR = 'SCI/contrib/scicos_ee/scicos_flex/dspic/macros/palettes/';

//** Load some FLEX specific palettes
scicos_pal($+1,:)=['MCHP16-Sources',PALETTE_DIR + 'MCHP16-Sources.cosf'];
scicos_pal($+1,:)=['MCHP16-Sinks',PALETTE_DIR + 'MCHP16-Sinks.cosf'];
scicos_pal($+1,:)=['MCHP16-Linear',PALETTE_DIR + 'MCHP16-Linear.cosf'];
scicos_pal($+1,:)=['MCHP16-NonLinear',PALETTE_DIR + 'MCHP16-NonLinear.cosf'];
scicos_pal($+1,:)=['MCHP16-Logic',PALETTE_DIR + 'MCHP16-Logic.cosf'];
scicos_pal($+1,:)=['MCHP16-TypeConversion',PALETTE_DIR + 'MCHP16-TypeConversion.cosf'];
scicos_pal($+1,:)=['MCHP16-Branching',PALETTE_DIR + 'MCHP16-Branching.cosf'];
scicos_pal($+1,:)=['FLEX',PALETTE_DIR + 'FLEX.cosf'];
scicos_pal($+1,:)=['FLEX-DemoBoard',PALETTE_DIR + 'FLEX-DMB.cosf'];
scicos_pal($+1,:)=['FLEX-MotionBoard',PALETTE_DIR + 'FLEX-MTB.cosf'];
//scicos_pal($+1,:)=['FLEX-DoubleTouchBoard',PALETTE_DIR + 'FLEX-DTB.cosf'];
scicos_pal($+1,:)=['FLEX-Communication',PALETTE_DIR + 'FLEX-Communication.cosf'];
scicos_pal($+1,:)=['RT Data Exchange',PALETTE_DIR + 'RT-Data-Exchange.cosf'];
scicos_pal($+1,:)=['Amazing Ball',PALETTE_DIR + 'AMAZING.cosf'];
scicos_pal($+1,:)=['Easylab',PALETTE_DIR + 'EASYLAB.cosf'];

if MSDOS then

//** Load the FLEX shared library of computational functions for SIMULATION 
exec("SCI\contrib\scicos_ee\scicos_flex\dspic\Flex-Sim\loader.sce"); 

//** Load the shared library of computational functions for Native Integer Support 
exec("SCI\contrib\scicos_ee\scicos_flex\dspic\NativeInteger\loader.sce"); 

//** Load the library of interfacing functions for Native Integer Support 
cd  ("SCI\contrib\scicos_ee\scicos_flex\dspic\NativeInteger") ;
exec("InterfaceLoader.sci");
cd ("SCI\contrib\scicos_ee\scicos_flex\dspic");

//** Load the UDP dll
exec("SCI\contrib\scicos_ee\scicos_flex\dspic\Flex-UDP\loader.sce");

//** Load the Roller dll
exec("SCI\contrib\scicos_ee\scicos_flex\dspic\Flex-Roller\loader.sce");

//** Load the MCP2200 dll
exec("SCI\contrib\scicos_ee\scicos_flex\dspic\Communication\MCP2200\loader.sce");

//** Load the Serial Gateway
exec("SCI\contrib\scicos_ee\scicos_flex\dspic\Communication\SerialGateway\loader.sce");

//** Load the RS232 dll
exec("SCI\contrib\scicos_ee\scicos_flex\dspic\Communication\RS232\loader.sce");

//** Load the documentation of the blocks 
exec("SCI\contrib\scicos_ee\scicos_flex\dspic\macros\man\loader.sce"); 

end

//** show some message  
disp("ScicosLab-FLEX Ready");disp(" ");

//**===================================================================================

//** Add this personal shortcut
%scicos_short=[%scicos_short; "w" "Identification"]; 

//**===================================================================================
