Developer Reference Notes About the Samples

Introduction

The ENCX evaluation download comes with built samples ready to use. Here are some notes about the samples. Source code for the samples (and .NET controls) is provided. Please read and adapt this code to help your projects.

After installing the evaluation the samples are available from the start menu. Start >> All Programs >> ENCX SDK >> Samples.

Chart Viewing Samples

DncView

This sample demonstrates the DNC functionality of ENCX. The ability to view DNC charts requires a special ENCX licence. Please contact us if this is of interest.

EncViewWithCSharp.exe

A very simple application to show installed ENC charts from C# code.

EncView1.exe

Views the sample ENC cells and sample Chersoft World Vector Shoreline information in the demonstration SENC. When the application starts the display will be centred on a zoomed out view of the sample area (the river Humber, UK). Use the mouse wheel to zoom in and out.

This application uses the ENCX .NET S-57/ENC control and is written in VB .NET.

RasView1.exe

Views the sample raster charts in the demonstration RENC. Enter a chart number (e.g. 107) into the 'choose chart' edit box and click on the 'go' button to view the chart. Charts in the demonstration RENC are 107, 109 and 3497.

This application uses the ENCX .NET raster control and is written in VB .NET.

EncView_MFC.exe

Another application which displays the demonstration ENC cells and world shoreline (similar to EncView1, see above). This application also crudely demonstrates overlaying information onto a chart by drawing a large white triangle on the display (see the source code for more information).

When the application starts up you will be prompted to enter a SENC path. The path to the demonstration SENC will be something like..

c:\program files\encx sdk\senc_demo

(dependant on where you installed the evaluation on your PC).

It is written in C++ and uses the MFC framework - it contains an MFC view derivative based on an ENCX S57Draw object.

RasView_MFC.exe

This program displays raster charts and like EncView_MFC you will be prompted for a path. Something like..

c:\program files\encx sdk\renc_demo

This sample demonstrates overlaying of information onto a chart by drawing a big red dot on the charts. This sample was written in C++ using MFC - it contains an MFC view derivative based on an ENC RasDraw object.

ViewCharts.exe

This is a VB 6 application that lists the ENC cells, lists the raster charts and displays both chart types.

If you click on a raster view it will bring up an ENC view centred around that point.

It demonstrates:

  • Enumerating raster charts (cf. RastList1)
  • Observing the raster catalogue (cf. RasList1)
  • Enumerating ENC (S-57) cells (cf. EncList1)
  • Observing the SENC (cf. EncList1)
  • Displaying raster charts
  • Display ENC information
  • Converting from a clicked point (pixel coordinate) to a geographic position (lat lon)

EncDisplaySettings.exe

This C# application shows how to change various display settings and even the colours used to draw features.

EncFeaturesAtPoint.exe

Shows how detailed information about the features at a particular point can be displayed in an HTML control.

WPF - RasExample.exe and S57Example.exe

Two simple applications that demonstrate how ENCX can be used in WPF applications. More details can be found here.

RasPanelOutlinesOnEnc.exe

This C# code shows how the polygon outlines of the panels that make up raster charts can be extracted and then drawn on a vector chart display.

WVSDemo.exe

A C# sample that draws the world vector shorelines and demonstrates how its display settings can be changed.

Note that ENCX only comes with a world vector shoreline covering the UK, Ireland and a bit of Europe but you can download full world coverage here.

Chart Querying Samples

EncList1.exe

This application demonstrates enumerating the chart cells in a SENC (a SENC is a special folder in which S-57/ENC cells are held) and observing any changes. It is important to observe the catalogue because the list may not be complete on application startup. Written in VB.NET.

RasList1.exe

This demo lists the charts in the RENC (a RENC is where raster charts are installed) and observes changes to that list. It is important to observe the catalogue because the list may not be complete on startup - this is to ensure the programs start quickly.Written in VB.NET.

EncFeatureProperties.exe

This C# sample shows how the installed cells can be queried to extract the features they contain and how the features can be queried to find their slaves and attributes.

RouteChecker.exe

This C# sample shows how ENCX can be used to provide ECDIS style route checking. See this article for more details.

Installing S-57 Charts

InstallCellsWithManageENC.exe and InstallCellsCPP.exe

These applications show how ManageENC can be driven so that you can implement your own user-interface for ENC and AML chart installations in C# and C++.

InstallLooseCells.exe

This C# code shows how "loose" cells (i.e. cells that are not part of an proper ENC or AML transmittal) can be installed.

Licensing Samples

ENCX is a licensed product as are many commercial charts (see Licensing and Security for more articles).

InstallationId.exe

See this article Getting the Installation ID

DotNetDongleMonitoring.exe

This sample monitors the status of the dongle (software or hardware). See Monitoring the Dongle.