Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F1497875
setupNode.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Size
1 KB
Referenced Files
None
Subscribers
None
setupNode.cpp
View Options
#include
"setupNode.h"
#include
"rlutil.h"
//#define PRINT
using
namespace
rlutil
;
void
setWorkingCycleOfSensor
(
Sensor
*
sensor
,
unsigned
int
workingCycle
)
{
if
(
sensor
->
set_workingCycle
(
workingCycle
))
{
#ifdef PRINT
printf
(
" > WorkingCycle of Sensor "
);
setColor
(
TXTCOLOR_LIGHTCYAN
);
printf
(
"%s "
,
sensor
->
get_name
().
c_str
());
setColor
(
TXTCOLOR_GREY
);
printf
(
"(id: %03u) "
,
sensor
->
get_id
());
setColor
(
TXTCOLOR_LIGHTGREEN
);
printf
(
"set "
);
setColor
(
TXTCOLOR_GREY
);
printf
(
"to %u
\n
"
,
workingCycle
);
#endif
// PRINT
}
else
{
#ifdef PRINT
setColor
(
TXTCOLOR_LIGHTRED
);
printf
(
" > Couldn't set WorkingCycle of Sensor %s (id: %03u)
\n
"
,
sensor
->
get_name
().
c_str
(),
sensor
->
get_id
());
setColor
(
TXTCOLOR_GREY
);
#endif
// PRINT
}
}
void
setWorkingCycleOfAgent
(
Agent
*
agent
,
unsigned
int
workingCycle
)
{
if
(
agent
->
set_workingCycle
(
workingCycle
))
{
#ifdef PRINT
printf
(
" > WorkingCycle of Agent "
);
setColor
(
TXTCOLOR_LIGHTCYAN
);
printf
(
"%s "
,
agent
->
get_name
().
c_str
());
setColor
(
TXTCOLOR_GREY
);
printf
(
"(id: %03u) "
,
agent
->
get_id
());
setColor
(
TXTCOLOR_LIGHTGREEN
);
printf
(
"set "
);
setColor
(
TXTCOLOR_GREY
);
printf
(
"to %u
\n
"
,
workingCycle
);
#endif
// PRINT
}
else
{
#ifdef PRINT
setColor
(
TXTCOLOR_LIGHTRED
);
printf
(
" > Couldn't set WorkingCycle of Sensor %s (id: %03u)
\n
"
,
agent
->
get_name
().
c_str
(),
agent
->
get_id
());
setColor
(
TXTCOLOR_GREY
);
#endif
// PRINT
}
}
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sun, Mar 1, 10:18 PM (1 d, 4 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
287462
Default Alt Text
setupNode.cpp (1 KB)
Attached To
Mode
R20 SoC_Rosa_repo
Attached
Detach File
Event Timeline
Log In to Comment