Context Object Parameters
Parameter Name | Type | Read or Write | Comments |
---|
iEqtPort | EleLogicalConnectorPort | Read | The port of the equipment |
iEqtPin | EleLogicalPin | Read | The pin of the equipment |
ostrPortName | String |
Write | The name of the output port |
ostrPinName | String | Write | The name of the output pin in the output port |
Sample
/* Rule : ELE_GetEquipmentByPass */
// input args
let eqtPin(EleLogicalPin)
let eqtPort(EleLogicalConnectorPort)
// output args
let strPinOut(String)
let strPortOut(String)
let segreg(String)
let pos(Integer)
let seglength(Integer)
strPinOut = ""
strPortOut = ""
set eqtPort = Parameters.GetAttributeObject("iEqtPort")
set eqtPin = Parameters.GetAttributeObject("iEqtPin")
// Read value in "Segregation" field - we search for a value formated : "CntPort.PinNum"
if (NULL <> eqtPin And NULL <> eqtPort)
{
//ok to get input pin and port
segreg = eqtPin->GetAttributeString("V_Elec_SepCode")
pos = segreg->Search(".",0,TRUE)
seglength = segreg->Length()
if (pos <> -1) {
strPortOut = segreg->Extract(0, pos)
strPinOut = segreg->Extract(pos + 1 , seglength - 1 - pos)
}
}
Parameters.SetAttributeString("ostrPortName", strPortOut)
Parameters.SetAttributeString("ostrPinName", strPinOut)