Commit 2852992d authored by claes's avatar claes

*** empty log message ***

parent 95a5afdc
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<frameset rows="170,*" frameborder="0"> <frameset rows="170,*" frameborder="0">
<frame name="I1" frameborder="0" noresize scrolling="no" src="main_menu_h.html"></frame> <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> </frameset>
</html> </html>
...@@ -46,15 +46,16 @@ ...@@ -46,15 +46,16 @@
<td valign="top"> <td valign="top">
<table id="mainmenu" border="1" cellspacing="0" width="100%"> <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_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_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_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_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_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_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> </table>
</td> </td>
<td valign="top"> <td valign="top">
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
<frameset rows="170,*" frameborder="0"> <frameset rows="170,*" frameborder="0">
<frame name="I1" frameborder="0" noresize scrolling="no" src="../main_menu_h.html"></frame> <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> </frameset>
</html> </html>
...@@ -6,6 +6,6 @@ link = $(ld) $(linkflags) $(domap) -o $(export_exe) \ ...@@ -6,6 +6,6 @@ link = $(ld) $(linkflags) $(domap) -o $(export_exe) \
$(pwr_obj)/rt_io_user.o \ $(pwr_obj)/rt_io_user.o \
-lpwr_rt -lpwr_co \ -lpwr_rt -lpwr_co \
-lpwr_msg_dummy \ -lpwr_msg_dummy \
-ldb -lrpcsvc -lpthread -lm -lrt -ldb-4.0 -lrpcsvc -lpthread -lm -lrt
endif endif
...@@ -31,12 +31,15 @@ static sEvent *CopyEvent( ...@@ -31,12 +31,15 @@ static sEvent *CopyEvent(
); );
int compTime(sKey d1, sKey d2); int compTime(sKey d1, sKey d2);
int writeInfo(int nrOfEvents, int firstTimeEver, pwr_tTime *oldestEventTime);
sHelCB lHelCB; sHelCB lHelCB;
DB *dataBaseP = NULL; DB *dataBaseP = NULL;
pwr_tUInt32 nrOfInsertsSinceLastTime = 0; pwr_tUInt32 nrOfInsertsSinceLastTime = 0;
headtyp *listhead; headtyp *listhead;
linktyp *lanklank; linktyp *lanklank;
char info_fname[200];
int int
main () main ()
{ {
...@@ -99,6 +102,7 @@ Init () ...@@ -99,6 +102,7 @@ Init ()
char fname[200]; char fname[200];
dcli_translate_filename( fname, DATABASE); dcli_translate_filename( fname, DATABASE);
dcli_translate_filename( info_fname, DATABASE_INFO);
sts = gdh_GetNodeIndex(&lHelCB.Nid); sts = gdh_GetNodeIndex(&lHelCB.Nid);
If_Error_Log_Exit(sts, "gdh_GetNodeIndex"); If_Error_Log_Exit(sts, "gdh_GetNodeIndex");
...@@ -133,7 +137,7 @@ Init () ...@@ -133,7 +137,7 @@ Init ()
exit(1); exit(1);
} }
/*open the database*/ /*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*/ /*error opening/creating db send the mess to errh, then exit*/
sprintf(msg, "db_open: %s, no eventlogger will run", db_strerror(ret)); 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 ...@@ -240,14 +244,11 @@ void Store( pwr_tBoolean *firstTime, pwr_tUInt32 *nrOfEvents, pwr_tUInt32 *nrOfK
if( (ret = dataBaseP->del(dataBaseP, NULL, &key, 0)) != 0 ) 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)); sprintf(msg, "Error deleting Record in HistDB nrOfKeys = %d Errmess=%s\n", *nrOfKeys, db_strerror(ret));
// printf("\n%s\n", msg);
Log(msg); Log(msg);
} }
else else
{ {
*nrOfEvents = *nrOfEvents - 1; *nrOfEvents = *nrOfEvents - 1;
// printf("Stdar, nrOfEvents= %d, nrOfKeys = %d, nrOfinssin= %d\n", *nrOfEvents,
// *nrOfKeys, nrOfInsertsSinceLastTime);
} }
elimlink(&lanklank); elimlink(&lanklank);
...@@ -255,7 +256,22 @@ void Store( pwr_tBoolean *firstTime, pwr_tUInt32 *nrOfEvents, pwr_tUInt32 *nrOfK ...@@ -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) pwr_tInt32 GetOldestEvents(pwr_tUInt32 *nrOfEvents , pwr_tUInt32 *nrOfKeys)
...@@ -378,3 +394,26 @@ int compTime(sKey d1, sKey d2) ...@@ -378,3 +394,26 @@ int compTime(sKey d1, sKey d2)
} }
return 0; 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 @@ ...@@ -22,6 +22,7 @@
#define DUMPFILE "rt_eventlog.dump" #define DUMPFILE "rt_eventlog.dump"
#define DATABASE "$pwrp_db/rt_eventlog.db" #define DATABASE "$pwrp_db/rt_eventlog.db"
#define DATABASE_INFO "$pwrp_db/rt_eventlog_info.txt"
#define DATABASETYPE DB_HASH #define DATABASETYPE DB_HASH
#define DATABASESTAT_STRUCT DB_BTREE_STAT #define DATABASESTAT_STRUCT DB_BTREE_STAT
......
...@@ -2,14 +2,19 @@ ...@@ -2,14 +2,19 @@
pkg_install_func () pkg_install_func ()
{ {
if [ ! -e "$1" ]; then
echo "No package $1"
exit 1
fi
pkg_remove_func "force" 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" echo "-- Installing package $1"
cd /tmp cd /tmp
...@@ -24,6 +29,7 @@ pkg_install_func () ...@@ -24,6 +29,7 @@ pkg_install_func ()
pkg_list_func () pkg_list_func ()
{ {
if [ -z $1 ]; then if [ -z $1 ]; then
# List installed package # List installed package
...@@ -35,13 +41,18 @@ pkg_list_func () ...@@ -35,13 +41,18 @@ pkg_list_func ()
datfile=$pwrp_load/pwr_pkg.dat datfile=$pwrp_load/pwr_pkg.dat
else else
# Extract datfile from package # 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" echo "-- No such package"
exit 1 exit 1
fi fi
pkg=`eval locate $1`
echo "-- Opening file $pkg" echo "-- Opening file $pkg"
cd /tmp cd /tmp
...@@ -71,6 +82,7 @@ pkg_list_func () ...@@ -71,6 +82,7 @@ pkg_list_func ()
pkg_listfiles_func () pkg_listfiles_func ()
{ {
if [ -z $1 ]; then if [ -z $1 ]; then
# List installed package # List installed package
...@@ -82,13 +94,18 @@ pkg_listfiles_func () ...@@ -82,13 +94,18 @@ pkg_listfiles_func ()
datfile=$pwrp_load/pwr_pkg.dat datfile=$pwrp_load/pwr_pkg.dat
else else
# Extract datfile from package # 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" echo "-- No such package"
exit 1 exit 1
fi fi
pkg=`eval locate $1`
echo "-- Opening file $pkg" echo "-- Opening file $pkg"
cd /tmp cd /tmp
...@@ -148,12 +165,18 @@ pkg_brief_func () ...@@ -148,12 +165,18 @@ pkg_brief_func ()
for file for file
do 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" echo "-- No such package"
exit 1 exit 1
fi fi
pkg=`eval locate $file`
dir=`eval pwd` dir=`eval pwd`
cd /tmp cd /tmp
...@@ -172,7 +195,8 @@ pkg_brief_func () ...@@ -172,7 +195,8 @@ pkg_brief_func ()
break break
fi fi
if [ $printout -eq 1 ]; then if [ $printout -eq 1 ]; then
echo $line fname=`eval basename $pkg`
echo $fname ${line#Proview package}
fi fi
fi fi
done done
...@@ -183,6 +207,48 @@ pkg_brief_func () ...@@ -183,6 +207,48 @@ pkg_brief_func ()
fi 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 () pkg_remove_func ()
{ {
if [ ! -e $pwrp_load/pwr_pkg.dat ]; then if [ ! -e $pwrp_load/pwr_pkg.dat ]; then
...@@ -205,7 +271,7 @@ pkg_remove_func () ...@@ -205,7 +271,7 @@ pkg_remove_func ()
done done
} < $pwrp_load/pwr_pkg.dat } < $pwrp_load/pwr_pkg.dat
if [ ! $1 = "force" ]; then if [ ! "$1" = "force" ]; then
echo "" echo ""
echo -n "Do you wan't to remove package $pkg (y/n) [n] " echo -n "Do you wan't to remove package $pkg (y/n) [n] "
read remove_pkg read remove_pkg
...@@ -238,25 +304,42 @@ pkg_remove_func () ...@@ -238,25 +304,42 @@ pkg_remove_func ()
} }
force="no" force="no"
while getopts ":i:l:b:fra:" opt; do while [ -n "$(echo $1 | grep '-')" ]; do
case $opt in OPTARG=$2
i ) pkg_install_func $OPTARG ;; 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 $@ ;; 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 exit 1
esac esac
shift
done done
......
...@@ -164,6 +164,31 @@ EOF ...@@ -164,6 +164,31 @@ EOF
wb_cmd @$tmpfile 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() reload_createvolumes()
{ {
...@@ -189,6 +214,7 @@ reload_createvolumes() ...@@ -189,6 +214,7 @@ reload_createvolumes()
done done
} }
reload_localwb() reload_localwb()
{ {
reload_checkpass "localwb" $start_pass reload_checkpass "localwb" $start_pass
...@@ -438,6 +464,7 @@ usage() ...@@ -438,6 +464,7 @@ usage()
userclasses Load userclasses.wb_load userclasses Load userclasses.wb_load
dirvolume Create directory volume. dirvolume Create directory volume.
cnvdirvolume Convert the directory volume. cnvdirvolume Convert the directory volume.
cnvdump Convert dumpfiles.
createvolumes Create configured databases. createvolumes Create configured databases.
localwb Create LocalWb volume for lists and template objects. localwb Create LocalWb volume for lists and template objects.
compile Compile all plcprograms in the database 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` ...@@ -476,7 +503,7 @@ databases=`eval source $v34_root/os_linux/hw_x86/exp/exe/pwrp_env.sh show db -a`
databases=$databases" dbdirectory" databases=$databases" dbdirectory"
export pwr_inc=$pwrb_root/os_linux/hw_x86/exp/inc 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 "Pass: $passes"
echo "" echo ""
echo -n "Enter start pass [dumpdb] > " echo -n "Enter start pass [dumpdb] > "
......
...@@ -68,7 +68,7 @@ SObject pwrb:Class ...@@ -68,7 +68,7 @@ SObject pwrb:Class
!/** !/**
! Name of the associated channel object. ! Name of the associated channel object.
!*/ !*/
Object SigChanCon $Objid 2 Object SigChanCon $Attribute 2
Body SysBody Body SysBody
Attr TypeRef = "pwrs:Type-$Objid" Attr TypeRef = "pwrs:Type-$Objid"
EndBody 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