Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
femto
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
LOFAR2.0
femto
Commits
e652053e
Commit
e652053e
authored
5 years ago
by
Thomas Jürges
Browse files
Options
Downloads
Patches
Plain Diff
Add command line parameter for server name and port
parent
c9234a9c
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
femto.py
+2
-1
2 additions, 1 deletion
femto.py
lib/femto_opc.py
+6
-3
6 additions, 3 deletions
lib/femto_opc.py
with
8 additions
and
4 deletions
femto.py
+
2
−
1
View file @
e652053e
...
@@ -44,6 +44,7 @@ def setup_command_argument_parser():
...
@@ -44,6 +44,7 @@ def setup_command_argument_parser():
:return: ArgumentParser with the station_test_watchdog options
:return: ArgumentParser with the station_test_watchdog options
"""
"""
parser
=
ArgumentParser
(
description
=
"
Femto watchdog listens to file write events
"
)
parser
=
ArgumentParser
(
description
=
"
Femto watchdog listens to file write events
"
)
parser
.
add_argument
(
'
url
'
,
help
=
"
OPC UA server name including port. Example:
\"
localhost:55555
\"
"
,
default
=
"
localhost:55555
"
)
parser
.
add_argument
(
'
path
'
,
help
=
"
file system path to monitor for new file events
"
)
parser
.
add_argument
(
'
path
'
,
help
=
"
file system path to monitor for new file events
"
)
parser
.
add_argument
(
'
expected_filename
'
,
help
=
"
Considers events only on file with a name
"
parser
.
add_argument
(
'
expected_filename
'
,
help
=
"
Considers events only on file with a name
"
"
that matches the specified regular expression
"
)
"
that matches the specified regular expression
"
)
...
@@ -74,7 +75,7 @@ def femto(args):
...
@@ -74,7 +75,7 @@ def femto(args):
settings
=
get_settings_from_command_arguments
(
args
)
settings
=
get_settings_from_command_arguments
(
args
)
apply_global_settings
(
settings
)
apply_global_settings
(
settings
)
server
=
setup_server
()
server
=
setup_server
(
settings
.
url
)
try
:
try
:
# Start the server.
# Start the server.
...
...
This diff is collapsed.
Click to expand it.
lib/femto_opc.py
+
6
−
3
View file @
e652053e
...
@@ -28,11 +28,14 @@ def datapoint_change_callback(idx, current_event: dict):
...
@@ -28,11 +28,14 @@ def datapoint_change_callback(idx, current_event: dict):
return
True
return
True
def
setup_server
():
def
setup_server
(
url
:
str
):
global
monitor_points
,
idx
global
monitor_points
,
idx
# setup our server
# setup our server
server
=
Server
()
server
=
Server
()
server
.
set_endpoint
(
"
opc.tcp://localhost:55555/LOFAR2.0/FEMTO
"
)
server_url
=
"
localhost:55555
"
if
url
is
not
None
:
server_url
=
url
server
.
set_endpoint
(
"
opc.tcp://
"
+
server_url
+
"
/LOFAR2.0/FEMTO
"
)
server
.
set_server_name
(
"
LOFAR2.0 Faulty Element Measurement To Opc UA (FEMTO)
"
)
server
.
set_server_name
(
"
LOFAR2.0 Faulty Element Measurement To Opc UA (FEMTO)
"
)
# setup our own namespace, not really necessary but should as spec
# setup our own namespace, not really necessary but should as spec
uri
=
"
http://lofar.eu
"
uri
=
"
http://lofar.eu
"
...
...
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