Commit ff59fc71 authored by Claes Sjofors's avatar Claes Sjofors

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

parents 3d3beef3 5b2e9615
......@@ -40,6 +40,7 @@
#include "pwr_baseclasses.h"
#define sev_cGarbageInterval 120
#define sev_cGarbageCycle 86400
static int sev_comp_item(tree_sTable *tp, tree_sNode *x, tree_sNode *y)
......@@ -68,6 +69,26 @@ static int sev_comp_item(tree_sTable *tp, tree_sNode *x, tree_sNode *y)
return 0;
}
static int sev_comp_refid(tree_sTable *tp, tree_sNode *x, tree_sNode *y)
{
sev_sRefid *xp = (sev_sRefid *) x;
sev_sRefid *yp = (sev_sRefid *) y;
if (xp->id.nid > yp->id.nid)
return 1;
if (xp->id.nid < yp->id.nid)
return -1;
if (xp->id.rix > yp->id.rix)
return 1;
if (xp->id.rix < yp->id.rix)
return -1;
return 0;
}
int sev_server::init( int noneth)
{
qcom_sNode node;
......@@ -131,6 +152,7 @@ int sev_server::init( int noneth)
m_db->get_items( &m_sts);
m_refid = tree_CreateTable(&sts, sizeof(pwr_tRefId), offsetof(sev_sRefid, id), sizeof(sev_sRefid), 100, sev_comp_refid);
m_item_key = tree_CreateTable(&sts, sizeof(sev_sItemKey), offsetof(sev_sItem, key), sizeof(sev_sItem), 100, sev_comp_item);
for ( unsigned int i = 0; i < m_db->m_items.size(); i++) {
......@@ -474,11 +496,17 @@ int sev_server::check_histitems( sev_sMsgHistItems *msg, unsigned int size)
// Remove all refid's for this node
pwr_tNid nid = msg->Items[0].sevid.nid;
for ( iterator_refid it = m_refid.begin(); it != m_refid.end(); it++) {
if ( it->first.id.nid == nid)
m_refid.erase( it);
sev_sRefid *rp = (sev_sRefid *)tree_Minimum(&sts, m_refid);
sev_sRefid *succ_rp;
while ( rp) {
succ_rp = (sev_sRefid *)tree_Successor(&sts, m_refid, rp);
if ( rp->id.nid == nid)
tree_Remove( &sts, m_refid, &rp->id);
rp = succ_rp;
}
for ( int i = 0; i < item_cnt; i++) {
// Deadband requires id variable
......@@ -507,8 +535,15 @@ int sev_server::check_histitems( sev_sMsgHistItems *msg, unsigned int size)
}
m_db->m_items[idx].sevid = msg->Items[i].sevid;
sev_refid sevid(msg->Items[i].sevid);
m_refid[sevid] = idx;
pwr_tRefId rk;
sev_sRefid *rp;
rk = msg->Items[i].sevid;
rp = (sev_sRefid *) tree_Insert(&sts, m_refid, &rk);
rp->idx = idx;
}
#if 0
......@@ -528,17 +563,20 @@ int sev_server::check_histitems( sev_sMsgHistItems *msg, unsigned int size)
int sev_server::receive_histdata( sev_sMsgHistDataStore *msg, unsigned int size)
{
pwr_tStatus sts;
sev_sHistData *dp = (sev_sHistData *)&msg->Data;
pwr_tTime time;
while ( (char *)dp - (char *)msg < (int)size) {
sev_refid sevid(dp->sevid);
iterator_refid it = m_refid.find( sevid);
if ( it == m_refid.end()) {
sev_sRefid *rp;
pwr_tRefId rk = dp->sevid;
rp = (sev_sRefid *) tree_Find(&sts, m_refid, &rk);
if ( !rp) {
dp = (sev_sHistData *)((char *)dp + sizeof( *dp) - sizeof(dp->data) + dp->size);
continue;
}
unsigned int idx = it->second;
unsigned int idx = rp->idx;
time = net_NetTimeToTime( &msg->Time);
m_db->store_value( &m_sts, idx, 0, time, &dp->data, dp->size);
......@@ -620,22 +658,57 @@ int sev_server::send_histdata( qcom_sQid tgt, sev_sMsgHistDataGetRequest *rmsg,
}
void sev_server::garbage_collector()
{
int item_size = m_db->m_items.size();
static int current = 0;
float items_per_scan;
int scan_per_items;
static int scan_cnt = 0;
int i;
if ( m_db->m_items.size() == 0)
return;
items_per_scan = ((float)sev_cGarbageInterval) * item_size / sev_cGarbageCycle;
if ( items_per_scan >= 1) {
for ( i = 0; i < (int)items_per_scan; i++) {
garbage_item( current);
current++;
if ( current >= item_size)
current = 0;
}
}
else {
scan_per_items = (int)( 1.0 / items_per_scan);
scan_cnt++;
if ( scan_cnt >= scan_per_items) {
scan_cnt = 0;
garbage_item( current);
current++;
if ( current >= item_size)
current = 0;
}
}
}
void sev_server::garbage_item( int idx)
{
pwr_tTime currenttime, limit;
time_GetTime( &currenttime);
for ( unsigned int i = 0; i < m_db->m_items.size(); i++) {
if ( m_db->m_items[i].deleted)
continue;
if ( m_db->m_items[i].storagetime.tv_sec == 0)
continue;
if ( m_db->m_items[idx].deleted)
return;
if ( m_db->m_items[idx].storagetime.tv_sec == 0)
return;
time_Asub( &limit, &currenttime, &m_db->m_items[i].storagetime);
time_Asub( &limit, &currenttime, &m_db->m_items[idx].storagetime);
m_db->delete_old_data( &m_sts, m_db->m_items[i].oid, m_db->m_items[i].attr[0].aname,
m_db->m_items[i].options, limit);
}
m_db->delete_old_data( &m_sts, m_db->m_items[idx].oid, m_db->m_items[idx].attr[0].aname,
m_db->m_items[idx].options, limit);
}
int main (int argc, char *argv[])
......
......@@ -34,7 +34,8 @@ class sev_node {
char name[80];
};
class sev_refid {
typedef struct {
#if 0
public:
sev_refid( pwr_tRefId rid) : id(rid) {}
bool operator<(const sev_refid& x) const {
......@@ -44,8 +45,11 @@ class sev_refid {
return true;
return false;
}
#endif
tree_sNode node;
pwr_tRefId id;
};
int idx;
} sev_sRefid;
// Struct for binary tree item
typedef struct {
......@@ -62,14 +66,12 @@ typedef struct {
class sev_server {
public:
sev_server() : m_server_status(0), m_item_key(0), m_msg_id(0) {}
typedef map<sev_refid, unsigned int>::iterator iterator_refid;
sev_server() : m_server_status(0), m_refid(0), m_item_key(0), m_msg_id(0) {}
pwr_tStatus m_sts;
pwr_tStatus m_server_status;
vector<sev_node> m_nodes;
map<sev_refid, unsigned int> m_refid;
tree_sTable *m_refid;
tree_sTable *m_item_key;
unsigned int m_msg_id;
sev_db *m_db;
......@@ -86,5 +88,6 @@ class sev_server {
int send_server_status( qcom_sQid tgt);
int delete_item( qcom_sQid tgt, sev_sMsgHistItemDelete *rmsg);
void garbage_collector();
void garbage_item( int idx);
};
#endif
......@@ -125,4 +125,5 @@
091014 cs doc Links in Designer's Guide updated and code format added in html version.
091020 cs co wow_CreateList now with variable text size.
091111 cs gdh Bugfix in nethandler SetObjectInfo and GetObjectInfo.
091209 cs co Command line interpreter, command not converted to upper case any more.
\ No newline at end of file
091209 cs co Command line interpreter, command not converted to upper case any more.
091211 cs rtt rt_rtt runable on sev station to show qcom nodes and qcom applications.
\ No newline at end of file
......@@ -399,7 +399,7 @@ int rt_sevhistmon::connect()
// Check if this node should be connected
bool found = false;
for ( unsigned int j = 0; j < m_hs.size(); j++) {
if ( m_hs[i].configerror)
if ( m_hs[j].configerror)
continue;
if ( cdh_NoCaseStrcmp( m_nodes[i].name, m_hs[j].nodename) == 0) {
found = true;
......@@ -444,6 +444,7 @@ bool rt_sevhistmon::send_connect( pwr_tNid nid, pwr_tStatus *sts)
return ODD(*sts);
}
bool rt_sevhistmon::send_server_status_request( pwr_tStatus *sts)
{
int stime;
......@@ -627,6 +628,13 @@ int rt_sevhistmon::mainloop()
m_loopcnt++;
send_data();
send_server_status_request( &sts);
if ( !m_allconnected) {
int reconnect_time = int(20.0 / m_scantime);
if ( m_loopcnt % reconnect_time == 0)
retry_connect();
}
continue;
}
......@@ -679,8 +687,6 @@ int rt_sevhistmon::mainloop()
qcom_Free( &sts, mp);
if ( !m_allconnected)
retry_connect();
}
}
......
This diff is collapsed.
This diff is collapsed.
......@@ -1090,42 +1090,42 @@ struct pwr_s_RootVolume {
pwr_tString80 Description;
pwr_tObjectIx NextOix pwr_dAlignW;
pwr_tProjVersion RtVersion pwr_dAlignW;
pwr_tTime RtCreTime pwr_dAlignW;
pwr_tTime RtCreTime pwr_dAlignLW;
pwr_tString16 RtCreator pwr_dAlignW;
pwr_tUInt32 RtCardinality pwr_dAlignW;
pwr_tUInt32 RtBodySize pwr_dAlignW;
pwr_mOpSys OperatingSystem pwr_dAlignW;
pwr_tTime Modified pwr_dAlignW;
pwr_tTime Modified pwr_dAlignLW;
};
struct pwr_s_SubVolume {
pwr_tString80 Description;
pwr_tObjectIx NextOix pwr_dAlignW;
pwr_tProjVersion RtVersion pwr_dAlignW;
pwr_tTime RtCreTime pwr_dAlignW;
pwr_tTime RtCreTime pwr_dAlignLW;
pwr_tString16 RtCreator pwr_dAlignW;
pwr_tUInt32 RtCardinality pwr_dAlignW;
pwr_tUInt32 RtBodySize pwr_dAlignW;
pwr_mOpSys OperatingSystem pwr_dAlignW;
pwr_tTime Modified pwr_dAlignW;
pwr_tTime Modified pwr_dAlignLW;
};
struct pwr_s_SharedVolume {
pwr_tString80 Description;
pwr_tObjectIx NextOix pwr_dAlignW;
pwr_tProjVersion RtVersion pwr_dAlignW;
pwr_tTime RtCreTime pwr_dAlignW;
pwr_tTime RtCreTime pwr_dAlignLW;
pwr_tString16 RtCreator pwr_dAlignW;
pwr_tUInt32 RtCardinality pwr_dAlignW;
pwr_tUInt32 RtBodySize pwr_dAlignW;
pwr_tTime Modified pwr_dAlignW;
pwr_tTime Modified pwr_dAlignLW;
};
struct pwr_s_DynamicVolume {
pwr_tString80 Description;
pwr_tObjectIx NextOix pwr_dAlignW;
pwr_tProjVersion RtVersion pwr_dAlignW;
pwr_tTime RtCreTime pwr_dAlignW;
pwr_tTime RtCreTime pwr_dAlignLW;
pwr_tString16 RtCreator pwr_dAlignW;
pwr_tUInt32 RtCardinality pwr_dAlignW;
pwr_tUInt32 RtBodySize pwr_dAlignW;
......@@ -1135,7 +1135,7 @@ struct pwr_s_SystemVolume {
pwr_tString80 Description;
pwr_tObjectIx NextOix pwr_dAlignW;
pwr_tProjVersion RtVersion pwr_dAlignW;
pwr_tTime RtCreTime pwr_dAlignW;
pwr_tTime RtCreTime pwr_dAlignLW;
pwr_tString16 RtCreator pwr_dAlignW;
pwr_tUInt32 RtCardinality pwr_dAlignW;
pwr_tUInt32 RtBodySize pwr_dAlignW;
......@@ -1145,7 +1145,7 @@ struct pwr_s_ClassVolume {
pwr_tString80 Description;
pwr_tObjectIx NextOix pwr_dAlignW;
pwr_tProjVersion RtVersion pwr_dAlignW;
pwr_tTime RtCreTime pwr_dAlignW;
pwr_tTime RtCreTime pwr_dAlignLW;
pwr_tString16 RtCreator pwr_dAlignW;
pwr_tUInt32 RtCardinality pwr_dAlignW;
pwr_tUInt32 RtBodySize pwr_dAlignW;
......@@ -1158,7 +1158,7 @@ struct pwr_s_WorkBenchVolume {
pwr_tString80 Description;
pwr_tObjectIx NextOix pwr_dAlignW;
pwr_tProjVersion RtVersion pwr_dAlignW;
pwr_tTime RtCreTime pwr_dAlignW;
pwr_tTime RtCreTime pwr_dAlignLW;
pwr_tString16 RtCreator pwr_dAlignW;
pwr_tUInt32 RtCardinality pwr_dAlignW;
pwr_tUInt32 RtBodySize pwr_dAlignW;
......@@ -1168,7 +1168,7 @@ struct pwr_s_DirectoryVolume {
pwr_tString80 Description;
pwr_tObjectIx NextOix pwr_dAlignW;
pwr_tProjVersion RtVersion pwr_dAlignW;
pwr_tTime RtCreTime pwr_dAlignW;
pwr_tTime RtCreTime pwr_dAlignLW;
pwr_tString16 RtCreator pwr_dAlignW;
pwr_tUInt32 RtCardinality pwr_dAlignW;
pwr_tUInt32 RtBodySize pwr_dAlignW;
......
......@@ -93,6 +93,13 @@ rtt_message('E',"Rtt is not connected to nethandler");\
return RTT__NOPICTURE;\
}
#define IF_NOQCOM_RETURN \
if ( !(rtt_gdh_started || rtt_qcom_started)) \
{\
rtt_message('E',"Rtt is not connected to qcom or nethandler");\
return RTT__NOPICTURE;\
}
/* Type definitions */
/* RTTSYS_GRAFCET ***/
typedef struct {
......@@ -11086,7 +11093,7 @@ int RTTSYS_QCOM_APPL( menu_ctx ctx,
pool_sQlink *al;
qdb_sAppl *ap;
IF_NOGDH_RETURN;
IF_NOQCOM_RETURN;
/**********************************************************
* The value of a parameter is changed.
......@@ -11720,7 +11727,7 @@ int RTTSYS_QCOM_NODES( menu_ctx ctx,
qdb_sNode *np;
char timbuf[32];
IF_NOGDH_RETURN;
IF_NOQCOM_RETURN;
/**********************************************************
* The value of a parameter is changed.
......@@ -11735,7 +11742,7 @@ int RTTSYS_QCOM_NODES( menu_ctx ctx,
k = 0;
l = 0;
gdb_ScopeLock {
qdb_ScopeLock {
for (
nl = pool_Qsucc(&sts, &qdb->pool, &qdb->g->node_lh);
nl != &qdb->g->node_lh;
......@@ -11814,7 +11821,7 @@ int RTTSYS_QCOM_NODES( menu_ctx ctx,
}
k++;
}
} gdb_ScopeUnlock;
} qdb_ScopeUnlock;
for ( i = l; i < QCOM_NODES_PAGESIZE; i++)
{
......@@ -11895,7 +11902,7 @@ int RTTSYS_QCOM_NODES( menu_ctx ctx,
k = 0;
l = 0;
gdb_ScopeLock {
qdb_ScopeLock {
for (
nl = pool_Qsucc(&sts, &qdb->pool, &qdb->g->node_lh);
nl != &qdb->g->node_lh;
......@@ -11974,7 +11981,7 @@ int RTTSYS_QCOM_NODES( menu_ctx ctx,
}
k++;
}
} gdb_ScopeUnlock;
} qdb_ScopeUnlock;
for ( i = l; i < QCOM_NODES_PAGESIZE; i++)
{
......@@ -12690,7 +12697,7 @@ int RTTSYS_QCOM_NODE( menu_ctx ctx,
qdb_sNode *np;
static pwr_tNodeId nid;
IF_NOGDH_RETURN;
IF_NOQCOM_RETURN;
/**********************************************************
* The value of a parameter is changed.
......@@ -12702,7 +12709,7 @@ int RTTSYS_QCOM_NODE( menu_ctx ctx,
menulist = (rtt_t_menu_upd *) ctx->menu;
menu_ptr = menulist;
gdb_ScopeLock {
qdb_ScopeLock {
for (
nl = pool_Qsucc(&sts, &qdb->pool, &qdb->g->node_lh);
nl != &qdb->g->node_lh;
......@@ -12835,7 +12842,7 @@ int RTTSYS_QCOM_NODE( menu_ctx ctx,
break;
}
}
} gdb_ScopeUnlock;
} qdb_ScopeUnlock;
return RTT__SUCCESS;
......@@ -12873,7 +12880,7 @@ int RTTSYS_QCOM_NODE( menu_ctx ctx,
menulist = (rtt_t_menu_upd *) ctx->menu;
menu_ptr = menulist;
gdb_ScopeLock {
qdb_ScopeLock {
for (
nl = pool_Qsucc(&sts, &qdb->pool, &qdb->g->node_lh);
nl != &qdb->g->node_lh;
......@@ -13006,7 +13013,7 @@ int RTTSYS_QCOM_NODE( menu_ctx ctx,
break;
}
}
} gdb_ScopeUnlock;
} qdb_ScopeUnlock;
break;
......
......@@ -20,9 +20,10 @@
#ifndef rt_rtt_functions_h
#define rt_rtt_functions_h
/* Module rs_rtt_menu.c */
/* Module rt_rtt_menu.c */
int rtt_gdh_init( void);
int rtt_qcom_init( void);
int rtt_initialize( char *username,
char *password,
char *commandfile,
......@@ -398,7 +399,7 @@ menu_ctx rtt_current_ctx();
int rtt_logon_pict( unsigned long *chn,
unsigned long *priv);
/* Module rs_rtt_crr.c */
/* Module rt_rtt_crr.c */
int rtt_crossref_signal(
unsigned long ctx,
......@@ -432,7 +433,7 @@ int rtt_show_signals(
char *windowname,
int debug);
/* Module rs_rtt_command.c */
/* Module rt_rtt_command.c */
int rtt_get_do_test( pwr_tObjid objid,
int *on);
......@@ -619,7 +620,7 @@ int rttcmd_learn_func( menu_ctx ctx,
int *flag);
int rtt_remove_blank( char *out_str, char *in_str);
/* Module rs_rtt_alarm.c */
/* Module rt_rtt_alarm.c */
int rtt_alarm_send(
char *alarm_text,
......@@ -647,7 +648,7 @@ int rtt_alarm_ack_last();
int rtt_alarmlog_start( char *filename);
int rtt_alarmlog_stop();
/* Module rs_rtt_logging.c */
/* Module rt_rtt_logging.c */
int rtt_logging_create(
menu_ctx ctx,
......@@ -698,7 +699,7 @@ int rtt_logging_delete(
char *parameterstr);
int rtt_logging_close_files();
/* Module rs_rtt_view.c */
/* Module rt_rtt_view.c */
int rtt_view( menu_ctx parent_ctx,
char *filename,
......@@ -715,7 +716,7 @@ int rtt_view_buffer(
char *intitle,
int type);
/* Module rs_rtt_os.c */
/* Module rt_rtt_os.c */
int rtt_get_nodename( char *nodename, int size);
char *rtt_fgetname( FILE *fp, char *name, char *def_name);
......@@ -794,7 +795,7 @@ int rtt_replace_env( char *str, char *newstr);
int rtt_get_platform( char *platform);
int rtt_get_hw( char *hw);
/* Module rs_rtt_qiomod.c */
/* Module rt_rtt_qiomod.c */
int qio_assign( char *s, int *chn);
int qio_set_attr( int *chn);
......@@ -806,7 +807,7 @@ int qio_write( int *chn, int tmo, char *buf, int len);
#endif
/* Module rs_rtt_cmdmode.c */
/* Module rt_rtt_cmdmode.c */
int rtt_store_symbols( char *filename);
int rtt_show_symbols( menu_ctx ctx);
int rtt_replace_symbol( char *command, char *newcommand);
......@@ -820,7 +821,7 @@ int rtt_attribute_func (
int *return_int,
char *return_string);
/* Module rs_rtt_rtc.c */
/* Module rt_rtt_rtc.c */
#ifdef OS_ELN
int rtt_rtc( int function);
#endif
......
......@@ -60,6 +60,7 @@ extern unsigned char rtt_AlarmReturn;
extern unsigned char rtt_AlarmAck;
extern rtt_t_loggtable rtt_loggtable[ RTT_LOGG_MAXENTRY];
extern int rtt_gdh_started;
extern int rtt_qcom_started;
extern char rtt_AlarmLastMessage[80];
extern char rtt_AlarmText1[80];
extern char rtt_AlarmText2[80];
......@@ -115,6 +116,7 @@ unsigned char rtt_AlarmReturn = 0;
unsigned char rtt_AlarmAck = 0;
rtt_t_loggtable rtt_loggtable[ RTT_LOGG_MAXENTRY];
int rtt_gdh_started = 0;
int rtt_qcom_started = 0;
char rtt_AlarmLastMessage[80] = "";
char rtt_AlarmText1[80] = "";
char rtt_AlarmText2[80] = "";
......
......@@ -340,6 +340,7 @@ int rtt_initialize( char *username,
{
int sts;
int noneth = 0;
int qcom_only = 0;
rtt_init_state_table();
......@@ -349,6 +350,11 @@ int rtt_initialize( char *username,
noneth = 1;
rtt_priv = RTT_PRV_SYS;
}
else if ( strcmp( username, "QCOMONLY") == 0) {
noneth = 1;
qcom_only = 1;
rtt_priv = RTT_PRV_SYS;
}
if ( !noneth) {
sts = rtt_gdh_init();
......@@ -365,6 +371,9 @@ int rtt_initialize( char *username,
exit(-1);
}
}
else if ( qcom_only) {
sts = rtt_qcom_init();
}
sts = rtt_recall_create( &rtt_recallbuff);
if (EVEN(sts)) return sts;
......@@ -440,6 +449,31 @@ int rtt_gdh_init()
return RTT__SUCCESS;
}
/*************************************************************************
*
* Name: rtt_gdh_init()
*
* Type int
*
* Type Parameter IOGF Description
*
* Description:
* This function initializes gdh for rtt.
*
**************************************************************************/
int rtt_qcom_init()
{
pwr_tStatus sts;
qcom_sAid aid;
qcom_Init( &sts, &aid, "rt_rtt");
if ( EVEN(sts)) return sts;
rtt_qcom_started = 1;
return RTT__SUCCESS;
}
/*************************************************************************
*
* Name: rtt_configure()
......
......@@ -148,4 +148,6 @@
091104 cs wb Build method for WebGraph objects added.
091208 cs wb PostCreate methods for Channels added to set default number and representation.
091208 cs wb Default name for created objects in wtt fetched from name of previous sibling.
091209 cs wb ConnectAttribute method added to SevHist.
\ No newline at end of file
091209 cs wb ConnectAttribute method added to SevHist.
091218 cs wb Bugfix for next cix and next oix in ced.
091218 cs wb Bugfix in wb_vrepdb:child().
\ No newline at end of file
......@@ -107,6 +107,7 @@ void wb_pvd_pl::writeAttribute( co_procom *pcom, pwr_tOix oix, unsigned int offs
strncpy( (char *)((unsigned long)m_list[oix].body + (unsigned long)path_offset), path,
sizeof(body.Path));
}
m_list[oix].flags |= pl_mFlags_PathModified;
}
else if ( offset == (unsigned int)((char *)&body.Path - (char *)&body)) {
m_list[oix].flags |= pl_mFlags_PathModified;
......@@ -363,7 +364,6 @@ void wb_pvd_pl::process_list( pwr_tStatus *sts)
if ( m_list[i].flags & procom_obj_mFlags_Deleted &&
!(m_list[i].flags & procom_obj_mFlags_Created)) {
printf( "Project deleted %s\n", longname(i));
sprintf( cmd, "pwrp_env.sh delete project %s noconfirm",
body->Project);
......@@ -378,7 +378,7 @@ void wb_pvd_pl::process_list( pwr_tStatus *sts)
else if ( m_list[i].flags & procom_obj_mFlags_Created &&
!(m_list[i].flags & procom_obj_mFlags_Deleted)) {
if ( strcmp( body->CopyFrom, "") == 0) {
printf( "Project created %s\n", longname(i));
printf( "-- Project created %s\n", longname(i));
sprintf( cmd, "wb_pvd_pl.sh create project %s %s %s \"%s\" \"%s\"",
body->Project, body->Version, body->Path, longname(m_list[i].oix),
......@@ -394,7 +394,6 @@ void wb_pvd_pl::process_list( pwr_tStatus *sts)
else {
sprintf( cmd, "pwrp_env.sh copy project %s %s %s %s noconfirm",
body->CopyFrom, body->Project, body->Path, longname(m_list[i].oix));
printf( "%s\n", cmd);
csts = system( cmd);
if ( (csts >>= 8) != 0) {
sprintf( msg, "%s, in object %s", pwrp_status_to_string(csts),
......@@ -409,11 +408,25 @@ void wb_pvd_pl::process_list( pwr_tStatus *sts)
pwr_sClass_ProjectReg *origbody = (pwr_sClass_ProjectReg *)m_list[i].userdata;
if ( m_list[i].flags & pl_mFlags_ProjectModified) {
printf( "Project modified %s\n", longname(i));
printf( "-- Project modified %s\n", longname(i));
}
if ( m_list[i].flags & pl_mFlags_ProjectModified &&
strcmp( body->Project, origbody->Project) != 0) {
printf( "-- Project Name modified %s\n", longname(i));
sprintf( cmd, "pwrp_env.sh modify project %s -n %s", origbody->Project,
body->Project);
csts = system( cmd);
if ( (csts >>= 8) != 0) {
sprintf( msg, "%s, in object %s", pwrp_status_to_string(csts),
longname(m_list[i].oix));
MsgWindow::message('E', msg, msgw_ePop_Yes);
return;
}
}
if ( m_list[i].flags & pl_mFlags_PathModified &&
strcmp( body->Path, origbody->Path) != 0) {
printf( "Path modified %s\n", longname(i));
printf( "-- Project Path modified %s\n", longname(i));
sprintf( cmd, "pwrp_env.sh modify project %s -r %s", origbody->Project,
body->Path);
......
......@@ -6673,7 +6673,7 @@ int utl_compile (
sts = ldh_GetVidInfo( ldh_SessionToWB( ldhses), vol_id, &volinfo);
if (EVEN(sts)) return sts;
if ( volinfo.VolRep == ldh_eVolRep_Db) { // Todo!!!! Handle dbms
if ( volinfo.VolRep == ldh_eVolRep_Db || volinfo.VolRep == ldh_eVolRep_Dbms) { // Todo!!!! Handle dbms
volume_vect[i] = vol_id;
i++;
if ( i > UTL_INPUTLIST_MAX)
......
......@@ -50,14 +50,15 @@ protected:
pwr_tVid m_vid;
pwr_tCid m_cid;
vector<wb_srep*> m_srep;
int m_no_nix_incr;
public:
virtual ~wb_vrep() {};
wb_vrep() : m_vid(pwr_cNVid), m_cid(pwr_cNCid) {}
wb_vrep(pwr_tVid vid) : m_vid(vid), m_cid(pwr_cNCid) {}
wb_vrep(pwr_tVid vid, pwr_tCid cid) : m_vid(vid), m_cid(cid) {}
wb_vrep() : m_vid(pwr_cNVid), m_cid(pwr_cNCid), m_no_nix_incr(0) {}
wb_vrep(pwr_tVid vid) : m_vid(vid), m_cid(pwr_cNCid), m_no_nix_incr(0) {}
wb_vrep(pwr_tVid vid, pwr_tCid cid) : m_vid(vid), m_cid(cid), m_no_nix_incr(0) {}
virtual void unref() = 0;
virtual wb_vrep *ref() = 0;
......@@ -167,6 +168,7 @@ public:
void removeSrep( wb_srep *srep);
wb_srep *srep( pwr_tStatus *sts);
wb_srep *nextSrep( pwr_tStatus *sts, wb_srep* srep);
void noNixIncr( int incr) { m_no_nix_incr = incr;}
virtual const char *fileName() = 0;
virtual bool time( pwr_tTime *t) { return false;}
......
......@@ -106,7 +106,11 @@ wb_orep *wb_vrepced::createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination
strcpy( name_str, name.object());
wb_name n( name_str);
if ( soix)
m_vrep->noNixIncr( 1);
wb_orep *o = m_vrep->createObject( sts, cdef, d, n, soix);
if ( soix)
m_vrep->noNixIncr( 0);
if ( ODD(*sts))
setFlagsNewAttribute( sts, o);
......@@ -141,7 +145,11 @@ wb_orep *wb_vrepced::copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_destin
wb_name n( name_str);
if ( soix)
m_vrep->noNixIncr( 1);
wb_orep *o = m_vrep->copyObject( sts, orep, d, n, soix);
if ( soix)
m_vrep->noNixIncr( 0);
if ( ODD(*sts))
setFlagsNewAttribute( sts, o);
......@@ -652,8 +660,14 @@ bool wb_vrepced::importPasteObject(pwr_tOid destination, ldh_eDest destcode,
if ( po)
po->unref();
return m_vrep->importPasteObject( destination, destcode, keepoid, oid, cid, poid, boid,
if ( woidl.oix != oid.oix)
m_vrep->noNixIncr( 1);
bool rsts = m_vrep->importPasteObject( destination, destcode, keepoid, oid, cid, poid, boid,
name, flags, rbSize, dbSize, rbody, dbody, woidl, roid);
if ( woidl.oix != oid.oix)
m_vrep->noNixIncr( 0);
return rsts;
}
bool wb_vrepced::classeditorCheck( ldh_eDest dest_code, wb_orep *dest, pwr_tCid cid,
......@@ -782,7 +796,7 @@ bool wb_vrepced::classeditorCheck( ldh_eDest dest_code, wb_orep *dest, pwr_tCid
}
case pwr_eClass_ClassDef: {
// Child to ClassHier, oix from cix
pwr_tOix cix;
pwr_tOix cix = 0;
if ( !fth || fth->cid() != pwr_eClass_ClassHier) {
if ( fth)
fth->unref();
......@@ -819,7 +833,7 @@ bool wb_vrepced::classeditorCheck( ldh_eDest dest_code, wb_orep *dest, pwr_tCid
case pwr_eClass_TypeDef: {
// Child to TypeHier, oix from tix
pwr_tOix tix;
pwr_tOix tix = 0;
if ( !fth || fth->cid() != pwr_eClass_TypeHier) {
if ( fth)
fth->unref();
......@@ -951,7 +965,7 @@ bool wb_vrepced::classeditorCheck( ldh_eDest dest_code, wb_orep *dest, pwr_tCid
return false;
}
pwr_tOix aix;
pwr_tOix aix = 0;
nextAix( sts, fth, &aix);
if ( EVEN(*sts)) return false;
......
......@@ -357,7 +357,10 @@ wb_orep *wb_vrepdb::copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_destina
pwr_tOid woid;
woid.oix = oix;
woid.vid = m_vid;
oid = m_db->new_oid(txn, woid);
if ( !m_no_nix_incr)
oid = m_db->new_oid(txn, woid);
else
oid = woid;
if ( !oid.oix) {
*sts = LDH__BADOBJID;
return 0;
......@@ -462,7 +465,10 @@ wb_orep* wb_vrepdb::createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destination
pwr_tOid woid;
woid.oix = oix;
woid.vid = m_vid;
oid = m_db->new_oid(txn, woid);
if ( !m_no_nix_incr)
oid = m_db->new_oid(txn, woid);
else
oid = woid;
if ( !oid.oix) {
*sts = LDH__BADOBJID;
return 0;
......@@ -1138,6 +1144,12 @@ wb_orep *wb_vrepdb::child(pwr_tStatus *sts, const wb_orep *orp, wb_name &name)
try {
wb_db_name n(m_db, m_db->m_txn, orp->oid(), name);
int rc = n.get(m_db->m_txn);
if (rc) {
*sts = LDH__NOSUCHOBJ;
return 0;
}
m_ohead.get(m_db->m_txn, n.oid());
return new (this) wb_orepdb(&m_ohead.m_o);
}
......@@ -1564,7 +1576,10 @@ bool wb_vrepdb::importPasteObject(pwr_tOid doid, ldh_eDest destcode,
}
if (cdh_ObjidIsNotNull( woid)) {
oep->n_oid = m_db->new_oid(m_db->m_txn, woid);
if ( !m_no_nix_incr)
oep->n_oid = m_db->new_oid(m_db->m_txn, woid);
else
oep->n_oid = woid;
if ( !oep->n_oid.oix)
oep->n_oid = m_db->new_oid(m_db->m_txn);
}
......
......@@ -364,7 +364,10 @@ wb_orep *wb_vrepdbms::copyObject(pwr_tStatus *sts, const wb_orep *orep, wb_desti
pwr_tOid woid;
woid.oix = oix;
woid.vid = m_vid;
oid = m_db->new_oid(txn, woid);
if ( !m_no_nix_incr)
oid = m_db->new_oid(txn, woid);
else
oid = woid;
if ( !oid.oix) {
*sts = LDH__BADOBJID;
return 0;
......@@ -469,7 +472,10 @@ wb_orep* wb_vrepdbms::createObject(pwr_tStatus *sts, wb_cdef cdef, wb_destinatio
pwr_tOid woid;
woid.oix = oix;
woid.vid = m_vid;
oid = m_db->new_oid(txn, woid);
if ( !m_no_nix_incr)
oid = m_db->new_oid(txn, woid);
else
oid = woid;
if ( !oid.oix) {
*sts = LDH__BADOBJID;
return 0;
......@@ -1569,7 +1575,10 @@ bool wb_vrepdbms::importPasteObject(pwr_tOid doid, ldh_eDest destcode,
}
if (cdh_ObjidIsNotNull( woid)) {
oep->n_oid = m_db->new_oid(m_db->m_txn, woid);
if ( !m_no_nix_incr)
oep->n_oid = m_db->new_oid(m_db->m_txn, woid);
else
oep->n_oid = woid;
if ( !oep->n_oid.oix)
oep->n_oid = m_db->new_oid(m_db->m_txn);
}
......
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