Charmed Quark Systems
Google
WWW CharmedQuark.com

Go Back   Charmed Quark Systems > General Discussion > Beta Driver Development
Register FAQ Members List Calendar Mark Forums Read

Beta Driver Development Discussion of new drivers, finding someone to write a new driver, etc...

Reply
 
Thread Tools Display Modes
  #1  
Old 01-18-2010, 07:45 PM
beelzerob beelzerob is offline
 
Join Date: Mar 2006
Location: Central PA
Posts: 4,661
Default ADICON Ocelot/Secu/Relay Driver

This is a cut at a driver for the Ocelot, and attached Secu16, Secu16i, or the Relay8.

If you install this driver, it should be able to determine what devices you have and create fields for them automatically.

If you want to give names to the various inputs/relays, so something more meaningful than "Secu16I_0_Input5", then you can create a name file.

The name file must go in the MacroFileRoot\Drivers\Ocelot directory, and the name of the file must be <Moniker>_names.txt. So, if the moniker for the driver install was "Ocelot", then the file would be named Ocelot_names.txt

The format of the file is this:

<DeviceType_Address>,<Input/Relay Num><Name>
etc etc etc
END


So, here is an example file:
Secu16_2,Input6,2ndFloorSmBedroomSmoke_Alarmed
Secu16I_0,Input7,MasterBedroomSmoke_Alarmed
Secu16I_0,Input8,GarageWorkshopDoorClosed
END

There is an IP and a Serial driver. The driver file itself is the same, just the .manifest files are different. So you can download and install both if you want. When installing the driver, they are listed as "Ocelot (Dev)" and "Ocelot IP (dev)".
Attached Files
File Type: cqcdrvpack Ocelot_Dev_v0.1.CQCDrvPack (7.5 KB, 3 views)
File Type: cqcdrvpack Ocelot_IP_Dev_v0.1.CQCDrvPack (7.5 KB, 3 views)
Reply With Quote
  #2  
Old 01-19-2010, 12:00 PM
znelbok znelbok is offline
 
Join Date: May 2005
Location: Calderwood, Australia
Posts: 2,631
Default

Is it possible in a Manifest file to ask for which version is to be used, serial vs IP and go from there instead of having two separate manifests.

Well done though on this driver - the more the better

Mick
Reply With Quote
  #3  
Old 01-19-2010, 01:01 PM
beelzerob beelzerob is offline
 
Join Date: Mar 2006
Location: Central PA
Posts: 4,661
Default

That would be great, as I'm about to add the same IP/Serial option to the datanab, RCS, and other drivers. I agree, it is a pain having multiple manifest files. Thank goodness at least the CML itself is the same.

Dean...????????
Reply With Quote
  #4  
Old 01-19-2010, 01:03 PM
Dean Roddey's Avatar
Dean Roddey Dean Roddey is offline
Administrator
 
Join Date: Aug 2002
Location: Mountain View, CA
Posts: 26,186
Default

Right now, no, it requires separate manifests, so that the correct initialization method can be called.
__________________
Dean Roddey
Software Geek Extraordinaire
Reply With Quote
  #5  
Old 01-19-2010, 01:05 PM
beelzerob beelzerob is offline
 
Join Date: Mar 2006
Location: Central PA
Posts: 4,661
Default

well, I think we know the *right now* case , but I'm more interested in the *sometime soon* case. Is this likely to change at some point?
Reply With Quote
  #6  
Old 01-19-2010, 02:21 PM
jrlewis jrlewis is offline
 
Join Date: Jun 2007
Location: Renton WA
Posts: 1,671
Default

It looks like you are providing the ability to custom name fields. In general this is a poor idea for portability of interface templates. For a single integrator every installation requires mucking with fields in the interface. I have been looking at all the lighting drivers and I think all of them are offenders on this point and it makes it difficult at best to generalize/abstract the user interface from the underlying drivers. Unless the underlying hardware supports the same type of functionality of renaming i/o then I would shy away from it. You are better off just including an extra field for each i/o group that is the name that can be used as a human readable field in the interface. The new "uber driver" may mitigate some of this, but having a systematic naming of fields is a better way to go.
__________________
It's the early bird that catches the worm, but it's the second mouse that gets the cheese...
Reply With Quote
  #7  
Old 01-19-2010, 03:31 PM
beelzerob beelzerob is offline
 
Join Date: Mar 2006
Location: Central PA
Posts: 4,661
Default

I guess I fail to see the threat to uniformity, given that it is merely an option, and probably strictly of use for the DIY crowd. I've lobbied for some time for a better means of naming fields in a meaningful way, but nothing appears on the horizon.

You're encouraged during driver load to name your monikers in a meaningful way, and "easily recognizeable". While I know that Ocelot.Input3, Ocelot.Input4, Ocelot.Input5, etc might be very standardized, it is a burning poker in the eyeball when it comes to using them in interfaces, actions, events, etc as I'll have to constantly look them up to remember what they were. With 32 inputs from the datanab and 16 from the ocelot...I see no reason to put myself through ambiguous hell when I don't have to.

I dont put the option for custom-naming fields in all my drivers. Obviously in the audio receivers category, it'd be stupid to name "Volume" as something else. Those are all self-naming as to their purpose. But the I/O and lighting categories just present too much hassle to me when it can so easily be avoided...if I *choose* to. None of my drivers require a naming of fields (though the datanab requires a config file, or else it wouldn't know what types of sensors those are), and it'll provide generic names in the absense of such.

Perhaps I'm misreading what you mean....but if the issue is the portability of templates, then Im the one shooting myself in the foot, right? If I find that my custom naming of fields is making it impossible for me to make use of some REALLY snazzy templates....then I'm probably going to stop the behavior. But I'd still be glad to have the option.

And as always, a CQC-native solution would of course be better.

I had asked before how the integrators handle having, say, 10 Datanab32's at a project. How do you keep track of 320 generically named inputs? I never got an answer.... So I answered myself.
Reply With Quote
  #8  
Old 01-19-2010, 03:59 PM
jrlewis jrlewis is offline
 
Join Date: Jun 2007
Location: Renton WA
Posts: 1,671
Default

I have a driver that I have done for a bloke over in the UK I'm working on the html file for a very similar situation as this. The way you handle 10 ocelots is to make up a sheet that has all the mappings in it. Same goes for lighting. A lot of times i/o devices and lighting in particular are purposed for specific functionality. If the field naming is done in a systematic manner and you include the ability to do some custom mapping you can create a set of templates and that can be moved from installation to installation with only a need to change a few configuration files, but the templates remain the same. I have written custom drivers that handle the mapping and sorting out of names to provide a consistent field space for lighting in particular, but it is better if it can be handled in the driver itself.

For the DIY having custom named fields isn't an issue so you only have to worry about 1 system. For the CI's doing multiple installations it becomes more of an issue. There are a lot of new integration partners coming on board and they likely wouldn't be aware of the pitfalls of using custom named fields. Just so you know the way I tend to approach these types of things is how do make a core system that can be easily configured in 100 installations, 1000 installations, etc. even if I am just doing it for myself.
__________________
It's the early bird that catches the worm, but it's the second mouse that gets the cheese...
Reply With Quote
  #9  
Old 01-20-2010, 10:45 AM
beelzerob beelzerob is offline
 
Join Date: Mar 2006
Location: Central PA
Posts: 4,661
Default

Quote:
Originally Posted by jrlewis
The new "uber driver" may mitigate some of this, but having a systematic naming of fields is a better way to go.

I guess I'm still not seeing the gotcha here, since my drivers *do* have a systematic naming of fields. With no config file, they'll be named as generically and consistently as possible.

However, if you don't want to carry around a sheet of paper with your magic markings all over it, then I simply have the option of naming them something useful, which in my book makes any kind of interface or action logic immensely easier.

If you're an integrator, then you're probably not going to use the naming option.

In reality, i think my naming option in these drivers where field names are redundant and carry no useful info, is something that CQC should be doing, and hopefully in the future will. There should be a "real" field name and a "pseudo" field name, or at least someplace to put info on what the field is for. IMO.
Reply With Quote
  #10  
Old 01-20-2010, 10:57 AM
jrlewis jrlewis is offline
 
Join Date: Jun 2007
Location: Renton WA
Posts: 1,671
Default

For basic i/o devices you are going to have analog outputs/inputs and digital outputs/inputs. There may be some other special functionality, but that is the basics. If the driver only supports one device then no need for a device identifier. Analog outputs and inputs should be AOValue## or AO##Value and AIValue## or AI##Value. Digitals would be DIState## and DOState##. I prefer the numbering where the number follows the base name as it makes sorting in the field browser and other places better. The thing is for basic i/o analog and digital signals are basically the same whether its on an ocelot or an elk. Regardless of where it is they really should be named with a basic naming pattern I have shown or something someone else comes up with. If everyone followed that pattern and people called them on it when they were first publishing drivers it would make intermixing various i/o devices a non-issue as well as being able to transport templates from one system to the next. The uber driver may mitigate this, but if everyone followed a more uniform naming of fields for basic devices it would make things easier. Similar to the work that was done on the russound/nuvo (can't remember which) to bring the distributed audio more in line or at least have a common field space.
__________________
It's the early bird that catches the worm, but it's the second mouse that gets the cheese...
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 01:43 AM.


Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.