Commit 60dd39e9 authored by Claes Sjofors's avatar Claes Sjofors

SevHist, Disable attribute added

parent d4812243
...@@ -213,6 +213,7 @@ int rt_sevhistmon::init_objects() ...@@ -213,6 +213,7 @@ int rt_sevhistmon::init_objects()
h.storagetime = h_p->StorageTime; h.storagetime = h_p->StorageTime;
h.deadband = h_p->DeadBand; h.deadband = h_p->DeadBand;
h.options = h_p->Options; h.options = h_p->Options;
h.disabled = h_p->Disable;
strncpy( h.description, h_p->Description, sizeof(h.description)); strncpy( h.description, h_p->Description, sizeof(h.description));
// Get unit from attribute object // Get unit from attribute object
...@@ -298,6 +299,7 @@ int rt_sevhistmon::init_sevhistobjects() ...@@ -298,6 +299,7 @@ int rt_sevhistmon::init_sevhistobjects()
h.storagetime = h_p->StorageTime; h.storagetime = h_p->StorageTime;
h.deadband = h_p->DeadBand; h.deadband = h_p->DeadBand;
h.options = h_p->Options; h.options = h_p->Options;
h.disabled = h_p->Disable;
strncpy( h.description, h_p->Description, sizeof(h.description)); strncpy( h.description, h_p->Description, sizeof(h.description));
h.scantime = m_hs[hs_idx].scantime; h.scantime = m_hs[hs_idx].scantime;
...@@ -618,12 +620,14 @@ int rt_sevhistmon::send_data() ...@@ -618,12 +620,14 @@ int rt_sevhistmon::send_data()
dp = (sev_sHistData *) &msg->Data; dp = (sev_sHistData *) &msg->Data;
for ( unsigned int j = 0; j < m_hs[i].sevhistlist.size(); j++) { for ( unsigned int j = 0; j < m_hs[i].sevhistlist.size(); j++) {
if ( !m_hs[i].sevhistlist[j].disabled) {
dp->sevid = m_hs[i].sevhistlist[j].sevid; dp->sevid = m_hs[i].sevhistlist[j].sevid;
dp->type = m_hs[i].sevhistlist[j].type; dp->type = m_hs[i].sevhistlist[j].type;
dp->size = m_hs[i].sevhistlist[j].size; dp->size = m_hs[i].sevhistlist[j].size;
memcpy( &dp->data, m_hs[i].sevhistlist[j].datap, dp->size); memcpy( &dp->data, m_hs[i].sevhistlist[j].datap, dp->size);
dp = (sev_sHistData *)((char *)dp + sizeof( *dp) - sizeof(dp->data) + dp->size); dp = (sev_sHistData *)((char *)dp + sizeof( *dp) - sizeof(dp->data) + dp->size);
} }
}
void *dpp; void *dpp;
for ( unsigned int j = 0; j < m_hs[i].sevhistobjectlist.size(); j++) { for ( unsigned int j = 0; j < m_hs[i].sevhistobjectlist.size(); j++) {
...@@ -631,6 +635,7 @@ int rt_sevhistmon::send_data() ...@@ -631,6 +635,7 @@ int rt_sevhistmon::send_data()
dp->size = m_hs[i].sevhistobjectlist[j].datasize; dp->size = m_hs[i].sevhistobjectlist[j].datasize;
dpp = &(dp->data); dpp = &(dp->data);
for ( unsigned int k = 0; k < m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist.size(); k++) { for ( unsigned int k = 0; k < m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist.size(); k++) {
if ( !m_hs[i].sevhistobjectlist[j].disabled) {
//dp->type = m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist[k].type; //dp->type = m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist[k].type;
//printf("sevhistobj[%d].attrlist[%d].aname: %s size:%d\n", j, k, m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist[k].aname, m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist[k].size); //printf("sevhistobj[%d].attrlist[%d].aname: %s size:%d\n", j, k, m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist[k].aname, m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist[k].size);
//if( m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist[k].type == pwr_eType_String ) { //if( m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist[k].type == pwr_eType_String ) {
...@@ -639,6 +644,7 @@ int rt_sevhistmon::send_data() ...@@ -639,6 +644,7 @@ int rt_sevhistmon::send_data()
memcpy( dpp, m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist[k].datap, m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist[k].size); memcpy( dpp, m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist[k].datap, m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist[k].size);
dpp = (sev_sHistData *)((char *)dpp + m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist[k].size); dpp = (sev_sHistData *)((char *)dpp + m_hs[i].sevhistobjectlist[j].sevhistobjectattrlist[k].size);
} }
}
dp = (sev_sHistData *)((char *)dp + sizeof( *dp) - sizeof(dp->data) + dp->size); dp = (sev_sHistData *)((char *)dp + sizeof( *dp) - sizeof(dp->data) + dp->size);
} }
......
...@@ -40,6 +40,7 @@ class sev_sevhist { ...@@ -40,6 +40,7 @@ class sev_sevhist {
pwr_tString80 description; pwr_tString80 description;
pwr_tString16 unit; pwr_tString16 unit;
pwr_tFloat32 scantime; pwr_tFloat32 scantime;
pwr_tBoolean disabled;
}; };
class sev_sevhistobjectattr { class sev_sevhistobjectattr {
...@@ -65,6 +66,7 @@ class sev_sevhistobject { ...@@ -65,6 +66,7 @@ class sev_sevhistobject {
pwr_tString80 description; pwr_tString80 description;
pwr_tFloat32 scantime; pwr_tFloat32 scantime;
unsigned int datasize; unsigned int datasize;
pwr_tBoolean disabled;
vector<sev_sevhistobjectattr> sevhistobjectattrlist; vector<sev_sevhistobjectattr> sevhistobjectattrlist;
}; };
......
...@@ -113,6 +113,14 @@ SObject pwrb:Class ...@@ -113,6 +113,14 @@ SObject pwrb:Class
Attr TypeRef = "pwrb:Type-SevHistOptionsMask" Attr TypeRef = "pwrb:Type-SevHistOptionsMask"
EndBody EndBody
EndObject EndObject
!/**
! Disable storage.
!*/
Object Disable $Attribute 7
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
EndObject EndObject
Object Template SevHist Object Template SevHist
Body RtBody Body RtBody
......
...@@ -108,6 +108,14 @@ SObject pwrb:Class ...@@ -108,6 +108,14 @@ SObject pwrb:Class
Attr TypeRef = "pwrb:Type-SevHistOptionsMask" Attr TypeRef = "pwrb:Type-SevHistOptionsMask"
EndBody EndBody
EndObject EndObject
!/**
! Disable storage.
!*/
Object Disable $Attribute 7
Body SysBody
Attr TypeRef = "pwrs:Type-$Boolean"
EndBody
EndObject
EndObject EndObject
Object Template SevHistObject Object Template SevHistObject
Body RtBody Body RtBody
......
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