Commit a52affb5 authored by Claes Sjöfors's avatar Claes Sjöfors

Project pwrdemo, program ra_status added

parent ad0ff03c
#!/bin/bash
nodename=`eval uname -n`
unamestr=`eval uname`
onamestr=`eval uname -o`
machine=`eval uname -m`
if [ $unamestr == "Darwin" ]; then
os="os_macos"
hw="hw_x86_64"
opsys=256
elif [ $unamestr == "FreeBSD" ]; then
os="os_freebsd"
hw="hw_x86_64"
opsys=1024
elif [ $unamestr == "OpenBSD" ]; then
os="os_openbsd"
hw="hw_x86_64"
opsys=2048
elif [ $onamestr == "Cygwin" ]; then
os="os_cygwin"
hw="hw_x86"
opsys=4096
else
if [ $machine == "x86_64" ]; then
machine="x86_64"
opsys=128
elif [ ${machine:0:3} == "arm" ]; then
machine="arm"
opsys=512
else
machine="x86"
opsys=64
fi
os="os_linux"
hw="hw_"$machine
fi
export pwra_db=$pwre_broot/$os/$hw/bld/project/adm/db
source $pwra_db/pwr_setup.sh
source $pwra_db/pwra_env.sh set project pwrdemo
my : demo_all
include $(pwr_exe)/pwrp_rules.mk
demo_modules = $(pwrp_exe)/ra_status
demo_all : $(demo_modules)
$(pwrp_exe)/ra_status : $(pwrp_appl)/ra_status.c
@ echo "Building ra_status"
@ g++ -g -o $(target) $(source) -I$(pwr_inc) -L$(pwr_lib) -lpwr_rt -lpwr_co -lpwr_msg_dummy -lrpcsvc -lpthread -lm -lrt
/*
Print current project status
*/
#include <stdio.h>
#include "pwr.h"
#include "rt_gdh.h"
int main()
{
pwr_tStatus sts, system_sts;
sts = gdh_Init("ra_status");
if (EVEN(sts)) {
printf("E pwrdemo status, gdh_Init error status: %u\n", sts);
exit(0);
}
sts = gdh_GetObjectInfo("Nodes-DemoNode.SystemStatus", &system_sts,
sizeof(system_sts));
if (EVEN(sts)) {
printf("E pwrdemo status, gdh_GetObjectInfo error status: %u\n", sts);
exit(0);
}
if (ODD(system_sts))
printf("I pwrdemo status success: %u\n", system_sts);
else
printf("E pwrdemo status error: %u\n", system_sts);
}
! Generated by wb_print_wbl 17-MAR-2020 16:58:29.18
! Generated by wb_print_wbl 19-MAR-2020 17:05:49.60
! Volume directory
! Version V5.7.1
Volume directory $DirectoryVolume 254.254.254.253
......@@ -16,7 +16,7 @@ Volume directory $DirectoryVolume 254.254.254.253
Attr BusNumber = 999
EndBody
Object DemoNode NodeConfig 10 11-MAY-2006 15:40:05.54
Body RtBody 17-MAR-2020 16:58:29.15
Body RtBody 19-MAR-2020 17:05:49.56
Attr NodeName = "aristotle"
Attr OperatingSystem = 128
Attr Address = "127.0.0.1"
......@@ -39,7 +39,7 @@ Volume directory $DirectoryVolume 254.254.254.253
EndObject
Object Build BuildConfig 14 03-FEB-2017 15:14:34.90
Body DevBody 03-FEB-2017 15:14:31.33
Attr VersionManager = 0
Attr VersionManager = 0
EndBody
Object pop BuildDirectory 16 03-FEB-2017 15:16:25.51
Body DevBody 03-FEB-2017 15:16:47.60
......@@ -69,6 +69,11 @@ Volume directory $DirectoryVolume 254.254.254.253
Attr Target = "$pwrp_inc/"
EndBody
EndObject
Object ra_status BuildMake 23 19-MAR-2020 17:02:17.98
Body DevBody 19-MAR-2020 17:02:24.03
Attr Makefile = "makefile"
EndBody
EndObject
EndObject
Object pwr_exe BuildDirectory 21 17-MAR-2020 16:29:34.33
Body DevBody 17-MAR-2020 16:29:38.54
......
......@@ -25,5 +25,6 @@ buildcopy pop $pwrp_pop/*.pwg $pwrp_exe/
buildcopy pop $pwrp_pop/*.pwg $pwrp_web/
builddir appl 1 ""
buildcopy appl $pwrp_appl/ra_plc_user.h $pwrp_inc/
buildmake appl $pwrp_appl/ "makefile"
builddir pwr_exe 2 ""
buildcopy pwr_exe $pwr_exe/pwr_logga.png $pwrp_web/
This diff is collapsed.
......@@ -66,7 +66,6 @@ cd ..
echo "-- copy project to package tree"
mv pwrdemo pwrdemo$ver
tar -chf $tarfile pwrdemo$ver
tar -tf $tarfile
mv pwrdemo$ver pwrdemo
cd $pkgroot/usr/pwrp
tar -xf $tarfile
......
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