Utilities


Functions

bool fwHw_saveScript (string pScriptName, string pScript="")
bool fwHw_removeScript (string pScriptName)
bool fwHw_getScripts (dyn_dyn_string &pScriptsList)
bool fwHw_executeScript (string pScriptName, dyn_string pParametersList=makeDynString())
bool fwHw_generateScript (string pHardwareType, dyn_string &pScript)

Detailed Description

Scripts can be written to generate hardware types and be stored as a PVSS datapoint. Also the other way round - scripts can be automatically generated from existing hardware types.

Function Documentation

bool fwHw_executeScript ( string  pScriptName,
dyn_string  pParametersList = makeDynString() 
)

This function executes the specified script.

Parameters:
[in] pScriptName name of the script to be executed.
[in] pParametersList list of parameters to be passed to the main function of the script. Note: this parameter is optional (if not specified, then an empty parameters list will be passed).
Returns:
true no error found.

false error found.

Example:

  (...)
  if (fwHw_executeScript("myScript"))   // execute the script 'myScript' with no parameters
     (...)
  else
     DebugTN("Error found!");
  (...)



bool fwHw_generateScript ( string  pHardwareType,
dyn_string &  pScript 
)

This function generates a script for the specified hardware type (i.e. generates a script that can create the specified hardware type (including all the registers, the "inserted" hardwares and the default common/specific settings, belonging to that hardware type)).

Parameters:
[in] pHardwareType name of the hardware type that will be used to generate the script.
[in] pScript list containing the generated script.
Returns:
true no error found.

false error found.

Example:

  (...)
  dyn_string myScript;
  int        i;

  if (fwHw_generateScript("Beetle", myScript))   // generate the script for hardware type 'Beetle'
  {
     DebugTN("Generated script:");
     for(i = 1; i <= dynlen(myScript); i++)
        DebugTN(myScript[i]);   // display script line
  }
  else
     DebugTN("Error found!");
  (...)



bool fwHw_getScripts ( dyn_dyn_string &  pScriptsList  ) 

Get a list with the existing scripts.

Parameters:
[out] pScriptsList returned list containing the scripts.
Returns:
true no error found.

false error found.

Example:

  (...)
  dyn_dyn_string myList;
  int            i;

  if (fwHw_getScripts(myList))   // get a list of the existing scripts
  {
     DebugTN("Existing scripts: " + dynlen(myList));   // display number of existing scripts
     for(i = 1; i <= dynlen(myList); i++)
     {
        DebugTN("Name  : " + myList[i][1]);   // display script name
        DebugTN("Script: " + myList[i][2]);   // display script
     }
  }
  else
     DebugTN("Error found!");
  (...)



bool fwHw_removeScript ( string  pScriptName  ) 

Remove the specified script.

Parameters:
[in] pScriptName name of the script to be removed.
Returns:
true no error found.

false error found.

Example:

  (...)
  if (fwHw_removeScript("myScript"))   // remove the script named 'myScript'
     (...)
  else
     DebugTN("Error found!");
  (...)



bool fwHw_saveScript ( string  pScriptName,
string  pScript = "" 
)

Create and save the specified script.

Parameters:
[in] pScriptName name of the script.
[in] pScript the script to be saved. Note: this parameter is optional (if not specified, then an empty script will be saved).
Returns:
true no error found.

false error found.

Example:

  (...)
  if (fwHw_saveScript("myScript", "main()\n {\n DebugTN(1);\n }\n"))   // save the script under the name 'myScript'
     (...)
  else
     DebugTN("Error found!");
  (...)




Generated on Mon Jan 28 10:40:20 2008 for FwHw by  doxygen 1.4.7