diff --git a/PGAss/PGAss.py b/PGAss/PGAss.py
new file mode 100755
index 0000000..974809f
--- /dev/null
+++ b/PGAss/PGAss.py
@@ -0,0 +1,29 @@
+#!/usr/bin/env python
+
+#import pyGnuAss
+
+class Main:
+ 'main class for PythonGnuAssistant; test for necessary libaries'
+ import sys
+
+ try:
+ import pygtk
+ pygtk.require("2.0") #we want to use gtk2
+ except:
+ print "\nYou need \"pygtk\" to get this working."
+ print "In Debian do: apt-get install python2.3-gtk2\n"
+ sys.exit(1)
+
+ try:
+ import gtk
+ from gtk import glade
+ except:
+ print "\nYou need \"libglade\" to get this working."
+ print "In Debian do: apt-get install python2.3-glade2\n"
+ sys.exit(1)
+
+ import pyGnuAss
+ pga = pyGnuAss.PyGnuplotAssistant(gtk)
+ gtk.mainloop()
+
+
diff --git a/PGAss/TODO b/PGAss/TODO
new file mode 100644
index 0000000..6ae5424
--- /dev/null
+++ b/PGAss/TODO
@@ -0,0 +1,13 @@
+TODO PythonGnuplotAsistant (02004/08/09)
+
+[ ] alte config einlesen
+[ ] grafiken ins gui einbauen
+[ ] threads fuer gnuplot
+
+
+meaning:
+[ ] request
+[.] work in progress
+[*] done
+[!] fix me
+
diff --git a/PGAss/Threadclass.py b/PGAss/Threadclass.py
new file mode 100644
index 0000000..793c208
--- /dev/null
+++ b/PGAss/Threadclass.py
@@ -0,0 +1,8 @@
+#!/usr/bin/python
+class plo:
+ def __init__(self):
+ print "myGnuplot thread started"
+ import myGnuPlot
+ gplot = myGnuPlot.myGnuPlot()
+ gplot.plot_it()
+
diff --git a/PGAss/gnuPlotData.py b/PGAss/gnuPlotData.py
new file mode 100644
index 0000000..24fe733
--- /dev/null
+++ b/PGAss/gnuPlotData.py
@@ -0,0 +1,74 @@
+class PlotData:
+ 'holds the data for gnuplot'
+ """ order of values in gnuplotdata is important!
+ 0:title 1:datastyle 2:seconds 3:filename 4:readdata
+ 5:labelx 6:labely"""
+ gnuplotdata = ['','','','','','','','']
+ """ order of values in gnuplotcheckboxes is important!
+ 0:reread, 1:autoscale, 2:grid, 3:key, 4:logx, 5:logy """
+ gnuplotcheckboxes = ['','','','','','']
+ # valuepairs; if no second option, leave empty ['foo', '']
+ # TODO: put this in an extra ascii file
+ cb_possibilities = [['\nreread',''],['\nset autoscale',''], \
+ ['\nset grid','\nset nogrid'],['\nset key','\nset nokey'], \
+ ['\nset logscale x','\nset nologscale x'], \
+ ['\nset logscale y','\nset nologscale y']]
+## this is for testing only..
+ comment = "\n# ___insert your plot here___ "\
+ "\n#e.g.: plot \"mydata.file\" using 2:5 "
+##
+
+ def __init__(self):
+ pass
+
+ def get_all_values(self):
+ return self.gnuplotdata
+
+ def set_important_values(self, a,b,c,d,e,f,g):
+ self.gnuplotdata = [a,b,c,d,e,f,g]
+ #print self.gnuplotdata
+
+ def set_checkbox_values(self, a,b,c,d,e,f):
+ self.gnuplotcheckboxes = [a,b,c,d,e,f]
+ #print self.gnuplotcheckboxes
+ self.__interpret_cb_values()
+ #print self.gnuplotcheckboxes
+
+ def write_tofile(self):
+ 'write all options to the specified file'
+### uncomment the following lines to deny file overwriting !!
+ #import os
+ #if os.path.exists(self.gnuplotdata[3]):
+ #return "file exists! cowardly refusing to write"
+###
+ try:
+ gnuplotfile = open(self.gnuplotdata[3],'w')
+ except:
+ return "could NOT write to "+self.gnuplotdata[3]
+ gnuplotfile.write("set title \""+self.gnuplotdata[0]+"\";")
+ gnuplotfile.write("\nset data style "+self.gnuplotdata[1]+";")
+ gnuplotfile.write("\nset xlabel \""+self.gnuplotdata[5]+"\";")
+ gnuplotfile.write("\nset ylabel \""+self.gnuplotdata[6]+"\";")
+ # don't print first element (reread)
+ for element in range(len(self.gnuplotcheckboxes)-1):
+ gnuplotfile.write(self.gnuplotcheckboxes[element+1])
+ ### plot command
+ self.plot = "\nplot \""+self.gnuplotdata[4]+"\" every 2::0 using 7 smooth unique title 'Fensterbank' , \""+self.gnuplotdata[4]+"\" every 2::1 using 7 smooth unique title'Kernschmelze'"
+ ###
+ gnuplotfile.write(self.comment)
+ gnuplotfile.write(self.plot)
+ gnuplotfile.write("\npause "+self.gnuplotdata[2])
+ # reread option is always printed at the end
+ gnuplotfile.write(self.gnuplotcheckboxes[0])
+ gnuplotfile.close()
+ return "successfully written to "+ self.gnuplotdata[3]
+
+ ### private functions
+ def __interpret_cb_values(self):
+ 'test if a setting is checked, if so then write the \
+ responding option in gnuplotcheckboxes'
+ for xxx in range(len(self.gnuplotcheckboxes)):
+ if self.gnuplotcheckboxes[xxx]:
+ self.gnuplotcheckboxes[xxx] = self.cb_possibilities[xxx][0]
+ else:
+ self.gnuplotcheckboxes[xxx] = self.cb_possibilities[xxx][1]
diff --git a/PGAss/gnuplot-howto.htm b/PGAss/gnuplot-howto.htm
new file mode 100755
index 0000000..be64339
--- /dev/null
+++ b/PGAss/gnuplot-howto.htm
@@ -0,0 +1,203 @@
+
+
Systemausfall: senseLab-Wiki: GnuPlotHowTo
+
+
+Benutzung von GnuPlot
+
+
+detailliert ist alles nachzulesen im [gnuplot-Handbuch] (gzipped)
+
+alles in Kürze findest Du hier: http://www.duke.edu/~hpgavin/gnuplot.html
+
+
die wichtigsten Befehle im Überblick
+
+mit
gnuplot startest Du den interaktiven Modus - alles laesst sich aber natuerlich auch per Skript reingeben (
gnuplot name_des_skripts.plt)
+
+[einen großen Teil der folgenden Auflistung habe ich http://ieee.uow.edu.au/documents/gnuplot/gnuplot entnommen ...]
+
+
+- set xrange [-5:5]
+
- set yrange [-2:4]
+
- set grid / set nogrid - die Rasterung
+
- set key / set nokey - die Legende
+
- set autoscale ueberschreibt alle xrange- und yrange-Festlegungen
+
- set size {{no}square | ratio <r> | noratio} {<xscale>,<yscale>}
+
- set output "filename" - aufeinanderfolgende Plots landen in derselben Datei, bis ein anderer terminal ausgewählt wird
+
- help
+
- exit
+
- set term TYPE legt die Ausgabe fest:
+
+- dutzende Formate: postscript, png, x11, windows, latex, corel, fig, ...
+
- die komplette Liste siehst Du mit set terminal
+
+ - load <gnuplotfile> - laed eine Datei mit gnuplot Befehlen & fuehrt diese aus
+
+
+
der plot-Befehl
+
+
+
+- der erste Parameter ist eine Funktion oder ein Dateiname (in Anführungsstrichen)
+
+- ein leerer Dateiname (also nur die Anfuehrungsstriche) entsprechen der letzten benutzten Datei
+
+ - danch kann Folgendes erscheinen:
+
+- index
+
+- es gibt diese drei Varianten, um "Zeilen" aus einer Datendatei auszuwählen:
+
+- N - nur den n-ten Datensatz
+
- N:M - alle Datensätze von n bis m
+
- N:P:M - von n ausgehend jeden p-ten Datensatz bis m
+
+
+ - every
+
+- Syntax: PunktIncrement:BlockIncrement:StartPunkt:StartBlock:EndPunkt:EndBlock
+
- jedes einzelne davon kann auch wegfallen - dann muessen fuehrende : aber stehen bleiben (abschliessende : dagegen muessen weggelassen werden)
+
- Blöcke werden in der Datendatei durch Leerzeilen getrennt
+
- innerhalb jedes Blockes können (in Abständen) also Punkte ausgewählt werden
+
+ - smooth
+
+- Werte: unique, csplines, acsplines, bezier oder sbezier
+
- unique ersetzt alle Punkte, die an derselben x-Stelle dargestellt werden würden durch einen Punkt mit gemitteltem y-Wert
+
- die Anderen berechnen die jeweilige Kurve zwischen den Endpunkten
+
- in jedem Fall werden die Punkte nicht mehr einzeln dargestellt, sondern verbunden
+
+ - using
+
+- dies ist der gebräuchlichste Parameter
+
- X:Y bedeutet, dass Spalte Y gegen Spalte X dargestellt werden soll
+
- die Zählung der Spalten beginnt hier mit Eins
+
- eine Null als Spaltennummer ergibt die Zeilennummer jedes Datensatzes
+
- dabei können auch Berechnungen verwendet werden:
+
+- 0:2 bzw. :2 - Spalte zwei wird über der Datensatz-Nummer aufgetragen
+
- 1:($2+$3) - die Summe von Spalte 2 und 3 wird gegen Spalte 1 dargestellt
+
- 1:($3>10 ? $2 : 1/0) - falls der Wert in Spalte 3 größer als 10 ist, wird Spalte 2 ausgegeben, ansonsten wird der Punkt ignoriert (wegen Division durch Null)
+
- ($0/1000):$2 - die Datensatz-Nummern werden um den Faktor 1000 verkleinert
+
+ - die Werte werden über die C-Funktion scanf eingelesen - dazu können Parameter in Anführungsstrichen übergeben werden
+
+ - t
+
+- anschliessend folgt die Beschriftung der Datenreihe fuer die Legende in Anfuehrungsstrichen
+
+
+ - mehrere Kurven in den selben Graphen bekommst Du folgendermassen:
+
+ plot "data/input1.csv" using 0:1 ,\
+ "" using 0:2 ,\
+ "data/input2.csv" using 0:1
+
+- die Reihenfolge der plot-Parameter ist relevant: "index, every, using, smooth" - die Anderen musst Du selbst ausprobieren ...
+
+
+
+
Achsenformatierung
+
+
+- mit set xtics laesst verschiedene Varianten zu:
+
+- X - in Schritten von X
+
- X,Y - ab X in Schritten von Y (bis unendlich)
+
- X,Y,Z - ab X in Schritten von Y bis Z
+
- (1,2,4,8,16,32) - die gegebenen Stellen beschriften
+
- ("text_fuer_wert_1" 1, "text_fuer_wert_2" 2, "text_fuer_wert_3" 3) - Texte speziellen Werten zuordnen
+
- set xtics rotate ???
+
+ - ansonsten:
+
+- set logscale x
+
- set format x "<format_string>"
+
+- auch mit single-quote, um ein paar Ersetzungen zu unterdrücken
+
- Formatbeispiele:
+
+- %f - Fließkomma (z.B.: %+-8.2f -> "+123.00 ")
+
- %e / %E - exponential
+
- %x / %X - hexadezimal
+
- %o / %O - oktal
+
- %T - Potenz zur Basis 10
+
- %S - wissenschaftliche Potenz
+
- %P - Vielfaches von Pi
+
- ansonsten: siehe [gnuplot-Handbuch], Kapitel 34.16 - Format
+
+
+
+
+
+
Beschriftungen (labels)
+
+Syntax:
+
+ set label {<tag>} {"<label-text>"} {at <position>} {<justification>} {{no}rotate} {font "<name><,size>"}
+ set nolabel {<tag>}
+
+
+
+- tag
- Zahl, die das Label identifiziert (fuer nachträgliche Änderung/Löschung); kann weggelassen werden
+
- label-text
- für Zeilenumbrüche, wie üblich, "\n" (oder "\\" für tex u.ä.)
+
- position
- zwei- oder dreimensionale Koordinaten, eventuell mit dem Präfix first, second, graph oder screen
+
- justification
- left, right oder center
+
+
+
+
Beispiele
+
+
+
response-time beim Silimann 6
+
+
+
+ set terminal postscript eps color
+ set yrange [1:4]
+ set ytics 1,0.25,4
+ set format y "%4.2f"
+ set grid
+ set xlabel "TIME [us]"
+ set ylabel "VOLTAGE [V]"
+ set nokey
+ set size square
+ set title "RESPONSE TIME FOR +0,1V STEP"
+ set output "F1.ps"
+ plot "/tikal/public/RUNS/Silimann6/Messdaten/response_time/Rohdaten/importierbares_format/F1/D01.CSV" every ::900::6900 using ($0/1000):1 smooth unique
+
+
+
kleine Sachen
+
+
+- durchgezogene geglättete Linien mit manueller Legenden-Bennenung
- plot "scanpfad.dat" using 3:($4*1000) smooth csplines t "analog-positiv" w lines
+
- die Legende außerhalb des Graphen in eine Box stecken
- set key outside box
+
- die Achsenrichtung umkehren (weiterhin automatische Auflösung)
- set xrange [*:*] reverse
+
- die Achsenbeschriftung um 90 Grad drehen
- set xtics rotate ("Eingangspegel-Aenderung" 0, "Scanpfad-Aktivierung" 1, "Dauer-Refresh" 2, "unbelastet" 3)
+
- ein mehrzeilige Beschriftung
- unix-gemaess durch Einfügen eines Zeilenumbruchs \n oder \\ fuer tex o.ä.
+
- encapsulated postscript
- set terminal postscript eps color (sogar mit Farbe)
+
- Ausgabe in mehreren Formaten
- nach dem Plot-Befehl eine neue Ausgabedatei (set output) und das Format (set terminal) festlegen, anschließend: replot
+
- Funktionen
- plot sin(x)*x - alle weiteren Funtionen unter help functions
+
- png-Bildformat
- folgende Parameter stehen zur Verfügung: {small | medium | large} {{no}transparent} {monochrome | gray | color}; Standard ist kleine Schrift, keine Transparenz und viel Farbe
+
- das Aussehen einzelner Bildpunkte veraendern
- set data style [lines|...]
+
- Punkte auslassen
- plot "datei.csv" every 10 using 0:1
+
- Sonderzeichen
- durch das Uebliche \NNN, wobei NNN eine Oktal-Zahl darstellt - die dazugehoerigen Zeichen lassen sich auf der Konsole beispielsweise durch folgende Eingabe anzeigen: i=0; while [ $i -lt 8 ]; do j=0; while [ $j -lt 8 ]; do k=0; while [ $k -lt 8 ]; do echo -e "$i$j$k\t\\$i$j$k"; k=$(($k+1)); done; j=$(($j+1)); done; i=$(($i+1)); done|less - nun einfach per Schraegstrich (slash) nach dem geuenschten Zeichen suchen; z.B. entspricht das Grad-Zeichen (von "Grad Celsius") dem Code \260
+
+
+
aktualisierte Grafik
+
+;Es soll alle zehn Sekunden eine Logdatei ausgelesen und die Grafik dazu aktualisiert werden.
+
+- scriptdatei erstellen
-
+
+- plot "/var/log/temperatures1", "/var/log/temperatures2"
+
- pause 10
+
- reread
+
+- dann starten
- $gnuplot scriptdatei
+
+
+
\ No newline at end of file
diff --git a/PGAss/gnuplot.prop b/PGAss/gnuplot.prop
new file mode 100644
index 0000000..9c280b2
--- /dev/null
+++ b/PGAss/gnuplot.prop
@@ -0,0 +1,13 @@
+set title "PyGnuplotAssistant";
+set data style lines;
+set xlabel "";
+set ylabel "";
+set autoscale
+set grid
+set key
+set nologscale x
+set nologscale y
+# ___insert your plot here___
+#e.g.: plot "mydata.file" using 2:5
+plot "templog" every 2::0 using 7 smooth unique title 'Fensterbank' , "templog" every 2::1 using 7 smooth unique title'Kernschmelze'
+pause 1
\ No newline at end of file
diff --git a/PGAss/myGnuPlot.py b/PGAss/myGnuPlot.py
new file mode 100644
index 0000000..7458a9d
--- /dev/null
+++ b/PGAss/myGnuPlot.py
@@ -0,0 +1,33 @@
+import os
+import time
+
+class MyGnuPlot:
+ 'use this to open a gnuplot session'
+
+ session = ''
+ def __init__(self, debug):
+ self.debug = debug
+ if self.debug >= 1:
+ print "opening new gnuplot session..."
+ self.session = os.popen("gnuplot","w")
+
+ def __del__(self):
+ if self.debug >= 1:
+ print "closing gnuplot session..."
+ self.session.close()
+
+ def send_command(self, filename):
+ if self.debug >= 1:
+ print "gnuplot load properties from %s" %filename
+ self.session.write("load '%s'\n" %filename)
+ self.session.flush()
+ try:
+ output = self.session.read()
+ except:
+ pass
+
+ def send_kill(self):
+ self.session.write('\n')
+ self.session.flush()
+
+
diff --git a/PGAss/pga-gui.glade b/PGAss/pga-gui.glade
new file mode 100644
index 0000000..c120cd1
--- /dev/null
+++ b/PGAss/pga-gui.glade
@@ -0,0 +1,892 @@
+
+
+
+
+
+
+ 4
+ True
+ window1
+ GTK_WINDOW_TOPLEVEL
+ GTK_WIN_POS_NONE
+ False
+ True
+ False
+
+
+
+ True
+ False
+ 0
+
+
+
+ True
+ Python Gnuplot Assistant
+ False
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+ 0
+ False
+ False
+
+
+
+
+
+ True
+ False
+ 0
+
+
+
+ True
+ Title:
+ False
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+ 3
+ False
+ False
+
+
+
+
+
+ True
+ True
+ True
+ True
+ True
+ 0
+ PyGnuplotAssistant
+ True
+ *
+ False
+
+
+ 0
+ True
+ True
+
+
+
+
+ 2
+ False
+ False
+
+
+
+
+
+ True
+ False
+ 0
+
+
+
+ True
+ Data Style :
+ False
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+ 3
+ False
+ False
+
+
+
+
+
+ True
+ False
+ True
+ False
+ True
+ False
+
+
+
+ True
+ True
+ True
+ True
+ 0
+
+ True
+ *
+ False
+
+
+
+
+
+ True
+ GTK_SELECTION_BROWSE
+
+
+
+ True
+ True
+ lines
+
+
+
+
+
+ True
+ True
+ points
+
+
+
+
+
+ True
+ True
+ linespoints
+
+
+
+
+
+ True
+ True
+ impulses
+
+
+
+
+
+ True
+ True
+ dots
+
+
+
+
+
+ True
+ True
+ steps
+
+
+
+
+
+
+ 0
+ True
+ True
+
+
+
+
+ 2
+ False
+ False
+
+
+
+
+
+ True
+ False
+ 0
+
+
+
+ True
+ Pause [s]
+ False
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+ 3
+ False
+ False
+
+
+
+
+
+ True
+ True
+ 1
+ 0
+ True
+ GTK_UPDATE_ALWAYS
+ False
+ False
+ 1 0 100 1 10 10
+
+
+ 0
+ False
+ False
+
+
+
+
+ 2
+ False
+ False
+
+
+
+
+
+ True
+ False
+ 47
+
+
+
+ True
+ True
+ Reread
+ True
+ GTK_RELIEF_NORMAL
+ False
+ False
+ True
+
+
+ 2
+ False
+ False
+
+
+
+
+
+ True
+ True
+ Autoscale
+ True
+ GTK_RELIEF_NORMAL
+ True
+ False
+ True
+
+
+ 2
+ False
+ False
+
+
+
+
+ 3
+ False
+ False
+
+
+
+
+
+ True
+ False
+ 67
+
+
+
+ True
+ True
+ Grid
+ True
+ GTK_RELIEF_NORMAL
+ True
+ False
+ True
+
+
+ 2
+ False
+ False
+
+
+
+
+
+ True
+ True
+ Key (legend)
+ True
+ GTK_RELIEF_NORMAL
+ True
+ False
+ True
+
+
+ 2
+ False
+ False
+
+
+
+
+ 3
+ False
+ False
+
+
+
+
+
+ True
+ False
+ 61
+
+
+
+ True
+ True
+ LogX
+ True
+ GTK_RELIEF_NORMAL
+ False
+ False
+ True
+
+
+ 2
+ False
+ False
+
+
+
+
+
+ True
+ True
+ LogY
+ True
+ GTK_RELIEF_NORMAL
+ False
+ False
+ True
+
+
+ 2
+ False
+ False
+
+
+
+
+ 3
+ False
+ False
+
+
+
+
+
+ True
+ False
+ 0
+
+
+
+ True
+ LabelX:
+ False
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+ 3
+ False
+ False
+
+
+
+
+
+ True
+ True
+ True
+ True
+ 0
+
+ True
+ *
+ False
+
+
+ 0
+ True
+ True
+
+
+
+
+ 3
+ False
+ False
+
+
+
+
+
+ True
+ False
+ 0
+
+
+
+ True
+ LabelY:
+ False
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+ 3
+ False
+ False
+
+
+
+
+
+ True
+ True
+ True
+ True
+ 0
+
+ True
+ *
+ False
+
+
+ 0
+ True
+ True
+
+
+
+
+ 3
+ False
+ False
+
+
+
+
+
+ True
+ False
+ 0
+
+
+
+ True
+ Read Data from:
+ False
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+ 3
+ False
+ False
+
+
+
+
+
+ True
+ True
+ True
+ True
+ 0
+ templog
+ True
+ *
+ False
+
+
+ 0
+ True
+ True
+
+
+
+
+ 3
+ False
+ False
+
+
+
+
+
+ True
+ False
+ 0
+
+
+
+ True
+ Save properties to:
+ False
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+ 3
+ False
+ False
+
+
+
+
+
+ True
+ True
+ True
+ True
+ 0
+ gnuplot.props
+ True
+ *
+ False
+
+
+ 0
+ True
+ True
+
+
+
+
+ 10
+ False
+ False
+
+
+
+
+
+ True
+
+
+ 6
+ False
+ False
+
+
+
+
+
+ True
+ True
+ True
+ True
+ 0
+
+ False
+ *
+ False
+
+
+ 2
+ False
+ False
+
+
+
+
+
+ 2
+ True
+ False
+ 2
+
+
+
+ 2
+ True
+ True
+ GTK_RELIEF_NORMAL
+
+
+
+
+
+
+ True
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+
+ True
+ False
+ 2
+
+
+
+ True
+ gtk-save
+ 4
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+ 0
+ False
+ False
+
+
+
+
+
+ True
+ Save
+ True
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+ 0
+ False
+ False
+
+
+
+
+
+
+
+
+ 0
+ False
+ False
+
+
+
+
+
+ True
+ True
+ GTK_RELIEF_NORMAL
+
+
+
+
+
+ True
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+
+ True
+ False
+ 2
+
+
+
+ True
+ gtk-execute
+ 4
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+ 0
+ False
+ False
+
+
+
+
+
+ True
+ Test in Gnuplot
+ True
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+ 0
+ False
+ False
+
+
+
+
+
+
+
+
+ 0
+ False
+ False
+
+
+
+
+
+ 2
+ True
+ True
+ GTK_RELIEF_NORMAL
+
+
+
+
+
+
+ True
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+
+ True
+ False
+ 2
+
+
+
+ True
+ gtk-quit
+ 4
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+ 0
+ False
+ False
+
+
+
+
+
+ True
+ Quit
+ True
+ False
+ GTK_JUSTIFY_LEFT
+ False
+ False
+ 0.5
+ 0.5
+ 0
+ 0
+
+
+ 0
+ False
+ False
+
+
+
+
+
+
+
+
+ 0
+ False
+ False
+
+
+
+
+ 2
+ False
+ False
+
+
+
+
+
+
+
diff --git a/PGAss/pga-gui.gladep b/PGAss/pga-gui.gladep
new file mode 100644
index 0000000..d7e0a0a
--- /dev/null
+++ b/PGAss/pga-gui.gladep
@@ -0,0 +1,8 @@
+
+
+
+
+ PGA
+ pga
+ FALSE
+
diff --git a/PGAss/pyGnuAss.py b/PGAss/pyGnuAss.py
new file mode 100644
index 0000000..a70ed5c
--- /dev/null
+++ b/PGAss/pyGnuAss.py
@@ -0,0 +1,89 @@
+#!/usr/bin/env python
+
+import sys
+import gnuPlotData
+
+class PyGnuplotAssistant:
+ 'this class handles the gui for PGAss'
+ import os
+ import myGnuPlot
+ import time
+ #-- import threading
+ #-- t = threading.Thread(target = myGnuPlot.myGnuPlot)
+
+ #xyz = os.popen("gnuplot","w")
+
+ # debug >=1 will print messages on console
+ x = myGnuPlot.MyGnuPlot(debug=1)
+
+
+ pd = gnuPlotData.PlotData()
+ def __init__(self, gtkext):
+ # gtk is given, it has to be known in the whole class
+ self.gtk = gtkext
+ # define which gladefile to use for frontend
+ gladefile = "pga-gui.glade"
+ self.pga = self.gtk.glade.XML(gladefile)
+ # set button handlers
+ actions = { "on_bu_ok_clicked": self.clicked_ok,
+ "on_bu_ok_enter": self.enter_ok,
+ "on_bu_test_clicked": self.clicked_test,
+ "on_bu_test_enter": self.enter_test,
+ "on_bu_cancel_enter": self.enter_cancel,
+ "on_bu_cancel_leave": self.leave_cancel,
+ "on_bu_cancel_clicked": (self.gtk.mainquit) }
+ # connect the actions to the events
+ self.pga.signal_autoconnect (actions)
+ return
+
+ def __del__(self):
+ # this is unnecesseray
+ self.xyz.close()
+
+ #### implementation of actions
+ def enter_cancel(self, widget):
+ self.pga.get_widget("tf_status").set_text("noooo, don't do it")
+ def leave_cancel(self, widget):
+ self.pga.get_widget("tf_status").set_text("do never ever try this again")
+ def enter_ok(self, widget):
+ self.pga.get_widget("tf_status").set_text("save settings to file")
+ def enter_test(self, widget):
+ self.pga.get_widget("tf_status").set_text("start gnuplot with saved properties")
+ def clicked_test(self, widget):
+ self.pga.get_widget("tf_status").set_text("check if gnuplot is installed")
+ filename = self.pga.get_widget("tf_filename").get_text()
+ '''
+ self.xyz.write("load '"+ filename +"'"+ '\n')
+ self.pga.get_widget("tf_status").set_text("check if gnuplot is installed")
+ self.xyz.flush()
+ a = self.xyz.read()
+ print "gnuplot ausgabe: %s" %a
+ '''
+ self.x.send_command(filename)
+ self.pga.get_widget("tf_status").set_text("you should see a popup window")
+
+ def clicked_ok(self, widget):
+ #read the fields and save them
+ ## important values
+ self.pga.get_widget("tf_status").set_text("saved to file")
+ title = self.pga.get_widget("tf_title").get_text()
+ datastyle = self.pga.get_widget("cb_datastyle").get_text()
+ seconds = self.pga.get_widget("sb_seconds").get_text()
+ filename = self.pga.get_widget("tf_filename").get_text()
+ readdata = self.pga.get_widget("tf_readdata").get_text()
+ labelx = self.pga.get_widget("tf_labelx").get_text()
+ labely = self.pga.get_widget("tf_labely").get_text()
+ ## checkbox values
+ reread = self.pga.get_widget("cb_reread").get_active()
+ autoscale = self.pga.get_widget("cb_autoscale").get_active()
+ grid = self.pga.get_widget("cb_grid").get_active()
+ key = self.pga.get_widget("cb_key").get_active()
+ logx = self.pga.get_widget("cb_logx").get_active()
+ logy = self.pga.get_widget("cb_logy").get_active()
+ # pass them to PlotData !order is important!
+ self.pd.set_important_values(title, datastyle, seconds, filename, readdata, labelx, labely)
+ self.pd.set_checkbox_values(reread, autoscale, grid, key, logx, logy)
+ writeresult = self.pd.write_tofile()
+ self.pga.get_widget("tf_status").set_text(writeresult)
+
+
diff --git a/PGAss/showtemps b/PGAss/showtemps
new file mode 100755
index 0000000..612be4a
--- /dev/null
+++ b/PGAss/showtemps
@@ -0,0 +1,9 @@
+set title "Temperaturverlauf"
+set ylabel "Temperatur in °C"
+set xlabel "Messwerte"
+set autoscale
+
+plot "/var/log/temps/templog-21-06-02004" using 7 every 2::0 smooth unique title 'Frühlingsnachmittag' , "/var/log/temps/templog-21-06-02004" using 7 every 2::1 smooth unique title 'Via-CPU'
+#plot "/var/log/temps/templog-21-05-02004" using 7 every 2::0 title 'Frühlingsnachmittag' , "/var/log/temps/templog-21-05-02004" using 7 every 2::1 title 'Via-CPU'
+pause 10
+reread
diff --git a/PGAss/templog b/PGAss/templog
new file mode 100644
index 0000000..e4fdb4f
--- /dev/null
+++ b/PGAss/templog
@@ -0,0 +1,166 @@
+Jun 07 18:09:34 Sensor 0 C: 22.19 F: 71.94
+Jun 07 18:09:45 Sensor 1 C: 26.56 F: 79.81
+Jun 07 18:09:55 Sensor 0 C: 22.25 F: 72.05
+Jun 07 18:10:05 Sensor 1 C: 26.38 F: 79.47
+Jun 07 18:10:15 Sensor 0 C: 22.19 F: 71.94
+Jun 07 18:10:26 Sensor 1 C: 26.25 F: 79.25
+Jun 07 18:10:36 Sensor 0 C: 22.25 F: 72.05
+Jun 07 18:10:46 Sensor 1 C: 26.12 F: 79.03
+Jun 07 18:10:56 Sensor 0 C: 22.25 F: 72.05
+Jun 07 18:11:07 Sensor 1 C: 26.06 F: 78.91
+Jun 07 18:11:18 Sensor 0 C: 22.25 F: 72.05
+Jun 07 18:11:28 Sensor 1 C: 26.06 F: 78.91
+Jun 07 18:11:39 Sensor 0 C: 22.50 F: 72.50
+Jun 07 18:11:49 Sensor 1 C: 26.12 F: 79.03
+Jun 07 18:11:59 Sensor 0 C: 22.50 F: 72.50
+Jun 07 18:12:10 Sensor 1 C: 26.31 F: 79.36
+Jun 07 18:12:20 Sensor 0 C: 22.50 F: 72.50
+Jun 07 18:12:30 Sensor 1 C: 26.38 F: 79.47
+Jun 07 18:12:41 Sensor 0 C: 22.44 F: 72.39
+Jun 07 18:12:51 Sensor 1 C: 26.44 F: 79.59
+Jun 07 18:13:01 Sensor 0 C: 22.44 F: 72.39
+Jun 07 18:13:11 Sensor 1 C: 26.50 F: 79.70
+Jun 07 18:13:22 Sensor 0 C: 22.38 F: 72.28
+Jun 07 18:13:32 Sensor 1 C: 26.44 F: 79.59
+Jun 07 18:13:42 Sensor 0 C: 22.31 F: 72.16
+Jun 07 18:13:53 Sensor 1 C: 26.44 F: 79.59
+Jun 07 18:14:03 Sensor 0 C: 22.31 F: 72.16
+Jun 07 18:14:13 Sensor 1 C: 26.44 F: 79.59
+Jun 07 18:14:24 Sensor 0 C: 22.31 F: 72.16
+Jun 07 18:14:34 Sensor 1 C: 26.44 F: 79.59
+Jun 07 18:14:44 Sensor 0 C: 22.25 F: 72.05
+Jun 07 18:14:55 Sensor 1 C: 26.50 F: 79.70
+Jun 07 18:15:05 Sensor 0 C: 22.19 F: 71.94
+Jun 07 18:15:15 Sensor 1 C: 26.62 F: 79.93
+Jun 07 18:15:26 Sensor 0 C: 22.25 F: 72.05
+Jun 07 18:15:36 Sensor 1 C: 26.69 F: 80.04
+Jun 07 18:15:47 Sensor 0 C: 22.31 F: 72.16
+Jun 07 18:15:57 Sensor 1 C: 26.69 F: 80.04
+Jun 07 18:16:07 Sensor 0 C: 22.31 F: 72.16
+Jun 07 18:16:18 Sensor 1 C: 26.75 F: 80.15
+Jun 07 18:16:28 Sensor 0 C: 22.25 F: 72.05
+Jun 07 18:16:38 Sensor 1 C: 26.88 F: 80.38
+Jun 07 18:16:48 Sensor 0 C: 22.25 F: 72.05
+Jun 07 18:16:59 Sensor 1 C: 26.94 F: 80.49
+Jun 07 18:17:09 Sensor 0 C: 22.25 F: 72.05
+Jun 07 18:17:19 Sensor 1 C: 26.94 F: 80.49
+Jun 07 18:17:29 Sensor 0 C: 22.12 F: 71.82
+Jun 07 18:17:40 Sensor 1 C: 26.88 F: 80.38
+Jun 07 18:17:50 Sensor 0 C: 22.12 F: 71.82
+Jun 07 18:18:00 Sensor 1 C: 26.75 F: 80.15
+Jun 07 18:18:10 Sensor 0 C: 22.06 F: 71.71
+Jun 07 18:18:21 Sensor 1 C: 26.69 F: 80.04
+Jun 07 18:18:31 Sensor 0 C: 22.06 F: 71.71
+Jun 07 18:18:41 Sensor 1 C: 26.62 F: 79.93
+Jun 07 18:18:52 Sensor 0 C: 22.06 F: 71.71
+Jun 07 18:19:02 Sensor 1 C: 26.56 F: 79.81
+Jun 07 18:19:12 Sensor 0 C: 22.06 F: 71.71
+Jun 07 18:19:22 Sensor 1 C: 26.50 F: 79.70
+Jun 07 18:19:33 Sensor 0 C: 22.06 F: 71.71
+Jun 07 18:19:43 Sensor 1 C: 26.44 F: 79.59
+Jun 07 18:19:53 Sensor 0 C: 22.00 F: 71.60
+Jun 07 18:20:03 Sensor 1 C: 26.38 F: 79.47
+Jun 07 18:20:14 Sensor 0 C: 22.00 F: 71.60
+Jun 07 18:20:24 Sensor 1 C: 26.38 F: 79.47
+Jun 07 18:20:34 Sensor 0 C: 22.00 F: 71.60
+Jun 07 18:20:44 Sensor 1 C: 26.31 F: 79.36
+Jun 07 18:20:55 Sensor 0 C: 22.00 F: 71.60
+Jun 07 18:21:05 Sensor 1 C: 26.31 F: 79.36
+Jun 07 18:21:15 Sensor 0 C: 22.06 F: 71.71
+Jun 07 18:21:25 Sensor 1 C: 26.25 F: 79.25
+Jun 07 18:21:36 Sensor 0 C: 22.19 F: 71.94
+Jun 07 18:21:46 Sensor 1 C: 26.25 F: 79.25
+Jun 07 18:21:56 Sensor 0 C: 22.62 F: 72.72
+Jun 07 18:22:06 Sensor 1 C: 26.19 F: 79.14
+Jun 07 18:22:17 Sensor 0 C: 22.56 F: 72.61
+Jun 07 18:22:27 Sensor 1 C: 26.12 F: 79.03
+Jun 07 18:22:37 Sensor 0 C: 22.56 F: 72.61
+Jun 07 18:22:47 Sensor 1 C: 26.19 F: 79.14
+Jun 07 18:22:58 Sensor 0 C: 22.50 F: 72.50
+Jun 07 18:23:08 Sensor 1 C: 26.19 F: 79.14
+Jun 07 18:23:18 Sensor 0 C: 22.44 F: 72.39
+Jun 07 18:23:28 Sensor 1 C: 26.12 F: 79.03
+Jun 07 18:23:39 Sensor 0 C: 22.38 F: 72.28
+Jun 07 18:23:49 Sensor 1 C: 26.12 F: 79.03
+Jun 07 18:23:59 Sensor 0 C: 22.62 F: 72.72
+Jun 07 18:24:10 Sensor 1 C: 26.12 F: 79.03
+Jun 07 18:24:20 Sensor 0 C: 22.56 F: 72.61
+Jun 07 18:24:30 Sensor 1 C: 26.12 F: 79.03
+Jun 07 18:24:40 Sensor 0 C: 22.50 F: 72.50
+Jun 07 18:24:51 Sensor 1 C: 26.12 F: 79.03
+Jun 07 18:25:01 Sensor 0 C: 22.31 F: 72.16
+Jun 07 18:25:11 Sensor 1 C: 26.12 F: 79.03
+Jun 07 18:25:21 Sensor 0 C: 22.31 F: 72.16
+Jun 07 18:25:32 Sensor 1 C: 26.12 F: 79.03
+Jun 07 18:25:42 Sensor 0 C: 22.25 F: 72.05
+Jun 07 18:25:52 Sensor 1 C: 26.12 F: 79.03
+Jun 07 18:26:02 Sensor 0 C: 22.12 F: 71.82
+Jun 07 18:26:13 Sensor 1 C: 26.06 F: 78.91
+Jun 07 18:26:23 Sensor 0 C: 22.06 F: 71.71
+Jun 07 18:26:33 Sensor 1 C: 26.06 F: 78.91
+Jun 07 18:26:43 Sensor 0 C: 22.00 F: 71.60
+Jun 07 18:26:54 Sensor 1 C: 26.06 F: 78.91
+Jun 07 18:27:04 Sensor 0 C: 22.00 F: 71.60
+Jun 07 18:27:14 Sensor 1 C: 26.06 F: 78.91
+Jun 07 18:27:24 Sensor 0 C: 22.00 F: 71.60
+Jun 07 18:27:35 Sensor 1 C: 26.12 F: 79.03
+Jun 07 18:27:45 Sensor 0 C: 22.06 F: 71.71
+Jun 07 18:27:55 Sensor 1 C: 26.19 F: 79.14
+Jun 07 18:28:05 Sensor 0 C: 22.19 F: 71.94
+Jun 07 18:28:16 Sensor 1 C: 26.19 F: 79.14
+Jun 07 18:28:26 Sensor 0 C: 22.12 F: 71.82
+Jun 07 18:28:37 Sensor 1 C: 26.19 F: 79.14
+Jun 07 18:28:47 Sensor 0 C: 22.06 F: 71.71
+Jun 07 18:28:57 Sensor 1 C: 26.25 F: 79.25
+Jun 07 18:29:08 Sensor 0 C: 22.06 F: 71.71
+Jun 07 18:29:18 Sensor 1 C: 26.25 F: 79.25
+Jun 07 18:29:28 Sensor 0 C: 22.06 F: 71.71
+Jun 07 18:29:38 Sensor 1 C: 26.31 F: 79.36
+Jun 07 18:29:49 Sensor 0 C: 22.06 F: 71.71
+Jun 07 18:29:59 Sensor 1 C: 26.38 F: 79.47
+Jun 07 18:30:09 Sensor 0 C: 22.00 F: 71.60
+Jun 07 18:30:19 Sensor 1 C: 26.44 F: 79.59
+Jun 07 18:30:30 Sensor 0 C: 22.00 F: 71.60
+Jun 07 18:30:40 Sensor 1 C: 26.50 F: 79.70
+Jun 07 18:30:50 Sensor 0 C: 21.94 F: 71.49
+Jun 07 18:31:01 Sensor 1 C: 26.56 F: 79.81
+Jun 07 18:31:11 Sensor 0 C: 22.00 F: 71.60
+Jun 07 18:31:21 Sensor 1 C: 26.62 F: 79.93
+Jun 07 18:31:31 Sensor 0 C: 22.06 F: 71.71
+Jun 07 18:31:42 Sensor 1 C: 26.62 F: 79.93
+Jun 07 18:31:52 Sensor 0 C: 22.06 F: 71.71
+Jun 07 18:32:02 Sensor 1 C: 26.69 F: 80.04
+Jun 07 18:32:13 Sensor 0 C: 22.06 F: 71.71
+Jun 07 18:32:23 Sensor 1 C: 26.69 F: 80.04
+Jun 07 18:32:33 Sensor 0 C: 22.00 F: 71.60
+Jun 07 18:32:43 Sensor 1 C: 26.69 F: 80.04
+Jun 07 18:32:54 Sensor 0 C: 21.94 F: 71.49
+Jun 07 18:33:04 Sensor 1 C: 26.69 F: 80.04
+Jun 07 18:33:14 Sensor 0 C: 21.88 F: 71.38
+Jun 07 18:33:25 Sensor 1 C: 26.69 F: 80.04
+Jun 07 18:33:35 Sensor 0 C: 21.75 F: 71.15
+Jun 07 18:33:45 Sensor 1 C: 26.69 F: 80.04
+Jun 07 18:33:55 Sensor 0 C: 21.81 F: 71.26
+Jun 07 18:34:06 Sensor 1 C: 26.69 F: 80.04
+Jun 07 18:34:16 Sensor 0 C: 21.81 F: 71.26
+Jun 07 18:34:26 Sensor 1 C: 26.62 F: 79.93
+Jun 07 18:34:36 Sensor 0 C: 21.81 F: 71.26
+Jun 07 18:34:47 Sensor 1 C: 26.62 F: 79.93
+Jun 07 18:34:57 Sensor 0 C: 21.81 F: 71.26
+Jun 07 18:35:07 Sensor 1 C: 26.62 F: 79.93
+Jun 07 18:35:17 Sensor 0 C: 21.75 F: 71.15
+Jun 07 18:35:28 Sensor 1 C: 26.56 F: 79.81
+Jun 07 18:35:38 Sensor 0 C: 21.75 F: 71.15
+Jun 07 18:35:48 Sensor 1 C: 26.56 F: 79.81
+Jun 07 18:35:58 Sensor 0 C: 21.75 F: 71.15
+Jun 07 18:36:09 Sensor 1 C: 26.56 F: 79.81
+Jun 07 18:36:19 Sensor 0 C: 21.81 F: 71.26
+Jun 07 18:36:29 Sensor 1 C: 26.56 F: 79.81
+Jun 07 18:36:39 Sensor 0 C: 21.88 F: 71.38
+Jun 07 18:36:50 Sensor 1 C: 26.56 F: 79.81
+Jun 07 18:37:00 Sensor 0 C: 21.88 F: 71.38
+Jun 07 18:37:10 Sensor 1 C: 26.50 F: 79.70
+Jun 07 18:37:20 Sensor 0 C: 22.00 F: 71.60
+Jun 07 18:37:31 Sensor 1 C: 26.50 F: 79.70
+Jun 07 18:37:41 Sensor 0 C: 22.00 F: 71.60
+Jun 07 18:37:51 Sensor 1 C: 26.44 F: 79.59