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
13d34a4c
Commit
13d34a4c
authored
1 year ago
by
Kien Le
Browse files
Options
Downloads
Patches
Plain Diff
Add check for masspos when detecting data type
parent
7bdc11ed
No related branches found
No related tags found
1 merge request
!191
Read log files generated by users
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sohstationviewer/model/reftek_data/reftek_reader/log_file_reader.py
+8
-2
8 additions, 2 deletions
...viewer/model/reftek_data/reftek_reader/log_file_reader.py
with
8 additions
and
2 deletions
sohstationviewer/model/reftek_data/reftek_reader/log_file_reader.py
+
8
−
2
View file @
13d34a4c
...
@@ -37,13 +37,19 @@ def detect_log_file_packet_format(packet: List[str]) -> LogFileFormat:
...
@@ -37,13 +37,19 @@ def detect_log_file_packet_format(packet: List[str]) -> LogFileFormat:
# at the start of a packet, we know the log file is from SOHStationViewer.
# at the start of a packet, we know the log file is from SOHStationViewer.
if
packet_start
.
startswith
(
'
Events:
'
):
if
packet_start
.
startswith
(
'
Events:
'
):
return
'
sohstationviewer
'
return
'
sohstationviewer
'
# Unlike logpeek, we are writing the mass position in its own packet. So,
# a packet that starts with mass position data would be an SOHStationViewer
# packet.
if
packet_start
.
startswith
(
'
LPMP
'
):
return
'
sohstationviewer
'
# Logpeek write its events' info right after an SH packet.
# Logpeek write its events' info right after an SH packet.
packet_end
=
packet
[
-
1
]
packet_end
=
packet
[
-
1
]
packet_end_with_event_info
=
(
packet_end
.
startswith
(
'
DAS
'
)
or
packet_end_with_event_info
=
(
packet_end
.
startswith
(
'
DAS
'
)
or
packet_end
.
startswith
(
'
WARNING
'
))
packet_end
.
startswith
(
'
WARNING
'
))
if
(
packet_start
.
startswith
(
'
State of Health
'
)
and
packet_end_with_mass_pos
=
packet_end
.
startswith
(
'
LPMP
'
)
packet_end_with_event_info
):
packet_end_special
=
packet_end_with_event_info
or
packet_end_with_mass_pos
if
packet_start
.
startswith
(
'
State of Health
'
)
and
packet_end_special
:
return
'
logpeek
'
return
'
logpeek
'
...
...
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