Commit 9b56a2ac authored by claes's avatar claes

*** empty log message ***

parent 5eccd5f1
......@@ -124,6 +124,9 @@ SObject NMps:Class
!
! 8 When the cell is reseted by the ResetObject, the dataobject is also
! removed from the database rtdb.
!
! 16 Backup. The cell and data objects in the cell, is backed up by
! the nmps backup process.
!*/
Object Function $Intern 4
Body SysBody
......
......@@ -116,6 +116,9 @@ SObject NMps:Class
!
! 8 When the cell is reseted by the ResetObject, the dataobject is also
! removed from the database rtdb.
!
! 16 Backup. The cell and data objects in the cell, is backed up by
! the nmps backup process.
!*/
Object Function $Intern 4
Body SysBody
......
......@@ -38,6 +38,7 @@ clean_gif := $(patsubst %.gif,clean_%.gif,$(gif_sources))
$(doc_dir)/orm/%.gif : %.gif
@ $(log_h_h)
@ $(cp) $(cpflags) $(source) $(target)
@ $(cp) $(cpflags) $(source) $(doc_dir)/help
.PHONY : all init copy lib exe clean realclean \
$(clean_gif)
......
......@@ -27,6 +27,16 @@
This module contains routines for the Queue Communication.
*/
/*! \defgroup Time Time functions
\ingroup PRM
This module contains utilites for time management.
*/
......
......@@ -5,9 +5,11 @@ HIDE_UNDOC_MEMBERS = YES
HIDE_UNDOC_CLASSES = YES
SOURCE_BROWSER = YES
INPUT = $(pwre_sroot)/doc/prm/src/doxygen.dx \
$(pwre_sroot)/lib/co/src/co_time.h \
$(pwre_sroot)/lib/rt/src/rt_gdh.h \
$(pwre_sroot)/lib/rt/src/rt_mh_appl.h \
$(pwre_sroot)/lib/rt/src/rt_qcom.h \
$(pwre_sroot)/lib/co/src/co_time.c \
$(pwre_sroot)/lib/rt/src/rt_gdh.c \
$(pwre_sroot)/lib/rt/src/rt_mh_appl.c \
$(pwre_sroot)/lib/rt/src/rt_qcom.c
......
......@@ -10,6 +10,7 @@
<tr><td><a href="dguide.pdf" target="right">Designer's Guide</a></td></tr>
<tr><td><a href="prm_f.html" target="_top">Programmer's Referens Manual</a></td></tr>
<tr><td><a href="qcom.pdf" target="right">QCOM Reference Guide</a></td></tr>
<tr><td><a href="help_f.html" target="right">Help</a></td></tr>
</table>
<br>
......@@ -22,6 +23,7 @@
<hr>
<table id="mainmenu" border="1" cellspacing="0" width="100%">
<tr><td><a href="download_f.html" target="right">Download</a></td></tr>
<tr><td><a href="dev_index.html" target="_top">Developer's Site</a></td></tr>
</table>
<br>
......
......@@ -7,6 +7,9 @@
<br>
<hr>
<a href="orm_intro.html" target="_self"><font size=4>Introduction</font></a>
<!-- ******* SystemClasses **********-->
<hr>
<table id="mainmenu" border="1" cellspacing="0" width="100%">
......
......@@ -6,7 +6,7 @@
<frameset rows="90,*" frameborder="0">
<frame name="I1" frameborder="0" noresize scrolling="no" src="orm_h.html"></frame>
<frame name="I2" frameborder="0" noresize scrolling="no" src="orm.html"></frame>
<frame name="I2" frameborder="0" src="orm.html"></frame>
</frameset>
</html>
\ No newline at end of file
......@@ -6,7 +6,7 @@
<body id="mainmenu">
<h2 id="mainmenu">Dokumentation</h2><br>
<table id="mainmenu" border="1" cellspacing="0" width="100%">
<tr><td><a href="../orm_f.html" target="_top">Objekt Handbok</a></td></tr>
<tr><td><a href="../orm_f.html" target="_top">Objekt Handbok</a> <a href="pwrb_xtthelp_f.html" target="right">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[svenska]</a></td></tr>
<tr><td><a href="../dguide.pdf" target="right">Designer's Guide</a></td></tr>
<tr><td><a href="../prm_f.html" target="_top">Programmer's Referens Manual</a></td></tr>
<tr><td><a href="dd_ge.pdf" target="right">Ge</a></td></tr>
......@@ -24,6 +24,7 @@
<tr><td><a href="remote.pdf" target="right">Remote</a></td></tr>
<tr><td><a href="profibus.pdf" target="right">Profibus</a></td></tr>
<tr><td><a href="rd_ssabobjects.pdf" target="right">SSAB I/O</a></td></tr>
<tr><td><a href="../help_f.html" target="right">Hjlp</a></td></tr>
</table>
<br>
......@@ -35,6 +36,7 @@
<a href="mailto:postmaster@proview.se">skicka meddelande</a>
<hr>
<table id="mainmenu" border="1" cellspacing="0" width="100%">
<tr><td><a href="../download_f.html" target="right">Download</a></td></tr>
<tr><td><a href="../dev_index.html" target="_top">Developer's Site</a></td></tr>
</table>
<br>
......
......@@ -92,7 +92,7 @@ void *wnav_help_insert_cb( void *ctx, navh_eItemType item_type, char *text1,
else {
if ( in_table) {
// Close table (keep if empty line)
if ( !( strcmp( text1, "") == 0 &&
if ( !( text1 && strcmp( text1, "") == 0 &&
(item_type == navh_eItemType_Help ||
item_type == navh_eItemType_HelpBold))) {
xh->fp << "</TABLE>" << endl;
......
......@@ -282,7 +282,7 @@ readSectVolRef (
pwr_dStatus(sts, status, INI__SUCCESS);
#if 0
#if 1
if (fseek(cp->dbs.f, cp->sect.offset, SEEK_SET) != 0)
pwr_Return(NO, sts, errno_GetStatus());
......@@ -1028,20 +1028,26 @@ ini_ReadBootFile (
cp->group[0] = '\0';
n = sscanf(s, "%s", cp->group);
break;
case 3: /* Find PLC version. */
case 3: { /* Find PLC version. */
char *t;
i++;
#if 1
n = sscanf(s, "%s %s %d", vname, vids, &cp->node.plcVersion);
#else
n = sscanf(s, "%s %d", vids, &cp->node.plcVersion);
#endif
n = sscanf(s, "%s %s", vname, vids);
if (n < 2) {
errh_LogError(&cp->log, "Bootfile corrupt, error in plc data");
cp->errors++;
continue;
}
if (n < 3) {
errh_LogError(&cp->log, "Found no PLC version");
t = strrchr( vname, '_');
n = sscanf(t+1, "%d", &cp->node.plcVersion);
if (n < 1) {
errh_LogError(&cp->log, "Bootfile corrupt, error in plc data");
cp->errors++;
continue;
}
if (!cp->flags.b.plcfile) {
#if defined OS_LYNX || defined OS_LINUX
sprintf(cp->plcfile.name, dbs_cNamePlc, "", cp->nodename, cp->busid, cp->node.plcVersion);
......@@ -1066,6 +1072,7 @@ ini_ReadBootFile (
cdh_ToLower(cp->plcfile.name, cp->plcfile.name);
errh_LogInfo(&cp->log, "This node vill run PLC file: %s", cp->plcfile.name);
break;
}
case 4: /* Find root volume. */
i++;
n = sscanf(s, "%s %s", vname, vids);
......
......@@ -245,7 +245,11 @@ sancAdd (
pool_sQlink *nl;
if (first) {
#ifdef OS_LINUX
cycle = 1 * sysconf(_SC_CLK_TCK);
#else
cycle = 1 * CLK_TCK;
#endif
setInterval(&cycle, gdbroot->db->sanc_add_int);
first = 0;
}
......@@ -286,7 +290,11 @@ sancExpired (
pool_sQlink *nl;
if (first) {
#ifdef OS_LINUX
cycle = 60 * sysconf(_SC_CLK_TCK);
#else
cycle = 60 * CLK_TCK;
#endif
setInterval(&cycle, gdbroot->db->sanc_exp_int);
first = 0;
}
......@@ -328,7 +336,11 @@ sansCheck (
pool_sQlink *nl;
if (first) {
#ifdef OS_LINUX
cycle = 2 * sysconf(_SC_CLK_TCK);
#else
cycle = 2 * CLK_TCK;
#endif
setInterval(&cycle, gdbroot->db->sans_chk_int);
first = 0;
}
......@@ -370,7 +382,11 @@ subcCheck (
static pwr_tBoolean first = 1;
if (first) {
#ifdef OS_LINUX
cycle = 3 * sysconf(_SC_CLK_TCK);
#else
cycle = 3 * CLK_TCK;
#endif
setInterval(&cycle, gdbroot->db->subc_chk_int);
first = 0;
}
......@@ -426,7 +442,11 @@ cacheTrim (
static pwr_tBoolean first = 1;
if (first) {
#ifdef OS_LINUX
cycle = 1 * sysconf(_SC_CLK_TCK);
#else
cycle = 1 * CLK_TCK;
#endif
setInterval(&cycle, gdbroot->db->cache_trim_int);
first = 0;
}
......@@ -554,7 +574,12 @@ msToClock (
{
time_tClock c;
#ifdef OS_LINUX
c = ms * sysconf(_SC_CLK_TCK) / 1000;
#else
c = ms * CLK_TCK / 1000;
#endif
if (ic != NULL) *ic = c;
......@@ -610,7 +635,12 @@ setInterval (
if (i == 0)
return;
#ifdef OS_LINUX
*c = i * sysconf(_SC_CLK_TCK) / 1000;
#else
*c = i * CLK_TCK / 1000;
#endif
}
......
......@@ -7,9 +7,10 @@ pkg_install_func ()
exit 1
fi
pkg=`eval locate $1`
pkg_remove_func "force"
pkg=/home/pwrp/$1
echo "-- Installing package $1"
cd /tmp
if ! tar -xzf $pkg pkg_unpack.sh; then
......
......@@ -550,12 +550,6 @@ pwrc_create_func()
# Printer command for plc documents
#export pwr_foe_gre_print="lpr -P lp1"
# Mysql server node
#node=`uname -n`
#if [ $node != "newton" ]; then
# export pwrp_mysql_server="newton"
#fi
if [ -e "$pwrp_login/sysinfo.txt" ]; then
echo "-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_-_"
echo "Welcome to"
......@@ -591,9 +585,14 @@ EOF
return
fi
pwrc_set_func "project" $pname
if [ $pwrc_status -ne $pwrc__success ]; then
return
fi
# Create an empty directory database
echo "Creating directory database"
pwrc_copy_func template -p $pname dbdirectory noconfirm
wb_cmd create volume/name=\"directory\"/class=\$DirectoryVolume/ident=254.254.254.253
return
fi
......@@ -685,14 +684,7 @@ pwrc_delete_func()
if [ -z $confirm ] || [ $confirm != "noconfirm" ]; then
echo "Delete project will"
echo " remove '$2' from the project list"
echo " delete all databases in project '$2':"
i=0
while [ "${db_array[$i]}" != "" ]; do
echo " database: '${db_array[$i]}'"
i=$i+1
done
echo " delete all databases in project '$2'"
echo " delete all files in $proot"
echo "Do you want do continue ? [y/n] "
read REPLY
......@@ -722,19 +714,6 @@ pwrc_delete_func()
return
fi
# Delete the databases
i=0
while [ "${db_array[$i]}" != "" ]; do
if mysqladmin -f $mysql_socket drop ${db_array[$i]}
then
echo "Database '${db_array[$i]}' deleted"
else
echo "Error: Error from mysqladmin $mysql_socket drop ${db_array[$i]}"
fi
i=$i+1
done
fi
pwrc_prlist_delete $2
......@@ -858,9 +837,9 @@ pwrc_set_func()
return
fi
cmd="base"
cmd="baseroot"
if [ $1 = $cmd ] || [ ${cmd#$1} != $cmd ]; then
# Command is "set base"
# Command is "set baseroot"
baseroot=$2
baseroot=${baseroot%/}
if [ ! -e "$baseroot" ]; then
......@@ -1275,83 +1254,6 @@ pwrc_copy_func()
pwrc_status=$pwrc__syntax
return
fi
if [ $1 = "template" ]; then
# Command is "copy template"
if [ $2 == "-p" ]; then
projectname=$3
shift 2
else
pwrc_get_projectname
fi
db=$2
confirm=$3
# This can only be done on mysql server
if [ ! -z "$pwrp_mysql_server" ]; then
node="`eval uname -n`"
if [ $node != $pwrp_mysql_server ]; then
echo "Error: current host is not mysql server ($pwrp_mysql_server)"
pwrc_status=$pwrc__notmysqlsrv
return
fi
fi
if [ -z $db ]; then
echo "Syntax error: enter database, or 'dbdirectory' for directory database"
pwrc_status=$pwrc__syntax
return
fi
# Get location for mysql database
datadir=`eval mysqladmin $mysql_socket variables| grep datadir | awk '{ print $4 }'`
datadir=${datadir%/}
if [ -z $datadir ]; then
echo "Error: Can't get database directory from mysql"
pwrc_status=$pwrc__datadir
return
fi
if [ "$db" = "dbdirectory" ]; then
dbname=$projectname"_"$pwr_dbversion
else
dbname=$projectname"_"$db"_"$pwr_dbversion
fi
if [ -z $confirm ] || [ $confirm != "noconfirm" ]; then
echo "Do you want to copy a template database to $dbname ? [y/n] "
read REPLY
if [ -z $REPLY ] || [ $REPLY != "y" ]; then
return
fi
fi
# Create database directory
if [ ! -e $datadir/$dbname ]; then
echo "Creating new database '$dbname'"
mysqladmin $mysql_socket create $dbname
fi
# if [ ! -e $datadir/wb_template_$pwr_dbversion ]; then
# echo "Can't find template database"
# pwrc_status=$pwrc__notemplatedb
# return
# fi
# Copy template database
if wb_cp $datadir/wb_template_$pwr_dbversion/ $datadir/$dbname/
then
echo "Template database copied to '"${dbname%"_"$pwr_dbversion}"'"
pwrc_status=$pwrc__success
else
pwrc_status=$pwrc__mysqldbcopy
return
fi
return
fi
cmd="project"
if [ $1 = $cmd ] || [ ${cmd#$1} != $cmd ]; then
......@@ -1381,35 +1283,6 @@ pwrc_copy_func()
to_phier="-"
fi
# Check that mysqladmin is alive
ver=`eval mysqladmin $mysql_socket --version`
if [ -z "$ver" ]; then
echo "Unable to find mysqladmin"
pwrc_status=$pwrc_mysql
return
fi
# This can only be done on mysql server
if [ ! -z "$pwrp_mysql_server" ]; then
node="`eval uname -n`"
if [ $node != $pwrp_mysql_server ]; then
echo "Error: current host is not mysql server ($pwrp_mysql_server)"
pwrc_status=$pwrc__notmysqlsrv
return
fi
fi
# Get location for mysql database
datadir=`eval mysqladmin $mysql_socket variables| grep datadir | awk '{ print $4 }'`
datadir=${datadir%/}
if [ -z $datadir ]; then
echo "Error: Can't get database directory from mysql"
pwrc_status=$pwrc__datadir
return
fi
# Load project list
pwrc_prlist_read
if [ $pwrc_status -ne $pwrc__success ]; then
......@@ -1459,41 +1332,13 @@ pwrc_copy_func()
from_proot=${root_array[$pwrc_current_index]}
# Get databases in from-project
pwrc_dblist_read $from_pname $from_proot
# Check that the databases can be found and that the new doesn't exist
i=0
while [ "${db_array[$i]}" != "" ]; do
if [ ! -e $datadir/${db_array[$i]} ]; then
echo "Error: Can't find database ${db_array[$i]}"
pwrc_status=$pwrc__nodb
return
fi
dbname=$to_pname${db_array[$i]#$from_pname}
if [ -e $datadir/$dbname ]; then
echo "Error: Database '$dbname' already exist"
pwrc_status=pwrc__dbalrexist
return
fi
i=$i+1
done
# Confirmation
if [ -z $confirm ] || [ $confirm != "noconfirm" ]; then
echo "Copy project will"
echo " add '$to_pname' to the project list"
echo " copy directory tree '$from_proot' to '$to_proot'"
echo " copy all databases in project '$from_pname':"
i=0
while [ "${db_array[$i]}" != "" ]; do
echo " database: '${db_array[$i]}'"
i=$i+1
done
echo "Do you want do continue ? [y/n] "
read REPLY
if [ -z $REPLY ] || [ $REPLY != "y" ]; then
......@@ -1511,29 +1356,6 @@ pwrc_copy_func()
return
fi
#Copy databases
i=0
while [ "${db_array[$i]}" != "" ]; do
dbname=$to_pname${db_array[$i]#$from_pname}
if mysqladmin $mysql_socket create $dbname
then
echo "Database '$dbname' created"
else
echo "Error: mysqladmin error"
pwrc_status=$pwrc__dbcreate
return
fi
if wb_cp $datadir/${db_array[$i]}/ $datadir/$dbname/
then
echo "Database $datadir/${db_array[$i]} copied"
else
pwrc_status=pwrc__mysqldbcopy
return
fi
i=$i+1
done
# Add new project into project list
pwrc_prlist_add dummy $to_pname ${base_array[pwrc_current_index]} $to_proot $to_phier ${desc_array[pwrc_current_index]} "(Copy of $from_pname)"
pwrc_prlist_write
......@@ -1549,59 +1371,10 @@ pwrc_copy_func()
pwrc_setdb_func()
{
if [ "$1" == "dbdirectory" ]; then
db=""
else
db=$1
fi
# Command is "setdb"
pwrc_get_projectname
if [ -z "$pwrp_root" ]; then
echo "No project is set"
pwrc_status=$pwrc__projnotset
return
fi
if [ -z $db ]; then
# Set directory db
if [ ! -z "$pwrp_mysql_server" ]; then
node="`eval uname -n`"
if [ $node = $pwrp_mysql_server ]; then
export PWRP_DB=:$projectname"_"$pwr_dbversion
else
export PWRP_DB=$pwrp_mysql_server:$projectname"_"$pwr_dbversion
fi
else
export PWRP_DB=:$projectname"_"$pwr_dbversion
fi
else
# Database is supplied
if [ ! -z "$pwrp_mysql_server" ]; then
node="`eval uname -n`"
if [ $node = $pwrp_mysql_server ]; then
export PWRP_DB=:$projectname"_"$db"_"$pwr_dbversion
else
export PWRP_DB=$pwrp_mysql_server:$projectname"_"$db"_"$pwr_dbversion
fi
else
export PWRP_DB=:$projectname"_"$db"_"$pwr_dbversion
fi
fi
echo "Database set to $db ($PWRP_DB)"
echo "setdb is obsolete"
pwrc_status=$pwrc__success
}
pwrc_mysql_func()
{
mysql $mysql_socket $1
}
pwrc_help_func()
{
cat << EOF
......@@ -1611,14 +1384,11 @@ pwrp_env.sh - Utilities for pwr project environment
help - Display help
create project 'name' - Create at new project
set project 'name' - Setup environment to a project
set base 'root' - Setup environment to proview base distribution
set baseroot 'root' - Setup environment to proview base distribution
set db ['db'] - Set database. If db ommitted, directory db is set.
show project - Show current project
show projects - Show all projects
show base - Show current base root
show db - Show current database
show db 'database' - Check that database exist
copy template 'db' - Copy a template database to database 'db'
EOF
}
......@@ -1633,7 +1403,6 @@ pwrc_parse ()
platform="x86_linux"
os="os_linux"
hw="hw_x86"
#mysql_socket="--socket /var/lib/mysql/mysql.sock"
local cmd
......@@ -1692,11 +1461,6 @@ pwrc_parse ()
shift
pwrc_setdb_func $@
return $pwrc_status
fi
if [ $1 = "mysql" ]; then
shift
pwrc_mysql_func $@
return
else
echo "Unknown command"
fi
......
This diff is collapsed.
......@@ -51,12 +51,12 @@ wb_adm_create_func ()
return $pwrc_status
fi
source pwrp_env.sh set project $pname
if [ $pwrc_status -ne 0 ]; then
return $pwrc_status
fi
#source pwrp_env.sh set project $pname
#if [ $pwrc_status -ne 0 ]; then
# return $pwrc_status
#fi
wb_cmd create volume/name=\"ProjectVolume\"/ident=254.254.254.253/class=\$DirectoryVolume
#wb_cmd create volume/name=\"directory\"/ident=254.254.254.253/class=\$DirectoryVolume
fi
}
......
......@@ -4,13 +4,6 @@
username=$1
password=$2
database=$3
volume=$4
if [ -z "$database" ]; then
source pwrp_env.sh setdb
else
source pwrp_env.sh setdb $database
fi
volume=$3
wb $username $password $volume
......@@ -54,10 +54,12 @@ realclean : clean $(clean_obj)
$(exe_dir)/xtt_help.dat : xtt_help.dat
@ echo "Copying xtt_help.dat"
@ $(cp) $(cpflags) $(source) $(target)
@ co_convert -t -d $(pwr_doc)/help $(source)
$(exe_dir)/sv_se/pwrb_xtthelp.dat : ../../pwrb_xtthelp.dat_sv_se
@ echo "Copying pwrb_xtthelp.dat sv_se"
@ $(cp) $(cpflags) $(source) $(target)
@ co_convert -t -d $(pwr_doc)/sv_se $(source)
$(clean_obj) : clean_%.o : %.c
......
......@@ -760,7 +760,7 @@ Engelsk text<link> ASup, "", $pwr_exe/pwrb_xtthelp.dat
Larmvervakning av analog storhet ( Analog Supervisory ).
<h1>Beskrivning
<image>orm_asup_fo.gif
vervakar analog storhet i godtyckligt objekt med avseende p ver eller
underskridande av vervakningsgrns. High anger om det r ver eller
underskridande som utgr storhetens larmlge.
......
......@@ -51,6 +51,7 @@
%# define load_cNameRttCrrObj "rtt_crro_%3.3d_%3.3d_%3.3d_%3.3d.dat"
%# define load_cNameRttCrrCode "rtt_crrc_%3.3d_%3.3d_%3.3d_%3.3d.dat"
%# define load_cNameRttPlc "rtt_plc_%3.3d_%3.3d_%3.3d_%3.3d.dat"
%# define load_cNamePkg "pwrp_pkg_%s_%04d.tgz"
%#endif
%
%
......
......@@ -276,6 +276,7 @@ static types_sEnumElement mask_Distribute_Components[] = {
{ 512 , "FlowFiles"},
{ 1024 , "RHostsFile"},
{ 2048 , "WebFiles"},
{ 4096 , "PwrpStop"},
{ 0, ""}};
static types_sEnum enum_types[] = {
......
......@@ -9,3 +9,4 @@ plcversion <plc version file corrupt> /error
syntax <syntax error> /error
nodename <node does not exist> /error
filecrp <file is corrupt> /error
noloadfile <file is no load file> /error
\ No newline at end of file
......@@ -214,6 +214,7 @@ sub build_all ()
_build("lib", "dtt", "all");
_build("exp", "rt", "all");
_build("exe", "rt*", "all");
_build("exe", "jpwr*", "all");
_build("exp", "ge", "all");
_build("mmi", "*", "copy");
_build("jpwr", "rt", "all");
......@@ -349,6 +350,7 @@ sub create()
create_dir($newdir . "/doc/sv_se");
create_dir($newdir . "/doc/prm");
create_dir($newdir . "/doc/orm");
create_dir($newdir . "/doc/help");
$newdir = $root . "/tmp";
create_dir($newdir);
......
......@@ -124,6 +124,9 @@ SObject NMps:Class
!
! 8 When the cell is reseted by the ResetObject, the dataobject is also
! removed from the database rtdb.
!
! 16 Backup. The cell and data objects in the cell, is backed up by
! the nmps backup process.
!*/
Object Function $Intern 4
Body SysBody
......
......@@ -116,6 +116,9 @@ SObject NMps:Class
!
! 8 When the cell is reseted by the ResetObject, the dataobject is also
! removed from the database rtdb.
!
! 16 Backup. The cell and data objects in the cell, is backed up by
! the nmps backup process.
!*/
Object Function $Intern 4
Body SysBody
......
......@@ -117,9 +117,16 @@ static int cmd_attach_volume_cb(
cmd->volctx,
ldh_eAccess_ReadWrite,
ldh_eUtility_Pwr);
if ( EVEN(sts)) return sts;
if ( EVEN(sts)) {
// Try read access
sts = ldh_OpenSession( &cmd->ldhses,
cmd->volctx,
ldh_eAccess_ReadOnly,
ldh_eUtility_Pwr);
if ( EVEN(sts)) return sts;
}
cmd->wnav->volume_attached( cmd->ldhses, pop);
cmd->wnav->volume_attached( cmd->wbctx, cmd->ldhses, pop);
return 1;
}
......@@ -164,23 +171,25 @@ static void cmd_save_cb( void *ctx)
Cmd *cmd = (Cmd *) ctx;
int sts;
if ( !cmd->ldhses)
{
if ( !cmd->ldhses) {
cmd->wnav->message( 'E', "Cmd is not attached to a volume");
return;
}
sts = ldh_SaveSession( cmd->ldhses);
if ( EVEN(sts))
{
if ( EVEN(sts)) {
cmd->wnav->message( 'E', wnav_get_message( sts));
return;
}
if ( cmd->wb_type == wb_eType_Directory)
{
ldh_sVolumeInfo info;
pwr_tCid volcid;
ldh_GetVolumeInfo( ldh_SessionToVol( cmd->ldhses), &info);
ldh_GetVolumeClass( cmd->wbctx, info.Volume, &volcid);
if ( volcid == pwr_eClass_DirectoryVolume) {
sts = lfu_SaveDirectoryVolume( cmd->ldhses, 0);
if ( EVEN(sts))
{
if ( EVEN(sts)) {
cmd->wnav->message( 'E', "Syntax error");
return;
}
......
......@@ -30,9 +30,9 @@ int main( int argc, char *argv[])
wb_vrepdbs *vdbs = new wb_vrepdbs(erep, argv[1]);
vdbs->load();
wb_dbs dbs(vdbs);
dbs.setFileName("lasse.dbs");
dbs.importVolume(*vdbs);
// wb_dbs dbs(vdbs);
// dbs.setFileName("lasse.dbs");
// dbs.importVolume(*vdbs);
//wb_orepdbs *op = (wb_orepdbs *)vdbs->object(&sts);
......
......@@ -75,10 +75,12 @@ realclean : clean $(clean_h) $(clean_c) $(clean_dat)
$(exe_dir)/wtt_help.dat : wtt_help.dat
@ echo "Copying wtt_help.dat"
@ $(cp) $(cpflags) $(source) $(target)
@ co_convert -t -d $(pwr_doc)/help $(source)
$(exe_dir)/ge_help.dat : ge_help.dat
@ echo "Copying ge_help.dat"
@ $(cp) $(cpflags) $(source) $(target)
@ co_convert -t -d $(pwr_doc)/help $(source)
$(exe_dir)/pwr_wb_palette.cnf : ../../pwr_wb_palette.cnf
@ echo "Copying pwr_wb_palette.cnf"
......
......@@ -235,6 +235,7 @@ topobjects ProjectNavigatorW1
class ClassVolumeConfig
class SubVolumeConfig
class WbEnvironment
class DbConfig
}
topobjects ProjectNavigatorW2
......@@ -263,15 +264,14 @@ palette ProjectNavigatorPalette
{
class ApplDistribute
class ClassVolumeLoad
class Distribute
class FriendNodeConfig
class GraphDistribute
class NodeConfig
class $NodeHier
class RootVolumeLoad
class SharedVolumeLoad
class SubVolumeLoad
class $System
class SystemDistribute
}
}
......
......@@ -7,6 +7,6 @@ link = $(ldxx) $(linkflags) $(domap) -o $(export_exe) \
-lpwr_ge -lpwr_rt -lpwr_co -lpwr_flow -lpwr_glow \
-lpwr_msg_dummy -lImlib -lMrm -lXm -lXpm -lXt -lX11 -lXext -lXp\
-lSM -lICE\
-ldb -lrpcsvc -lpthread -lm -lrt
-ldb-4.0 -lrpcsvc -lpthread -lm -lrt
endif
......@@ -851,6 +851,7 @@ Xtt::Xtt( int argc, char *argv[], int *return_sts) :
static int reglist_num = (sizeof reglist / sizeof reglist[0]);
char opplace_str[80] = "";
int opplace_found = 0;
pwr_tObjid op_objid;
hot_xtt = this;
......@@ -864,11 +865,29 @@ Xtt::Xtt( int argc, char *argv[], int *return_sts) :
for ( i = 1; i < argc; i++) {
if ( strcmp( argv[i], "-l") == 0 && i + 1 < argc)
Lng::set( argv[i+1]);
else if ( strcmp( argv[i], "-u") == 0 && i + 1 < argc) {
char oname[80];
strcpy( opplace_str, argv[i+1]);
sts = gdh_GetClassList( pwr_cClass_OpPlace, &op_objid);
while (ODD(sts)) {
sts = gdh_ObjidToName( op_objid, oname, sizeof(oname), cdh_mName_object);
if (ODD(sts) && cdh_NoCaseStrcmp( oname, opplace_str) == 0) {
sts = gdh_ObjidToName( op_objid, opplace_str, sizeof(opplace_str), cdh_mNName);
opplace_found = 1;
break;
}
}
if ( !opplace_found) {
printf("** Unable to find opplace\n");
exit(sts);
}
}
}
if ( argc >= 2 && strncmp( argv[1], "-", 1) != 0)
if ( !opplace_found && argc >= 2 && strncmp( argv[1], "-", 1) != 0)
{
pwr_tObjid op_objid;
pwr_tClassId op_class;
// First argument is opplace object
......@@ -884,8 +903,7 @@ Xtt::Xtt( int argc, char *argv[], int *return_sts) :
sts = gdh_GetObjectClass( op_objid, &op_class);
if ( EVEN(sts)) exit( sts);
if ( op_class != pwr_cClass_OpPlace)
{
if ( op_class != pwr_cClass_OpPlace) {
printf("** Error in opplace object class\n");
exit(sts);
}
......
......@@ -90,10 +90,24 @@ int main( int argc, char *argv[])
XtManageChild(mainwindow);
if ( argc > 1)
{
strcpy( graph_name, argv[1]);
ge_new( NULL, mainwindow, 0, 1, graph_name);
printf( "Argc: %d\n", argc);
if ( argc > 1) {
printf( "Arg: %s\n", argv[1]);
if ( argv[1][0] == '@') {
// Execute script
void *gectx;
pwr_tStatus sts;
gectx = ge_new( NULL, mainwindow, 0, 1, NULL);
sts = ge_command( gectx, argv[1]);
if ( EVEN(sts))
ge_message( gectx, sts);
}
else {
// Open graph
strcpy( graph_name, argv[1]);
ge_new( NULL, mainwindow, 0, 1, graph_name);
}
}
else
ge_new( NULL, mainwindow, 0, 1, NULL);
......
......@@ -2542,6 +2542,18 @@ int ge_generate_web( ldh_tSesContext ldhses)
return Graph::generate_web( ldhses);
}
int ge_command( void *ge_ctx, char *cmd)
{
ge_tCtx gectx = (ge_tCtx) ge_ctx;
return gectx->graph->command( cmd);
}
void ge_message( void *ge_ctx, pwr_tStatus sts)
{
ge_tCtx gectx = (ge_tCtx) ge_ctx;
gectx->graph->message( sts);
}
void ge_del( void *ge_ctx)
{
ge_tCtx gectx = (ge_tCtx) ge_ctx;
......@@ -2907,3 +2919,9 @@ void *ge_new( void *parent_ctx,
}
......@@ -24,6 +24,8 @@ void ge_open( void *ge_ctx, char *name);
void ge_save( void *ge_ctx, char *name);
void ge_clear( void *ge_ctx);
int ge_generate_web( ldh_tSesContext ldhses);
int ge_command( void *ge_ctx, char *cmd);
void ge_message( void *ge_ctx, pwr_tStatus sts);
#if defined __cplusplus
}
......
......@@ -2029,6 +2029,9 @@ int GeInvisible::disconnect( grow_tObject object)
int GeInvisible::scan( grow_tObject object)
{
if ( !p)
return 1;
if ( !first_scan) {
if ( old_value == *p) {
// No change since last time
......@@ -5885,6 +5888,9 @@ int GeRadioButton::disconnect( grow_tObject object)
int GeRadioButton::scan( grow_tObject object)
{
if ( !p)
return 1;
if ( !first_scan) {
if ( old_value == *p) {
// No change since last time
......
......@@ -998,7 +998,7 @@ class GeValueInput : public GeDynElem {
{}
GeValueInput( const GeValueInput& x) :
GeDynElem(x.dyn,x.dyn_type,x.action_type,x.prio), min_value(x.min_value),
max_value(x.max_value)
max_value(x.max_value), clear(x.clear), popup(x.popup)
{}
void get_attributes( attr_sItem *attrinfo, int *item_count);
void save( ofstream& fp);
......
......@@ -39,6 +39,7 @@ extern "C" {
extern "C" {
#include "co_mrm_util.h"
#include "co_msg.h"
#include "flow_x.h"
}
#include "co_lng.h"
......@@ -106,6 +107,14 @@ static int graph_get_current_colors_cb( void *g, glow_eDrawType *fill_color,
static int graph_grow_cb( GlowCtx *ctx, glow_tEvent event);
void Graph::message( pwr_tStatus sts)
{
char msg[80];
msg_GetMsg( sts, msg, sizeof(msg));
message('I', msg);
}
void Graph::message( char sev, char *text)
{
(message_cb)( parent_ctx, sev, text);
......
......@@ -471,6 +471,12 @@ class Graph {
*/
void message( char sev, char *text);
//! Print a status message
/*!
\param sts Status code.
*/
void message( pwr_tStatus sts);
int grow_pop();
int grow_push();
int grow_push_all();
......
......@@ -2478,13 +2478,15 @@ int Graph::command( char* input_str)
int sts, sym_sts;
char symbol_value[80];
dcli_toupper( input_str, input_str);
sts = dcli_replace_symbol( input_str, command, sizeof(command));
if ( EVEN(sts)) return sts;
if ( input_str[0] == '@')
{
/* Read command file */
char *s;
if ( (s = strchr( input_str, ' ')))
dcli_toupper( s, s);
sts = dcli_replace_symbol( input_str, command, sizeof(command));
if ( EVEN(sts)) return sts;
sts = readcmdfile( &command[1]);
if ( sts == DCLI__NOFILE)
{
......@@ -2495,6 +2497,10 @@ int Graph::command( char* input_str)
return DCLI__SUCCESS;
}
dcli_toupper( input_str, input_str);
sts = dcli_replace_symbol( input_str, command, sizeof(command));
if ( EVEN(sts)) return sts;
sts = dcli_cli( (dcli_tCmdTable *)&graph_command_table, command, (void *) this, 0);
if ( sts == DCLI__COM_NODEF)
{
......
......@@ -759,8 +759,6 @@ void GrowBar::convert( glow_eConvert version)
GrowRect::convert( version);
bar_drawtype = GlowColor::convert( version, bar_drawtype);
bar_bordercolor = GlowColor::convert( version, bar_bordercolor);
original_fill_drawtype = GlowColor::convert( version, original_fill_drawtype);
fill_drawtype = GlowColor::convert( version, fill_drawtype);
break;
}
......
......@@ -1949,7 +1949,10 @@ void GrowNode::convert( glow_eConvert version)
original_border_drawtype = GlowColor::convert( version, original_border_drawtype);
original_fill_drawtype = GlowColor::convert( version, original_fill_drawtype);
fill_drawtype = GlowColor::convert( version, fill_drawtype);
if ( trace.attr_type == 3 || trace.attr_type == 4 || trace.attr_type == 12) {
if ( trace.attr_type == 3 || trace.attr_type == 4 || trace.attr_type == 12 ||
trace.attr_type == 1010 || trace.attr_type == 1011 || trace.attr_type == 1012 ||
trace.attr_type == 1013 || trace.attr_type == 1014 || trace.attr_type == 1015 ||
trace.attr_type == 1016 || trace.attr_type == 1021 || trace.attr_type == 1023) {
if ( (glow_eDrawTone) trace.color == glow_eDrawTone_YellowGreen)
(glow_eDrawTone) trace.color = glow_eDrawTone_Yellow;
if ( (glow_eDrawTone) trace.color2 == glow_eDrawTone_YellowGreen)
......
......@@ -834,7 +834,7 @@ void Hist::get_hist_list()
printf(" Fel vid skapande av databashandtag avslutar\n");
return;
}
if((ret = dataBaseP->open(dataBaseP, 0, dbName, NULL, DATABASETYPE, DB_RDONLY, 0)) != 0)
if((ret = dataBaseP->open(dataBaseP, dbName, NULL, DATABASETYPE, DB_RDONLY, 0)) != 0)
{
/*error opening/creating db send the mess to errh, then exit*/
printf("error db_open: %s\n", db_strerror(ret));
......
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