home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
drssmitemo.tcl
< prev
next >
Wrap
Text File
|
1997-08-29
|
5KB
|
166 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)drssmitemo.tcl /main/titanic/4
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)drssmitemo.tcl /main/titanic/4 29 Aug 1997 Copyright 1997 Cayenne Software Inc.
# Start user added include file section
require reqdriver.tcl
# End user added include file section
require "drsitemobj.tcl"
Class DrsSMItemObject : {DrsItemObject} {
method destructor
constructor
method getEditorTypes
method linkComponents
method levelName
method levelType
attribute semTypeName
attribute smObject
}
method DrsSMItemObject::destructor {this} {
# Start destructor user section
# End destructor user section
$this DrsItemObject::destructor
}
constructor DrsSMItemObject {class this smObject system systemV} {
set workItem [$smObject getWorkItem]
set this [DrsItemObject::constructor $class $this $workItem $system $systemV]
$this smObject $smObject
set semType [$smObject getSemType]
$this semTypeName [ReqDriver::getSMTypeName $semType]
return $this
}
method DrsSMItemObject::getEditorTypes {this} {
set smObject [$this smObject]
set semType [$smObject getSemType]
set semType [$semType name]
if {[llength $semType] == 2} {
return [string tolower [lindex $semType 0]]
}
if {$semType == "Class"} {
return "cad ccd etd std"
}
if {$semType == "Event"} {
return "mgd etd ccd ucd std"
}
if {$semType == "EventSender" || $semType == "EventReceiver"} {
return "ccd std etd ucd"
}
return [string tolower [lindex $semType 0]]
}
method DrsSMItemObject::linkComponents {this currDoorsObject} {
set dxlCommand [$this dxlCommand]
set semTypeNames [m4_var get M4_doors_semantic_types]
set smTypes ""
foreach smTypeName $semTypeNames {
set smType [SMTypeDB::find $smTypeName]
if ![$smType isNil] {
lappend smTypes $smType
}
}
set otConnections [m4_var get M4_doors_connections_link_module]
$dxlCommand doorsObjectDeleteLinks $currDoorsObject $otConnections
set smObject [$this smObject]
if [$smObject isA SMConnector] {
# this is a link connector
set smConnector $smObject
foreach smType $smTypes {
set smFrom [$smConnector getFrom $smType]
if ![llength $smFrom] {
continue
}
set fromWorkItem [$smFrom getWorkItem]
if [$fromWorkItem isNil] {
continue
}
set itemProps [$fromWorkItem properties]
set fromDrsId [$itemProps getPropertyValue ${DrsDriver::FORMALMODULE}]
if ![llength $fromDrsId] {
continue
}
set fromDrsObj [$dxlCommand doorsObjectFind $fromDrsId]
$dxlCommand doorsObjectCreateLink $currDoorsObject $fromDrsObj\
$otConnections
}
foreach smType $smTypes {
set smTo [$smConnector getTo $smType]
if ![llength $smTo] {
continue
}
set toWorkItem [$smTo getWorkItem]
if [$toWorkItem isNil] {
continue
}
set itemProps [$toWorkItem properties]
set toDrsId [$itemProps getPropertyValue ${DrsDriver::FORMALMODULE}]
if ![llength $toDrsId] {
continue
}
set toDrsObj [$dxlCommand doorsObjectFind $toDrsId]
$dxlCommand doorsObjectCreateLink $toDrsObj $currDoorsObject\
$otConnections
}
return
}
# current isa node
set smNode $smObject
foreach connType $smTypes {
foreach oppType $smTypes {
foreach smConn [$smNode getConnectorsIn $connType $oppType] {
set connWorkItem [$smConn getWorkItem]
if [$connWorkItem isNil] {
continue
}
set itemProps [$connWorkItem properties]
set connDrsId [$itemProps getPropertyValue ${DrsDriver::FORMALMODULE}]
if ![llength $connDrsId] {
continue
}
set connDrsObj [$dxlCommand doorsObjectFind $connDrsId]
$dxlCommand doorsObjectCreateLink $currDoorsObject \
$connDrsObj $otConnections
}
foreach smConn [$smNode getConnectorsOut $connType $oppType] {
set connWorkItem [$smConn getWorkItem]
if [$connWorkItem isNil] {
continue
}
set itemProps [$connWorkItem properties]
set connDrsId [$itemProps getPropertyValue ${DrsDriver::FORMALMODULE}]
if ![llength $connDrsId] {
continue
}
set connDrsObj [$dxlCommand doorsObjectFind $connDrsId]
$dxlCommand doorsObjectCreateLink $connDrsObj \
$currDoorsObject $otConnections
}
}
}
}
method DrsSMItemObject::levelName {this} {
set smObject [$this smObject]
set item [$this item]
return "[$item name].[$this levelType]"
}
method DrsSMItemObject::levelType {this} {
return [$this semTypeName]
}
# Do not delete this line -- regeneration end marker