Call function from other kit

83 views
Skip to first unread message

Romain Boyer

unread,
Aug 26, 2017, 12:03:30 AM8/26/17
to Sedona Framework
Hi all,

I'm creating a kit and I need Log function, I know I can write a native method to create it otherwise I can integrate in dependency easyioFGMathConversion kit.
In my code how can I call Log function from other kit ?

Thanks!

Andrey Skvortsov

unread,
Aug 26, 2017, 6:33:57 AM8/26/17
to sedo...@googlegroups.com
Hi Romain,
First you should include dependency into your kits.xml
like this
<depend on="func 1.2+" />

And then you may call any function from that in your sedona kit.


If you want to use instance of any class inherited from Component class,
then you need in your class include inline instance.

inline Cmpr cmp;

Because now Sedona Virtual Machine doesn't call methods of inline cmp
member, you have to do this by yourself in sedona code.

virtual override void loaded()
{
cmp.loaded()
...
}

virtual override void start()
{
cmp.start()
...
}

virtual override void execute()
{
cmp.execute()
...
}

virtual override void stop()
{
cmp.stop()
...
}


--
Best regards,
Andrey Skvortsov


signature.asc

Romain Boyer

unread,
Aug 26, 2017, 12:02:53 PM8/26/17
to Sedona Framework
Thanks mister!

Another question I want to change variable type from float to double
@summary property float Resistance
@summary property float ResistanceLog

 ResistanceLog = Math.log(Resistance);
 double test = (float)ResistanceLog

I have this error  'float' is not assignable to 'double

Thanks

Romain Boyer

unread,
Aug 26, 2017, 12:22:54 PM8/26/17
to Sedona Framework
My bad I got it ;)

@summary property float Resistance
@summary property float ResistanceLog

 ResistanceLog = Math.log(Resistance);
 double test = (double)ResistanceLog

I have a variable
double varA  = 0.0010291947674224981d
But in software I just see 0.00 and my calculation result is always 0.00
Where can I change precision?

Andrey Skvortsov

unread,
Aug 29, 2017, 3:10:56 PM8/29/17
to sedo...@googlegroups.com
Hi Romain,

On 17-08-26 09:22, Romain Boyer wrote:
> My bad I got it ;)
>
> @summary property float Resistance
> @summary property float ResistanceLog
>
> ResistanceLog = Math.log(Resistance);
> double test = (*double*)ResistanceLog
>
> I have a variable
> double varA = 0.0010291947674224981d
> But in software I just see 0.00 and my calculation result is always 0.00
> Where can I change precision?

It depends on software tool, that you use to work with
sedona. I'm using CPT and it has setting 'Max Num of Decimals'. But it
affects only properties and has no effect on wire sheet.
Other software may have other settings.

But calculations is done using full precision regardless of these settings.
signature.asc
Reply all
Reply to author
Forward
0 new messages