Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SOHViewer
Manage
Activity
Members
Labels
Plan
Issues
14
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
5
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
ae7ce4a2
Commit
ae7ce4a2
authored
1 year ago
by
Lan Dam
Browse files
Options
Downloads
Patches
Plain Diff
perform finalize only once after data loaded
parent
93b79182
No related branches found
No related tags found
1 merge request
!142
perform finalize only once after data loaded
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sohstationviewer/model/general_data/general_data.py
+38
-51
38 additions, 51 deletions
sohstationviewer/model/general_data/general_data.py
with
38 additions
and
51 deletions
sohstationviewer/model/general_data/general_data.py
+
38
−
51
View file @
ae7ce4a2
...
@@ -318,20 +318,6 @@ class GeneralData():
...
@@ -318,20 +318,6 @@ class GeneralData():
execute_db
(
f
'
UPDATE PersistentData SET FieldValue=
"
{
self
.
tmp_dir
}
"
'
execute_db
(
f
'
UPDATE PersistentData SET FieldValue=
"
{
self
.
tmp_dir
}
"
'
f
'
WHERE FieldName=
"
tempDataDirectory
"'
)
f
'
WHERE FieldName=
"
tempDataDirectory
"'
)
def
check_not_found_soh_channels
(
self
):
# FROM data_type_model.Data_Type_Model.check_not_found_soh_channels
all_chans_meet_req
=
(
list
(
self
.
soh_data
[
self
.
selected_key
].
keys
())
+
list
(
self
.
mass_pos_data
[
self
.
selected_key
].
keys
())
+
list
(
self
.
log_data
[
self
.
selected_key
].
keys
()))
not_found_chans
=
[
c
for
c
in
self
.
req_soh_chans
if
c
not
in
all_chans_meet_req
]
if
not_found_chans
!=
[]:
msg
=
(
f
"
No data found for the following channels:
"
f
"
{
'
,
'
.
join
(
not_found_chans
)
}
"
)
self
.
processing_log
.
append
((
msg
,
LogType
.
WARNING
))
def
sort_all_data
(
self
):
def
sort_all_data
(
self
):
"""
"""
FROM data_type_model.Data_Type_Model.sort_all_data
FROM data_type_model.Data_Type_Model.sort_all_data
...
@@ -341,51 +327,51 @@ class GeneralData():
...
@@ -341,51 +327,51 @@ class GeneralData():
because it is created from log data which is sorted in
because it is created from log data which is sorted in
prepare_soh_data_from_log_data()
prepare_soh_data_from_log_data()
"""
"""
sort_data
(
self
.
waveform_data
[
self
.
selected_key
])
for
key
in
self
.
keys
:
sort_data
(
self
.
mass_pos_data
[
self
.
selected_key
])
sort_data
(
self
.
waveform_data
[
key
])
try
:
sort_data
(
self
.
mass_pos_data
[
key
])
sort_data
(
self
.
soh_data
[
self
.
selected_key
])
try
:
except
KeyError
:
sort_data
(
self
.
soh_data
[
key
])
# Reftek's SOH trace doesn't have startTmEpoch and
except
KeyError
:
# actually soh_data consists of only one trace
# Reftek's SOH trace doesn't have startTmEpoch and
pass
# actually soh_data consists of only one trace
pass
def
combine_all_data
(
self
):
def
combine_all_data
(
self
):
combine_data
(
self
.
selected_key
,
self
.
waveform_data
,
self
.
gap_minimum
)
for
key
in
self
.
keys
:
combine_data
(
self
.
selected_key
,
self
.
mass_pos_data
,
self
.
gap_minimum
)
combine_data
(
key
,
self
.
waveform_data
,
self
.
gap_minimum
)
try
:
combine_data
(
key
,
self
.
mass_pos_data
,
self
.
gap_minimum
)
combine_data
(
self
.
selected_key
,
self
.
soh_data
,
self
.
gap_minimum
)
try
:
except
KeyError
:
combine_data
(
key
,
self
.
soh_data
,
self
.
gap_minimum
)
# Reftek's SOH trace doesn't have startTmEpoch and
except
KeyError
:
# actually soh_data consists of only one trace
# Reftek's SOH trace doesn't have startTmEpoch and
pass
# actually soh_data consists of only one trace
pass
def
retrieve_gaps_from_data_dicts
(
self
):
def
retrieve_gaps_from_data_dicts
(
self
):
"""
"""
Getting gaps from each data_dicts then squash all related gaps
Getting gaps from each data_dicts then squash all related gaps
"""
"""
self
.
gaps
[
self
.
selected_key
]
=
[]
for
key
in
self
.
keys
:
retrieve_gaps_from_data_dict
(
self
.
gaps
[
key
]
=
[]
self
.
selected_key
,
self
.
soh_data
,
self
.
gaps
)
retrieve_gaps_from_data_dict
(
key
,
self
.
soh_data
,
self
.
gaps
)
retrieve_gaps_from_data_dict
(
retrieve_gaps_from_data_dict
(
key
,
self
.
mass_pos_data
,
self
.
gaps
)
self
.
selected_key
,
self
.
mass_pos_data
,
self
.
gaps
)
retrieve_gaps_from_data_dict
(
key
,
self
.
waveform_data
,
self
.
gaps
)
retrieve_gaps_from_data_dict
(
self
.
selected_key
,
self
.
waveform_data
,
self
.
gaps
)
self
.
gaps
[
self
.
selected_key
]
=
squash_gaps
(
self
.
gaps
[
key
]
=
squash_gaps
(
self
.
gaps
[
key
])
self
.
gaps
[
self
.
selected_key
])
def
retrieve_data_time_from_data_dicts
(
self
):
def
retrieve_data_time_from_data_dicts
(
self
):
"""
"""
Going through each data_dict to update the data_time to be
Going through each data_dict to update the data_time to be
[min of startTimeEpoch, max of endTimeEpoch] for each station.
[min of startTimeEpoch, max of endTimeEpoch] for each station.
"""
"""
retrieve_data_time_from_data_dict
(
for
key
in
self
.
keys
:
self
.
selected_key
,
self
.
soh_data
,
self
.
data_time
)
retrieve_data_time_from_data_dict
(
retrieve_data_time_from_data_dict
(
key
,
self
.
soh_data
,
self
.
data_time
)
self
.
selected_key
,
self
.
mass_pos_data
,
self
.
data_time
)
retrieve_data_time_from_data_dict
(
retrieve_data_time_from_data_dict
(
key
,
self
.
mass_pos_data
,
self
.
data_time
)
self
.
selected_key
,
self
.
waveform_data
,
self
.
data_time
)
retrieve_data_time_from_data_dict
(
key
,
self
.
waveform_data
,
self
.
data_time
)
def
fill_empty_data
(
self
):
def
fill_empty_data
(
self
):
"""
"""
...
@@ -406,12 +392,13 @@ class GeneralData():
...
@@ -406,12 +392,13 @@ class GeneralData():
Applying convert_factor to avoid using flags to prevent double
Applying convert_factor to avoid using flags to prevent double
applying convert factor when plotting
applying convert factor when plotting
"""
"""
apply_convert_factor_to_data_dict
(
for
key
in
self
.
keys
:
self
.
selected_key
,
self
.
soh_data
,
self
.
data_type
)
apply_convert_factor_to_data_dict
(
apply_convert_factor_to_data_dict
(
key
,
self
.
soh_data
,
self
.
data_type
)
self
.
selected_key
,
self
.
mass_pos_data
,
self
.
data_type
)
apply_convert_factor_to_data_dict
(
apply_convert_factor_to_data_dict
(
key
,
self
.
mass_pos_data
,
self
.
data_type
)
self
.
selected_key
,
self
.
waveform_data
,
self
.
data_type
)
apply_convert_factor_to_data_dict
(
key
,
self
.
waveform_data
,
self
.
data_type
)
def
reset_all_selected_data
(
self
):
def
reset_all_selected_data
(
self
):
"""
"""
...
...
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