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 ...@@ -1469,7 +1469,10 @@ int sev_dbms::get_values( pwr_tStatus *sts, pwr_tOid oid, pwr_tMask options, flo
*sts = SEV__DBERROR; *sts = SEV__DBERROR;
return 0; return 0;
} }
if ( starttime && endtime) { if ( item.options & pwr_mSevOptionsMask_Event) {
total_rows = atoi(row[4]);
}
else if ( starttime && endtime) {
pwr_tTime update_time; pwr_tTime update_time;
if ( row[12]) if ( row[12])
timestr_to_time( row[12], &update_time); timestr_to_time( row[12], &update_time);
...@@ -3173,7 +3176,10 @@ int sev_dbms::get_objectvalues( pwr_tStatus *sts, sev_item *item, ...@@ -3173,7 +3176,10 @@ int sev_dbms::get_objectvalues( pwr_tStatus *sts, sev_item *item,
*sts = SEV__DBERROR; *sts = SEV__DBERROR;
return 0; return 0;
} }
if ( starttime && endtime) { if ( item->options & pwr_mSevOptionsMask_Event) {
total_rows = atoi(row[4]);
}
else if ( starttime && endtime) {
pwr_tTime update_time; pwr_tTime update_time;
if ( row[12]) if ( row[12])
timestr_to_time( row[12], &update_time); timestr_to_time( row[12], &update_time);
...@@ -3352,9 +3358,6 @@ int sev_dbms::get_objectvalues( pwr_tStatus *sts, sev_item *item, ...@@ -3352,9 +3358,6 @@ int sev_dbms::get_objectvalues( pwr_tStatus *sts, sev_item *item,
queryStr.append(" order by "); queryStr.append(" order by ");
queryStr.append(orderby_part); 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()); rc = mysql_query( m_env->con(), queryStr.c_str());
if (rc) { if (rc) {
printf("In %s row %d:\n", __FILE__, __LINE__); printf("In %s row %d:\n", __FILE__, __LINE__);
...@@ -3362,7 +3365,6 @@ int sev_dbms::get_objectvalues( pwr_tStatus *sts, sev_item *item, ...@@ -3362,7 +3365,6 @@ int sev_dbms::get_objectvalues( pwr_tStatus *sts, sev_item *item,
*sts = SEV__DBERROR; *sts = SEV__DBERROR;
return 0; return 0;
} }
errh_Info("After query in get_objectvalues");
result = mysql_store_result( m_env->con()); result = mysql_store_result( m_env->con());
if ( !result) { if ( !result) {
...@@ -3371,7 +3373,6 @@ int sev_dbms::get_objectvalues( pwr_tStatus *sts, sev_item *item, ...@@ -3371,7 +3373,6 @@ int sev_dbms::get_objectvalues( pwr_tStatus *sts, sev_item *item,
*sts = SEV__DBERROR; *sts = SEV__DBERROR;
return 0; return 0;
} }
errh_Info("After store result in get_objectvalues");
int rows = mysql_num_rows( result); int rows = mysql_num_rows( result);
int bufrows = rows; int bufrows = rows;
...@@ -3538,7 +3539,6 @@ int sev_dbms::get_objectvalues( pwr_tStatus *sts, sev_item *item, ...@@ -3538,7 +3539,6 @@ int sev_dbms::get_objectvalues( pwr_tStatus *sts, sev_item *item,
*bsize = bcnt; *bsize = bcnt;
mysql_free_result( result); mysql_free_result( result);
} }
errh_Info("After copying values in get_objectvalues");
*sts = SEV__SUCCESS; *sts = SEV__SUCCESS;
return 1; return 1;
......
...@@ -691,11 +691,12 @@ int rt_sevhistmon::send_data() ...@@ -691,11 +691,12 @@ int rt_sevhistmon::send_data()
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++) {
if ( !m_hs[i].sevhistobjectlist[j].hsp->Disable) { if ( !m_hs[i].sevhistobjectlist[j].hsp->Disable) {
if ( m_hs[i].sevhistobjectlist[j].hsp->Options & pwr_mSevOptionsMask_Event && 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->Trigger)
m_hs[i].sevhistobjectlist[j].hsp->Trigger = 0; m_hs[i].sevhistobjectlist[j].hsp->Trigger = 0;
else else
continue; continue;
}
dp->sevid = m_hs[i].sevhistobjectlist[j].sevid; dp->sevid = m_hs[i].sevhistobjectlist[j].sevid;
dp->size = m_hs[i].sevhistobjectlist[j].datasize; 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, ...@@ -403,6 +403,11 @@ int sevcli_get_itemdata( pwr_tStatus *sts, sevcli_tCtx ctx, pwr_tOid oid,
qcom_Free( &lsts, rmsg); qcom_Free( &lsts, rmsg);
return 0; return 0;
} }
if( rmsg->NumPoints == 0 ) {
qcom_Free( sts, rmsg);
*sts = SEV__NOPOINTS;
return 0;
}
int item_cnt = rmsg->NumPoints; int item_cnt = rmsg->NumPoints;
...@@ -505,7 +510,7 @@ int sevcli_get_objectitemdata( pwr_tStatus *sts, sevcli_tCtx ctx, pwr_tOid oid, ...@@ -505,7 +510,7 @@ int sevcli_get_objectitemdata( pwr_tStatus *sts, sevcli_tCtx ctx, pwr_tOid oid,
} }
if( rmsg->NumPoints == 0 ) { if( rmsg->NumPoints == 0 ) {
qcom_Free( sts, rmsg); qcom_Free( sts, rmsg);
*sts = 0; *sts = SEV__NOPOINTS;
return 0; return 0;
} }
......
...@@ -49,6 +49,7 @@ init <Initialization done> /info ...@@ -49,6 +49,7 @@ init <Initialization done> /info
exportfile <Unable to open export file> /error exportfile <Unable to open export file> /error
repair_failed <Repair failed> /error repair_failed <Repair failed> /error
nyi <Not yet implemented> /error nyi <Not yet implemented> /error
nopoints <No points found in this interval> /error
.end .end
......
...@@ -96,11 +96,23 @@ XttSevHist::XttSevHist( void *parent_ctx, ...@@ -96,11 +96,23 @@ XttSevHist::XttSevHist( void *parent_ctx,
time_Period( time_ePeriod_OneHour, &from, &to, 0, 0); time_Period( time_ePeriod_OneHour, &from, &to, 0, 0);
if ( oid_cnt == 1) { if ( oid_cnt == 1) {
get_data( sts, from, to); 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 { else {
get_multidata( sts, from, to); 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); cdh_StrncpyCutOff( title, name, sizeof(title), 1);
} }
......
...@@ -3729,7 +3729,7 @@ static int xnav_open_func( void *client_data, ...@@ -3729,7 +3729,7 @@ static int xnav_open_func( void *client_data,
sts = gdh_GetObjectClass( coid, &cid); sts = gdh_GetObjectClass( coid, &cid);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
if ( cid != pwr_cClass_SevHist) if ( !(cid == pwr_cClass_SevHist || cid == pwr_cClass_SevHistObject))
continue; continue;
sts = gdh_ObjidToName( coid, cname[idx], sizeof(cname[0]), cdh_mName_object); 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