Python scripting - Objects

CENPyOlpResource

 

Methods

 

GetName(): string

 

 

o

return

The resource name

 

Returns the resource name.

 

[Example]

resName = olpResource.GetName()

 


 

GetManufacturer(): string

 

 

o

return

The resource manufacturer

 

Returns the resource manufacturer.

 

[Example]

resManufacturer = olpResource.GetManufacturer()

 


 

GetSeries(): string

 

 

o

return

The resource series

 

Returns the resource series.

 

[Example]

resSeries = olpResource.GetSeries()

 


 

GetModel(): string

 

 

o

return

The resource model

 

Returns the resource model.

 

[Example]

resModel = olpResource.GetModel()

 


 

GetItemType(): FSItemType

 

o

return

The item type of the resource as unsigned integer

 

Returns the item type of the resource as unsigned integer.

 

[Example]

itemType = olpResource.GetItemType()

 


 

GetItemSubType(): ItemSubType

 

o

return

The item sub type of the resource as unsigned integer

 

Returns the item sub type of the resource as unsigned integer.

 

[Example]

itemSubType = olpResource.GetItemSubType()

 


 

GetAllPorts(): list

 

 

o

return

List of CENPyOlpPort objects. All ports that are currently active in the resource.

 

Returns a list of all ports that are currently active in the resource.

 

[Example]

allPorts = resource.GetAllPorts()

allPortCount = len(allPorts)

for i in range(0, allPortCount):

   port = allPorts[i]

   portDirection = port.GetPortDirection()

   if (portValueType != VALUETYPE_BOOL):

      continue

   if (portDirection != RES_INPORTS):

      continue

 


 

GetPorts(valueType: RSimSignalValueType, direction: PortDirection): list

 

 

o

valueType

Specifies the value type of ports to be returned. There is no option for all value types, use GetAllPorts method instead.

 

o

direction

Specifies the direction of ports to be returned. There is no option for all directions, use GetAllPorts method instead.

 

o

return

List of CENPyOlpPort objects. All ports that are currently active and have the requested value type and direction in the resource.

 

Returns a list of prefiltered ports. The ports in the list will all be active in the current resource and have the requested value type and direction.

 

[Example]

outBoolPorts = resource.GetPorts(VALUETYPE_BOOL, RES_OUTPORTS)

outBoolPortCount = len(outBoolPorts)

for i in range(0, outBoolPortCount):

   outPort = outBoolPorts[i]

   outPortComment = outPort.GetComment()

 


 

GetAttributeByName(name: string): CENPyOlpAttribute

 

 

o

name

Name of attribute to search for

 

o

return

CENPyOlpAttribute object

 

[Example]

   foundAttribute = resource.GetAttributeByName("AttributeName")

 


 

GetValueOfIntegerAttributeByName(name: string): int

 

 

o

name

Name of attribute to search for

 

o

return

Value of the attribute

 

[Example]

   valueOfIntAttrib = resource.GetValueOfIntegerAttributeByName("AttributeName")

 


   

GetValueOfFloatAttributeByName(name: string): float

 

 

o

name

Name of attribute to search for

 

o

return

Value of the attribute

 

[Example]

   valueOfFloatAttrib = resource.GetValueOfFloatAttributeByName("AttributeName")

 


   

GetValueOfStringAttributeByName(name: string): string

 

 

o

name

Name of attribute to search for

 

o

return

Value of the attribute

 

[Example]

   valueOfStringAttrib = resource.GetValueOfStringAttributeByName("AttributeName")

 


   

GetValueOfBoolAttributeByName(name: string): bool

 

 

o

name

Name of attribute to search for

 

o

return

Value of the attribute

 

[Example]

   valueOfBoolAttrib = resource.GetValueOfBoolAttributeByName("AttributeName")

 


 


Previous
Page précédente
Chapter
Page principale du chapitre
Next
Page suivante