Commit 7bd0340c authored by claes's avatar claes

*** empty log message ***

parent 006d7833
......@@ -44,6 +44,7 @@
%# define load_cNameDistribute "$pwrp_root/common/db/pwrp_cnf_distribute.dat"
%# define load_cNameSysObject "$pwrp_root/common/db/pwrp_cnf_sysobject.dat"
%# define load_cNameFilePath "$pwrp_root/common/db/pwrp_cnf_dirlist.dat"
%# define load_cNameLocalWb "$pwrp_root/common/db/wb.wb_load"
%# define load_cNameGblVolumeList "$pwra_db/pwr_volumelist.dat"
%# define load_cNameCmnVolumeList "pwr_volumelist.dat"
%# define load_cNameRttCrr "rtt_crr_%3.3d_%3.3d_%3.3d_%3.3d.dat"
......
......@@ -89,6 +89,12 @@ wb_vrep *wb_erep::volume(pwr_tStatus *sts, const char *name) // Fix
return it->second;
}
}
for ( it = m_vrepextern.begin(); it != m_vrepextern.end(); it++) {
if ( cdh_NoCaseStrcmp( it->second->name(), name) == 0) {
*sts = LDH__SUCCESS;
return it->second;
}
}
*sts = LDH__NOSUCHVOL;
return 0;
}
......@@ -223,6 +229,7 @@ void wb_erep::load( pwr_tStatus *sts)
if ( EVEN(*sts)) return;
loadMeta( sts);
loadLocalWb( sts);
}
void wb_erep::loadDirList( pwr_tStatus *status)
......@@ -425,6 +432,35 @@ void wb_erep::loadMeta( pwr_tStatus *status)
*status = LDH__SUCCESS;
}
void wb_erep::loadLocalWb( pwr_tStatus *rsts)
{
pwr_tStatus sts;
char found_file[200];
sts = dcli_search_file( load_cNameLocalWb, found_file, DCLI_DIR_SEARCH_INIT);
dcli_search_file( load_cNameLocalWb, found_file, DCLI_DIR_SEARCH_END);
if ( ODD(sts)) {
try {
wb_vrepwbl *vrep = new wb_vrepwbl( this);
sts = vrep->load( found_file);
if ( ODD(sts))
addExtern( &sts, vrep);
else {
*rsts = sts;
cout << "** Failiure loading local workbench volume" << endl;
return;
}
}
catch ( wb_error& e) {
*rsts = e.sts();
cout << "** Failiure loading local workbench volume" << endl;
return ;
}
cout << "-- Local workbench volume loaded" << endl;
}
*rsts = LDH__SUCCESS;
}
wb_cdrep *wb_erep::cdrep( pwr_tStatus *sts, const wb_orep& o)
{
wb_vrep *vrep = volume(sts, o.vid());
......
......@@ -57,6 +57,7 @@ private:
void loadDirList( pwr_tStatus *status);
void loadCommonMeta( pwr_tStatus *status);
void loadMeta( pwr_tStatus *status);
void loadLocalWb( pwr_tStatus *sts);
};
#endif
......
......@@ -23,6 +23,7 @@ extern "C" {
#define ldh_cWbdbVersionStr "V2.7.0"
#define ldh_cWBVol (0 + ((pwr_tVolumeId)254 << 24) + (254 << 16) + (254 << 8) + 254)
#define ldh_cWBVolLocal (0 + ((pwr_tVolumeId)254 << 24) + (254 << 16) + (254 << 8) + 252)
#define ldh_cProjectVolume (0 + ((pwr_tVolumeId)254 << 24) + (254 << 16) + (254 << 8) + 253)
#if 0
......
......@@ -518,6 +518,7 @@ pwr_tStatus WVsel::load_volumelist()
XmString cstr;
pwr_tStatus sts;
int i;
bool local_wbvolume = false;
XmListDeleteAllItems( widgets.volumelist);
volume_count = 0;
......@@ -575,8 +576,17 @@ pwr_tStatus WVsel::load_volumelist()
volume_count++;
if ( volume_count >= VSEL_MAX_VOLUMES)
break;
if ( local_wbvolume)
break;
sts = ldh_GetNextVolume( wbctx, volume, &volume);
if ( EVEN(sts) && all) {
// Look for local workbench volume
volume = ldh_cWBVolLocal;
sts = ldh_VolumeIdToName( wbctx, volume, name, sizeof(name),
&size);
local_wbvolume = true;
}
}
return 1;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment