Google Groepen ondersteunt geen nieuwe Usenet-berichten of -abonnementen meer. Historische content blijft zichtbaar.

Showing graphical temperature with Tcl/Tk

151 weergaven
Naar het eerste ongelezen bericht

Cecil Westerhof

ongelezen,
19 dec 2017, 04:14:0619-12-2017
aan
I just started with Tcl and now also with Tk. But I like it and I
think it will supplant my Bash usage.

I already wrote a little script that shows my CPU temperature in a
console. But it would be much better to do this with Tk.

I measure the temperature every minute. I would think to show a graph
from the last 60 minutes and beside that the current temperature. The
last part I know, but any pointers about how to display the graph?

--
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof

Arjen Markus

ongelezen,
19 dec 2017, 04:35:4119-12-2017
aan
The Wiki has plenty of pointers for that, BLT is a well-known package for plotting, I myself often use Plotchart (part of Tklib). I am a trifle biased, though, as I developed it together with contributions from others.

It sounds like you are looking for a stripchart facility. Both packages can do that.

Regards,

Arjen

Christian Gollwitzer

ongelezen,
19 dec 2017, 05:01:3519-12-2017
aan
Hi Cecil,

Am 19.12.17 um 10:08 schrieb Cecil Westerhof:
> I measure the temperature every minute. I would think to show a graph
> from the last 60 minutes and beside that the current temperature. The
> last part I know, but any pointers about how to display the graph?

I'm also a bit biased as the author of yet another plot package called ukaz:

https://github.com/auriocus/ukaz

One of the demos is actually similar to your request:

https://github.com/auriocus/ukaz/blob/master/demo/linuxload.tcl

It displays a graph of the load average on Linux.

Christian

Cecil Westerhof

ongelezen,
19 dec 2017, 05:14:0519-12-2017
aan
OK, thanks. I will look into that as soon as I have a basic
understanding of Tk.

Rich

ongelezen,
19 dec 2017, 06:00:5519-12-2017
aan
Cecil Westerhof <Ce...@decebal.nl> wrote:
> I just started with Tcl and now also with Tk. But I like it and I
> think it will supplant my Bash usage.
>
> I already wrote a little script that shows my CPU temperature in a
> console. But it would be much better to do this with Tk.
>
> I measure the temperature every minute. I would think to show a graph
> from the last 60 minutes and beside that the current temperature. The
> last part I know, but any pointers about how to display the graph?

1) Install TkLib, use the 'plotchart' widget. Several wiki links:

http://wiki.tcl-lang.org/11265 (plotchart)
http://wiki.tcl-lang.org/18167 (Plotchart gallery)
http://wiki.tcl-lang.org/28514 (Some more Plotchart examples)
http://wiki.tcl-lang.org/28179 (Interactive plotting with Plotchart)
http://wiki.tcl-lang.org/21144 (An interactive tutorial for Plotchart)
http://wiki.tcl-lang.org/48910 (Data selection in plotchart)
http://wiki.tcl-lang.org/26050 (Extensions to Plotchart)
http://wiki.tcl-lang.org/26064 (Extensions to Plotchart 2)

2) Or read these pages:

http://wiki.tcl-lang.org/1123 (How to plot a graph)
http://wiki.tcl-lang.org/9503 (Chart generation support)
http://wiki.tcl-lang.org/10552 (Plotting a simple graph)
http://wiki.tcl-lang.org/13680 (A little bar chart)
http://wiki.tcl-lang.org/988 (A little function plotter)
http://wiki.tcl-lang.org/8552 (A little graph plotter)

#1 is the "I want a temperature graph with the least amount of work"
set of links. #2 is the "I want to know how to draw a graph from a
dataset" set of links (although reading the plotchart source would
likely help here slightly as well).


Cecil Westerhof

ongelezen,
19 dec 2017, 07:28:0619-12-2017
aan
Thank you. I think both will be interesting.

I am afraid I will not get bored soon. ;-)

keithv

ongelezen,
20 dec 2017, 21:35:2520-12-2017
aan
On Tuesday, December 19, 2017 at 1:14:06 AM UTC-8, Cecil Westerhof wrote:
> I just started with Tcl and now also with Tk. But I like it and I
> think it will supplant my Bash usage.
>
> I already wrote a little script that shows my CPU temperature in a
> console. But it would be much better to do this with Tk.
>
> I measure the temperature every minute. I would think to show a graph
> from the last 60 minutes and beside that the current temperature. The
> last part I know, but any pointers about how to display the graph?

The NOAA Weather Forecast page on wiki (http://wiki.tcl.tk/17514) has a graph of temperatures which you could use as a guide. It uses plotchart to do the heavy lifting. Checkout the procedure PlotTemp.

Keith

ifind...@gmail.com

ongelezen,
31 jan 2018, 17:38:3531-01-2018
aan
Have a look at TclFltk. It has instant plotting widgets and extensive documentation.
0 nieuwe berichten