Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 10:21 Go to next message
Yann Garcia is currently offline Yann GarciaFriend
Messages: 145
Registered: June 2016
Senior Member
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 11:20 Go to previous messageGo to next message
Olaf Bergengruen is currently offline Olaf BergengruenFriend
Messages: 122
Registered: November 2018
Senior Member
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 11:32 Go to previous messageGo to next message
Botond Baranyi is currently offline Botond BaranyiFriend
Messages: 53
Registered: February 2016
Member
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 08:18 Go to previous message
Yann Garcia is currently offline Yann GarciaFriend
Messages: 145
Registered: June 2016
Senior Member
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 Apr 24 18:26:56 GMT 2024

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

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

Back to the top