Not sure what your question is, but it is very easy to use tcl/tk within skill and therefore other cdn apps such as Allegro DE HDL (formerly known as ConceptHDL). contact me directly if you like a copy of the white paper I presented at ICU2003.
Below is a very simple example of an tcl app that performs zoom functions in concept. Note that you need to install tcl/tk. you can get it at www.tcltk.com
=======================================================
;;set ConceptSKILL global variables
verbose = cnSetRunOptions(?result cnOUT_VERBOSE ?display cnOUT_VERBOSE)
silent = cnSetRunOptions(?result cnOUT_SILENT ?display cnOUT_SILENT)
(defun tclInterp (childID data)
;; send the command you recieved to concepthdl
cnSendCommand(cnhandle, data)
;; send the command back to tcl app
;; this is just to see that the data got to skill
ipcWriteProcess(childID data)
)
;; add the dfII/bin path to the path environment variable
;; otherwise the ipc server will not launch when ipcBeginProcess is invoked.
sprintf( dfii_bin_path ""%s\\tools\\dfII\\bin"" getShellEnvVar(""CDSROOT""))
setShellEnvVar( sprintf(nil ""path=%s;%s"" getShellEnvVar(""path"") , dfii_bin_path ) )
cnhandle = cnmpsImport()
tclp = ipcBeginProcess(""wish tcl_skill.tcl"" """" 'tclInterp )
=========================================================
Here is the tcl program (name it tcl_skill.tcl
otrherwise the ipcBeginProcess call will do nothing):
=========================================================
#!/usr/bin/sh
#\
exec wish ""$0"" ""$@""
# prog below used to send data to skill on stdout
proc TCLSkill_Send {command} {
set list [file channels]
puts stdout $command
flush stdout
}
# prog used to display recieved data
proc TCLSkill_Recv {} {
set response [read stdin]
while {! [info complete $response]} {
append response [read stdin]
}
# print the reponse in the text widget
.t insert end ""R> $response""
.t yview moveto 1
}
button .b1 -text ""zoom in"" -command [list TCLSkill_Send ""zoom in""]
button .b2 -text ""zoom out"" -command [list TCLSkill_Send ""zoom out""]
button .b3 -text ""zoom fit"" -command [list TCLSkill_Send ""zoom fit""]
grid .b1 -in . -row 0 -column 0 -sticky nswe -padx 10 -pady 10
grid .b2 -in . -row 1 -column 0 -sticky nswe -padx 10 -pady 10
grid .b3 -in . -row 2 -column 0 -sticky nswe -padx 10 -pady 10
text .t -width 50 -height 10
grid .t -in . -row 3 -column 0 -sticky nswe
update
update idletasks
# configure stdin channel so we can recieve data and deal with it to....
fconfigure stdin -buffering none -blocking 0 -translation auto
fileevent stdin readable ""TCLSkill_Recv""
wm title . ""TCL/Skill""
Hope this helps
Andy
Message was edited by: Andy_Kulik
Originally posted in cdnusers.org by Andy_Kulik