home *** CD-ROM | disk | FTP | other *** search
- #---------------------------------------------------------------------------
- #
- # (c) Westmount Technology 1995
- #
- # File: @(#)ude.tcl /main/titanic/6
- # Author: Fred Mol
- # Description: main ude.tcl
- #---------------------------------------------------------------------------
- # SccsId = @(#)ude.tcl /main/titanic/6 27 Nov 1997Copyright 1995 Westmount Technology
-
- OtkRegister::extGui
-
- source [m4_path_name tcl libocl.tcl]
-
- require platform.tcl
- require procs.tcl
- require messagehdl.tcl
- require caynutil.tcl
-
- proc usage {} {
- error "Usage: otk ude.tcl -- \
- \[-c caller\] \
- \[-r\] \
- levelPath | levelPathIds"
- }
-
- set argc 0
- set status INITIAL
- set readOnly 0
- set caller ""
- foreach arg $argv {
- case $arg in {
- {-c} {
- if {$status != "INITIAL"} {
- usage
- }
- set status CALLER
- }
- {-r} {
- if {$status != "INITIAL"} {
- usage
- }
- set readOnly 1
- }
- {default} {
- case $status in {
- {CALLER} {
- set caller $arg
- set status INITIAL
- }
- {INITIAL} {
- set idx [lsearch $argv $arg]
- set currArg $idx
- incr idx 3
- set argvl [llength $argv]
- if {$idx == $argvl} {
- # old style open: with fileV,systemV,configV
- # for compatibility, try to avoid usage
- set fvArg [lindex $argv $currArg]
- incr currArg
- set svArg [lindex $argv $currArg]
- incr currArg
- set cvArg [lindex $argv $currArg]
-
- if [catch {set fv [Graph new $fvArg]}] {
- usage
- }
- if [catch {set sv [SystemVersion new $svArg]}] {
- usage
- }
- if [catch {set cv [ConfigVersion new $cvArg]}] {
- usage
- }
-
- set cc [ClientContext::global]
- set corp [$cc currentCorporate]
- set proj [$cv project]
- set phase \
- [$cv findPhaseVersion -byPhase [$sv phase]]
- set str /[$corp identity]
- append str /[$proj identity]
- append str /[$cv identity]
- append str /[$phase identity]
- append str /[$sv identity]
- append str /[$fv identity]
- set levelPath $str
- incr argc 2
- } else {
- # levelpath
- if [catch {set levelPath $arg}] {
- usage
- }
-
- }
- set status LEVELPATH
- }
- {LEVELPATH} {
- break
- }
- {default} {
- usage
- }
- }
- }
- }
- incr argc 1
- }
- if {$status != "LEVELPATH"} {
- usage
- }
- if [catch {set levelPathObj [LevelPath new $levelPath]}] {
- usage
- }
- if [catch {set fv [$levelPathObj nameAt File]}] {
- usage
- }
- if [isObjectId $fv Graph:] {
- set type [[[Graph new $fv] file] type]
- } else {
- set type [nt_get_type $levelPath]
- }
-
- require "${type}editor.tcl"
- sourceOptional u_ude
-
- [string toupper $type]Editor new .main \
- -permanentReadOnly $readOnly \
- -caller "$caller" \
- -diagramType $type \
- -firstExposed ".main startEdit $levelPath"
- .main popUp
- .main ready
-