1 Reply Latest reply on Oct 18, 2017 10:27 AM by NyameyeO

    Collection Breaks Until Metadata Received Upon Forced Update

    NyameyeO

      Hello,

       

      As a follow up to this question : https://pisquare.osisoft.com/message/105176-re-how-to-force-collection-symbols-to-be-updated-when-stencilsymbolsconfigur…

       

      I implemented the button as per the the above link, however I have noticed some curious behaviour. When there are multiple of these collections on the display, and I click the button, only the most recently added collection will properly update, the other n amount of symbols will fail to load for a matter of seconds, presumably until meta data is received as it takes roughly a minute.

       

      If I manually enter edit mode by right-clicking, formatting the symbol, changing the checkbox which is assigned to the boolean flag, and exiting edit mode manually, all visually through PI Vision, this problem does not occur. Should I be using some sort of requestUpdate method before scope.$emit('escape')?

       

      All the button does is loop through the Symbols Collection > find the collection > enterEditSelectedSymbol on the collection > change the StencilSymbols.Configuration variable to be true or false > and finally exit edit mode with scope.$emit('escape').

       

      I cannot understand what could cause this when manually changing does not, unless something about the StencilSymbols is config is different from a standalone symbols, or meta data works different when there are multiple collection in the display.

       

      Thanks in advance for any help given!

       

      Message was edited by: Nyameye Otoo

        • Re: Collection Breaks Until Metadata Received Upon Forced Update
          NyameyeO

          After being unable to come to a solution on how to fix the issue, some digging led me to believe it was what 'scope.$emit('escape')' did (or did not do) when called.

          On the diffForData sent after the button is pressed with 'scope.$emit('escape')', only one symbol included the 'IncludeMetadata : true' property, with the others set to false. Whilst searching for a way to force this to be true only for a single update, it occurred to me that there must be a proper alternative way that does not "force" the symbol to exit and still complete it's call; it was only logical that if there was an 'enterEditSelectedSymbol()' there would be an 'exitEditSelectedSymbol' and it turns out that there was.

           

          Calling 'exitEditSelectedSymbol' instead of 'scope.$emit('escape')' fixes this issue.

          I will also update the original thread, hope this is of use to someone.