Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SOHViewer
Manage
Activity
Members
Labels
Plan
Issues
11
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
3
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
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
Code review analytics
Issue analytics
Insights
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
Software Public
PASSOFT
SOHViewer
Commits
4b641259
Commit
4b641259
authored
2 years ago
by
Lan Dam
Browse files
Options
Downloads
Patches
Plain Diff
let user select one of the folders data/, sdata/
parent
7379932b
No related branches found
No related tags found
1 merge request
!190
let user select one of the folders data/, sdata/
Pipeline
#3030
passed with stage
in 2 minutes and 15 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sohstationviewer/view/main_window.py
+33
-2
33 additions, 2 deletions
sohstationviewer/view/main_window.py
with
33 additions
and
2 deletions
sohstationviewer/view/main_window.py
+
33
−
2
View file @
4b641259
...
@@ -39,6 +39,9 @@ from sohstationviewer.view.util.functions import (
...
@@ -39,6 +39,9 @@ from sohstationviewer.view.util.functions import (
check_chan_wildcards_format
,
check_masspos
,
check_chan_wildcards_format
,
check_masspos
,
)
)
from
sohstationviewer.view.channel_prefer_dialog
import
ChannelPreferDialog
from
sohstationviewer.view.channel_prefer_dialog
import
ChannelPreferDialog
from
sohstationviewer.view.create_muti_buttons_dialog
import
(
create_multi_buttons_dialog
)
from
sohstationviewer.controller.processing
import
detect_data_type
from
sohstationviewer.controller.processing
import
detect_data_type
from
sohstationviewer.controller.util
import
(
from
sohstationviewer.controller.util
import
(
...
@@ -508,12 +511,40 @@ class MainWindow(QtWidgets.QMainWindow, UIMainWindow):
...
@@ -508,12 +511,40 @@ class MainWindow(QtWidgets.QMainWindow, UIMainWindow):
else
:
else
:
self
.
list_of_dir
=
[
root_dir
.
joinpath
(
'
sdata
'
)]
self
.
list_of_dir
=
[
root_dir
.
joinpath
(
'
sdata
'
)]
else
:
else
:
# When "From Data Card" checkbox is checked, sub directories of
the
# When "From Data Card" checkbox is
n't
checked, sub directories of
# current dir (root_dir) will be displayed in File List box.
#
the
current dir (root_dir) will be displayed in File List box.
# User can select one or more sub-directories to process from.
# User can select one or more sub-directories to process from.
self
.
list_of_dir
=
[
self
.
list_of_dir
=
[
root_dir
.
joinpath
(
item
.
text
())
root_dir
.
joinpath
(
item
.
text
())
for
item
in
self
.
open_files_list
.
selectedItems
()]
for
item
in
self
.
open_files_list
.
selectedItems
()]
has_data_sdata
=
False
for
folder
in
self
.
list_of_dir
:
has_data_sdata
=
check_data_sdata
(
folder
)
if
has_data_sdata
:
break
if
has_data_sdata
:
if
len
(
self
.
list_of_dir
)
>
1
:
msg
=
(
"
More than one folders are selected. At least one
"
"
of them has sub-folders data/ and sdata/.
\n\n
"
"
It confuses SOH View.
\n\n
"
"
SOH View will read only one folder with
"
"
sub-folder data/ and sdata/.
"
)
raise
Exception
(
msg
)
else
:
msg
=
(
"
The selected folder contains 2 data folders:
\n
"
"'
data/
'
,
'
sdata/
'
.
\n\n
"
"
Please select one of them to read data from.
"
)
result
=
create_multi_buttons_dialog
(
msg
,
[
'
data/
'
,
'
sdata/
'
],
abort_is_0
=
True
)
if
result
==
0
:
self
.
list_of_dir
=
[
self
.
list_of_dir
[
0
].
joinpath
(
'
data
'
)]
elif
result
==
1
:
self
.
list_of_dir
=
[
self
.
list_of_dir
[
0
].
joinpath
(
'
sdata
'
)]
else
:
raise
Exception
(
'
Process is cancelled by user.
'
)
if
self
.
list_of_dir
==
[]:
if
self
.
list_of_dir
==
[]:
msg
=
"
No directories have been selected.
"
msg
=
"
No directories have been selected.
"
raise
Exception
(
msg
)
raise
Exception
(
msg
)
...
...
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