Commit c0f6cdea authored by Claes Sjofors's avatar Claes Sjofors

Sev, rtdb with sev tree distribution and build, server read threads

parent 94746644
......@@ -35,6 +35,7 @@
**/
#include <math.h>
#include <pthread.h>
#include "pwr.h"
#include "co_cdh.h"
......@@ -464,10 +465,6 @@ int sev_server::mainloop()
m_config->Stat.MediumLoad = m_stat.medium_load;
m_config->Stat.StorageRate = m_stat.storage_rate;
m_config->Stat.MediumStorageRate = m_stat.medium_storage_rate;
m_config->Stat.DataStoreMsgCnt = m_stat.datastore_msg_cnt;
m_config->Stat.DataGetMsgCnt = m_stat.dataget_msg_cnt;
m_config->Stat.ItemsMsgCnt = m_stat.items_msg_cnt;
m_config->Stat.EventStoreMsgCnt = m_stat.eventstore_msg_cnt;
}
time_Aadd( &next_stat, &next_stat, &stat_interval);
busy = pwr_cNDeltaTime;
......@@ -499,7 +496,8 @@ int sev_server::mainloop()
case sev_eMsgType_HistDataGetRequest:
send_histdata( get.reply, (sev_sMsgHistDataGetRequest *) mp, get.size);
m_stat.dataget_msg_cnt++;
break;
// Don't free the message now
continue;
case sev_eMsgType_HistItemsRequest:
send_itemlist( get.reply);
break;
......@@ -535,6 +533,13 @@ int sev_server::mainloop()
}
qcom_Free( &sts, mp);
if ( m_config) {
m_config->Stat.DataStoreMsgCnt = m_stat.datastore_msg_cnt;
m_config->Stat.DataGetMsgCnt = m_stat.dataget_msg_cnt;
m_config->Stat.ItemsMsgCnt = m_stat.items_msg_cnt;
m_config->Stat.EventStoreMsgCnt = m_stat.eventstore_msg_cnt;
}
}
}
......@@ -789,6 +794,28 @@ int sev_server::receive_histdata( sev_sMsgHistDataStore *msg, unsigned int size)
}
int sev_server::send_histdata( qcom_sQid tgt, sev_sMsgHistDataGetRequest *rmsg, unsigned int size)
{
pthread_t thread;
int sts;
sev_sHistDataThread *arg = (sev_sHistDataThread *) malloc( sizeof(*arg));
arg->sev = this;
arg->tgt = tgt;
arg->rmsg = rmsg;
arg->size = size;
if ( m_read_threads) {
sts = pthread_create( &thread, NULL, send_histdata_thread, arg);
if ( sts != 0)
printf( "pthread_create error %d\n", sts);
}
else {
send_histdata_thread( arg);
}
return 1;
}
void *sev_server::send_histdata_thread( void *arg)
{
pwr_tTime *tbuf;
void *vbuf;
......@@ -798,28 +825,37 @@ int sev_server::send_histdata( qcom_sQid tgt, sev_sMsgHistDataGetRequest *rmsg,
qcom_sPut put;
pwr_tStatus sts, lsts;
pwr_tTime starttime, endtime;
unsigned int item_idx;
sev_server *sev = ((sev_sHistDataThread *)arg)->sev;
qcom_sQid tgt = ((sev_sHistDataThread *)arg)->tgt;
sev_sMsgHistDataGetRequest *rmsg = ((sev_sHistDataThread *)arg)->rmsg;
free( arg);
starttime = net_NetTimeToTime( &rmsg->StartTime);
endtime = net_NetTimeToTime( &rmsg->EndTime);
sev_item item;
m_db->get_item(&m_sts, &item, rmsg->Oid, rmsg->AName);
if(ODD(m_sts)) {
m_db->get_values( &m_sts, rmsg->Oid, item.options, item.deadband,
rmsg->AName, item.attr[0].type, item.attr[0].size,
item.scantime, &item.creatime,
&starttime, &endtime, rmsg->NumPoints, &tbuf, &vbuf, &rows);
}
if ( ODD(m_sts) && rows != 0)
msize = rows * ( sizeof(pwr_tTime) + item.attr[0].size) + sizeof(*msg) - sizeof(msg->Data);
sev->m_db->get_item_idx(&sts, &item_idx, rmsg->Oid, rmsg->AName);
if ( EVEN(sts)) return (void *) 1;
sev->m_db->get_values( &sts, rmsg->Oid, sev->m_db->m_items[item_idx].options,
sev->m_db->m_items[item_idx].deadband,
rmsg->AName, sev->m_db->m_items[item_idx].attr[0].type,
sev->m_db->m_items[item_idx].attr[0].size,
sev->m_db->m_items[item_idx].scantime, &sev->m_db->m_items[item_idx].creatime,
&starttime, &endtime, rmsg->NumPoints, &tbuf, &vbuf, &rows);
if ( ODD(sts) && rows != 0)
msize = rows * ( sizeof(pwr_tTime) + sev->m_db->m_items[item_idx].attr[0].size) +
sizeof(*msg) - sizeof(msg->Data);
else
msize = sizeof(*msg);
put.reply.nid = m_nodes[0].nid;
put.reply.nid = sev->m_nodes[0].nid;
put.reply.qix = sev_eProcSevServer;
put.type.b = (qcom_eBtype) sev_cMsgClass;
put.type.s = (qcom_eStype) sev_eMsgType_HistDataGet;
put.msg_id = m_msg_id++;
put.msg_id = sev->m_msg_id++;
put.size = msize;
msg = (sev_sMsgHistDataGet *) qcom_Alloc(&lsts, put.size);
......@@ -829,22 +865,24 @@ int sev_server::send_histdata( qcom_sQid tgt, sev_sMsgHistDataGetRequest *rmsg,
msg->Type = sev_eMsgType_HistDataGet;
msg->Oid = rmsg->Oid;
strncpy( msg->AName, rmsg->AName, sizeof(msg->AName));
if ( ODD(m_sts)) {
if ( ODD(sts)) {
msg->NumPoints = rows;
msg->VType = item.attr[0].type;
msg->VSize = item.attr[0].size;
msg->VType = sev->m_db->m_items[item_idx].attr[0].type;
msg->VSize = sev->m_db->m_items[item_idx].attr[0].size;
}
msg->Status = m_sts;
qcom_Free( &lsts, rmsg);
msg->Status = sts;
if ( ODD(m_sts) && rows) {
if ( ODD(sts) && rows) {
memcpy( &msg->Data, tbuf, sizeof(pwr_tTime) * rows);
memcpy( (char *)&msg->Data + sizeof(pwr_tTime) * rows, vbuf, item.attr[0].size * rows);
memcpy( (char *)&msg->Data + sizeof(pwr_tTime) * rows, vbuf, sev->m_db->m_items[item_idx].attr[0].size * rows);
}
if ( !qcom_Put( &sts, &tgt, &put)) {
qcom_Free( &sts, put.data);
}
return 1;
// pthread_exit( (void *) 1);
return (void *) 1;
}
int sev_server::send_objecthistdata( qcom_sQid tgt, sev_sMsgHistDataGetRequest *rmsg, unsigned int size)
......@@ -1019,6 +1057,7 @@ int main (int argc, char *argv[])
sev_server srv;
int noneth = 0;
sev_eDbType dbtype = sev_eDbType_;
char str[80];
if ( argc > 1 && strcmp( argv[1], "-n") == 0)
noneth = 1;
......@@ -1040,6 +1079,10 @@ int main (int argc, char *argv[])
dbtype = sev_eDbType_HDF5;
}
}
if ( cnf_get_value( "sevReadThreads", str, sizeof(str))) {
if ( cdh_NoCaseStrcmp( str, "yes") == 0)
srv.m_read_threads = 1;
}
if ( dbtype == sev_eDbType_)
dbtype = sev_eDbType_Mysql;
......
......@@ -46,6 +46,8 @@
#include "rt_sev_net.h"
#include "sev_db.h"
class sev_server;
class sev_node {
public:
pwr_tNodeId nid;
......@@ -58,11 +60,19 @@ typedef struct {
int idx;
} sev_sRefid;
typedef struct {
sev_server *sev;
qcom_sQid tgt;
sev_sMsgHistDataGetRequest *rmsg;
unsigned int size;
unsigned int item_idx;
} sev_sHistDataThread;
class sev_server {
public:
sev_server() : m_server_status(0), m_refid(0), m_msg_id(0), m_storage_cnt(0),
m_db_type(sev_eDbType_Sqlite), m_config(0) {memset(&m_stat,0,sizeof(m_stat));}
m_db_type(sev_eDbType_Sqlite), m_config(0), m_read_threads(0) {memset(&m_stat,0,sizeof(m_stat));}
pwr_tStatus m_sts;
pwr_tStatus m_server_status;
......@@ -76,6 +86,7 @@ class sev_server {
sev_eDbType m_db_type;
pwr_sClass_SevServer *m_config;
pwr_tDlid m_config_dlid;
int m_read_threads;
int init( int noneth);
int connect();
......@@ -92,5 +103,7 @@ class sev_server {
void garbage_collector();
void garbage_item( int idx);
void set_dbtype( sev_eDbType type) { m_db_type = type;}
static void *send_histdata_thread( void *arg);
};
#endif
\ No newline at end of file
#endif
......@@ -42,7 +42,7 @@
#include "pwr_names.h"
#include "rt_load.h"
#include "co_dcli.h"
#include "rt_sev_msg.h"
sev_db *sev_db::open_database( sev_eDbType type)
......@@ -116,4 +116,18 @@ int sev_db::get_systemname( char *name)
}
strcpy( name, system_name);
return 1;
}
\ No newline at end of file
}
void sev_db::get_item_idx( pwr_tStatus *sts, unsigned int *item_idx, pwr_tOid oid, char *attributename)
{
for ( unsigned int i = 0; i < m_items.size(); i++) {
if ( m_items[i].oid.oix == oid.oix && m_items[i].oid.vid == oid.vid &&
(cdh_NoCaseStrcmp( attributename, m_items[i].attr[0].aname) == 0)) {
*item_idx = i;
*sts = SEV__SUCCESS;
return;
}
}
*sts = SEV__NOSUCHITEM;
}
......@@ -189,6 +189,7 @@ class sev_db {
pwr_tStatus tree_update();
pwr_tStatus tree_update_value( int item_idx, pwr_tTime time, void *buf);
void get_item_idx( pwr_tStatus *sts, unsigned int *item_idx, pwr_tOid oid, char *attributename);
virtual int check_item( pwr_tStatus *sts, pwr_tOid oid, char *oname, char *aname,
pwr_tDeltaTime storatetime, pwr_eType type, unsigned int size,
......
......@@ -76,3 +76,4 @@ notauthorized <Not authorized for this operation> /error
novalidcurve <No valid curve found> /error
nosuchvolume <No such volume> /error
invalidobject <Invalid object for this operation> /error
emptylist <List is empty> /info
#!/bin/bash
hw=deb
op=deb
# Get version
if [ -e $pwr_inc/pwr_version.h ]; then
ver=`eval cat $pwr_inc/pwr_version.h | grep "\bpwrv_cWbdbVersionShortStr\b" | awk '{print $3}'`
......@@ -13,11 +16,11 @@ fi
# Generate version help file
{
if [ ! -e $pwre_sroot/tools/pkg/deb/pwrsev/control ]; then
if [ ! -e $pwre_sroot/tools/pkg/$hw/pwrsev/control ]; then
echo "Controlfile not found"
exit 1
fi
datfile=$pwre_sroot/tools/pkg/deb/pwrsev/control
datfile=$pwre_sroot/tools/pkg/$hw/pwrsev/control
echo "<topic> version"
d=`eval date +\"%F %X\"`
......@@ -92,7 +95,7 @@ if [ "$1" == "-v" ]; then
fi
pkgroot=$pwre_broot/$pwre_target/bld/pkg/pwrsev
pkgsrc=$pwre_sroot/tools/pkg/deb/pwrsev
pkgsrc=$pwre_sroot/tools/pkg/$hw/pwrsev
# Create directories
......@@ -143,7 +146,9 @@ currentdir="`eval pwd`"
tarfile=$pwre_broot/$pwre_target/bld/pkg/pwrtmp.tar
cd $pwre_broot/$pwre_target/exp
echo "-- Copy release to package tree"
tar -cf $tarfile exe/rt_qmon exe/rt_prio exe/sev_ini exe/sev_xtt exe/sev_xtt_gtk exe/sev_server exe/sev_repair exe/*.gif exe/*.png load/sev_xtt_version_help.dat exe/pwr_pkg.sh exe/en_us/*.txt doc/*
tar -cf $tarfile exe/rt_qmon exe/rt_prio exe/sev_ini exe/sev_xtt exe/sev_xtt_gtk exe/sev_server \
exe/sev_repair exe/*.gif exe/*.png load/pwrs.dbs load/pwrb.dbs load/sev_xtt_version_help.dat \
exe/pwr_pkg.sh exe/rt_xtt exe/rt_xtt_gtk exe/rt_rtt exe/*.pwgc exe/en_us/*.txt doc/*
cd $pkgroot/usr/pwrsev
mkdir cnf
tar -xf $tarfile
......@@ -158,21 +163,21 @@ cp $pkgsrc/proview.cnf $pkgroot/usr/pwrsev/cnf
# Copy op to cnf
mkdir $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/deb/op/.bashrc $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/deb/op/.bash_profile $pkgroot/usr/pwrsev/cnf/op
#cp $pwre_sroot/tools/pkg/deb/op/.mwmrc $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/deb/op/.rtt_start $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/deb/op/.xtt_start $pkgroot/usr/pwrsev/cnf/op
#cp $pwre_sroot/tools/pkg/deb/op/.xsession $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/$op/op/.bashrc $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/$op/op/.bash_profile $pkgroot/usr/pwrsev/cnf/op
#cp $pwre_sroot/tools/pkg/$op/op/.mwmrc $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/$op/op/.rtt_start $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/$op/op/.xtt_start $pkgroot/usr/pwrsev/cnf/op
#cp $pwre_sroot/tools/pkg/$op/op/.xsession $pkgroot/usr/pwrsev/cnf/op
# Copy user to cnf
mkdir $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/deb/user/.bashrc $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/deb/user/.bash_profile $pkgroot/usr/pwrsev/cnf/user
#cp $pwre_sroot/tools/pkg/deb/user/.mwmrc $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/deb/user/.rtt_start $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/deb/user/.xtt_start $pkgroot/usr/pwrsev/cnf/user
#cp $pwre_sroot/tools/pkg/deb/user/.xsession $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/$op/user/.bashrc $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/$op/user/.bash_profile $pkgroot/usr/pwrsev/cnf/user
#cp $pwre_sroot/tools/pkg/$op/user/.mwmrc $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/$op/user/.rtt_start $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/$op/user/.xtt_start $pkgroot/usr/pwrsev/cnf/user
#cp $pwre_sroot/tools/pkg/$op/user/.xsession $pkgroot/usr/pwrsev/cnf/user
# Create package
echo "-- Building package"
......
......@@ -145,7 +145,9 @@ currentdir="`eval pwd`"
tarfile=$pwre_broot/$pwre_target/bld/pkg/pwrtmp.tar
cd $pwre_broot/$pwre_target/exp
echo "-- Copy release to package tree"
tar -cf $tarfile exe/rt_qmon exe/rt_prio exe/sev_ini exe/sev_xtt exe/sev_xtt_gtk exe/sev_server exe/sev_repair exe/*.gif exe/*.png load/sev_xtt_version_help.dat exe/pwr_pkg.sh exe/en_us/*.txt doc/*
tar -cf $tarfile exe/rt_qmon exe/rt_prio exe/sev_ini exe/sev_xtt exe/sev_xtt_gtk exe/sev_server \
exe/sev_repair exe/*.gif exe/*.png load/pwrs.dbs load/pwrb.dbs load/sev_xtt_version_help.dat \
exe/pwr_pkg.sh exe/rt_xtt exe/rt_xtt_gtk exe/rt_rtt exe/*.pwgc exe/en_us/*.txt doc/*
cd $pkgroot/usr/pwrsev
mkdir cnf
tar -xf $tarfile
......
#!/bin/bash
hw=raspbian
op=deb
# Get version
if [ -e $pwr_inc/pwr_version.h ]; then
ver=`eval cat $pwr_inc/pwr_version.h | grep "\bpwrv_cWbdbVersionShortStr\b" | awk '{print $3}'`
......@@ -13,11 +16,11 @@ fi
# Generate version help file
{
if [ ! -e $pwre_sroot/tools/pkg/raspbian/pwrsev/control ]; then
if [ ! -e $pwre_sroot/tools/pkg/$hw/pwrsev/control ]; then
echo "Controlfile not found"
exit 1
fi
datfile=$pwre_sroot/tools/pkg/raspbian/pwrsev/control
datfile=$pwre_sroot/tools/pkg/$hw/pwrsev/control
echo "<topic> version"
d=`eval date +\"%F %X\"`
......@@ -92,7 +95,7 @@ if [ "$1" == "-v" ]; then
fi
pkgroot=$pwre_broot/$pwre_target/bld/pkg/pwrsev
pkgsrc=$pwre_sroot/tools/pkg/raspbian/pwrsev
pkgsrc=$pwre_sroot/tools/pkg/$hw/pwrsev
# Create directories
......@@ -143,7 +146,9 @@ currentdir="`eval pwd`"
tarfile=$pwre_broot/$pwre_target/bld/pkg/pwrtmp.tar
cd $pwre_broot/$pwre_target/exp
echo "-- Copy release to package tree"
tar -cf $tarfile exe/rt_qmon exe/rt_prio exe/sev_ini exe/sev_xtt exe/sev_xtt_gtk exe/sev_server exe/sev_repair exe/*.gif exe/*.png load/sev_xtt_version_help.dat exe/pwr_pkg.sh exe/en_us/*.txt doc/*
tar -cf $tarfile exe/rt_qmon exe/rt_prio exe/sev_ini exe/sev_xtt exe/sev_xtt_gtk exe/sev_server \
exe/sev_repair exe/*.gif exe/*.png load/pwrs.dbs load/pwrb.dbs load/sev_xtt_version_help.dat \
exe/pwr_pkg.sh exe/rt_xtt exe/rt_xtt_gtk exe/rt_rtt exe/*.pwgc exe/en_us/*.txt doc/*
cd $pkgroot/usr/pwrsev
mkdir cnf
tar -xf $tarfile
......@@ -158,21 +163,21 @@ cp $pkgsrc/proview.cnf $pkgroot/usr/pwrsev/cnf
# Copy op to cnf
mkdir $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/deb/op/.bashrc $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/deb/op/.bash_profile $pkgroot/usr/pwrsev/cnf/op
#cp $pwre_sroot/tools/pkg/deb/op/.mwmrc $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/deb/op/.rtt_start $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/deb/op/.xtt_start $pkgroot/usr/pwrsev/cnf/op
#cp $pwre_sroot/tools/pkg/deb/op/.xsession $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/$op/op/.bashrc $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/$op/op/.bash_profile $pkgroot/usr/pwrsev/cnf/op
#cp $pwre_sroot/tools/pkg/$op/op/.mwmrc $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/$op/op/.rtt_start $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/$op/op/.xtt_start $pkgroot/usr/pwrsev/cnf/op
#cp $pwre_sroot/tools/pkg/$op/op/.xsession $pkgroot/usr/pwrsev/cnf/op
# Copy user to cnf
mkdir $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/deb/user/.bashrc $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/deb/user/.bash_profile $pkgroot/usr/pwrsev/cnf/user
#cp $pwre_sroot/tools/pkg/deb/user/.mwmrc $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/deb/user/.rtt_start $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/deb/user/.xtt_start $pkgroot/usr/pwrsev/cnf/user
#cp $pwre_sroot/tools/pkg/deb/user/.xsession $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/$op/user/.bashrc $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/$op/user/.bash_profile $pkgroot/usr/pwrsev/cnf/user
#cp $pwre_sroot/tools/pkg/$op/user/.mwmrc $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/$op/user/.rtt_start $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/$op/user/.xtt_start $pkgroot/usr/pwrsev/cnf/user
#cp $pwre_sroot/tools/pkg/$op/user/.xsession $pkgroot/usr/pwrsev/cnf/user
# Create package
echo "-- Building package"
......
#!/bin/bash
hw=ubu
op=deb
# Get version
if [ -e $pwr_inc/pwr_version.h ]; then
ver=`eval cat $pwr_inc/pwr_version.h | grep "\bpwrv_cWbdbVersionShortStr\b" | awk '{print $3}'`
......@@ -13,11 +16,11 @@ fi
# Generate version help file
{
if [ ! -e $pwre_sroot/tools/pkg/ubu/pwrsev/control ]; then
if [ ! -e $pwre_sroot/tools/pkg/$hw/pwrsev/control ]; then
echo "Controlfile not found"
exit 1
fi
datfile=$pwre_sroot/tools/pkg/ubu/pwrsev/control
datfile=$pwre_sroot/tools/pkg/$hw/pwrsev/control
echo "<topic> version"
d=`eval date +\"%F %X\"`
......@@ -92,7 +95,7 @@ if [ "$1" == "-v" ]; then
fi
pkgroot=$pwre_broot/$pwre_target/bld/pkg/pwrsev
pkgsrc=$pwre_sroot/tools/pkg/ubu/pwrsev
pkgsrc=$pwre_sroot/tools/pkg/$hw/pwrsev
# Create directories
......@@ -143,7 +146,9 @@ currentdir="`eval pwd`"
tarfile=$pwre_broot/$pwre_target/bld/pkg/pwrtmp.tar
cd $pwre_broot/$pwre_target/exp
echo "-- Copy release to package tree"
tar -cf $tarfile exe/rt_qmon exe/rt_prio exe/sev_ini exe/sev_xtt exe/sev_xtt_gtk exe/sev_server exe/sev_repair exe/*.gif exe/*.png load/sev_xtt_version_help.dat exe/pwr_pkg.sh exe/en_us/*.txt doc/*
tar -cf $tarfile exe/rt_qmon exe/rt_prio exe/sev_ini exe/sev_xtt exe/sev_xtt_gtk exe/sev_server \
exe/sev_repair exe/*.gif exe/*.png load/pwrs.dbs load/pwrb.dbs load/sev_xtt_version_help.dat \
exe/pwr_pkg.sh exe/rt_xtt exe/rt_xtt_gtk exe/rt_rtt exe/*.pwgc exe/en_us/*.txt doc/*
cd $pkgroot/usr/pwrsev
mkdir cnf
tar -xf $tarfile
......@@ -158,21 +163,21 @@ cp $pkgsrc/proview.cnf $pkgroot/usr/pwrsev/cnf
# Copy op to cnf
mkdir $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/deb/op/.bashrc $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/deb/op/.bash_profile $pkgroot/usr/pwrsev/cnf/op
#cp $pwre_sroot/tools/pkg/deb/op/.mwmrc $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/deb/op/.rtt_start $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/deb/op/.xtt_start $pkgroot/usr/pwrsev/cnf/op
#cp $pwre_sroot/tools/pkg/deb/op/.xsession $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/$op/op/.bashrc $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/$op/op/.bash_profile $pkgroot/usr/pwrsev/cnf/op
#cp $pwre_sroot/tools/pkg/$op/op/.mwmrc $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/$op/op/.rtt_start $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/$op/op/.xtt_start $pkgroot/usr/pwrsev/cnf/op
#cp $pwre_sroot/tools/pkg/$op/op/.xsession $pkgroot/usr/pwrsev/cnf/op
# Copy user to cnf
mkdir $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/deb/user/.bashrc $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/deb/user/.bash_profile $pkgroot/usr/pwrsev/cnf/user
#cp $pwre_sroot/tools/pkg/deb/user/.mwmrc $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/deb/user/.rtt_start $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/deb/user/.xtt_start $pkgroot/usr/pwrsev/cnf/user
#cp $pwre_sroot/tools/pkg/deb/user/.xsession $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/$op/user/.bashrc $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/$op/user/.bash_profile $pkgroot/usr/pwrsev/cnf/user
#cp $pwre_sroot/tools/pkg/$op/user/.mwmrc $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/$op/user/.rtt_start $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/$op/user/.xtt_start $pkgroot/usr/pwrsev/cnf/user
#cp $pwre_sroot/tools/pkg/$op/user/.xsession $pkgroot/usr/pwrsev/cnf/user
# Create package
echo "-- Building package"
......
#!/bin/bash
pf="ubu_x86_64"
hw=ubu_x86_64
op=deb
# Get version
if [ -e $pwr_inc/pwr_version.h ]; then
......@@ -15,11 +16,11 @@ fi
# Generate version help file
{
if [ ! -e $pwre_sroot/tools/pkg/$pf/pwrsev/control ]; then
if [ ! -e $pwre_sroot/tools/pkg/$hw/pwrsev/control ]; then
echo "Controlfile not found"
exit 1
fi
datfile=$pwre_sroot/tools/pkg/$pf/pwrsev/control
datfile=$pwre_sroot/tools/pkg/$hw/pwrsev/control
echo "<topic> version"
d=`eval date +\"%F %X\"`
......@@ -94,7 +95,7 @@ if [ "$1" == "-v" ]; then
fi
pkgroot=$pwre_broot/$pwre_target/bld/pkg/pwrsev
pkgsrc=$pwre_sroot/tools/pkg/$pf/pwrsev
pkgsrc=$pwre_sroot/tools/pkg/$hw/pwrsev
# Create directories
......@@ -145,7 +146,9 @@ currentdir="`eval pwd`"
tarfile=$pwre_broot/$pwre_target/bld/pkg/pwrtmp.tar
cd $pwre_broot/$pwre_target/exp
echo "-- Copy release to package tree"
tar -cf $tarfile exe/rt_qmon exe/rt_prio exe/sev_ini exe/sev_xtt exe/sev_xtt_gtk exe/sev_server exe/sev_repair exe/*.gif exe/*.png load/sev_xtt_version_help.dat exe/pwr_pkg.sh exe/en_us/*.txt doc/*
tar -cf $tarfile exe/rt_qmon exe/rt_prio exe/sev_ini exe/sev_xtt exe/sev_xtt_gtk exe/sev_server \
exe/sev_repair exe/*.gif exe/*.png load/pwrs.dbs load/pwrb.dbs load/sev_xtt_version_help.dat \
exe/pwr_pkg.sh exe/rt_xtt exe/rt_xtt_gtk exe/rt_rtt exe/*.pwgc exe/en_us/*.txt doc/*
cd $pkgroot/usr/pwrsev
mkdir cnf
tar -xf $tarfile
......@@ -160,21 +163,21 @@ cp $pkgsrc/proview.cnf $pkgroot/usr/pwrsev/cnf
# Copy op to cnf
mkdir $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/deb/op/.bashrc $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/deb/op/.bash_profile $pkgroot/usr/pwrsev/cnf/op
#cp $pwre_sroot/tools/pkg/deb/op/.mwmrc $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/deb/op/.rtt_start $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/deb/op/.xtt_start $pkgroot/usr/pwrsev/cnf/op
#cp $pwre_sroot/tools/pkg/deb/op/.xsession $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/$op/op/.bashrc $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/$op/op/.bash_profile $pkgroot/usr/pwrsev/cnf/op
#cp $pwre_sroot/tools/pkg/$op/op/.mwmrc $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/$op/op/.rtt_start $pkgroot/usr/pwrsev/cnf/op
cp $pwre_sroot/tools/pkg/$op/op/.xtt_start $pkgroot/usr/pwrsev/cnf/op
#cp $pwre_sroot/tools/pkg/$op/op/.xsession $pkgroot/usr/pwrsev/cnf/op
# Copy user to cnf
mkdir $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/deb/user/.bashrc $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/deb/user/.bash_profile $pkgroot/usr/pwrsev/cnf/user
#cp $pwre_sroot/tools/pkg/deb/user/.mwmrc $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/deb/user/.rtt_start $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/deb/user/.xtt_start $pkgroot/usr/pwrsev/cnf/user
#cp $pwre_sroot/tools/pkg/deb/user/.xsession $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/$op/user/.bashrc $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/$op/user/.bash_profile $pkgroot/usr/pwrsev/cnf/user
#cp $pwre_sroot/tools/pkg/$op/user/.mwmrc $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/$op/user/.rtt_start $pkgroot/usr/pwrsev/cnf/user
cp $pwre_sroot/tools/pkg/$op/user/.xtt_start $pkgroot/usr/pwrsev/cnf/user
#cp $pwre_sroot/tools/pkg/$op/user/.xsession $pkgroot/usr/pwrsev/cnf/user
# Create package
echo "-- Building package"
......
......@@ -2644,7 +2644,7 @@ pwr_tStatus lfu_SaveDirectoryVolume(
!(distr_options & lfu_mDistrOpt_NoRootVolume)) {
fprintf( file, "load %s\n", nodename_ptr);
}
if ( cid == pwr_cClass_SevNodeConfig)
else if ( cid == pwr_cClass_SevNodeConfig)
fprintf( file, "boot %s\n", nodename_ptr);
if ( *components_ptr & pwr_mDistrComponentMask_UserDatabase)
......
......@@ -182,12 +182,14 @@ void GeCurve::activate_filledcurves( int set)
grow_SetTrendFillCurve( curve_object, 0);
configure_curves();
}
grow_NavRedraw( growcurve_ctx);
}
void GeCurve::activate_curvetype( int type)
{
grow_SetCurveType( curve_object, (glow_eCurveType)type);
configure_curves();
grow_NavRedraw( growcurve_ctx);
}
void GeCurve::activate_help()
......
......@@ -2501,10 +2501,10 @@ int GlowDrawGtk::draw_points( GlowWind *wind, glow_sPointX *points, int point_nu
for ( int i = 0; i < point_num; i++) {
if ( !w->draw_buffer_only)
gdk_draw_rectangle( w->window,
get_gc( this, gc_type, 0), 1, points[i].x - idx/2, points[i].y, idx, idx);
get_gc( this, gc_type, 0), 1, points[i].x - idx/2, points[i].y - idx/2, idx, idx);
if ( w->double_buffer_on)
gdk_draw_rectangle( w->buffer,
get_gc( this, gc_type, 0), 1, points[i].x - idx/2, points[i].y, idx, idx);
get_gc( this, gc_type, 0), 1, points[i].x - idx/2, points[i].y - idx/2, idx, idx);
}
if ( w->clip_on)
reset_clip( w, get_gc( this, gc_type, 0));
......
......@@ -5906,7 +5906,7 @@ int grow_KeyPressed( grow_tCtx ctx, int key)
void grow_SignalSend( grow_tCtx ctx, char *signalname)
{
((GrowCtx *)ctx)->signal_send( signalname);
((GrowCtx *)ctx)->signal_send( signalname);
}
void grow_DrawObject( grow_tObject object)
......@@ -5914,4 +5914,9 @@ void grow_DrawObject( grow_tObject object)
((GlowArrayElem *)object)->draw();
}
void grow_NavRedraw( grow_tCtx ctx)
{
((GrowCtx *)ctx)->nav_zoom();
}
/*@}*/
......@@ -3225,6 +3225,7 @@ extern "C" {
int grow_KeyPressed( grow_tCtx ctx, int key);
void grow_SignalSend( grow_tCtx ctx, char *signalname);
void grow_DrawObject( grow_tObject object);
void grow_NavRedraw( grow_tCtx ctx);
/*@}*/
......
......@@ -100,7 +100,8 @@ XttSevHistGtk::XttSevHistGtk( void *parent_ctx,
curve->add_cb = sevhist_add_cb;
curve->remove_cb = sevhist_remove_cb;
curve->export_cb = sevhist_export_cb;
curve->enable( curve_mEnable_Timebox | curve_mEnable_Export | curve_mEnable_ExportTime);
curve->enable( curve_mEnable_Timebox | curve_mEnable_Export | curve_mEnable_ExportTime |
curve_mEnable_CurveType | curve_mEnable_CurveTypeSquare | curve_mEnable_FillCurve);
if ( initial_period != time_ePeriod_)
curve->set_period( initial_period, 1);
......@@ -162,4 +163,4 @@ XttOTree *XttSevHistGtk::tree_new( const char *title, pwr_tAttrRef *itemlist, in
pwr_tStatus (*action_cb)( void *, pwr_tAttrRef *))
{
return new XttOTreeGtk( parent_widget, this, title, itemlist, itemcnt, layout, action_cb);
}
\ No newline at end of file
}
......@@ -197,9 +197,15 @@ void Op::activate_fast()
void Op::activate_history()
{
int sts;
char cmd[200] = "show objecttree/class=sevhist,sevhistobject/title=\"Process History List\"/alpha/global";
if ( command_cb)
command_cb( parent_ctx, cmd);
if ( command_cb) {
sts = command_cb( parent_ctx, cmd);
if ( sts == XNAV__EMPTYLIST) {
strcpy( cmd, "show objecttree/class=sevitemfloat,sevitemint,sevitemboolean/title=\"Process History List\"/alpha");
sts = command_cb( parent_ctx, cmd);
}
}
}
void Op::activate_graph()
......
......@@ -104,7 +104,7 @@ class Op {
int button_cnt;
int start_jop;
Jop *jop;
void (*command_cb)( void *, char *);
int (*command_cb)( void *, char *);
void (*map_cb)( void *);
void (*help_cb)( void *, const char *);
void (*close_cb)( void *);
......@@ -162,4 +162,4 @@ class Op {
static void sup_scan( void *data);
};
#endif
\ No newline at end of file
#endif
......@@ -82,7 +82,7 @@ class XColWind {
int (*call_method_cb)(void *, const char *, const char *, pwr_sAttrRef,
unsigned long, unsigned long, char *);
int (*is_authorized_cb)(void *, unsigned int);
void (*command_cb)( void *, char *);
int (*command_cb)( void *, char *);
int (*get_select_cb)( void *, pwr_tAttrRef *, int *);
void *client_data;
brow_tObject input_node;
......@@ -140,4 +140,4 @@ class XColWind {
static int name_to_objid_cb( void *ctx, char *name, pwr_tObjid *objid);
};
#endif
\ No newline at end of file
#endif
......@@ -175,7 +175,7 @@ static void xnav_stream_close_cb( void *xnav, XttStream *strmctx);
//new code by Jonas Nylund 030131
static void xnav_hist_close_cb( void *ctx);
//end new code by Jonas Nylund 030131
static void xnav_op_command_cb( void *xnav, char *command);
static int xnav_op_command_cb( void *xnav, char *command);
static void xnav_op_close_cb( void *ctx);
static void xnav_op_help_cb( void *ctx, const char *key);
static void xnav_op_map_cb( void *ctx);
......@@ -2820,6 +2820,7 @@ static int xnav_show_func( void *client_data,
int listcnt;
unsigned int options = 0;
char layout_str[40];
char title_str[80];
int i;
int global;
int alphaorder;
......@@ -2827,6 +2828,9 @@ static int xnav_show_func( void *client_data,
global = ODD( dcli_get_qualifier( "/GLOBAL", 0, 0));
alphaorder = ODD( dcli_get_qualifier( "/ALPHAORDER", 0, 0));
if ( EVEN(dcli_get_qualifier( "/TITLE", title_str, sizeof(title_str))))
strcpy( title_str, "Objects");
// The class string can contain several classes separated by ','
class_num = dcli_parse( class_str, ",", "",
(char *) class_array, sizeof( class_array)/sizeof( class_array[0]),
......@@ -2850,7 +2854,7 @@ static int xnav_show_func( void *client_data,
}
if ( listcnt == 0) {
xnav->message('E', "No objects found");
return XNAV__HOLDCOMMAND;
return XNAV__EMPTYLIST;
}
if ( ODD( dcli_get_qualifier( "/LAYOUT", layout_str, sizeof(layout_str)))) {
......@@ -2878,7 +2882,7 @@ static int xnav_show_func( void *client_data,
if ( alphaorder)
options |= tree_mOptions_AlphaOrder;
xnav->tree_new( "Objects", list, listcnt, options, xnav_otree_action_cb);
xnav->tree_new( title_str, list, listcnt, options, xnav_otree_action_cb);
free( (char *)list);
return XNAV__SUCCESS;
......@@ -10127,6 +10131,9 @@ static pwr_tStatus xnav_otree_action_cb( void *ctx, pwr_tAttrRef *aref)
break;
case pwr_cClass_SevHist:
case pwr_cClass_SevHistObject:
case pwr_cClass_SevItemFloat:
case pwr_cClass_SevItemInt:
case pwr_cClass_SevItemBoolean:
sprintf( cmd, "open history/name=%s/title=\"%s\"", aname, aname);
break;
case pwr_cClass_XttGraph:
......@@ -10324,9 +10331,10 @@ static void xnav_op_ack_last_cb( void *xnav, unsigned long type,
((XNav *)xnav)->ev->ack_last_prio( type, prio);
}
static void xnav_op_command_cb( void *xnav, char *command)
static int xnav_op_command_cb( void *xnav, char *command)
{
((XNav *)xnav)->command( command);
return ((XNav *)xnav)->get_command_sts();
}
static void xnav_op_map_cb( void *ctx)
......
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