Commit 2d4da514 authored by claes's avatar claes

Merge branch 'master' of 62.20.65.89:/data1/git/pwr

parents 3730cde8 43ada11f
......@@ -1469,7 +1469,10 @@ int sev_dbms::get_values( pwr_tStatus *sts, pwr_tOid oid, pwr_tMask options, flo
*sts = SEV__DBERROR;
return 0;
}
if ( starttime && endtime) {
if ( item.options & pwr_mSevOptionsMask_Event) {
total_rows = atoi(row[4]);
}
else if ( starttime && endtime) {
pwr_tTime update_time;
if ( row[12])
timestr_to_time( row[12], &update_time);
......@@ -3173,7 +3176,10 @@ int sev_dbms::get_objectvalues( pwr_tStatus *sts, sev_item *item,
*sts = SEV__DBERROR;
return 0;
}
if ( starttime && endtime) {
if ( item->options & pwr_mSevOptionsMask_Event) {
total_rows = atoi(row[4]);
}
else if ( starttime && endtime) {
pwr_tTime update_time;
if ( row[12])
timestr_to_time( row[12], &update_time);
......@@ -3352,9 +3358,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 +3365,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 +3373,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 +3539,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)
m_hs[i].sevhistobjectlist[j].hsp->Trigger = 0;
else
continue;
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;
......
......@@ -403,6 +403,11 @@ int sevcli_get_itemdata( pwr_tStatus *sts, sevcli_tCtx ctx, pwr_tOid oid,
qcom_Free( &lsts, rmsg);
return 0;
}
if( rmsg->NumPoints == 0 ) {
qcom_Free( sts, rmsg);
*sts = SEV__NOPOINTS;
return 0;
}
int item_cnt = rmsg->NumPoints;
......@@ -505,7 +510,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
......
......@@ -96,11 +96,23 @@ XttSevHist::XttSevHist( void *parent_ctx,
time_Period( time_ePeriod_OneHour, &from, &to, 0, 0);
if ( oid_cnt == 1) {
get_data( sts, from, to);
if ( EVEN(*sts)) return;
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 ( EVEN(*sts)) return;
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);
}
......
......@@ -3729,7 +3729,7 @@ static int xnav_open_func( void *client_data,
sts = gdh_GetObjectClass( coid, &cid);
if ( EVEN(sts)) return sts;
if ( cid != pwr_cClass_SevHist)
if ( !(cid == pwr_cClass_SevHist || cid == pwr_cClass_SevHistObject))
continue;
sts = gdh_ObjidToName( coid, cname[idx], sizeof(cname[0]), cdh_mName_object);
......
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