Search:

Type: Posts; User: Ron; Keyword(s):

Search: Search took 0.35 seconds.

  1. Thread: plugin question

    by Ron
    Replies
    36
    Views
    4,204

    You are missing the io include at the top: ...

    You are missing the io include at the top:



    local io = require('io')
  2. Thread: plugin question

    by Ron
    Replies
    36
    Views
    4,204

    You placed the timer outside of a function that...

    You placed the timer outside of a function that gets 'self'.



    local base = require("plugin.component")
    local print = print
    local Promixis = Promixis
    local bit = require('bit')
    local json =...
  3. Thread: plugin question

    by Ron
    Replies
    36
    Views
    4,204

    No problem! Have fun.

    No problem! Have fun.
  4. Thread: plugin question

    by Ron
    Replies
    36
    Views
    4,204

    lua is case sensitive you typed "internalid" it...

    lua is case sensitive you typed "internalid" it should be "internalId" ... picky computers.
  5. Thread: plugin question

    by Ron
    Replies
    36
    Views
    4,204

    you are calling update without self parameter,...

    you are calling update without self parameter, won't work. You need to call it with a valid component.

    Place this code in the init part of your component:



    self.timer = timer.new(...
  6. Thread: plugin question

    by Ron
    Replies
    36
    Views
    4,204

    inside component.lua you reference it as "self" ...

    inside component.lua you reference it as "self"



    self:forEachDevice( function ( internalId, device )
    print(internalId)
    end)


    Make sure that...
  7. Thread: plugin question

    by Ron
    Replies
    36
    Views
    4,204

    at the top file plugin.lua: local...

    at the top file plugin.lua:



    local MyComponent = require('mycomponent.component') -- your own descendant of component. Change mycomponent to match your actual path
    local Device =...
  8. Thread: plugin question

    by Ron
    Replies
    36
    Views
    4,204

    You can copy it but you'd have to change the...

    You can copy it but you'd have to change the stuff specific to the irtrans of course. Also to make Girder actually load it you must adapt the createComponentManager function in plugin.lua. Again look...
  9. Thread: plugin question

    by Ron
    Replies
    36
    Views
    4,204

    understood. Once you have the component manager...

    understood. Once you have the component manager part in place, you can access the component. The component will have that function attached. I believe the irtrans plugins uses this.
  10. Thread: plugin question

    by Ron
    Replies
    36
    Views
    4,204

    I might have misled you with the self part :D ...

    I might have misled you with the self part :D



    self:forEachDevice( function ( internalId, device )
    print(internalId)
    end)

    self in your code above...
  11. Thread: plugin question

    by Ron
    Replies
    36
    Views
    4,204

    forEachDevice will do a callback on each device...

    forEachDevice will do a callback on each device to the function you pass it.



    self:forEachDevice( function ( internalId, device )
    print(internalId)
    ...
  12. Thread: plugin question

    by Ron
    Replies
    36
    Views
    4,204

    both irtrans and simpleTransport use...

    both irtrans and simpleTransport use forEachDevice, with the irtrans plugin doing this inside the component.

    lua\irtrans\component.lua
  13. Thread: plugin question

    by Ron
    Replies
    36
    Views
    4,204

    Hmm, I'm having a hard time understanding what...

    Hmm, I'm having a hard time understanding what you want to do? On what level does the timer run? (Plugin / Component / Device / Control ). From any of those levels you can use the...
  14. Thread: plugin question

    by Ron
    Replies
    36
    Views
    4,204

    If you look at plugin\device.lua you'll see there...

    If you look at plugin\device.lua you'll see there is a function called "findControl(self, internalId) this returns the first child control with that internalId. Is that something you could use? If...
Results 1 to 14 of 14