In the Niagara AX framework driver control points reside under a special component that called a point device extension. The developer driver framework takes care of most of the details for you. All you need to do is define a class for your driver's point device extension, add one of your driver's point device extension components as a property to BYourDriverDevice, and override a method on BYourDriverProxyExt. From that method you will need to simply return the TYPE constant that belongs to your driver's point device extension.
This might sound complicated but it is very simple to do and will only take a matter of minutes. In fact, we believe this will be the simplest chapter in today's lesson!
While following the examples in this chapter, please replace the text jarFileName, yourDriver and yourCompany as previously described in the Preparation section):
To do this, create a text file named BYourDriverPointDeviceExt.java in the jarFileName/src/com/yourCompany/yourDriver folder. Inside the text file, start with the following text:
package com.yourCompany.yourDriver; import javax.baja.sys.*; import javax.baja.util.*; import com.tridium.ddf.*; import com.yourCompany.yourDriver.point.*; public class BYourDriverPointDeviceExt extends BDdfPointDeviceExt { /*- class BYourDriverPointDeviceExt { properties { } } -*/ }
/** * Associates BYourDriverPointDeviceExt to BYourDriverDevice. */ public Type getDeviceType() { return BYourDriverDevice.TYPE; } /** * Associates BYourDriverPointDeviceExt to BYourDriverPointFolder. */ public Type getPointFolderType() { return BYourDriverPointFolder.TYPE; } /** * Associates BYourDriverPointDeviceExt to BYourDriverProxyExt */ public Type getProxyExtType() { return BYourDriverProxyExt.TYPE; } /** * This can be left null, depending on how you decide to define * the discovery behavior in your driver. We will visit the * discovery process in further detail during another day's * lesson. */ public BFolder getDiscoveryFolder() { return null; }
/** * This associates BYourDriverDeviceExt with * BYourDriverProxyExt within the Niagara AX * framework. */ public Type getDeviceExtType() { return BYourDriverPointDeviceExt.TYPE; }
import com.yourCompany.yourDriver.*;
/*- class BYourDriverDevice { properties { deviceId : BDdfIdParams -- This plugs in an instance of yourDriver's -- device id as this device's deviceId default {[new BYourDriverDeviceId()]} points : BYourDriverPointDeviceExt -- Adds the special point device extension -- component to the property sheet and the -- Niagara AX navigation tree. This special -- component will contain and process all -- control points for YourDriver default{[new BYourDriverPointDeviceExt()]} } } -*/
Copyright © 2000-2016 Tridium Inc. All rights reserved.