Skip to content

Commit f18fe63

Browse files
author
aglavic
committed
GUI icons
XY-projectoins improved Some fixes for multiplot Fix gnuplto script for xy-projections
1 parent fe69a4a commit f18fe63

21 files changed

+896
-751
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ debug/*.sim
2222
debug/*.res
2323
debug/*.png
2424
debug/*.sh
25+
gtkgui/icons/*
2526
config/fit/fit-script.sh
2627
config/fit/fit_tmp.f90
2728
config/fonts

.project

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
</natures>
1717
<filteredResources>
1818
<filter>
19-
<id>1327181354968</id>
19+
<id>1327485180744</id>
2020
<name></name>
2121
<type>26</type>
2222
<matcher>
@@ -25,7 +25,7 @@
2525
</matcher>
2626
</filter>
2727
<filter>
28-
<id>1327181354970</id>
28+
<id>1327485180753</id>
2929
<name></name>
3030
<type>22</type>
3131
<matcher>
@@ -34,7 +34,7 @@
3434
</matcher>
3535
</filter>
3636
<filter>
37-
<id>1327181354971</id>
37+
<id>1327485180762</id>
3838
<name></name>
3939
<type>26</type>
4040
<matcher>
@@ -43,7 +43,7 @@
4343
</matcher>
4444
</filter>
4545
<filter>
46-
<id>1327181354972</id>
46+
<id>1327485180769</id>
4747
<name></name>
4848
<type>26</type>
4949
<matcher>
@@ -52,13 +52,40 @@
5252
</matcher>
5353
</filter>
5454
<filter>
55-
<id>1327181354974</id>
55+
<id>1327485180770</id>
5656
<name></name>
5757
<type>26</type>
5858
<matcher>
5959
<id>org.eclipse.ui.ide.multiFilter</id>
6060
<arguments>1.0-name-matches-false-false-repository</arguments>
6161
</matcher>
6262
</filter>
63+
<filter>
64+
<id>1327485180771</id>
65+
<name></name>
66+
<type>10</type>
67+
<matcher>
68+
<id>org.eclipse.ui.ide.multiFilter</id>
69+
<arguments>1.0-name-matches-false-false-debug</arguments>
70+
</matcher>
71+
</filter>
72+
<filter>
73+
<id>1327485180772</id>
74+
<name></name>
75+
<type>10</type>
76+
<matcher>
77+
<id>org.eclipse.ui.ide.multiFilter</id>
78+
<arguments>1.0-name-matches-false-false-doc</arguments>
79+
</matcher>
80+
</filter>
81+
<filter>
82+
<id>1327485180774</id>
83+
<name></name>
84+
<type>5</type>
85+
<matcher>
86+
<id>org.eclipse.ui.ide.multiFilter</id>
87+
<arguments>1.0-name-matches-false-false-*.*</arguments>
88+
</matcher>
89+
</filter>
6390
</filteredResources>
6491
</projectDescription>

.settings/org.eclipse.core.resources.prefs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
1-
#Tue Jan 24 21:02:52 CET 2012
1+
#Thu Jan 26 17:23:57 CET 2012
22
eclipse.preferences.version=1
33
encoding//additions/matplot_npz.py=utf8
4+
encoding//config/default_templates/afm.py=utf-8
5+
encoding//config/default_templates/afm_histo.py=utf-8
6+
encoding//config/gnuplot_preferences.py=utf-8
47
encoding//gtkgui/dialogs.py=utf-8
58
encoding//gtkgui/diverse_classes.py=utf-8
69
encoding//gtkgui/file_actions.py=utf-8
710
encoding//gtkgui/main_window.py=utf-8
811
encoding//gtkgui/multiplots.py=utf-8
12+
encoding//gtkgui/treff.py=utf-8
13+
encoding//plugins/__init__.py=utf-8
14+
encoding//read_data/__init__.py=utf-8
915
encoding//read_data/reflectometer.py=utf-8
1016
encoding//sessions/generic.py=utf-8
1117
encoding/__init__.py=utf-8
@@ -15,3 +21,4 @@ encoding/measurement_data_structure.py=utf-8
1521
encoding/option_types.py=utf-8
1622
encoding/parallel.py=utf-8
1723
encoding/plotpy_info.py=utf-8
24+
encoding/setup.py=utf-8

MANIFEST.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
recursive-include doc *.html
2+
recursive-include gtkgui/icons *.png
23
include config/fit/fit.f90
34
include config/logo*.*
45
recursive-include config/fit/pnr_multi *.f90

additions/matplot_npz.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
Example script how to used numpy .npz exported data from plot.py
55
'''
66

7-
import sys
8-
from pylab import *
9-
from numpy import load
7+
import sys #@UnusedImport
8+
from pylab import * #@UnusedWildImport
9+
from numpy import load #@Reimport
1010

1111
nextlog=False
1212
for i, name in enumerate(sys.argv[1:]):

config/gnuplot_preferences.py

Lines changed: 44 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77
from os.path import exists, split
88
from os.path import join as join_path
99

10-
__author__ = "Artur Glavic"
11-
__credits__ = []
10+
__author__="Artur Glavic"
11+
__credits__=[]
1212
from plotpy_info import __copyright__, __license__, __version__, __maintainer__, __email__
13-
__status__ = "Production"
13+
__status__="Production"
1414

1515
#
1616
# place holders:
@@ -71,7 +71,7 @@
7171
# character encoding in gnuplot
7272
ENCODING='utf8'
7373
# set the terminal options for the gnuplot output (postscript could need other labels)
74-
set_output_terminal_png='png enhanced size [width],[height] font "'+join_path('[font-path]', 'Arial.ttf')+\
74+
set_output_terminal_png='png enhanced size [width],[height] font "'+join_path('[font-path]', 'Arial.ttf')+\
7575
'" [font-size] lw 2' #transparent
7676
# since gnuplot 4.4 this is suppoerted
7777
set_output_terminal_pngcairo='pngcairo enhanced size [width],[height] font "Arial,[font-size]" lw 2' #transparent
@@ -80,12 +80,12 @@
8080

8181
# terminal for external gnuplot window
8282
if "linux" in platform:
83-
set_output_terminal_wxt='wxt enhanced font "'+join_path('[font-path]', 'Arial.ttf')+'" 16'
83+
set_output_terminal_wxt='wxt enhanced font "'+join_path('[font-path]', 'Arial.ttf')+'" 16'
8484
elif "darwin" in platform:
85-
set_output_terminal_wxt='aqua enhanced font "'+join_path('[font-path]', 'Arial.ttf')+'" 16'
85+
set_output_terminal_wxt='aqua enhanced font "'+join_path('[font-path]', 'Arial.ttf')+'" 16'
8686
else:
87-
set_output_terminal_wxt='wxt enhanced font "'+join_path('[font-path]', 'Arial.ttf')+'" 16'
88-
set_output_terminal_x11='x11 enhanced font "'+join_path('[font-path]', 'Arial.ttf')+'" 16'
87+
set_output_terminal_wxt='wxt enhanced font "'+join_path('[font-path]', 'Arial.ttf')+'" 16'
88+
set_output_terminal_x11='x11 enhanced font "'+join_path('[font-path]', 'Arial.ttf')+'" 16'
8989

9090
# set output file name, the postfix has to be chosen consistant to the 'set term' statement
9191
output_file_name='[name]_[add_info][nr].png'
@@ -105,7 +105,7 @@
105105
plotting_parameters_3d='w pm3d' # plotting 3d
106106
plotting_parameters_fit='w lines lw 3'
107107
settings_3d=\
108-
'''set style line 100 lt 6 lw 2
108+
'''set style line 100 lc 0 lw 0.5
109109
set pm3d hidden3d 100
110110
set ticslevel 0.05
111111
set palette defined (0 "blue", 1 "green", 2 "yellow", 3 "red", 4 "purple", 5 "black")
@@ -117,44 +117,44 @@
117117
set size square
118118
'''
119119
defined_color_patterns={
120-
'Default': 'defined (0 "blue", 1 "green", 2 "yellow", 3 "red", 4 "purple", 5 "black") model RGB',
121-
'Default White Base': 'defined (0 "white", 0.001 "blue", 1 "green", 2 "yellow", 3 "red", 4 "purple", 5 "black")',
122-
'GLI': 'functions (gray*5./6.<0.75)?0.75-gray*5./6.:1.75-gray*5./6., 0.857, 0.875 model HSV',
123-
'Black to Red': 'defined (0 "black", 1 "purple", 2 "blue", 3 "green", 4 "yellow", 5 "red") model RGB',
124-
'Grey Scale': 'gray model RGB',
125-
'Blue,Green,Yellow,Red': 'defined (0 "blue",1 "green", 2 "yellow",3 "red") model RGB',
126-
'Black to Yellow': 'defined (0 "black",1 "blue", 2 "red",3 "yellow") model RGB',
127-
'Gnuplot std.': 'rgbformulae 7,5,15 model RGB',
120+
'Default': 'defined (0 "blue", 1 "green", 2 "yellow", 3 "red", 4 "purple", 5 "black") model RGB',
121+
'Default White Base': 'defined (0 "white", 0.001 "blue", 1 "green", 2 "yellow", 3 "red", 4 "purple", 5 "black")',
122+
'GLI': 'functions (gray*5./6.<0.75)?0.75-gray*5./6.:1.75-gray*5./6., 0.857, 0.875 model HSV',
123+
'Black to Red': 'defined (0 "black", 1 "purple", 2 "blue", 3 "green", 4 "yellow", 5 "red") model RGB',
124+
'Grey Scale': 'gray model RGB',
125+
'Blue,Green,Yellow,Red': 'defined (0 "blue",1 "green", 2 "yellow",3 "red") model RGB',
126+
'Black to Yellow': 'defined (0 "black",1 "blue", 2 "red",3 "yellow") model RGB',
127+
'Gnuplot std.': 'rgbformulae 7,5,15 model RGB',
128128
# MARIA color map from Stefan Mattauch
129-
'MARIA log': 'defined (0 0 0 0 , 1 0 1 0, 2 0 0 1, 3 1 0 0, 4 0 1 1 , 5 1 0 1, 6 1 1 0, 7 1 1 1) model RGB',
130-
'MARIA lin': 'defined (0 1 1 1 , 1 0 1 0, 2 0 0 1, 3 1 0 0, 4 0 1 1 , 5 1 0 1, 6 1 1 0, 7 1 1 1) model RGB',
131-
'fit2d': 'defined (0 "#000000", 1 "#0000d1", 2 "#c3c3ff", 3 "#9ee246", 4 "#fdfe78", 5.5 "#cc8800", 6.5 "#dc3ef7", 7.5 "#ffffff") model RGB',
132-
'Rainbow': 'rgbformulae 22,13,-31 model RGB',
133-
'Hot': 'rgbformulae 21,22,23 model RGB',
134-
'Color, gray printable': 'rgbformulae 31,32,33 model RGB',
135-
'+ and - peaks': 'defined (0 0 0 0.5, 1 0 0 1, 5 1 1 1, 9 1 0 0, 10 0.5 0 0) model RGB',
129+
'MARIA log': 'defined (0 0 0 0 , 1 0 1 0, 2 0 0 1, 3 1 0 0, 4 0 1 1 , 5 1 0 1, 6 1 1 0, 7 1 1 1) model RGB',
130+
'MARIA lin': 'defined (0 1 1 1 , 1 0 1 0, 2 0 0 1, 3 1 0 0, 4 0 1 1 , 5 1 0 1, 6 1 1 0, 7 1 1 1) model RGB',
131+
'fit2d': 'defined (0 "#000000", 1 "#0000d1", 2 "#c3c3ff", 3 "#9ee246", 4 "#fdfe78", 5.5 "#cc8800", 6.5 "#dc3ef7", 7.5 "#ffffff") model RGB',
132+
'Rainbow': 'rgbformulae 22,13,-31 model RGB',
133+
'Hot': 'rgbformulae 21,22,23 model RGB',
134+
'Color, gray printable': 'rgbformulae 31,32,33 model RGB',
135+
'+ and - peaks': 'defined (0 0 0 0.5, 1 0 0 1, 5 1 1 1, 9 1 0 0, 10 0.5 0 0) model RGB',
136136
}
137137
# title for a curve
138138
titles='[titles_add]'
139139

140-
postscript_characters= [
141-
('µ','{/Symbol m}'),
142-
('°','\\260'),
143-
('·','\\267'),
144-
('²','\\262'),
145-
('α','{/Symbol a}'),
146-
('β','{/Symbol b}'),
147-
('γ','{/Symbol g}'),
148-
('Γ','{/Symbol G}'),
149-
('δ','{/Symbol d}'),
150-
('φ','{/Symbol f}'),
151-
('χ','{/Symbol c}'),
152-
('π','{/Symbol p}'),
153-
('σ','{/Symbol s}'),
154-
('ω','{/Symbol w}'),
155-
('Σ','{/Symbol S}'),
156-
('Δ','{/Symbol D}'),
157-
('Ω','{/Symbol W}'),
158-
('Θ','{/Symbol Q}'),
159-
('Å','A'),
140+
postscript_characters=[
141+
('µ', '{/Symbol m}'),
142+
('°', '\\260'),
143+
('·', '\\267'),
144+
('²', '\\262'),
145+
('α', '{/Symbol a}'),
146+
('β', '{/Symbol b}'),
147+
('γ', '{/Symbol g}'),
148+
('Γ', '{/Symbol G}'),
149+
('δ', '{/Symbol d}'),
150+
('φ', '{/Symbol f}'),
151+
('χ', '{/Symbol c}'),
152+
('π', '{/Symbol p}'),
153+
('σ', '{/Symbol s}'),
154+
('ω', '{/Symbol w}'),
155+
('Σ', '{/Symbol S}'),
156+
('Δ', '{/Symbol D}'),
157+
('Ω', '{/Symbol W}'),
158+
('Θ', '{/Symbol Q}'),
159+
('Å', 'A'),
160160
]

config/gui.py

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,38 @@
88
so it is recommanded to use this if possible.
99
'''
1010

11-
__author__ = "Artur Glavic"
12-
__credits__ = []
11+
__author__="Artur Glavic"
12+
__credits__=[]
1313
from plotpy_info import __copyright__, __license__, __version__, __maintainer__, __email__
14-
__status__ = "Development"
14+
__status__="Development"
1515

1616
#toolkit='wx'
1717
toolkit='gtk'
1818

1919
DOWNLOAD_PAGE_URL='http://iffwww.iff.kfa-juelich.de/~glavic/plotupdate.py'
2020

21+
ICONS={
22+
'Apply': 'apply.png',
23+
'ErrorBars': 'errorbars.png',
24+
'ToggleMousemode': 'mousemode.png',
25+
'ExportAll': 'exportselection.png',
26+
'ExportAs': 'export.png',
27+
'Export': 'export.png',
28+
'AddMultiplot': 'multiplotadd.png',
29+
'Multiplot': 'multiplot.png',
30+
'SnapshotSub': 'snapshot.png',
31+
'SaveSnapshot': 'snapshotsave.png',
32+
'SaveSnapshotAs': 'snapshotsave.png',
33+
'LoadSnapshot': 'snapshotload.png',
34+
'LoadSnapshotFrom': 'snapshotload.png',
35+
'PlotKeyLeft': 'keytopleft.png',
36+
'PlotKeyRight': 'keytopright.png',
37+
'PlotKeyBottomLeft': 'keybottomleft.png',
38+
'PlotKeyBottomRight': 'keybottomright.png',
39+
'PlotToggleGrid': 'grid.png',
40+
'PlotToggleLinespoints': 'linespoints.png',
41+
'ShowPersistent': 'plotexternal.png',
42+
'XYProjections': 'togglexyprojection.png',
43+
44+
}
45+
ICON_SIZE=24

gtkgui/dialogs.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
__author__="Artur Glavic"
2323
__credits__=[]
24-
from plotpy_info import __copyright__, __license__, __version__, __maintainer__, __email__
24+
from plotpy_info import __copyright__, __license__, __version__, __maintainer__, __email__ #@UnusedImport
2525
__status__="Production"
2626

2727

@@ -157,10 +157,10 @@ def run(self):
157157
'''
158158
Called to show the dialog and create unset previews.
159159
'''
160-
def stop_preview_creation(dialog, id):
160+
def stop_preview_creation(dialog, id_):
161161
# Stop the preview creation on a response signal
162162
self.stop_preview=True
163-
self.response_id=id
163+
self.response_id=id_
164164
self.show()
165165
self.stop_preview=False
166166
self.connect('response', stop_preview_creation)
@@ -334,11 +334,12 @@ def create_preview(self):
334334
[dataset],
335335
'preview',
336336
dataset.short_info,
337-
[object.short_info for object in dataset.plot_together],
337+
[item.short_info for item in dataset.plot_together],
338338
main_window.errorbars,
339339
output_file=self.preview_temp_file,
340340
fit_lorentz=False)
341-
buf=gtk.gdk.pixbuf_new_from_file(self.preview_temp_file).scale_simple(100, 50, gtk.gdk.INTERP_BILINEAR)
341+
buf=gtk.gdk.pixbuf_new_from_file(self.preview_temp_file).scale_simple(
342+
100, 50, gtk.gdk.INTERP_BILINEAR)
342343
image.set_from_pixbuf(buf)
343344
dataset.preview=buf
344345
while gtk.events_pending():
@@ -519,8 +520,8 @@ def run(self):
519520
# if a mouse callback is registered it doesn't
520521
# work with Dialog.run
521522
self._result=None
522-
def set_result(widget, id):
523-
self._result=id
523+
def set_result(widget, id_):
524+
self._result=id_
524525
self.connect('response', set_result)
525526
self.show_all()
526527
while self._result is None:
@@ -570,7 +571,7 @@ def register_mouse_callback(self, window, entries):
570571
raise IndexError, "position tuple only has 6 items"
571572
self.mouse_position_entries=entries
572573
self.mouse_position_step=0
573-
for key, index in entries[0]:
574+
for key, ignore in entries[0]:
574575
self.entries[key].modify_text(gtk.STATE_NORMAL, gtk.gdk.color_parse('red'))
575576
self.entries[key].modify_text(gtk.STATE_SELECTED, gtk.gdk.color_parse('yellow'))
576577

@@ -1581,7 +1582,7 @@ def _create_entries(self):
15811582
entry.connect('changed', self._entry_set)
15821583
entries.append((name, [entry]))
15831584
elif vtype is list:
1584-
entries.append((name, value))
1585+
entries.append((name, vtype))
15851586
elif vtype is tuple:
15861587
pass
15871588
elif vtype is bool:

gtkgui/file_actions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -320,10 +320,10 @@ def iterate_through_measurements(self, action_name):
320320
elif action_name=='Last':
321321
mp.select_item(-1)
322322
elif action_name=='Next':
323-
mp.select_item(min(len(mp)-1, mp.item_index+1))
323+
mp.select_item(min(len(mp.multiplots)-1, mp.item_index+1))
324324
else:
325325
try:
326-
if len(mp)>int(self.window.plot_page_entry.get_text()) and\
326+
if len(mp.multiplots)>int(self.window.plot_page_entry.get_text()) and\
327327
int(self.window.plot_page_entry.get_text())>=0:
328328
mp.select_item(int(self.window.plot_page_entry.get_text()))
329329
except ValueError:

0 commit comments

Comments
 (0)