Difference between revisions of "Batchmake developers"

From KitwarePublic
Jump to navigationJump to search
Line 17: Line 17:
Actually, the Reset function is called when you clik on the Compile button, in BatchMake.
Actually, the Reset function is called when you clik on the Compile button, in BatchMake.
* In your header file bmScriptNewCommnadAction.h
* In your header file bmScriptNewCommnadAction.h
** namespace bm {
class ScriptDownloadXcedeDataSetAction :public ScriptAction
** Two main public functions : Execute(), et TestParam(ScriptError* error,int linenumber)
** Two main public functions : Execute(), et TestParam(ScriptError* error,int linenumber)
** The first one is what your command is going to do, and the second is going to test if the paramters the user put in are correct or not.
** The first one is what your command is going to do, and the second is going to test if the paramters the user put in are correct or not.
** Execute will be called when BatckMake is running, but TestParam is called when the script is compiling.
** Execute will be called when BatckMake is running, but TestParam is called when the script is compiling.
** A function Help() which returns a MString, which is basicaly a string with BatchMake specific functions (see the MString class for more information about these functions) In BatchMake you will be able eo see that string when you type the name of your new command.
** Generally, you don't need any protected varaiables in that class.

Revision as of 20:28, 21 January 2008

Documentation for Developers.

Add new command to BatchMake

  • Add a new class (bmScriptNewCommnadAction.h, and bmScriptNewCommandAction.cxx)
  • Don't forget to add it to the CMakeLists
  • In the header file bmScriptActionManager.h :
    • Include the header of your class
#include "bmScriptNewCommandAction.h"
    • In the GetKeywordList() function, add a new keyword :
BM_NEWKEYWORD(_list, NewCommand);
    • In the CreateAction(MString option) function, add a new action :
BM_NEWACTION(option, NewCommand);

You can choose to put theses two last things in BM_GRID, or BM_DASHBOARD, if it is a new command for the grid, or the dashboard.

  • If your new command requires to clear some variables at each time you launch the command in BatchMake, you have to do it in the Reset() function.

Actually, the Reset function is called when you clik on the Compile button, in BatchMake.

  • In your header file bmScriptNewCommnadAction.h
    • namespace bm {

class ScriptDownloadXcedeDataSetAction :public ScriptAction

    • Two main public functions : Execute(), et TestParam(ScriptError* error,int linenumber)
    • The first one is what your command is going to do, and the second is going to test if the paramters the user put in are correct or not.
    • Execute will be called when BatckMake is running, but TestParam is called when the script is compiling.
    • A function Help() which returns a MString, which is basicaly a string with BatchMake specific functions (see the MString class for more information about these functions) In BatchMake you will be able eo see that string when you type the name of your new command.
    • Generally, you don't need any protected varaiables in that class.