Menu
Logged-In As
ACCOUNTNot Logged In
Web interface (AJAX?) to MGEDBRL-CAD
Status: ClosedTime to complete:
72 hrs
Mentors: Sean
BRL-CAD has a geometry editor application called MGED that will run in a graphical or text console mode (mged -c)
Your task is to do some exploratory research. Make it so that we can go to a web page and interact with a remote instance of MGED. Don't worry about making it pretty, we're looking for proof-of-concept.
You can do this task in any language you like, but you need to set up a temporary demo somewhere that we can get to. Provide the URL and your source file(s).
CAUTION: Keep it protected or run it in a VM or otherwise "sandboxed" environment, however, because MGED does allow shell command execution and we wouldn't want some random individual causing problems. :)
Uploaded Work
File name/URL | File size | Date submitted | |
---|---|---|---|
http://crit.brlcad.org/~gciskriptkid/cmd/ | n/a | January 03 2013 17:32 UTC | |
http://crit.brlcad.org/~gciskriptkid/cmd/ | n/a | January 05 2013 12:09 UTC |
Is this suppose to be a graphical or commandline instance of mged? Also, can we use other opensource software to implement this?
It can be either and yes, you can use any open source and any language you want. it's more about doing some research on the feasibility. Proof-of-concept. It it works great, we could create dozens of additional tasks to keep working on it. ;)
I would like to work on this task.
This task has been assigned to Richard Tynan. You have 72 hours to complete this task, good luck!
The claim on this task has been removed, someone else can claim it now.
I would like to work on this task.
The claim on this task has been removed, someone else can claim it now.
I would like to work on this task.
This task has been assigned to Tanuj Guha. You have 72 hours to complete this task, good luck!
Melange has detected that the initial deadline has passed and it has set the task status to ActionNeeded. The student has 24 hours to submit the work before the task is reopened and sent back to the pool for other students to claim.
Melange has detected that the final deadline has passed and it has reopened the task.
I would like to work on this task.
This task has been assigned to Skriptkid. You have 72 hours to complete this task, good luck!
Are we looking at Software as a Service?
Maybe I haven't understood this right. What exactly am I supposed to do? By web interface to Mged, do you mean that I have to create an interface to interact with Mged from a browser? The user types in mged commands into the browser, which is parsed by Mged on a certain computer and an output is given out accordingly?
What you asked sounds correct. Should be fun! :)
Okay, I'm thinking of using the 'exec' or a similar function, which executes terminal commands, in PHP for this, along with AJAX. But mged takes all input when it is being run, and not as command line arguments. Any suggestions or ideas on how commands can be sent to it?(I'm looking around, of course.)
A very basic CLI-Ajax interface I've managed to come up with. No bells and whistles or niceties. So the next thing is to figure out the mged-PHP interaction.
The work on this task is ready to be reviewed.
mged can take commands in a whole variety of ways including one-at-a-time but it's best to establish a back-end "session" with mged so that you don't have to keep re-invoking it. That way you can stream back responses/output too for commands like "rt" that take a while.
One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.
Okay, here's thr problme with Ajax + PHP: Every time AJAX sends data to PHP, the PHP script is opened and after the programmed operations are done, the script ends. So every time an mged command is sent through AJAX, the PHP script is closed and respawned, taking down the MGED instance that was opened and thus making all further commands useless. Sadly, there's no way to keep the script alive.
My idea of a workaround for this: Create two PHP scripts, one that takes the AJAX input and the other which is always running on command line(spawned by the first script.) These two are connected by sockets. So PHP-1 takes commands through AJAX and relays it to the -ever-alive PHP-2, which then executes then, since it's able to keep MGED instance alive.
Go ahead with this model?
I tried that, but did not work. I'm able to take commands and pass them to the command line, but once MGED is started, I'm unable to pass any input to it through STDIN. I've uploaded what I've done so far.
The work on this task is ready to be reviewed.
Melange has detected that the deadline has passed and no more work can be submitted. The submitted work should be reviewed.
Need an extension. Still working on this.
Uploaded some new files to the server. Uses piping. But sockets need to be enabled in PHP for it to work. Could that be done? Also, the file "sock.php" needs to be run before testing. It's in public_html/cmd. "php -f sock.php"
Congratulations, this task has been completed successfully.
It's reasonable progress given the expected level of effort for a GCI task so we can call this bit of research complete and create a follow-on task for the next step. We'll look into the php sockets option you mentioned.
Found a bit of info that might be useful later. This might be of some help: http://pexpect.sourceforge.net/pexpect.html