Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • cs/ds/alarm-handler
  • francesco.tripaldi/alarm-handler
2 results
Show changes
Commits on Source (159)
Showing with 8258 additions and 2 deletions
......@@ -27,3 +27,13 @@
*.exe
*.out
*.app
bin/
build/
.nse_depinfo
# Eclipse
.cproject
.project
.settings
image:
name: harbor.skao.int/production/ska-tango-images-tango-dsconfig:1.5.5
stages:
- build
- test
build_job:
stage: build
tags:
- docker
before_script:
- sudo apt update && sudo apt -y --no-install-recommends install build-essential cmake pkg-config libboost-thread-dev
script:
- mkdir build && cd build
- cmake -DBUILD_TESTS=ON ..
- make
artifacts:
paths:
- build/alarm-handler-srv
- build/bin/testdevice-srv
expire_in: 1 week
test_load_job:
stage: test
tags:
- docker
before_script:
- sudo apt update && sudo apt -y --no-install-recommends install libboost-thread-dev
script:
- sleep 10
- /usr/local/bin/DataBaseds 2 -ORBendPoint giop:tcp::10000 &
- sleep 10
- exit_code=2
- json2tango -w -a -u ./test/ah_config.json || exit_code=$?
- if [ ${exit_code} -ne 2 ]; then echo "Tango DB configuration failed!" ; else echo "Tango DB configuration succedeed!"; fi
- ./build/alarm-handler-srv 01 &
- ./build/bin/testdevice-srv 01 &
- sleep 5
- python ./test/load-alarm-conf.py --device=alarm/handler/01 --load="tag=test0;formula=(alarm/test/01/condition == 1);on_delay=0;off_delay=0;priority=high;shlvd_time=0;group=gr_test;message=Test alarm;url=;on_command=;off_command=;enabled=1"
- sleep 1
- python ./test/check-alarm-conf.py --device=alarm/handler/01 --alarm="tag=test0;formula=(alarm/test/01/condition == 1);on_delay=0;off_delay=0;priority=high;shlvd_time=0;group=gr_test;message=Test alarm;url=;on_command=;off_command=;enabled=1"
needs: ["build_job"]
services:
- name: harbor.skao.int/production/ska-tango-images-tango-db:10.4.16
alias: tangodb
image:
name: harbor.skao.int/production/ska-tango-images-tango-dsconfig:1.5.5
# The following variables are automatically passed down to the tangodb container
# as well as the tangodatabaseds container and available within each.
variables:
MYSQL_ROOT_PASSWORD: "secret"
MYSQL_DATABASE: "tango"
MYSQL_USER: "tango"
MYSQL_PASSWORD: "tango"
MYSQL_HOST: "tangodb"
TANGO_HOST: "localhost:10000"
stages:
- build
- conf
- test
services:
- name: harbor.skao.int/production/ska-tango-images-tango-db
alias: tangodb
# - name: harbor.skao.int/production/ska-tango-images-tango-cpp
# alias: tangodatabaseds
# entrypoint: ["/usr/local/bin/DataBaseds"]
# command: ["2","-ORBendPoint giop:tcp::10000"]
build_job:
stage: build
before_script:
#TODO: remove procps use for ps
- sudo apt update && sudo apt -y --no-install-recommends install build-essential cmake pkg-config libboost-thread-dev procps
script:
#- make
- mkdir build && cd build
- cmake ..
- make
artifacts:
paths:
- build/alarm-handler-srv
expire_in: 1 week
# # depending on your build setup it's most likely a good idea to cache outputs to reduce the build time
# cache:
# paths:
# - build/CMakeFiles/
configure_and_run_job:
stage: conf
script:
- sleep 10
- /usr/local/bin/DataBaseds 2 -ORBendPoint giop:tcp::10000 &
- sleep 10
- exit_code=2
- json2tango -w -a -u ./test/ah_config.json || exit_code=$?
# json2tango returns 2 if values written to DB
- if [ ${exit_code} -ne 2 ]; then echo "Tango DB configuration failed!" ; else echo "Tango DB configuration succedeed!"; fi
- sleep 5
artifacts:
paths:
- build/alarm-handler-srv
expire_in: 1 week
needs: ["build_job"]
#services:
# - name: harbor.skao.int/production/ska-tango-images-tango-db
# alias: tangodb
test_job:
stage: test
before_script:
#TODO: remove procps use for ps
- sudo apt update && sudo apt -y --no-install-recommends install libboost-thread-dev procps
script:
- /usr/local/bin/DataBaseds 2 -ORBendPoint giop:tcp::10000 &
- sleep 10
- ./build/alarm-handler-srv 01 &
- sleep 10
- ps -ef | grep alarm-handler-srv | grep -v grep
- sleep 5
needs: ["configure_and_run_job"]
# Functions and Pre-build -----------------------------------
# Stop messy in source builds
set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
set(CMAKE_DISABLE_SOURCE_CHANGES OFF)
if ( ${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR} )
message( FATAL_ERROR "In-source builds not allowed. Please make a new directory (called a build directory) and run CMake from there. You may need to remove CMakeCache.txt." )
endif()
# Start Build Config -----------------------------------
cmake_minimum_required(VERSION 3.8)
set(CMAKE_SKIP_RPATH true)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_COLOR_MAKEFILE ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Output name for the final binary
set(AH_NAME "alarm-handler-srv")
# Versioning
set(VERSION_MAJOR "1")
set(VERSION_MINOR "0")
set(VERSION_PATCH "0")
set(VERSION_METADATA "")
set(VERSION_STRING ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH})
# Add any include paths from the command line
list(APPEND INCLUDE_PATHS ${CMAKE_INCLUDE_PATH})
list(APPEND INCLUDE_PATHS ${CMAKE_SOURCE_DIR})
list(APPEND LIBRARY_PATHS ${CMAKE_LIBRARY_PATH})
# Start the project
project(alarm_handler VERSION ${VERSION_STRING} LANGUAGES CXX)
# Build options
option(ENABLE_CLANG "Enable clang code and layout analysis" OFF)
option(BUILD_TESTS "Build tests" OFF)
# arch install definitions
include(GNUInstallDirs)
message(STATUS "Searching for libraries...")
# Variable to contain a list of all the libs we depend on
set(AH_LIBRARIES)
# allow pkg-config to search the CMAKE_PREFIX_PATH
set(PKG_CONFIG_USE_CMAKE_PREFIX_PATH ON)
list(APPEND CMAKE_PREFIX_PATH "/usr")
# Find Dependencies -----------------------------------
# Find tango if it has not already been found. Returns an interface library
# called TangoInterfaceLibrary
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH};${CMAKE_CURRENT_SOURCE_DIR}/cmake")
find_package(Tango)
set(Boost_USE_STATIC_LIBS OFF)
set(Boost_USE_MULTITHREADED ON)
set(Boost_USE_STATIC_RUNTIME OFF)
find_package(Boost 1.65.0 COMPONENTS thread)
# Code Analysis -----------------------------------
if(ENABLE_CLANG)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# To find clang, find_program will search your PATH environment variable.
# Ensure if you have a non-standard clang install, that it has been added
# to your path.
find_program(CLANG_TIDY_EXE
NAMES "clang-tidy"
DOC "Path to clang-tidy executable")
if(NOT CLANG_TIDY_EXE)
message(STATUS "clang-tidy not found.")
else(NOT CLANG_TIDY_EXE)
message(STATUS "clang-tidy found: ${CLANG_TIDY_EXE}")
set(DO_CLANG_TIDY "${CLANG_TIDY_EXE}")
endif(NOT CLANG_TIDY_EXE)
endif(ENABLE_CLANG)
# Source -----------------------------------
add_subdirectory(src)
# Build Targets -----------------------------------
# Executable --------
add_executable(alarm_handler ${SRC_FILES})
target_link_libraries(alarm_handler
PRIVATE
TangoInterfaceLibrary
${Boost_LIBRARIES}
)
target_include_directories(alarm_handler
PRIVATE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src>
${INCLUDE_PATHS}
"${PROJECT_BINARY_DIR}"
${Boost_INCLUDE_DIRS})
if(NOT (CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang"))
set_target_properties(alarm_handler
PROPERTIES
OUTPUT_NAME ${AH_NAME}
LINK_FLAGS "-Wl,--no-undefined"
CXX_STANDARD 17)
else()
set_target_properties(alarm_handler
PROPERTIES
OUTPUT_NAME ${AH_NAME}
LINK_FLAGS ""
CXX_STANDARD 17)
endif()
if(DO_CLANG_TIDY)
set_target_properties(alarm_handler
PROPERTIES
CXX_CLANG_TIDY ${DO_CLANG_TIDY})
endif(DO_CLANG_TIDY)
target_compile_options(alarm_handler
PRIVATE "$<$<CONFIG:DEBUG>:-g>")
# Install Config -----------------------------------
install(
TARGETS alarm_handler
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
message(STATUS "Configured alarm-handler project")
# Tests -----------------------------------
if(BUILD_TESTS)
add_subdirectory(test)
endif(BUILD_TESTS)
NAME_SRV = alarm-handler-srv
CXXFLAGS +=
LDFLAGS += -lboost_thread
include ../makefiles/Make-9.3.3.in
# alarm
Elettra Alarms
# Alarm-handler
Elettra alarm-handler Tango device
## Building and Installation
In its simplest form, clone the repository and assuming a standard install for all dependencies:
```
mkdir build
cd build
cmake ../
make
make install
```
### pkg-config Settings
The build system uses pkg-config to find some dependencies, for example Tango. If Tango is not installed to a standard location, set PKG_CONFIG_PATH, i.e.
```bash
export PKG_CONFIG_PATH=/non/standard/tango/install/location
...
cmake ../
...
```
The pkg-config path can also be set with the cmake argument CMAKE_PREFIX_PATH. This can be set on the command line at configuration time, i.e.:
```bash
...
cmake -DCMAKE_PREFIX_PATH=/non/standard/tango/install/location ../
...
```
### Project Flags
| Flag | Setting | Default | Description |
|------|-----|-----|-----|
| BUILD_TESTS | ON/OFF | OFF | Build test devices under test directory |
### Standard CMake Flags
The build system is CMake therefore standard CMake flags can be used to influence the build and installation process. The following is a list of common useful CMake flags and their use:
| Flag | Use |
|------|-----|
| CMAKE_INSTALL_PREFIX | Standard CMake flag to modify the install prefix. |
| CMAKE_INCLUDE_PATH | Standard CMake flag to add include paths to the search path. |
| CMAKE_LIBRARY_PATH | Standard CMake flag to add paths to the library search path |
## Legacy Building
Using Elettra makefiles, clone both alarm-handler and makefile repositories, then call make:
```bash
git clone http://gitlab.elettra.eu/cd/ds/makefiles.git
git clone http://gitlab.elettra.eu/cs/ds/alarm-handler.git
cd alarm-handler
make
```
include(CMakeParseArguments)
function(find_libraries)
# Parse the parameters
set(MULTIVALUEARGS LIBRARIES SEARCH_PATHS)
cmake_parse_arguments(FIND_LIBRARIES "" "" "${MULTIVALUEARGS}" ${ARGN})
# Clear the found libraries
unset(FOUND_LIBRARIES PARENT_SCOPE)
foreach(LIB ${FIND_LIBRARIES_LIBRARIES})
# try the user provided paths first
find_library(FOUND_LIB_${LIB} ${LIB} PATHS ${FIND_LIBRARIES_SEARCH_PATHS} NO_DEFAULT_PATH)
# if we could not find it, drop to the system paths
if(NOT FOUND_LIB_${LIB})
find_library(FOUND_LIB_${LIB} ${LIB})
endif(NOT FOUND_LIB_${LIB})
if(FOUND_LIB_${LIB})
message(STATUS "Found " ${LIB} " at: " ${FOUND_LIB_${LIB}})
list(APPEND FOUND_LIBRARIES ${FOUND_LIB_${LIB}})
else()
message(FATAL "Could not find " ${LIB})
endif(FOUND_LIB_${LIB})
endforeach(LIB ${LIBRARIES})
set(FOUND_LIBRARIES ${FOUND_LIBRARIES} PARENT_SCOPE)
endfunction(find_libraries)
\ No newline at end of file
if(NOT TARGET TangoInterfaceLibrary)
# Ensure pkg-config is installed
find_package(PkgConfig REQUIRED)
# Now search for the tango.pc file, this is a required dependency
message(STATUS "Search for TANGO package config...")
pkg_search_module(TANGO REQUIRED tango>=9.2.5)
message(STATUS "Found tango version ${TANGO_VERSION} at ${TANGO_PREFIX}")
include(FindLibraries)
find_libraries(LIBRARIES ${TANGO_LIBRARIES} SEARCH_PATHS ${TANGO_LIBRARY_DIRS})
# Create an interface library to represent the tango linkage
add_library(TangoInterfaceLibrary INTERFACE)
set_target_properties(TangoInterfaceLibrary
PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${TANGO_INCLUDE_DIRS}"
INTERFACE_LINK_LIBRARIES "${FOUND_LIBRARIES}"
INTERFACE_COMPILE_OPTIONS "${TANGO_CFLAGS}")
message(STATUS "Configured Tango Interface for TANGO version ${TANGO_VERSION}")
endif(NOT TARGET TangoInterfaceLibrary)
\ No newline at end of file
File added
# Formula syntax
The formula is an expression with operators, operands and functions. Operands can be variables, constant values, or other expression optionally enclosed by parentheses.
## Operands
### Variables
- Attributes names with or without fqdn (e.g. ```tango://host:port/name/of/dev/attr```, ```name/of/dev/attr```)
- attribute properties ```.quality```, ```.alarm```, ```.normal``` so that
- ```name/of/dev/attr.quality``` returns the Tango quality (the integer value) of the attribute
- ```name/of/dev/attr.alarm``` returns true if the attribute ==UNACK or ==ACK
- ```name/of/dev/attr.normal``` returns true if the attribute ==NORM or ==RTNUN
### Constants
- Real numbers (e.g. ```name/of/dev/attr >= 35```, ```name/of/dev/attr < -23.5```)
- Hexadecimal numbers (e.g. ```name/of/dev/attr != 0xaf```, ```name/of/dev/attr & 0x1A```)
- Strings as any character between an opening and a closing ' (e.g. ```name/of/dev/status == 'The device is in ON state.'```)
- Tango states enum labels (*ON, OFF, CLOSE, OPEN, INSERT, EXTRACT, MOVING, STANDBY, FAULT, INIT, RUNNING, ALARM, DISABLE, UNKNOWN*) (e.g. ```name/of/dev/state == FAULT```)
- Tango quality enum labels (*ATTR_VALID, ATTR_INVALID, ATTR_WARNING, ATTR_ALARM, ATTR_CHANGING*) (e.g. ```name/of/dev/attr.quality == ATTR_ALARM```)
- Alarm state enum labels (*NORM, UNACK, ACKED, RTNUN, SHLVD, DSUPR, OOSRV*) (e.g. ```name/of/dev/alarm_attr != NORM```)
### Expressions
- A combination of operands and operators enclosed by parentheses
## Operators
### Binary Math
- Multiplication ```*```
- Division ```/```
- Addition ```+```
- Subtraction ```-```
### Binary Comparison
- Equal ```==```
- Not equal ```!=```
- Greater than ```>```
- Greater than or equal to ```>=```
- Less than ```<```
- Less than or equal to ```<=```
### Binary Logical
- Logical AND ```&&```
- Logical OR ```||```
### Binary Bitwise
- Left shift ```<<```
- Right shift ```>>```
- Bitwise AND ```&```
- Bitwise OR ```|```
- Bitwise XOR ```^```
### Unary Math
- Minus ```-```
### Unary Logical
- Logical NOT ```!```
### Binary operators order of precedence
```
*, /, +, -, <<, >>, <=, >=, >, <, ==, !=, &, |, ^, &&, ||
```
## Functions
### Unary Functions
- Absolute value of X ```abs(X)```
- Sine of X ```sin(X)```
- Cosine of X ```cos(X)```
### Binary Functions
- Minimum between two values X and Y ```min(X,Y)```
- Maximum between two values X and Y ```max(X,Y)```
- Power: X raised to the power of Y ```pow(X,Y)```
### Ternary Functions
- Conditional operator: if X then Y else Z ```X ? Y : Z```
### Reduce Functions
- Reduce OR: reduce array X applying logical OR to each element ```OR(X)```
- Reduce AND: reduce array X applying logical AND to each element ```OR(X)```
# Attributes types
The following types of attribute are supported:
```
Scalar, Spectrum, Image
```
with data types:
```
DevBoolean, DevUChar, DevShort, DevUShort, DevLong, DevULong, DevLong64, DevULong64, DevFloat, DevDouble, DevString, DevState, DevEnum
```
```DevEncoded``` is not supported.
The read part of every attribute is internally extracted in a vector of double with the ```extract_read``` method of the ```DeviceAttribute``` class. In this ways operations between attribute with different data types and sizes can be performed with the following constraints:
- DevString attributes can only be compared with 'equal' or 'not equal' operators to DevString attributes or string constants
- Binary operators can operate on arrays if both operands have the same size, or one of the two has size equal to one.
# Operation on arrays
## Indexes to access elements
- A single element of a one-dimensional array attribute (Spectrum) can be extracted with a single index between square brackets (e.g. ```name/of/dev/attr[ind]```).
- A single element of a two-dimensional array attribute (Image) can be extracted with two indexes between square brackets (e.g. ```name/of/dev/attr[ind_row][ind_column]```).
- A one-dimensional array can be extracted from a two-dimensional array attribute (Image) with a single index between square brackets (e.g. ```name/of/dev/attr[ind_row]```).
## Lists and ranges of indexes to slice arrays
Indexes can be specified as a comma separated list and/or hyphen-separated range (e.g. ```[i0,i1-i2,...]```).
In this way:
- A slice can be extracted from a one-dimensional array with a list and/or range of indexes between square brackets (e.g. ```name/of/dev/1Dattr[i0,i1-i2,...]```).
- A subset of rows can be extracted from a two-dimensional array with a list and/or range of indexes for the first dimension (e.g. ```name/of/dev/2Dattr[i0,i1-i2,...]```).
- A single column slice can be extracted from a two-dimensional array with a list and/or range of indexes for the first dimension and a single index for the second dimension (e.g. ```name/of/dev/2Dattr[i0,i1-i2,...][i3]```).
- A single row slice can be extracted from a two-dimensional array with a single index for the first dimension and list/range of indexes for the second dimension (e.g. ```name/of/dev/2Dattr[i0][i1-i2,i3,...]```).
- An array slice can be extracted from a two-dimensional array with a list and/or range of indexes for both the first and second dimensions (e.g. ```name/of/dev/2Dattr[i0-i1,...][i2,i3,...]```).
- To specify all elements of one dimension index -1 can be used (e.g. Column 3 of all rows of 2D array ```name/of/dev/2Dattr[-1][3]```).
If any index exceeds actual dimensions of the array, the formula is evaluated to ERROR with an out of bounds exception.
No check is done on the order and uniqueness of indexes, so it is allowed to concatenate duplicated and out of order elements/rows/columns (e.g. ```name/of/dev/2Dattr[0-2,1,0,..]``` evaluates to an array with rows 0,1,2,1,0 of 2Dattr)
## Limitations
- It is not possible to specify array constants (e.g. ```name/of/dev/attr > [val1,val2]```).
- It is not possible to use indexes on expressions (e.g. ```(any_expression)[ind]```).
## Unary operators and functions
Unary operators and functions are applied to every element of the array
## Binary operators and functions
- If both operands have the same size, operators are applied element by element. Result is an array with the same size.
- If one operand has size one, operators apply it to every element of the other operand. Result is an array with the same size.
- Otherwise an exception is raised and the formula is evaluated to the *ERROR* state with the Reason, Descrption and Origin DevFailed fields properly filled.
## Ternary Function
- Conditional operator: if X then Y else Z. X is implicitly reduced with *OR* to have a boolean value, then Y or Z are evaluated depending on the result
# Formula result
Every formula produce a boolean result in the following way:
1. each element of the array is tested as not equal to zero in order to have an array of booleans
2. the array of boolean is reduced with OR (i.e. if at least one element of the array is TRUE, the result is TRUE)
# Errors
If a formula cannot be evaluated, the corresponding alarm is set to the *ERROR* value with the Reason, Description and Origin DevFailed fields properly filled.
Possible errors are:
- Errors coming from the event system for one or more attributes involved in the formula
- Errors coming from evaluation of array with different sizes
- Errors coming from indexes out of bound while extracting elements from arrays
- Unexpected errors while evaluating formulas
File added
File added
File added
File added
File added
File added
source diff could not be displayed: it is too large. Options to address this: view the blob.
/*----- PROTECTED REGION ID(AlarmHandler.h) ENABLED START -----*/
//=============================================================================
//
// file : AlarmHandler.h
//
// description : Include file for the AlarmHandler class
//
// project : Elettra alarm handler device server
//
// This file is part of Tango device class.
//
// Tango is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Tango is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Tango. If not, see <http://www.gnu.org/licenses/>.
//
//
//
//=============================================================================
// This file is generated by POGO
// (Program Obviously used to Generate tango Object)
//=============================================================================
#ifndef AlarmHandler_H
#define AlarmHandler_H
#include <tango/tango.h>
#include <boost/version.hpp>
#if BOOST_VERSION >= 103600
#define BOOST_VER_1_36_0 1
#endif
#include "alarm_table.h"
#include "event_table.h"
#include "SubscribeThread.h"
#define MAX_ALARMS 2000
#define MAX_ATTR_NAME 1000
#define MAX_ATTR_SUMMARY 10000
//#define _USE_ELETTRA_DB_RW
//using namespace Tango;
class alarm_thread;
class log_thread;
class update_thread;
# define DECLARE_TIME_VAR struct timeval
# define GET_TIME(t) gettimeofday(&t, NULL);
# define ELAPSED(before, after) \
1000.0*(after.tv_sec-before.tv_sec) + \
((double)after.tv_usec-before.tv_usec) / 1000
#ifndef TANGO_LOG
#define TANGO_LOG cout
#endif
#ifndef TANGO_LOG_INFO
#define TANGO_LOG_INFO cout2
#endif
#ifndef TANGO_LOG_DEBUG
#define TANGO_LOG_DEBUG cout4
#endif
/*----- PROTECTED REGION END -----*/ // AlarmHandler.h
/**
* AlarmHandler class description:
* Elettra alarm handler device server
*/
namespace AlarmHandler_ns
{
enum _AlarmStateEnum {
_NORM,
_UNACK,
_ACKED,
_RTNUN,
_SHLVD,
_DSUPR,
_OOSRV,
_ERROR,
} ;
typedef _AlarmStateEnum AlarmStateEnum;
/*----- PROTECTED REGION ID(AlarmHandler::Additional Class Declarations) ENABLED START -----*/
// Additional Class Declarations
/*----- PROTECTED REGION END -----*/ // AlarmHandler::Additional Class Declarations
class AlarmHandler : public TANGO_BASE_CLASS
{
/*----- PROTECTED REGION ID(AlarmHandler::Data Members) ENABLED START -----*/
// Add your own data members
public:
bool compare_without_domain(string str1, string str2);
string remove_domain(string str);
Tango::DevLong attr_AttributeNumber_read;
string normalAlarms_read[MAX_ALARMS];
string unacknowledgedAlarms_read[MAX_ALARMS];
string acknowledgedAlarms_read[MAX_ALARMS];
string unacknowledgedNormalAlarms_read[MAX_ALARMS];
string shelvedAlarms_read[MAX_ALARMS];
string outOfServiceAlarms_read[MAX_ALARMS];
string silencedAlarms_read[MAX_ALARMS];
string listAlarms_read[MAX_ALARMS];
string alarmSummary_read[MAX_ALARMS];
string eventList_read[MAX_ATTR_SUMMARY];
string eventSummary_read[MAX_ATTR_SUMMARY];
string alarmDisabled_read[MAX_ALARMS];
/* char c_normalAlarms_read[MAX_ALARMS][MAX_ATTR_NAME];
char c_unacknowledgedAlarms_read[MAX_ALARMS][MAX_ATTR_NAME];
char c_acknowledgedAlarms_read[MAX_ALARMS][MAX_ATTR_NAME];
char c_unacknowledgedNormalAlarms_read[MAX_ALARMS][MAX_ATTR_NAME];
char c_shelvedAlarms_read[MAX_ALARMS][MAX_ATTR_NAME];
char c_outOfServiceAlarms_read[MAX_ALARMS][MAX_ATTR_NAME];
char c_silencedAlarms_read[MAX_ALARMS][MAX_ATTR_NAME];
char c_listAlarms_read[MAX_ALARMS][MAX_ATTR_NAME];
#define MAX_SUMMARY 2*MAX_ATTR_NAME //TODO: max summary length!!!
char c_alarmSummary_read[MAX_ALARMS][MAX_SUMMARY];*/
size_t normalAlarms_sz;
size_t unacknowledgedAlarms_sz;
size_t acknowledgedAlarms_sz;
size_t unacknowledgedNormalAlarms_sz;
size_t shelvedAlarms_sz;
size_t outOfServiceAlarms_sz;
size_t silencedAlarms_sz;
size_t listAlarms_sz;
size_t alarmSummary_sz;
size_t eventList_sz;
size_t eventSummary_sz;
size_t alarmDisabled_sz;
double last_statistics_reset_time;
omni_mutex *prepare_alm_mtx;
/*----- PROTECTED REGION END -----*/ // AlarmHandler::Data Members
// Device property data members
public:
// GroupNames: Labels for Group mask, first is for mask 0x00
vector<string> groupNames;
// SubscribeRetryPeriod: Retry subscription period in seconds
Tango::DevLong subscribeRetryPeriod;
// StatisticsTimeWindow: Time window to compute statistics in seconds
vector<Tango::DevLong> statisticsTimeWindow;
// ErrorDelay: Delay in seconds before changing to ERROR state after an exception is received.
Tango::DevULong errorDelay;
// SetAlarmQuality: Set alarm attribute quality as computed using quality of attributes in the formula
Tango::DevBoolean setAlarmQuality;
// Attribute data members
public:
Tango::DevBoolean *attr_alarmAudible_read;
Tango::DevDouble *attr_StatisticsResetTime_read;
Tango::DevString *attr_alarm_read;
Tango::DevString *attr_alarmNormal_read;
Tango::DevString *attr_alarmUnacknowledged_read;
Tango::DevString *attr_alarmAcknowledged_read;
Tango::DevString *attr_alarmUnacknowledgedNormal_read;
Tango::DevString *attr_alarmShelved_read;
Tango::DevString *attr_alarmOutOfService_read;
Tango::DevString *attr_alarmSilenced_read;
Tango::DevString *attr_alarmList_read;
Tango::DevDouble *attr_alarmFrequency_read;
Tango::DevString *attr_alarmSummary_read;
Tango::DevString *attr_eventList_read;
Tango::DevString *attr_eventSummary_read;
Tango::DevString *attr_alarmDisabled_read;
// Constructors and destructors
public:
/**
* Constructs a newly device object.
*
* @param cl Class.
* @param s Device Name
*/
AlarmHandler(Tango::DeviceClass *cl,string &s);
/**
* Constructs a newly device object.
*
* @param cl Class.
* @param s Device Name
*/
AlarmHandler(Tango::DeviceClass *cl,const char *s);
/**
* Constructs a newly device object.
*
* @param cl Class.
* @param s Device name
* @param d Device description.
*/
AlarmHandler(Tango::DeviceClass *cl,const char *s,const char *d);
/**
* The device object destructor.
*/
~AlarmHandler() {delete_device();};
// Miscellaneous methods
public:
/*
* will be called at device destruction or at init command.
*/
void delete_device();
/*
* Initialize the device
*/
virtual void init_device();
/*
* Read the device properties from database
*/
void get_device_property();
/*
* Always executed method before execution command method.
*/
virtual void always_executed_hook();
// Attribute methods
public:
//--------------------------------------------------------
/*
* Method : AlarmHandler::read_attr_hardware()
* Description : Hardware acquisition for attributes.
*/
//--------------------------------------------------------
virtual void read_attr_hardware(vector<long> &attr_list);
/**
* Attribute alarmAudible related methods
* Description: True if there is at least one alarm that needs audible indication on the GUI
*
* Data type: Tango::DevBoolean
* Attr type: Scalar
*/
virtual void read_alarmAudible(Tango::Attribute &attr);
virtual bool is_alarmAudible_allowed(Tango::AttReqType type);
/**
* Attribute StatisticsResetTime related methods
* Description: Time elapsed in seconds since last Resetstatistics
*
* Data type: Tango::DevDouble
* Attr type: Scalar
*/
virtual void read_StatisticsResetTime(Tango::Attribute &attr);
virtual bool is_StatisticsResetTime_allowed(Tango::AttReqType type);
/**
* Attribute alarm related methods
* Description:
*
* Data type: Tango::DevString
* Attr type: Spectrum max = 1024
*/
virtual void read_alarm(Tango::Attribute &attr);
virtual bool is_alarm_allowed(Tango::AttReqType type);
/**
* Attribute alarmNormal related methods
* Description: List of alarms in normal state
*
* Data type: Tango::DevString
* Attr type: Spectrum max = 10000
*/
virtual void read_alarmNormal(Tango::Attribute &attr);
virtual bool is_alarmNormal_allowed(Tango::AttReqType type);
/**
* Attribute alarmUnacknowledged related methods
* Description: List of alarms in unacknowledged state
*
* Data type: Tango::DevString
* Attr type: Spectrum max = 10000
*/
virtual void read_alarmUnacknowledged(Tango::Attribute &attr);
virtual bool is_alarmUnacknowledged_allowed(Tango::AttReqType type);
/**
* Attribute alarmAcknowledged related methods
* Description: List of alarms in acknowledged state
*
* Data type: Tango::DevString
* Attr type: Spectrum max = 10000
*/
virtual void read_alarmAcknowledged(Tango::Attribute &attr);
virtual bool is_alarmAcknowledged_allowed(Tango::AttReqType type);
/**
* Attribute alarmUnacknowledgedNormal related methods
* Description: List of alarms in unacknowledged normal state
*
* Data type: Tango::DevString
* Attr type: Spectrum max = 10000
*/
virtual void read_alarmUnacknowledgedNormal(Tango::Attribute &attr);
virtual bool is_alarmUnacknowledgedNormal_allowed(Tango::AttReqType type);
/**
* Attribute alarmShelved related methods
* Description: List of alarms in shelved state
*
* Data type: Tango::DevString
* Attr type: Spectrum max = 10000
*/
virtual void read_alarmShelved(Tango::Attribute &attr);
virtual bool is_alarmShelved_allowed(Tango::AttReqType type);
/**
* Attribute alarmOutOfService related methods
* Description: List of alarms in out of service state
*
* Data type: Tango::DevString
* Attr type: Spectrum max = 10000
*/
virtual void read_alarmOutOfService(Tango::Attribute &attr);
virtual bool is_alarmOutOfService_allowed(Tango::AttReqType type);
/**
* Attribute alarmSilenced related methods
* Description: List of alarms in silenced state
*
* Data type: Tango::DevString
* Attr type: Spectrum max = 10000
*/
virtual void read_alarmSilenced(Tango::Attribute &attr);
virtual bool is_alarmSilenced_allowed(Tango::AttReqType type);
/**
* Attribute alarmList related methods
* Description: List of all alarms
*
* Data type: Tango::DevString
* Attr type: Spectrum max = 10000
*/
virtual void read_alarmList(Tango::Attribute &attr);
virtual bool is_alarmList_allowed(Tango::AttReqType type);
/**
* Attribute alarmFrequency related methods
* Description: List of frequency of evaluation of all alarms
*
* Data type: Tango::DevDouble
* Attr type: Spectrum max = 10000
*/
virtual void read_alarmFrequency(Tango::Attribute &attr);
virtual bool is_alarmFrequency_allowed(Tango::AttReqType type);
/**
* Attribute alarmSummary related methods
* Description:
*
* Data type: Tango::DevString
* Attr type: Spectrum max = 10000
*/
virtual void read_alarmSummary(Tango::Attribute &attr);
virtual bool is_alarmSummary_allowed(Tango::AttReqType type);
/**
* Attribute eventList related methods
* Description: List of all subscribed attributes
*
* Data type: Tango::DevString
* Attr type: Spectrum max = 10000
*/
virtual void read_eventList(Tango::Attribute &attr);
virtual bool is_eventList_allowed(Tango::AttReqType type);
/**
* Attribute eventSummary related methods
* Description:
*
* Data type: Tango::DevString
* Attr type: Spectrum max = 10000
*/
virtual void read_eventSummary(Tango::Attribute &attr);
virtual bool is_eventSummary_allowed(Tango::AttReqType type);
/**
* Attribute alarmDisabled related methods
* Description: List of alarms in out of service or shelved state
*
* Data type: Tango::DevString
* Attr type: Spectrum max = 10000
*/
virtual void read_alarmDisabled(Tango::Attribute &attr);
virtual bool is_alarmDisabled_allowed(Tango::AttReqType type);
// Dynamic attribute methods
public:
/**
* Attribute AlarmState related methods
* Description:
*
* Data type: Tango::DevEnum
* Attr type: Scalar
*/
virtual void read_AlarmState(Tango::Attribute &attr);
virtual bool is_AlarmState_allowed(Tango::AttReqType type);
void add_AlarmState_dynamic_attribute(string attname);
void remove_AlarmState_dynamic_attribute(string attname);
Tango::DevEnum *get_AlarmState_data_ptr(string &name);
map<string,Tango::DevEnum> AlarmState_data;
/**
* Attribute AlarmFormula related methods
* Description:
*
* Data type: Tango::DevString
* Attr type: Scalar
*/
virtual void read_AlarmFormula(Tango::Attribute &attr);
virtual bool is_AlarmFormula_allowed(Tango::AttReqType type);
void add_AlarmFormula_dynamic_attribute(string attname);
void remove_AlarmFormula_dynamic_attribute(string attname);
Tango::DevString *get_AlarmFormula_data_ptr(string &name);
map<string,Tango::DevString> AlarmFormula_data;
//--------------------------------------------------------
/**
* Method : AlarmHandler::add_dynamic_attributes()
* Description : Add dynamic attributes if any.
*/
//--------------------------------------------------------
void add_dynamic_attributes();
// Command related methods
public:
/**
* Command Ack related method
* Description: Alarm acknowledge
*
* @param argin String array containing the alarms to be acknowledged
*/
virtual void ack(const Tango::DevVarStringArray *argin);
virtual bool is_Ack_allowed(const CORBA::Any &any);
/**
* Command Load related method
* Description: Load a new alarm.
*
* @param argin Alarm entry
*/
virtual void load(Tango::DevString argin);
virtual bool is_Load_allowed(const CORBA::Any &any);
/**
* Command Remove related method
* Description: Remove alarm.
*
* @param argin Alarm name
*/
virtual void remove(Tango::DevString argin);
virtual bool is_Remove_allowed(const CORBA::Any &any);
/**
* Command SearchAlarm related method
* Description: Return list of configured alarms matching the filter string
*
* @param argin String containing a filter for output, if empty or * return all alarms
* @returns Configured alarms
*/
virtual Tango::DevVarStringArray *search_alarm(Tango::DevString argin);
virtual bool is_SearchAlarm_allowed(const CORBA::Any &any);
/**
* Command StopAudible related method
* Description: Stop audible indications on the GUI
*
*/
virtual void stop_audible();
virtual bool is_StopAudible_allowed(const CORBA::Any &any);
/**
* Command Silence related method
* Description: Alarm temporarily silence
*
* @param argin String array containing the alarms to be silenced
*/
virtual void silence(const Tango::DevVarStringArray *argin);
virtual bool is_Silence_allowed(const CORBA::Any &any);
/**
* Command Modify related method
* Description: Modify an existing alarm.
*
* @param argin Alarm entry
*/
virtual void modify(Tango::DevString argin);
virtual bool is_Modify_allowed(const CORBA::Any &any);
/**
* Command Shelve related method
* Description: Shelve an alarm: no state transition recorded, no audible nor visual indication
*
* @param argin String array containing alarm to be shelved
*/
virtual void shelve(const Tango::DevVarStringArray *argin);
virtual bool is_Shelve_allowed(const CORBA::Any &any);
/**
* Command Enable related method
* Description: Enable an alarm from Out of service state
*
* @param argin Alarm name
*/
virtual void enable(Tango::DevString argin);
virtual bool is_Enable_allowed(const CORBA::Any &any);
/**
* Command Disable related method
* Description: Put an alarm in Out of service state
*
* @param argin Alarm name
*/
virtual void disable(Tango::DevString argin);
virtual bool is_Disable_allowed(const CORBA::Any &any);
/**
* Command ResetStatistics related method
* Description: Reset statistics
*
*/
virtual void reset_statistics();
virtual bool is_ResetStatistics_allowed(const CORBA::Any &any);
/**
* Command StopNew related method
* Description: Stop audible indications on the GUI
*
*/
virtual void stop_new();
virtual bool is_StopNew_allowed(const CORBA::Any &any);
/**
* Command GetAlarmInfo related method
* Description: Returns the complete attribute info as an array of key=value
*
* @param argin Alarm name followed optionally by wanted key names
* @returns Complete attribute info as an array of key=value
*/
virtual Tango::DevVarStringArray *get_alarm_info(const Tango::DevVarStringArray *argin);
virtual bool is_GetAlarmInfo_allowed(const CORBA::Any &any);
/**
* Command ReLoadAll related method
* Description: Re Load all alarms.
*
*/
virtual void re_load_all();
virtual bool is_ReLoadAll_allowed(const CORBA::Any &any);
//--------------------------------------------------------
/**
* Method : AlarmHandler::add_dynamic_commands()
* Description : Add dynamic commands if any.
*/
//--------------------------------------------------------
void add_dynamic_commands();
/*----- PROTECTED REGION ID(AlarmHandler::Additional Method prototypes) ENABLED START -----*/
// Additional Method prototypes
friend class alarm_thread;
friend class SubscribeThread;
friend class event_table;
alarm_table alarms;
protected :
private:
vector<alarm_t> stored; /* property stored alarms (on exit) */
event_table* events;
// event_list evlist; /* producer/consumer events list */ //gcc 4 problem??
// EventCallBack ecb; /* callback handles */
alarm_thread *almloop;
update_thread *updateloop;
vector<alarm_t> alarmed;
ReadersWritersLock *alarmedlock;
vector<alarm_t> internal;
ReadersWritersLock *internallock;
ReadersWritersLock *dslock;
int period; //subscribe thread period
map<string, string> saved_alarms;
ReadersWritersLock *savedlock;
static int instanceCounter;
int internal_counter;
int ds_num;
Tango::DevString ds[MAX_ALARMS];
char dss[MAX_ALARMS][10124];
void init_events(vector<string> &evn);
#if 0
void init_alarms(map< string,vector<string> > &alarm_events);
#endif
void add_alarm(alarm_t& a, bool starting=false);
void add_event(alarm_t& a, vector<string> &evn);
#if 0
void subscribe_event(alarm_t& a, EventCallBack& ecb, vector<string> &evn);
#endif
// void do_alarm(bei_t& e); //gcc 4 problem??
bool remove_alarm(string& s);
//void add_to_database(alarm_t& a);
void set_internal_alarm(string name, Tango::TimeVal t, string msg, unsigned int count=1);
void load_alarm(string alarm_string, alarm_t &alm, vector<string> &evn);
formula_res_t eval_formula(tree_parse_info_t tree, string &attr_values);
void find_event_formula(tree_parse_info_t tree, vector<string> &);
formula_res_t eval_expression(iter_t const& i, string &attr_values, vector< vector<double> > ev_ind={}); //recursive tree node evaluation
void eval_index_range(iter_t const& i, string &attr_values, vector<double> & ind);
void eval_node_event(iter_t const& i, vector<string> & ev); //recursive tree node evaluation
void prepare_alarm_attr(); //for read attribute alarm and push_change_event
void prepare_event_list();
void prepare_event_summary();
void remove_AlarmState_dynamic_attribute_no_clean_db(string attname);
void parse_alarm(string &alarm_string, alarm_t &alm);
SubscribeThread *thread;
public:
void put_signal_property();
bool check_signal_property();
void do_alarm(bei_t& e); //public instead of protected for gcc 4 problem??
bool do_alarm_eval(string alm_name, string ev_name, Tango::TimeVal ts);
void timer_update(); //public instead of protected for gcc 4 problem??
event_list evlist; /* producer/consumer events list */ //public instead of protected for gcc 4 problem??
bool abortflag;
#ifdef _USE_ELETTRA_DB_RW
private:
string host_rw;
long port_rw;
#endif
/*----- PROTECTED REGION END -----*/ // AlarmHandler::Additional Method prototypes
};
/*----- PROTECTED REGION ID(AlarmHandler::Additional Classes Definitions) ENABLED START -----*/
// Additional Classes Definitions
/*----- PROTECTED REGION END -----*/ // AlarmHandler::Additional Classes Definitions
} // End of namespace
#endif // AlarmHandler_H
<?xml version="1.0" encoding="ASCII"?>
<pogoDsl:PogoSystem xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pogoDsl="http://www.esrf.fr/tango/pogo/PogoDsl">
<classes name="AlarmHandler" pogoRevision="9.6">
<description description="Elettra alarm handler device server" title="Elettra alarm handler device server" sourcePath="/home/graziano/ws/alarm-handler/src" language="Cpp" filestogenerate="XMI file,Code files,Protected Regions" license="GPL" copyright="" hasMandatoryProperty="false" hasConcreteProperty="true" hasAbstractCommand="false" hasAbstractAttribute="false">
<inheritances classname="Device_4Impl" sourcePath=""/>
<identification contact="at elettra.eu - graziano.scalamera" author="graziano.scalamera" emailDomain="elettra.eu" classFamily="SoftwareSystem" siteSpecific="" platform="Unix Like" bus="Not Applicable" manufacturer="" reference=""/>
</description>
<classProperties name="GroupNames" description="Labels for Group mask, first is for mask 0x00">
<type xsi:type="pogoDsl:StringVectorType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</classProperties>
<classProperties name="SubscribeRetryPeriod" description="Retry subscription period in seconds">
<type xsi:type="pogoDsl:IntType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<DefaultPropValue>30</DefaultPropValue>
</classProperties>
<classProperties name="StatisticsTimeWindow" description="Time window to compute statistics in seconds">
<type xsi:type="pogoDsl:IntVectorType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<DefaultPropValue>60</DefaultPropValue>
</classProperties>
<classProperties name="ErrorDelay" description="Delay in seconds before changing to ERROR state after an exception is received.">
<type xsi:type="pogoDsl:UIntType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<DefaultPropValue>30</DefaultPropValue>
</classProperties>
<classProperties name="SetAlarmQuality" description="Set alarm attribute quality as computed using quality of attributes in the formula">
<type xsi:type="pogoDsl:BooleanType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<DefaultPropValue>false</DefaultPropValue>
</classProperties>
<deviceProperties name="GroupNames" description="Labels for Group mask, first is for mask 0x00">
<type xsi:type="pogoDsl:StringVectorType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</deviceProperties>
<deviceProperties name="SubscribeRetryPeriod" description="Retry subscription period in seconds">
<type xsi:type="pogoDsl:IntType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<DefaultPropValue>30</DefaultPropValue>
</deviceProperties>
<deviceProperties name="StatisticsTimeWindow" description="Time window to compute statistics in seconds">
<type xsi:type="pogoDsl:IntVectorType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<DefaultPropValue>60</DefaultPropValue>
</deviceProperties>
<deviceProperties name="ErrorDelay" description="Delay in seconds before changing to ERROR state after an exception is received.">
<type xsi:type="pogoDsl:UIntType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<DefaultPropValue>30</DefaultPropValue>
</deviceProperties>
<deviceProperties name="SetAlarmQuality" description="Set alarm attribute quality as computed using quality of attributes in the formula">
<type xsi:type="pogoDsl:BooleanType"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<DefaultPropValue>false</DefaultPropValue>
</deviceProperties>
<commands name="State" description="This command gets the device state (stored in its &lt;i>device_state&lt;/i> data member) and returns it to the caller." execMethod="dev_state" displayLevel="OPERATOR" polledPeriod="0">
<argin description="none.">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="State Code">
<type xsi:type="pogoDsl:StateType"/>
</argout>
<status abstract="true" inherited="true" concrete="true" concreteHere="false"/>
</commands>
<commands name="Status" description="This command gets the device status (stored in its &lt;i>device_status&lt;/i> data member) and returns it to the caller." execMethod="dev_status" displayLevel="OPERATOR" polledPeriod="0">
<argin description="none.">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="Status description">
<type xsi:type="pogoDsl:ConstStringType"/>
</argout>
<status abstract="true" inherited="true" concrete="true" concreteHere="false"/>
</commands>
<commands name="Ack" description="Alarm acknowledge" execMethod="ack" displayLevel="OPERATOR" polledPeriod="0">
<argin description="String array containing the alarms to be acknowledged">
<type xsi:type="pogoDsl:StringArrayType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<commands name="Load" description="Load a new alarm." execMethod="load" displayLevel="OPERATOR" polledPeriod="0">
<argin description="Alarm entry">
<type xsi:type="pogoDsl:StringType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<commands name="Remove" description="Remove alarm." execMethod="remove" displayLevel="OPERATOR" polledPeriod="0">
<argin description="Alarm name">
<type xsi:type="pogoDsl:StringType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<commands name="SearchAlarm" description="Return list of configured alarms matching the filter string" execMethod="search_alarm" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false">
<argin description="String containing a filter for output, if empty or * return all alarms">
<type xsi:type="pogoDsl:StringType"/>
</argin>
<argout description="Configured alarms">
<type xsi:type="pogoDsl:StringArrayType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<commands name="StopAudible" description="Stop audible indications on the GUI" execMethod="stop_audible" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false">
<argin description="">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<commands name="Silence" description="Alarm temporarily silence" execMethod="silence" displayLevel="OPERATOR" polledPeriod="0">
<argin description="String array containing the alarms to be silenced">
<type xsi:type="pogoDsl:StringArrayType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<commands name="Modify" description="Modify an existing alarm." execMethod="modify" displayLevel="OPERATOR" polledPeriod="0">
<argin description="Alarm entry">
<type xsi:type="pogoDsl:StringType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<commands name="Shelve" description="Shelve an alarm: no state transition recorded, no audible nor visual indication" execMethod="shelve" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false">
<argin description="String array containing alarm to be shelved">
<type xsi:type="pogoDsl:StringArrayType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<commands name="Enable" description="Enable an alarm from Out of service state" execMethod="enable" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false">
<argin description="Alarm name">
<type xsi:type="pogoDsl:StringType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<commands name="Disable" description="Put an alarm in Out of service state" execMethod="disable" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false">
<argin description="Alarm name">
<type xsi:type="pogoDsl:StringType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<commands name="ResetStatistics" description="Reset statistics" execMethod="reset_statistics" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false">
<argin description="">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<commands name="StopNew" description="Stop audible indications on the GUI" execMethod="stop_new" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false">
<argin description="">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<commands name="GetAlarmInfo" description="Returns the complete attribute info as an array of key=value" execMethod="get_alarm_info" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false">
<argin description="Alarm name followed optionally by wanted key names">
<type xsi:type="pogoDsl:StringArrayType"/>
</argin>
<argout description="Complete attribute info as an array of key=value">
<type xsi:type="pogoDsl:StringArrayType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<commands name="ReLoadAll" description="Re Load all alarms." execMethod="re_load_all" displayLevel="OPERATOR" polledPeriod="0" isDynamic="false">
<argin description="">
<type xsi:type="pogoDsl:VoidType"/>
</argin>
<argout description="">
<type xsi:type="pogoDsl:VoidType"/>
</argout>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
</commands>
<attributes name="alarmAudible" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:BooleanType"/>
<changeEvent fire="true" libCheckCriteria="true"/>
<archiveEvent fire="true" libCheckCriteria="true"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="True if there is at least one alarm that needs audible indication on the GUI" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="StatisticsResetTime" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:DoubleType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="Time elapsed in seconds since last Resetstatistics" label="" unit="s" standardUnit="1" displayUnit="s" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="alarm" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="1024" maxY="0">
<dataType xsi:type="pogoDsl:StringType"/>
<changeEvent fire="false" libCheckCriteria="false"/>
<archiveEvent fire="false" libCheckCriteria="false"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="alarmNormal" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="10000" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:StringType"/>
<changeEvent fire="true" libCheckCriteria="true"/>
<archiveEvent fire="true" libCheckCriteria="true"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="List of alarms in normal state" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="alarmUnacknowledged" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="10000" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:StringType"/>
<changeEvent fire="true" libCheckCriteria="true"/>
<archiveEvent fire="true" libCheckCriteria="true"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="List of alarms in unacknowledged state" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="alarmAcknowledged" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="10000" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:StringType"/>
<changeEvent fire="true" libCheckCriteria="true"/>
<archiveEvent fire="true" libCheckCriteria="true"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="List of alarms in acknowledged state" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="alarmUnacknowledgedNormal" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="10000" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:StringType"/>
<changeEvent fire="true" libCheckCriteria="true"/>
<archiveEvent fire="true" libCheckCriteria="true"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="List of alarms in unacknowledged normal state" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="alarmShelved" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="10000" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:StringType"/>
<changeEvent fire="true" libCheckCriteria="true"/>
<archiveEvent fire="true" libCheckCriteria="true"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="List of alarms in shelved state" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="alarmOutOfService" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="10000" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:StringType"/>
<changeEvent fire="true" libCheckCriteria="true"/>
<archiveEvent fire="true" libCheckCriteria="true"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="List of alarms in out of service state" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="alarmSilenced" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="10000" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:StringType"/>
<changeEvent fire="true" libCheckCriteria="true"/>
<archiveEvent fire="true" libCheckCriteria="true"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="List of alarms in silenced state" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="alarmList" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="10000" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:StringType"/>
<changeEvent fire="true" libCheckCriteria="true"/>
<archiveEvent fire="true" libCheckCriteria="true"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="List of all alarms" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="alarmFrequency" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="10000" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:DoubleType"/>
<changeEvent fire="true" libCheckCriteria="true"/>
<archiveEvent fire="true" libCheckCriteria="true"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="List of frequency of evaluation of all alarms" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="alarmSummary" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="10000" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:StringType"/>
<changeEvent fire="true" libCheckCriteria="true"/>
<archiveEvent fire="true" libCheckCriteria="true"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="eventList" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="10000" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:StringType"/>
<changeEvent fire="false" libCheckCriteria="true"/>
<archiveEvent fire="false" libCheckCriteria="true"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="List of all subscribed attributes" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="eventSummary" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="10000" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:StringType"/>
<changeEvent fire="false" libCheckCriteria="true"/>
<archiveEvent fire="false" libCheckCriteria="true"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<attributes name="alarmDisabled" attType="Spectrum" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="10000" maxY="" allocReadMember="true" isDynamic="false">
<dataType xsi:type="pogoDsl:StringType"/>
<changeEvent fire="true" libCheckCriteria="true"/>
<archiveEvent fire="true" libCheckCriteria="true"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="List of alarms in out of service or shelved state" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</attributes>
<dynamicAttributes name="AlarmState" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="true">
<dataType xsi:type="pogoDsl:EnumType"/>
<changeEvent fire="true" libCheckCriteria="true"/>
<archiveEvent fire="true" libCheckCriteria="true"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
<enumLabels>NORM</enumLabels>
<enumLabels>UNACK</enumLabels>
<enumLabels>ACKED</enumLabels>
<enumLabels>RTNUN</enumLabels>
<enumLabels>SHLVD</enumLabels>
<enumLabels>DSUPR</enumLabels>
<enumLabels>OOSRV</enumLabels>
<enumLabels>ERROR</enumLabels>
</dynamicAttributes>
<dynamicAttributes name="AlarmFormula" attType="Scalar" rwType="READ" displayLevel="OPERATOR" polledPeriod="0" maxX="" maxY="" allocReadMember="true" isDynamic="true">
<dataType xsi:type="pogoDsl:StringType"/>
<changeEvent fire="true" libCheckCriteria="true"/>
<archiveEvent fire="true" libCheckCriteria="true"/>
<dataReadyEvent fire="false" libCheckCriteria="true"/>
<status abstract="false" inherited="false" concrete="true" concreteHere="true"/>
<properties description="" label="" unit="" standardUnit="" displayUnit="" format="" maxValue="" minValue="" maxAlarm="" minAlarm="" maxWarning="" minWarning="" deltaTime="" deltaValue=""/>
</dynamicAttributes>
<preferences docHome="./doc_html" makefileHome="/usr/local/tango-9.3.3/share/pogo/preferences"/>
</classes>
</pogoDsl:PogoSystem>