Commit 10fade2c authored by Claes Sjofors's avatar Claes Sjofors

Sev database hdf5 added

parent 70a66ffb
ifndef link_rule_mk
link_rule_mk := 1
link = $(ldxx) $(elinkflags) $(domap) -o $(export_exe) \
ifeq ($(PWRE_CONF_LIBHDF5),1)
ldsev = mpic++
else
ldsev = $(ldxx)
endif
link = $(ldsev) $(elinkflags) $(domap) -o $(export_exe) \
$(export_obj) $(objects) $(wb_msg_eobjs) $(rt_msg_eobjs) \
$(pwr_eobj)/rt_io_user.o \
$(pwre_conf_libdir) $(pwre_conf_libpwrsev) $(pwre_conf_libpwrrt) $(pwre_conf_lib)
......
......@@ -108,10 +108,14 @@ int sev_server::init( int noneth)
exit(0);
}
pwr_sAttrRef aref = cdh_ObjidToAref( conf_oid);
sts = gdh_DLRefObjectInfoAttrref( &aref, (void **)&m_config, &m_config_dlid);
if ( EVEN(sts))
m_config = 0;
// Get configured database
pwr_tAttrRef daref;
pwr_eSevDatabaseEnum db_enum;
pwr_tAttrRef aref = cdh_ObjidToAref( conf_oid);
sts = gdh_ArefANameToAref( &aref, "Database", &daref);
if ( ODD(sts)) {
sts = gdh_GetObjectInfoAttrref( &daref, (void *)&db_enum, sizeof(db_enum));
......@@ -123,6 +127,9 @@ int sev_server::init( int noneth)
case pwr_eSevDatabaseEnum_SQLite:
set_dbtype( sev_eDbType_Sqlite);
break;
case pwr_eSevDatabaseEnum_HDF5:
set_dbtype( sev_eDbType_HDF5);
break;
}
}
}
......@@ -444,6 +451,16 @@ int sev_server::mainloop()
m_stat.medium_storage_rate = a * m_stat.medium_storage_rate + (1.0-a) * m_stat.storage_rate;
m_storage_cnt = 0;
m_db->store_stat( &m_stat);
if ( m_config) {
m_config->Stat.CurrentLoad = m_stat.current_load;
m_config->Stat.MediumLoad = m_stat.medium_load;
m_config->Stat.StorageRate = m_stat.storage_rate;
m_config->Stat.MediumStorageRate = m_stat.medium_storage_rate;
m_config->Stat.DataStoreMsgCnt = m_stat.datastore_msg_cnt;
m_config->Stat.DataGetMsgCnt = m_stat.dataget_msg_cnt;
m_config->Stat.ItemsMsgCnt = m_stat.items_msg_cnt;
m_config->Stat.EventStoreMsgCnt = m_stat.eventstore_msg_cnt;
}
time_Aadd( &next_stat, &next_stat, &stat_interval);
busy = pwr_cNDeltaTime;
idle = pwr_cNDeltaTime;
......@@ -576,6 +593,8 @@ int sev_server::check_histitems( sev_sMsgHistItems *msg, unsigned int size)
buffP->scantime,
buffP->deadband,
buffP->options,
buffP->attrnum,
buffP->attr,
&idx)) {
m_db->add_objectitem( &m_sts,
tablename,
......@@ -587,6 +606,8 @@ int sev_server::check_histitems( sev_sMsgHistItems *msg, unsigned int size)
buffP->scantime,
buffP->deadband,
buffP->options,
buffP->attrnum,
buffP->attr,
&idx);
if ( EVEN(m_sts)) return m_sts;
newobject = true;
......@@ -986,6 +1007,8 @@ int main (int argc, char *argv[])
dbtype = sev_eDbType_Sqlite;
else if ( argc > 2 + noneth && strcmp( argv[1+noneth], "-d") == 0 && strcmp( argv[2+noneth], "mysql") == 0)
dbtype = sev_eDbType_Mysql;
else if ( argc > 2 + noneth && strcmp( argv[1+noneth], "-d") == 0 && strcmp( argv[2+noneth], "hdf5") == 0)
dbtype = sev_eDbType_HDF5;
if ( dbtype == sev_eDbType_) {
char type[80];
......@@ -994,6 +1017,8 @@ int main (int argc, char *argv[])
dbtype = sev_eDbType_Sqlite;
else if ( cdh_NoCaseStrcmp( type, "mysql") == 0)
dbtype = sev_eDbType_Mysql;
else if ( cdh_NoCaseStrcmp( type, "hdf5") == 0)
dbtype = sev_eDbType_HDF5;
}
}
......
......@@ -42,6 +42,7 @@
#include "pwr.h"
#include "pwr_class.h"
#include "pwr_baseclasses.h"
#include "rt_sev_net.h"
#include "sev_db.h"
......@@ -72,7 +73,7 @@ class sev_server {
public:
sev_server() : m_server_status(0), m_refid(0), m_msg_id(0), m_storage_cnt(0),
m_db_type(sev_eDbType_Sqlite) {memset(&m_stat,0,sizeof(m_stat));}
m_db_type(sev_eDbType_Sqlite), m_config(0) {memset(&m_stat,0,sizeof(m_stat));}
pwr_tStatus m_sts;
pwr_tStatus m_server_status;
......@@ -84,6 +85,8 @@ class sev_server {
unsigned int m_storage_cnt;
sev_sStat m_stat;
sev_eDbType m_db_type;
pwr_sClass_SevServer *m_config;
pwr_tDlid m_config_dlid;
int init( int noneth);
int connect();
......
......@@ -37,10 +37,17 @@
#include "sev_db.h"
#include "sev_dbms.h"
#include "sev_dbsqlite.h"
#include "sev_dbhdf5.h"
#include "co_syi.h"
#include "pwr_names.h"
#include "rt_load.h"
#include "co_dcli.h"
sev_db *sev_db::open_database( sev_eDbType type)
{
if ( type == sev_eDbType_Mysql) {
#if defined PWRE_CONF_MYSQL
return sev_dbms::open_database();
......@@ -55,8 +62,58 @@ sev_db *sev_db::open_database( sev_eDbType type)
#else
printf( "** Release is not built with sqlite3\n");
return 0;
#endif
}
else if ( type == sev_eDbType_HDF5) {
#if defined PWRE_CONF_HDF5
return sev_dbhdf5::open_database();
#else
printf( "** Release is not built with HDF5\n");
return 0;
#endif
}
else
return 0;
}
int sev_db::get_systemname( char *name)
{
FILE *file;
pwr_tFileName fname;
char nodename[40];
char *bus_str;
int bus;
char line[200];
pwr_tStatus sts;
static char system_name[80] = "";
if ( strcmp( system_name, "") == 0) {
syi_NodeName( &sts, nodename, sizeof(nodename));
if ( EVEN(sts)) return 0;
bus_str = getenv( "PWR_BUS_ID");
if ( !bus_str)
return 0;
if ( sscanf( bus_str, "%d", &bus) != 1)
return 0;
sprintf( fname, pwr_cNameBoot, load_cDirectory, cdh_Low(nodename), bus);
dcli_translate_filename( fname, fname);
file = fopen( fname, "r");
if ( file == 0) {
printf("In %s row %d:\n", __FILE__, __LINE__);
printf("** Warning, systemname not found\n");
return 0;
}
if ( !dcli_read_line( line, sizeof(line), file))
return 0;
if ( !dcli_read_line( line, sizeof(line), file))
return 0;
strcpy( system_name, line);
}
strcpy( name, system_name);
return 1;
}
......@@ -42,6 +42,7 @@
#include "pwr.h"
#include "pwr_class.h"
#include "rt_mh_net.h"
#include "rt_sev_net.h"
using namespace std;
......@@ -50,7 +51,8 @@ using namespace std;
typedef enum {
sev_eDbType_,
sev_eDbType_Mysql,
sev_eDbType_Sqlite
sev_eDbType_Sqlite,
sev_eDbType_HDF5
} sev_eDbType;
typedef struct {
......@@ -66,6 +68,12 @@ typedef struct {
class sev_attr {
public:
sev_attr() : type(pwr_eType_), size(0), elem(0) {
strcpy( aname, ""); strcpy( unit, "");
}
sev_attr( const sev_attr& x) : type(x.type), size(x.size), elem(x.elem) {
strncpy( aname, x.aname, sizeof(aname)); strncpy( unit, x.unit, sizeof(unit));
}
pwr_tOName aname;
pwr_eType type;
unsigned int size;
......@@ -86,8 +94,17 @@ class sev_event {
class sev_item {
public:
sev_item() : deadband_active(0), last_id(0), value_size(0), old_value(0), first_storage(1), status(0), logged_status(0),
deleted(0)
idx(0), deleted(0)
{ /*memset( old_value, 0, sizeof(old_value));*/}
sev_item( const sev_item& x) : id(x.id), oid(x.oid), creatime(x.creatime), modtime(x.modtime),
storagetime(x.storagetime), sevid(x.sevid), scantime(x.scantime), deadband(x.deadband), options(x.options),
deadband_active(x.deadband_active), last_id(x.last_id), value_size(x.value_size), first_storage(x.first_storage),
attrnum(x.attrnum), attr(x.attr), status(x.status), logged_status(x.logged_status),
idx(x.idx), deleted(x.deleted) {
strncpy( tablename, x.tablename, sizeof(tablename));
strncpy( oname, x.oname, sizeof(oname));
strncpy( description, x.description, sizeof(description));
}
unsigned int id;
char tablename[256];
pwr_tOid oid;
......@@ -110,6 +127,7 @@ class sev_item {
vector<sev_attr> attr;
pwr_tStatus status;
pwr_tStatus logged_status;
unsigned int idx;
int deleted;
};
......@@ -124,54 +142,58 @@ class sev_db {
pwr_tDeltaTime storatetime, pwr_eType type, unsigned int size,
char *description, char *unit, pwr_tFloat32 scantime,
pwr_tFloat32 deadband, pwr_tMask options, unsigned int *idx)
{ return 0;}
{ *sts = 0; return 0;}
virtual int add_item( pwr_tStatus *sts, pwr_tOid oid, char *oname, char *aname,
pwr_tDeltaTime storagetime, pwr_eType type, unsigned int size,
char *description, char *unit, pwr_tFloat32 scantime,
pwr_tFloat32 deadband, pwr_tMask options, unsigned int *idx)
{ return 0;}
virtual int delete_item( pwr_tStatus *sts, pwr_tOid oid, char *aname) { return 0;}
{ *sts = 0; return 0;}
virtual int delete_item( pwr_tStatus *sts, pwr_tOid oid, char *aname) { *sts = 0; return 0;}
virtual int store_value( pwr_tStatus *sts, int item_idx, int attr_idx,
pwr_tTime time, void *buf, unsigned int size) { return 0;}
pwr_tTime time, void *buf, unsigned int size) { *sts = 0; return 0;}
virtual int get_values( pwr_tStatus *sts, pwr_tOid oid, pwr_tMask options, float deadband,
char *aname, pwr_eType type,
unsigned int size, pwr_tFloat32 scantime, pwr_tTime *creatime, pwr_tTime *starttime,
pwr_tTime *endtime, int maxsize, pwr_tTime **tbuf, void **vbuf,
unsigned int *bsize) { return 0;}
virtual int get_items( pwr_tStatus *sts) { return 0;}
unsigned int *bsize) { *sts = 0; return 0;}
virtual int get_items( pwr_tStatus *sts) { *sts = 0; return 0;}
virtual int delete_old_data( pwr_tStatus *sts, char *tablename,
pwr_tMask options, pwr_tTime limit, pwr_tFloat32 scantime, pwr_tFloat32 garbagecycle) { return 0;}
pwr_tMask options, pwr_tTime limit, pwr_tFloat32 scantime, pwr_tFloat32 garbagecycle)
{ *sts = 0; return 0;}
virtual int check_objectitem( pwr_tStatus *sts, char *tablename, pwr_tOid oid, char *oname, char *aname,
pwr_tDeltaTime storagetime,
char *description, pwr_tFloat32 scantime,
pwr_tFloat32 deadband, pwr_tMask options, unsigned int *idx) { return 0;}
pwr_tDeltaTime storagetime,
char *description, pwr_tFloat32 scantime,
pwr_tFloat32 deadband, pwr_tMask options, unsigned int attrnum,
sev_sHistAttr *attr, unsigned int *idx) { *sts = 0; return 0;}
virtual int add_objectitem( pwr_tStatus *sts, char *tablename, pwr_tOid oid, char *oname, char *aname,
pwr_tDeltaTime storagetime,
char *description, pwr_tFloat32 scantime,
pwr_tFloat32 deadband, pwr_tMask options, unsigned int *idx) { return 0;}
pwr_tDeltaTime storagetime,
char *description, pwr_tFloat32 scantime,
pwr_tFloat32 deadband, pwr_tMask options, unsigned int attrnum,
sev_sHistAttr *attr, unsigned int *idx) { *sts = 0; return 0;}
virtual int store_objectitem( pwr_tStatus *sts, char *tablename, pwr_tOid oid, char *oname, char *aname,
pwr_tDeltaTime storagetime, char *description, pwr_tFloat32 scantime, pwr_tFloat32 deadband, pwr_tMask options) { return 0;}
virtual int store_event( pwr_tStatus *sts, int item_idx, sev_event *ep) { return 0;}
virtual int get_item( pwr_tStatus *sts, sev_item *item, pwr_tOid oid, char *attributename) { return 0;}
virtual int get_objectitem( pwr_tStatus *sts, sev_item *item, pwr_tOid oid, char *attributename) { return 0;}
virtual int get_objectitems( pwr_tStatus *sts) { return 0;}
virtual int store_event( pwr_tStatus *sts, int item_idx, sev_event *ep) { *sts = 0; return 0;}
virtual int get_item( pwr_tStatus *sts, sev_item *item, pwr_tOid oid, char *attributename) { *sts = 0; return 0;}
virtual int get_objectitem( pwr_tStatus *sts, sev_item *item, pwr_tOid oid, char *attributename) { *sts = 0; return 0;}
virtual int get_objectitems( pwr_tStatus *sts) { *sts = 0; return 0;}
virtual int check_objectitemattr( pwr_tStatus *sts, char *tablename, pwr_tOid oid, char *aname, char *oname,
pwr_eType type, unsigned int size, unsigned int *idx) { return 0;}
pwr_eType type, unsigned int size, unsigned int *idx) { *sts = 0; return 0;}
virtual int delete_old_objectdata( pwr_tStatus *sts, char *tablename,
pwr_tMask options, pwr_tTime limit, pwr_tFloat32 scantime, pwr_tFloat32 garbagecycle) { return 0;}
pwr_tMask options, pwr_tTime limit, pwr_tFloat32 scantime, pwr_tFloat32 garbagecycle) { *sts = 0; return 0;}
virtual int get_objectvalues( pwr_tStatus *sts, sev_item *item,
unsigned int size, pwr_tTime *starttime, pwr_tTime *endtime,
int maxsize, pwr_tTime **tbuf, void **vbuf, unsigned int *bsize) { return 0;}
virtual int handle_objectchange(pwr_tStatus *sts, char *tablename, unsigned int item_idx, bool newObject) { return 0;}
virtual int repair_table( pwr_tStatus *sts, char *tablename) { return 0;}
virtual int alter_engine( pwr_tStatus *sts, char *tablename) { return 0;}
virtual int optimize( pwr_tStatus *sts, char *tablename) { return 0;}
int maxsize, pwr_tTime **tbuf, void **vbuf, unsigned int *bsize) { *sts = 0; return 0;}
virtual int handle_objectchange(pwr_tStatus *sts, char *tablename, unsigned int item_idx, bool newObject) { *sts = 0; return 0;}
virtual int repair_table( pwr_tStatus *sts, char *tablename) { *sts = 0; return 0;}
virtual int alter_engine( pwr_tStatus *sts, char *tablename) { *sts = 0; return 0;}
virtual int optimize( pwr_tStatus *sts, char *tablename) { *sts = 0; return 0;}
virtual int store_stat( sev_sStat *stat) { return 0;}
virtual int begin_transaction() { return 0;}
virtual int commit_transaction() { return 0;}
virtual char *dbName() { return 0;}
static sev_db *open_database( sev_eDbType type);
static int get_systemname( char *name);
};
#endif
This diff is collapsed.
This diff is collapsed.
......@@ -2246,9 +2246,10 @@ char *sev_dbms::pwrtype_to_type( pwr_eType type, unsigned int size)
int sev_dbms::check_objectitem( pwr_tStatus *sts, char *tablename, pwr_tOid oid, char *oname, char *aname,
pwr_tDeltaTime storagetime,
char *description, pwr_tFloat32 scantime,
pwr_tFloat32 deadband, pwr_tMask options, unsigned int *idx)
pwr_tDeltaTime storagetime,
char *description, pwr_tFloat32 scantime,
pwr_tFloat32 deadband, pwr_tMask options, unsigned int attrnum,
sev_sHistAttr *attr, unsigned int *idx)
{
char timestr[40];
pwr_tTime uptime;
......@@ -2303,9 +2304,10 @@ int sev_dbms::check_objectitem( pwr_tStatus *sts, char *tablename, pwr_tOid oid,
}
int sev_dbms::add_objectitem( pwr_tStatus *sts, char *tablename, pwr_tOid oid, char *oname, char *aname,
pwr_tDeltaTime storagetime,
char *description, pwr_tFloat32 scantime,
pwr_tFloat32 deadband, pwr_tMask options, unsigned int *idx)
pwr_tDeltaTime storagetime,
char *description, pwr_tFloat32 scantime,
pwr_tFloat32 deadband, pwr_tMask options, unsigned int attrnum,
sev_sHistAttr *attr, unsigned int *idx)
{
store_objectitem( sts, tablename, oid, oname, aname, storagetime, description,
......
......@@ -163,12 +163,14 @@ class sev_dbms : public sev_db {
static int timestr_to_time( char *tstr, pwr_tTime *ts);
int check_objectitem( pwr_tStatus *sts, char *tablename, pwr_tOid oid, char *oname, char *aname,
pwr_tDeltaTime storagetime,
char *description, pwr_tFloat32 scantime,
pwr_tFloat32 deadband, pwr_tMask options, unsigned int *idx);
char *description, pwr_tFloat32 scantime,
pwr_tFloat32 deadband, pwr_tMask options, unsigned int attrnum,
sev_sHistAttr *attr, unsigned int *idx);
int add_objectitem( pwr_tStatus *sts, char *tablename, pwr_tOid oid, char *oname, char *aname,
pwr_tDeltaTime storagetime,
char *description, pwr_tFloat32 scantime,
pwr_tFloat32 deadband, pwr_tMask options, unsigned int *idx);
pwr_tDeltaTime storagetime,
char *description, pwr_tFloat32 scantime,
pwr_tFloat32 deadband, pwr_tMask options, unsigned int attrnum,
sev_sHistAttr *attr, unsigned int *idx);
int store_objectitem( pwr_tStatus *sts, char *tablename, pwr_tOid oid, char *oname, char *aname,
pwr_tDeltaTime storagetime, char *description, pwr_tFloat32 scantime,
pwr_tFloat32 deadband, pwr_tMask options);
......
......@@ -1887,9 +1887,10 @@ char *sev_dbsqlite::pwrtype_to_type( pwr_eType type, unsigned int size)
int sev_dbsqlite::check_objectitem( pwr_tStatus *sts, char *tablename, pwr_tOid oid, char *oname, char *aname,
pwr_tDeltaTime storagetime,
char *description, pwr_tFloat32 scantime,
pwr_tFloat32 deadband, pwr_tMask options, unsigned int *idx)
pwr_tDeltaTime storagetime,
char *description, pwr_tFloat32 scantime,
pwr_tFloat32 deadband, pwr_tMask options, unsigned int attrnum,
sev_sHistAttr *attr, unsigned int *idx)
{
char timestr[40];
pwr_tTime uptime;
......@@ -1946,9 +1947,10 @@ int sev_dbsqlite::check_objectitem( pwr_tStatus *sts, char *tablename, pwr_tOid
}
int sev_dbsqlite::add_objectitem( pwr_tStatus *sts, char *tablename, pwr_tOid oid, char *oname, char *aname,
pwr_tDeltaTime storagetime,
char *description, pwr_tFloat32 scantime,
pwr_tFloat32 deadband, pwr_tMask options, unsigned int *idx)
pwr_tDeltaTime storagetime,
char *description, pwr_tFloat32 scantime,
pwr_tFloat32 deadband, pwr_tMask options, unsigned int attrnum,
sev_sHistAttr *attr, unsigned int *idx)
{
store_objectitem( sts, tablename, oid, oname, aname, storagetime, description,
......
......@@ -100,13 +100,15 @@ class sev_dbsqlite : public sev_db {
char *pwrtype_to_type( pwr_eType type, unsigned int size);
static int timestr_to_time( char *tstr, pwr_tTime *ts);
int check_objectitem( pwr_tStatus *sts, char *tablename, pwr_tOid oid, char *oname, char *aname,
pwr_tDeltaTime storagetime,
char *description, pwr_tFloat32 scantime,
pwr_tFloat32 deadband, pwr_tMask options, unsigned int *idx);
pwr_tDeltaTime storagetime,
char *description, pwr_tFloat32 scantime,
pwr_tFloat32 deadband, pwr_tMask options, unsigned int attrnum,
sev_sHistAttr *attr, unsigned int *idx);
int add_objectitem( pwr_tStatus *sts, char *tablename, pwr_tOid oid, char *oname, char *aname,
pwr_tDeltaTime storagetime,
char *description, pwr_tFloat32 scantime,
pwr_tFloat32 deadband, pwr_tMask options, unsigned int *idx);
pwr_tDeltaTime storagetime,
char *description, pwr_tFloat32 scantime,
pwr_tFloat32 deadband, pwr_tMask options, unsigned int attrnum,
sev_sHistAttr *attr, unsigned int *idx);
int store_objectitem( pwr_tStatus *sts, char *tablename, pwr_tOid oid, char *oname, char *aname,
pwr_tDeltaTime storagetime, char *description, pwr_tFloat32 scantime,
pwr_tFloat32 deadband, pwr_tMask options);
......
......@@ -996,7 +996,8 @@ int rt_sevhistmon::send_itemlist( pwr_tNid nid)
m_sevhistevents->description,
sizeof(((sev_sMsgHistItems *)put.data)->Items[0].description));
strcpy( ((sev_sMsgHistItems *)put.data)->Items[k].attr[0].unit, "");
((sev_sMsgHistItems *)put.data)->Items[k].scantime = 0;
// Put the table size in scan time. Only used for hdf5 databases.
((sev_sMsgHistItems *)put.data)->Items[k].scantime = m_sevhistevents->table_size;
k++;
}
......@@ -1352,6 +1353,7 @@ int rt_sevhistmon::init_events()
h->storagetime = h->hsp->StorageTime;
h->options = h->hsp->Options;
h->table_size = h->hsp->TableSize;
strcpy( h->description, h->hsp->Description);
h->disabled = h->hsp->Disable;
h->event_thread_idx = hs_idx;
......
......@@ -77,6 +77,7 @@ class sev_sevhistevents {
pwr_tRefId hs_refid;
pwr_tDeltaTime storagetime;
pwr_tMask options;
pwr_tUInt32 table_size;
pwr_tBoolean disabled;
unsigned int event_thread_idx;
sev_sEvent event_buffer[20];
......
......@@ -50,6 +50,7 @@ exportfile <Unable to open export file> /error
repair_failed <Repair failed> /error
nyi <Not yet implemented> /error
nopoints <No points found in this interval> /error
nosuchattr <No such attribute exist> /error
.end
......
......@@ -458,6 +458,8 @@ else
pwre_config_check_lib mysql MYSQL lib lib 1 "/usr/lib/libmysqlclient.so:/usr/lib/mysql/libmysqlclient.so:/usr/lib/$hwpl-linux-$gnu/libmysqlclient.so"
pwre_config_check_include sqlite3 SQLITE3 1 "/usr/include/sqlite3.h"
pwre_config_check_lib libsqlite3 LIBSQLITE3 lib lib 0 "/usr/lib/libsqlite3.so:/usr/lib/$hwpl-linux-$gnu/libsqlite3.so"
pwre_config_check_include hdf5 HDF5 1 "/usr/lib/openmpi/include/mpi.h"
pwre_config_check_lib libhdf5 LIBHDF5 lib lib 0 "/usr/lib/libhdf5.so:/usr/lib/$hwpl-linux-$gnu/libhdf5.so"
pwre_config_check_lib mq MQ lib mq 1 "/usr/lib/libdmq.so:/usr/local/dmq/lib/libdmq.so"
pwre_config_check_lib wmq WMQ lib wmq 1 "/usr/lib/libmqic.so"
pwre_config_check_lib libpnioif PNAK lib pnak 1 "/usr/lib/libpnioif.a:/usr/local/lib/libpnioif.a"
......
!
! Proview Open Source Process Control.
! Copyright (C) 2005-2014 SSAB EMEA AB.
!
! This file is part of Proview.
!
! This program 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 2 of
! the License, or (at your option) any later version.
!
! This program 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 Proview. If not, see <http://www.gnu.org/licenses/>
!
! Linking Proview statically or dynamically with other modules is
! making a combined work based on Proview. Thus, the terms and
! conditions of the GNU General Public License cover the whole
! combination.
!
! In addition, as a special exception, the copyright holders of
! Proview give you permission to, from the build function in the
! Proview Configurator, combine Proview with modules generated by the
! Proview PLC Editor to a PLC program, regardless of the license
! terms of these modules. You may copy and distribute the resulting
! combined work under the terms of your choice, provided that every
! copy of the combined work is accompanied by a complete copy of
! the source code of Proview (the version used to produce the
! combined work), being distributed under the terms of the GNU
! General Public License plus this exception.
!
! pwrb_c_a_sevstatistics.wb_load -- Defines the class SevStatistics.
!
SObject pwrb:Class
!/**
! @Version 1.0
! Displays sev server statistics.
!
! @b See also
! @classlink SevServer pwrb_sevserver.html
!*/
Object SevStatistics $ClassDef 657
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Standard
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "SevStatistics"
EndBody
!/**
! Current load in percentage.
!*/
Object CurrentLoad $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
!/**
! Medium load in percentage.
!*/
Object MediumLoad $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
!/**
! Storage rate. Values per second.
!*/
Object StorageRate $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
!/**
! Medium storage rate. Values per second.
!*/
Object MediumStorageRate $Attribute 4
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
!/**
! Data store message count.
!*/
Object DataStoreMsgCnt $Attribute 5
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt32"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
!/**
! Data get message count.
!*/
Object DataGetMsgCnt $Attribute 6
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt32"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
!/**
! Items message count.
!*/
Object ItemsMsgCnt $Attribute 7
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt32"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
!/**
! Event store message count.
!*/
Object EventStoreMsgCnt $Attribute 8
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt32"
Attr Flags |= PWR_MASK_NOEDIT
Attr Flags |= PWR_MASK_STATE
EndBody
EndObject
EndObject
EndObject
EndSObject
......@@ -134,11 +134,20 @@ SObject pwrb:Class
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
!/**
! Size of event table. Only used for hdf5 databases.
!*/
Object TableSize $Attribute 9
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
EndObject
Object Template SevHistEvents
Body RtBody
Attr EventTypes = 3
Attr Options = 0
Attr TableSize = 10000
EndBody
EndObject
Object PostCreate $DbCallBack
......
......@@ -81,6 +81,15 @@ SObject pwrb:Class
Attr TypeRef = "pwrb:Type-SevDatabaseEnum"
EndBody
EndObject
!/**
! Statistics.
!*/
Object Stat $Attribute 3
Body SysBody
Attr TypeRef = "pwrb:Class-SevStatistics"
Attr Flags |= PWR_MASK_CLASS
EndBody
EndObject
EndObject
EndObject
EndSObject
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment