]> OCCT Git - occt-wok.git/commitdiff
wsrc,wadm,winc aliaces will work both in workbench and in unit
authorcascade <cascade@opencascade.com>
Wed, 11 Jun 2003 19:43:58 +0000 (19:43 +0000)
committercascade <cascade@opencascade.com>
Wed, 11 Jun 2003 19:43:58 +0000 (19:43 +0000)
src/WOKTclLib/WCOMPATIBLE.tcl

index 92fdf79de64aefa00d4203d75d665a6abb1f9a87..054ebcd5848fca12114c22bdbc404f048146d9ac 100755 (executable)
@@ -12,33 +12,168 @@ proc wcd { args } {
     return
 
 }
-
 proc wsrc {{entity ""}} {
-    if { $entity != "" } { wokcd -Tsrcdir $entity } {wokcd -Tsrcdir}
+    if { $entity != "" } { 
+      if {[wokinfo -t $entity] == "workbench"} {
+          wokcd -Tsrcdir $entity 
+      } 
+      if {[wokinfo -t $entity] == "devunit"} {
+           wokcd -T source $entity
+      }          
+    } else {
+      if {[wokinfo -t [wokcd]] == "workbench"} { 
+          wokcd -Tsrcdir
+      }
+      if {[wokinfo -t [wokcd]] == "devunit"} {
+           wokcd -T source 
+      }          
+
+    }
 }
 
+
+;#proc wdrv {{entity ""}} {
+;#   if { $entity != "" } { wokcd -Tdrvdir $entity } {wokcd -Tdrvdir}
+;#}
 proc wdrv {{entity ""}} {
-    if { $entity != "" } { wokcd -Tdrvdir $entity } {wokcd -Tdrvdir}
+    if { $entity != "" } { 
+      if {[wokinfo -t $entity] == "workbench"} {
+          wokcd -Tdrvdir $entity 
+      } 
+      if {[wokinfo -t $entity] == "devunit"} {
+           wokcd -T derivated $entity
+      }          
+    } else {
+      if {[wokinfo -t [wokcd]] == "workbench"} { 
+          wokcd -Tdrvdir
+      }
+      if {[wokinfo -t [wokcd]] == "devunit"} {
+           wokcd -T derivated 
+      }          
+
+    }
 }
 
+
+;#proc wlib {{entity ""}} {
+;#    if { $entity != "" } { wokcd -Tlibdir $entity } {wokcd -Tlibdir}
+;#}
+
 proc wlib {{entity ""}} {
-    if { $entity != "" } { wokcd -Tlibdir $entity } {wokcd -Tlibdir}
+    if { $entity != "" } { 
+      if {[wokinfo -t $entity] == "workbench"} {
+          wokcd -Tlibdir $entity 
+      } 
+      if {[wokinfo -t $entity] == "devunit"} {
+           wokcd -T library $entity
+      }          
+    } else {
+      if {[wokinfo -t [wokcd]] == "workbench"} { 
+          wokcd -Tlibdir
+      }
+      if {[wokinfo -t [wokcd]] == "devunit"} {
+           wokcd -T library 
+      }          
+
+    }
 }
 
+;#proc wbin {{entity ""}} {
+;#    if { $entity != "" } { wokcd -Tbindir $entity } {wokcd -Tbindir}
+;#}
+
 proc wbin {{entity ""}} {
-    if { $entity != "" } { wokcd -Tbindir } {wokcd -Tbindir}
+    if { $entity != "" } { 
+      if {[wokinfo -t $entity] == "workbench"} {
+          wokcd -Tbindir $entity 
+      } 
+      if {[wokinfo -t $entity] == "devunit"} {
+           wokcd -T executable $entity
+      }          
+    } else {
+      if {[wokinfo -t [wokcd]] == "workbench"} { 
+          wokcd -Tbindir
+      }
+      if {[wokinfo -t [wokcd]] == "devunit"} {
+           wokcd -T executable 
+      }          
+
+    }
 }
+
+
+;#proc wobj {{entity ""}} {
+;#    if { $entity != "" } { wokcd -Tobjdir $entity } {wokcd -Tobjdir}
+;#}
+
 proc wobj {{entity ""}} {
-    if { $entity != "" } { wokcd -Tobjdir } {wokcd -Tobjdir}
+    if { $entity != "" } { 
+      if {[wokinfo -t $entity] == "workbench"} {
+          wokcd -Tobjdir $entity 
+      } 
+      if {[wokinfo -t $entity] == "devunit"} {
+           wokcd -T object $entity
+      }          
+    } else {
+      if {[wokinfo -t [wokcd]] == "workbench"} { 
+          wokcd -Tobjdir
+      }
+      if {[wokinfo -t [wokcd]] == "devunit"} {
+           wokcd -T object 
+      }          
+
+    }
 }
+
+
+;#proc winc {{entity ""}} {
+;#    if { $entity != "" } { wokcd -Tpubincdir $entity } {wokcd -Tpubincdir}
+;#}
+
 proc winc {{entity ""}} {
-    if { $entity != "" } { wokcd -Tpubincdir $entity } {wokcd -Tpubincdir}
+    if { $entity != "" } { 
+      if {[wokinfo -t $entity] == "workbench"} {
+          wokcd -Tpubincdir $entity 
+      } 
+      if {[wokinfo -t $entity] == "devunit"} {
+           wokcd -T pubinclude $entity
+      }          
+    } else {
+      if {[wokinfo -t [wokcd]] == "workbench"} { 
+          wokcd -Tpubincdir
+      }
+      if {[wokinfo -t [wokcd]] == "devunit"} {
+           wokcd -T pubinclude 
+      }          
+
+    }
 }
+
+
+;#proc wadm {{entity ""}} {
+;#    if { $entity != "" } { wokcd -Tadmfile $entity } {wokcd -Tadmfile}
+;#}
 proc wadm {{entity ""}} {
-    if { $entity != "" } { wokcd -Tadmfile $entity } {wokcd -Tadmfile}
+    if { $entity != "" } { 
+      if {[wokinfo -t $entity] == "workbench"} {
+          wokcd -T AdmDir $entity 
+      } 
+      if {[wokinfo -t $entity] == "devunit"} {
+           wokcd -T admfile $entity
+      }          
+    } else {
+      if {[wokinfo -t [wokcd]] == "workbench"} { 
+          wokcd -T AdmDir
+      }
+      if {[wokinfo -t [wokcd]] == "devunit"} {
+           wokcd -T admfile 
+      }          
+
+    }
 }
 
 
+
 proc wls { args } {
     set f [lsearch -regexp $args {-[pnijCtexscfOrd]} ]
     if { $f != -1 } {