Commit c8b74bbc authored by claes's avatar claes

Administrator replaced

parent d7900252
/*
* Proview $Id: wb_cdrep.cpp,v 1.27 2005-09-06 10:43:31 claes Exp $
* Proview $Id: wb_cdrep.cpp,v 1.28 2005-09-20 13:14:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -73,7 +73,7 @@ wb_cdrep::~wb_cdrep()
m_orep->unref();
}
wb_cdrep::wb_cdrep( wb_mvrep *mvrep, pwr_tCid cid) : m_nRef(0)
wb_cdrep::wb_cdrep( wb_mvrep *mvrep, pwr_tCid cid) : m_nRef(0), m_orep(0)
{
pwr_tOid oid = cdh_ClassIdToObjid( cid);
m_orep = mvrep->object( &m_sts, oid);
......@@ -83,7 +83,7 @@ wb_cdrep::wb_cdrep( wb_mvrep *mvrep, pwr_tCid cid) : m_nRef(0)
m_sts = LDH__SUCCESS;
}
wb_cdrep::wb_cdrep( wb_mvrep *mvrep, wb_name name) : m_nRef(0)
wb_cdrep::wb_cdrep( wb_mvrep *mvrep, wb_name name) : m_nRef(0), m_orep(0)
{
char str[80];
strcpy( str, "Class-");
......@@ -96,7 +96,7 @@ wb_cdrep::wb_cdrep( wb_mvrep *mvrep, wb_name name) : m_nRef(0)
m_sts = LDH__SUCCESS;
}
wb_cdrep::wb_cdrep( wb_mvrep *mvrep, const wb_orep& o) : m_nRef(0)
wb_cdrep::wb_cdrep( wb_mvrep *mvrep, const wb_orep& o) : m_nRef(0), m_orep(0)
{
pwr_tOid oid = cdh_ClassIdToObjid( o.cid());
m_orep = mvrep->object( &m_sts, oid);
......@@ -106,7 +106,7 @@ wb_cdrep::wb_cdrep( wb_mvrep *mvrep, const wb_orep& o) : m_nRef(0)
m_sts = LDH__SUCCESS;
}
wb_cdrep::wb_cdrep( const wb_orep& o) : m_nRef(0)
wb_cdrep::wb_cdrep( const wb_orep& o) : m_nRef(0), m_orep(0)
{
pwr_tStatus sts;
......
/*
* Proview $Id: wb_ldh.cpp,v 1.45 2005-09-06 10:43:31 claes Exp $
* Proview $Id: wb_ldh.cpp,v 1.46 2005-09-20 13:14:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -1805,7 +1805,8 @@ ldh_CreateLoadFile(ldh_tSession session)
}
pwr_tStatus
ldh_WbDump( ldh_tSession session, char *objname, char *dumpfile, int keep_name)
ldh_WbDump( ldh_tSession session, char *objname, char *dumpfile, int keep_name,
int noindex)
{
wb_session *sp = (wb_session*)session;
char fname[200];
......@@ -1823,6 +1824,8 @@ ldh_WbDump( ldh_tSession session, char *objname, char *dumpfile, int keep_name)
wb_print_wbl wprint( fp);
if ( keep_name)
wprint.keepName();
if ( noindex)
wprint.noIndex();
if ( !objname)
wprint.printVolume( *sp);
else {
......
/*
* Proview $Id: wb_ldh.h,v 1.27 2005-09-06 10:43:31 claes Exp $
* Proview $Id: wb_ldh.h,v 1.28 2005-09-20 13:14:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -44,6 +44,9 @@ extern "C" {
#define ldh_cPlcHostVolume (0 + ((pwr_tVolumeId)254 << 24) + (254 << 16) + (254 << 8) + 250)
#define ldh_cIoConnectVolume cdh_cIoConnectVolume
#define ldh_cProjectListVolume (0 + ((pwr_tVolumeId)254 << 24) + (254 << 16) + (254 << 8) + 248)
#define ldh_cGlobalVolumeListVolume (0 + ((pwr_tVolumeId)254 << 24) + (254 << 16) + (254 << 8) + 247)
#define ldh_cUserDatabaseVolume (0 + ((pwr_tVolumeId)254 << 24) + (254 << 16) + (254 << 8) + 246)
#define ldh_cVolatileVolMin (0 + ((pwr_tVolumeId)254 << 24) + (254 << 16) + (254 << 8) + 0)
#define ldh_cVolatileVolMax (0 + ((pwr_tVolumeId)254 << 24) + (254 << 16) + (254 << 8) + 100)
......@@ -1100,7 +1103,8 @@ ldh_WbDump(
ldh_tSession session,
char *objname,
char *dumpfile,
int keep_name
int keep_name,
int noindex
);
pwr_tStatus
......
/*
* Proview $Id: wb_print_wbl.h,v 1.8 2005-09-06 10:43:31 claes Exp $
* Proview $Id: wb_print_wbl.h,v 1.9 2005-09-20 13:14:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -98,6 +98,7 @@ public:
int getErrCnt() const { return m_errCnt;}
void resetErrCnt() {m_errCnt = 0; }
void keepName() { m_keepName = true;}
void noIndex() { m_idxFlag = false;}
void printHierarchy(wb_volume& v, wb_object& o); //< Prints a hierarchy
void printObject(wb_volume& v, wb_object& o, bool recursive = true); //< Prints an object
......
This diff is collapsed.
/*
* Proview $Id: wb_pvd_file.h,v 1.1 2005-09-20 13:14:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#ifndef wb_pvd_file_h
#define wb_pvd_file_h
#include "wb_provider.h"
typedef enum {
pitem_mFlags_Deleted = 1 << 0,
pitem_mFlags_Created = 1 << 1,
} pitem_mFlags;
class pitem {
public:
int cid;
pwr_tOix oix;
pwr_tOix fthoix;
pwr_tOix bwsoix;
pwr_tOix fwsoix;
pwr_tOix fchoix;
pwr_tOix lchoix;
char name[32];
char lname[120];
unsigned long flags;
void *body;
unsigned int body_size;
pitem() : fthoix(0), bwsoix(0), fwsoix(0), fchoix(0), lchoix(0), flags(0),
body(0), body_size(0)
{ strcpy(lname,"");}
~pitem()
{
if ( body)
free(body);
}
pitem( const pitem& x)
{
memcpy( this, &x, sizeof(pitem));
if ( x.body) {
body = calloc( 1, body_size);
memcpy( body, x.body, body_size);
}
}
pitem& operator=(const pitem& x)
{
memcpy( this, &x, sizeof(pitem));
if ( body) {
body = calloc( 1, body_size);
memcpy( body, x.body, body_size);
}
return *this;
}
};
class wb_pvd_file : public wb_provider {
public:
wb_pvd_file() : root(0), next_oix(1) {}
virtual void object( wb_procom *pcom);
virtual void objectOid( wb_procom *pcom, pwr_tOix oix);
virtual void objectName( wb_procom *pcom, char *name);
virtual void objectBody( wb_procom *pcom, pwr_tOix oix);
virtual void createObject( wb_procom *pcom, pwr_tOix destoix, int desttype,
pwr_tCid cid, char *name);
virtual void moveObject( wb_procom *pcom, pwr_tOix oix, pwr_tOix destoix, int desttype);
virtual void copyObject( wb_procom *pcom, pwr_tOix oix, pwr_tOix destoix, int desttype,
char *name);
virtual void deleteObject( wb_procom *pcom, pwr_tOix oix);
virtual void deleteFamily( wb_procom *pcom, pwr_tOix oix);
virtual void renameObject( wb_procom *pcom, pwr_tOix oix, char *name);
virtual void writeAttribute( wb_procom *pcom, pwr_tOix oix, unsigned int offset,
unsigned int size, char *buffer);
virtual void commit( wb_procom *pcom);
virtual void abort( wb_procom *pcom);
virtual char *longname( pwr_tOix oix);
virtual void delete_tree( pwr_tOix oix);
virtual void save( pwr_tStatus *sts) {}
virtual void load( pwr_tStatus *sts) {}
vector<pitem> m_list;
pwr_tOix root;
pwr_tOix next_oix;
};
#endif
/*
* Proview $Id: wb_pvd_gvl.cpp,v 1.1 2005-09-20 13:14:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#include <vector.h>
#include <string.h>
#include <stdio.h>
#include <iostream.h>
#include <fstream.h>
#include "pwr.h"
#include "pwr_class.h"
#include "pwr_baseclasses.h"
#include "wb_vext.h"
#include "wb_pvd_gvl.h"
#include "wb_ldh.h"
#include "wb_ldh_msg.h"
extern "C" {
#include "co_cdh.h"
#include "co_dcli.h"
}
void wb_pvd_gvl::save( pwr_tStatus *sts)
{
ofstream of;
pwr_tFileName fname;
*sts = LDH__SUCCESS;
dcli_translate_filename( fname, "$pwra_db/pwr_volumelist.tst");
of.open( fname);
if ( !of) {
*sts = LDH__FILEOPEN;
return;
}
for ( int oix = m_list[0].fchoix; oix; oix = m_list[oix].fwsoix)
save_item( oix, of);
of.close();
}
void wb_pvd_gvl::save_item( pwr_tOix oix, ofstream& of)
{
switch ( m_list[oix].cid) {
case pwr_eClass_PlantHier: {
pwr_sPlantHier *body = (pwr_sPlantHier *)m_list[oix].body;
of << "!**Menu " << m_list[oix].name << " { // " << body->Description << endl;
for ( int ix = m_list[oix].fchoix; ix; ix = m_list[ix].fwsoix)
save_item( ix, of);
of << "!**}" << endl;
break;
}
case pwr_cClass_VolumeReg: {
pwr_sClass_VolumeReg *body = (pwr_sClass_VolumeReg *)m_list[oix].body;
of << " " << m_list[oix].name << " " <<
cdh_VolumeIdToString( 0, body->VolumeId, 0, 0) << " " << body->Project <<
endl;
for ( int ix = m_list[oix].fchoix; ix; ix = m_list[ix].fwsoix)
save_item( ix, of);
break;
}
default: ;
}
}
void wb_pvd_gvl::load( pwr_tStatus *rsts)
{
char line[200];
char line_item[6][80];
int num;
ifstream is;
pwr_tFileName fname;
int line_cnt = 0;
pwr_tStatus sts;
int menu_stack[100];
int menu_cnt = 0;
char description[80];
*rsts = LDH__SUCCESS;
dcli_translate_filename( fname, "$pwra_db/pwr_volumelist.tst");
is.open( fname);
if ( !is) {
*rsts = LDH__NEWFILE;
return;
}
// Create Root object
pitem rootitem;
strcpy( rootitem.name, "GlobalVolumeList");
rootitem.cid = pwr_eClass_PlantHier;
rootitem.oix = 0;
m_list.push_back(rootitem);
menu_stack[menu_cnt] = rootitem.oix;
menu_cnt++;
while ( is.getline( line, sizeof(line))) {
line_cnt++;
if ( line[0] == '!') {
if ( strncmp( line, "!**Menu", 7) == 0) {
// Add PlantHier
char *s = strstr( line, "// ");
if ( s) {
strncpy( description, s+3, sizeof(description));
description[sizeof(description)-1] = 0;
}
else
strcpy( description, "");
num = dcli_parse( line, " ", "", (char *)line_item,
sizeof(line_item)/sizeof(line_item[0]),
sizeof(line_item[0]), 0);
if ( num < 3) {
cout << "Syntax error " << fname << " row " << line_cnt << endl;
continue;
}
pitem plantitem;
strcpy( plantitem.name, line_item[1]);
plantitem.cid = pwr_eClass_PlantHier;
plantitem.oix = next_oix++;
plantitem.fthoix = menu_stack[menu_cnt - 1];
plantitem.bwsoix = m_list[plantitem.fthoix].lchoix;
plantitem.fwsoix = 0;
plantitem.body_size = sizeof(pwr_sPlantHier);
pwr_sPlantHier *plantbody = (pwr_sPlantHier *) calloc( 1, plantitem.body_size);
plantitem.body = plantbody;
strcpy( plantbody->Description, description);
m_list.push_back(plantitem);
if ( plantitem.bwsoix != 0)
m_list[plantitem.bwsoix].fwsoix = plantitem.oix;
m_list[plantitem.fthoix].lchoix = plantitem.oix;
if ( m_list[plantitem.fthoix].fchoix == 0)
m_list[plantitem.fthoix].fchoix = plantitem.oix;
menu_stack[menu_cnt] = plantitem.oix;
menu_cnt++;
}
else if ( strncmp( line, "!**}", 4) == 0) {
if ( menu_cnt == 0) {
cout << "Syntax error " << fname << " row " << line_cnt << endl;
continue;
}
menu_cnt--;
}
continue;
}
dcli_trim( line, line);
num = dcli_parse( line, " ", "", (char *)line_item,
sizeof(line_item)/sizeof(line_item[0]),
sizeof(line_item[0]), 0);
if ( num != 3) {
cout << "Syntax error " << fname << " row " << line_cnt << endl;
continue;
}
pitem volitem;
strcpy( volitem.name, line_item[0]);
volitem.body_size = sizeof(pwr_sClass_VolumeReg);
pwr_sClass_VolumeReg *volbody =
(pwr_sClass_VolumeReg *) calloc( 1, volitem.body_size);
volitem.body = volbody;
strcpy( volbody->Project, line_item[2]);
sts = cdh_StringToVolumeId( line_item[1], &volbody->VolumeId);
if ( EVEN(sts)) {
cout << "Syntax error " << fname << " row " << line_cnt << endl;
continue;
}
volitem.cid = pwr_cClass_VolumeReg;
volitem.oix = next_oix++;
volitem.fthoix = menu_stack[menu_cnt - 1];
volitem.bwsoix = m_list[volitem.fthoix].lchoix;
volitem.fwsoix = 0;
strcpy( volbody->Description, line_item[1]);
for ( int i = strlen(volbody->Description); i < 18; i++)
strcat( volbody->Description, " ");
strcat( volbody->Description, line_item[2]);
m_list.push_back(volitem);
if ( volitem.bwsoix != 0)
m_list[volitem.bwsoix].fwsoix = volitem.oix;
m_list[volitem.fthoix].lchoix = volitem.oix;
if ( m_list[volitem.fthoix].fchoix == 0)
m_list[volitem.fthoix].fchoix = volitem.oix;
}
}
/*
* Proview $Id: wb_pvd_gvl.h,v 1.1 2005-09-20 13:14:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelösund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#ifndef wb_pvd_gvl_h
#define wb_pvd_gvl_h
#include "wb_pvd_file.h"
class wb_pvd_gvl : public wb_pvd_file {
public:
wb_pvd_gvl()
{
pwr_tStatus sts;
load( &sts);
}
void load( pwr_tStatus *sts);
void save( pwr_tStatus *sts);
void save_item( pwr_tOix oix, ofstream &of);
};
#endif
/*
* Proview $Id: wb_pvd_pl.cpp,v 1.1 2005-09-20 13:14:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#include <vector.h>
#include <string.h>
#include <stdio.h>
#include <iostream.h>
#include <fstream.h>
#include "pwr.h"
#include "pwr_class.h"
#include "pwr_baseclasses.h"
#include "wb_vext.h"
#include "wb_pvd_pl.h"
#include "wb_ldh.h"
#include "wb_ldh_msg.h"
extern "C" {
#include "co_cdh.h"
#include "co_dcli.h"
}
void wb_pvd_file::writeAttribute( wb_procom *pcom, pwr_tOix oix, unsigned int offset,
unsigned int size, char *buffer)
{
if ( oix >= m_list.size() || oix <= 0) {
pcom->provideStatus( LDH__NOSUCHOBJ);
return;
}
switch ( m_list[oix].cid) {
case pwr_cClass_ProjectReg: {
pwr_sClass_ProjectReg body;
if ( offset == (unsigned int)((char *)&body.Project - (char *)&body))
m_list[oix].flags |= pl_mFlags_ProjectModified;
else if ( offset == (unsigned int)((char *)&body.Path - (char *)&body))
m_list[oix].flags |= pl_mFlags_PathModified;
break;
}
default: ;
}
wb_pvd_file::writeAttribute( pcom, oix, offset, size, buffer);
}
void wb_pvd_pl::save( pwr_tStatus *sts)
{
process_list( sts);
save_list( sts);
}
void wb_pvd_pl::process_list( pwr_tStatus *sts)
{
for ( int i = 0; i < (int) m_list.size(); i++) {
switch ( m_list[i].cid) {
case pwr_cClass_ProjectReg: {
if ( m_list[i].flags & pitem_mFlags_Deleted &&
!(m_list[i].flags & pitem_mFlags_Created)) {
printf( "Project deleted %s\n", longname(i));
}
else if ( m_list[i].flags & pitem_mFlags_Created &&
!(m_list[i].flags & pitem_mFlags_Deleted)) {
printf( "Project deleted %s\n", longname(i));
}
else if ( !(m_list[i].flags & pitem_mFlags_Deleted)) {
if ( m_list[i].flags & pl_mFlags_ProjectModified) {
printf( "Project modified %s\n", longname(i));
}
if ( m_list[i].flags & pl_mFlags_PathModified) {
printf( "Path modified %s\n", longname(i));
}
}
break;
}
default: ;
}
}
}
void wb_pvd_pl::save_list( pwr_tStatus *sts)
{
ofstream of;
pwr_tFileName fname;
*sts = LDH__SUCCESS;
dcli_translate_filename( fname, "$pwra_db/pwr_projectlist.tst");
of.open( fname);
if ( !of) {
*sts = LDH__FILEOPEN;
return;
}
for ( int oix = m_list[0].fchoix; oix; oix = m_list[oix].fwsoix) {
if ( !(m_list[oix].flags & pitem_mFlags_Deleted))
save_item( oix, of);
}
of.close();
}
void wb_pvd_pl::save_item( pwr_tOix oix, ofstream& of)
{
switch ( m_list[oix].cid) {
case pwr_eClass_Hier: {
pwr_sHier *body = (pwr_sHier *)m_list[oix].body;
if ( oix != 1)
of << "!**Menu " << m_list[oix].name << " { // " << body->Description << endl;
for ( int ix = m_list[oix].fchoix; ix; ix = m_list[ix].fwsoix) {
if ( !(m_list[ix].flags & pitem_mFlags_Deleted))
save_item( ix, of);
}
if ( oix != 1)
of << "!**}" << endl;
break;
}
case pwr_cClass_ProjectReg: {
char hname[120];
pwr_sClass_ProjectReg *body = (pwr_sClass_ProjectReg *)m_list[oix].body;
strcpy( hname, longname(oix));
of << body->Project << " " << body->Version << " " << body->Path << " " << hname
<< " \"" << body->Description << "\"" << endl;
for ( int ix = m_list[oix].fchoix; ix; ix = m_list[ix].fwsoix) {
if ( !(m_list[ix].flags & pitem_mFlags_Deleted))
save_item( ix, of);
}
break;
}
case pwr_cClass_BaseReg: {
pwr_sClass_BaseReg *body = (pwr_sClass_BaseReg *)m_list[oix].body;
of << "%base " << body->Version << " " << body->Path << endl;
break;
}
default: ;
}
}
void wb_pvd_pl::load( pwr_tStatus *rsts)
{
char line[200];
char line_item[6][80];
int num;
ifstream is;
pwr_tFileName fname;
int line_cnt = 0;
int menu_stack[100];
int menu_cnt = 0;
char description[80];
char *s;
*rsts = LDH__SUCCESS;
dcli_translate_filename( fname, "$pwra_db/pwr_projectlist.tst");
is.open( fname);
if ( !is) {
*rsts = LDH__NEWFILE;
return;
}
// Create Root object
pitem rootitem;
strcpy( rootitem.name, "ProjectList");
rootitem.cid = pwr_eClass_Hier;
rootitem.oix = 0;
m_list.push_back(rootitem);
menu_stack[menu_cnt] = rootitem.oix;
menu_cnt++;
// Create Root for BaseReg objects
pitem brootitem;
strcpy( brootitem.name, "Bases");
brootitem.cid = pwr_eClass_Hier;
brootitem.oix = next_oix++;
brootitem.fthoix = m_list[rootitem.oix].oix;
m_list[rootitem.oix].fchoix = brootitem.oix;
m_list[rootitem.oix].lchoix = brootitem.oix;
m_list.push_back(brootitem);
while ( is.getline( line, sizeof(line))) {
line_cnt++;
if ( line[0] == '!') {
if ( strncmp( line, "!**Menu", 7) == 0) {
// Add Hier
char *s = strstr( line, "// ");
if ( s) {
strncpy( description, s+3, sizeof(description));
description[sizeof(description)-1] = 0;
}
else
strcpy( description, "");
num = dcli_parse( line, " ", "", (char *)line_item,
sizeof(line_item)/sizeof(line_item[0]),
sizeof(line_item[0]), 0);
if ( num < 3) {
cout << "Syntax error " << fname << " row " << line_cnt << endl;
continue;
}
pitem hieritem;
strcpy( hieritem.name, line_item[1]);
hieritem.cid = pwr_eClass_Hier;
hieritem.oix = next_oix++;
hieritem.fthoix = menu_stack[menu_cnt - 1];
hieritem.bwsoix = m_list[hieritem.fthoix].lchoix;
hieritem.fwsoix = 0;
hieritem.body_size = sizeof(pwr_sHier);
pwr_sHier *hierbody = (pwr_sHier *) calloc( 1, hieritem.body_size);
hieritem.body = hierbody;
strcpy( hierbody->Description, description);
m_list.push_back(hieritem);
if ( hieritem.bwsoix != 0)
m_list[hieritem.bwsoix].fwsoix = hieritem.oix;
m_list[hieritem.fthoix].lchoix = hieritem.oix;
if ( m_list[hieritem.fthoix].fchoix == 0)
m_list[hieritem.fthoix].fchoix = hieritem.oix;
menu_stack[menu_cnt] = hieritem.oix;
menu_cnt++;
}
else if ( strncmp( line, "!**}", 4) == 0) {
if ( menu_cnt == 0) {
cout << "Syntax error " << fname << " row " << line_cnt << endl;
continue;
}
menu_cnt--;
}
continue;
}
dcli_trim( line, line);
num = dcli_parse( line, " ", "", (char *)line_item,
sizeof(line_item)/sizeof(line_item[0]),
sizeof(line_item[0]), 0);
if ( strncmp( line, "%base", 5) == 0) {
// Insert BaseReg under baseroot
if ( num != 3) {
cout << "Syntax error " << fname << " row " << line_cnt << endl;
continue;
}
pitem baseitem;
strcpy( baseitem.name, basename(line_item[1]));
baseitem.cid = pwr_cClass_BaseReg;
baseitem.oix = next_oix++;
baseitem.fthoix = brootitem.oix;
baseitem.bwsoix = m_list[baseitem.fthoix].lchoix;
baseitem.fwsoix = 0;
baseitem.body_size = sizeof(pwr_sClass_BaseReg);
pwr_sClass_BaseReg *basebody =
(pwr_sClass_BaseReg *) calloc( 1, baseitem.body_size);
baseitem.body = basebody;
strcpy( basebody->Description, "");
strcpy( basebody->Version, line_item[1]);
strcpy( basebody->Path, line_item[2]);
m_list.push_back(baseitem);
if ( baseitem.bwsoix != 0)
m_list[baseitem.bwsoix].fwsoix = baseitem.oix;
m_list[baseitem.fthoix].lchoix = baseitem.oix;
if ( m_list[baseitem.fthoix].fchoix == 0)
m_list[baseitem.fthoix].fchoix = baseitem.oix;
continue;
}
if ( num != 5) {
cout << "Syntax error " << fname << " row " << line_cnt << endl;
continue;
}
pitem projitem;
if ( (s = strrchr( line_item[3], '-')))
strcpy( projitem.name, s + 1);
else
strcpy( projitem.name, line_item[3]);
projitem.body_size = sizeof(pwr_sClass_ProjectReg);
pwr_sClass_ProjectReg *projbody =
(pwr_sClass_ProjectReg *) calloc( 1, projitem.body_size);
projitem.body = projbody;
strncpy( projbody->Version, line_item[1], sizeof( projbody->Version));
strncpy( projbody->Project, line_item[0], sizeof( projbody->Project));
projitem.cid = pwr_cClass_ProjectReg;
projitem.oix = next_oix++;
projitem.fthoix = menu_stack[menu_cnt - 1];
projitem.bwsoix = m_list[projitem.fthoix].lchoix;
projitem.fwsoix = 0;
strcpy( projbody->Description, line_item[4]);
strcpy( projbody->Path, line_item[2]);
m_list.push_back(projitem);
if ( projitem.bwsoix != 0)
m_list[projitem.bwsoix].fwsoix = projitem.oix;
m_list[projitem.fthoix].lchoix = projitem.oix;
if ( m_list[projitem.fthoix].fchoix == 0)
m_list[projitem.fthoix].fchoix = projitem.oix;
}
}
// Convert version to a valid object name
char *wb_pvd_pl::basename( char *version)
{
char *s, *t;
static char str[80];
strcpy( str, "Base");
for ( s = version, t = &str[strlen(str)]; *s; s++) {
if ( *s == '.')
continue;
*t++ = *s;
}
*t = 0;
return str;
}
/*
* Proview $Id: wb_pvd_pl.h,v 1.1 2005-09-20 13:14:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#ifndef wb_pvd_pl_h
#define wb_pvd_pl_h
#include "wb_pvd_file.h"
typedef enum {
pl_mFlags_ProjectModified = 1 << 16,
pl_mFlags_PathModified = 1 << 17
} pl_mFlags;
class wb_pvd_pl : public wb_pvd_file {
public:
wb_pvd_pl()
{
pwr_tStatus sts;
load( &sts);
}
void writeAttribute( wb_procom *pcom, pwr_tOix oix, unsigned int offset,
unsigned int size, char *buffer);
void load( pwr_tStatus *sts);
void save( pwr_tStatus *sts);
void process_list( pwr_tStatus *sts);
void save_list( pwr_tStatus *sts);
void save_item( pwr_tOix oix, ofstream &of);
char *basename( char *version);
};
#endif
/*
* Proview $Id: wb_pvd_udb.cpp,v 1.1 2005-09-20 13:14:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
#include <vector.h>
#include <string.h>
#include <stdio.h>
#include <iostream.h>
#include <fstream.h>
#include "pwr.h"
#include "pwr_class.h"
#include "pwr_baseclasses.h"
#include "wb_vext.h"
#include "wb_pvd_udb.h"
#include "wb_ldh.h"
#include "wb_ldh_msg.h"
extern "C" {
#include "co_cdh.h"
#include "co_dcli.h"
}
void wb_pvd_udb::save( pwr_tStatus *sts)
{
gu->clear();
for ( int i = 1; i < (int)m_list.size(); i++) {
if ( m_list[i].flags & pitem_mFlags_Deleted)
continue;
switch ( m_list[i].cid) {
case pwr_cClass_SystemGroupReg: {
pwr_sClass_SystemGroupReg *body = (pwr_sClass_SystemGroupReg *)m_list[i].body;
*sts = gu->add_system( groupname(longname( m_list[i].oix)), body->Attributes);
if ( EVEN(*sts)) return;
break;
}
case pwr_cClass_UserReg: {
pwr_sClass_UserReg *body = (pwr_sClass_UserReg *)m_list[i].body;
char gname[120];
char *s;
strcpy( gname, longname( m_list[i].oix));
if ( (s = strrchr( gname, '-')))
*s = 0;
*sts = gu->add_user( groupname(gname), m_list[i].name, body->Password,
body->Privileges);
if ( EVEN(*sts)) return;
break;
}
default: ;
}
}
*sts = gu->save();
}
char *wb_pvd_udb::groupname( char *name)
{
static char str[200];
char *s, *t;
for ( s = name, t = str; *s; s++,t++) {
if ( *s == '-')
*t = '.';
else
*t = *s;
}
*t = 0;
return str;
}
void wb_pvd_udb::load( pwr_tStatus *rsts)
{
char filename[256];
int sts;
if ( gu)
gu->clear();
else
gu = new GeUser();
sts = dcli_get_defaultfilename( user_cFilename, filename, "");
gu->load( filename);
// Create Root object
pitem rootitem;
strcpy( rootitem.name, "GlobalVolumeList");
rootitem.cid = pwr_eClass_PlantHier;
rootitem.oix = 0;
m_list.push_back(rootitem);
menu_stack[menu_cnt] = rootitem.oix;
menu_cnt++;
SystemList *systemgroup = gu->root_system();
while ( systemgroup) {
load_systemgroup( systemgroup);
systemgroup = systemgroup->next_system();
}
}
void wb_pvd_udb::load_systemgroup( SystemList *systemgroup)
{
pitem item;
pwr_sClass_SystemGroupReg *body;
char sname[120];
char *s;
item.oix = next_oix++;
item.cid = pwr_cClass_SystemGroupReg;
item.fthoix = menu_stack[menu_cnt - 1];
item.bwsoix = m_list[item.fthoix].lchoix;
if ( item.bwsoix)
m_list[item.bwsoix].fwsoix = item.oix;
if ( m_list[item.fthoix].fchoix == 0)
m_list[item.fthoix].fchoix = item.oix;
m_list[item.fthoix].lchoix = item.oix;
item.body_size = sizeof(pwr_sClass_SystemGroupReg);
body = (pwr_sClass_SystemGroupReg *) calloc( 1, item.body_size);
item.body = body;
gu->get_system_name( systemgroup, sname);
if (( s = strrchr( sname, '.')))
strcpy( item.name, s+1);
else
strcpy( item.name, sname);
gu->get_system_data( sname, &body->Attributes);
menu_stack[menu_cnt] = item.oix;
menu_cnt++;
m_list.push_back( item);
UserList *user = systemgroup->first_user();
while ( user) {
load_user( user, systemgroup);
user = user->next_user();
}
SystemList *sg = systemgroup->first_system();
while ( sg) {
load_systemgroup( sg);
sg = sg->next_system();
}
menu_cnt--;
}
void wb_pvd_udb::load_user( UserList *user, SystemList *sg)
{
pitem item;
pwr_sClass_UserReg *body;
item.oix = next_oix++;
item.cid = pwr_cClass_UserReg;
item.fthoix = menu_stack[menu_cnt - 1];
item.bwsoix = m_list[item.fthoix].lchoix;
if ( item.bwsoix)
m_list[item.bwsoix].fwsoix = item.oix;
if ( m_list[item.fthoix].fchoix == 0)
m_list[item.fthoix].fchoix = item.oix;
m_list[item.fthoix].lchoix = item.oix;
item.body_size = sizeof(pwr_sClass_UserReg);
body = (pwr_sClass_UserReg *) calloc( 1, item.body_size);
item.body = body;
strcpy( item.name, user->get_name());
user->get_data( body->Password, &body->Privileges);
m_list.push_back( item);
}
/*
* Proview $Id: wb_pvd_udb.h,v 1.1 2005-09-20 13:14:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation, either version 2 of
* the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with the program, if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/
// Provider for user database
#ifndef wb_pvd_udb_h
#define wb_pvd_udb_h
#include "wb_pvd_file.h"
#include "co_user.h"
class wb_pvd_udb : public wb_pvd_file {
public:
wb_pvd_udb() : gu(0), menu_cnt(0)
{
pwr_tStatus sts;
load( &sts);
}
void load( pwr_tStatus *sts);
void load_systemgroup( SystemList *systemgroup);
void load_user( UserList *user, SystemList *sg);
void save( pwr_tStatus *sts);
char *groupname( char *name);
GeUser *gu;
int menu_stack[100];
int menu_cnt;
};
#endif
/*
* Proview $Id: wb_vext.h,v 1.5 2005-09-06 10:43:32 claes Exp $
* Proview $Id: wb_vext.h,v 1.6 2005-09-20 13:14:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -22,10 +22,20 @@
typedef enum {
vext_eMsgType_Status,
vext_eMsgType_Object,
vext_eMsgType_ObjectOid,
vext_eMsgType_ObjectName,
vext_eMsgType_ObjectBody
vext_eMsgType_ObjectBody,
vext_eMsgType_CreateObject,
vext_eMsgType_MoveObject,
vext_eMsgType_CopyObject,
vext_eMsgType_DeleteObject,
vext_eMsgType_DeleteFamily,
vext_eMsgType_RenameObject,
vext_eMsgType_WriteAttr,
vext_eMsgType_Commit,
vext_eMsgType_Abort
} vext_eMsgType;
// Question message types
......@@ -41,16 +51,77 @@ typedef struct {
pwr_tOix Oix;
} vext_sQMsgOid;
typedef struct {
unsigned long message_type;
vext_eMsgType Type;
pwr_tOix Oix;
} vext_sQMsgDeleteObject;
typedef struct {
unsigned long message_type;
vext_eMsgType Type;
pwr_tOix Oix;
} vext_sQMsgDeleteFamily;
typedef struct {
unsigned long message_type;
vext_eMsgType Type;
char Name[120];
} vext_sQMsgObjectName;
typedef struct {
unsigned long message_type;
vext_eMsgType Type;
pwr_tOix DestOix;
int DestType;
pwr_tCid Cid;
char Name[120];
} vext_sQMsgCreateObject;
typedef struct {
unsigned long message_type;
vext_eMsgType Type;
pwr_tOix Oix;
pwr_tOix DestOix;
int DestType;
} vext_sQMsgMoveObject;
typedef struct {
unsigned long message_type;
vext_eMsgType Type;
pwr_tOix Oix;
pwr_tOix DestOix;
int DestType;
char Name[120];
} vext_sQMsgCopyObject;
typedef struct {
unsigned long message_type;
vext_eMsgType Type;
pwr_tOix Oix;
char Name[120];
} vext_sQMsgRenameObject;
typedef struct {
unsigned long message_type;
vext_eMsgType Type;
pwr_tOix Oix;
unsigned int Offset;
unsigned int Size;
char Buffer[512];
} vext_sQMsgWriteAttr;
typedef union {
vext_sQMsgAny Any;
vext_sQMsgOid Oid;
vext_sQMsgObjectName ObjectName;
vext_sQMsgCreateObject CreateObject;
vext_sQMsgMoveObject MoveObject;
vext_sQMsgCopyObject CopyObject;
vext_sQMsgDeleteObject DeleteObject;
vext_sQMsgDeleteFamily DeleteFamily;
vext_sQMsgRenameObject RenameObject;
vext_sQMsgWriteAttr WriteAttr;
} vext_sQMsg;
// Answer message types
......
This diff is collapsed.
/*
* Proview $Id: wb_vrepext.h,v 1.4 2005-09-06 10:43:32 claes Exp $
* Proview $Id: wb_vrepext.h,v 1.5 2005-09-20 13:14:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -29,6 +29,8 @@
#include "co_dbs.h"
#include "wb_import.h"
#include "wb_vext.h"
#include "wb_provider.h"
#include "wb_cdef.h"
class wb_vrepext;
......@@ -48,7 +50,8 @@ class ext_object
m_oid.oix = 0;
m_oid.vid = 0;
}
ext_object( vext_sAMsgObject *msg, pwr_tVid vid) : rbody_size(0), dbody_size(0), rbody(0), dbody(0)
ext_object( vext_sAMsgObject *msg, pwr_tVid vid, wb_cdef &cdef) :
rbody_size(0), dbody_size(0), rbody(0), dbody(0)
{
strcpy( m_name, msg->name);
strcpy( m_longname, msg->longname);
......@@ -65,11 +68,36 @@ class ext_object
lchoid.oix = msg->lchoix;
lchoid.vid = vid;
m_cid = msg->cid;
m_flags = cdef.flags();
}
~ext_object() {
if ( rbody_size) free( rbody);
if ( dbody_size) free( dbody);
}
ext_object(const ext_object& x) {
memcpy( this, &x, sizeof(x));
if ( rbody_size) {
rbody = calloc( 1, rbody_size);
memcpy( rbody, x.rbody, rbody_size);
}
if ( dbody_size) {
dbody = calloc( 1, dbody_size);
memcpy( dbody, x.dbody, dbody_size);
}
}
ext_object& operator=(const ext_object& x) {
memcpy( this, &x, sizeof(x));
if ( rbody_size) {
rbody = calloc( 1, rbody_size);
memcpy( rbody, x.rbody, rbody_size);
}
if ( dbody_size) {
dbody = calloc( 1, dbody_size);
memcpy( dbody, x.dbody, dbody_size);
}
return *this;
}
const char *name() const { return m_name; }
const char *longname() const { return m_longname; }
bool exportHead(wb_import &i) { return false;}
......@@ -107,15 +135,14 @@ class wb_vrepext : public wb_vrep
wb_merep *m_merep;
unsigned int m_nRef;
ext_object volume_object;
char m_provider[200];
char m_providerstr[200];
int m_connected;
int m_msgsndid;
int m_msgrcvid;
ext_object m_cashe;
map<pwr_tOix, ext_object *> m_oix_list;
typedef map<pwr_tOix, ext_object *>::iterator iterator_oix_list;
wb_procom *m_procom;
wb_provider *m_provider;
procom_eType m_ptype;
public:
wb_vrepext( wb_erep *erep) :
......@@ -142,13 +169,6 @@ public:
wb_erep *erep() {return m_erep;}
wb_merep *merep() const { return m_merep;}
int nextOix();
ext_object *findObject( pwr_tOix oix);
ext_object *find( const char *name);
int nameToOid( const char *name, pwr_tOid *oid);
bool registerObject( pwr_tOix oix, ext_object *node);
bool unregisterObject( pwr_tOix oix);
void registerVolume( const char *name, pwr_tCid cid, pwr_tVid vid, ext_object *node);
void info();
bool createVolumeObject( char *name);
......
/*
* Proview $Id: wb_wblnode.cpp,v 1.46 2005-09-06 10:43:32 claes Exp $
* Proview $Id: wb_wblnode.cpp,v 1.47 2005-09-20 13:14:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -97,6 +97,8 @@ static wbl_sSym datatypes[] =
,{ "pwr_eTix_NetStatus", pwr_eTix_NetStatus }
,{ "pwr_eType_CastId", pwr_eType_CastId }
,{ "pwr_eTix_CastId", pwr_eTix_CastId }
,{ "pwr_eType_ProString", pwr_eType_ProString }
,{ "pwr_eTix_ProString", pwr_eTix_ProString }
,{ "pwr_eTypeDef_AdefFlags", pwr_eTypeDef_AdefFlags }
,{ "pwr_eTdix_AdefFlags", pwr_eTdix_AdefFlags }
,{ "pwr_eTypeDef_ClassDefFlags", pwr_eTypeDef_ClassDefFlags }
......@@ -235,6 +237,8 @@ static wbl_sSym classes[] =
,{ "pwr_eCix_Method", pwr_eCix_Method }
,{ "pwr_eClass_RtMethod", pwr_eClass_RtMethod }
,{ "pwr_eCix_RtMethod", pwr_eCix_RtMethod }
,{ "pwr_eClass_Hier", pwr_eClass_Hier }
,{ "pwr_eCix_Hier", pwr_eCix_Hier }
,{ 0, 0 }
};
......@@ -395,6 +399,10 @@ int wb_wblnode::convconst( int *val, char *str)
if (wb_wblnode::lookup( val, str, editor)) return( TRUE);
if (wb_wblnode::lookup( val, str, datatypes)) return( TRUE);
if (wb_wblnode::lookup( val, str, attr_flags)) return( TRUE);
if (strncmp( str, "\"_X", 2) == 0) {
if ( sscanf( &str[3], "%d", val) == 1)
return( TRUE);
}
return( FALSE);
}
......@@ -608,6 +616,22 @@ void wb_wblnode::build( bool recursive)
else if ( isBuffer()) {
}
else if ( isVolume()) {
size_t size, offset;
int elements;
pwr_tTypeId tid;
pwr_eType type;
int flags;
pwr_tObjectIx no;
// Transfer next_oix from volumes rtbody
if ( m_vrep->getAttrInfo( "NextOix", pwr_eBix_sys, o->m_cid, &size, &offset,
&tid, &elements, &type, &flags)) {
no = *(pwr_tObjectIx *)((char *)o->rbody + offset);
if ( no > (pwr_tObjectIx)m_vrep->next_oix)
m_vrep->next_oix = *(pwr_tObjectIx *)((char *)o->rbody + offset);
}
}
else {
if( !m_vrep->registerObject( o->m_oid.oix, this)) {
......@@ -1743,6 +1767,8 @@ void wb_wblnode::registerNode( wb_vrepwbl *vol)
// Register volume
m_vrep->registerVolume( name(), o->m_cid, vid, this);
// Build to get next oix
build( false);
break;
}
case tokens.ATTRIBUTE:
......
/*
* Proview $Id: wb_wnav.cpp,v 1.22 2005-09-06 10:43:32 claes Exp $
* Proview $Id: wb_wnav.cpp,v 1.23 2005-09-20 13:14:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -194,6 +194,7 @@ int wnav_attr_string_to_value( ldh_tSesContext ldhses, int type_id, char *value
}
case pwr_eType_Text:
case pwr_eType_String:
case pwr_eType_ProString:
{
if ( (int) strlen( value_str) >= attr_size)
return WNAV__STRINGTOLONG;
......@@ -387,6 +388,15 @@ void wnav_attrvalue_to_string( ldh_tSesContext ldhses, int type_id, void *value
*buff = str;
break;
}
case pwr_eType_ProString:
{
*len = strlen((char *) value_ptr);
strcpy( str, "");
for ( int i = 0; i < *len; i++)
strcat( str, "*");
*buff = str;
break;
}
case pwr_eType_Objid:
{
ldh_sVolumeInfo info;
......@@ -3116,6 +3126,11 @@ void WNav::refresh()
void WNav::select_object( brow_tObject object)
{
if ( set_focus_cb)
(set_focus_cb)( parent_ctx, this);
set_selection_owner();
brow_SelectClear( brow->ctx);
brow_SetInverse( object, 1);
brow_SelectInsert( brow->ctx, object);
......
/*
* Proview $Id: wb_wnav_command.cpp,v 1.30 2005-09-06 14:18:18 claes Exp $
* Proview $Id: wb_wnav_command.cpp,v 1.31 2005-09-20 13:14:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -3842,6 +3842,7 @@ static int wnav_wb_func( void *client_data,
char *hierarchystr_p;
pwr_tStatus sts;
int keepname;
int noindex;
if ( EVEN( dcli_get_qualifier( "/OUTPUT" , outputstr)))
{
......@@ -3855,10 +3856,11 @@ static int wnav_wb_func( void *client_data,
hierarchystr_p = 0;
keepname = ODD( dcli_get_qualifier( "/KEEPNAME", 0));
noindex = ODD( dcli_get_qualifier( "/NOINDEX", 0));
sts = wnav_wccm_get_ldhsession_cb( wnav, &wnav->ldhses);
sts = ldh_WbDump( wnav->ldhses, hierarchystr_p, outputstr, keepname);
sts = ldh_WbDump( wnav->ldhses, hierarchystr_p, outputstr, keepname, noindex);
if ( EVEN(sts))
wnav->message(' ', wnav_get_message(sts));
return sts;
......
/*
* Proview $Id: wb_wtt.cpp,v 1.25 2005-09-06 10:43:32 claes Exp $
* Proview $Id: wb_wtt.cpp,v 1.26 2005-09-20 13:14:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -133,6 +133,8 @@ static pwr_tStatus wtt_ldh_this_session_cb (
{
Wtt *wtt = (Wtt *) ctx;
if ( wtt->input_open)
wtt->close_change_value();
wtt->wnav->ldh_event( event);
wtt->wnavnode->ldh_event( event);
return 1;
......@@ -147,6 +149,8 @@ static pwr_tStatus wtt_ldh_other_session_cb(
switch (event->Event)
{
case ldh_eEvent_SessionSaved:
if ( wtt->input_open)
wtt->close_change_value();
wtt->wnav->ldh_refresh( pwr_cNObjid);
wtt->wnavnode->ldh_refresh( pwr_cNObjid);
break;
......@@ -777,6 +781,8 @@ static void wtt_revert_ok( Wtt *wtt)
wtt->message( 'E', wnav_get_message( sts));
else
{
if ( wtt->input_open)
wtt->close_change_value();
wtt->wnav->ldh_refresh( pwr_cNObjid);
wtt->wnavnode->ldh_refresh( pwr_cNObjid);
wtt->message( 'E', "Session reverted");
......@@ -1315,6 +1321,15 @@ void Wtt::set_prompt( char *prompt)
XmStringFree( cstr);
}
void Wtt::close_change_value()
{
if ( input_open) {
XtUnmanageChild( cmd_input);
set_prompt( "");
input_open = 0;
}
}
void Wtt::open_change_value()
{
int sts;
......@@ -1324,8 +1339,7 @@ void Wtt::open_change_value()
int multiline;
int input_size;
if ( input_open)
{
if ( input_open) {
XtUnmanageChild( cmd_input);
set_prompt( "");
input_open = 0;
......@@ -2071,6 +2085,30 @@ static void wtt_activate_openfile_wbl( Widget w, Wtt *wtt, XmAnyCallbackStruct *
wtt->reset_cursor();
}
static void wtt_activate_openpl( Widget w, Wtt *wtt, XmAnyCallbackStruct *data)
{
wtt->set_clock_cursor();
if ( wtt->open_volume_cb)
(wtt->open_volume_cb) ( wtt, wb_eType_Volume, "ProjectList", wow_eFileSelType_);
wtt->reset_cursor();
}
static void wtt_activate_opengvl( Widget w, Wtt *wtt, XmAnyCallbackStruct *data)
{
wtt->set_clock_cursor();
if ( wtt->open_volume_cb)
(wtt->open_volume_cb) ( wtt, wb_eType_Volume, "GlobalVolumeList", wow_eFileSelType_);
wtt->reset_cursor();
}
static void wtt_activate_openudb( Widget w, Wtt *wtt, XmAnyCallbackStruct *data)
{
wtt->set_clock_cursor();
if ( wtt->open_volume_cb)
(wtt->open_volume_cb) ( wtt, wb_eType_Volume, "UserDatabase", wow_eFileSelType_);
wtt->reset_cursor();
}
static void wtt_activate_spreadsheet( Widget w, Wtt *wtt, XmAnyCallbackStruct *data)
{
#if defined OS_VMS
......@@ -2497,9 +2535,11 @@ static void wtt_valchanged_cmd_input( Widget w, XEvent *event)
default:
;
}
XtUnmanageChild( w);
wtt->set_prompt( "");
wtt->input_open = 0;
if ( wtt->input_open) {
XtUnmanageChild( w);
wtt->set_prompt( "");
wtt->input_open = 0;
}
}
else if ( wtt->command_open)
{
......@@ -3320,6 +3360,9 @@ Wtt::Wtt(
{"wtt_activate_openbuffer",(caddr_t)wtt_activate_openbuffer },
{"wtt_activate_openfile_dbs",(caddr_t)wtt_activate_openfile_dbs },
{"wtt_activate_openfile_wbl",(caddr_t)wtt_activate_openfile_wbl },
{"wtt_activate_openpl",(caddr_t)wtt_activate_openpl },
{"wtt_activate_opengvl",(caddr_t)wtt_activate_opengvl },
{"wtt_activate_openudb",(caddr_t)wtt_activate_openudb },
{"wtt_activate_spreadsheet",(caddr_t)wtt_activate_spreadsheet },
{"wtt_activate_openge",(caddr_t)wtt_activate_openge },
{"wtt_activate_openclasseditor",(caddr_t)wtt_activate_openclasseditor },
......
/*
* Proview $Id: wb_wtt.h,v 1.12 2005-09-06 10:43:32 claes Exp $
* Proview $Id: wb_wtt.h,v 1.13 2005-09-20 13:14:28 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -250,6 +250,7 @@ class Wtt {
void set_twowindows( int two, int display_wnav, int display_wnavnode);
void set_prompt( char *prompt);
void open_change_value();
void close_change_value();
void open_change_name();
void update_options_form();
void set_options();
......
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