Commit 391d66ec authored by claes's avatar claes

Error messages for not yet created loadfiles suppressed when building dev

parent 8a9ca8ee
/**
* Proview $Id: co_dbs.c,v 1.24 2005-09-01 14:57:52 claes Exp $
* Proview $Id: co_dbs.c,v 1.25 2005-12-15 07:41:17 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -436,7 +436,7 @@ dbs_Map(pwr_tStatus *sts, const char *filename)
if ((ret = stat(filename, &sb)) != 0) {
*sts = errno_GetStatus();
perror("stat");
// perror("stat");
return NULL;
}
......
/**
* Proview $Id: co_msgwindow.cpp,v 1.7 2005-09-01 14:57:52 claes Exp $
* Proview $Id: co_msgwindow.cpp,v 1.8 2005-12-15 07:41:17 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -55,6 +55,7 @@ static void msg_activate_help_message( Widget w, MsgWindow *msgw, XmAnyCallbackS
static void msg_create_form( Widget w, MsgWindow *msgw, XmAnyCallbackStruct *data);
MsgWindow *MsgWindow::default_window = 0;
int MsgWindow::hide_info = 0;
static void msgw_find_wnav_cb( void *ctx, pwr_tOid oid)
{
......@@ -72,10 +73,13 @@ static void msgw_find_plc_cb( void *ctx, pwr_tOid oid)
void MsgWindow::message( int severity, const char *text, msgw_ePop pop, pwr_tOid oid, bool is_plc)
{
if ( default_window) {
default_window->insert( severity, text, oid, is_plc);
}
else {
if ( hide_info && severity == 'I')
return;
if ( severity == 'E' || severity == 'W' || severity == 'F' || severity == 'I')
printf( "%c %s\n", severity, text);
else
......
/**
* Proview $Id: co_msgwindow.h,v 1.4 2005-10-25 15:28:10 claes Exp $
* Proview $Id: co_msgwindow.h,v 1.5 2005-12-15 07:41:17 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -75,6 +75,7 @@ class MsgWindow {
void (*find_plc_cb)( void *, pwr_tObjid);
static MsgWindow *default_window;
static int hide_info;
void map();
void unmap();
......@@ -93,6 +94,7 @@ class MsgWindow {
static void dset_nodraw() { if ( default_window) default_window->set_nodraw();}
static void dreset_nodraw() { if ( default_window) default_window->reset_nodraw();}
static void get_parent_widget( Widget *w) { *w = default_window->parent_wid;}
static void hide_info_messages( int hide) { hide_info = hide;}
};
#endif
......
......@@ -93,13 +93,13 @@ clean_ps_en_us := $(patsubst %.wb_load,clean_%_en_us.ps,$(wbl_sources))
.SUFFIXES:
$(load_dir)/%.dbs : ../../%.wb_load
@ echo "Generating snapshot for $(source)"
@ wb_cmd create snapshot /file=\"$(source)\"/out=\"$(target)\"
@ echo "Generating loadfile for $(source)"
@ wb_cmd -q -i create snapshot /file=\"$(source)\"/out=\"$(target)\"
@ chmod a+w $(target)
$(inc_dir)/pwr_%classes.h : ../../%.wb_load
@ echo "Generating struct files for $(source) classes..."
@ co_convert -sv -d $(inc_dir) "$(source)"
@ co_convert -s -d $(inc_dir) "$(source)"
$(inc_dir)/pwr_%classes.hpp : ../../%.wb_load
@ echo "Generating hpp files for $(source) classes..."
......
......@@ -93,13 +93,13 @@ clean_ps_en_us := $(patsubst %.wb_load,clean_%_en_us.ps,$(wbl_sources))
.SUFFIXES:
$(load_dir)/%.dbs : ../../%.wb_load
@ echo "Generating snapshot for $(source)"
@ wb_cmd create snapshot /file=\"$(source)\"/out=\"$(target)\"
@ echo "Generating loadfile for $(source)"
@ wb_cmd -q -i create snapshot /file=\"$(source)\"/out=\"$(target)\"
@ chmod a+w $(target)
$(inc_dir)/pwr_%classes.h : ../../%.wb_load
@ echo "Generating struct files for $(source) classes..."
@ co_convert -sv -d $(inc_dir) "$(source)"
@ co_convert -s -d $(inc_dir) "$(source)"
$(inc_dir)/pwr_%classes.hpp : ../../%.wb_load
@ echo "Generating hpp files for $(source) classes..."
......
......@@ -44,8 +44,8 @@ clean :
realclean : clean $(clean_wbl)
$(load_dir)/nmps.dbs :
@ echo "Generating snapshot for nmps"
@ wb_cmd create snapshot /file=\"$(pwre_sroot)/wbl/nmps/src/\"/out=\"$(target)\"
@ echo "Generating loadfile for nmps"
@ wb_cmd -q -i create snapshot /file=\"$(pwre_sroot)/wbl/nmps/src/\"/out=\"$(target)\"
@ chmod a+w $(target)
$(inc_dir)/pwr_nmpsclasses.h :
......
......@@ -46,13 +46,13 @@ clean :
realclean : clean clean_pwrb_xtthelp clean_pwrb_html clean_baseclasses
$(load_dir)/pwrb.dbs :
@ echo "Generating snapshot for pwrb"
@ wb_cmd create snapshot /file=\"$(pwre_sroot)/wbl/pwrb/src/\"/out=\"$(target)\"
@ echo "Generating loadfile for pwrb"
@ wb_cmd -q -i create snapshot /file=\"$(pwre_sroot)/wbl/pwrb/src/\"/out=\"$(target)\"
@ chmod a+w $(target)
$(inc_dir)/pwr_baseclasses.h :
@ echo "Generating struct files for pwrb classes..."
@ co_convert -sv -d $(inc_dir) "$(pwre_sroot)/wbl/pwrb/src/pwrb_*.wb_load"
@ co_convert -s -d $(inc_dir) "$(pwre_sroot)/wbl/pwrb/src/pwrb_*.wb_load"
$(inc_dir)/pwr_baseclasses.hpp :
@ echo "Generating hpp files for pwrb classes..."
......
......@@ -44,8 +44,8 @@ clean : $(clean_wbl)
realclean : clean clean_pwrs_xtthelp clean_pwrs_html clean_systemclasses
$(load_dir)/pwrs.dbs :
@ echo "Generating snapshot for pwrs"
@ wb_cmd create snapshot /file=\"$(pwre_sroot)/wbl/pwrs/src/\"/out=\"$(target)\"
@ echo "Generating loadfile for pwrs"
@ wb_cmd -q -i create snapshot /file=\"$(pwre_sroot)/wbl/pwrs/src/\"/out=\"$(target)\"
@ chmod a+w $(target)
$(inc_dir)/pwr_systemclasses.h :
......
......@@ -43,8 +43,8 @@ clean :
realclean : clean $(clean_wbl)
$(load_dir)/ssab.dbs :
@ echo "Generating snapshot for ssab"
@ wb_cmd create snapshot /file=\"$(pwre_sroot)/wbl/ssab/src/\"/out=\"$(target)\"
@ echo "Generating loadfile for ssab"
@ wb_cmd -q -i create snapshot /file=\"$(pwre_sroot)/wbl/ssab/src/\"/out=\"$(target)\"
@ chmod a+w $(target)
$(inc_dir)/pwr_ssabclasses.h :
......
......@@ -44,8 +44,8 @@ clean :
realclean : clean $(clean_wbl)
$(load_dir)/tlog.dbs :
@ echo "Generating snapshot for tlog"
@ wb_cmd create snapshot /file=\"$(pwre_sroot)/wbl/tlog/src/\"/out=\"$(target)\"
@ echo "Generating loadfile for tlog"
@ wb_cmd -q -i create snapshot /file=\"$(pwre_sroot)/wbl/tlog/src/\"/out=\"$(target)\"
@ chmod a+w $(target)
$(inc_dir)/pwr_tlogclasses.h :
......
/*
* Proview $Id: wb.cpp,v 1.20 2005-11-22 12:18:20 claes Exp $
* Proview $Id: wb.cpp,v 1.21 2005-12-15 07:41:17 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -661,7 +661,7 @@ int main( int argc, char *argv[])
CoXHelp *xhelp = new CoXHelp( mainwindow, 0, xhelp_eUtility_Wtt, &sts);
CoXHelp::set_default( xhelp);
sts = ldh_OpenWB(&wbctx, volumename_p);
sts = ldh_OpenWB(&wbctx, volumename_p, 0);
psts(sts, NULL);
if (EVEN(sts)) exit(sts);
......
/*
* Proview $Id: wb_cmd.cpp,v 1.7 2005-09-06 14:13:43 claes Exp $
* Proview $Id: wb_cmd.cpp,v 1.8 2005-12-15 07:41:17 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -63,9 +63,11 @@ extern "C" {
#include "wb_wnav_msg.h"
#include "wb_cmdc.h"
#include "wb.h"
#include "co_msgwindow.h"
static char cmd_volume[80];
static char *cmd_volume_p = 0;
static unsigned int cmd_options = 0;
static void usage()
{
......@@ -100,7 +102,7 @@ static int cmd_get_wbctx( void *ctx, ldh_tWBContext *wbctx)
}
else
{
sts = ldh_OpenWB( &cmd->wbctx, cmd_volume_p);
sts = ldh_OpenWB( &cmd->wbctx, cmd_volume_p, cmd_options);
if ( ODD(sts))
*wbctx = cmd->wbctx;
}
......@@ -297,6 +299,7 @@ int main(int argc, char *argv[])
int i;
char str[256] ;
Cmd *cmd;
int quiet = 0;
cmd = new Cmd;
......@@ -328,6 +331,15 @@ int main(int argc, char *argv[])
else
cout << "Syntax error, volume is missing" << endl;
break;
case 'q':
// Quiet
quiet = 1;
break;
case 'i':
// Ignore errors for dbs files not yet created
cmd_options = ldh_mWbOption_IgnoreDLoadError;
MsgWindow::hide_info_messages( 1);
break;
default:
cout << "Unknown argument: " << argv[i] << endl;
}
......@@ -339,7 +351,8 @@ int main(int argc, char *argv[])
}
}
cout << "\n\
if ( !quiet)
cout << "\n\
Proview is free software; covered by the GNU General Public License.\n\
You can redistribute it and/or modify it under the terms of this license.\n\
\n\
......
/*
* Proview $Id: wb_dbs.cpp,v 1.23 2005-09-06 10:43:31 claes Exp $
* Proview $Id: wb_dbs.cpp,v 1.24 2005-12-15 07:41:17 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -317,7 +317,7 @@ bool wb_dbs::importHead(pwr_tOid oid, pwr_tCid cid, pwr_tOid poid,
char buf[40];
time_AtoAscii( &oep->o.time, time_eFormat_DateAndTime, buf, sizeof(buf));
printf( "Class version: %s %s\n", name, buf);
// printf( "Class version: %s %s\n", name, buf);
}
return true;
......@@ -479,7 +479,7 @@ wb_dbs::openFile()
if ((ret = stat(m_fileName, &sb)) != 0) {
sts = errno_GetStatus();
perror("stat");
// perror("stat");
return sts;
}
......
/*
* Proview $Id: wb_erep.cpp,v 1.41 2005-11-22 12:22:29 claes Exp $
* Proview $Id: wb_erep.cpp,v 1.42 2005-12-15 07:41:17 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -47,8 +47,8 @@ extern "C" {
pwr_dImport pwr_BindClasses(System);
pwr_dImport pwr_BindClasses(Base);
wb_erep::wb_erep() : m_nRef(0), m_dir_cnt(0), m_volatile_idx(0), m_buffer_max(10),
m_ref_merep_occupied(false)
wb_erep::wb_erep( unsigned int options) : m_nRef(0), m_dir_cnt(0), m_volatile_idx(0), m_buffer_max(10),
m_ref_merep_occupied(false), m_options( options)
{
m_merep = new wb_merep(0);
......@@ -492,7 +492,10 @@ void wb_erep::loadCommonMeta( pwr_tStatus *status)
MsgWindow::message( 'I', "Volume loaded", vname);
}
catch ( wb_error& e) {
MsgWindow::message( 'E', "Unable to open volume", vname, e.what().c_str());
if ( m_options & ldh_mWbOption_IgnoreDLoadError)
MsgWindow::message( 'I', "Unable to open volume", vname);
else
MsgWindow::message( 'E', "Unable to open volume", vname, e.what().c_str());
}
}
fpm.close();
......@@ -592,7 +595,10 @@ void wb_erep::loadMeta( pwr_tStatus *status, char *db)
vol_cnt++;
}
catch ( wb_error& e) {
MsgWindow::message( 'E', "Unable to open volume", vname, e.what().c_str());
if ( m_options & ldh_mWbOption_IgnoreDLoadError)
MsgWindow::message( 'I', "Unable to open volume", vname);
else
MsgWindow::message( 'E', "Unable to open volume", vname, e.what().c_str());
}
}
else {
......@@ -613,7 +619,10 @@ void wb_erep::loadMeta( pwr_tStatus *status, char *db)
MsgWindow::message( 'I', "Volume loaded", vname);
}
catch ( wb_error& e) {
MsgWindow::message( 'E', "Unable to open volume", vname, e.what().c_str());
if ( m_options & ldh_mWbOption_IgnoreDLoadError)
MsgWindow::message( 'I', "Unable to open volume", vname);
else
MsgWindow::message( 'E', "Unable to open volume", vname, e.what().c_str());
}
break;
}
......@@ -646,7 +655,10 @@ void wb_erep::loadMeta( pwr_tStatus *status, char *db)
MsgWindow::message( 'I', "Volume loaded", vname);
}
catch ( wb_error& e) {
MsgWindow::message( 'E', "Unable to open volume", vname, e.what().c_str());
if ( m_options & ldh_mWbOption_IgnoreDLoadError)
MsgWindow::message( 'I', "Unable to open volume", vname);
else
MsgWindow::message( 'E', "Unable to open volume", vname, e.what().c_str());
}
}
continue;
......@@ -677,7 +689,10 @@ void wb_erep::loadMeta( pwr_tStatus *status, char *db)
vol_cnt++;
}
catch ( wb_error& e) {
MsgWindow::message( 'E', "Unable to open volume", vname, e.what().c_str());
if ( m_options & ldh_mWbOption_IgnoreDLoadError)
MsgWindow::message( 'I', "Unable to open volume", vname);
else
MsgWindow::message( 'E', "Unable to open volume", vname, e.what().c_str());
}
}
else {
......
/*
* Proview $Id: wb_erep.h,v 1.21 2005-11-22 12:22:29 claes Exp $
* Proview $Id: wb_erep.h,v 1.22 2005-12-15 07:41:17 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -54,9 +54,10 @@ class wb_erep
int m_volatile_idx;
int m_buffer_max;
bool m_ref_merep_occupied;
unsigned int m_options;
public:
wb_erep();
wb_erep( unsigned int options = 0);
~wb_erep();
void unref();
wb_erep *ref();
......
/*
* Proview $Id: wb_ldh.cpp,v 1.48 2005-10-21 16:11:23 claes Exp $
* Proview $Id: wb_ldh.cpp,v 1.49 2005-12-15 07:41:17 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -1524,9 +1524,9 @@ ldh_OpenSession(ldh_tSession *session, ldh_tVolume volume,
it with objects from database on disk. */
pwr_tStatus
ldh_OpenWB(ldh_tWorkbench *workbench, char *db)
ldh_OpenWB(ldh_tWorkbench *workbench, char *db, unsigned int options)
{
wb_erep *erep = new wb_erep();
wb_erep *erep = new wb_erep( options);
wb_env *env = new wb_env(erep);
env->load( db);
......
/*
* Proview $Id: wb_ldh.h,v 1.31 2005-11-14 16:30:13 claes Exp $
* Proview $Id: wb_ldh.h,v 1.32 2005-12-15 07:41:17 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -124,6 +124,10 @@ typedef enum {
ldh_eDId_
} ldh_eDId;
typedef enum {
ldh_mWbOption_IgnoreDLoadError = 1 << 0
} ldh_mWbOption;
typedef enum {
ldh_eEvent__ = 0,
ldh_eEvent_ObjectCreated,
......@@ -945,7 +949,8 @@ ldh_OpenSession (
pwr_tStatus
ldh_OpenWB (
ldh_tWorkbench *WorkBench,
char *db
char *db,
unsigned int options
);
pwr_tStatus ldh_Paste (
......
/*
* Proview $Id: wb_wtt.cpp,v 1.28 2005-11-22 12:32:17 claes Exp $
* Proview $Id: wb_wtt.cpp,v 1.29 2005-12-15 07:41:17 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -1365,7 +1365,7 @@ static int wtt_get_wbctx( void *ctx, ldh_tWBContext *wbctx)
else
{
wtt->set_clock_cursor();
sts = ldh_OpenWB( &wtt->wbctx, 0);
sts = ldh_OpenWB( &wtt->wbctx, 0, 0);
if ( ODD(sts))
*wbctx = wtt->wbctx;
......
/*
* Proview $Id: ge.cpp,v 1.18 2005-12-14 13:07:16 claes Exp $
* Proview $Id: ge.cpp,v 1.19 2005-12-15 07:43:03 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -2607,7 +2607,7 @@ static int ge_get_ldhses_cb( void *ctx, ldh_tSesContext *ldhses, int load)
else
{
// Open workbench and attatch some volume
sts = ldh_OpenWB( &wbctx, 0);
sts = ldh_OpenWB( &wbctx, 0, 0);
if ( EVEN(sts)) return sts;
// Attach first rootvolume, or if no rootvolume exist some other volume
......
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