FET Forum

FET Development => Suggestions => Topic started by: Zsolt Udvari on June 28, 2009, 02:36:31 PM

Title: Command line
Post by: Zsolt Udvari on June 28, 2009, 02:36:31 PM
Hi all!
I want to know that is there in plans a command line version of fet? Why? Because I've an SSH-access to a server (that machine is faster than my Celeron 2GHz machine), and I can't use in SSH the X-server.
I hope that in short time this will be a featuer ;)
Title: Re: Command line
Post by: Liviu Lalescu on June 28, 2009, 02:40:35 PM
It is done for a long time ago (maybe 1 year ago). See README file.

The future version 5.10.0 (might be ready Monday evening) will permit also to specify an output directory.
Title: Re: Command line
Post by: Zsolt Udvari on June 28, 2009, 02:58:16 PM
[uzsolt@carme-pld-i686 ~]$ fet --inputfile=/usr/src/examples/fet-5.9.3/sample_inputs/Hungary/Bethlen/2008-2009/newer/Bethlen-2008-2009.fet
Settings read
fet: cannot connect to X server

Or should I add some more options?
Title: Re: Command line
Post by: Liviu Lalescu on June 28, 2009, 03:22:13 PM
Hmmm, you touched a sensible point :-(

FET even command line needs X server. This is because when reading the rules, there are some message boxes, and also when precomputing. This cannot be easily changed, because there are so many messages. These message boxes will show up only in case of error, but it seems that FET needs a graphical server.
Title: Re: Command line
Post by: Zsolt Udvari on June 28, 2009, 03:46:19 PM
And when with a command-line option? Imho this is a many if-statement (if GUI then dialog box, when CLI then stdout).
Title: Re: Command line
Post by: Liviu Lalescu on June 28, 2009, 03:53:11 PM
I'll add this in the TODO.

It is difficult, because there is much to change and test.
Title: Re: Command line
Post by: Zsolt Udvari on June 28, 2009, 03:57:14 PM
I will be the tester ;)
Title: Re: Command line
Post by: Liviu Lalescu on June 28, 2009, 03:59:59 PM
QuoteI will be the tester ;)

:-)

I don't promise a solution fast. I am also working on max gaps per day and on other improvements (but max gaps per day is also a far perspective).
Title: Re: Command line
Post by: Volker Dirr on June 28, 2009, 04:29:09 PM
QuoteAnd when with a command-line option? Imho this is a many if-statement (if GUI then dialog box, when CLI then stdout).

i fear the compiler will not be clever enough for this.

in generate.cpp and pre_generate.cpp is a "#include <QMessageBox>". So i fear it will always complain a missing x-server, even if there is never an error message comming.

what about the samplefile you tried to generate? what happen if you try to generate with the command line version on your own computer? Can you see a message box if you use commandline version with that sample on your own computer?
Title: Re: Command line
Post by: Zsolt Udvari on June 28, 2009, 06:05:53 PM
Not yet samplefile, I tried the my "old" file.
On my machine no dialogs apper, only I see the logs.
Title: Re: Command line
Post by: Liviu Lalescu on June 28, 2009, 06:44:54 PM
OK, it seems we need to make a separate command line version, without including Qt GUI. Unfortunately, I cannot do that soon. I can give advice and support on how to do that (only files in engine and fet.cpp need to be taken and put as a separate project).
Title: Re: Command line
Post by: Zsolt Udvari on June 29, 2009, 08:50:34 AM
Yes, this would be the best solution for me. I'll try to do this, I hope it isn't too difficult. Imho the basic functions (input file, how many timetable, etc.) are enough.
But I want to try that the fet runs on server and displays itself on my machine (SSH, remote X-server,...).
Title: Re: Command line
Post by: Liviu Lalescu on June 29, 2009, 08:57:13 AM
How many timetables - this is not yet implemented in command line.
Title: Re: Command line
Post by: Corfiot on August 26, 2009, 03:39:26 PM
You can get an X-Server and run it on your client computer. Then you can use ssh X11 forwarding. This way you run FET on the remove machine but it's GUI is displayed on yours.

Check this thread.

http://nixcraft.com/getting-started-tutorials/170-run-remote-x-applications-over-network-using-ssh.html

the gist of it:

1 run Xserver on client
2 on client> xhosts server_ip
3 on server> export DISPLAY=client_ip:0
4 on server> fet

ta-da
Title: Re: Command line
Post by: Zsolt Udvari on August 27, 2009, 07:05:19 PM
QuoteYou can get an X-Server and run it on your client computer. Then you can use ssh X11 forwarding. This way you run FET on the remove machine but it's GUI is displayed on yours.

Check this thread.

http://nixcraft.com/getting-started-tutorials/170-run-remote-x-applications-over-network-using-ssh.html

the gist of it:

1 run Xserver on client
2 on client> xhosts server_ip
3 on server> export DISPLAY=client_ip:0
4 on server> fet

ta-da
As you think. And what can I do when doesn't enabled X11 forwarding on server? I'm not root on this machine, only a single user, so I can't change ssh settings.

But a solution: tightvnc, and I don't run any wm on server (in vnc), I run only a fet. I don't want to see the fet dialogs (while generating), so it's enough for me ;) (and a simple script checks the fet is running ;)).
Title: Re: Command line
Post by: Corfiot on August 27, 2009, 08:11:45 PM
If X11 forwarding is not enabled on the server you just manually type what I pasted. You use an outgoing socket connection from the server to your machine, this is very rarely blocked :-p

With tightvnc you escape the need for an X Server on your client but you have to be able to install it on the server...

WHATEVER WORKS MAN! :)
Title: Re: Command line
Post by: Zsolt Udvari on August 27, 2009, 08:17:36 PM
I can install any packages (that exist) on server ;)