From: Bruce W. <br...@mi...> - 2004-02-01 01:14:14
|
> What is the correct strategy for processing a queue of group member > changes? (I assume only one changed item is served up from the serial > input queue for each pass of my user code.) The documentation for the > Group object says state_now returns the last state that the group was set > to and member_changed returns a member name whenever one changes. But I > really want the name and state of the next group member in the queue, not > necessarily the one most recently changed. I can't use *_log arrays since > I don't know how far back to look. > > I haven't found the correct combination, but neither it seems, has the > lower TK debug window. With ~20 state changes queued up, that > window seems > to get the times and state changes correct, but repeats one of the group > member's name for each item processed. I'm not sure I follow the question. If you set a group to a state, all members of that group are set to that in the same pass. If the members of that group are tied to the same serial port (e.g. X10 items), then mh will likely pause while it shoves the data out that port for that pass (unless you have a proxy set up for that port). Since it is all done in one pass, member_changed will return the last member of the group (not sure how it would be sorted). Maybe I could follow the question a little better if you had example code, or more specifics on what you were trying to do. Bruce |