Results 1 to 5 of 5

Thread: Why are variables where they are?

  1. #1
    Join Date
    Jun 2005
    Posts
    760

    Default Why are variables where they are?

    In G4 when one wanted to find a Lua variable related to the RSS feed, for example, one would look under the RSS variable tree in the Girder variable display.
    But with G5, when I look in the RSS tree, I find an overwhelming number of variables; most of which don't seem to belong there. For example, the value for variable:
    RSS.Provider.Local.Devices.List[26].DisplayName
    is X10P2 which is one of my X10 devices. What's it doing there?
    Likewise, I did finally found a URL related to the G5 RSS feed. The value of:
    http://news.bbc.co.uk/go/rss/-/1/hi/...st/7128170.stm
    was located in G5 Lua variable:
    DeviceManager.ConnectionManager.Clients.51b2e72b-47de-4f0e-aa37-6fcc8f3d4f71.Client.cache.labels.emma\RSS\BBC World News\ItemList.Values_3_URL
    ... and I'm sure this isn't the right place to grab the variable if one is trying to send it to NetRemote.

    What is the logic behind where variables related to a G5 plugin are stored? How does one find these variables?

    I asked a similar question when I was trying to find where the CallerID log was stored. I never got a straight answer, but that very helpful Rob suggested the following script to populate a CallerID table with the key 'Calls':
    Code:
    CallerID = {}
    local cidCmp = ComponentManager:GetComponentUsingName('Caller ID Handler')
    if cidCmp then
       CallerID.Calls = cidCmp.Settings.Calls
    end
    Do I have to do this with all the G5 plugins to get the variables?

  2. #2
    Join Date
    May 2004
    Location
    Cardigan, UK
    Posts
    9,278

    Default

    The relevant variables will probably already be being sent to NR.

    It really depends on the component
    --Rob

  3. #3
    Join Date
    Sep 2006
    Location
    Silicon Valley, CA
    Posts
    320

    Default

    What if one doesn't want to use NR and just want to get the data directly from Girder?
    ??

    Quote Originally Posted by Rob H View Post
    The relevant variables will probably already be being sent to NR.

    It really depends on the component

  4. #4
    Join Date
    May 2004
    Location
    Cardigan, UK
    Posts
    9,278

    Default

    Again it depends on the component.

    Generally the first step is to use
    Code:
    ComponentManager:GetComponentUsingName()
    If the component has multiple instances you'll need to call the component's GetInstance() method to find the specific instance.

    However, if you want to know about changes to the component then I'd recommend getting the component as in the first step and subscribing to it e.g.

    Code:
    comp:Subscribe(function(cmp, instance, event, ...)
        if event == ComponentManager.Component.Events.Update) then
           -- deal with the event here
        end
    end)
    --Rob

  5. #5
    Join Date
    Sep 2006
    Location
    Silicon Valley, CA
    Posts
    320

    Default

    Rob - Thanks!
    This is something new for me.. I'll give this a try..

    Quote Originally Posted by Rob H View Post
    Again it depends on the component.

    Generally the first step is to use
    Code:
    ComponentManager:GetComponentUsingName()
    If the component has multiple instances you'll need to call the component's GetInstance() method to find the specific instance.

    However, if you want to know about changes to the component then I'd recommend getting the component as in the first step and subscribing to it e.g.

    Code:
    comp:Subscribe(function(cmp, instance, event, ...)
        if event == ComponentManager.Component.Events.Update) then
           -- deal with the event here
        end
    end)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •