Plugin design question

HouseBot Plugin Development Discussions.
Post Reply
yaccri
HouseBot Special Member
Posts: 304
Joined: Wed May 07, 2003 2:19 pm
Location: Tel-Aviv, Israel
Contact:

Plugin design question

Post by yaccri »

I would like to develop a plugin for cards that are connected to the serial port. The cards are concatenated to each other (up to 32 cards), and of three different types (dimmers, on/off lights and shutters). Each card can control 4 or 8 devices.



I thought of creating a hardware interface to manage the serial line, and three different types of device plugins, one for each type of card. Does the plan sound OK?



Thanks,

Yoram.
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Re: Plugin design question

Post by ScottBot »

You should design the Devices from the users perspective and not from the hardware architecture. So having Dimmer, On/Off, and shutter Devices makes sense. The Devices would have the obvious Properties that relate to their type (like Dim Level for the Dimmer), and probably also an 'Address' Property that selects the actual physical device somehow.
Scott
yaccri
HouseBot Special Member
Posts: 304
Joined: Wed May 07, 2003 2:19 pm
Location: Tel-Aviv, Israel
Contact:

Post by yaccri »

Thank's Scott,



I am concerned about response times. I want it for an application that would control *many* lights (256, or maybe even more). The cards will be queried all the time about the lights' status. Most of the time there will be no change, but when a change occurs, it needs to show up immediately.



With performance issues in mind, would it make any difference which method of device plugin will be used? Does having less devices also mean less database IO access?



Yoram.
ScottBot
Site Admin
Posts: 2787
Joined: Thu Feb 13, 2003 6:46 pm
Location: Georgia (USA)
Contact:

Post by ScottBot »

Your Hardware Interface will be doing the polling. The Devices will just be waiting for a notification from the interface. So having more Devices really won't effect the DB or system CPU in any way. When the polling Interface determines that one or more device states have changed, it will send out notifications to the devices using a filter that specifies the device addresses and new states. Then the Device(s) will update their Properties and save to the DB.
Scott
yaccri
HouseBot Special Member
Posts: 304
Joined: Wed May 07, 2003 2:19 pm
Location: Tel-Aviv, Israel
Contact:

Post by yaccri »

That's great!

Thanks a lot,



Yoram.
Post Reply