API move image function different in AM4.0

Discuss suspected bugs with other users and Sim Innovations Staff

Moderators: russ, Ralph

Post Reply
Message
Author
Detlef
Posts: 304
Joined: Mon Nov 16, 2020 9:43 am
Location: Bavaria

API move image function different in AM4.0

#1 Post by Detlef »

Hi there,

I installed AM 4.0 today. I am currently working on Saab S340B Carenado Instruments. I had buttons move with this function:

move(but.id, but.x+3-gDim.x_offset, but.y+3-gDim.y_offset, 184, 128, "LINEAR")

The buttons did not move anymore. When I add a movement speed parameter, it works again, like this:

move(but.id, but.x+3-gDim.x_offset, but.y+3-gDim.y_offset, 184, 128, "LINEAR", 1)

The speed parameter must be different from 0. I guess the default speed is 0. But the speed parameter is optional according to the API documentation. So the image should move when I say "LINEAR" even without an additional parameter.

No big thing. Great job with the update!

'Thanks
Detlef

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: API move image function different in AM4.0

#2 Post by Sling »

I believe that’s an error on the wiki page based on what there for the rotate function. If you think about it, why would a type work on its own without a speed. The rotate function has a similar set of arguments but not one without speed. I expect the older version was using a speed default value but from what you say it seems to have now been removed.

Whatever the fix is, It would be good to make the move and rotate functions the same.

User avatar
Keith Baxter
Posts: 4674
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: API move image function different in AM4.0

#3 Post by Keith Baxter »

Sling wrote: Sun Apr 25, 2021 9:53 am I believe that’s an error on the wiki page based on what there for the rotate function. If you think about it, why would a type work on its own without a speed. The rotate function has a similar set of arguments but not one without speed. I expect the older version was using a speed default value but from what you say it seems to have now been removed.

Whatever the fix is, It would be good to make the move and rotate functions the same.
Tony,

I suspect, It might be the (Optional) has changed between AM versions.

As Detlef says. Not a big issue. As long as the API indicates the change and is consistent and if (options) are in "sets" or can truly be optional. The description I suppose indicates that.

In this case the animation speed is optional as per description.

Code: Select all

move(node_id, x, y, width, height, animation_type) (from AM/AP 4.0)
move(node_id, x, y, width, height, animation_type, animation_speed) (from AM/AP 4.0)
If @Corjan could please indicate if this a issue or the API will be altered to accommodate the way (optional ) is handled.
The SI Guys are extremely busy ATM so not expecting changes tomorrow.

Keith
Last edited by Keith Baxter on Sun Apr 25, 2021 10:34 am, edited 1 time in total.
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Sling
Posts: 5237
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: API move image function different in AM4.0

#4 Post by Sling »

The wiki says Rotate only has this variant so whichever way its done they should be consistent. Meaning remove the type only variant from the move wiki page or add the type only variant to the rotate wiki function and alter the AM code to make the move and rotate functions use a default speed when its not used with the type only variants. If the later approach is used it would be good to put the default speed value on the move and rotate wiki pages.

Code: Select all

rotate(node_id, degrees, animation_type, animation_speed)

Post Reply