home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1997 November
/
PCWorld_1997-11_cd.bin
/
software
/
programy
/
komix
/
DATA.Z
/
communications.tcl
< prev
next >
Wrap
Text File
|
1996-12-16
|
3KB
|
106 lines
#---------------------------------------------------------------------------
#
# (c) Cadre Technologies Inc. 1995
#
# File: @(#)communications.tcl /main/hindenburg/4
# Author: Harm Leijendeckers
# Description: Report on communications
# Usage in: SystemVersion and CCD editor
#
#---------------------------------------------------------------------------
# SccsId = @(#)communications.tcl /main/hindenburg/4 16 Dec 1996 Copyright 1995 Cadre Technologies Inc.
eval [$cc getCustomFileContents semanticbase tcl reports]
Class ReportCommunications : {SemanticBase} {
constructor
method doReport
method printConnector
}
constructor ReportCommunications {class this} {
set this [SemanticBase::constructor $class $this]
$this reportName "CCD Communications"
return $this
}
method ReportCommunications::doReport {this model} {
# get all CCD Classes
set classes [concat [$model getSMObjects $OMT_CCD_Node]]
if [lempty $classes] { return 0 }
set report [$this report]
set sortedClasses [concat \
[query "getItem.isNil == 1" $classes] \
[osort getItem.name [query "getItem.isNil == 0" $classes]]]
foreach class $sortedClasses {
set eventsSent [$class getConnectorsOut $OMT_CCD_Message $ANY]
set eventsRcvd [$class getConnectorsIn $OMT_CCD_Message $ANY]
if { [lempty $eventsSent] && [lempty $eventsRcvd] } {
continue
}
set type [query -s type $class.getComponents]
$report print "[$this objName $class] ($type)" line
# all events sent
if ![lempty $eventsSent] {
$report space 2
$report print Sends 40
$report print To 38
$report print In line
foreach sentEvent $eventsSent {
$this printConnector $sentEvent out
}
}
# all events received
if ![lempty $eventsRcvd] {
$report space 2
$report print Receives 40
$report print From 38
$report print In line
foreach rcvdEvent $eventsRcvd {
$this printConnector $rcvdEvent in
}
}
$report line
}
$report page
return 0
}
method ReportCommunications::printConnector {this conn io} {
set report [$this report]
$report space 4
$report print [$this objName $conn] 39
$report space
if { $io == "in" } {
set toComp [$conn getFrom $OMT_CCD_Node]
} else {
set toComp [$conn getTo $OMT_CCD_Node]
}
set type [query -s type $toComp.getComponents]
$report print "[$this objName $toComp] ($type)" 37
$report space
$report print [$this fullFileName [$conn getDefiningDiagram]] line
}
# ----------------------------------------------------------------------
#
set executeMe [ReportCommunications new]