Commit 3b16f97a authored by Claes Sjofors's avatar Claes Sjofors

Sev bugfix, sevobjects without event-bit didn't work

parent 5386692a
......@@ -3352,9 +3352,6 @@ int sev_dbms::get_objectvalues( pwr_tStatus *sts, sev_item *item,
queryStr.append(" order by ");
queryStr.append(orderby_part);
errh_Info("Before query in get_objectvalues");
printf("%s: %s\n", __FUNCTION__, queryStr.c_str());
rc = mysql_query( m_env->con(), queryStr.c_str());
if (rc) {
printf("In %s row %d:\n", __FILE__, __LINE__);
......@@ -3362,7 +3359,6 @@ int sev_dbms::get_objectvalues( pwr_tStatus *sts, sev_item *item,
*sts = SEV__DBERROR;
return 0;
}
errh_Info("After query in get_objectvalues");
result = mysql_store_result( m_env->con());
if ( !result) {
......@@ -3371,7 +3367,6 @@ int sev_dbms::get_objectvalues( pwr_tStatus *sts, sev_item *item,
*sts = SEV__DBERROR;
return 0;
}
errh_Info("After store result in get_objectvalues");
int rows = mysql_num_rows( result);
int bufrows = rows;
......@@ -3538,7 +3533,6 @@ int sev_dbms::get_objectvalues( pwr_tStatus *sts, sev_item *item,
*bsize = bcnt;
mysql_free_result( result);
}
errh_Info("After copying values in get_objectvalues");
*sts = SEV__SUCCESS;
return 1;
......
......@@ -691,11 +691,12 @@ int rt_sevhistmon::send_data()
void *dpp;
for ( unsigned int j = 0; j < m_hs[i].sevhistobjectlist.size(); j++) {
if ( !m_hs[i].sevhistobjectlist[j].hsp->Disable) {
if ( m_hs[i].sevhistobjectlist[j].hsp->Options & pwr_mSevOptionsMask_Event &&
m_hs[i].sevhistobjectlist[j].hsp->Trigger)
if ( m_hs[i].sevhistobjectlist[j].hsp->Options & pwr_mSevOptionsMask_Event) {
if ( m_hs[i].sevhistobjectlist[j].hsp->Trigger)
m_hs[i].sevhistobjectlist[j].hsp->Trigger = 0;
else
continue;
}
dp->sevid = m_hs[i].sevhistobjectlist[j].sevid;
dp->size = m_hs[i].sevhistobjectlist[j].datasize;
......
......@@ -505,7 +505,7 @@ int sevcli_get_objectitemdata( pwr_tStatus *sts, sevcli_tCtx ctx, pwr_tOid oid,
}
if( rmsg->NumPoints == 0 ) {
qcom_Free( sts, rmsg);
*sts = 0;
*sts = SEV__NOPOINTS;
return 0;
}
......
......@@ -49,6 +49,7 @@ init <Initialization done> /info
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
.end
......
......@@ -95,13 +95,25 @@ XttSevHist::XttSevHist( void *parent_ctx,
time_Period( time_ePeriod_OneHour, &from, &to, 0, 0);
if ( oid_cnt == 1) {
get_data( sts, from, to);
if ( *sts == SEV__NOPOINTS) {
// Try month
time_Period( time_ePeriod_OneMonth, &from, &to, 0, 0);
get_data( sts, from, to);
if ( EVEN(*sts)) return;
}
else if ( EVEN(*sts)) return;
}
else {
get_multidata( sts, from, to);
if ( *sts == SEV__NOPOINTS) {
// Try month
time_Period( time_ePeriod_OneMonth, &from, &to, 0, 0);
get_multidata( sts, from, to);
if ( EVEN(*sts)) return;
}
else if ( EVEN(*sts)) return;
}
cdh_StrncpyCutOff( title, name, sizeof(title), 1);
}
......
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