/****************************************************************************** * * Title : HELP.TXT * Version 0.0 * * Description: THIS TEXT IS A GUIDE HOW TO * A) include a new primitive(or remove old one), * B) include a new command(or remove old one), * C) include new register_id(or remove old one). * * Revision history: * * Author: Lukas Tomasek, tomasekl@fzu.cz * ******************************************************************************/ A) HOW TO INCLUDE A NEW PRIMITIVE ================================== a1) Copy all common header files from DSP code to test stand code into directory ..RodTS\Rcc\CommonWithDspCode\ . The common primitive parameters are in primParams.h . Note: It's supposed that a prim params struct+id+revision number for the new primitive has already been defined in primParams.h and implemented in the DSP code. a2) Create a NEW_PRIMITIVE_PANEL in primParamsUir.uir . The easiest way is just to copy and paste any similar primitive panel and change it. Don't forget to create a callback function for the new primitive panel in primParamsUir.c . a3) Add line LOAD_PANEL(&global->panel.primEdit[getInternalPrimId(NEW_PRIMITIVE_ID)], panel, "primParamsUir.uir", NEW_PRIMITIVE_PANEL); into hostGlobalInit() function defined in loadExitHost.c , which will load the NEW_PRIMITIVE_PANEL into memory after the program start. a4) Add the new Common/Master/Slave primitive into fillPrimRingCommon/Master/Slave() routine in fillUirControls.c: FILL_ITEM(NEW_PRIMITIVE_ID). It loads the new primitive name into PRIM_RING_MASTER/SLAVE in primitive list editor panel (primListEdit.uir). a5) Create a new primitive function files, i.e. -- header primFunc_newPrimitive.h with the struct of parameters (define struct PRIM_NEW_PRIMITIVE_PARAMS) and host revision number R_NEW_PRIMITIVE_HOST (should be the same as R_NEW_PRIMITIVE in primParams.h); -- primFunc_newPrimitive.c with the primitive procedure primFunction_newPrimitive(). Again the best way is just to copy similar files and change only what's necessary. a6) Include the new parameter struct (defined in primFunc_newPrimitive.h) to union in primParamsStruct.h . union PRIM_PARAMS_UNION{ ... struct PRIM_NEW_PRIMITIVE_PARAMS newPrimitive; ... } You have to #include "primFunc_newPrimitive.h" also. a7) Go to primFunctionInit.c and insert the pointer to the new primitive function into: void primFunctionInit(PRIM_FUNCTION_TYPE (*primFunction[])){ ... primFunction[getArrayId(NEW_PRIMITIVE_ID)]=&primFunction_newPrimitive; ... } You have to #include "primFunc_newPrimitive.h" also. A8) Add primitive name to the function getPrimName() in RWlists.c : GET_PRIM_NAME(PRIM_NAME); /******************************************************************************/ B) HOW TO INCLUDE A NEW COMMAND ================================== b1) #Define NEW_COMMAND_ID and change LAST_COMMAND_ID in commandParamsStruct.h . b2) Create a NEW_COMMAND_PANEL in commandParamsUir.uir . The easiest way is just to copy and paste any similar command panel and change it. Don't forget to create a callback function for the new command panel in commandParamsUir.c . b3) Add line LOAD_PANEL(&global->panel.commandEdit[NEW_COMMAND_ID], panel, "commandParamsUir.uir", NEW_COMMAND_PANEL); into hostGlobalInit() function defined in loadExitHost.c , which will load the NEW_COMMAND_PANEL into memory after the program start. b4) Add the new command into fillCommandIdRing() routine in fillUirControls.c: FILL_ITEM_NAME(New command text, NEW_COMMAND_ID, ++index). It loads the new command name into COMMAND_RING in command list editor panel (commandListEdit.uir). b5) Create a new command function files, i.e. -- header commandFunc_newCommand.h with the struct of parameters (define struct NEW_COMMAND_PARAMS); -- commandFunc_newCommand.c with the command procedure commandFunction_newCommand(). Again the best way is just to copy similar files and change only what's necessary. b6) Include the new parameter struct (defined in commandFunc_newCommand.h) to union in commandParamsStruct.h . union COMMAND_PARAMS_UNION{ ... struct NEW_COMMAND_PARAMS newCommand; ... } You have to #include "commandFunc_newCommand.h" also. b7) #Include "commandFunc_newCommand.h" into commandFunctionInit.c . Insert the pointer to the new command function into: void commandFunctionInit(COMMAND_FUNCTION_TYPE (*commandFunction[])){ ... commandFunction[NEW_COMMAND_ID]=&commandFunction_newCommand; ... } /******************************************************************************/ C) HOW TO INCLUDE A NEW REGISTER ID (RW_REGISTER_FIELD and POLL_REGISTER_FIELD primitive) ========================================================================================= c1) Copy a new version of registerIndicies.h from DSP code to test stand code into directory ..RodTS\Rcc\CommonWithDspCode\ . c2) Add the new register into fillRegisterIdRing() routine in fillUirControls.c: FILL_ITEM(REGISTER_ID, ++index); or FILL_ITEM_NAME(REGISTER_ID(x, y, z), REGISTER_ID(0, 0, 0), ++index); It loads the new register name into BASE_ID on RW_REGISTER_FIELD and POLL_REGISTER_FIELD primitive panels (in primParamsUir.uir). c3) Add a case switch into getRegisterId() function in getRegisterId.c if the new registerId has any input parameter(s): case REGISTER_ID(0, 0, 0) : *registerId=REGISTER_ID(x, y, z) ; break; It is used to decode the real registerId from the baseId and the input parameters. c4) You can (but don't have to) create text file which describes register fields in the new register: ...RodTS\Rcc\MDSPRegFieldsDescription\regID_(ID#hex).txt