Commit fc262100 authored by claes's avatar claes

Storage environment first version

parent 8a7cd23f
include $(pwre_dir_symbols)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(hw_name)/$(type_name)_generic.mk
ifeq ($($(type_name)_generic_mk),)
-include $(pwre_kroot)/tools/bld/src/$(os_name)/$(type_name)_generic.mk
endif
ifeq ($($(type_name)_generic_mk),)
include $(pwre_kroot)/tools/bld/src/$(type_name)_generic.mk
endif
ifndef link_rule_mk
link_rule_mk := 1
link = $(ldxx) $(elinkflags) $(domap) -o $(export_exe) \
$(export_obj) $(objects) $(wb_msg_eobjs) $(rt_msg_eobjs) \
$(pwr_eobj)/rt_io_user.o \
-lpwr_sev -lpwr_rt -lpwr_co $(linkmysql)\
-lpwr_msg_dummy \
-lrpcsvc -lpthread -lm -lrt -ldb_cxx -lz -lcrypt
#-lpwr_wb -lpwr_rt -lpwr_ge -lpwr_flow -lpwr_glow -lpwr_co \
# -L/usr/X11R6/lib -L/usr/local/BerkeleyDB.4.0/lib \
# -L/opt/gnome/lib \
# -lantlr -lImlib -lMrm -lXm -lXpm -lXt -lX11 -lXext -lXp\
# -lXmu -lSM -lICE\
endif
This diff is collapsed.
/*
* Proview $Id: rt_sevhistmon.h,v 1.1 2008-07-17 11:33:09 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* 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 the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef rt_dshistmon_h
#define rt_dshistmon_h
#include <vector.h>
#include "pwr.h"
#include "pwr_class.h"
class sev_dshist {
public:
pwr_tAttrRef aref;
pwr_tAName aname;
pwr_tRefId refid;
void *datap;
pwr_tDeltaTime storagetime;
pwr_eType type;
unsigned int size;
pwr_tRefId sevid;
pwr_tString80 description;
pwr_tString16 unit;
pwr_tFloat32 scantime;
};
class sev_dshistthread {
public:
pwr_tOid oid;
pwr_tFloat32 scantime;
char nodename[80];
pwr_tNid nid;
unsigned int size;
vector<sev_dshist> dshistlist;
};
class sev_node {
public:
pwr_tNid nid;
char name[80];
};
class rt_dshistmon {
public:
rt_dshistmon() : m_msg_id(0), m_next_rix(0), m_loopcnt(0) {}
pwr_tStatus m_sts;
vector<sev_dshistthread> m_hs;
vector<sev_node> m_nodes;
unsigned int m_msg_id;
unsigned int m_next_rix;
unsigned int m_loopcnt;
int init();
int close();
int mainloop();
int connect();
int send_itemlist( pwr_tNid nid);
int send_data();
};
#endif
/*
* Proview $Id: rt_sev_net.h,v 1.1 2008-07-17 11:33:59 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* 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 the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef rt_sev_net_h
#define rt_sev_net_h
#include "pwr.h"
#ifdef __cplusplus
extern "C"
{
#endif
#define sev_eProcSevClient 121
#define sev_eProcSevServer 122
#define sev_cMsgClass 201
typedef enum {
sev_eMsgType_NodeUp,
sev_eMsgType_HistItemsRequest,
sev_eMsgType_HistItems,
sev_eMsgType_HistDataStore,
sev_eMsgType_HistDataGetRequest,
sev_eMsgType_HistDataGet,
} sev_eMsgType;
typedef struct {
pwr_tOid oid;
pwr_tOName oname;
pwr_tOName aname;
pwr_tDeltaTime storagetime;
pwr_eType type;
unsigned int size;
pwr_tRefId sevid;
pwr_tString80 description;
pwr_tString16 unit;
pwr_tFloat32 scantime;
} sev_sHistItem;
typedef struct {
pwr_tRefId sevid;
pwr_eType type;
unsigned int size;
int data[1];
} sev_sHistData;
// Message types
typedef struct {
sev_eMsgType Type;
} sev_sMsgAny;
typedef struct {
sev_eMsgType Type;
pwr_tStatus Status;
sev_sHistItem Items[1];
} sev_sMsgHistItems;
typedef struct {
sev_eMsgType Type;
pwr_tTime Time;
int Data[1];
} sev_sMsgHistDataStore;
typedef struct {
sev_eMsgType Type;
pwr_tOid Oid;
pwr_tOName AName;
pwr_tTime StartTime;
pwr_tTime EndTime;
int NumPoints;
} sev_sMsgHistDataGetRequest;
typedef struct {
sev_eMsgType Type;
pwr_tOid Oid;
pwr_tOName AName;
pwr_tStatus Status;
int NumPoints;
pwr_eType VType;
unsigned int VSize;
int Data[1];
} sev_sMsgHistDataGet;
#ifdef __cplusplus
}
#endif
#endif
/*
* Proview $Id: rt_sevcli.c,v 1.1 2008-07-17 11:33:59 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* 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 the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include "pwr.h"
#include "co_cdh.h"
#include "co_time.h"
#include "rt_qcom.h"
#include "rt_qcom_msg.h"
#include "rt_sev_msg.h"
#include "rt_sevcli.h"
#include "rt_sev_net.h"
int sevcli_init( pwr_tStatus *sts, sevcli_tCtx *ctx)
{
// Create a queue to server
qcom_sQattr attr;
*ctx = calloc( 1, sizeof(sevcli_sCtx));
(*ctx)->qid.qix = 0;
(*ctx)->qid.nid = 0;
attr.type = qcom_eQtype_private;
attr.quota = 100;
if (!qcom_CreateQ(sts, &(*ctx)->qid, &attr, "SevXtt")) {
return 0;
}
*sts = SEV__SUCCESS;
return 1;
}
int sevcli_close( pwr_tStatus *sts, sevcli_tCtx ctx)
{
// Delete queue
if (!qcom_DeleteQ( sts, &ctx->qid)) {
return 0;
}
free( ctx);
*sts = SEV__SUCCESS;
return 1;
}
void sevcli_set_servernid( sevcli_tCtx ctx, pwr_tNid nid)
{
ctx->server = nid;
}
int sevcli_set_servernode( pwr_tStatus *sts, sevcli_tCtx ctx, char *nodename)
{
qcom_sNode node;
pwr_tNid nid;
if ( !nodename || strcmp( nodename, "") == 0) {
ctx->server = ctx->qid.nid;
*sts = SEV__SUCCESS;
return 1;
}
// Try this node
qcom_MyNode( sts, &node);
if ( EVEN(*sts)) return 0;
if ( cdh_NoCaseStrcmp( node.name, nodename) == 0) {
ctx->server = node.nid;
*sts = SEV__SUCCESS;
return 1;
}
// Try other qcom nodes
for (nid = qcom_cNNid; qcom_NextNode(sts, &node, nid); nid = node.nid) {
if ( cdh_NoCaseStrcmp( nodename, node.name) == 0) {
ctx->server = node.nid;
*sts = SEV__SUCCESS;
return 1;
}
}
*sts = SEV__NOSUCHNODE;
return 0;
}
int sevcli_get_itemlist( pwr_tStatus *sts, sevcli_tCtx ctx, sevcli_sHistItem **list,
unsigned int *cnt)
{
sev_sMsgAny *msg;
qcom_sQid tgt;
qcom_sPut put;
pwr_tStatus lsts;
int tmo = 1000;
qcom_sGet get;
sevcli_sHistItem *lp;
int i;
if ( ctx->server)
tgt.nid = ctx->server;
else
tgt.nid = ctx->qid.nid;
tgt.qix = sev_eProcSevServer;
put.reply = ctx->qid;
put.type.b = (qcom_eBtype) sev_cMsgClass;
put.type.s = (qcom_eStype) sev_eMsgType_HistItemsRequest;
put.msg_id = ctx->msg_id++;
put.size = sizeof(*msg);
msg = (sev_sMsgAny *) qcom_Alloc( sts, put.size);
put.data = msg;
msg->Type = sev_eMsgType_HistItemsRequest;
if ( !qcom_Put( sts, &tgt, &put)) {
qcom_Free( &lsts, put.data);
return 0;
}
sev_sMsgHistItems *rmsg;
memset( &get, 0, sizeof(get));
for (;;) {
rmsg = (sev_sMsgHistItems *) qcom_Get( sts, &ctx->qid, &get, tmo);
if ( *sts == QCOM__TMO || !rmsg) {
return 0;
}
if ( get.type.b == sev_cMsgClass &&
get.type.s == (qcom_eStype) sev_eMsgType_HistItems)
break;
qcom_Free( sts, rmsg);
}
*sts = rmsg->Status;
if ( EVEN(*sts))
return 0;
int item_cnt = (get.size - sizeof(sev_sMsgHistItems)) / sizeof(sev_sHistItem) + 1;
lp = (sevcli_sHistItem *) calloc( item_cnt, sizeof(sevcli_sHistItem));
for ( i = 0; i < item_cnt; i++) {
lp[i].oid = rmsg->Items[i].oid;
strncpy( lp[i].oname, rmsg->Items[i].oname, sizeof(lp[0].oname));
strncpy( lp[i].aname, rmsg->Items[i].aname, sizeof(lp[0].aname));
lp[i].storagetime = rmsg->Items[i].storagetime;
lp[i].type = rmsg->Items[i].type;
lp[i].size = rmsg->Items[i].size;
strncpy( lp[i].description, rmsg->Items[i].description, sizeof(lp[0].description));
strncpy( lp[i].unit, rmsg->Items[i].unit, sizeof(lp[0].unit));
lp[i].scantime = rmsg->Items[i].scantime;
}
qcom_Free( sts, rmsg);
*cnt = item_cnt;
*list = lp;
*sts = SEV__SUCCESS;
return 1;
}
int sevcli_get_itemdata( pwr_tStatus *sts, sevcli_tCtx ctx, pwr_tOid oid,
char *aname, pwr_tTime starttime, pwr_tTime endtime, int numpoints,
pwr_tTime **tbuf, void **vbuf, int *rows,
pwr_eType *vtype, unsigned int *vsize)
{
sev_sMsgHistDataGetRequest *msg;
qcom_sQid tgt;
qcom_sPut put;
int tmo = 10000;
qcom_sGet get;
pwr_tStatus lsts;
if ( ctx->server)
tgt.nid = ctx->server;
else
tgt.nid = ctx->qid.nid;
tgt.qix = sev_eProcSevServer;
put.reply = ctx->qid;
put.type.b = (qcom_eBtype) sev_cMsgClass;
put.type.s = (qcom_eStype) sev_eMsgType_HistDataGetRequest;
put.msg_id = ctx->msg_id++;
put.size = sizeof(*msg);
msg = (sev_sMsgHistDataGetRequest *) qcom_Alloc( sts, put.size);
put.data = msg;
msg->Type = sev_eMsgType_HistDataGetRequest;
msg->Oid = oid;
strncpy( msg->AName, aname, sizeof(msg->AName));
msg->StartTime = starttime;
msg->EndTime = endtime;
msg->NumPoints = numpoints;
if ( !qcom_Put( sts, &tgt, &put)) {
qcom_Free( &lsts, put.data);
return 0;
}
sev_sMsgHistDataGet *rmsg;
memset( &get, 0, sizeof(get));
for (;;) {
rmsg = (sev_sMsgHistDataGet *) qcom_Get(sts, &ctx->qid, &get, tmo);
if ( *sts == QCOM__TMO || !rmsg)
return 0;
if ( get.type.b == sev_cMsgClass &&
get.type.s == (qcom_eStype) sev_eMsgType_HistDataGet &&
cdh_ObjidIsEqual( oid, rmsg->Oid) &&
cdh_NoCaseStrcmp( aname, rmsg->AName) == 0)
break;
qcom_Free( sts, rmsg);
}
*sts = rmsg->Status;
if ( EVEN(*sts))
return 0;
int item_cnt = rmsg->NumPoints;
*tbuf = malloc( item_cnt * sizeof(pwr_tTime));
*vbuf = malloc( item_cnt * rmsg->VSize);
memcpy( *tbuf, &rmsg->Data, item_cnt * sizeof(pwr_tTime));
memcpy( *vbuf, (char *)&rmsg->Data + item_cnt * sizeof(pwr_tTime), item_cnt * rmsg->VSize);
*rows = item_cnt;
*vtype = rmsg->VType;
*vsize = rmsg->VSize;
qcom_Free( sts, rmsg);
*sts = SEV__SUCCESS;
return 1;
}
/*
* Proview $Id: rt_sevcli.h,v 1.1 2008-07-17 11:33:59 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* 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 the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef rt_sevcli_h
#define rt_sevcli_h
/* rt_sevcli.h -- Storage client */
#ifndef pwr_h
# include "pwr.h"
#endif
#ifndef rt_qcom_h
# include "rt_qcom.h"
#endif
#ifdef __cplusplus
extern "C"
{
#endif
typedef struct {
qcom_sQid qid;
pwr_tNid server;
unsigned int msg_id;
} sevcli_sCtx, *sevcli_tCtx;
typedef struct {
pwr_tOid oid;
pwr_tAName oname;
pwr_tAName aname;
pwr_tDeltaTime storagetime;
pwr_eType type;
unsigned int size;
pwr_tString80 description;
pwr_tString16 unit;
pwr_tFloat32 scantime;
} sevcli_sHistItem;
int sevcli_init( pwr_tStatus *sts, sevcli_tCtx *ctx);
int sevcli_close( pwr_tStatus *sts, sevcli_tCtx ctx);
void sevcli_set_servernid( sevcli_tCtx ctx, pwr_tNid nid);
int sevcli_set_servernode( pwr_tStatus *sts, sevcli_tCtx ctx, char *nodename);
int sevcli_get_itemlist( pwr_tStatus *sts, sevcli_tCtx ctx,
sevcli_sHistItem **list, unsigned int *cnt);
int sevcli_get_itemdata( pwr_tStatus *sts, sevcli_tCtx ctx, pwr_tOid oid,
char *aname, pwr_tTime starttime, pwr_tTime endtime, int numpoints,
pwr_tTime **tbuf, void **vbuf, int *rows,
pwr_eType *vtype, unsigned int *vsize);
#ifdef __cplusplus
}
#endif
#endif
!
! Proview $Id: rt_sev_msg.msg,v 1.1 2008-07-17 11:38:21 claes Exp $
! Copyright (C) 2005 SSAB Oxelösund AB.
!
! 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 the program, if not, write to the Free Software
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!
! rt_sev_msg.msg -- <short description>
!
.facility SEV,25 /prefix = SEV__
success <Successful completion> /succ
dberror <Database error> /error
nosuchitem <No such item exists> /error
nosuchnode <No such node exists> /error
curvetype <Uable to draw a curve for this type> /error
nodatatime <No data found in this time interval> /error
noitems <No items found> /error
.end
!
! Proview $Id: pwrb_c_dshist.wb_load,v 1.3 2005-09-01 14:58:01 claes Exp $
! Proview $Id: pwrb_c_dshist.wb_load,v 1.4 2008-07-17 11:36:41 claes Exp $
! Copyright (C) 2005 SSAB Oxelsund AB.
!
! This program is free software; you can redistribute it and/or
......@@ -20,12 +20,13 @@
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Version 2.0
! @Group PlantConfiguration,DsHist
! @Summary Configures historical data storage for a value.
! Configures historical data storage for a scalar
! quantity or element in a one-dimensional vector. (Datastorage
! History).
!
! Historical data storage is an option in PROVIEW/R.
! In a relational database, data resides in
! two-dimensional tables known as relations. A relation
! consist of rows and columns.
......@@ -33,14 +34,17 @@ SObject pwrb:Class
! The DsHist object specifies which quantity is to be
! stored and in which relation. Up to three different
! relations can be specified.
! Hints
! Hints
!
! If the storage concern signal values DsHist is
! configured in the development environment often direct
! below the current signal object.
!
! See Also
! DsHistServer.
! @b See also
! @classlink DsHistThread pwrb_dshistthread.html
! @classlink DsHistMonitor pwrb_dshistmonitor.html
! @classlink DsHistServer pwrb_dshistserver.html
!*/
Object DsHist $ClassDef 106
Body SysBody
......@@ -51,6 +55,9 @@ SObject pwrb:Class
Body SysBody
Attr StructName = "DsHist"
EndBody
!/**
! Optional desription.
!*/
Object Description $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
......@@ -58,27 +65,36 @@ SObject pwrb:Class
EndObject
!/**
! Specifies the complete name of the attribute whose
! value is to be stored. The attribute has to be any of
! the types: pwr_tBoolean, pwr_tFloat32, pwr_tInt8,
! pwr_tInt16, or pwr_tInt32.
! The value is always stored as pwr_tFloat32.
! value is to be stored.
!*/
Object Attribute $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$AttrRef"
EndBody
EndObject
Object HistServerObject $Attribute 3
!/**
! DsHistThread object that specifies the storage scantime
! and in which server the data is stored.
!*/
Object ThreadObject $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
Attr Flags |= PWR_MASK_ARRAY
Attr Elements = 3
EndBody
EndObject
!/**
! The attribute is intended for use in the future.
! Time the data will be stored in the database.
! Data that is older than this time will be removed from
! the database by a garbage collector.
!*/
Object DeadBand $Attribute 4
Object StorageTime $Attribute 4
Body SysBody
Attr TypeRef = "pwrs:Type-$DeltaTime"
EndBody
EndObject
!/**
! Not yet implemented.
!*/
Object DeadBand $Attribute 5
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
......@@ -99,5 +115,20 @@ SObject pwrb:Class
Attr MethodName = "DsHist-PostMove"
EndBody
EndObject
Object ConfiguratorPoson $Menu
Object Pointed $Menu
Object ConnectThread $MenuButton
Body SysBody
Attr ButtonName = "Connect DsHistThread"
Attr MethodName = "$Objid-Connect"
Attr MethodArguments[0] = "ThreadObject"
Attr MethodArguments[1] = "DsHistThread"
Attr FilterName = "$Objid-IsOkConnect"
Attr FilterArguments[0] = "ThreadObject"
Attr FilterArguments[1] = "DsHistThread"
EndBody
EndObject
EndObject
EndObject
EndObject
EndSObject
!
! Proview $Id: pwrb_c_dshistmonitor.wb_load,v 1.1 2008-07-17 11:37:57 claes Exp $
! Copyright (C) 2005 SSAB Oxelsund AB.
!
! 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 the program, if not, write to the Free Software
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!
! pwrb_c_dshistmonitor.wb_load -- Defines the class DsHistMonitor.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Group Servers,NodeConfiguration
! Configures the DsHist monitor process.
!
! The DsHist monitor process keeps track of all DsHist objects
! in the current node. The process is divided into threads that
! collect data with a specific scantime and sends to the specified
! database server. The threads are specified by DsHistThread objects
! that reside under the DsHistMonitor object in the node hierarchy.
!
! @b See also
! @classlink DsHistThread pwrb_dshistthread.html
! @classlink DsHist pwrb_dshist.html
! @classlink DsHistServer pwrb_dshistserver.html
!*/
Object DsHistMonitor $ClassDef 534
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Standard
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "DsHistMonitor"
EndBody
!/**
! Optional description.
!*/
Object Description $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
EndObject
Object PostCreate $DbCallBack
Body SysBody
Attr MethodName = "DsHistMonitor-PostCreate"
EndBody
EndObject
EndObject
EndSObject
!
! Proview $Id: pwrb_c_dshistserver.wb_load,v 1.4 2005-09-01 14:58:01 claes Exp $
! Proview $Id: pwrb_c_dshistserver.wb_load,v 1.5 2008-07-17 11:36:41 claes Exp $
! Copyright (C) 2005 SSAB Oxelösund AB.
!
! This program is free software; you can redistribute it and/or
......@@ -16,39 +16,29 @@
! along with the program, if not, write to the Free Software
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!
! pwrb_c_dshistserver.wb_load -- Defines the class DsHistServer.
! pwrb_c_dshistmonitor.wb_load -- Defines the class DsHistMonitor.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Group Servers,NodeConfiguration
! Configures the server for historical data storage. (Datasto
! History Server).
! Configures the DsHist server process.
!
! Historical data storage is an option in PROVIEW/R.
! Data storage is done in a relational database, Rdb. The
! relations are supposed to be created and named on
! delivery of the option. The number of relations are
! default 4.
! Configures the server process for historical data storage.
!
! DsHistServer is configured in the development
! environment below the $Node object which represents the
! node where the Rdb storage will be done. This node will
! be referred to as the 'historical storage node'.
! In the 'historical storage node', subscriptions to
! quantities that will be included in the storage, are
! automatically set up. Data, to form an average, are
! stored in a local buffer at each storage time and an
! aritmethical average will be calculated before storage.
! Quantities which are included in the historical
! storage, but whose values are not accessible (there may
! be time-out in the subscription e.g.) will be stored as
! null characters.
! This object is used when the server is started on a node with
! the runtime environment started.
! The the server can also be started without the runtime
! environment, but with the storage environment (Sev) installed.
! See the documentation for the storage environment on how to
! start the server in this case.
!
! See Also
! DsHist,
! @b See also
! @classlink DsHistThread pwrb_dshistthread.html
! @classlink DsHistMonitor pwrb_dshistmonitor.html
! @classlink DsHist pwrb_dshist.html
!*/
Object DsHistServer $ClassDef 107
Object DsHistServer $ClassDef 535
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Standard
......@@ -57,82 +47,14 @@ SObject pwrb:Class
Body SysBody
Attr StructName = "DsHistServer"
EndBody
Object Description $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!/**
! Specifies the name of a relation in Rdb. A relation
! consist of one row to each storage time with up to 1500
! data columns.
! The attribute is case sensitive i.e. if the relation is
! named HistoricRelation_1 it has to be written
! HistoricRelation_1 and not historicrelation_1,for
! example.
!*/
Object Table $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$String40"
EndBody
EndObject
!/**
! Specifies, in seconds, the time between two storages in
! the relation. The attribute has to be an integer
! multiple of ScanTime; se below.
!*/
Object StoreInterval $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
!/**
! Specifies, in seconds, the time between two samples.
! The minimum allowed value is 10 seconds.
!
! If StoreInterval = ScanTime latest sample will be
! stored.
! If StoreInterval > ScanTime storage according to
! FilterFunction will be done.
! Optional description.
!*/
Object ScanTime $Attribute 4
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
!/**
! Specifies, in days, how long data will be saved in Rdb.
! Rdb is on delivery created to hold a certain number of
! samples of the data quantities. The following
! expression will be satisfied,
!
! StoreTime <= "maximum number of samples" * StoreInterval
!*/
Object StoreTime $Attribute 5
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt32"
EndBody
EndObject
!/**
! Specifies how a sample will be handled before storage.
! The following alternatives exist:
! -- At storage the latest sample of the quantity will
! -- At storage the arithmetical average of the quantity
! will be used.
!*/
Object FilterFunction $Attribute 6
Object Description $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$UInt16"
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
EndObject
Object Template DsHistServer
Body RtBody
Attr ScanTime = 10
Attr StoreInterval = 10
Attr StoreTime = 2
Attr FilterFunction = 0
EndBody
EndObject
EndObject
EndSObject
!
! Proview $Id: pwrb_c_dshistthread.wb_load,v 1.1 2008-07-17 11:37:57 claes Exp $
! Copyright (C) 2005 SSAB Oxelsund AB.
!
! 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 the program, if not, write to the Free Software
! Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
!
! pwrb_c_dshistthread.wb_load -- Defines the class DsHistThread.
!
SObject pwrb:Class
!/**
! @Version 1.0
! @Group Servers,NodeConfiguration
! Configures a thread in the DsHist monitor process, with a
! specific scantime and database server node.
!
! The DsHist monitor process keeps track of all DsHist objects
! in the current node. The process is divided into threads that
! collect data with a specific scantime and sends to the specified
! database server. The threads are specified by DsHistThread objects
! that reside under the DsHistMonitor object in the node hierarchy.
!
! @b See also
! @classlink DsHist pwrb_dshist.html
! @classlink DsHistMonitor pwrb_dshistmonitor.html
! @classlink DsHistServer pwrb_dshistserver.html
!*/
Object DsHistThread $ClassDef 107
Body SysBody
Attr Editor = pwr_eEditor_AttrEd
Attr Method = pwr_eMethod_Standard
EndBody
Object RtBody $ObjBodyDef 1
Body SysBody
Attr StructName = "DsHistThread"
EndBody
!/**
! Optional description.
!*/
Object Description $Attribute 1
Body SysBody
Attr TypeRef = "pwrs:Type-$String80"
EndBody
EndObject
!/**
! The name of the node where the data is stored.
! The DsHistServer has to be started on this node.
!*/
Object ServerNode $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$String40"
EndBody
EndObject
!/**
! Specifies, in seconds, the time between two samples.
! The minimum allowed value is 1 seconds.
!*/
Object ScanTime $Attribute 3
Body SysBody
Attr TypeRef = "pwrs:Type-$Float32"
EndBody
EndObject
EndObject
Object Template DsHistThread
Body RtBody
Attr ScanTime = 10
EndBody
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