Home AMX User Forum Duet/Cafe Duet

process...Event implementation question

Hi everyone!

I wonder if anybody knows how to make methods like processInputSelectEvent, processInputCountEvent and other process..Event method to drive on?
I understand that methods, for example processInputSelectEvent, runs when I send command like 'INPUTSELECT-4' to Duet module. Am I right?
Also there is some kind of issue with addSourceSelectComponentListener method that i can't take in mind.

How one has to implement such events?

Any suggestions would be appreciated!

Comments

  • sonnysonny Posts: 208
    This may not be word-for-word accurate, but here goes...

    the component class implements the listener class...so your classes will implement the component. For example

    public class MyReceiver extends Receiver {

    ......

    }

    the 'process' events are taken care of internal to the listener class, so you implement actual device code in the get/set methods of the component classes. So whenever Netlinx sends over and INPUTSELECT command, the setInputSelect method gets called. Might look something like this...

    public void setInputSelect(int index) {
    // add device command to queue

    cmdQ.doEnq("INPUT=" + index);

    super.setInputSelect(index);

    }

    I use Queue objects to queue up all device commands and process them via a timer event.

    not sure the details of the question regarding the addSourceSelectComponentListener. I've never used this, but it appears to be used when you want to extend the component listener class, then instantiate multiple instances of it. You must then add a reference to each instance to the system via this method. Much like you add a reference to a data listener class that receives comm port data.

    Hope this helps...
Sign In or Register to comment.