Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
T
tango
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira issues
Open 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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LOFAR2.0
tango
Commits
42eb0621
Commit
42eb0621
authored
3 years ago
by
Taya Snijder
Browse files
Options
Downloads
Patches
Plain Diff
file being funky
parent
7176f8bf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!27
Resolve #2021 "04 16 branched from master apsctl device"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
devices/examples/HW_device_template.py
+0
-94
0 additions, 94 deletions
devices/examples/HW_device_template.py
with
0 additions
and
94 deletions
devices/examples/HW_device_template.py
deleted
100644 → 0
+
0
−
94
View file @
7176f8bf
# -*- coding: utf-8 -*-
#
# This file wraps around a tango device class and provides a number of abstractions useful for hardware devices. It works together
#
# Distributed under the terms of the APACHE license.
# See LICENSE.txt for more info.
"""
"""
# PyTango imports
from
tango.server
import
run
from
tango
import
AttrWriteType
# Additional import
<<<<<<<
HEAD
:
devices
/
HW_device_template
.
py
from
src.attribute_wrapper
import
*
from
src.hardware_device
import
*
=======
from
util.attribute_wrapper
import
attribute_wrapper
from
util.hardware_device
import
hardware_device
>>>>>>>
master
:
devices
/
examples
/
HW_device_template
.
py
__all__
=
[
"
HW_dev
"
]
class
HW_dev
(
hardware_device
):
"""
This class is the minimal (read empty) implementation of a class using
'
hardware_device
'
"""
# ----------
# Attributes
# ----------
"""
attribute wrapper objects can be declared here. All attribute wrapper objects will get automatically put in a list (attr_list) for easy access
example = attribute_wrapper(comms_annotation=
"
this is an example
"
, datatype=numpy.double, dims=(8, 2), access=AttrWriteType.READ_WRITE)
...
"""
def
always_executed_hook
(
self
):
"""
Method always executed before any TANGO command is executed.
"""
pass
def
delete_device
(
self
):
"""
Hook to delete resources allocated in init_device.
This method allows for any memory or other resources allocated in the
init_device method to be released. This method is called by the device
destructor and by the device Init command (a Tango built-in).
"""
self
.
debug_stream
(
"
Shutting down...
"
)
self
.
Off
()
self
.
debug_stream
(
"
Shut down. Good bye.
"
)
# --------
# overloaded functions
# --------
def
fault
(
self
):
"""
user code here. is called when the state is set to FAULT
"""
pass
def
off
(
self
):
"""
user code here. is called when the state is set to OFF
"""
pass
def
on
(
self
):
"""
user code here. is called when the state is set to ON
"""
pass
def
standby
(
self
):
"""
user code here. is called when the state is set to STANDBY
"""
pass
def
initialise
(
self
):
"""
user code here. is called when the sate is set to INIT
"""
pass
# ----------
# Run server
# ----------
def
main
(
args
=
None
,
**
kwargs
):
"""
Main function of the hardware device module.
"""
return
run
((
HW_dev
,),
args
=
args
,
**
kwargs
)
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