comp.lang.ada
 help / color / mirror / Atom feed
* Tcl/TK + Ada
@ 2012-09-18 11:56 Patrick
  2012-09-18 12:42 ` Thomas Løcke
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Patrick @ 2012-09-18 11:56 UTC (permalink / raw)


This is probably just a continuation of the recent Ada GTK vs QTbinding thread but I didn't want to take a chance of thread-jacking.

So I am working on a daemon that will be written in Ada and controlled by a slew of small simple commands. I am planning on controlling it through a Tcl/Tk GUI. I am wondering if this is a good design decision? Has anyone done somethign like this?

Tcl is not going to be as reliable as Ada but if the code base is small (and Tcl was designed for small code bases) then I should be okay right?

There is an Ada binding:
http://tcladashell.sourceforge.net/index.htm

Am I walking into any pitfalls here...

Any feedback woudl be appreciated-Patrick



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Tcl/TK + Ada
  2012-09-18 11:56 Tcl/TK + Ada Patrick
@ 2012-09-18 12:42 ` Thomas Løcke
  2012-09-18 12:51   ` Patrick
  2012-09-18 17:36 ` Simon Wright
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 15+ messages in thread
From: Thomas Løcke @ 2012-09-18 12:42 UTC (permalink / raw)


On 09/18/2012 01:56 PM, Patrick wrote:
> This is probably just a continuation of the recent Ada GTK vs QTbinding thread but I didn't want to take a chance of thread-jacking.
>
> So I am working on a daemon that will be written in Ada and controlled by a slew of small simple commands. I am planning on controlling it through a Tcl/Tk GUI. I am wondering if this is a good design decision? Has anyone done somethign like this?
>
> Tcl is not going to be as reliable as Ada but if the code base is small (and Tcl was designed for small code bases) then I should be okay right?
>
> There is an Ada binding:
> http://tcladashell.sourceforge.net/index.htm
>
> Am I walking into any pitfalls here...
>
> Any feedback woudl be appreciated-Patrick
>


If the daemon is controlled by a "slew of simple commands", why not just
control it from the commandline interface? That way your daemon is also
controllable from scripts, making it easier for sysadmins to manage it.

Personally I can't stand daemons that are managed from a GUI, as a GUI
usually limits my ability to control the daemon however I want.

Server software without a decent CLI is a dreadful thing to work with.

-- 
Thomas L�cke | thomas@12boo.net | http://12boo.net



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Tcl/TK + Ada
  2012-09-18 12:42 ` Thomas Løcke
@ 2012-09-18 12:51   ` Patrick
  0 siblings, 0 replies; 15+ messages in thread
From: Patrick @ 2012-09-18 12:51 UTC (permalink / raw)


Hi Thomas

Yep I had similar experiences with the cherokee web server. I didn't want to clutter the list but as per usual I can't be short and clear.

Basically the daemon is an scientific instrument control server.  I need a GUI for data visualization. Ther server would maintain sanity and abstract the PC's hardware. So for instance a command could end up being sent over RS232, ethernet or GPIB and if a command was sent out of order, like some sort of initilization after the instrument was already running, then the server could ignore it.

Thanks



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Tcl/TK + Ada
  2012-09-18 11:56 Tcl/TK + Ada Patrick
  2012-09-18 12:42 ` Thomas Løcke
@ 2012-09-18 17:36 ` Simon Wright
  2012-09-18 18:57   ` Patrick
  2012-09-19 10:02 ` john
  2012-09-21  8:54 ` leonid.dulman
  3 siblings, 1 reply; 15+ messages in thread
From: Simon Wright @ 2012-09-18 17:36 UTC (permalink / raw)


Patrick <patrick@spellingbeewinnars.org> writes:

> So I am working on a daemon that will be written in Ada and controlled
> by a slew of small simple commands. I am planning on controlling it
> through a Tcl/Tk GUI. I am wondering if this is a good design
> decision? Has anyone done somethign like this?
>
> Tcl is not going to be as reliable as Ada but if the code base is
> small (and Tcl was designed for small code bases) then I should be
> okay right?
>
> There is an Ada binding: http://tcladashell.sourceforge.net/index.htm
>
> Am I walking into any pitfalls here...

When you say "daemon" I imagine a process which runs continually, and
needs to be controlled using separate, probably short-lived, processes
run from eg the command line and which interact with the daemon process
using some sort of inter-process comms.

The natural way of writing a TASH/Tk app such as you describe has the
GUI as part of the app, and that's not how daemons work.

Given that, even though I'm one of TclAdaShell (aka TASH)'s maintainers,
I don't see any advantage to writing the control process using
TclAdaShell (aka TASH) vs the web approach, where connecting via a
browser corresponds to the short-lived "process".

I do have a minimal web server EWS[1], but it doesn't hold your hand at
all with connecting web pages via eg AJAX to an Ada application. You can
do it, but it's a lot of work.

In distinction, AWS from AdaCore has a lot of support for this sort of
thing, and is definitely worth a look.

[1] https://sourceforge.net/projects/embed-web-srvr/



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Tcl/TK + Ada
  2012-09-18 17:36 ` Simon Wright
@ 2012-09-18 18:57   ` Patrick
  2012-09-18 19:30     ` Simon Wright
  0 siblings, 1 reply; 15+ messages in thread
From: Patrick @ 2012-09-18 18:57 UTC (permalink / raw)



Hi Simon

I am still really in the planning stage right now...but when I say daemon I mean a process that stays alive and accepts instructions. I was planning on using a port to receive on.

So let's say we were controlling an optical spectrometer, we might have commands like:
set_wavelength
set_high_voltage
set_stirrer
plot
etc

So take the plot command for instance.  I want the command to send an instruction and arguments to the daemon and then return right away. The plotting could take hours or days so the daemon could be responsible for it after that point.

If I had all these simple little commands to control the daemon I thought I could also build a gui for it to visualize the data being collected.

Hope this isn't too long or too off topic....

Thanks



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Tcl/TK + Ada
  2012-09-18 18:57   ` Patrick
@ 2012-09-18 19:30     ` Simon Wright
  0 siblings, 0 replies; 15+ messages in thread
From: Simon Wright @ 2012-09-18 19:30 UTC (permalink / raw)


Patrick <patrick@spellingbeewinnars.org> writes:

> I am still really in the planning stage right now...but when I say
> daemon I mean a process that stays alive and accepts instructions. I
> was planning on using a port to receive on.

OK

> So let's say we were controlling an optical spectrometer, we might
> have commands like:
> set_wavelength
> set_high_voltage
> set_stirrer
> plot
> etc
>
> So take the plot command for instance.  I want the command to send an
> instruction and arguments to the daemon and then return right
> away. The plotting could take hours or days so the daemon could be
> responsible for it after that point.

OK. You could build the GUI in straight Tcl/Tk and have it talk to the
daemon's port (on Linux, I guess that'd be a UNIX-domain socket).

> If I had all these simple little commands to control the daemon I
> thought I could also build a gui for it to visualize the data being
> collected.

Yes, indeed; but it'd need to be on the user side, not the daemon's, so
you'd need a protocol to request the current stats/return them (2-way
comms).


Equally you could use the same architecture but with Gtk/Ada.



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Tcl/TK + Ada
  2012-09-18 11:56 Tcl/TK + Ada Patrick
  2012-09-18 12:42 ` Thomas Løcke
  2012-09-18 17:36 ` Simon Wright
@ 2012-09-19 10:02 ` john
  2012-09-19 11:17   ` Pascal Obry
  2012-09-21  8:54 ` leonid.dulman
  3 siblings, 1 reply; 15+ messages in thread
From: john @ 2012-09-19 10:02 UTC (permalink / raw)


Like others said, you should provide all means to control the behavior of the daemon via command line.

Apart from that, Tcl/Tk should be fine, but you might also want to consider building a browser-based interface, e.g. using AWS. 

It's a bit more complicated, but it's "modern" (whether you like it or not) and does have advantages. For example, by using SSL and basic authentication a browser-based interface could easily be used for remote-controlling the daemon if security requirements are not very high.



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Tcl/TK + Ada
  2012-09-19 10:02 ` john
@ 2012-09-19 11:17   ` Pascal Obry
  2012-09-19 12:08     ` Patrick
  0 siblings, 1 reply; 15+ messages in thread
From: Pascal Obry @ 2012-09-19 11:17 UTC (permalink / raw)
  To: john


John,

> Apart from that, Tcl/Tk should be fine, but you might also want to
> consider building a browser-based interface, e.g. using AWS.

Agreed.

> It's a bit more complicated, but it's "modern" (whether you like it
> or not) and does have advantages. For example, by using SSL and basic
> authentication a browser-based interface could easily be used for
> remote-controlling the daemon if security requirements are not very
> high.

Or use a client certificate based authentication which is the highest
security level when dealing with Web applications. Support for this has
recently been added into AWS. Worth looking at the documentation I would
say.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|    http://www.obry.net  -  http://v2p.fr.eu.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Tcl/TK + Ada
  2012-09-19 11:17   ` Pascal Obry
@ 2012-09-19 12:08     ` Patrick
  2012-09-19 13:05       ` john
  2012-09-21 23:23       ` Jerry
  0 siblings, 2 replies; 15+ messages in thread
From: Patrick @ 2012-09-19 12:08 UTC (permalink / raw)
  Cc: john

Hi Pascal

I did seriously consider a web based solution. The problem is it complicates the graphing. There are all sort of plotting solutions in the GUI wolrd but web based, I am stuck with Javascript and few libraries.

Thank for feeding back though



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Tcl/TK + Ada
  2012-09-19 12:08     ` Patrick
@ 2012-09-19 13:05       ` john
  2012-09-19 14:27         ` Patrick
  2012-09-21 23:23       ` Jerry
  1 sibling, 1 reply; 15+ messages in thread
From: john @ 2012-09-19 13:05 UTC (permalink / raw)
  Cc: john


> 
> I did seriously consider a web based solution. The problem is it complicates the graphing. There are all sort of plotting solutions in the GUI wolrd but web based, I am stuck with Javascript and few libraries.

Is your daemon not allowed to execute external processes? If not, there are all kinds of very powerful command-line utilities you could use, e.g. gnuplot. 



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Tcl/TK + Ada
  2012-09-19 13:05       ` john
@ 2012-09-19 14:27         ` Patrick
  2012-09-19 15:12           ` Dmitry A. Kazakov
  2012-09-19 15:43           ` Pascal Obry
  0 siblings, 2 replies; 15+ messages in thread
From: Patrick @ 2012-09-19 14:27 UTC (permalink / raw)
  Cc: john

Hi

external commands are no problem. I like gnuplot and it might be possible to embed it. it would be nice to have contols for the user along side a canvas widget, rather then a free-standing gunplot window

I like GIMP but there are a lot of complaints about all the little windows everywhere, I would like to keep everything in one window.



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Tcl/TK + Ada
  2012-09-19 14:27         ` Patrick
@ 2012-09-19 15:12           ` Dmitry A. Kazakov
  2012-09-19 15:43           ` Pascal Obry
  1 sibling, 0 replies; 15+ messages in thread
From: Dmitry A. Kazakov @ 2012-09-19 15:12 UTC (permalink / raw)


On Wed, 19 Sep 2012 07:27:25 -0700 (PDT), Patrick wrote:

> I like GIMP but there are a lot of complaints about all the little windows
> everywhere, I would like to keep everything in one window.

Don't want to spoil the party, but GIMP is based on GTK. So is AICWL.

It has oscilloscope widget which can be used for plotting, both off-line
and in-the-loop. Since it is a plain GTK widget, you can put into whatever
window you wished.

Code samples can be found here:

http://www.dmitry-kazakov.de/ada/aicwl.htm#12.5

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Tcl/TK + Ada
  2012-09-19 14:27         ` Patrick
  2012-09-19 15:12           ` Dmitry A. Kazakov
@ 2012-09-19 15:43           ` Pascal Obry
  1 sibling, 0 replies; 15+ messages in thread
From: Pascal Obry @ 2012-09-19 15:43 UTC (permalink / raw)
  To: Patrick; +Cc: john

Le 19/09/2012 16:27, Patrick a �crit :
> I like GIMP but there are a lot of complaints about all the little
> windows everywhere, I would like to keep everything in one window.

Which is the case now with GIMP 2.8.

Pascal.

-- 

--|------------------------------------------------------
--| Pascal Obry                           Team-Ada Member
--| 45, rue Gabriel Peri - 78114 Magny Les Hameaux FRANCE
--|------------------------------------------------------
--|    http://www.obry.net  -  http://v2p.fr.eu.org
--| "The best way to travel is by means of imagination"
--|
--| gpg --keyserver keys.gnupg.net --recv-key F949BD3B




^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Tcl/TK + Ada
  2012-09-18 11:56 Tcl/TK + Ada Patrick
                   ` (2 preceding siblings ...)
  2012-09-19 10:02 ` john
@ 2012-09-21  8:54 ` leonid.dulman
  3 siblings, 0 replies; 15+ messages in thread
From: leonid.dulman @ 2012-09-21  8:54 UTC (permalink / raw)


On Tuesday, September 18, 2012 1:56:08 PM UTC+2, Patrick wrote:
> This is probably just a continuation of the recent Ada GTK vs QTbinding thread but I didn't want to take a chance of thread-jacking.
> 
> 
> 
> So I am working on a daemon that will be written in Ada and controlled by a slew of small simple commands. I am planning on controlling it through a Tcl/Tk GUI. I am wondering if this is a good design decision? Has anyone done somethign like this?
> 
> 
> 
> Tcl is not going to be as reliable as Ada but if the code base is small (and Tcl was designed for small code bases) then I should be okay right?
> 
> 
> 
> There is an Ada binding:
> 
> http://tcladashell.sourceforge.net/index.htm
> 
> 
> 
> Am I walking into any pitfalls here...
> 
> 
> 
> Any feedback woudl be appreciated-Patrick

If you want to use ADA with tcl/tk , try VAD (Visual Ada Developer) from http://users1.jabry.com/adastudio/index.html



^ permalink raw reply	[flat|nested] 15+ messages in thread

* Re: Tcl/TK + Ada
  2012-09-19 12:08     ` Patrick
  2012-09-19 13:05       ` john
@ 2012-09-21 23:23       ` Jerry
  1 sibling, 0 replies; 15+ messages in thread
From: Jerry @ 2012-09-21 23:23 UTC (permalink / raw)
  Cc: john

On Wednesday, September 19, 2012 5:08:00 AM UTC-7, Patrick wrote:
> Hi Pascal
> I did seriously consider a web based solution. The problem is it complicates the graphing. There are all sort of plotting solutions in the GUI wolrd but web based, I am stuck with Javascript and few libraries.
>
> Thank for feeding back though

And there's PLplot, a linkable library with fine ;-) Ada bindings and extensions.

http://plplot.sourceforge.net/

Jerry



^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2012-09-21 23:23 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-18 11:56 Tcl/TK + Ada Patrick
2012-09-18 12:42 ` Thomas Løcke
2012-09-18 12:51   ` Patrick
2012-09-18 17:36 ` Simon Wright
2012-09-18 18:57   ` Patrick
2012-09-18 19:30     ` Simon Wright
2012-09-19 10:02 ` john
2012-09-19 11:17   ` Pascal Obry
2012-09-19 12:08     ` Patrick
2012-09-19 13:05       ` john
2012-09-19 14:27         ` Patrick
2012-09-19 15:12           ` Dmitry A. Kazakov
2012-09-19 15:43           ` Pascal Obry
2012-09-21 23:23       ` Jerry
2012-09-21  8:54 ` leonid.dulman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox