Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
GEPARD
GEPARD
Commits
69ffaf01
Commit
69ffaf01
authored
Oct 29, 2019
by
Josef Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed Layout of OpticalScan UI
parent
c42c2a00
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
20 deletions
+48
-20
opticalscan.py
opticalscan.py
+29
-12
zlevelsetter.py
zlevelsetter.py
+19
-8
No files found.
opticalscan.py
View file @
69ffaf01
...
...
@@ -232,8 +232,8 @@ class OpticalScan(QtWidgets.QWidget):
super
().
__init__
(
parent
,
QtCore
.
Qt
.
Window
)
self
.
logpath
=
logpath
self
.
view
=
parent
grid
Layout
=
QtWidgets
.
Q
Grid
Layout
()
gridLayout
.
columnStretch
(
2
)
main
Layout
=
QtWidgets
.
Q
VBox
Layout
()
pointgroup
=
QtWidgets
.
QGroupBox
(
"Point coordinates [µm]"
,
self
)
self
.
ramanctrl
=
ramanctrl
self
.
dataset
=
dataset
...
...
@@ -272,6 +272,7 @@ class OpticalScan(QtWidgets.QWidget):
self
.
hdrcheck
.
setChecked
(
False
)
self
.
zLevelSetter
=
ZLevelSetter
()
self
.
zLevelSetter
.
sizeChanged
.
connect
(
self
.
_updateSize
)
self
.
prun
=
QtWidgets
.
QPushButton
(
"Run"
,
self
)
self
.
pexit
=
QtWidgets
.
QPushButton
(
"Cancel"
,
self
)
...
...
@@ -333,16 +334,28 @@ class OpticalScan(QtWidgets.QWidget):
btnLayout
.
addWidget
(
self
.
pexit
)
btnLayout
.
addStretch
()
gridLayout
.
addWidget
(
pointgroup
,
0
,
0
)
gridLayout
.
addWidget
(
self
.
areaOptionsGroup
,
0
,
1
)
gridLayout
.
addWidget
(
bkggroup
,
1
,
1
)
gridLayout
.
addWidget
(
furtherOptionsGroup
,
2
,
1
)
gridLayout
.
addWidget
(
self
.
zLevelSetter
,
1
,
0
,
3
,
1
)
gridLayout
.
addLayout
(
btnLayout
,
4
,
0
,
2
,
1
)
gridLayout
.
addWidget
(
self
.
progresstime
,
5
,
0
,
2
,
1
)
gridLayout
.
addWidget
(
self
.
progressbar
,
6
,
0
,
2
,
1
)
vbox1
=
QtWidgets
.
QVBoxLayout
()
vbox2
=
QtWidgets
.
QVBoxLayout
()
vbox1
.
addWidget
(
pointgroup
)
vbox1
.
addWidget
(
self
.
zLevelSetter
)
vbox1
.
addStretch
()
vbox2
.
addWidget
(
self
.
areaOptionsGroup
)
vbox2
.
addWidget
(
bkggroup
)
vbox2
.
addWidget
(
furtherOptionsGroup
)
vbox2
.
addStretch
()
optionsLayout
=
QtWidgets
.
QHBoxLayout
()
optionsLayout
.
addLayout
(
vbox1
)
optionsLayout
.
addLayout
(
vbox2
)
self
.
setLayout
(
gridLayout
)
mainLayout
.
addLayout
(
optionsLayout
)
mainLayout
.
addWidget
(
self
.
progresstime
)
mainLayout
.
addWidget
(
self
.
progressbar
)
mainLayout
.
addLayout
(
btnLayout
)
self
.
setLayout
(
mainLayout
)
self
.
setVisible
(
False
)
def
enableDisableBackground
(
self
):
...
...
@@ -363,6 +376,10 @@ class OpticalScan(QtWidgets.QWidget):
def
managerWasClosed
(
self
):
self
.
showBgkManagerBtn
.
setText
(
'Show Background Manager Window'
)
@
QtCore
.
pyqtSlot
()
def
_updateSize
(
self
):
self
.
adjustSize
()
@
QtCore
.
pyqtSlot
()
def
stopScan
(
self
):
if
self
.
process
is
not
None
and
self
.
process
.
is_alive
():
...
...
zlevelsetter.py
View file @
69ffaf01
...
...
@@ -4,7 +4,7 @@ Created on Fri Oct 25 09:39:14 2019
@author: brandt
"""
from
PyQt5
import
QtWidgets
,
Qt
Gui
from
PyQt5
import
QtWidgets
,
Qt
Core
import
sys
import
numpy
as
np
from
.errors
import
ValueNotSetError
...
...
@@ -15,6 +15,9 @@ class ZLevelSetter(QtWidgets.QLabel):
Allows refining settings for the focus-z-stacking
:return:
"""
sizeChanged
=
QtCore
.
pyqtSignal
()
def
__init__
(
self
):
super
(
ZLevelSetter
,
self
).
__init__
()
layout
=
QtWidgets
.
QVBoxLayout
()
...
...
@@ -26,8 +29,7 @@ class ZLevelSetter(QtWidgets.QLabel):
layout
.
addLayout
(
self
.
_createLevelSelectionLayout
())
self
.
_addRadioBtnsToGroup
()
self
.
sizePolicy
().
setVerticalPolicy
(
QtWidgets
.
QSizePolicy
.
Expanding
)
# self.sizePolicy().setVerticalStretch(2)
self
.
_updateLevels
()
def
_createRangeGroupBox
(
self
):
"""
...
...
@@ -56,11 +58,11 @@ class ZLevelSetter(QtWidgets.QLabel):
for
box
in
[
self
.
minLevelSpinbox
,
self
.
maxLevelSpinbox
,
self
.
numLevelsSpinbox
]:
box
.
valueChanged
.
connect
(
self
.
_updateLevels
)
rangesLayout
.
addWidget
(
QtWidgets
.
QLabel
(
'
Minimum
(µm): '
))
rangesLayout
.
addWidget
(
QtWidgets
.
QLabel
(
'
z_min
(µm): '
))
rangesLayout
.
addWidget
(
self
.
minLevelSpinbox
)
rangesLayout
.
addWidget
(
QtWidgets
.
QLabel
(
',
Maximum
(µm): '
))
rangesLayout
.
addWidget
(
QtWidgets
.
QLabel
(
',
z_max
(µm): '
))
rangesLayout
.
addWidget
(
self
.
maxLevelSpinbox
)
rangesLayout
.
addWidget
(
QtWidgets
.
QLabel
(
', Num
ber of S
teps: '
))
rangesLayout
.
addWidget
(
QtWidgets
.
QLabel
(
', Num
. s
teps: '
))
rangesLayout
.
addWidget
(
self
.
numLevelsSpinbox
)
return
rangeGroupBox
...
...
@@ -147,6 +149,7 @@ class ZLevelSetter(QtWidgets.QLabel):
self
.
_updateLinPreview
()
self
.
_updateLogPreview
()
self
.
_updateCustomPreview
()
self
.
_updateSize
()
def
_updateLinPreview
(
self
):
"""
...
...
@@ -208,6 +211,16 @@ class ZLevelSetter(QtWidgets.QLabel):
entry
.
setParent
(
None
)
self
.
customPreviewSteps
.
remove
(
entry
)
def
_updateSize
(
self
):
"""
Updates the size so that all entries are well visible
:return:
"""
width
=
400
height
=
100
+
self
.
numLevelsSpinbox
.
value
()
*
30
self
.
setFixedSize
(
width
,
height
)
self
.
sizeChanged
.
emit
()
def
_minLevelBoxChanged
(
self
):
"""
Adjusts maxLevelSpinbox to show always values larger then minLevelSpinbox
...
...
@@ -256,8 +269,6 @@ class ZLevelSetter(QtWidgets.QLabel):
raise
ValueNotSetError
return
sorted
(
levels
)
# def resizeEvent(self, event: QtGui.QResizeEvent) -> None:
# print(event.size())
if
__name__
==
'__main__'
:
try
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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