|
|

This page describes the anatomy and usage of the FPCDriver ActiveX
component and DLL. This component is a DLL which conforms
to Microsoft Corporation's ActiveX control specification. The
control provides a quick and easy way to add support for the Florida
Probe electronic periodontal probing system to any application
running in a Win32 environment. The control can be
embedded into any application which is an ActiveX control container,
including applications produced by Microsoft Visual Basic, Microsoft
Visual C/C++, Borland C/C++, Borland Delphi, and PowerBuilder.
The control can also be embedded into applications which allow
controls to be added at runtime, such as the Microsoft Internet
Explorer and Microsoft Office.
This versatility allows custom office solutions to take advantage
of the Florida Probe hardware. This document assumes that
the reader is already familiar with integrating DLL and ActiveX
components into applications using their development environment
of choice. This procedure varies from product to product,
so we are not able to provide assistance in most cases.
Consult the documentation for your development products.
Some older documentation may refer to ActiveX components at "OCX
modules", "OCX components", or "OCX controls". These
all mean the same thing for the purposes of this document.
Anatomy
The FPCDriver ActiveX component can be thought of as a
'little black box', which performs the routine tasks
required toopen a communications port to the Florida Probe
hardware and interact with it.
|
The FPCDriver as it appears when
it is visible in an application
|
This interaction requires spawning several separate threads
of execution using the apartment threading model, allocating memory
resources, communicating with the probe using a specified protocol,
and other tasks. The FPCDriver control encapsulates all of these
tasks and hides them from the application into which it is embedded.
The application needs to concentrate only on the methods, properties,
and events which the control provides. Through these
interface mechanisms the host application communicates with the
Florida Probe hardware, while all of the technical issues
are hidden by the FPCDriver control.
The methods exposed by the control are tasks which the host
application can instruct the control to perform. Methods
currently implemented in the FPCDriver control are:
-
Initialize( ) - Connect to the Florida Probe interface
module via a serial port and prepare to start using it.
-
Calibrate( ) - Prompt the user (via custom dialog boxes
which are produced by the control itself) to perform
the calibration procedure. The probe should be initialized
before using this method.
-
GetDepth( ) - Returns the current depth of the periodontal
probe as a double-precision floating point value, assuming
that the probe has been initialized and calibrated already.
-
Uninitialize( ) - For removing a connection to a Florida
Probe Interface, uninitializing the serial port, and
killing all threads
-
AboutBox( ) - Produces version information about the FPCDriver
control. Most host applications will have no use
for this method.
-
IdentifyProbe( ) - Changes the ProbeType property to the
type of the current probe connected to the serial port.
This function relies on the port being initialized and correctly
calibrated to determine the probe type. Also, calling
this after it is set from the default UnknownProbe will cause
the user to be prompted if the probe type should be changed
or stay the same.
The properties exposed by the control are attributes
which the host application can read to determine the current state
of the control, and to modify the behavior of the FPCDrv component.
Properties currently implemented in the FPCDrv control are:
-
LastDepth - A property that the FPCDriver control sets
on a regular basis whenever the depth read by the probe changes.
This is a double-precision floating point value, and is read-only.
This value will change more frequently if UpdateRate is changed
to a lower number
-
PortName - A string value which represents the name of
the serial port to use to interface with the probe.
This property allows a host application to remember what port
the probe is on and store it along with its own initialization
information. This value is the same value passed to
the Win32 API call OpenHandle( ). This value is used only
in the Initialize( ) method, and will be set to the port initialized
by autodetection if left blank.
|
|
|
|
The properties exposed by the control are attributes
which the host application can read to determine the current state
of the control, and to modify the behavior of the FPCDrv component.
Properties currently implemented in the FPCDrv control are:
-
LastDepth - A property that the FPCDriver control sets
on a regular basis whenever the depth read by the probe changes.
This is a double-precision floating point value, and is read-only.
This value will change more frequently if UpdateRate is changed
to a lower number
-
PortName - A string value which represents the name of
the serial port to use to interface with the probe.
This property allows a host application to remember what port
the probe is on and store it along with its own initialization
information. This value is the same value passed to
the Win32 API call OpenHandle( ). This value is used only
in the Initialize( ) method, and will be set to the port initialized
by autodetection if left blank.
-
UpdateRate - The rate at which the LastDepth property
is updated, in milliseconds. The default is 250.
-
Initialized - this read-only flag has a value of
zero when the hardware is not initialized, and a value
of True (-1) when it is
-
Calibrated - this read-only flag has a value of zero
if the hardware is not calibrated, and True (-1) if it has
been calibrated correctly
-
Disabled - this read-write flag 'pauses' the updating of
the threads, and disables all communication with the
probe temporarily. It does not free up the port for other
programs to use the Florida Probe hardware, use
-
Uninitialize( ) for this.
-
AutodetectPrompt - this read-write flag allows the programmer
to decide how they want the ActiveX control to respond if
the PortName field is empty. With this set to true, it will
prompt the user for a COM port or ask them to enter a name
for a custom port. With this flag at false, it will
silently fail initialization and come back with the Initialized
flag set to false.
-
Autocalibrate - this read-write flag allows the programmer
to decide how they want the ActiveX control to respond when
the hardware reads off an out-of-bounds value. True (the default
value) will cause the component to issue a Recalibrate message
internally, which pops up an application-modal dialog box.
Setting this to False will cause the dialog not to pop
up, and reading a ERROR_DEPTH from GetDepth( )
or checking the Calibrated property are the only ways to know
if the hardware needs recalibration.
-
ProbeType - this enumerated variable holds the current
probe type. The value of this only changes the
max value at which a recalibration is issued, and changes
the picture in a recalibration popup dialog. It is provided
as a convenience.
The events exposed by the control are notifications to
the host application that something important has happened.
Events currently exposed by the FPCDriver are:
-
Footswitch - Used to notify the host application that a
footswitch has been pressed. This event provides three
values which indicate which switch was pressed, the duration
the user has held the switch, and the depth at the time the
event was sent.
-
ChangedDepth - Used to notify the host application that
the probe reading has changed values. This event
is useful for providing dynamic visual feedback of the
probe status. It provides one double for the depth.
-
Sound - Used to notify the host application that a status
event has occured. The host application is responsible for
playing a sound on an event, the control does no sound output.
These status methods are for providing the user with
audio feedback of the hardware status, i.e. the probe is no
longer calibrated, the footswitch was released, the
probe type changed, etc.
Example
An example of the FPCDriver control embedded in a web page is
provided here for users
of the Microsoft Internet Explorer, version 3.0 or better.
This application is an ActiveX control container and will automatically
download and activate the FPCDriver control when the demonstration
page is loaded. This page has two buttons, one connected
to the Initialize( ) method, and one connected to the Calibrate(
) method. If you have a Florida Probe hardware interface
attached to your system and functioning (and you don't have another
program currently accessing it, like FP32) then the control will
enable the Microsoft Internet Explorer to access the probe hardware
and display the current depth reading.
For a more pertinent, although less interesting, demonstration
of the FPCDrv control, download
the new Florida Probe SDK. This self-extracting installation
file provides the complete source code to the current version
of the FPCDrv component, as well as two sample host applications.
The source code to the control and to the samples are provided
for investigation. For users of other development environments,
a pre-compiled FPCDrv component is provided, as well as a pre-compiled
executable version of the FPCPanel program.
Redistribution
This beta version of the FPCDrv component cannot be redistributed
to end users, as there may be quality issues with the implementation.
In creating a redistribution package however, the
file FPCDrv.ocx must be redistributed, as well as the Microsoft
Foundation Class runtime libraries from version 5.0.
The FPCDrv component must be registered on the end user's system
before it can be used. Most installation utilities, such
as InstallShield will automatically register FPCDrv when it is
copied onto the user's hard drive.
|
|
|