How to interact with "Modify Display" and "Save" buttons from custom symbol code.

Hello, I'm making a map custom symbol and I'm wondering if it is possible to access the status of the "Modify Display" and "Save" button from the custom symbol code.



Here are the 2 cases I'm trying to address.

 

  1. When I enable "Modify Display" and move the custom symbol, the map view also moves. I would like to detect when "Modify Display is enabled so that the map view is locked in place and only the custom symbol moves. 
    Modify Display button enabled.png
  2. When I move the map view to a specific location, the Save button remains greyed out and disabled. I would like to enable "Save" button when the map view is moved to save that specific location.
    Save button enabled. .png

Please let me know if this is possible. Any tips are greatly appreciated. Thanks

 

Kind regards,

Julian

Parents
  • While you technically could hook into those situations, more than likely, it's not going to be recommended or supported by AVEVA. For your first use-case, that's true of every symbol because the border is drawn around the canvas. Your symbol should move as much as everything else, so what is the concern there?

     

    For your other use case, if you move a symbol on the canvas, the save capability should become available, and again, this is true for every symbol. So I'm not sure what you're doing to have that specific issue.

  • Thanks for your reply. I'll try to clarify the 2 use cases.

    1. When I move the custom symbol, the map that is embedded inside of the custom symbol also moves around, which makes it annoying to relocate. If I had context on the "Modify Display" button I would be able to lock the internal map, while the custom symbol can be moved around the PI display like normal.
      image.png
    2. While "Modify Display" is disabled, the map embedded in the map custom symbol is still able to be dragged around. In the screenshot below, I've dragged Chicago to the top right corner within the map, but the save capability remains unavailable. I would like it to become available after dragging the embedded map view.
      image_1.png

      image_2.png
  • Thanks for the clarity, that helps. I haven't embedded maps before, so I won't be able to give specific advice to that. If your map moves with the symbol, you might want to try seeing if there are ways to prevent that from the embedded side (ie lock map movement to only being possible by using buttons). From my memory, there's nothing supported that would tell you that the display is being edited, but even then, you would want to make sure the user could still properly navigate the map while actively trying to update it. There are internal tools to both AngularJS and ones that OSIsoft had built, and they may offer functionality that you're looking for. But they can change, and you will not know until you do an upgrade and your symbol breaks.

     

    For your other issue, you need to trigger an update to your symbol. If you want to change the viewed location on the map, you'd want to save that in your symbol so you navigate to it when the display loads. That's not a PI Vision symbol issue, you need to make sure you are linking the map changes to your state (config) so that changes are persisted. Once you do that, then the save functionality will work as expected.

Reply
  • Thanks for the clarity, that helps. I haven't embedded maps before, so I won't be able to give specific advice to that. If your map moves with the symbol, you might want to try seeing if there are ways to prevent that from the embedded side (ie lock map movement to only being possible by using buttons). From my memory, there's nothing supported that would tell you that the display is being edited, but even then, you would want to make sure the user could still properly navigate the map while actively trying to update it. There are internal tools to both AngularJS and ones that OSIsoft had built, and they may offer functionality that you're looking for. But they can change, and you will not know until you do an upgrade and your symbol breaks.

     

    For your other issue, you need to trigger an update to your symbol. If you want to change the viewed location on the map, you'd want to save that in your symbol so you navigate to it when the display loads. That's not a PI Vision symbol issue, you need to make sure you are linking the map changes to your state (config) so that changes are persisted. Once you do that, then the save functionality will work as expected.

Children
No Data