home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 1998 October
/
PCWorld_1998-10_cd.bin
/
software
/
prehled
/
komix
/
DATA.Z
/
drstreeobj.tcl
< prev
next >
Wrap
Text File
|
1997-08-29
|
5KB
|
165 lines
#---------------------------------------------------------------------------
#
# (c) Cayenne Software Inc. 1997
#
# File: @(#)drstreeobj.tcl /main/titanic/4
# Author: <generated>
# Description:
#---------------------------------------------------------------------------
# SccsId = @(#)drstreeobj.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 "drsobject.tcl"
Class DrsTreeObject : {DrsObject} {
constructor
method destructor
method getChildLevels
method getParentPropertyObject
method getPropertyObject
method getTimeStampObject
method synObjects
method saveReference
method deleteObsolete
method show
method filter
method getLevelV
attribute childLevels
}
constructor DrsTreeObject {class this level} {
set this [DrsObject::constructor $class $this $level]
# Start constructor user section
# End constructor user section
return $this
}
method DrsTreeObject::destructor {this} {
# Start destructor user section
# End destructor user section
$this DrsObject::destructor
}
method DrsTreeObject::getChildLevels {this} {
return [$this childLevels]
}
method DrsTreeObject::getParentPropertyObject {this} {
return [$this parentLevel]
}
method DrsTreeObject::getPropertyObject {this} {
return [$this level]
}
method DrsTreeObject::getTimeStampObject {this} {
return [$this getLevelV]
}
method DrsTreeObject::synObjects {this} {
set levelType [$this levelType]
set levelName [$this levelName]
[.main messageArea] message "Checking Diagram Objects of $levelType $levelName"
set currObject [$this level]
set currVersId [$this versionId]
set parVOfChildLevDict [Dictionary new]
set childInDoorsDict [Dictionary new]
$childInDoorsDict contents \
[$currObject getPropertyValue ${DrsDriver::FORMALMODULE}_SelectedItems]
# for each selected item and its versions which is selected in one
# of the versions of the curren phase
set thisChildLevelVersions [$this childLevelVersions]
$childInDoorsDict foreach childName childVersionIds {
set childLevels [$this getChildLevels]
set childLevel [ReqDriver::searchOnName $childLevels $childName]
if ![llength $childLevel ] {
continue
}
if [$childLevel isA WorkItem] {
set childLevel [$childLevel properties]
}
# the back reference
$parVOfChildLevDict contents [$childLevel getPropertyValue \
${DrsDriver::FORMALMODULE}_ParentOTVersions]
$parVOfChildLevDict foreach childVersId childsParentVersIds {
if { [lsearch $childsParentVersIds $currVersId] != -1 } {
if ![llength [ReqDriver::searchOnNameAndVersion $thisChildLevelVersions\
$childName $childVersId]] {
$this deleteObsolete $childLevel $childVersId $currObject $currVersId
}
}
}
}
return "1"
}
method DrsTreeObject::saveReference {this levelObject doorsRef selItems} {
set thisLevel [$this level]
set doorsRef [lindex $doorsRef 0]
$levelObject setProperty ${DrsDriver::FORMALMODULE} $doorsRef
# for synchronization, just a dummy
set propObj [$this getPropertyObject]
set timeStamp ""
$propObj setProperty ${DrsDriver::FORMALMODULE}_TIMESTAMP $timeStamp
# now the real time stamp
set timeStampObj [$this getTimeStampObject]
set timeStamp [$timeStampObj updateTime]
$levelObject setProperty ${DrsDriver::FORMALMODULE}_TIMESTAMP $timeStamp
#$this addDoorsRefToCorp [[$thisLevel project] name] $doorsRef
set parentLevel [$this getParentPropertyObject]
$parentLevel setProperty ${DrsDriver::FORMALMODULE}_SelectedItems $selItems
}
method DrsTreeObject::deleteObsolete {this childLevel childVersId currObject currVersId} {
if [$childLevel isA ItemProperties] {
set childLevel [$childLevel workItem]
set doorsObject [DrsSMItemObject new $childLevel \
$childVersId $currObject $currVersId]
} else {
set doorsObject [Drs[$childLevel ORB_class]Object new \
$childLevel $childVersId $currObject $currVersId]
}
$doorsObject synObjects
$doorsObject deleteObject
}
method DrsTreeObject::show {this majorOper minorOper} {
set levelName [$this levelName]
set levelType [$this levelType]
[.main messageArea] message "Processing $levelName"
set dxlCommand [$this dxlCommand]
set thisLevel [$this getPropertyObject]
set doorsObjectId [$thisLevel getPropertyValue ${DrsDriver::FORMALMODULE}]
if {[llength $doorsObjectId] && $doorsObjectId > 0 } {
set doorsObject [$dxlCommand doorsObjectFind $doorsObjectId]
$dxlCommand doorsObject$majorOper $doorsObject $minorOper
}
}
method DrsTreeObject::filter {this majorOper minorOper} {
set dxlCommand [$this getDxlCommand]
if {$minorOper == "All"} {
$dxlCommand doorsObject$majorOper "" $minorOper
return
}
$this show $majorOper $minorOper
return [$this dxlCommand]
}
method DrsTreeObject::getLevelV {this} {
}
# Do not delete this line -- regeneration end marker