C_wiz: for total recall

Low cost, high performance vessel monitoring for Microsoft Windows


 Home

Other Services

Download

Upgrade

D3 Library and SDK

Dreaded Feature Summary

History

FAQ

Contact Us

C_wiz GE Interface

The following VB5 code snippets and procedures demonstrate how the GE COM API has been used to interface GE to C_wiz at build 2006112507.


NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE


The following material is being maintained for posterity.

The C_wiz GE interface has been massively enhanced at build 2007112515. Go here for a more detailed discussion of these enhancements and a 5 minute video.

Most of the gripes I had with the GE COM API (and verbalized below) I have been able to resolve (at considerable time and effort) by some pretty low level code.

I haven't updated this essay with the the latest stuff because it would take a large amount of time which is in short supply right now.

I have been thinking it would actually be easier to write an ActiveX control encompassing the functionality in build 2007112515 than it would be to explain how to do it - if anyone is interested in this possibility please contact me via Contact Us 


The code should be usable in VB6 and probably VBA also.

This is not the actual code used in C_wiz - it has been simplified basically by editing out material not essential to demonstrating what it does, amongst other things this includes some error handling and code associated with co-existing with C_wiz.

In some places, where it was considered desirable to smooth the flow, comments of the form "Some C_wiz co-existence code here,..." have been added in other places irrelevant code has just been removed.

The concepts embodied in the code are not necessarily original - ideas have come from all over the web.

Included are several suggestions and comments directed at any GE developer that may stray past.

Before proceeding it may make sense to see what the GE interface of C_wiz does, to do this:

o Install GE at version 4.0.2416 or later.

o Download then follow the instructions to install the evaluation version of C_wiz.

o Launch C_wiz then:

o Click [File] then click [Habitats] then click [Evaluation 2 - Anne Sargeant 2 + GE].

o Click [Play] then click [15 June 2004 - Sydney Harbour].

o Click [Track] - the Map subsystem will automatically launch GE.

o Play with the GE navigation controls in the top RH corner.

o Crank up the replay speed by clicking [Throttle] on the Map then adjusting the throttle setting with the slide control.


The code shows how to:

o Make appropriate declarations.

o Check if any version of GE is installed.

o Find the fully qualified name of the GE executable.

o Access the GE COM API properties and methods from VB5.

o Check the version of GE installed is 4.0.2416 or later.

o Launch GE and wait for it to initialize.

o Get the handle of the main GE window and position the GE window as per last use.

o Monitor any changes the user makes to the GE Navigator control.

o Overlay a chart on GE:

o Flush any current chart overlay.

o Build a kml file describing the chart overlay and send it to GE.

o Sympathetically move the GE view.

o Overlay vessel tracks on GE:

o Build a new vessel data kml file describing the vessel tracks.

o Replace any old vessel data kml file with the new vessel data kml file.

o Set up the vessel link kml file and send it to GE.

o Sympathetically move the GE view.

o Send a kml file to GE.

o Kill the GE fetch error window.

o Extract GE window settings for next use.

o Flush any current active kml files.

o Close GE.

o "Park" GE so that it can be quickly resurrected.

o Convert VB5 color long to GE <color> ... </color> hex string.

o Use GE features to inspect the GE Temporary Places folder.

(1) Declarations

These declarations need to be placed in a module:

(2) Check GE

This snippet:

o Checks if any version of GE is installed.

o Finds the fully qualified name of the GE executable.

(3) Load GE

This procedure:

o  Contains comments that explain how to access the GE COM API properties and methods from VB5.

o  Checks that the version of GE installed is 4.0.2416 or later - the first version that had the new COM API.

o  Launches GE and waits for it to initialize.

o  Gets the handle of the main GE window and positions the GE window as per last use.

o  Sets up any initial chart overlay and vessel tracks.

o  Starts the GE interrogator and GE fetch error window killer.

Note that GE at version 4.0.2416 has VersionMajor/Minor/Build properties but these are not much use if the GE version installed is prior to 4.0.2416.

(4) GE interrogator

This procedure:

o  Requires a VB5 timer control GE_interrogate (Enabled = False, Interval = 10).

o  Monitors any changes the user makes to the GE Navigator control and suspends updating of chart overlays and vessel tracks while changes are occurring.

o  Otherwise updates chart overlays and vessel tracks as required by procedures in greater C_wiz - at a pace that GE can handle.

In a better (GE) world this procedure wouldn't be necessary - if any GE developer reads this then it would be appreciated if they read the comments quite closely, particularly:

o  The suggestions about some form of event notification from GE when the user changes a navigation parameter and/or the ability to just update latitude and longitude in <LookAt> and SetCamera.

o  The bit about problems associated with Microsoft KB article KB176399.

(5) Overlay a chart on GE

In C_wiz a "chart" (*.img) is a bitmap, RLE bitmap, jpeg etc.

This procedure:

o  Flushes any current chart overlay.

o  Builds a kml file describing the chart overlay and sends it to GE.

o  Sympathetically moves the GE view.

If any GE developer reads this then it would be appreciated if they read the bit about the need for both <LookAt> and SetCamera.

(6) Overlay vessel tracks on GE

This procedure:

o  Builds a new vessel data kml file describing the vessel tracks.

o  Replaces any old vessel data kml file with the new vessel data kml file.

o  If it hasn't already, sets up the vessel link kml file and sends it to GE.

o  Sympathetically moves the GE view.

(7) Send a kml file to GE

This procedure is fairly self explanatory.

(8) Kill the GE fetch error window

This procedure is fairly self explanatory.

If any GE developer reads this then it would be appreciated if they read the bit about some simple refinements.

(9) Flush GE

This procedure:

o  Extracts GE window settings for use in any subsequent GE_Load.

o  Flushes any current active kml files.

o  If appropriate, closes GE.

o  If appropriate, minimizes GE, effectively "parking" it so that if it is subsequently required again it can be quickly resurrected without having to go through the time consuming logon/initialization process.

(10) Tidy up GE interface

This procedure is fairly self explanatory.

(11) Convert VB5 color long to GE <color> ... </color> hex string

I found this somewhere - handy little bit of code.

(11) Inspect the GE Temporary Places folder

The following code was written at one stage when trying to sort out the Automation Error -2147418107 (80010005) problem mentioned in [(4) GE interrogator].

It was subsequently found not to be necessary but shows how to access GE features, feature collections and their properties.

(12) Some final suggestions

If any GE developer reads this then there are a couple of final suggestions:

o  Some mechanism to easily ascertain if the user has changed an overlay's opacity.

o  Some mechanism to easily ascertain mouse activities on the GE window - e.g. movement and clicks - with this I suspect the functionality in the C_wiz Map window could effectively be transferred to GE - maybe this is why you won't do it?

© 2018 ForTotalRecall Pty Ltd. All rights reserved.