Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
X
xsocs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
22
Issues
22
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kmap
xsocs
Commits
d43887a8
Commit
d43887a8
authored
Nov 16, 2018
by
Thomas Vincent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docstring update
parent
65eeb17d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
42 deletions
+33
-42
xsocs/gui/view/QspaceView.py
xsocs/gui/view/QspaceView.py
+33
-42
No files found.
xsocs/gui/view/QspaceView.py
View file @
d43887a8
...
...
@@ -64,7 +64,8 @@ except ImportError:
def
_useOpenGL
():
"""Returns True if OpenGL is available and enabled
:rtype: bool"""
:rtype: bool
"""
return
ScalarFieldView
is
not
None
and
config
.
USE_OPENGL
...
...
@@ -125,7 +126,6 @@ class ROIPlotIntensityMap(PlotIntensityMap):
def
__updateClicked
(
self
,
checked
=
False
):
"""Handle button clicked"""
if
self
.
__roiSlices
is
None
:
# No ROI, use sum for the whole QSpace
with
self
.
__qspaceH5
as
qspaceH5
:
...
...
@@ -226,26 +226,21 @@ class CutPlanePlotWindow(PlotWidget):
class
QSpaceView
(
Qt
.
QMainWindow
):
"""
Window displaying the 3D q space isosurfaces.
"""Window displaying the 3D Q space isosurfaces.
:param qspaceItem: QspaceItem project item
:param parent: parent widget
"""
sigFitDone
=
Qt
.
Signal
(
object
,
object
)
"""
Signal emitted when the fit is done.
"""
Signal emitted when the fit is done.
Arguments : this qspace item's h5Path and the resulting FitH5 file name.
"""
plot
=
property
(
lambda
self
:
self
.
__plotWindow
)
def
__init__
(
self
,
qspaceItem
,
parent
=
None
):
"""
:param qspaceItem: QspaceItem project item
:param parent: parent widget
"""
def
__init__
(
self
,
qspaceItem
,
parent
=
None
):
super
(
QSpaceView
,
self
).
__init__
(
parent
)
self
.
setWindowTitle
(
'[XSOCS] {0}:{1}'
.
format
(
qspaceItem
.
filename
,
...
...
@@ -407,12 +402,11 @@ class QSpaceView(Qt.QMainWindow):
return
self
.
__getDefaultIsoLevels
(
data
)[
1
]
def
__setPlotData
(
self
,
x
,
y
,
data
):
"""
Sets the intensity maps data.
"""
Sets the intensity maps data.
:param x:
:param y:
:param data:
:return:
"""
self
.
__plotWindow
.
setPlotData
(
x
,
y
,
data
)
self
.
__plotWindow
.
resetZoom
()
...
...
@@ -420,20 +414,20 @@ class QSpaceView(Qt.QMainWindow):
self
.
__roiPlotWindow
.
resetZoom
()
def
selectPoint
(
self
,
x
,
y
):
"""
Displays the q space closest to sample coordinates x and y.
"""
Displays the q space closest to sample coordinates x and y.
:param x:
:param y:
:return:
"""
self
.
__showIsoView
(
x
,
y
)
def
__pointSelected
(
self
,
point
):
"""
Slot called each time a point is selected on one of the intensity maps.
Displays the corresponding q space cube.
:param point:
:return:
"""
xIdx
=
point
.
xIdx
x
=
point
.
x
...
...
@@ -442,15 +436,15 @@ class QSpaceView(Qt.QMainWindow):
self
.
__showIsoView
(
x
,
y
,
xIdx
)
def
__showIsoView
(
self
,
x
,
y
,
idx
=
None
):
"""
Displays the q space closest to sample coordinates x and y.
"""
Displays the q space closest to sample coordinates x and y.
If idx is provided, x and y are ignored. If idx is not provided, the
closest point to x and y is selected.
:param x: sample x coordinate of the point to select
:param y: sample y coordinate of the point to select
:param idx: index of the point to select in the array of sample
coordinates.
:return:
:param idx:
index of the point to select in the array of sample coordinates.
"""
if
self
.
sender
()
==
self
.
__roiPlotWindow
:
self
.
__plotWindow
.
selectPoint
(
x
,
y
)
...
...
@@ -528,7 +522,6 @@ class QSpaceView(Qt.QMainWindow):
def
__nextFitFile
(
self
):
"""
Temporary method that generated a new file name for the Fit results.
:return:
"""
prefix
=
os
.
path
.
basename
(
self
.
__projectItem
.
path
)
project
=
self
.
__projectItem
.
projectRoot
()
...
...
@@ -540,23 +533,23 @@ class QSpaceView(Qt.QMainWindow):
self
.
__fitWidget
.
setOutputFile
(
output_f
)
def
__slotFitProcessStarted
(
self
):
"""
Slot called when a fit is started. Locks all widgets that reads
the XsocsProject file. This is necessary because that file is
is opened in write mode when the fit is done, to write the fit result.
:return:
"""
Slot called when a fit is started.
Locks all widgets that reads the XsocsProject file.
This is necessary because that file is opened in write mode
when the fit is done, to write the fit result.
"""
for
widget
in
self
.
__lockWidgets
:
widget
.
setEnabled
(
False
)
def
__slotFitProcessDone
(
self
,
event
):
"""
Slot called when the fit is done. Event is the name of the FitH5 file
that has been created.
"""
Slot called when the fit is done.
Event is the name of the FitH5 file
that has been created.
Unlocks the widgets locked in __slotFitProcessStarted.
Emits QSpaceView.sigFitDone.
:param event:
:return:
"""
if
event
is
not
None
:
self
.
__nextFitFile
()
...
...
@@ -617,10 +610,9 @@ class QSpaceView(Qt.QMainWindow):
self
.
__stackView
.
remove
(
legend
,
kind
=
'item'
)
def
__slotRoiToggled
(
self
,
on
):
"""
Slot called when the Roi selection is enabled.
"""
Slot called when the Roi selection is enabled.
:param on:
:return:
"""
if
self
.
__view3d
is
not
None
:
region
=
self
.
__view3d
.
getSelectedRegion
()
...
...
@@ -656,10 +648,9 @@ class QSpaceView(Qt.QMainWindow):
self
.
__updateStackViewROI
()
def
__slotRoiChanged
(
self
,
event
):
"""
Slot called each time the ROI is modified
"""
Slot called each time the ROI is modified
:param event:
:return:
"""
if
self
.
__view3d
is
not
None
:
...
...
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