[simpits-tech] a tale of Phidget Mania...

Gene Buckle simpits-tech@simpits.org
Fri, 7 Jun 2002 13:04:48 -0700 (PDT)


As most of you know, I've been working on writing some software that will
allow you to use various Phidgets (http://www.phidget.com) with your
cockpit.  I've been working on this for quite a while, mostly not getting
a whole lot done. :)

The whole idea was to write an easily configured application in Delphi
that people could use to interface MSFS via FSUIPC.  Well I worked on it
for a while and it dawned on me that not only had I completely over-done
the software feature set, I had yet to do more than move a servo.  I was
so wrapped up in "I can add this, which makes this work like...", that the
end goal became this fog enshrouded thing that really couldn't be named.

This of course is commonly known as Creeping Featurism (it had actually
become Feeping Creaturism by this point, but I digress).

I completely pitched out what I was working on.  It was too complex and
tried to do too many things.  "Rewrite!  Refactor!  Recode!", I yelled.

This of course was stupid.  In a period of about two days, I ended up with
an application that was even _more_ complex and feature over-loaded than
the first version.  And it _still_ only moved a servo and merely
initialzed the FSUIPC system.  I mean, this sucker was impressive as hell,
but it didn't do a damn thing that was really _useful_.

I threw all THAT code away and started again with 4 goals:

1.  Read Switch state changes from the PhidgetInterfaceKit.
2.  Set output states in the PhidgetInterfaceKit.
3.  Read analog state changes from the PhidgetInterfaceKit.
4.  Send data to the PhigetServo
5.  Interface 1..4 to FSUIPC.

Nice list, right?  Short and to the point.

Well, I get hung up in #1.  I mean _REALLY_ hung up.  Because the Phidget
library is an ActiveX control, it requires a fancy import unit to use in
Delphi.  This is not really that bad since Delphi can generate the code
for this unit automagically.  Well to make a long, agonizingly boring
story a bit less agonizingly boring, Delphi choked when I tried to
implment the code to handle the input events.  It _hated_ it.  It bitched,
moaned, complained and I'm positive that had it been capable of wearing
clothing, it would've begun tearing at it.  Seriously.  Delphi *hates*
this poor little DLL.  Calls it all sorts of names and spits repeatedly on
it.

In a fit of pure desperation, I re-started this whole nightmare using
Visual Basic.  Well to my _utter_ disgust, VB merrily got along with that
pitiful little DLL.  <yoda>Fast friends became, they did!</yoda>

My wonderful Object Oriented Uber Genius just got tromped by the Village
Idiot.  How humiliating is _THAT_?

Anyway, I have my little example program chatting quite happily with the
Phidgets and the flight simulator software.  In the coming week, I'll get
it finished off (still need to do the analog and the servo) and make it
available to download.  It's not fancy by any means, but it will show you
how easy it is to interface Phidgets with FSUIPC.  I'm sure that Rob Favre
would be interested in doing something similar for Falcon 4.

For those of you that don't know already, the Phidget line of devices will
give you the same functionality as an EPIC setup, but you won't have to go
dipping into the kids' college fund to pay for it.

(Please note, that I have _no_ pecuniary interest at all with Phidgets,
I'm just an evangelizer of a good product line)

g.