Re: Running an .sce from the command line.

classic Classic list List threaded Threaded
4 messages Options
Tim Wescott Tim Wescott
Reply | Threaded
Open this post in threaded view
|

Re: Running an .sce from the command line.

xend().

I don't know if this is what you want, but the enclosed .sce file
generates a graph, writes an image to a .eps file, and then exits.  This
is how I generate graphs for papers -- it gives me a more maintainable
way to replicate the graphs later, or tweak them, or whatever.

Note that there are some dependencies that I'm not sharing, so it won't
work.  You should still get an idea of how it works, or maybe chop out
the dependencies and try it out.

It should be one of the figures in this paper:
http://wescottdesign.com/articles/Friction/friction.pdf.

On Thu, 2016-03-31 at 10:35 -0800, [hidden email] wrote:

> Hi,
>
> I can run my .sce file which produces a graph from a file of data from the (windows) command line using:
>
>     scilex -f myscript.sce filename.rdat
>
> and that works except:
>
> Once the plot() executes and the graphic window appears, control and focus returns to the interactive command line.
>
> That's okay; but it'd would be really nice if the focus remained on the graphic window until it was closed and then the scilab shell exited automatically.
>
> Is it possible to arrange for that to happen?
>
> Thanks, Buk.
>
> ____________________________________________________________
> TRY FREE IM TOOLPACK at http://www.imtoolpack.com/default.aspx?rc=if5
> Capture screenshots, upload images, edit and send them to your friends
> through IMs, post on Twitter®, Facebook®, MySpace™, LinkedIn® – FAST!
>
>
>
> _______________________________________________
> users mailing list
> [hidden email]
> http://lists.scilab.org/mailman/listinfo/users
--

Tim Wescott
www.wescottdesign.com
Control & Communications systems, circuit & software design.
Phone: 503.631.7815
Cell:  503.349.8432

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users

motor-PD-friction.sce (660 bytes) Download Attachment
Samuel GOUGEON Samuel GOUGEON
Reply | Threaded
Open this post in threaded view
|

Re: Running an .sce from the command line.

Hello,

Le 31/03/2016 20:35, [hidden email] a écrit :
> Hi,
>
> I can run my .sce file which produces a graph from a file of data from the (windows) command line using:
>
>      scilex -f myscript.sce filename.rdat
>
> and that works except:
>
> Once the plot() executes and the graphic window appears, control and focus returns to the interactive command line.
Scilab's console, i guess not the shell terminal.

> That's okay; but it'd would be really nice if the focus remained on the graphic window until it was closed and then the scilab shell exited automatically.
Graphics are not modal: AFAIK it is not possible to lock the console
with a figure until the figure is closed (or until any other event)(you
could use a for loop waiting for an event ; but it won't reject CTRL-C
interruptions).
However, to close automatically Scilab when the figure is closed, you
may add the following in your script:
gcf().closerequestfcn="exit(0)";

HTH
Samuel

_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
aweeks aweeks
Reply | Threaded
Open this post in threaded view
|

Re: Running an .sce from the command line.

In reply to this post by Tim Wescott
Hi,

I don't know if this will be any help to you in this particular case but it may be of some interest.

I was using Scilab to control some hardware and receive and display data coming back.  The data was displayed in a graphics window and I then had to enter some commands to the Scilab console.  The windows focus always ended up on the graphics window and I had to keep putting it back on the console using the mouse:  the novelty of doing this quickly wore off.

My PC at the time was running Windows XP and I had the following arrangement:

        In a folder, a file called   "focusonwindow.vbs"  containing these two lines:

        Set WshShell = WScript.CreateObject("WScript.Shell")
        WshShell.AppActivate WScript.Arguments.Item(0)

in the Scilab script the following line:

        host('cscript /B focusonwindow.vbs ""Scilab""')

and here ""Scilab"" is the name of the window (the console) to which the focus should be switched.

My current PC runs Windows 7 and I haven't got around to re-implementing the above yet but I imagine something similar will be possible.

I don't take any credit for the above.  At the time, I put a query on the forum (21 Feb. 2014) and received a reply offering this solution so I thank the gentleman who helped me.  He suggested this webpage:  http://stackoverflow.com/questions/786368/how-to-bring-a-cmd-exe-window-to-top

Good luck,
Adrian.

Adrian Weeks
Development Engineer, Hardware Engineering EMEA
Office: +44 (0)2920 528500 | Desk: +44 (0)2920 528523 | Fax: +44 (0)2920 520178

aweeks@...
HID Global Logo
Unit 3, Cae Gwyrdd,
Green meadow Springs,
Cardiff, UK,
CF15 7AB.

www.hidglobal.com




From: [hidden email]
To: "[hidden email]"  <>
Date: 31/03/2016 19:37
Subject: [Scilab-users] Running an .sce from the command line.
Sent by: "users" <[hidden email]>





Hi,

I can run my .sce file which produces a graph from a file of data from the (windows) command line using:

   scilex -f myscript.sce filename.rdat

and that works except:

Once the plot() executes and the graphic window appears, control and focus returns to the interactive command line.

That's okay; but it'd would be really nice if the focus remained on the graphic window until it was closed and then the scilab shell exited automatically.

Is it possible to arrange for that to happen?

Thanks, Buk.

____________________________________________________________
TRY FREE IM TOOLPACK at
http://www.imtoolpack.com/default.aspx?rc=if5
Capture screenshots, upload images, edit and send them to your friends
through IMs, post on Twitter®, Facebook®, MySpace™, LinkedIn® – FAST!



_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users



_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users
Rafael Guerra Rafael Guerra
Reply | Threaded
Open this post in threaded view
|

Re: Running an .sce from the command line.

Hello Adrian,

Just to thank you for sharing this very useful solution which works great
with Scilab 5.5.2 on Windows 7.

Regards,
Rafael




--
Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html
_______________________________________________
users mailing list
[hidden email]
http://lists.scilab.org/mailman/listinfo/users