Functions for use in FSM User Panels (across distributed systems)


Functions

string fwHw_getHwSys (string hw)
string fwHw_getHwType (string hw, int &intfType)
string fwHw_getHwDpType (string hw)
int fwHw_getHwRegisters (string hw, dyn_string &regs, dyn_int &types)
int fwHw_getHwRecipeType (string hw, string recipe, string &recipeType)
int fwHw_getHwRecipeTypeInfo (string hw, string recipeType, dyn_string &regs)

Detailed Description

List of functions that can be used in the FSM user panels since they work fine across distributed systems. In particular they can be used in DU panels by using the parameter $2 (as device/hw name).
And also the following Recipe Functions (Documented in the Recipe Section):

Function Documentation

string fwHw_getHwDpType ( string  hw  ) 

This function returns the Datapoint type of certain hardware device. Note: This function works across distributed systems

Parameters:
[in] hw hardware to get the dpType from (can be in a different PVSS system).
Returns:
the dpType or "" (empty string) in case of error.
Example:

  (...)
  string dpType;

  dpType = fwHw_getHwDpType("sys1:myBoard1");
  DebugTN("sys1:myBoard1 is of DP Type "+dpType);
  (...)



int fwHw_getHwRecipeType ( string  hw,
string  recipe,
string &  recipeType 
)

This function retrieves the Recipe Type of a Recipe defined for a given hw device. Note1: this function works across distributed systems Note2: this function only works if one single recipeType was used to build this recipe for this hw device.

Parameters:
[in] hw name of the device.
[in] recipe name of the recipe.
[out] recipeType The recipeType.
Returns:
1 if OK, 0 if failed, -1 if error occurs in fwConfigurationDB functions. Note: see LogViewer for exception info
Example:

  (...)

  string      recipeType;

  fwHw_getHwRecipeType("sys1:myBoard1","PHYSCICS/Configure", recipeType);
  DebugN(recipeType);

  (...)



int fwHw_getHwRecipeTypeInfo ( string  hw,
string  recipeType,
dyn_string &  regs 
)

This function retrieves the list of registers that are specified for a given device and Recipe Type. Note: This function replaces fwHw_getRecipeTypeInfo() for panels that work across distributed systems

Parameters:
[in] hw name of the device.
[in] recipeType name of the recipe type.
[out] regs the list of registers (in the form .xxx.yyy.regA).
Returns:
1 if OK, -1 if error occurs in fwConfigurationDB functions. Note: see LogViewer for exception info
Example:

  (...)

  dyn_string      myRegisters;

  fwHw_getHwRecipeTypeInfo("sys1:myBoard1","MyBoardType_", myRegisters);
  DebugN(myRegisters);

  (...)



int fwHw_getHwRegisters ( string  hw,
dyn_string &  regs,
dyn_int &  types 
)

This function returns all registers (including their respective types) of a certain hardware. Note: This function replaces fwHw_getRegisters() for panels that work across distributed systems

Parameters:
[in] hw hardware to get the registers from (can be in a different PVSS system).
[out] regs list containing all existing registers of the specified hardware.
[out] types list containing the types of the registers. Note: the type of the register will be the same as the one specified when the register was created.
Returns:
1 no error found.

0 error found.

Example:

  (...)
  dyn_string registers;
  dyn_int    types;
  int        i;

  if (fwHw_getHwRegisters("sys1:myBoard1", registers, types))   // get a list of the registers (and their respective types) of hardware type 'Beetle'
  {
     DebugTN("Existing registers: " + dynlen(registers));   // display number of existing registers
     for(i = 1; i <= dynlen(registers); i++)
        switch(types[i])
        {
           case FWHW_I2C : DebugTN("Register " + registers[i] + " is of type I2C";
                           break;
           case FWHW_JTAG: DebugTN("Register " + registers[i] + " is of type JTAG";
                           break;
           case FWHW_PBUS: DebugTN("Register " + registers[i] + " is of type PBUS";
                           break;
           case FWHW_REG : DebugTN("Register " + registers[i] + " is of type REG";
                           break;
           case FWHW_DCU : DebugTN("Register " + registers[i] + " is of type DCU Register";
                           break;
           case FWHW_DCUChannel : DebugTN("Register " + registers[i] + " is of type DCU Channel";
                           break;
           case FWHW_LBUS: DebugTN("Register " + registers[i] + " is of type LBUS";
                           break;                                                                                                                                                       
           case FWHW_GBE : DebugTN("Register " + registers[i] + " is of type GBE";
                           break;                                                                                                                                                       
           default       : DebugTN("Register " + registers[i] + " is of unknown type";
        }
  }
  else
     DebugTN("Error found!");
  (...)



string fwHw_getHwSys ( string  hw  ) 

This function returns the system name where a certain hardware device is defined. Note: This function works across distributed systems

Parameters:
[in] hw hardware for which to get the systemName (can be in a different PVSS system).
Returns:
the systemName if remote system or "" (empty string) for local system.
Example:

  (...)
  string systemName;

  systemName = fwHw_getHwSys("sys1:myBoard1");
  DebugTN("sys1:myBoard1 is in system "+systemName);
  (...)



string fwHw_getHwType ( string  hw,
int &  intfType 
)

This function returns the hardware type of certain hardware device, and also its interface type. Note: This function works across distributed systems

Parameters:
[in] hw hardware to get the hwType from (can be in a different PVSS system).
[out] intfType The interface type: FWHW_SPECS, FWHW_CCPC or FWHW_GENERIC.
Returns:
the hwType or "" (empty string) in case of error.
Example:

  (...)
  string hwType;
  int intfType

  hwType = fwHw_getHwType("sys1:myBoard1", intfType);
  DebugTN("sys1:myBoard1 is of Type "+hwType);
  (...)




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