Issues.00292 - lordmundi/wikidoctest GitHub Wiki
00292: Add the ability to define nested macros
Summary: Add the ability to define nested macros
Created: 2010–11–05 14:22
Status: Released
Category: Request
From: brad
Version: 2.1
Released_In: 2.2
Description:
This is a request to allow the use of nested macros. This would make it easier to define more compressed config files by allowing more complex substitutions based on environment variables.
Comments
brad November 05, 2010, at 03:05 PM: This is done.
frankie November 30, 2010, at 01:52 PM: As an example, consider the case where each of the projectors in a graphics dome will need their own display context with their own view line. Rather than have many duplicated blocks, this lets us define the viewport string to a variable, and then select which variable to use in the viewport definition based off of other variables passed in (such as the hostname). For example:
DSP_CONFIG
{
DEFINES
{
# Defaults, in case these are not specified via -D on command line
#DISP rocbotw
CAMERA ${${DISP}_CAM}
#WINDOW 01
rocbotw_CAM CM_Cam
rocbotw01_RECLINED "${CAMERA} pan( 0.0) tilt( 90.0) spin( 0.0) window(-3.2491, 3.2491, -2.4932, 4.2447, 10.0, 1000000000000.0) xywh(0,0,140,105)"
rocbotw02_RECLINED "${CAMERA} pan( 72.0) tilt( 31.0) spin( 2.0) window(-5.7735, 5.7735, 3.0573, 14.2814, 10.0, 1000000000000.0) xywh(0,0,140,105)"
rocbotw03_RECLINED "${CAMERA} pan( 0.0) tilt( 31.0) spin( 0.0) window(-5.7735, 5.7735, 3.0573, 14.8256, 10.0, 1000000000000.0) xywh(0,0,140,105)"
rocbotw04_RECLINED "${CAMERA} pan(-72.0) tilt( 31.0) spin( 2.0) window(-5.7735, 5.7735, 3.0573, 14.2814, 10.0, 1000000000000.0) xywh(0,0,140,105)"
rocbotw05_RECLINED "${CAMERA} pan( 76.0) tilt( 15.0) spin( 0.0) window(-7.8128, 8.0978, -2.6794, 10.7236, 10.0, 1000000000000.0) xywh(0,0,140,105)"
rocbotw06_RECLINED "${CAMERA} pan( 0.0) tilt( 15.0) spin( 0.0) window(-9.3251, 9.3251, -2.6794, 10.7236, 10.0, 1000000000000.0) xywh(0,0,140,105)"
rocbotw07_RECLINED "${CAMERA} pan(-76.0) tilt( 15.0) spin( 0.0) window(-8.0978, 7.8128, -2.6794, 10.7236, 10.0, 1000000000000.0) xywh(0,0,140,105)"
rocbotw08_RECLINED "${CAMERA} pan( 84.0) tilt( -7.0) spin(-4.0) window(-7.0020, 7.0020, -4.8773, 4.8773, 10.0, 1000000000000.0) xywh(0,0,140,105)"
rocbotw09_RECLINED "${CAMERA} pan( 27.0) tilt( -8.0) spin( 0.0) window(-8.3909, 6.7450, -5.0952, 5.0952, 10.0, 1000000000000.0) xywh(0,0,140,105)"
rocbotw10_RECLINED "${CAMERA} pan(-26.0) tilt(-12.0) spin( 0.0) window(-6.7450, 9.6568, -5.0952, 5.0952, 10.0, 1000000000000.0) xywh(0,0,140,105)"
rocbotw11_RECLINED "${CAMERA} pan(-84.0) tilt( -7.0) spin( 4.0) window(-6.7450, 7.5355, -4.8773, 4.8773, 10.0, 1000000000000.0) xywh(0,0,140,105)"
}
...
and then later, in the display context channel definition, we may have:
channel1
{
view.${DISP}${WINDOW}_RECLINED ${${DISP}${WINDOW}_RECLINED}
}
which lets us pick the appropriate define based off of the "DISP" and "WINDOW" variables. We could set these in our startup script environment or pass them in using the "-D" command line define capability. However they are defined, it lets us then select which string defined above to use. This capability will recurse as far as needed until all variables have been resolved.
Associated Commits
| commit | c60a8be101e098381eec30e12588ea4636e9a9da
link6 |
||
| Author: | Brad Bell
|
| Date: | Mon Nov 15 04:48:33 2010 -0600
|
| Message: | [@Issue 00292: Fixed a warning message that was not giving the right info
@] |
Affected Files:
lib_Linux_FC3/libdsp.a | Bin 961958 -> 961990 bytes
lib_Linux_FC3/libdsp_s.so | Bin 802301 -> 802333 bytes
lib_Win32/libdsp.dll | Bin 295936 -> 295936 bytes
lib_Win32/libviewer.dll | Bin 494592 -> 494592 bytes
4 files changed, 0 insertions(+), 0 deletions(-)
| commit | 544ad187e3af80fde5e29776221d0ee792f873e8
link7 |
||
| Author: | Brad Bell
|
| Date: | Fri Nov 5 08:42:50 2010 -0500
|
| Message: | [@Issue 00293: Done Issue 00292: Done
@] |
Affected Files:
lib_Linux_FC3/libdsp.a | Bin 958450 -> 959982 bytes
lib_Linux_FC3/libdsp_s.so | Bin 799821 -> 800605 bytes
lib_Win32/libdsp.dll | Bin 295424 -> 295424 bytes
lib_Win32/libviewer.dll | Bin 494592 -> 494592 bytes
4 files changed, 0 insertions(+), 0 deletions(-)