Jump to content
Developer Wiki and Function Reference Links ×

Reset PIO from within another PIO


BobD

Recommended Posts

Hello All,

This seems to be an ongoing question. I have a PIO with parametric data which other PIOs read and are then generated.

What I want to happen is to immediately reflect parameter data changes in one PIO in other specific PIOs.

I have tried all combinations of ResetObject, resetting class name, RedrawAll, as suggested in this forum.

The best that I can get to happen is to modify a parameter twice in a row, and the second time I can get the other PIO to regenerate correctly.

Any ideas out there?

thanks,

BobD.

Link to comment

If you change parameters in any PIO (including the currently executing PIO), using SetRField, then those changes will be immediately accessible using GetRField. They will not be accessible using "pParamName" within the currently executing PIO. "pParamName" values are constants whose values cannot be changed during the execution of a script.

Note that using SetRField to modify a parameter in another PIO will not cause the reset of that PIO, the way changing a parameter in the Object Info palette causes a reset of the selected object. You have to call ResetObject on another PIO to get its script to run.

What does not happen immediately is that if one PIO is executing, and it calls ResetObject on another PIO, that PIO will not regenerate until after the first PIO's script is done.

While resetting the class name will cause a regen, and while this at one time was a necessary work-around in some situations, this should no longer be necessary. ResetObject should work in all cases, at least to the same extent as any work-around would work.

ReDrawAll will not reset anything. It merely forces a refresh of the screen, though within PIOs this generally doesn't do much. The part of the screen that VW thinks needs to be redrawn will automatically be redrawn, and anything outside of the bounding box of the PIO (before or after the reset) will be left as is. This can sometimes leave artifacts on the screen. There are work-arounds for that, but screen artifacts are not the issue here.

Calling SetRField twice on another PIO should accomplish nothing, so I'm puzzled as to how this could be helping.

HTH,

Link to comment

Charles,

Thanks so much for your reply.

Yes, I agree with all that you said.

The only issue is synchronization. In the executing PIO I use SetRField and ResetObject on the second PIO and when the first PIO is done, indeed the params in the second PIO are updated, but no redraw occurs in the second PIO unless I move it, etc... , so the second PIO drawing can be out of synch with its own param values.

However, if I update a param in the first PIO twice in a row, then the second PIO will redraw correctly.

I guess this is the best I can expect at this time.

Thanks again,

Bob D.

Link to comment

OK, so it's not that you're calling SetRField on the other PIO twice; it's that you have to alter a parameter in the OI palette twice, regening the first PIO twice, to get the second PIO to update.

Are there only two PIOs in question here? The reason I ask is that there is a different issue that can surface when there is a chain of resets that goes back and forth between PIO types. But it doesn't sound like that's the issue here.

I'm stumped.

What version of VW are you running, and on what platform?

Link to comment

How many different actual PIOs are getting updated? I don't mean how many PIO instances in the drawing -- I mean how many different PIO types? In other words, is it all "Point Object #1", or is it "Point Object #1", "Linear Object #1", "Point Object #2", etc., that are in the reset chain? To put it another way, in the plug-in editor, where it lists the plug-ins of which VW is aware, how many of those items are involved?

Edited by Charles Chandler
Link to comment

Charles,

There are 5 different types of PIOs, not instances. On any given layer one of the 5 would be on a layer along with the PIO that sets the params. By linear I meant the update would have to be to one of the PIOs, not recursive among 5 PIOs. So linear does not mean a type of object in this context.

Thanks,

Bob

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...