[GiDlist] Re: exec command
Moderator: GiD Team
[GiDlist] About trimmed NURBS
Hello,
My personal web page should be working again.
There is plenty of source code about NURBS in Internet. The problem
is that it has the basement but it is not normally too reliable.
Specially
for complex operations like intersections, tessellation and so on. Maybe
you can check the OpenGL companion, the GLU library, that has
tessellation
routines for NURBS and that now can be obtained with source code. Search
in:
www.opengl.org
A last comment: Trimmed NURBS surfaces are MUCH, MUCH more difficult
than
plain NURBS for some operations like tessellation, visualization and
others.
Do not hesitate to explain in this list your experiences and
successes in
these issues.
Regards,
--
Compass Ing. y Sistemas Dr. Ramon Ribo
http://www.compassis.com ramsan at compassis.com
c/ Manuel Girona, 61 bajos tel. +34 93 204 10 82
08034 Barcelona, Spain fax. +34 93 204 19 09
-----Mensaje original-----
De: gidlist-admin at gatxan.cimne.upc.es
[mailto:gidlist-admin at gatxan.cimne.upc.es] En nombre de ieea
Enviado el: miércoles, 02 de abril de 2003 9:20
Para: gidlist at gatxan.cimne.upc.es
Asunto: Re: [GiDlist] About trimmed NURBS
Dear Ramon Ramsan,
Thank you for your response. I am sorry being late to answer you... We
noticed that the server corresponding to your web site is now out, so it
is difficult for us to read your papers. Nevertheless, we have yet a
good experience using NURBS surfaces and especially how to read GID
ASCII files of geometry. In fact, we are looking for a software (C or
Fortran sources) which could help us to well study our GID's geometries
without creating mistakes, in particular with the trimmed surfaces which
are small different than the others. If you could advice us a good web
site, it would be great !
Thank you again for you answer and congratulations for GID.
G.W.R. Geis
Hello,
the surface contains an indicator for every line contained inside
it (SAME1ST or DIFF1ST). It tell if the line is to be taken in its
natural orientation or in the inverse. Then, a line has the existent
part of the surface in the anticlockwise side, taking as orientation
rule the right hand rule related to the normal of the surface.
If you want to implement the math's of it, you will have some
work.
You can find some pointers to some scientifical papers in my web
page where to find more:
http://gatxan.cimne.upc.es/ramsan
Regards,
--
Compass Ing. y Sistemas Dr. Ramon Ribo
http://www.compassis.com ramsan at compassis.com
c/ Manuel Girona, 61 bajos tel. +34 93 204 10 82
08034 Barcelona, Spain fax. +34 93 204 19 09
-----Mensaje original-----
De: gidlist-admin at gatxan.cimne.upc.es
[mailto:gidlist-admin at gatxan.cimne.upc.es] En nombre de ieea Enviado
el: martes, 18 de marzo de 2003 14:24
Para: GID
Asunto: [GiDlist] About trimmed NURBS
Dear All,
Now I'm developing a ray tracer with GID using NURBS surfaces.
I get the object description from the ASCII project.geo file. It
works very well on untrimmed NURBS surfaces, but I would like to
extend it to trimmed surfaces.
For the moment, I'm able to extract the 3D trimming curves and their
orientations. Is it possible to use these informations to implement an
efficient inside test ?
Generally speaking, could you tell me how GID can detect the inside
from the outside of the trimmed NURBS ?
Thank you in advance,
G.W.R. Geis
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
My personal web page should be working again.
There is plenty of source code about NURBS in Internet. The problem
is that it has the basement but it is not normally too reliable.
Specially
for complex operations like intersections, tessellation and so on. Maybe
you can check the OpenGL companion, the GLU library, that has
tessellation
routines for NURBS and that now can be obtained with source code. Search
in:
www.opengl.org
A last comment: Trimmed NURBS surfaces are MUCH, MUCH more difficult
than
plain NURBS for some operations like tessellation, visualization and
others.
Do not hesitate to explain in this list your experiences and
successes in
these issues.
Regards,
--
Compass Ing. y Sistemas Dr. Ramon Ribo
http://www.compassis.com ramsan at compassis.com
c/ Manuel Girona, 61 bajos tel. +34 93 204 10 82
08034 Barcelona, Spain fax. +34 93 204 19 09
-----Mensaje original-----
De: gidlist-admin at gatxan.cimne.upc.es
[mailto:gidlist-admin at gatxan.cimne.upc.es] En nombre de ieea
Enviado el: miércoles, 02 de abril de 2003 9:20
Para: gidlist at gatxan.cimne.upc.es
Asunto: Re: [GiDlist] About trimmed NURBS
Dear Ramon Ramsan,
Thank you for your response. I am sorry being late to answer you... We
noticed that the server corresponding to your web site is now out, so it
is difficult for us to read your papers. Nevertheless, we have yet a
good experience using NURBS surfaces and especially how to read GID
ASCII files of geometry. In fact, we are looking for a software (C or
Fortran sources) which could help us to well study our GID's geometries
without creating mistakes, in particular with the trimmed surfaces which
are small different than the others. If you could advice us a good web
site, it would be great !
Thank you again for you answer and congratulations for GID.
G.W.R. Geis
Hello,
the surface contains an indicator for every line contained inside
it (SAME1ST or DIFF1ST). It tell if the line is to be taken in its
natural orientation or in the inverse. Then, a line has the existent
part of the surface in the anticlockwise side, taking as orientation
rule the right hand rule related to the normal of the surface.
If you want to implement the math's of it, you will have some
work.
You can find some pointers to some scientifical papers in my web
page where to find more:
http://gatxan.cimne.upc.es/ramsan
Regards,
--
Compass Ing. y Sistemas Dr. Ramon Ribo
http://www.compassis.com ramsan at compassis.com
c/ Manuel Girona, 61 bajos tel. +34 93 204 10 82
08034 Barcelona, Spain fax. +34 93 204 19 09
-----Mensaje original-----
De: gidlist-admin at gatxan.cimne.upc.es
[mailto:gidlist-admin at gatxan.cimne.upc.es] En nombre de ieea Enviado
el: martes, 18 de marzo de 2003 14:24
Para: GID
Asunto: [GiDlist] About trimmed NURBS
Dear All,
Now I'm developing a ray tracer with GID using NURBS surfaces.
I get the object description from the ASCII project.geo file. It
works very well on untrimmed NURBS surfaces, but I would like to
extend it to trimmed surfaces.
For the moment, I'm able to extract the 3D trimming curves and their
orientations. Is it possible to use these informations to implement an
efficient inside test ?
Generally speaking, could you tell me how GID can detect the inside
from the outside of the trimmed NURBS ?
Thank you in advance,
G.W.R. Geis
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
[GiDlist] Re: exec command
Hi GiD support,
I am using the command "exec" in my tcl scripts and it's running fine
except that it prints out my progress messages in the error box! Is there
a way to customize the error box, such as modifying the text on the title
bar and changing the dimensions of the error box? If not, is there a way
to disable the error box and bring out a message window or dos prompt
window that can monitor my progress messages? I'm running GiD v6.3
(windows version) on Windows2000 Pro O/S. Thanks.
Tom
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20030425/a19e8d70/attachment.htm
I am using the command "exec" in my tcl scripts and it's running fine
except that it prints out my progress messages in the error box! Is there
a way to customize the error box, such as modifying the text on the title
bar and changing the dimensions of the error box? If not, is there a way
to disable the error box and bring out a message window or dos prompt
window that can monitor my progress messages? I'm running GiD v6.3
(windows version) on Windows2000 Pro O/S. Thanks.
Tom
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20030425/a19e8d70/attachment.htm
[GiDlist] Re: exec command
the output messages resulting from the 'exec' command are printed
in the standard output. the 'exec' command does not display
any error box.
can you send a snapshot/picture of your "error box"?
and a snapshot of your code?
miguel
Thomas Chan wrote:
Hi GiD support,
I am using the command "exec" in my tcl scripts and it's running fine except that it prints out my progress messages in the error
box! Is there a way to customize the error box, such as modifying the text on the title bar and changing the dimensions of the
error box? If not, is there a way to disable the error box and bring out a message window or dos prompt window that can monitor
my progress messages? I'm running GiD v6.3 (windows version) on Windows2000 Pro O/S. Thanks.
Tom
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
--
--------------------------------------------------------------------------------
Miguel A. Pasenau de Riera miguel at cimne.upc.es http://gid.cimne.upc.es
in the standard output. the 'exec' command does not display
any error box.
can you send a snapshot/picture of your "error box"?
and a snapshot of your code?
miguel
Thomas Chan wrote:
Hi GiD support,
I am using the command "exec" in my tcl scripts and it's running fine except that it prints out my progress messages in the error
box! Is there a way to customize the error box, such as modifying the text on the title bar and changing the dimensions of the
error box? If not, is there a way to disable the error box and bring out a message window or dos prompt window that can monitor
my progress messages? I'm running GiD v6.3 (windows version) on Windows2000 Pro O/S. Thanks.
Tom
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
--
--------------------------------------------------------------------------------
Miguel A. Pasenau de Riera miguel at cimne.upc.es http://gid.cimne.upc.es
[GiDlist] Re: exec command
I not understand your question. What's the error box?. Your program prints to the standard output.
You can use catch to capture the exe output in a tcl variable
for example:
catch {exec yourprogram.exe yourparameters} ret
capture the progress messages of your program in the tcl "ret" variable.
Enrique Escolano
----- Original Message -----
From: Thomas Chan
To: gidlist at gatxan.cimne.upc.es
Sent: Friday, April 25, 2003 12:34 AM
Subject: [GiDlist] Re: exec command
Hi GiD support,
I am using the command "exec" in my tcl scripts and it's running fine except that it prints out my progress messages in the error box! Is there a way to customize the error box, such as modifying the text on the title bar and changing the dimensions of the error box? If not, is there a way to disable the error box and bring out a message window or dos prompt window that can monitor my progress messages? I'm running GiD v6.3 (windows version) on Windows2000 Pro O/S. Thanks.
Tom
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20030425/9edf1fa5/attachment.htm
You can use catch to capture the exe output in a tcl variable
for example:
catch {exec yourprogram.exe yourparameters} ret
capture the progress messages of your program in the tcl "ret" variable.
Enrique Escolano
----- Original Message -----
From: Thomas Chan
To: gidlist at gatxan.cimne.upc.es
Sent: Friday, April 25, 2003 12:34 AM
Subject: [GiDlist] Re: exec command
Hi GiD support,
I am using the command "exec" in my tcl scripts and it's running fine except that it prints out my progress messages in the error box! Is there a way to customize the error box, such as modifying the text on the title bar and changing the dimensions of the error box? If not, is there a way to disable the error box and bring out a message window or dos prompt window that can monitor my progress messages? I'm running GiD v6.3 (windows version) on Windows2000 Pro O/S. Thanks.
Tom
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20030425/9edf1fa5/attachment.htm
[GiDlist] Re: exec command
You have three posibilities:
* when using the exec command, redirect the output to a file
and run the program in background:
exec your_program.exe outputfile.txt &
end then create a procedure which reads this file and
fills a window till the program finishes
* To show the output of your program, if it prints to the standard output,
using the calculate command of GiD you have to, in the batch file,
redirect the output of your program to a file and let GiD know the name
of this file
http://www.gidhome.com/support/gid_15.subst#SEC232
http://www.gidhome.com/support/gid_15.subst#SEC234
http://www.gidhome.com/support/gid_15.subst#SEC235
http://www.gidhome.com/support/gid_15.subst#SEC236
for instance (the output file will have the name of the project.log)
YourProblemTypeBatchFile.bat:
============================
rem basename=%1
rem directory=%2
rem ProblemDirectory=%3
rem OutputFile: %1.log
del %1.post.res
%3\YourProgram.exe YourParameters( %1, ...) %1.log
move %1.FinalFile %1.post.res
* Using pipes you can read the output of your program and fill a window,
for instance:
set fi [ open " | YourProgram.exe"]
while { ![ eof $fi]} {
get $fi line_txt
# send $line_txt to a window/text widget
}
Hope it helps,
miguel
Thomas Chan wrote:
Thanks, Miguel. I think either the WarnWin or WarnWinText command are
helpful. The only thing I also want is to display the progress messages
DURING the run, since WarnWin or WarnWinText only displays the messages
after the run is finished. My runs can last from 1 mins to several hours
so the progress messages during the run is important. Do you have any
suggestion?
I tried using the Calculate command from GiD menu to run a batch file, it
runs but the command.exe window does not show up on the screen.
Thanks a bunch!
Tom
At 04:02 PM 4/25/2003 +0200, you wrote:
This is the dialog that appears when an error in TclTk appears.
in the man page of the 'exec' command
(http://www.gidhome.com/ManHtml/tcl8.4.2/html/TclCmd/exec.htm)
says that
"If any of the commands in the pipeline exit abnormally or are killed or
suspended, then exec will return an error and
the error message will include the pipeline's output followed by error
messages describing the abnormal terminations; the
errorCode variable will contain additional information about the last
abnormal termination encountered"
There is also the variable 'errorInfo' which contains the output till the
error was raised.
Among other information the 'errorCode' stores the exit code of your command.
So what you can do is this:
catch { exec $engine $projname}
if { "$errorCode" != "NONE"} {
# Here WarnWin can be substituted by your own window / treatment procedure
WarnWin "ErrorCode: $errorCode\nError: $errorInfo"
}
miguel
Thomas Chan wrote:
Thankyou for looking into this case, Miguel. Two files are attached.
Regards,
Tom
At 12:21 PM 4/25/2003 +0200, you wrote:
the output messages resulting from the 'exec' command are printed
in the standard output. the 'exec' command does not display
any error box.
can you send a snapshot/picture of your "error box"?
and a snapshot of your code?
miguel
Thomas Chan wrote:
Hi GiD support,
I am using the command "exec" in my tcl scripts and it's running fine
except that it prints out my progress messages in the error
box! Is there a way to customize the error box, such as modifying the
text on the title bar and changing the dimensions of the
error box? If not, is there a way to disable the error box and bring
out a message window or dos prompt window that can monitor
my progress messages? I'm running GiD v6.3 (windows version) on
Windows2000 Pro O/S. Thanks.
Tom
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
--
-----------------------------------------------------------------------
---------
Miguel A. Pasenau de
Riera miguel at cimne.upc.es http://gid.cimne.upc.es
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
------------------------------------------------------------------------------------------------------------------------------------
Name: messages.doc
messages.doc Type: Microsoft Word Document (application/msword)
Encoding: base64
FEM.tclName: FEM.tcl
Type: Plain Text (text/plain)
--
--------------------------------------------------------------------------------
Miguel A. Pasenau de
Riera miguel at cimne.upc.es http://gid.cimne.upc.es
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
--
--------------------------------------------------------------------------------
Miguel A. Pasenau de Riera miguel at cimne.upc.es http://gid.cimne.upc.es
* when using the exec command, redirect the output to a file
and run the program in background:
exec your_program.exe outputfile.txt &
end then create a procedure which reads this file and
fills a window till the program finishes
* To show the output of your program, if it prints to the standard output,
using the calculate command of GiD you have to, in the batch file,
redirect the output of your program to a file and let GiD know the name
of this file
http://www.gidhome.com/support/gid_15.subst#SEC232
http://www.gidhome.com/support/gid_15.subst#SEC234
http://www.gidhome.com/support/gid_15.subst#SEC235
http://www.gidhome.com/support/gid_15.subst#SEC236
for instance (the output file will have the name of the project.log)
YourProblemTypeBatchFile.bat:
============================
rem basename=%1
rem directory=%2
rem ProblemDirectory=%3
rem OutputFile: %1.log
del %1.post.res
%3\YourProgram.exe YourParameters( %1, ...) %1.log
move %1.FinalFile %1.post.res
* Using pipes you can read the output of your program and fill a window,
for instance:
set fi [ open " | YourProgram.exe"]
while { ![ eof $fi]} {
get $fi line_txt
# send $line_txt to a window/text widget
}
Hope it helps,
miguel
Thomas Chan wrote:
Thanks, Miguel. I think either the WarnWin or WarnWinText command are
helpful. The only thing I also want is to display the progress messages
DURING the run, since WarnWin or WarnWinText only displays the messages
after the run is finished. My runs can last from 1 mins to several hours
so the progress messages during the run is important. Do you have any
suggestion?
I tried using the Calculate command from GiD menu to run a batch file, it
runs but the command.exe window does not show up on the screen.
Thanks a bunch!
Tom
At 04:02 PM 4/25/2003 +0200, you wrote:
This is the dialog that appears when an error in TclTk appears.
in the man page of the 'exec' command
(http://www.gidhome.com/ManHtml/tcl8.4.2/html/TclCmd/exec.htm)
says that
"If any of the commands in the pipeline exit abnormally or are killed or
suspended, then exec will return an error and
the error message will include the pipeline's output followed by error
messages describing the abnormal terminations; the
errorCode variable will contain additional information about the last
abnormal termination encountered"
There is also the variable 'errorInfo' which contains the output till the
error was raised.
Among other information the 'errorCode' stores the exit code of your command.
So what you can do is this:
catch { exec $engine $projname}
if { "$errorCode" != "NONE"} {
# Here WarnWin can be substituted by your own window / treatment procedure
WarnWin "ErrorCode: $errorCode\nError: $errorInfo"
}
miguel
Thomas Chan wrote:
Thankyou for looking into this case, Miguel. Two files are attached.
Regards,
Tom
At 12:21 PM 4/25/2003 +0200, you wrote:
the output messages resulting from the 'exec' command are printed
in the standard output. the 'exec' command does not display
any error box.
can you send a snapshot/picture of your "error box"?
and a snapshot of your code?
miguel
Thomas Chan wrote:
Hi GiD support,
I am using the command "exec" in my tcl scripts and it's running fine
except that it prints out my progress messages in the error
box! Is there a way to customize the error box, such as modifying the
text on the title bar and changing the dimensions of the
error box? If not, is there a way to disable the error box and bring
out a message window or dos prompt window that can monitor
my progress messages? I'm running GiD v6.3 (windows version) on
Windows2000 Pro O/S. Thanks.
Tom
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
--
-----------------------------------------------------------------------
---------
Miguel A. Pasenau de
Riera miguel at cimne.upc.es http://gid.cimne.upc.es
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
------------------------------------------------------------------------------------------------------------------------------------
Name: messages.doc
messages.doc Type: Microsoft Word Document (application/msword)
Encoding: base64
FEM.tclName: FEM.tcl
Type: Plain Text (text/plain)
--
--------------------------------------------------------------------------------
Miguel A. Pasenau de
Riera miguel at cimne.upc.es http://gid.cimne.upc.es
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
--
--------------------------------------------------------------------------------
Miguel A. Pasenau de Riera miguel at cimne.upc.es http://gid.cimne.upc.es
[GiDlist] Re: .flavia.res file
Hi GiD staff,
My flavia.res file has a format as follows:
gausspoints "center" elemtype triangle
number of gauss point: 1
natural coordinates: internal
end gausspoints
E_normal(V/cm) 3 1 1 2 0 "center"
1891 3910.47
2705 3951.03
.
.
E_tangent(V/cm) 3 1 1 2 0 "center"
1891 .00000
2705 .00000
.
.
The info windows prints:
Found EOF too early: in this line: 2299 - Reading Results.
I can visualize both E_normal and E_tangent, which is fine. But when I
tried other projects with LONGER flavia.res file, the info window prints:
Incorrect format: in this line: 4964 - Reading Results.
Looking for result header: found unexpected result on line 4965 -
'79095 0.000000'.
Now I can only visualize E_normal but not E_tangent. What is wrong? I'm
running GiD v6.3.0b on Windows 2K Pro. Thanks.
Regards,
Tom
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20030509/1b5ea23a/attachment.htm
My flavia.res file has a format as follows:
gausspoints "center" elemtype triangle
number of gauss point: 1
natural coordinates: internal
end gausspoints
E_normal(V/cm) 3 1 1 2 0 "center"
1891 3910.47
2705 3951.03
.
.
E_tangent(V/cm) 3 1 1 2 0 "center"
1891 .00000
2705 .00000
.
.
The info windows prints:
Found EOF too early: in this line: 2299 - Reading Results.
I can visualize both E_normal and E_tangent, which is fine. But when I
tried other projects with LONGER flavia.res file, the info window prints:
Incorrect format: in this line: 4964 - Reading Results.
Looking for result header: found unexpected result on line 4965 -
'79095 0.000000'.
Now I can only visualize E_normal but not E_tangent. What is wrong? I'm
running GiD v6.3.0b on Windows 2K Pro. Thanks.
Regards,
Tom
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listas.cimne.upc.edu/pipermail/gidlist/attachments/20030509/1b5ea23a/attachment.htm
[GiDlist] Re: .flavia.res file
Can you send an example?
Thomas Chan wrote:
Hi GiD staff,
My flavia.res file has a format as follows:
gausspoints "center" elemtype triangle
number of gauss point: 1
natural coordinates: internal
end gausspoints
E_normal(V/cm) 3 1 1 2 0 "center"
1891 3910.47
2705 3951.03
.
.
E_tangent(V/cm) 3 1 1 2 0 "center"
1891 .00000
2705 .00000
.
.
The info windows prints:
Found EOF too early: in this line: 2299 - Reading Results.
I can visualize both E_normal and E_tangent, which is fine. But when I tried other projects with LONGER flavia.res file, the info
window prints:
Incorrect format: in this line: 4964 - Reading Results.
Looking for result header: found unexpected result on line 4965 - '79095 0.000000'.
Now I can only visualize E_normal but not E_tangent. What is wrong? I'm running GiD v6.3.0b on Windows 2K Pro. Thanks.
Regards,
Tom
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
--
--------------------------------------------------------------------------------
Miguel A. Pasenau de Riera miguel at cimne.upc.es http://gid.cimne.upc.es
Thomas Chan wrote:
Hi GiD staff,
My flavia.res file has a format as follows:
gausspoints "center" elemtype triangle
number of gauss point: 1
natural coordinates: internal
end gausspoints
E_normal(V/cm) 3 1 1 2 0 "center"
1891 3910.47
2705 3951.03
.
.
E_tangent(V/cm) 3 1 1 2 0 "center"
1891 .00000
2705 .00000
.
.
The info windows prints:
Found EOF too early: in this line: 2299 - Reading Results.
I can visualize both E_normal and E_tangent, which is fine. But when I tried other projects with LONGER flavia.res file, the info
window prints:
Incorrect format: in this line: 4964 - Reading Results.
Looking for result header: found unexpected result on line 4965 - '79095 0.000000'.
Now I can only visualize E_normal but not E_tangent. What is wrong? I'm running GiD v6.3.0b on Windows 2K Pro. Thanks.
Regards,
Tom
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
--
--------------------------------------------------------------------------------
Miguel A. Pasenau de Riera miguel at cimne.upc.es http://gid.cimne.upc.es
[GiDlist] Re: exec command
Dear All,
I am very interested by the first Miguel's possibility.
I wish to create a procedure that indicates progress of an external code launched by GID.
Is there a Tcl procedure in GID that allows to read the file being created by an external program and that returns the lines of this file
while the program finishes.
If somebody has got an idea...
Thank you in advance.
G.W.R. Geis
"Miguel A. de Riera Pasenau" a écrit :
You have three posibilities:
* when using the exec command, redirect the output to a file
and run the program in background:
exec your_program.exe outputfile.txt &
end then create a procedure which reads this file and
fills a window till the program finishes
* To show the output of your program, if it prints to the standard output,
using the calculate command of GiD you have to, in the batch file,
redirect the output of your program to a file and let GiD know the name
of this file
http://www.gidhome.com/support/gid_15.subst#SEC232
http://www.gidhome.com/support/gid_15.subst#SEC234
http://www.gidhome.com/support/gid_15.subst#SEC235
http://www.gidhome.com/support/gid_15.subst#SEC236
for instance (the output file will have the name of the project.log)
YourProblemTypeBatchFile.bat:
============================
rem basename=%1
rem directory=%2
rem ProblemDirectory=%3
rem OutputFile: %1.log
del %1.post.res
%3\YourProgram.exe YourParameters( %1, ...) %1.log
move %1.FinalFile %1.post.res
* Using pipes you can read the output of your program and fill a window,
for instance:
set fi [ open " | YourProgram.exe"]
while { ![ eof $fi]} {
get $fi line_txt
# send $line_txt to a window/text widget
}
Hope it helps,
miguel
Thomas Chan wrote:
Thanks, Miguel. I think either the WarnWin or WarnWinText command are
helpful. The only thing I also want is to display the progress messages
DURING the run, since WarnWin or WarnWinText only displays the messages
after the run is finished. My runs can last from 1 mins to several hours
so the progress messages during the run is important. Do you have any
suggestion?
I tried using the Calculate command from GiD menu to run a batch file, it
runs but the command.exe window does not show up on the screen.
Thanks a bunch!
Tom
At 04:02 PM 4/25/2003 +0200, you wrote:
This is the dialog that appears when an error in TclTk appears.
in the man page of the 'exec' command
(http://www.gidhome.com/ManHtml/tcl8.4.2/html/TclCmd/exec.htm)
says that
"If any of the commands in the pipeline exit abnormally or are killed or
suspended, then exec will return an error and
the error message will include the pipeline's output followed by error
messages describing the abnormal terminations; the
errorCode variable will contain additional information about the last
abnormal termination encountered"
There is also the variable 'errorInfo' which contains the output till the
error was raised.
Among other information the 'errorCode' stores the exit code of your command.
So what you can do is this:
catch { exec $engine $projname}
if { "$errorCode" != "NONE"} {
# Here WarnWin can be substituted by your own window / treatment procedure
WarnWin "ErrorCode: $errorCode\nError: $errorInfo"
}
miguel
Thomas Chan wrote:
Thankyou for looking into this case, Miguel. Two files are attached.
Regards,
Tom
At 12:21 PM 4/25/2003 +0200, you wrote:
the output messages resulting from the 'exec' command are printed
in the standard output. the 'exec' command does not display
any error box.
can you send a snapshot/picture of your "error box"?
and a snapshot of your code?
miguel
Thomas Chan wrote:
Hi GiD support,
I am using the command "exec" in my tcl scripts and it's running fine
except that it prints out my progress messages in the error
box! Is there a way to customize the error box, such as modifying the
text on the title bar and changing the dimensions of the
error box? If not, is there a way to disable the error box and bring
out a message window or dos prompt window that can monitor
my progress messages? I'm running GiD v6.3 (windows version) on
Windows2000 Pro O/S. Thanks.
Tom
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
--
-----------------------------------------------------------------------
---------
Miguel A. Pasenau de
Riera miguel at cimne.upc.es http://gid.cimne.upc.es
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
------------------------------------------------------------------------------------------------------------------------------------
Name: messages.doc
messages.doc Type: Microsoft Word Document (application/msword)
Encoding: base64
FEM.tclName: FEM.tcl
Type: Plain Text (text/plain)
--
--------------------------------------------------------------------------------
Miguel A. Pasenau de
Riera miguel at cimne.upc.es http://gid.cimne.upc.es
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
--
--------------------------------------------------------------------------------
Miguel A. Pasenau de Riera miguel at cimne.upc.es http://gid.cimne.upc.es
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
I am very interested by the first Miguel's possibility.
I wish to create a procedure that indicates progress of an external code launched by GID.
Is there a Tcl procedure in GID that allows to read the file being created by an external program and that returns the lines of this file
while the program finishes.
If somebody has got an idea...
Thank you in advance.
G.W.R. Geis
"Miguel A. de Riera Pasenau" a écrit :
You have three posibilities:
* when using the exec command, redirect the output to a file
and run the program in background:
exec your_program.exe outputfile.txt &
end then create a procedure which reads this file and
fills a window till the program finishes
* To show the output of your program, if it prints to the standard output,
using the calculate command of GiD you have to, in the batch file,
redirect the output of your program to a file and let GiD know the name
of this file
http://www.gidhome.com/support/gid_15.subst#SEC232
http://www.gidhome.com/support/gid_15.subst#SEC234
http://www.gidhome.com/support/gid_15.subst#SEC235
http://www.gidhome.com/support/gid_15.subst#SEC236
for instance (the output file will have the name of the project.log)
YourProblemTypeBatchFile.bat:
============================
rem basename=%1
rem directory=%2
rem ProblemDirectory=%3
rem OutputFile: %1.log
del %1.post.res
%3\YourProgram.exe YourParameters( %1, ...) %1.log
move %1.FinalFile %1.post.res
* Using pipes you can read the output of your program and fill a window,
for instance:
set fi [ open " | YourProgram.exe"]
while { ![ eof $fi]} {
get $fi line_txt
# send $line_txt to a window/text widget
}
Hope it helps,
miguel
Thomas Chan wrote:
Thanks, Miguel. I think either the WarnWin or WarnWinText command are
helpful. The only thing I also want is to display the progress messages
DURING the run, since WarnWin or WarnWinText only displays the messages
after the run is finished. My runs can last from 1 mins to several hours
so the progress messages during the run is important. Do you have any
suggestion?
I tried using the Calculate command from GiD menu to run a batch file, it
runs but the command.exe window does not show up on the screen.
Thanks a bunch!
Tom
At 04:02 PM 4/25/2003 +0200, you wrote:
This is the dialog that appears when an error in TclTk appears.
in the man page of the 'exec' command
(http://www.gidhome.com/ManHtml/tcl8.4.2/html/TclCmd/exec.htm)
says that
"If any of the commands in the pipeline exit abnormally or are killed or
suspended, then exec will return an error and
the error message will include the pipeline's output followed by error
messages describing the abnormal terminations; the
errorCode variable will contain additional information about the last
abnormal termination encountered"
There is also the variable 'errorInfo' which contains the output till the
error was raised.
Among other information the 'errorCode' stores the exit code of your command.
So what you can do is this:
catch { exec $engine $projname}
if { "$errorCode" != "NONE"} {
# Here WarnWin can be substituted by your own window / treatment procedure
WarnWin "ErrorCode: $errorCode\nError: $errorInfo"
}
miguel
Thomas Chan wrote:
Thankyou for looking into this case, Miguel. Two files are attached.
Regards,
Tom
At 12:21 PM 4/25/2003 +0200, you wrote:
the output messages resulting from the 'exec' command are printed
in the standard output. the 'exec' command does not display
any error box.
can you send a snapshot/picture of your "error box"?
and a snapshot of your code?
miguel
Thomas Chan wrote:
Hi GiD support,
I am using the command "exec" in my tcl scripts and it's running fine
except that it prints out my progress messages in the error
box! Is there a way to customize the error box, such as modifying the
text on the title bar and changing the dimensions of the
error box? If not, is there a way to disable the error box and bring
out a message window or dos prompt window that can monitor
my progress messages? I'm running GiD v6.3 (windows version) on
Windows2000 Pro O/S. Thanks.
Tom
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
--
-----------------------------------------------------------------------
---------
Miguel A. Pasenau de
Riera miguel at cimne.upc.es http://gid.cimne.upc.es
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
------------------------------------------------------------------------------------------------------------------------------------
Name: messages.doc
messages.doc Type: Microsoft Word Document (application/msword)
Encoding: base64
FEM.tclName: FEM.tcl
Type: Plain Text (text/plain)
--
--------------------------------------------------------------------------------
Miguel A. Pasenau de
Riera miguel at cimne.upc.es http://gid.cimne.upc.es
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
--
--------------------------------------------------------------------------------
Miguel A. Pasenau de Riera miguel at cimne.upc.es http://gid.cimne.upc.es
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
[GiDlist] Re: exec command
Hi,
i attach the 'tktail' command which keeps reading the content of a file and
shows it in a window
miguel
ieea wrote:
Dear All,
I am very interested by the first Miguel's possibility.
I wish to create a procedure that indicates progress of an external code launched by GID.
Is there a Tcl procedure in GID that allows to read the file being created by an external program and that returns the lines of this file
while the program finishes.
If somebody has got an idea...
Thank you in advance.
G.W.R. Geis
"Miguel A. de Riera Pasenau" a écrit :
You have three posibilities:
* when using the exec command, redirect the output to a file
and run the program in background:
exec your_program.exe outputfile.txt &
end then create a procedure which reads this file and
fills a window till the program finishes
* To show the output of your program, if it prints to the standard output,
using the calculate command of GiD you have to, in the batch file,
redirect the output of your program to a file and let GiD know the name
of this file
http://www.gidhome.com/support/gid_15.subst#SEC232
http://www.gidhome.com/support/gid_15.subst#SEC234
http://www.gidhome.com/support/gid_15.subst#SEC235
http://www.gidhome.com/support/gid_15.subst#SEC236
for instance (the output file will have the name of the project.log)
YourProblemTypeBatchFile.bat:
============================
rem basename=%1
rem directory=%2
rem ProblemDirectory=%3
rem OutputFile: %1.log
del %1.post.res
%3\YourProgram.exe YourParameters( %1, ...) %1.log
move %1.FinalFile %1.post.res
* Using pipes you can read the output of your program and fill a window,
for instance:
set fi [ open " | YourProgram.exe"]
while { ![ eof $fi]} {
get $fi line_txt
# send $line_txt to a window/text widget
}
Hope it helps,
miguel
Thomas Chan wrote:
Thanks, Miguel. I think either the WarnWin or WarnWinText command are
helpful. The only thing I also want is to display the progress messages
DURING the run, since WarnWin or WarnWinText only displays the messages
after the run is finished. My runs can last from 1 mins to several hours
so the progress messages during the run is important. Do you have any
suggestion?
I tried using the Calculate command from GiD menu to run a batch file, it
runs but the command.exe window does not show up on the screen.
Thanks a bunch!
Tom
At 04:02 PM 4/25/2003 +0200, you wrote:
This is the dialog that appears when an error in TclTk appears.
in the man page of the 'exec' command
(http://www.gidhome.com/ManHtml/tcl8.4.2/html/TclCmd/exec.htm)
says that
"If any of the commands in the pipeline exit abnormally or are killed or
suspended, then exec will return an error and
the error message will include the pipeline's output followed by error
messages describing the abnormal terminations; the
errorCode variable will contain additional information about the last
abnormal termination encountered"
There is also the variable 'errorInfo' which contains the output till the
error was raised.
Among other information the 'errorCode' stores the exit code of your command.
So what you can do is this:
catch { exec $engine $projname}
if { "$errorCode" != "NONE"} {
# Here WarnWin can be substituted by your own window / treatment procedure
WarnWin "ErrorCode: $errorCode\nError: $errorInfo"
}
miguel
Thomas Chan wrote:
Thankyou for looking into this case, Miguel. Two files are attached.
Regards,
Tom
At 12:21 PM 4/25/2003 +0200, you wrote:
the output messages resulting from the 'exec' command are printed
in the standard output. the 'exec' command does not display
any error box.
can you send a snapshot/picture of your "error box"?
and a snapshot of your code?
miguel
Thomas Chan wrote:
Hi GiD support,
I am using the command "exec" in my tcl scripts and it's running fine
except that it prints out my progress messages in the error
box! Is there a way to customize the error box, such as modifying the
text on the title bar and changing the dimensions of the
error box? If not, is there a way to disable the error box and bring
out a message window or dos prompt window that can monitor
my progress messages? I'm running GiD v6.3 (windows version) on
Windows2000 Pro O/S. Thanks.
Tom
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
--
-----------------------------------------------------------------------
---------
Miguel A. Pasenau de
Riera miguel at cimne.upc.es http://gid.cimne.upc.es
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
------------------------------------------------------------------------------------------------------------------------------------
Name: messages.doc
messages.doc Type: Microsoft Word Document (application/msword)
Encoding: base64
FEM.tclName: FEM.tcl
Type: Plain Text (text/plain)
--
--------------------------------------------------------------------------------
Miguel A. Pasenau de
Riera miguel at cimne.upc.es http://gid.cimne.upc.es
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
--
--------------------------------------------------------------------------------
Miguel A. Pasenau de Riera miguel at cimne.upc.es http://gid.cimne.upc.es
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
--
--------------------------------------------------------------------------------
Miguel A. Pasenau de Riera miguel at cimne.upc.es http://gid.cimne.upc.es
-------------- next part --------------
#!/bin/sh
# the next line restarts using wish \
exec wish "$0" ${1+"$@"}
proc TkTailFill { text fd filename { actualizar 1}} {
global tcl_platform TkTailPriv
if { ![winfo exists $text] } {
catch { close $fd }
return
}
if { $fd == "" } {
set JustOpen 1
if { [catch { set fd [open $filename r] } ] } {
set fd ""
} else {
bind $text Destroy "catch [list close $fd]"
$text del 1.0 end
}
} else { set JustOpen 0 }
if { $fd != "" } {
set textinserted 0
set aa [gets $fd]
while { ![fblocked $fd] && ![eof $fd]} {
set textinserted 1
$text ins end "$aa\n"
set aa [gets $fd]
if { $tcl_platform(platform) != "windows"} {
if { ![info exists TkTailPriv(tempstopupdates)] || $TkTailPriv(tempstopupdates) == 0 } {
$text see end
}
}
}
if { ($tcl_platform(platform) == "windows") && ($textinserted == 1)} {
if { ![info exists TkTailPriv(tempstopupdates)] || $TkTailPriv(tempstopupdates) == 0 } {
$text see end
}
}
if { $JustOpen && !$textinserted } {
close $fd
set fd ""
} else {
update idletasks
}
}
if { $actualizar} {
after 100 [list TkTailFill $text $fd $filename ]
}
}
proc TkTail { filename { basename "" } { actualizar 1} } {
global TkTailPriv
set title "Output for '$filename'"
set inum 1
while { [winfo exists ._outputview$inum] } {
if { [wm title ._outputview$inum] == $title } {
raise ._outputview$inum
return
}
incr inum
}
set w ._outputview$inum
if { ![winfo exists $w] } {
toplevel $w
wm title $w $title
font create FixedFont -family Courier -size 10
text $w.t -width 81 -xscrollcommand "$w.scrollbar#1 set" \
-yscrollcommand "$w.scrollbar#2 set" -font FixedFont \
-bd 1
scrollbar $w.scrollbar#2 -command "$w.t yview" -orient v \
-bd 1 -elementborderwidth 1
scrollbar $w.scrollbar#1 -command "$w.t xview" -orient h \
-bd 1 -elementborderwidth 1
bind $w.scrollbar#2 ButtonPress-1 "set TkTailPriv(tempstopupdates) 1"
bind $w.scrollbar#1 ButtonPress-1 "set TkTailPriv(tempstopupdates) 1"
bind $w.scrollbar#2 ButtonRelease-1 "set TkTailPriv(tempstopupdates) 0"
bind $w.scrollbar#1 ButtonRelease-1 "set TkTailPriv(tempstopupdates) 0"
frame $w.buts
button $w.close -text "Close" -width 6 -command "destroy $w" -bd 1
pack $w.close -in $w.buts
focus $w.close
grid $w.t -row 1 -column 1 -sticky nesw
grid $w.scrollbar#2 -row 1 -column 2 -sticky ns
grid $w.scrollbar#1 -row 2 -column 1 -sticky ew
grid $w.buts -row 3 -column 1 -rowspan 2 -pady 5
grid rowconfigure $w 1 -weight 1
grid columnconfigure $w 1 -weight 1
wm withdraw $w
update idletasks
set rw [ winfo reqwidth $w]
set rh [ winfo reqheight $w]
set sw [ winfo screenwidth $w]
set sh [ winfo screenheight $w]
set px [ expr ( $sw - $rw) / 2]
set py [ expr ( $sh - $rh) / 2]
wm geometry $w +${px}+${py}
wm deiconify $w
}
TkTailFill $w.t "" $filename $actualizar
return $w
}
if { $argc != 1} {
puts "Usage: $argv0 filename"
exit
}
wm withdraw .
set wtail [ TkTail [ lindex $argv 0]]
tkwait window $wtail
destroy .
i attach the 'tktail' command which keeps reading the content of a file and
shows it in a window
miguel
ieea wrote:
Dear All,
I am very interested by the first Miguel's possibility.
I wish to create a procedure that indicates progress of an external code launched by GID.
Is there a Tcl procedure in GID that allows to read the file being created by an external program and that returns the lines of this file
while the program finishes.
If somebody has got an idea...
Thank you in advance.
G.W.R. Geis
"Miguel A. de Riera Pasenau" a écrit :
You have three posibilities:
* when using the exec command, redirect the output to a file
and run the program in background:
exec your_program.exe outputfile.txt &
end then create a procedure which reads this file and
fills a window till the program finishes
* To show the output of your program, if it prints to the standard output,
using the calculate command of GiD you have to, in the batch file,
redirect the output of your program to a file and let GiD know the name
of this file
http://www.gidhome.com/support/gid_15.subst#SEC232
http://www.gidhome.com/support/gid_15.subst#SEC234
http://www.gidhome.com/support/gid_15.subst#SEC235
http://www.gidhome.com/support/gid_15.subst#SEC236
for instance (the output file will have the name of the project.log)
YourProblemTypeBatchFile.bat:
============================
rem basename=%1
rem directory=%2
rem ProblemDirectory=%3
rem OutputFile: %1.log
del %1.post.res
%3\YourProgram.exe YourParameters( %1, ...) %1.log
move %1.FinalFile %1.post.res
* Using pipes you can read the output of your program and fill a window,
for instance:
set fi [ open " | YourProgram.exe"]
while { ![ eof $fi]} {
get $fi line_txt
# send $line_txt to a window/text widget
}
Hope it helps,
miguel
Thomas Chan wrote:
Thanks, Miguel. I think either the WarnWin or WarnWinText command are
helpful. The only thing I also want is to display the progress messages
DURING the run, since WarnWin or WarnWinText only displays the messages
after the run is finished. My runs can last from 1 mins to several hours
so the progress messages during the run is important. Do you have any
suggestion?
I tried using the Calculate command from GiD menu to run a batch file, it
runs but the command.exe window does not show up on the screen.
Thanks a bunch!
Tom
At 04:02 PM 4/25/2003 +0200, you wrote:
This is the dialog that appears when an error in TclTk appears.
in the man page of the 'exec' command
(http://www.gidhome.com/ManHtml/tcl8.4.2/html/TclCmd/exec.htm)
says that
"If any of the commands in the pipeline exit abnormally or are killed or
suspended, then exec will return an error and
the error message will include the pipeline's output followed by error
messages describing the abnormal terminations; the
errorCode variable will contain additional information about the last
abnormal termination encountered"
There is also the variable 'errorInfo' which contains the output till the
error was raised.
Among other information the 'errorCode' stores the exit code of your command.
So what you can do is this:
catch { exec $engine $projname}
if { "$errorCode" != "NONE"} {
# Here WarnWin can be substituted by your own window / treatment procedure
WarnWin "ErrorCode: $errorCode\nError: $errorInfo"
}
miguel
Thomas Chan wrote:
Thankyou for looking into this case, Miguel. Two files are attached.
Regards,
Tom
At 12:21 PM 4/25/2003 +0200, you wrote:
the output messages resulting from the 'exec' command are printed
in the standard output. the 'exec' command does not display
any error box.
can you send a snapshot/picture of your "error box"?
and a snapshot of your code?
miguel
Thomas Chan wrote:
Hi GiD support,
I am using the command "exec" in my tcl scripts and it's running fine
except that it prints out my progress messages in the error
box! Is there a way to customize the error box, such as modifying the
text on the title bar and changing the dimensions of the
error box? If not, is there a way to disable the error box and bring
out a message window or dos prompt window that can monitor
my progress messages? I'm running GiD v6.3 (windows version) on
Windows2000 Pro O/S. Thanks.
Tom
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
--
-----------------------------------------------------------------------
---------
Miguel A. Pasenau de
Riera miguel at cimne.upc.es http://gid.cimne.upc.es
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
------------------------------------------------------------------------------------------------------------------------------------
Name: messages.doc
messages.doc Type: Microsoft Word Document (application/msword)
Encoding: base64
FEM.tclName: FEM.tcl
Type: Plain Text (text/plain)
--
--------------------------------------------------------------------------------
Miguel A. Pasenau de
Riera miguel at cimne.upc.es http://gid.cimne.upc.es
Thomas Chan
R&D Engineer
EMAG Technologies, Inc.
www.emagtechnologies.com
--
--------------------------------------------------------------------------------
Miguel A. Pasenau de Riera miguel at cimne.upc.es http://gid.cimne.upc.es
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
_______________________________________________
GiDlist mailing list
GiDlist at gid.cimne.upc.es
http://gid.cimne.upc.es/mailman/listinfo/gidlist
--
--------------------------------------------------------------------------------
Miguel A. Pasenau de Riera miguel at cimne.upc.es http://gid.cimne.upc.es
-------------- next part --------------
#!/bin/sh
# the next line restarts using wish \
exec wish "$0" ${1+"$@"}
proc TkTailFill { text fd filename { actualizar 1}} {
global tcl_platform TkTailPriv
if { ![winfo exists $text] } {
catch { close $fd }
return
}
if { $fd == "" } {
set JustOpen 1
if { [catch { set fd [open $filename r] } ] } {
set fd ""
} else {
bind $text Destroy "catch [list close $fd]"
$text del 1.0 end
}
} else { set JustOpen 0 }
if { $fd != "" } {
set textinserted 0
set aa [gets $fd]
while { ![fblocked $fd] && ![eof $fd]} {
set textinserted 1
$text ins end "$aa\n"
set aa [gets $fd]
if { $tcl_platform(platform) != "windows"} {
if { ![info exists TkTailPriv(tempstopupdates)] || $TkTailPriv(tempstopupdates) == 0 } {
$text see end
}
}
}
if { ($tcl_platform(platform) == "windows") && ($textinserted == 1)} {
if { ![info exists TkTailPriv(tempstopupdates)] || $TkTailPriv(tempstopupdates) == 0 } {
$text see end
}
}
if { $JustOpen && !$textinserted } {
close $fd
set fd ""
} else {
update idletasks
}
}
if { $actualizar} {
after 100 [list TkTailFill $text $fd $filename ]
}
}
proc TkTail { filename { basename "" } { actualizar 1} } {
global TkTailPriv
set title "Output for '$filename'"
set inum 1
while { [winfo exists ._outputview$inum] } {
if { [wm title ._outputview$inum] == $title } {
raise ._outputview$inum
return
}
incr inum
}
set w ._outputview$inum
if { ![winfo exists $w] } {
toplevel $w
wm title $w $title
font create FixedFont -family Courier -size 10
text $w.t -width 81 -xscrollcommand "$w.scrollbar#1 set" \
-yscrollcommand "$w.scrollbar#2 set" -font FixedFont \
-bd 1
scrollbar $w.scrollbar#2 -command "$w.t yview" -orient v \
-bd 1 -elementborderwidth 1
scrollbar $w.scrollbar#1 -command "$w.t xview" -orient h \
-bd 1 -elementborderwidth 1
bind $w.scrollbar#2 ButtonPress-1 "set TkTailPriv(tempstopupdates) 1"
bind $w.scrollbar#1 ButtonPress-1 "set TkTailPriv(tempstopupdates) 1"
bind $w.scrollbar#2 ButtonRelease-1 "set TkTailPriv(tempstopupdates) 0"
bind $w.scrollbar#1 ButtonRelease-1 "set TkTailPriv(tempstopupdates) 0"
frame $w.buts
button $w.close -text "Close" -width 6 -command "destroy $w" -bd 1
pack $w.close -in $w.buts
focus $w.close
grid $w.t -row 1 -column 1 -sticky nesw
grid $w.scrollbar#2 -row 1 -column 2 -sticky ns
grid $w.scrollbar#1 -row 2 -column 1 -sticky ew
grid $w.buts -row 3 -column 1 -rowspan 2 -pady 5
grid rowconfigure $w 1 -weight 1
grid columnconfigure $w 1 -weight 1
wm withdraw $w
update idletasks
set rw [ winfo reqwidth $w]
set rh [ winfo reqheight $w]
set sw [ winfo screenwidth $w]
set sh [ winfo screenheight $w]
set px [ expr ( $sw - $rw) / 2]
set py [ expr ( $sh - $rh) / 2]
wm geometry $w +${px}+${py}
wm deiconify $w
}
TkTailFill $w.t "" $filename $actualizar
return $w
}
if { $argc != 1} {
puts "Usage: $argv0 filename"
exit
}
wm withdraw .
set wtail [ TkTail [ lindex $argv 0]]
tkwait window $wtail
destroy .