objectclasses::Device Class Reference

Inheritance diagram for objectclasses::Device:

objectclasses::DBInfo cdbVisCore::dbUpdate

List of all members.


Detailed Description

Class for storing information about a device. A device is a physical device in the LHCb detector that is usually connected to other devices with links.

Definition at line 1327 of file objectclasses.py.


Public Member Functions

def __init__
def GetModifyStatus
def GetComments
def GetLocation
def GetResponsible
def GetHWType
def GetSerial
def GetOldName
def GetSaveStatus
def GetName
def GetID
def GetType
def GetDeviceFunction
def GetNode
def GetPromMode
def GetSystem
def GetColour
def GetTheDict
def GetErrorMessage
def IsSystemChanged
def IsNodeChanged
def GetPortsIn
def GetPortsOut
def GetTypeDescription
def GetSavedFreePorts
def GetURL
def SetPortsOut
def SetPortsIn
def GetPortsOut
def SetURL
def SetModifyStatus
def SetComments
def SetLocation
def SetResponsible
def SetFunction
def SetHWType
def SetSerial
def SetOldName
def SetSaveStatus
def SetName
def SetID
def SetErrorMessage
def SetType
def SetNode
def SetPromMode
def SetSystem
def SetDict
def SetAllInfoDict
def UpdateDeviceType
def GetObjectInfo
def Update
def IsAllPortsFree
def GetFreePorts
def GetLinks
def GetPortIDs
def GetPorts
def GetPaths
def GetSpecificPathInfo
def PrintSaveFunction
def Save
def Delete
def Modify
def Create

Public Attributes

 totalp
 inp
 outp

Private Attributes

 __errormessage
 _deviceInfo
 if GetAppWin().GetUserMode() == ID_CREATION_MODE:
 __deviceType
 __ports
 __links
 __cfg
 __listofpaths

Member Function Documentation

def objectclasses::Device::__init__ (   self,
  systemname,
  deviceName = "",
  new = True 
)

Constructor.

Parameters: - the subsystem(s) the device will be a part of (stored in) - the unique name of the device, given by the user - whether the device is about to be created, or is already created. True if it is being created, False if not. If it is already created, we will fill the object with goods. (names and values)

Definition at line 1339 of file objectclasses.py.

def objectclasses::Device::GetModifyStatus (   self  ) 

Definition at line 1383 of file objectclasses.py.

def objectclasses::Device::GetComments (   self  ) 

Definition at line 1385 of file objectclasses.py.

def objectclasses::Device::GetLocation (   self  ) 

Definition at line 1387 of file objectclasses.py.

def objectclasses::Device::GetResponsible (   self  ) 

Definition at line 1389 of file objectclasses.py.

def objectclasses::Device::GetHWType (   self  ) 

Definition at line 1391 of file objectclasses.py.

def objectclasses::Device::GetSerial (   self  ) 

Definition at line 1393 of file objectclasses.py.

def objectclasses::Device::GetOldName (   self  ) 

Definition at line 1395 of file objectclasses.py.

def objectclasses::Device::GetSaveStatus (   self  ) 

Definition at line 1397 of file objectclasses.py.

def objectclasses::Device::GetName (   self  ) 

Definition at line 1399 of file objectclasses.py.

def objectclasses::Device::GetID (   self  ) 

Definition at line 1401 of file objectclasses.py.

def objectclasses::Device::GetType (   self  ) 

Definition at line 1403 of file objectclasses.py.

def objectclasses::Device::GetDeviceFunction (   self  ) 

Definition at line 1406 of file objectclasses.py.

def objectclasses::Device::GetNode (   self  ) 

Definition at line 1408 of file objectclasses.py.

def objectclasses::Device::GetPromMode (   self  ) 

Definition at line 1410 of file objectclasses.py.

def objectclasses::Device::GetSystem (   self  ) 

Definition at line 1412 of file objectclasses.py.

def objectclasses::Device::GetColour (   self  ) 

Definition at line 1414 of file objectclasses.py.

def objectclasses::Device::GetTheDict (   self  ) 

Definition at line 1416 of file objectclasses.py.

def objectclasses::Device::GetErrorMessage (   self  ) 

Get the error message that was set most recently.

!return - the error message string

Reimplemented from objectclasses::DBInfo.

Definition at line 1418 of file objectclasses.py.

def objectclasses::Device::IsSystemChanged (   self  ) 

Definition at line 1420 of file objectclasses.py.

def objectclasses::Device::IsNodeChanged (   self  ) 

Definition at line 1422 of file objectclasses.py.

def objectclasses::Device::GetPortsIn (   self  ) 

Definition at line 1426 of file objectclasses.py.

def objectclasses::Device::GetPortsOut (   self  ) 

Definition at line 1428 of file objectclasses.py.

def objectclasses::Device::GetTypeDescription (   self  ) 

Definition at line 1430 of file objectclasses.py.

def objectclasses::Device::GetSavedFreePorts (   self  ) 

Definition at line 1434 of file objectclasses.py.

def objectclasses::Device::GetURL (   self,
  update = False 
)

Definition at line 1437 of file objectclasses.py.

def objectclasses::Device::SetPortsOut (   self,
  nbr 
)

Definition at line 1448 of file objectclasses.py.

def objectclasses::Device::SetPortsIn (   self,
  nbr 
)

Definition at line 1451 of file objectclasses.py.

def objectclasses::Device::GetPortsOut (   self  ) 

Definition at line 1454 of file objectclasses.py.

def objectclasses::Device::SetURL (   self,
  url 
)

Definition at line 1456 of file objectclasses.py.

def objectclasses::Device::SetModifyStatus (   self,
  status 
)

Definition at line 1458 of file objectclasses.py.

def objectclasses::Device::SetComments (   self,
  comments 
)

Definition at line 1460 of file objectclasses.py.

def objectclasses::Device::SetLocation (   self,
  location 
)

Definition at line 1463 of file objectclasses.py.

def objectclasses::Device::SetResponsible (   self,
  responsible 
)

Definition at line 1466 of file objectclasses.py.

def objectclasses::Device::SetFunction (   self,
  function 
)

Definition at line 1469 of file objectclasses.py.

def objectclasses::Device::SetHWType (   self,
  hwtype 
)

Definition at line 1472 of file objectclasses.py.

def objectclasses::Device::SetSerial (   self,
  serial 
)

Definition at line 1475 of file objectclasses.py.

def objectclasses::Device::SetOldName (   self,
  oldname 
)

Definition at line 1478 of file objectclasses.py.

def objectclasses::Device::SetSaveStatus (   self,
  state 
)

Definition at line 1480 of file objectclasses.py.

def objectclasses::Device::SetName (   self,
  name 
)

Definition at line 1482 of file objectclasses.py.

def objectclasses::Device::SetID (   self,
  id 
)

Definition at line 1485 of file objectclasses.py.

def objectclasses::Device::SetErrorMessage (   self,
  msg 
)

Set the error message so that it can be looked up. - the message string

Reimplemented from objectclasses::DBInfo.

Definition at line 1487 of file objectclasses.py.

def objectclasses::Device::SetType (   self,
  devtype,
  update = True 
)

Sets the device type of this device.

- the unique device type name - whether we also should update this devices dictionary with device type parameters (ports, colour)

Definition at line 1496 of file objectclasses.py.

def objectclasses::Device::SetNode (   self,
  node,
  changed = True 
)

We check whether the user changed the value of the node property. - the value of the node property - if the node property was changed set to True, False otherwise

Definition at line 1521 of file objectclasses.py.

def objectclasses::Device::SetPromMode (   self,
  prommode 
)

Definition at line 1526 of file objectclasses.py.

def objectclasses::Device::SetSystem (   self,
  system,
  changed = True 
)

Definition at line 1529 of file objectclasses.py.

def objectclasses::Device::SetDict (   self,
  newdict 
)

Definition at line 1535 of file objectclasses.py.

def objectclasses::Device::SetAllInfoDict (   self,
  devinfo 
)

Copy device info from one device to another (this one).

Definition at line 1543 of file objectclasses.py.

def objectclasses::Device::UpdateDeviceType (   self  ) 

If we need to update the information about the device type this device is, we use this method. The method fills the property dictionary with device type parameters and values.

Definition at line 1557 of file objectclasses.py.

def objectclasses::Device::GetObjectInfo (   self,
  doNotLookUp = True 
)

Get all info about a device in a subsystem, given the unique name of a device.

Here we do some check where to get the properies information from, f.ex. whether this device object is the most recent object in dirty list; if so we can just return this objects dictionary. TODO.

- whether we should look for information about this object in dirty objects list and ConfDB (False) or not(True).

Definition at line 1576 of file objectclasses.py.

def objectclasses::Device::Update (   self,
  doNotCheckInDirtyList = False 
)

Here we update the device with the most recent information about the device witht the given information; either in dirty objects list (if found and in creation mode), or from ConfDB.

- if True, we do not check in dirty objects list, but go straight forward to the ConfDB and look for information about this device there.

Definition at line 1593 of file objectclasses.py.

def objectclasses::Device::IsAllPortsFree (   self  ) 

Method to check whether the device has any connections at all to other devices. If this is true (all ports are free, no connections to other devices), the given device can be deleted, else it can not.

!return - True if all ports are free, -1 if not all are free. False if an error occurs

Definition at line 1696 of file objectclasses.py.

def objectclasses::Device::GetFreePorts (   self  ) 

Nr of ports on a device is nr of input + nr of output for the given device type it is. We find all the taken ports; subtract them from the list of all ports; and return the list of free ports (actually as a 3-tuple; number of free ports in total, and then 1 list for each direction; IN and OUT)

!return - 3 tuple: integer - number of free ports in total list *port name* - a list of port numbers that are free; TO the device list *port name* - a list of port numbers that are free; FROM the device

False is returned if an error occurs

Definition at line 1735 of file objectclasses.py.

def objectclasses::Device::GetLinks (   self,
  nodefrom = True 
)

Get all links (objects) that start or end in the given device.

Parameters: - if nodefrom is set to true, then all links that start (FROM) in the given device is returned if nodefrom is set to false, then all links that end (TO) in the given device is returned

!return - a list of link objects that either start or end at the current device.

Definition at line 1880 of file objectclasses.py.

def objectclasses::Device::GetPortIDs (   self  ) 

Get all portids of the current device. This is the IDs set automatically to ports in the ConfDB. Usually used as a helper function to GetPorts(...).

!return - list of portIDs (ints) of ports on this device

Definition at line 2001 of file objectclasses.py.

def objectclasses::Device::GetPorts (   self  ) 

Get all ports assigned to a device as port objects in a list. Look for ports in both dirty objects list and ConfDB.

!return - list of port objects for the ports of a device.

Definition at line 2037 of file objectclasses.py.

def objectclasses::Device::GetPaths (   self  ) 

Get all the paths this device is a part of. We set the paths found to a member variable dictionary, and what we return is actually a list with descriptions (start and end nodes) of each path. Each index in this list corresponds to an entry in the member variable dictionary we have set.

!return - a list with string description of each path

Definition at line 2137 of file objectclasses.py.

def objectclasses::Device::GetSpecificPathInfo (   self,
  pathid 
)

Return all path information necessary to display a path for a given path(ID).

A path from the list of paths for a device was selected; the entry index of that list corresponds to entries in our member variable dictionary.

Parameters: - the ID of the path chosen to get path information for. The path ID is the index of the entry in the list returned by the GetPaths(...) function.

!return - an ordered list of member variable dictionaries for the devices in the given path.

Definition at line 2269 of file objectclasses.py.

def objectclasses::Device::PrintSaveFunction (   self,
  first = False,
  insertmany = False,
  commit = True 
)

A function that returns the string to the function that will be called in the ConfDBLibrary for the given save and modify status of this data object, as well as use of single or multiple insert.

Parameters: Same as for Save(...)

!return - returns a String with the function name as well as all set parameters

Definition at line 2334 of file objectclasses.py.

def objectclasses::Device::Save (   self,
  first = False,
  insertmany = False,
  commit = True 
)

Update changes to the ConfDB for this object.

Parameters: - if first is True; it is the first kind of this db update; prepare and initialize cache, if first is False, add it to the already existing cache. cache is only used if insertmany = True. - If insertmany is set to false, the single insert function will be used, which is optimized for single inserts. If insertmany is set to true, the multiple insert function will be used, which is optimized for multiple inserts (use of cache) - if commit is set to false, no data will be commited, put are put on hold in the cache, if commit is set to true, all data that are put on hold in the cache will be commited.

Definition at line 2400 of file objectclasses.py.

def objectclasses::Device::Delete (   self  ) 

Sets the save status of this object to delete, and adds it to the dirty objects list for later update in the ConfDB.

Reimplemented from objectclasses::DBInfo.

Definition at line 2499 of file objectclasses.py.

def objectclasses::Device::Modify (   self,
  commit = 1 
)

Sets the save status of this object to modify, and adds it to the dirty objects list for later update in the ConfDB. The Modify status is set in the respective Set-functions for the parameters they change.

Definition at line 2510 of file objectclasses.py.

def objectclasses::Device::Create (   self  ) 

Sets the save status of this object to create, and adds it to the dirty objects list for later update in the ConfDB.

Reimplemented from objectclasses::DBInfo.

Definition at line 2518 of file objectclasses.py.


Member Data Documentation

objectclasses::Device::__errormessage [private]

Reimplemented from objectclasses::DBInfo.

Definition at line 1341 of file objectclasses.py.

objectclasses::Device::_deviceInfo [private]

if GetAppWin().GetUserMode() == ID_CREATION_MODE:

Definition at line 1343 of file objectclasses.py.

objectclasses::Device::__deviceType [private]

Definition at line 1371 of file objectclasses.py.

objectclasses::Device::__ports [private]

Definition at line 1372 of file objectclasses.py.

objectclasses::Device::__links [private]

Definition at line 1373 of file objectclasses.py.

objectclasses::Device::__cfg [private]

Definition at line 1374 of file objectclasses.py.

objectclasses::Device::__listofpaths [private]

Definition at line 1376 of file objectclasses.py.

objectclasses::Device::totalp

Definition at line 1854 of file objectclasses.py.

objectclasses::Device::inp

Definition at line 1855 of file objectclasses.py.

objectclasses::Device::outp

Definition at line 1856 of file objectclasses.py.


The documentation for this class was generated from the following file:
Generated on Fri Aug 31 11:11:20 2007 for CDBVis by  doxygen 1.5.3