You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by "pedro.pinto" <pe...@gmail.com> on 2007/03/23 11:28:15 UTC

Noob guy in Velocity terminology

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...
					
-- 
View this message in context: http://www.nabble.com/Noob-guy-in-Velocity-terminology-tf3452940.html#a9632112
Sent from the Velocity - User mailing list archive at Nabble.com.


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


Re: Noob guy in Velocity terminology##SPAM

Posted by ap...@recks.org.
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


Re: Noob guy in Velocity terminology##SPAM

Posted by ap...@recks.org.
> I hope i had been clear enough...

this time I don't understand the question nor the examples;
sorry, can't help...

:( Christoph


pedro.pinto wrote:
> 
> This is maybe a silly question but, and if I want to show the name of the
> parameter splited as in here:
> 
> noValueText='$parameter'
> 
> in 
>  
> ParameterNames="${parameter}#STATE_PC">)
> 
> but I also with the same behavior I had with:
> 
> ParameterNames="${parameter_orig}#STATE_PC">)
> 
> 
> Imagine parameter_orig  is like RPHGA.RR57.RQ8.R5B1/SUB_51 and this value
> activates a specific STATE_PC....but I want that appears in the Interface
> only 
> RQ8.R5B1/SUB_51..but with the same STATE_PC behavior I had with the
> parameter_orig name...
> 
> notice that:
> 
>> #set( $parameter_orig = $parameter )
>> #set( $parameter = $converter.getDeviceNameSplited("$parameter") )
> 
> and
> 
> STATE_PC
> 
> <panel layout="GridLayout(0,1)"  >
> 				<gridbagconstraints  fill="GridBagConstraints.BOTH" insets="2,2,2,2"
> gridx="0" gridy="1"  weightx="1.0" weighty="0.8"/> 	
> 				<vbox>
> 				<SummaryViewer  PreferredSize="600,80"
> parameterNames='$converter.convert("$parameterList")' Font="-BOLD-48" 
> Field="STATE_PC" States="" Background="blue" />
> 				<glue PreferredSize="600,80"/>
> 				<SummaryViewer PreferredSize="600,80"
> parameterNames='$converter.convert("$parameterList")' Field="STATE_PC"
> States="FLT_OFF" Background="red" Font="-BOLD-48"/>
> 				<glue PreferredSize="600,80"/>
> 				<SummaryViewer PreferredSize="600,80"
> parameterNames='$converter.convert("$parameterList")' Field="STATE_PC"
> States="FLT_STOPPING,SLOW_ABORT" Background="orange" Font="-BOLD-48"/>
> 				<glue PreferredSize="600,80"/>
> 				<SummaryViewer PreferredSize="600,80"
> parameterNames='$converter.convert("$parameterList")' Field="STATE_PC"
> States="STARTING,STOPPING,TO_STANDBY,RUNNING,ABORTING,DIRECT_RT"
> Background="FFFF5A" Font="-BOLD-48"/>
> 				<glue PreferredSize="600,80"/>
> 				<SummaryViewer PreferredSize="600,80"
> parameterNames='$converter.convert("$parameterList")' Field="STATE_PC"
> States="ON_STANDBY,IDLE,CHECKING" Background="199400" Font="-BOLD-48"/>
> 				<glue PreferredSize="600,80"/>
> 				<SummaryViewer PreferredSize="600,80"
> parameterNames='$converter.convert("$parameterList")' Field="STATE_PC"
> States="ARMED" Background="8c06a0" Font="-BOLD-48"/>
> 				<glue PreferredSize="600,80"/>
> 				<SummaryViewer PreferredSize="600,80"
> parameterNames='$converter.convert("$parameterList")' Field="STATE_PC"
> States="OFF" Background="white" Font="-BOLD-48"/>
> 				</vbox>
> 	    	</panel>
> 
> 
> 
> I hope i had been clear enough...
> 
> Thanks for the help!!!
> \
> 
> 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


Re: Noob guy in Velocity terminology

Posted by "pedro.pinto" <pe...@gmail.com>.

This is maybe a silly question but, and if I want to show the name of the
parameter splited as in here:

noValueText='$parameter'

in 
 
ParameterNames="${parameter}#STATE_PC">)

but I also with the same behavior I had with:

ParameterNames="${parameter_orig}#STATE_PC">)


Imagine parameter_orig  is like RPHGA.RR57.RQ8.R5B1/SUB_51 and this value
activates a specific STATE_PC....but I want that appears in the Interface
only 
RQ8.R5B1/SUB_51..but with the same STATE_PC behavior I had with the
parameter_orig name...

notice that:

> #set( $parameter_orig = $parameter )
> #set( $parameter = $converter.getDeviceNameSplited("$parameter") )

and

STATE_PC

<panel layout="GridLayout(0,1)"  >
				<gridbagconstraints  fill="GridBagConstraints.BOTH" insets="2,2,2,2"
gridx="0" gridy="1"  weightx="1.0" weighty="0.8"/> 	
				<vbox>
				<SummaryViewer  PreferredSize="600,80"
parameterNames='$converter.convert("$parameterList")' Font="-BOLD-48" 
Field="STATE_PC" States="" Background="blue" />
				<glue PreferredSize="600,80"/>
				<SummaryViewer PreferredSize="600,80"
parameterNames='$converter.convert("$parameterList")' Field="STATE_PC"
States="FLT_OFF" Background="red" Font="-BOLD-48"/>
				<glue PreferredSize="600,80"/>
				<SummaryViewer PreferredSize="600,80"
parameterNames='$converter.convert("$parameterList")' Field="STATE_PC"
States="FLT_STOPPING,SLOW_ABORT" Background="orange" Font="-BOLD-48"/>
				<glue PreferredSize="600,80"/>
				<SummaryViewer PreferredSize="600,80"
parameterNames='$converter.convert("$parameterList")' Field="STATE_PC"
States="STARTING,STOPPING,TO_STANDBY,RUNNING,ABORTING,DIRECT_RT"
Background="FFFF5A" Font="-BOLD-48"/>
				<glue PreferredSize="600,80"/>
				<SummaryViewer PreferredSize="600,80"
parameterNames='$converter.convert("$parameterList")' Field="STATE_PC"
States="ON_STANDBY,IDLE,CHECKING" Background="199400" Font="-BOLD-48"/>
				<glue PreferredSize="600,80"/>
				<SummaryViewer PreferredSize="600,80"
parameterNames='$converter.convert("$parameterList")' Field="STATE_PC"
States="ARMED" Background="8c06a0" Font="-BOLD-48"/>
				<glue PreferredSize="600,80"/>
				<SummaryViewer PreferredSize="600,80"
parameterNames='$converter.convert("$parameterList")' Field="STATE_PC"
States="OFF" Background="white" Font="-BOLD-48"/>
				</vbox>
	    	</panel>



I hope i had been clear enough...

Thanks for the help!!!
\

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...
> 					
> 

-- 
View this message in context: http://www.nabble.com/Noob-guy-in-Velocity-terminology-tf3452940.html#a9635921
Sent from the Velocity - User mailing list archive at Nabble.com.


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