You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by ap...@recks.org on 2007/03/23 13:12:12 UTC

Re: Noob guy in Velocity terminology##SPAM

Hi Pedro,

... make a copy of the value before using it:

#set( $parameter_orig = $parameter )
#set( $parameter = $converter.getDeviceNameSplited("$parameter") )
<ParameterInfoViewerValueInd   fieldName="I_MEAS" abs="true"
...
ParameterNames="${parameter_orig}#STATE_PC">
</ParameterInfoViewerValueInd>

Cheers,
Christoph

P.S. Cool to see Velocity combined with SwiXML ;)

pedro.pinto wrote:
> Hi,
> 
> I'm developer at CERN and I started to use velocity yesterday and I have
> many questions but, I have this piece of code:
> 
> #macro( screenType2 $title $text $parameters $name)
> <Screen title="Set $title" visible="true" name="screen$name">
> 	<panel layout="GridBagLayout"> 
> 
> 		#header($text)
> 
> 		
> 		
> 		<panel layout="FlowLayout"  >
> 		<gridbagconstraints  fill="GridBagConstraints.BOTH" insets="2,2,2,2"
> gridx="0" gridy="1"  weightx="1.0" weighty="0.8"/> 	
> 
> 				#foreach( $parameter in $parameters)
> 					##$attributeController.getDeviceAttributeValue("AAA", "BBB")
> 					##$parameter
> 					##$attributeController.getDeviceAttributeValue( "$parameter", "IMAX_EG"
> )
> 					#set( $imax = $attributeController.getDeviceAttributeValue(
> "$parameter", "IMAX_EG" ) )
> 					
> 					#if( ! $imax ) 
> 						#set( $imax="5" )
> 					#end
> 	
> 					##set( $imin = $attributeController.getDeviceAttributeValue(
> $parameter, "IMIN" ) )
> 					#if( ! $imin ) 
> 						#set( $imin="0" )
> 					#end
> 					
> 					#set( $inom = $attributeController.getDeviceAttributeValue(
> "$parameter", "INOM" ) )
> 					#if( ! $inom ) 
> 						#set( $inom="3" )
> 					#end
> 					
> 					#set( $parameter = $converter.getDeviceNameSplited("$parameter"))
> 					
> <ParameterInfoViewerValueInd   fieldName="I_MEAS" abs="true"
> maxValue="$imax" minValue="$imin" nomValue="$inom" textColorInversion="true"
> errorColor="blue" Background="blue" onlyStatic="false" 
> PreferredSize="295,26" border="MatteBorder(1,1,1,1,black)"
> Foreground="white"   Font="-BOLD-18"
> StringColorCondition="FLT_OFF,OFF,FLT_STOPPING,STOPPING,STARTING,SLOW_ABORT,TO_STANDBY,ON_STANDBY,IDLE,CHECKING,ARMED,RUNNING,ABORTING,DIRECT_RT;
> red, white, orange, FFFF5A, FFFF5A, orange, FFFF5A, green, green, green,
> 8c06a0, FFFF5A, FFFF5A, FFFF5A" noValueText='$parameter'
> ParameterNames="${parameter}#STATE_PC">
> </ParameterInfoViewerValueInd>
> 
> 
> Where the variable '$parameter' represents a name of a parameter spited with
> set( $parameter = $converter.getDeviceNameSplited("$parameter"))......the
> problem is that this application is dynamic....and when
> ParameterNames="${parameter}#STATE_PC" is invoked the parameter value was
> already splited and  I can't get the initial parameter value defined in the
> beginning of the macro....so...I get always the noValueText...
> 
> So, I would like to know how to solve this....
> 
> PS: I really don't know if I expressed myself well...
> 					

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@velocity.apache.org
For additional commands, e-mail: user-help@velocity.apache.org