Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SGS18-READEX
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Ondrej Vysocky
SGS18-READEX
Commits
dc2f0d47
Commit
dc2f0d47
authored
6 years ago
by
ulc0011
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Sending info between heatmap and main menu
#5
parent
7dac9f12
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/heatmap.py
+9
-2
9 additions, 2 deletions
src/heatmap.py
src/main_menu_analyze.py
+10
-31
10 additions, 31 deletions
src/main_menu_analyze.py
with
19 additions
and
33 deletions
src/heatmap.py
+
9
−
2
View file @
dc2f0d47
...
...
@@ -25,7 +25,8 @@ cm = mpc.ListedColormap(C/255.0)
class
Window
(
QtWidgets
.
QDialog
):
def
__init__
(
self
,
ownData
=
None
,
parent
=
None
):
sendInfo
=
QtCore
.
pyqtSignal
(
object
)
def
__init__
(
self
,
ownData
=
None
,
parent
=
None
):
super
(
Window
,
self
).
__init__
(
parent
)
if
not
ownData
:
self
.
d
=
run_path
(
"
get_data_for_gui.py
"
)
...
...
@@ -186,10 +187,15 @@ class Window(QtWidgets.QDialog):
self
.
layout
.
addLayout
(
self
.
h2
)
self
.
layout
.
addWidget
(
self
.
toolbar
)
self
.
layout
.
addWidget
(
self
.
button3
)
self
.
infoForTree
=
""
self
.
setLayout
(
self
.
layout
)
self
.
draw_heatmap
()
def
getInfo
(
self
):
return
self
.
infoForTree
def
getTeX
(
self
):
dlg
=
QtWidgets
.
QFileDialog
()
save_file_path
=
str
(
dlg
.
getSaveFileName
(
filter
=
'
TeX code (*.tex)
'
)[
0
])
...
...
@@ -261,6 +267,7 @@ class Window(QtWidgets.QDialog):
tex_file
.
write
(
'''
\n
\end{document}
'''
)
tex_file
.
close
()
print
(
'
TeX file created
'
)
self
.
sendInfo
.
emit
({
'
quantity
'
:
str
(
self
.
combo
.
currentText
()),
'
region
'
:
str
(
self
.
combo_reg
.
currentText
())})
...
...
@@ -335,7 +342,7 @@ class Window(QtWidgets.QDialog):
self
.
data
=
np
.
zeros
([
self
.
y
,
self
.
x
])
self
.
ax
.
clear
()
#Error je, protože chybí naměřená položka! Chyba v datech, ne v heatmapě
for
i
in
range
(
0
,
self
.
x
):
self
.
data
[:,
i
]
=
[
h
[
1
]
for
h
in
self
.
heat_data
[
i
]]
...
...
This diff is collapsed.
Click to expand it.
src/main_menu_analyze.py
+
10
−
31
View file @
dc2f0d47
...
...
@@ -18,8 +18,10 @@ from src import pydot_example
from
src
import
all_tables
from
src
import
radarGUI_analyze
from
src
import
mericOpt
from
src
import
texReportDialog
from
runpy
import
run_path
from
PyQt5
import
QtCore
,
QtGui
,
QtWidgets
from
functools
import
partial
class
DataHandler
:
...
...
@@ -58,6 +60,7 @@ class Ui_MainMenu(object):
self
.
config_path
=
config_path
self
.
config
=
run_path
(
config_path
)
self
.
MainMenu
=
None
self
.
dictForTex
=
{
'
plots
'
:
[],
'
heatmaps
'
:
[],
'
tables
'
:
[]}
def
setupUi
(
self
,
MainMenu
):
self
.
MainMenu
=
MainMenu
...
...
@@ -123,6 +126,11 @@ class Ui_MainMenu(object):
def
__heatmap
(
self
):
self
.
heatmap_window
=
heatmap
.
Window
(
ownData
=
self
.
radar_data
.
raw_data
)
self
.
heatmap_window
.
show
()
self
.
heatmap_window
.
sendInfo
.
connect
(
partial
(
self
.
__getTeXInfo
,
'
heatmaps
'
))
def
__getTeXInfo
(
self
,
objType
,
entry
):
self
.
dictForTex
[
objType
].
append
(
entry
)
print
(
self
.
dictForTex
)
def
__tree
(
self
):
self
.
tree_window
=
pydot_example
.
regionTree
(
pathToData
=
self
.
radar_data
.
raw_data
[
'
root_folder_lst
'
][
0
],
ownData
=
self
.
radar_data
.
raw_data
)
...
...
@@ -161,37 +169,8 @@ class Ui_MainMenu(object):
msg
.
exec_
()
def
__generate_latex
(
self
):
path_to_radar
=
Path
(
sys
.
path
[
0
]
+
(
'
/pathToRadar.json
'
))
if
path_to_radar
.
exists
():
with
open
(
path_to_radar
)
as
f
:
try
:
data
=
json
.
load
(
f
)
path_to_radar
=
data
[
'
pathToRadar
'
]
sys
.
path
.
append
(
path_to_radar
)
# sys.argv = ['', '-configFile', '{}/config.py'.format(path_to_radar) ]
sys
.
argv
=
[
''
,
'
-configFile
'
,
'
{}
'
.
format
(
self
.
config_path
)]
dlg
=
QtWidgets
.
QFileDialog
()
save_file_path
=
str
(
dlg
.
getSaveFileName
(
filter
=
'
Text files (*.tex)
'
)[
0
])
radar_return
=
os
.
system
(
path_to_radar
+
"
printFullReport.py -configFile {}
"
.
format
(
self
.
config_path
))
if
radar_return
==
0
:
if
save_file_path
and
not
save_file_path
.
endswith
(
'
.tex
'
):
save_file_path
=
save_file_path
+
'
.tex
'
root_folder_lst
=
[
e
[
0
]
for
e
in
self
.
config
[
'
root_folder
'
]]
for
root_folder_ind
,
root_folder
in
enumerate
(
root_folder_lst
):
# Expanze cesty ke slozce s daty
root_folder
=
os
.
path
.
abspath
(
root_folder
)
shutil
.
move
(
root_folder
+
'
/results.tex
'
,
save_file_path
)
self
.
__print_success_msg
(
'
LaTeX report created.
'
)
else
:
self
.
__print_error_msg
(
'
Radar error.
'
)
except
json
.
decoder
.
JSONDecodeError
:
self
.
__print_error_msg
(
'
pathToRadar.json file is not in valid format
'
)
else
:
self
.
__print_error_msg
(
'
pathToRadar.json not found
'
)
self
.
latex_report_window
=
texReportDialog
.
Window
(
ownData
=
self
.
radar_data
.
raw_data
)
self
.
latex_report_window
.
show
()
def
__save_config
(
self
):
dlg
=
QtWidgets
.
QFileDialog
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment