Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
km3mon
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
km3py
km3mon
Commits
46deb035
Commit
46deb035
authored
5 years ago
by
Tamas Gal
Browse files
Options
Downloads
Patches
Plain Diff
Remove old script
parent
c4afee8e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/logio.py
+0
-80
0 additions, 80 deletions
scripts/logio.py
with
0 additions
and
80 deletions
scripts/logio.py
deleted
100755 → 0
+
0
−
80
View file @
c4afee8e
#!/usr/bin/env python
# coding=utf-8
# Filename: logio.py
# Author: Tamas Gal <tgal@km3net.de>
# vim: ts=4 sw=4 et
"""
Sends MSG data from Ligier to a log.io server to be displayed in real-time.
Usage:
logio.py [options]
logio.py (-h | --help)
Options:
-l LIGIER_IP The IP of the ligier [default: 127.0.0.1].
-p LIGIER_PORT The port of the ligier [default: 5553].
-x LOGIO_IP The IP of the ligier [default: 127.0.0.1].
-q LOGIO_PORT The port of the ligier [default: 28777].
-h --help Show this screen.
"""
import
socket
import
time
from
km3pipe
import
Pipeline
,
Module
from
km3pipe.io
import
CHPump
class
LogIO
(
Module
):
def
configure
(
self
):
url
=
self
.
get
(
'
logio_ip
'
,
default
=
'
127.0.0.1
'
)
port
=
self
.
get
(
'
logio_port
'
,
default
=
28777
)
self
.
sock
=
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
self
.
sock
.
connect
((
url
,
port
))
def
process
(
self
,
blob
):
data
=
blob
[
'
CHData
'
]
log_level
=
'
info
'
if
"
ERROR
"
in
data
:
log_level
=
'
error
'
if
"
WARNING
"
in
data
:
log_level
=
'
warning
'
source
=
"
Other
"
if
"
F0
"
in
data
:
source
=
"
DataFilter
"
if
"
Q0
"
in
data
:
source
=
"
DataQueue
"
if
"
W0
"
in
data
:
source
=
"
DataWriter
"
self
.
sock
.
send
(
"
+log|{0}|Portopalo DAQ|{1}|{2}
\r\n
"
.
format
(
source
,
log_level
,
data
))
return
blob
def
finish
(
self
):
self
.
sock
.
close
()
def
main
():
from
docopt
import
docopt
args
=
docopt
(
__doc__
)
ligier_ip
=
args
[
'
-l
'
]
ligier_port
=
int
(
args
[
'
-p
'
])
logio_ip
=
args
[
'
-x
'
]
logio_port
=
int
(
args
[
'
-q
'
])
pipe
=
Pipeline
()
pipe
.
attach
(
CHPump
,
host
=
ligier_ip
,
port
=
ligier_port
,
tags
=
'
MSG
'
,
timeout
=
7
*
60
*
60
*
24
,
max_queue
=
500
)
pipe
.
attach
(
LogIO
,
logio_ip
=
logio_ip
,
logio_port
=
logio_port
)
pipe
.
drain
()
if
__name__
==
'
__main__
'
:
main
()
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