logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Octave and Matlab Web pages - Browser pages for Octave
marinettejoe
#1 Posted : Tuesday, January 22, 2008 10:28:05 AM(UTC)
marinettejoe

Rank: Administration

Groups: Admin2
Joined: 12/3/2007(UTC)
Posts: 515
Points: 611
Location: Aquia, Va

Thanks: 31 times
Was thanked: 37 time(s) in 24 post(s)
I am crossposting this thread on using a browser with Octave or Matlab (Math tools for EE developer). This is a thread on using javascript and a browser as a Octave UI. --- Very early in the process. - Trying to get a fork, pipe, or async to work in windows.

So far, It's been 3 hours of work.

I'm working on a very limited and different approach to a GUI. Octave is a STDIN and STDOUT focused product. I'd like a functionalized library using browser based java scripting as an alternative. (It's crude in this form, but workable).
I've needed to use a browser as a front end to html GUIs in Octave with Stdin and Stdout for the NMEA2000 project. Both IE (4+) in windows and Firefox support console output. This is based on Gunter Born's wscript page. It stops octave in the process. There is some browser based interaction that would add a lot to Octave.

I'm still working the firefox stuff and linux. The code in form1.html shown below should have a window.close(); to return and close the browser. - No Web Server is used!!! It's all local.


Yes, it's still very crude, but it offers some simple opportunities for easy development of GUI's with forms and browsers. Great for developing a test harness with the Tek 11801C and GPIB with Octave!!!

The below example has been tested to work in Matlab and Octave...
In windows octave, a simple line like the following executes a cscript. (Note system must be lower case in MATLAB 7.1) (I put these in the matlab work directory for MATLAB and the Octave directory for octave - Did not enter paths).

[Status,Output] = system("cscript octave2.js");

The cscript returns the wscript.echo entries from the cscript batch file.

octave2.js

//************************************************
// File: Form1.js (WSH sample in JScript)
// Author: (c) G. Born modified for octave
//
// Using Internet Explorer 4 or 5 to retrieve
// form input
//************************************************
var Text2 = "You entered:\n";

// Launch Internet Explorer, and connect event handler.
var oIE = WScript.CreateObject("InternetExplorer.Application", "IE_");

oIE.Left = 50; // Window position and other properties
oIE.Top = 100;
oIE.Height = 100;
oIE.Width = 280;
oIE.MenuBar = 0; // No menu
oIE.ToolBar = 0;
oIE.StatusBar = 0;
// Commented out because it causes a corrupted window border.
// oIE.Resizable = 0 // Disable resizing.
oIE.navigate(GetPath() + "Form1.htm"); // Load form.
oIE.Visible = 1; // Keep visible.

// Important: Wait until IE is ready.
while (oIE.Busy) {WScript.Sleep(200)} // Suspend

var ready = false; // Form is still open.

// Wait until the user closes the form using
// the Close button in the upper right corner of the window.
// This sets ready to true in the onclose event.
while (!ready) {WScript.Sleep(500)} // Suspend

// Display the data obtained in the event handling procedure.
WScript.Echo(Text2 + "\n" + name + "\n" + age);

// We're ready now. The sample script terminates.
// Here you can add script-specific code.

// Event handler and helper

function IE_OnQuit()
{
// Event handler is called if IE terminates.
// This happens if the user clicks the Close button.
// Retrieve the values.
name = "Name: " + oIE.Document.ValidForm.fName.value;
age = "Age: " + oIE.Document.ValidForm.fAge.value;
ready = true; // Indicate form is closed.
}

function GetPath()
{
// Get script path because form (HTML file)
// must be in the same folder.
var path = WScript.ScriptFullName;
path = path.substr(0, path.lastIndexOf("\\") + 1);
return path;
}

//*** End


and the form form1.htm which returns to the script on the browser close. (Needs a javascript function so use the X to close the window.

<HTML>
<form name="ValidForm">
<p>
Name:
<input type="text" size="5" name="fName">
Age:
<input type="text" size="3" name="fAge">
<br>

Password:
<input type="password" size="12" maxlength="8" name="fPassw">

<input type="button" name="Button1" value="OK">
<br> The OK button needs to be fixed (close the browser instead) and look at the output variable.

<input type="checkbox" name="fPrinter" value="1" checked>
Printer
<input type="checkbox" name="fScreen" value="2">
Screen
<br>

Remarks:
<br>

<textarea cols="40" rows="5" name="fRemark">
</textarea>
</p>
</form>
</HTML>


The Output variable will contain everything from the echoed commands.

Really I need to convert this to a functionalized .m or oct library.

[Status.Response] = browsermodal("exampleform.html", params,...);

Thanks
Marinette Joe

>>> From a nabble query <<<

gri6507 wrote:
Hello,

Please pardon me for posting this question since it seems like it's been asked many times before. However, I am quite confused about which options are still valid for a GUI frontend to Octave.

What I'd like to have is something like Octave Workshop (http://www.math.mcgill.ca/loisel/octave-workshop/). However, as that page says, the project is no longer being maintained. There also seems to be something at https://sourceforge.net/projects/octave-gtk/, but the screen shots there are not very good and it seems like activity has stopped on that project as well. I also saw a number of references to Tcl, JAVA, and Python programs that are in various states of maintenance and functionality. In summary, I'm confused.

Can someone please clarify this issue for me?
>>> <<<
Unzinced ships sink at slips. yep
Sponsor
Please Register : To weed out spammers, new members may not post until approved. An email is usually sent after approval. This forum is for Marinette Owners and other aluminum boat boaters who wish to share boating information. Aluminum Roamer owners are also welcome. (Do not post content you do not have the right to post and mass (robots) posters are unwelcome. We also have a marine electronics page and lots of Chrysler Engine info. State by what permission you copy content and give credit properly.) The site is now fixed with some more Chrysler information. We have space for pictures on the new location. Use shinkpic to autochange size http://www.onthegosoft.com/sp_download.htm

Great Sites - http://www.marinette.com Marinette Company

http://web.me.com/dougmrose/Doug_Roses_Website/Welcome.html

http://fastjeff.tripod.com/ Repair Tricks and Techniques for Marinettes

http://www.greatlakesmarinetteclub.com/

PLEASE post in the appropriate folder. Please, do not post your actual email address in publicly readable websites. The first rule is be a class act.

Docsnow
#2 Posted : Tuesday, January 22, 2008 10:57:48 AM(UTC)
Docsnow

Rank: Marinette Royal Aluminum Poster (300+) posts

Groups: Admin, Administration
Joined: 12/4/2007(UTC)
Posts: 1,868
Points: 4,238

Thanks: 2 times
Was thanked: 27 time(s) in 27 post(s)
Joe,

"Octave and Matlab Web pages"

Hope U never miss spell “Matlab” Shame on you METHLAB Shame on you Or U might have the DEA & Coasties boarding U Pray
Now that would be a revolting development !!! d'oh!

Norm, BIG BigM live on Applause
http://www.picturetrail.com/gid23690601 Try it now there's music to listen to while U view the Big M's

http://www.PictureTrail..../index.php?clubID=20726 this one for the Pix club


 You'll have bad times, but they'll just wake you up to the good times you weren't paying attention to

Some people try to turn back their odometers.Not me, I want people to know "why" I look this way.I've traveled a long way and some of the roads weren't paved.
marinettejoe
#3 Posted : Wednesday, January 23, 2008 5:30:28 AM(UTC)
marinettejoe

Rank: Administration

Groups: Admin2
Joined: 12/3/2007(UTC)
Posts: 515
Points: 611
Location: Aquia, Va

Thanks: 31 times
Was thanked: 37 time(s) in 24 post(s)
Thanks DOC, ....
It's deep technie preference stuff.
Both of these are big on the EE and CE part of electronics. I needed an interface for Signals stuff, so I worked this out rather than a MATLAB toolbox solution. (Still nothing replaces the ease of Simulink) I'm told that Jaguar racing used Octave for it's math analysis, but the lack of a good front end makes it hard to use. It's free toolboxes with 3d stuff and structures analysis might be a good choice for hull designers.

This gives me a way to knock up a front end that can do toolbox stuff with a local browser interface. ... Of course no one else uses this trick, but hey... They will.
Unzinced ships sink at slips. yep
Users browsing this topic
guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.156 seconds.