Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
BornAgain
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mlz
BornAgain
Commits
7a486d86
Commit
7a486d86
authored
1 year ago
by
Mikhail Svechnikov
Browse files
Options
Downloads
Patches
Plain Diff
check if 2D
parent
beaae729
No related branches found
No related tags found
1 merge request
!2380
Prevent trials to load clearly 1D data in 2D loader and vice versa (#904)
Pipeline
#130559
passed
1 year ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
GUI/View/Data/DatafilesSelector.cpp
+18
-13
18 additions, 13 deletions
GUI/View/Data/DatafilesSelector.cpp
with
18 additions
and
13 deletions
GUI/View/Data/DatafilesSelector.cpp
+
18
−
13
View file @
7a486d86
...
...
@@ -279,20 +279,25 @@ void DatafilesSelector::importData1D()
const
IO
::
Filetype1D
global_ftype
=
::
filterkey2type
(
filters1D
,
selectedFilter
);
for
(
const
QString
&
fname
:
fnames
)
{
const
ImportSettings1D
*
settings
=
nullptr
;
IO
::
Filetype1D
ftype
=
global_ftype
;
if
(
ftype
==
IO
::
unknown1D
)
ftype
=
IO
::
filename2type1D
(
fname
.
toStdString
());
if
(
ftype
==
IO
::
csv1D
)
{
Legacy1dDialog
dialog
(
this
,
fname
);
const
auto
result
=
dialog
.
exec
();
if
(
result
!=
QDialog
::
Accepted
)
return
;
settings
=
&
Legacy1dDialog
::
Msettings
;
}
try
{
if
(
IO
::
isPure2dFile
(
fname
.
toStdString
()))
throw
std
::
runtime_error
(
"File
\"
"
+
ZipUtil
::
uncompressedExtension
(
fname
.
toStdString
())
+
"
\"
may contain only 2D data"
);
const
ImportSettings1D
*
settings
=
nullptr
;
IO
::
Filetype1D
ftype
=
global_ftype
;
if
(
ftype
==
IO
::
unknown1D
)
ftype
=
IO
::
filename2type1D
(
fname
.
toStdString
());
if
(
ftype
==
IO
::
csv1D
)
{
Legacy1dDialog
dialog
(
this
,
fname
);
const
auto
result
=
dialog
.
exec
();
if
(
result
!=
QDialog
::
Accepted
)
return
;
settings
=
&
Legacy1dDialog
::
Msettings
;
}
Datafield
df
=
IO
::
readData1D
(
fname
.
toStdString
(),
ftype
,
settings
);
if
(
df
.
rank
()
!=
1
)
throw
std
::
runtime_error
(
"File does not contain a 1d data set"
);
...
...
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