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

Sev database hdf5 work

parent 59d96e50
......@@ -62,6 +62,7 @@
using namespace std;
#define ITER_MAX 50
#define cName_Dir "/Dir"
#define cName_Stat "/Stat"
#define cName_Items "/Items"
......@@ -2194,6 +2195,9 @@ int sev_dbhdf5::store_value( pwr_tStatus *sts, int item_idx, int attr_idx,
strcat( dname, cName_Header);
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,
&header);
......@@ -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,
&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( "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
break;
}
default:
*sts = SEV__UNKNOWNTYPE;
return 0;
}
......@@ -4754,7 +4763,7 @@ int sev_dbhdf5::time_to_idx( hid_t dataset_id, hid_t memspace_id, hid_t dataspac
int idx;
(*iter)++;
if ( *iter > 50)
if ( *iter > ITER_MAX)
return 0;
if ( high_idx < low_idx)
......
......@@ -105,8 +105,8 @@ int rt_sevhistmon::init()
m_confp->Status = m_server_status = PWR__SRVSTARTUP;
m_scantime = m_confp->ScanTime;
if ( m_scantime < 0.02)
m_scantime = 0.02;
if ( m_scantime < 0.01)
m_scantime = 0.01;
// Create a queue to server
qcom_sQattr attr;
......
......@@ -51,6 +51,9 @@ repair_failed <Repair failed> /error
nyi <Not yet implemented> /error
nopoints <No points found in this interval> /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
......
......@@ -779,6 +779,11 @@ void XttSevHist::sevhist_reload_cb( void *ctx)
else
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_high_old = 0;
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