Commit 2852992d authored by claes's avatar claes

*** empty log message ***

parent 95a5afdc
......@@ -6,7 +6,7 @@
<frameset rows="170,*" frameborder="0">
<frame name="I1" frameborder="0" noresize scrolling="no" src="main_menu_h.html"></frame>
<frame name="I2" frameborder="0" noresize scrolling="no" src="dev_menu.html"></frame>
<frame name="I2" frameborder="0" noresize src="dev_menu.html"></frame>
</frameset>
</html>
......@@ -46,15 +46,16 @@
<td valign="top">
<table id="mainmenu" border="1" cellspacing="0" width="100%">
<tr><td><a href="orm/pwrb_group_plc_index.html" target="_self"><font size=3>Plc</font></a></td></tr>
<tr><td><a href="orm/pwrb_group_plcgrafcet_index.html" target="_self">PlcGrafcet</a></td></tr>
<tr><td><a href="orm/pwrb_group_plcio_index.html" target="_self">PlcIO</a></td></tr>
<tr><td><a href="orm/pwrb_group_plclogic_index.html" target="_self">PlcLogic</a></td></tr>
<tr><td><a href="orm/pwrb_group_plcanalog_index.html" target="_self">PlcAnalog</a></td></tr>
<tr><td><a href="orm/pwrb_group_plccontrol_index.html" target="_self">PlcControl</a></td></tr>
<tr><td><a href="orm/pwrb_group_plcconversion_index.html" target="_self">PlcConversion</a></td></tr>
<tr><td><a href="orm/pwrb_group_plcdata_index.html" target="_self">PlcData</a></td></tr>
<tr><td><a href="orm/pwrb_group_plcdrive_index.html" target="_self">PlcDrive</a></td></tr>
<tr><td><a href="orm/pwrb_group_plcedit_index.html" target="_self">PlcEdit</a></td></tr>
<tr><td><a href="orm/pwrb_group_plcgrafcet_index.html" target="_self">PlcGrafcet</a></td></tr>
<tr><td><a href="orm/pwrb_group_plcio_index.html" target="_self">PlcIO</a></td></tr>
<tr><td><a href="orm/pwrb_group_plclogic_index.html" target="_self">PlcLogic</a></td></tr>
<tr><td><a href="orm/pwrb_group_plcstring_index.html" target="_self">PlcString</a></td></tr>
<tr><td><a href="orm/pwrb_group_plcdata_index.html" target="_self">PlcData</a></td></tr>
</table>
</td>
<td valign="top">
......
......@@ -6,7 +6,7 @@
<frameset rows="170,*" frameborder="0">
<frame name="I1" frameborder="0" noresize scrolling="no" src="../main_menu_h.html"></frame>
<frame name="I2" frameborder="0" noresize scrolling="no" src="main_menu.html"></frame>
<frame name="I2" frameborder="0" noresize src="main_menu.html"></frame>
</frameset>
</html>
......@@ -6,6 +6,6 @@ link = $(ld) $(linkflags) $(domap) -o $(export_exe) \
$(pwr_obj)/rt_io_user.o \
-lpwr_rt -lpwr_co \
-lpwr_msg_dummy \
-ldb -lrpcsvc -lpthread -lm -lrt
-ldb-4.0 -lrpcsvc -lpthread -lm -lrt
endif
......@@ -31,12 +31,15 @@ static sEvent *CopyEvent(
);
int compTime(sKey d1, sKey d2);
int writeInfo(int nrOfEvents, int firstTimeEver, pwr_tTime *oldestEventTime);
sHelCB lHelCB;
DB *dataBaseP = NULL;
pwr_tUInt32 nrOfInsertsSinceLastTime = 0;
headtyp *listhead;
linktyp *lanklank;
char info_fname[200];
int
main ()
{
......@@ -99,6 +102,7 @@ Init ()
char fname[200];
dcli_translate_filename( fname, DATABASE);
dcli_translate_filename( info_fname, DATABASE_INFO);
sts = gdh_GetNodeIndex(&lHelCB.Nid);
If_Error_Log_Exit(sts, "gdh_GetNodeIndex");
......@@ -133,7 +137,7 @@ Init ()
exit(1);
}
/*open the database*/
if((ret = dataBaseP->open(dataBaseP, 0, fname, NULL, DATABASETYPE, DB_CREATE, 0664)) != 0)
if((ret = dataBaseP->open(dataBaseP, fname, NULL, DATABASETYPE, DB_CREATE, 0664)) != 0)
{
/*error opening/creating db send the mess to errh, then exit*/
sprintf(msg, "db_open: %s, no eventlogger will run", db_strerror(ret));
......@@ -240,14 +244,11 @@ void Store( pwr_tBoolean *firstTime, pwr_tUInt32 *nrOfEvents, pwr_tUInt32 *nrOfK
if( (ret = dataBaseP->del(dataBaseP, NULL, &key, 0)) != 0 )
{
sprintf(msg, "Error deleting Record in HistDB nrOfKeys = %d Errmess=%s\n", *nrOfKeys, db_strerror(ret));
// printf("\n%s\n", msg);
Log(msg);
}
else
{
*nrOfEvents = *nrOfEvents - 1;
// printf("Stdar, nrOfEvents= %d, nrOfKeys = %d, nrOfinssin= %d\n", *nrOfEvents,
// *nrOfKeys, nrOfInsertsSinceLastTime);
}
elimlink(&lanklank);
......@@ -255,7 +256,22 @@ void Store( pwr_tBoolean *firstTime, pwr_tUInt32 *nrOfEvents, pwr_tUInt32 *nrOfK
}
}
if(*nrOfKeys > 0)
{
lanklank = firstlink(listhead);
if(lanklank != 0)
{
writeInfo(*nrOfEvents+nrOfInsertsSinceLastTime, 0, &lanklank->data.EventTime);
}
else
{
writeInfo(*nrOfEvents+nrOfInsertsSinceLastTime, 0, NULL);
}
}
else
{
writeInfo(*nrOfEvents+nrOfInsertsSinceLastTime, 0, NULL);
}
}
pwr_tInt32 GetOldestEvents(pwr_tUInt32 *nrOfEvents , pwr_tUInt32 *nrOfKeys)
......@@ -378,3 +394,26 @@ int compTime(sKey d1, sKey d2)
}
return 0;
}
int writeInfo(int nrOfEvents, int firstTimeEver, pwr_tTime *oldestEventTime)
{
FILE *info_file = NULL;
char time_str[40];
time_str[0] = 0;
if(oldestEventTime != NULL)
{
time_AtoAscii(oldestEventTime, time_eFormat_DateAndTime, time_str, sizeof(time_str));
}
//open a file to print info about the database to
info_file = fopen( info_fname, "w" );
if(info_file == NULL) return 2;
fprintf(info_file, "NrOfEvents:%d OldestEventTime:%s\n", nrOfEvents, time_str);
fclose(info_file);
return 1;
}
......@@ -22,6 +22,7 @@
#define DUMPFILE "rt_eventlog.dump"
#define DATABASE "$pwrp_db/rt_eventlog.db"
#define DATABASE_INFO "$pwrp_db/rt_eventlog_info.txt"
#define DATABASETYPE DB_HASH
#define DATABASESTAT_STRUCT DB_BTREE_STAT
......
......@@ -2,14 +2,19 @@
pkg_install_func ()
{
if [ ! -e "$1" ]; then
echo "No package $1"
exit 1
fi
pkg_remove_func "force"
pkg=/home/pwrp/$1
if [ $1 == ${1##*/} ]; then
# Add path
pkg="/home/pwrp/$1"
else
pkg=$1
fi
if [ ! -e "$pkg" ]; then
echo "No package $pkg"
exit 1
fi
echo "-- Installing package $1"
cd /tmp
......@@ -24,6 +29,7 @@ pkg_install_func ()
pkg_list_func ()
{
if [ -z $1 ]; then
# List installed package
......@@ -35,13 +41,18 @@ pkg_list_func ()
datfile=$pwrp_load/pwr_pkg.dat
else
# Extract datfile from package
if [ ! -e $1 ]; then
if [ $1 == ${1##*/} ]; then
# Add path
pkg="/home/pwrp/$1"
else
pkg=$1
fi
if [ ! -e $pkg ]; then
echo "-- No such package"
exit 1
fi
pkg=`eval locate $1`
echo "-- Opening file $pkg"
cd /tmp
......@@ -71,6 +82,7 @@ pkg_list_func ()
pkg_listfiles_func ()
{
if [ -z $1 ]; then
# List installed package
......@@ -82,13 +94,18 @@ pkg_listfiles_func ()
datfile=$pwrp_load/pwr_pkg.dat
else
# Extract datfile from package
if [ ! -e $1 ]; then
if [ $1 == ${1##*/} ]; then
# Add path
pkg="/home/pwrp/$1"
else
pkg=$1
fi
if [ ! -e $pkg ]; then
echo "-- No such package"
exit 1
fi
pkg=`eval locate $1`
echo "-- Opening file $pkg"
cd /tmp
......@@ -148,12 +165,18 @@ pkg_brief_func ()
for file
do
if [ ! -e $file ]; then
if [ $file == ${file##*/} ]; then
# Add path
pkg="/home/pwrp/$file"
else
pkg=$file
fi
if [ ! -e $pkg ]; then
echo "-- No such package"
exit 1
fi
pkg=`eval locate $file`
dir=`eval pwd`
cd /tmp
......@@ -172,7 +195,8 @@ pkg_brief_func ()
break
fi
if [ $printout -eq 1 ]; then
echo $line
fname=`eval basename $pkg`
echo $fname ${line#Proview package}
fi
fi
done
......@@ -183,6 +207,48 @@ pkg_brief_func ()
fi
}
pkg_dir_func()
{
if [ -z $1 ]; then
allpkg=`ls /home/pwrp/pwrp_pkg_*.tgz`
else
if [ $1 == ${1##*/} ]; then
# Add path
pattern="/home/pwrp/*$1*"
else
pattern=*$1*
fi
allpkg=`ls $pattern`
fi
for pkg in $allpkg ; do
if [ -z ${pkg##*pwrp_pkg_*.tgz} ]; then
pkg_brief_func $pkg
fi
done
}
pkg_dirbrief_func()
{
if [ -z $1 ]; then
allpkg=`ls /home/pwrp/pwrp_pkg_*.tgz`
else
if [ $1 == ${1##*/} ]; then
# Add path
pattern="/home/pwrp/*$1*"
else
pattern=*$1*
fi
allpkg=`ls $pattern`
fi
for pkg in $allpkg ; do
if [ -z ${pkg##*pwrp_pkg_*.tgz} ]; then
basename $pkg
fi
done
}
pkg_remove_func ()
{
if [ ! -e $pwrp_load/pwr_pkg.dat ]; then
......@@ -205,7 +271,7 @@ pkg_remove_func ()
done
} < $pwrp_load/pwr_pkg.dat
if [ ! $1 = "force" ]; then
if [ ! "$1" = "force" ]; then
echo ""
echo -n "Do you wan't to remove package $pkg (y/n) [n] "
read remove_pkg
......@@ -238,25 +304,42 @@ pkg_remove_func ()
}
force="no"
while getopts ":i:l:b:fra:" opt; do
while [ -n "$(echo $1 | grep '-')" ]; do
case $opt in
i ) pkg_install_func $OPTARG ;;
OPTARG=$2
case $1 in
-i ) pkg_install_func $OPTARG ;;
l ) pkg_list_func $OPTARG ;;
-la ) pkg_list_func $OPTARG ;;
a ) pkg_listfiles_func $OPTARG;;
-lf ) pkg_listfiles_func $OPTARG;;
b ) shift
-lp ) shift
pkg_brief_func $@ ;;
r ) pkg_remove_func $force ;;
-r ) pkg_remove_func ;;
-rf ) force="force"
pkg_remove_func $force ;;
-ld ) pkg_dir_func $OPTARG ;;
-l ) pkg_dirbrief_func $OPTARG;;
* ) cat <<EOF
usage: pwr_pkg [-i pkg] [-l [pkg]] [-b [pkg]] [-r]
f ) force="force" ;;
pwr_pkg -i 'pkg' Install package 'pkg'
pwr_pkg -r Remove currently installed package
pwr_pkg -lp ['pkg'] List installed package, or package 'pkg'
pwr_pkg -la ['pkg'] List installed package, or package 'pkg', all info
pwr_pkg -lf ['pkg'] List files in installed package, or package 'pkg'
pwr_pkg -l List all packages
\? ) echo 'usage: pwr_pkg [-i pkg] [-l] [-b] [-r]'
EOF
exit 1
esac
shift
done
......
......@@ -164,6 +164,31 @@ EOF
wb_cmd @$tmpfile
}
reload_cnvdump()
{
reload_checkpass "cnvdump" $start_pass
if [ $pass_status -ne $pass__execute ]; then
reload_status=$reload__success
return
fi
reload_continue "Pass convert dumpfiles"
dmpfiles=`eval ls $pwrp_db/*.wb_dmp`
echo $dmpfiles
for dmpfile in $dmpfiles; do
file=${dmpfile##/*/}
db="${file%.*}.db"
if [ $db = "wb.db" ]; then
db=""
else
sed 's/ GetIp / GetIpToA /; s/ StoIp / StoAtoIp /; s/ CStoIp / CStoAtoIp /; s/Class-GetIp/Class-GetIpToA/; s/Class-StoIp/Class-StoAtoIp/; s/Class-CStoIp/Class-CStoAtoIp/' $dmpfile > $pwrp_tmp/t.wb_dmp
mv $pwrp_tmp/t.wb_dmp $dmpfile
fi
done
}
reload_createvolumes()
{
......@@ -189,6 +214,7 @@ reload_createvolumes()
done
}
reload_localwb()
{
reload_checkpass "localwb" $start_pass
......@@ -438,6 +464,7 @@ usage()
userclasses Load userclasses.wb_load
dirvolume Create directory volume.
cnvdirvolume Convert the directory volume.
cnvdump Convert dumpfiles.
createvolumes Create configured databases.
localwb Create LocalWb volume for lists and template objects.
compile Compile all plcprograms in the database
......@@ -476,7 +503,7 @@ databases=`eval source $v34_root/os_linux/hw_x86/exp/exe/pwrp_env.sh show db -a`
databases=$databases" dbdirectory"
export pwr_inc=$pwrb_root/os_linux/hw_x86/exp/inc
passes="dumpdb userclasses dirvolume cnvdirvolume createvolumes localwb compile createload createboot convertge"
passes="dumpdb userclasses dirvolume cnvdirvolume cnvdump createvolumes localwb compile createload createboot convertge"
echo "Pass: $passes"
echo ""
echo -n "Enter start pass [dumpdb] > "
......
......@@ -68,7 +68,7 @@ SObject pwrb:Class
!/**
! Name of the associated channel object.
!*/
Object SigChanCon $Objid 2
Object SigChanCon $Attribute 2
Body SysBody
Attr TypeRef = "pwrs:Type-$Objid"
EndBody
......
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