Skip to main content



      Home
Home » Eclipse Projects » Eclipse Titan » Function eveluation in template(TTCN-3 Template Function Evaluation)
Function eveluation in template [message #1810333] Thu, 08 August 2019 06:21 Go to next message
Eclipse UserFriend
Hello,

I have a template with one of the field resulting of a function evaluation:
            template LongPosVector mw_longPosVectorPosition(
                in template (value) LongPosVector p_longPosVector
            ) := {
                gnAddr := p_longPosVector.gnAddr,
                timestamp_ := ?,
                latitude := f_getDelta32(valueof(p_longPosVector.latitude), PX_POS_DELTA),
                longitude := f_getDelta32(valueof(p_longPosVector.longitude), PX_POS_DELTA),
                pai := ?,
                //FIXME May the delta factor should be based on the actual speed value -> low speed=lower delta, high speed=higher delta
                speed := f_getDelta15(valueof(p_longPosVector.speed), float2int(int2float(valueof(p_longPosVector.speed)) * 0.03)),
                heading := p_longPosVector.heading
            }


It seems that the function was evaluated only once, during the first evaluation of the template, doesn't it?

Thanks a lot

Yann
Re: Function eveluation in template [message #1810335 is a reply to message #1810333] Thu, 08 August 2019 07:20 Go to previous messageGo to next message
Eclipse UserFriend
Hi Yann,

I would code a function dynamically building the template, so that it is clear when the new template is generated.
Something like:

function f_LongPosVectorPosition(template (value) LongPosVector p_LongPosVector) return template LongPosVector 
{
 template LongPosVector v_LongPosVector;
 v_LongPosVector := ...
    ;
 return  v_LongPosVector;
};


Regards,
Olaf
Re: Function eveluation in template [message #1810336 is a reply to message #1810333] Thu, 08 August 2019 07:32 Go to previous messageGo to next message
Eclipse UserFriend
Hi Yann,

I'm not sure which function you're talking about. It looks like there are 3 function calls in that template (2x f_getDelta32 and 1x f_getDelta15).
All of them should be called every time the template is evaluated.

Best regards,
Botond
Re: Function eveluation in template [message #1810383 is a reply to message #1810336] Fri, 09 August 2019 04:18 Go to previous message
Eclipse UserFriend
Hello Botond, Olaf,

Thanks a lot for your answers.
I tried with the latest version of TITAN and you're right, the functions f_getDeltaxx() are evaluated each time the template is evaluated.
I'm going to cross-check with the company which raised the issue because .

Thanks again for your help,

Yann
Previous Topic:TCP ASPs over TLS
Next Topic:Need help to run a DNS test for ttcn3
Goto Forum:
  


Current Time: Wed Jul 23 22:05:47 EDT 2025

Powered by FUDForum. Page generated in 0.05645 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top