Commit 9fd2a1f5 authored by Claes Sjofors's avatar Claes Sjofors

Sev database hdf5 work

parent 59d96e50
...@@ -62,6 +62,7 @@ ...@@ -62,6 +62,7 @@
using namespace std; using namespace std;
#define ITER_MAX 50
#define cName_Dir "/Dir" #define cName_Dir "/Dir"
#define cName_Stat "/Stat" #define cName_Stat "/Stat"
#define cName_Items "/Items" #define cName_Items "/Items"
...@@ -2194,6 +2195,9 @@ int sev_dbhdf5::store_value( pwr_tStatus *sts, int item_idx, int attr_idx, ...@@ -2194,6 +2195,9 @@ int sev_dbhdf5::store_value( pwr_tStatus *sts, int item_idx, int attr_idx,
strcat( dname, cName_Header); strcat( dname, cName_Header);
hid_t dataset_id = H5Dopen2( m_file, dname, H5P_DEFAULT); hid_t dataset_id = H5Dopen2( m_file, dname, H5P_DEFAULT);
if ( dataset_id == -1)
return SEV__NOSUCHTABLE;
hsts = H5Dread( dataset_id, m_header_mtype, H5S_ALL, H5S_ALL, H5P_DEFAULT, hsts = H5Dread( dataset_id, m_header_mtype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
&header); &header);
...@@ -2816,6 +2820,10 @@ int sev_dbhdf5::get_values( pwr_tStatus *sts, pwr_tOid oid, pwr_tMask options, f ...@@ -2816,6 +2820,10 @@ int sev_dbhdf5::get_values( pwr_tStatus *sts, pwr_tOid oid, pwr_tMask options, f
header.first_idx, header.last_idx, first_time, header.last_time, res, 0, header.first_idx, header.last_idx, first_time, header.last_time, res, 0,
&from_iter, &from_idx); &from_iter, &from_idx);
} }
if ( from_iter == ITER_MAX + 1 || to_iter == ITER_MAX + 1) {
*sts = SEV__RANGE;
return 0;
}
printf( "first time %d, last time %d res %d\n", first_time, header.last_time, res); printf( "first time %d, last time %d res %d\n", first_time, header.last_time, res);
printf( "from idx %d, to idx %d, iter %d %d\n", from_idx, to_idx, from_iter, to_iter); printf( "from idx %d, to idx %d, iter %d %d\n", from_idx, to_idx, from_iter, to_iter);
...@@ -3462,6 +3470,7 @@ int sev_dbhdf5::get_values( pwr_tStatus *sts, pwr_tOid oid, pwr_tMask options, f ...@@ -3462,6 +3470,7 @@ int sev_dbhdf5::get_values( pwr_tStatus *sts, pwr_tOid oid, pwr_tMask options, f
break; break;
} }
default: default:
*sts = SEV__UNKNOWNTYPE;
return 0; return 0;
} }
...@@ -4754,7 +4763,7 @@ int sev_dbhdf5::time_to_idx( hid_t dataset_id, hid_t memspace_id, hid_t dataspac ...@@ -4754,7 +4763,7 @@ int sev_dbhdf5::time_to_idx( hid_t dataset_id, hid_t memspace_id, hid_t dataspac
int idx; int idx;
(*iter)++; (*iter)++;
if ( *iter > 50) if ( *iter > ITER_MAX)
return 0; return 0;
if ( high_idx < low_idx) if ( high_idx < low_idx)
......
...@@ -105,8 +105,8 @@ int rt_sevhistmon::init() ...@@ -105,8 +105,8 @@ int rt_sevhistmon::init()
m_confp->Status = m_server_status = PWR__SRVSTARTUP; m_confp->Status = m_server_status = PWR__SRVSTARTUP;
m_scantime = m_confp->ScanTime; m_scantime = m_confp->ScanTime;
if ( m_scantime < 0.02) if ( m_scantime < 0.01)
m_scantime = 0.02; m_scantime = 0.01;
// Create a queue to server // Create a queue to server
qcom_sQattr attr; qcom_sQattr attr;
......
...@@ -51,6 +51,9 @@ repair_failed <Repair failed> /error ...@@ -51,6 +51,9 @@ repair_failed <Repair failed> /error
nyi <Not yet implemented> /error nyi <Not yet implemented> /error
nopoints <No points found in this interval> /error nopoints <No points found in this interval> /error
nosuchattr <No such attribute exist> /error nosuchattr <No such attribute exist> /error
range <Unable to get range> /error
unknowntype <Unknown data type> /error
nosuchtable <Table doesn't exist> /error
.end .end
......
...@@ -779,6 +779,11 @@ void XttSevHist::sevhist_reload_cb( void *ctx) ...@@ -779,6 +779,11 @@ void XttSevHist::sevhist_reload_cb( void *ctx)
else else
sevhist->get_multidata( &sts, t_low, t_high); sevhist->get_multidata( &sts, t_low, t_high);
if ( EVEN(sts)) {
sevhist->wow->DisplayError( "Data error", XNav::get_message(sts));
return;
}
sevhist->time_low_old = 0; sevhist->time_low_old = 0;
sevhist->time_high_old = 0; sevhist->time_high_old = 0;
sevhist->curve->set_center_from_window( 1); sevhist->curve->set_center_from_window( 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