📄 test.tcl
字号:
proc ShowPortProp {Port} { global fp puts $fp " <---- properties ----" puts $fp " npiName=[npi_get $Port -npiName]" puts $fp " npiFullName=[npi_get $Port -npiFullName]" puts $fp " npiType=[npi_get $Port -npiType]" puts $fp " npiFile=[npi_get $Port -npiFile]" puts $fp " npiLineNo=[npi_get $Port -npiLineNo]" puts $fp " npiPortIndex=[npi_get $Port -npiPortIndex]" puts $fp " npiDirection=[npi_get $Port -npiDirection]" puts $fp " npiSize=[npi_get $Port -npiSize]" puts $fp " npiIsConnByName=[npi_get $Port -npiIsConnByName]" puts $fp " npiIsExplicitName=[npi_get $Port -npiIsExplicitName]" puts $fp " npiIsVector=[npi_get $Port -npiIsVector]" puts $fp " npiIsScalar=[npi_get $Port -npiIsScalar]" puts $fp " >---- properties ----"}proc foreach_IterateHandle {iter_handle iter_type} { global fp set Object_Handle [npi_scan $iter_handle] puts $fp " <---$iter_type--->" while {$Object_Handle != "NULL"} { puts $fp " <---begin npi_scan \$iter_handle--->" puts $fp " npiType = [npi_get $Object_Handle -npiType]" puts $fp " npiName = [npi_get $Object_Handle -npiName]" puts $fp " npiLineNo = [npi_get $Object_Handle -npiLineNo]" puts $fp " <---end of npi_scan \$iter_handle--->" set Object_Handle [npi_scan $iter_handle] } puts $fp " <---end of $iter_type--->"}proc ShowHandleProp {Handle type} { global fp puts $fp " <---$type --->" puts $fp " npiType = [npi_get $Handle -npiType]" puts $fp " npiName = [npi_get $Handle -npiName]" puts $fp " npiLineNo = [npi_get $Handle -npiLineNo]" puts $fp " <---end of $type --->"}proc ShowPortRelationship {Port} { global fp puts $fp " <---relationship --->" set Scope [npi_handle $Port -npiType npiScope] ShowHandleProp $Scope Scope set HighConn [npi_handle $Port -npiType npiHighConn] ShowHandleProp $HighConn HighConn set LowConn [npi_handle $Port -npiType npiLowConn] ShowHandleProp $LowConn LowConn set PortInst [npi_handle $Port -npiType npiPortInst] ShowHandleProp $PortInst PortInst puts $fp " <---end of relationship --->"}proc ShowPortPropAndRelationship {} { global g_Port global fp set Port $g_Port puts $fp "<---begin showing Port information--->" ShowPortProp $Port ShowPortRelationship $Port puts $fp "<---end of showing Port information--->"} set log_file [file join [file dirname [info script]] [file tail [info script]].out]set fp [open $log_file w]fconfigure $fp -buffering nonenpi_register_cb -npiModuleBased Port ShowPortPropAndRelationshipnpi_traverse_model -npiModuleBasedclose $fp
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -