Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
05542d4a
Commit
05542d4a
authored
Jul 16, 2020
by
Claes
Committed by
Esteban Blanc
Dec 23, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
pwrdemo rt_status creating logfile
parent
4ce23d13
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
97 additions
and
31 deletions
+97
-31
project/pwrdemo/src/appl/makefile
project/pwrdemo/src/appl/makefile
+1
-1
project/pwrdemo/src/appl/ra_status.c
project/pwrdemo/src/appl/ra_status.c
+0
-30
project/pwrdemo/src/appl/ra_status.cpp
project/pwrdemo/src/appl/ra_status.cpp
+80
-0
project/pwrdemo/src/appl/ra_status.h
project/pwrdemo/src/appl/ra_status.h
+16
-0
No files found.
project/pwrdemo/src/appl/makefile
View file @
05542d4a
...
@@ -8,6 +8,6 @@ demo_modules = $(pwrp_exe)/ra_status
...
@@ -8,6 +8,6 @@ demo_modules = $(pwrp_exe)/ra_status
demo_all
:
$(demo_modules)
demo_all
:
$(demo_modules)
$(pwrp_exe)/ra_status
:
$(pwrp_appl)/ra_status.c
$(pwrp_exe)/ra_status
:
$(pwrp_appl)/ra_status.c
pp
@
echo
"Building ra_status"
@
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
@
g++
-g
-o
$(target)
$(source)
-I
$(pwr_inc)
-L
$(pwr_lib)
-lpwr_rt
-lpwr_co
-lpwr_msg_dummy
-lrpcsvc
-lpthread
-lm
-lrt
project/pwrdemo/src/appl/ra_status.c
deleted
100644 → 0
View file @
4ce23d13
/*
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
);
}
project/pwrdemo/src/appl/ra_status.cpp
0 → 100644
View file @
05542d4a
/*
Print current project status
*/
#include <stdio.h>
#include "pwr.h"
#include "co_cdh.h"
#include "rt_gdh.h"
#include "ra_status.h"
void
ra_status
::
test_status
()
{
pwr_tStatus
sts
,
system_sts
;
pwr_tOid
noid
;
pwr_tOName
name
;
m_sts
=
gdh_GetNodeObject
(
0
,
&
noid
);
if
(
EVEN
(
m_sts
))
{
m_log
->
log
(
'E'
,
"gdh_GetNodeObject"
,
m_sts
);
return
;
}
m_sts
=
gdh_ObjidToName
(
noid
,
name
,
sizeof
(
name
),
cdh_mName_volumeStrict
);
if
(
EVEN
(
m_sts
))
{
m_log
->
log
(
'E'
,
"gdh_ObjidToName"
,
m_sts
);
return
;
}
strcat
(
name
,
".SystemStatus"
);
m_sts
=
gdh_GetObjectInfo
(
name
,
&
system_sts
,
sizeof
(
system_sts
));
if
(
EVEN
(
m_sts
))
{
m_log
->
log
(
'E'
,
"gdh_GetObjectInfo"
,
m_sts
);
return
;
}
switch
(
errh_Severity
(
system_sts
))
{
case
errh_eSeverity_Success
:
m_log
->
log
(
'S'
,
"Success system status"
,
system_sts
);
break
;
case
errh_eSeverity_Info
:
m_log
->
log
(
'I'
,
"Info system status"
,
system_sts
);
break
;
case
errh_eSeverity_Warning
:
m_log
->
log
(
'W'
,
"Warning system status"
,
system_sts
);
break
;
case
errh_eSeverity_Error
:
m_log
->
log
(
'E'
,
"Error system status"
,
system_sts
);
break
;
case
errh_eSeverity_Fatal
:
m_log
->
log
(
'F'
,
"Fatal system status"
,
system_sts
);
break
;
}
}
// Constructor
ra_status
::
ra_status
()
{
m_log
=
new
tst_log
(
&
m_sts
,
"pwrdemo-Status"
,
"$pwrp_tmp/pwrdemo_status.tlog"
);
if
(
EVEN
(
m_sts
))
printf
(
"** Unable to open log file"
);
m_sts
=
gdh_Init
(
"ra_status"
);
if
(
EVEN
(
m_sts
))
{
m_log
->
log
(
'F'
,
"gdh_Init"
,
m_sts
);
exit
(
0
);
}
}
// Destructor
ra_status
::~
ra_status
()
{
delete
m_log
;
}
int
main
()
{
ra_status
s
;
s
.
test_status
();
}
project/pwrdemo/src/appl/ra_status.h
0 → 100644
View file @
05542d4a
#include "pwr.h"
#include "co_cdh.h"
#include "rt_gdh.h"
#include "co_tst_log.h"
class
ra_status
{
pwr_tStatus
m_sts
;
tst_log
*
m_log
;
public:
ra_status
();
~
ra_status
();
void
test_status
();
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment