Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Jan Zelenka
prasopes
Commits
59ba6394
Commit
59ba6394
authored
Jul 16, 2020
by
Yan
Browse files
Implemented PaintFig into reactivitytools
parent
fdc3a84e
Changes
3
Hide whitespace changes
Inline
Side-by-side
prasopes/config.py
View file @
59ba6394
...
...
@@ -19,14 +19,20 @@ def settings():
(
"print/zcespec_xinch"
,
5
),
(
"print/zcespec_yinch"
,
2
),
(
"print/zcespec_dpi"
,
300
),
(
"print/reactspecspec_xinch"
,
3.5
),
(
"print/reactspecspec_yinch"
,
2
),
(
"print/reactspecspec_dpi"
,
300
),
(
"imggen/msspec_xinch"
,
10
),
(
"imggen/msspec_yinch"
,
4
),
(
"imggen/msspec_dpi"
,
300
),
(
"imggen/msspec_xtics"
,
5
),
(
"imggen/msspec_onlymanann"
,
False
),
(
"imggen/zcespec_xinch"
,
5
),
(
"imggen/zcespec_yinch"
,
2
),
(
"imggen/zcespec_dpi"
,
300
),
(
"imggen/msspec_onlymanann"
,
False
),
(
"imggen/reactspecspec_xinch"
,
3.5
),
(
"imggen/reactspecspec_yinch"
,
2
),
(
"imggen/reactspecspec_dpi"
,
300
),
(
"reactivity/index"
,
0
),
(
"recents"
,
""
)}
[
settings
.
setValue
(
*
i
)
...
...
prasopes/reactivitytools.py
View file @
59ba6394
...
...
@@ -13,6 +13,7 @@ import prasopes.graphtools as gt
import
prasopes.filetools
as
ft
import
prasopes.config
as
cf
import
prasopes.drltools
as
drl
import
prasopes.imagetools
as
imgt
import
os.path
import
logging
matplotlib
.
use
(
"Qt5Agg"
)
...
...
@@ -65,7 +66,10 @@ class reactivityParam(QtWidgets.QHBoxLayout):
def
key_pressed
(
event
,
augCanvas
,
drls
,
grph
,
labels
,
parselect
):
if
event
.
key
()
==
QtCore
.
Qt
.
Key_C
:
if
event
.
modifiers
().
__int__
()
==
QtCore
.
Qt
.
ControlModifier
:
clip_spect_img
(
augCanvas
,
drls
,
grph
,
labels
,
parselect
)
imggen
=
imgt
.
ImagePainter
(
"zcespec"
)
imggen
.
popfig
=
lambda
:
paint_override
(
imggen
,
augCanvas
,
drls
,
grph
,
labels
,
parselect
)
imggen
.
clip
()
def
export_dial
(
augCanvas
,
drls
,
grph
,
labels
,
parselect
):
...
...
@@ -102,25 +106,10 @@ def update_parselect(augCanvas, parselect):
parselect
.
setCurrentIndex
(
index
)
def
paint_image
(
augCanvas
,
drls
,
grph
,
labels
,
parselect
):
paintfig
=
Figure
(
figsize
=
(
3.5
,
2
),
dpi
=
300
,
constrained_layout
=
True
)
FigureCanvas
(
paintfig
)
printplot
=
paintfig
.
add_subplot
(
111
)
pop_dial
(
augCanvas
,
drls
,
printplot
,
labels
,
parselect
)
printplot
.
set_xlim
(
grph
.
get_xlim
())
printplot
.
set_ylim
(
grph
.
get_ylim
())
paintfig
.
canvas
.
draw
()
cache_file
=
BytesIO
()
paintfig
.
savefig
(
cache_file
)
cache_file
.
seek
(
0
)
image
=
QtGui
.
QImage
.
fromData
(
cache_file
.
read
())
return
image
def
clip_spect_img
(
augCanvas
,
drls
,
grph
,
labels
,
parselect
):
image
=
paint_image
(
augCanvas
,
drls
,
grph
,
labels
,
parselect
)
QtWidgets
.
QApplication
.
clipboard
().
clear
()
[
QtWidgets
.
QApplication
.
clipboard
().
setImage
(
image
,
i
)
for
i
in
range
(
2
)]
def
paint_override
(
self
,
augCanvas
,
drls
,
grph
,
labels
,
parselect
):
pop_dial
(
augCanvas
,
drls
,
self
.
plot
,
labels
,
parselect
)
self
.
plot
.
set_xlim
(
grph
.
get_xlim
())
self
.
plot
.
set_ylim
(
grph
.
get_ylim
())
def
pop_dial
(
augCanvas
,
drls
,
graph
,
labels
,
parselect
):
...
...
prasopes/zcetools.py
View file @
59ba6394
...
...
@@ -6,11 +6,11 @@ from PyQt5 import QtGui
from
PyQt5
import
QtWidgets
from
PyQt5
import
QtPrintSupport
from
prasopes.zcetools_help
import
helpstr
from
prasopes
import
imagetools
as
imgt
from
io
import
BytesIO
import
numpy
as
np
import
prasopes.graphtools
as
gt
import
prasopes.filetools
as
ft
import
prasopes.imagetools
as
imgt
import
os.path
import
logging
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment