Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mantid
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mantidproject
mantid
Commits
60e8faf7
Commit
60e8faf7
authored
12 years ago
by
Bilheux, Jean-Christophe
Browse files
Options
Downloads
Patches
Plain Diff
Added automatic population of incident medium list when browsing for config file. This refs #4303
parent
621aad8e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Code/Mantid/scripts/Interface/reduction_gui/widgets/reflectometer/base_ref_reduction.py
+34
-1
34 additions, 1 deletion
...reduction_gui/widgets/reflectometer/base_ref_reduction.py
with
34 additions
and
1 deletion
Code/Mantid/scripts/Interface/reduction_gui/widgets/reflectometer/base_ref_reduction.py
+
34
−
1
View file @
60e8faf7
...
...
@@ -227,7 +227,40 @@ class BaseRefWidget(BaseWidget):
if
(
str
(
file_name
).
strip
()
!=
''
):
if
os
.
path
.
isfile
(
file_name
):
self
.
_summary
.
cfg_scaling_factor_file_name
.
setText
(
file_name
)
# self.display_preview_config_file()
self
.
retrieve_list_of_incident_medium
(
file_name
)
def
variable_value_splitter
(
self
,
variable_value
):
"""
This function split the variable that looks like
"
LambdaRequested:3.75
"
and returns a dictionnary of the variable name and value
"""
_split
=
variable_value
.
split
(
'
=
'
)
variable
=
_split
[
0
]
value
=
_split
[
1
]
return
{
'
variable
'
:
variable
,
'
value
'
:
value
}
def
retrieve_list_of_incident_medium
(
self
,
cfg_file_name
):
"""
This procedure will parse the configuration file and will
populate the Incident Medium dropbox with the list of incident medium
found
"""
f
=
open
(
cfg_file_name
,
'
r
'
)
text
=
f
.
readlines
()
list_incident_medium
=
[]
for
_line
in
text
:
if
_line
[
0
]
==
'
#
'
:
continue
_line_split
=
_line
.
split
(
'
'
)
_incident_medium
=
self
.
variable_value_splitter
(
_line_split
[
0
])
list_incident_medium
.
append
(
_incident_medium
[
'
value
'
])
_unique_list
=
list
(
set
(
list_incident_medium
))
self
.
_summary
.
incident_medium_combobox
.
clear
()
for
i
in
range
(
len
(
_unique_list
)):
self
.
_summary
.
incident_medium_combobox
.
addItem
(
str
(
_unique_list
[
i
]))
def
_run_number_changed
(
self
):
self
.
_edit_event
(
ctrl
=
self
.
_summary
.
data_run_number_edit
)
...
...
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