IV. Example

The delivery includes three test clients with source code, written in Microsoft VC++, VB and Borland Delphi, to demonstrate the capabilities of the SDM server. Those built from VB and Borland Delphi, are a subset of the VC++ test client. The following discussion is based on the one built with MS VC++.

The user interface is simply a collection of buttons, which are divided into four groups:

  1. Feature selection – This group has an Obsolete subgroup with two buttons, Select Feature (2-way) and Select Feature (1-way). Below this sub-group, there is a group of five buttons: Select single feature (2-way), Select feature collection (2-way), Select single feature (1-way), Select feature collection (1-way) and Change selection color. When the selection is confirmed, some feature or features are selected, and a Query button appears under this sub-group. Finally there are two buttons at the bottom, Get List in Circle and Get List in Smoke Field.
  2. Add/Delete Features – There are 10 buttons: Get Point (two-way), Get Point (one-way), Add Point Feature, Add Label Point Feature, Add Line, Add Point to Line, Add Circle, Add Smoke Field, Delete Feature and Delete All.
  3. Feature appearance – There are four buttons that allow feature color control: Change Feature Color, Change Feature Code Color, Reset Feature Color and Reset Feature Code color. Feature or layer visibility can be manipulated with 4 buttons for features — Feature Visibility Off, Feature Visibility On, Feature Code Visibility Off, and Feature Code Visibility On — and 2 buttons for layer — Layer Visibility Off and Layer Visibility On. Finally, there is one button to set feature symbolization on/off (Symbolization), and a button to turn a tracking line to a collection of points (Line as points).
  4. Display Control – It consists of the following buttons: Overview, Center At Point, Center At Feature, Zoom In, Zoom Out, Zoom To Fit, Get Rect (2-way), Get Rect (1-way), Zoom to fit Points, Order Front, Get Display Extent, Set Display Extent, Get display scale, Print current display, Set zoom by rect, Maximize Main Wnd, Move/Resize Main Wnd, Minimize Main Wnd, Restore Main Wnd, Open New View, Minimize Overview Wnd, Restore Overview Wnd, set mouse neutral.

Five buttons appear  in the lower left corner:

  1. Do Composition brings up the Composition PlugIn
  2. Two buttons that start and kill SICOM Simulation Module
  3. Print current display prints the current display , and Copy to Clipboard copies the current display to the paste board

In the middle of the interface panel, there are three text entry fields for arguments required by some buttons. These buttons invoke client callback methods that call the services with the most important arguments obtained from the text entry fields or from information obtained via previous actions. Additional arguments are hard-wired. Table IV-1 serves as a combination client user’s guide and roadmap to the callback methods that contain the API examples.

When adding features, a CARIS key is required. The test client generates these keys automatically. For point, labeled point, and line features the key has the form: FCODEnnn, where FCODE is the feature code supplied by the user (via text field 1) and nnn is a number starting with zero. Point and Labeled Point features share the same counter, while Line Features have their own counter. Thus, if the first point feature added is given feature code MPAW, its key will be MPAW000. If a labeled point feature is then added with feature code DACA30, its key will be DACA30001. If a line feature is then added with feature code PADL, its key will be PADL000. Circle and smoke field features each have their own counters, and are given keys "circlennn" and "smkFldnnn", respectively.

When the test client adds a Line Feature, it is hard-wired to have the shape of a "W", with its top-left point at the currently stored point (obtained via the last getPoint). The lengths of the segments of the "W" are supplied by the user, via text field 2. Whether the end-points of the segments are 2D or 3D points is determined by the user via text field 3. If the points are 3D, the 3rd coordinate list is {0,3,6,9,12}.

When this testClient is executed, it brings up an SDM view that permits the user to load data from the client panel, or a File menu that allows the user to open a file. Note that the look and feel of the SDM is different from the standard SDM (Fig. IV-2), i.e the File and Readout on the menus becomes Chart and NAV, respectively, and a new menu item, MarineOps is added. This is done deliberately in order to show the new APIs from the SDM server, allowing the AP developer to modify menu names and to add one additional item to the menu.

 

 
Fig. IV-1 Test Client User Interface

 

Table IV-1 Test Client Button Summary

Button Title

Prerequisites

Text Entry Fields

Callback

API Method

1. Feature Selection

Select single feature (2-way)

None

1. a feature code
(wild card accepted)

OnButton45

setSelectSingleFeature
fcode = text1

Select feature collection (2-way)

None

1. a feature code
(wild card accepted)

OnButton46

setSelectFeatureCollection
fcode = text1

Select single feature (1-way)

None

1. a feature code
(wild card accepted)
 

selectSingleFeature
fcode = text1

Select feature collection (1-way)

None

1. a feature code (wild card accepted)

OnButton47

selectFeatureCollection
fcode = text1
isOpComplete,
getStatus,
getKeys

Change selection color

None

Not used

OnButton49

setSelectionColor
colorIndex = -1

Query

Valid selection, (via any of the above methods)

1. selection index or CARIS key
2. "C" or "S" (Client or Server displays query result
3. extra name/value pair (or blank)

OnQuery

GetKeys,
querySelectionByIndex
index = text1 (if index),
show = (T,F) – text2,
extra = text3

OR

querySelectionByKey
key = text1 (if key),
show = (T,F) – text2,
extra = text3

Get List in Circle

At least one circle added

1. CARIS key of a circle, i.e. "circle"nnn
2. feature code: of points or labeled points

OnButton37

getFeaturesInsideShape
ck = text1,
fc = text2

Get List in Smoke Field

At least one smoke field added

1. CARIS key of a smoke field, i.e. "smkFld"nnn
2. feature code: of points or labeled points

OnButton33

getFeaturesInsideShape
ck = text1,
fc = text2

Button Title

Prerequisites

Text Entry Fields

Callback

API Method

2. Add/Delete features

Get Point (2-way)

None

Not used

OnButton4

setSendPoint

Get Point (1-way)

None

Not used

OnButton5

getPoint,
isOpComplete,
getX,
getY

Add Point Feature

Get Point

1.feature code

OnButton1

createNewPointFeature
x,y – Get Point,
fcode = text1,
key = text1||count,
size = "10.0"

Add Labeled Point Feature

Get Point

1.feature code
2.label(s)

OnButton36

createNewLabeledPoint
Feature
x,y – Get Point,
fcode = text1,
key = text1||count,
size = "10.0",
label = text2

Add Line

Get Point

1.feature code
2.segment length "2D" or "3D"

OnButton52

createNewLineFeature
ck = text1||count,
fc = text1,
xArray, yArray, array3 –
(see discussion above)

Add Point to Line

Get Point

1. CARIS key of a line feature
2. 3rd Coordinate, if line has 3D points

OnAddtoline

appendPointToLineFeature
ck = text1,
xNew, yNew – getPoint,
c3New – text2

Add Circle

None

1. CARIS key of a point or labeled point feature
2. radius

OnButton15

addCircleToFeature
ck = text1,
radius = text2,
linecolor = 1,
fillstate = 3,
linewidth = "0.2",
key = "circle"||count

Add Smoke Field

Get Point

1. long radius
2. short radius
3. angle

OnButton21

addSmokeField
ck = "smkFld"||count,
x, y – Get Point,
long_radius = text1,
short_radius = text2,
angle = text3,
linecolor = 1,
lineweight = "0.2"

Delete feature

Transient fea-ture(s) added

1. CARIS key of a transient feature

OnButton12

deleteFeature
ck = text1

Delete All

Transient fea-ture(s) added

1. feature code

OnButton13

deleteFeatureAll
fc = text1

Button Title

Prerequisites

Text Entry Fields

Callback

API Method

3. Feature appearance

Change Feature Color

None

1. CARIS key
2. color index

OnButton17

setFeatureColor
ck = text1,
color = text2

Reset Feature Color

Change Feature Color

1. CARIS key with changed color

OnButton18

resetFeatureColor
ck = text1

Change Feature Code Color

None

1. feature code
2.color index

OnButton19

setFeatureColorAll
fcode = text1,
color = text2

Reset Feature Code Color

Change Feature Code Color

1. feature code

OnButton20

resetFeatureColorAll
fcode = text1

Move point feature

Get Point

1. CARIS key of a point or labeled point

OnMovePoint

movePointToNewPosition
ck = text1,
x, y – Get Point

Rotate point feature

None

1. CARIS key of a point or labeled point
2. angle

OnRotPoint

setSymbolOrientation
ck = text1,
angle = text2

Line as points

Add Line

1. CARIS key of a line
2. "0" – for normal
;"1" – for as points;"2" – for both
3. feature code of a point

OnLineAsPoints

showLineAsPoints
ck = text1,
state = text2,
symCode = text3

Feature Visibility Off

None

1. CARIS key

OnButton50

setFeatureVisibility
FALSE,
ck = text1

Feature Visibility On

Feature Visiblity Off

1.CARIS key

OnButton51

setFeatureVisibility
TRUE,
ck = text1

Feature Code Visibility Off

None

1.feature code

OnButton10

setFeatureVisibilityAll
FALSE,
fcode = text1

Feature Code Visibility On

Feature Visibility Off

1.feature code

OnButton11

setFeatureVisibilityAll
TRUE,
fcode = text1

Layer Visibility Off

None

1.layer name

OnButton39

setLayerVisibility
FALSE,
layerName = text1

Layer Visibility On

Layer Visibility Off

  1. layer name

OnButton40

setLayerVisibility
TRUE,
layerName = text1

Symbolization

None

1. T or F

OnButtonSymb

set SymbolizationOn
flag –text1

Button Title

Prerequisites

Text Entry Fields

Callback

API Method

4. Display Control

Overview

None

Not used

OnButton6

setOverview

Center at Point

Get Point

Not used

OnButton7

centerAtPoint
x , y - Get Point

Center at Feature

None

1. CARIS key of a point feature

OnButton16

centerAtFeature
ck = text1

Zoom In

None

Not used

OnButton8

zoomByPercent
percent = 50,
in = TRUE

Zoom Out

None

Not used

OnButton9

zoomByPercent
percent = 50,
in = FALSE

Zoom to Fit

None

1.CARIS key of extended feature

OnButton14

zoomToFitFeature
ck = text1

Zoom to fit Points

Add Point or
Add Labeled Point
(at least two)

1. feature code of a group of point or labeled point features
2. number of points

OnFitPoints

zoomToFitPoints
KeyList*

Order Front

None

Not used

OnButton34

orderFront

Get Display Extent

None

Not used

OnButton35

getDisplayedMapExtent

Set Display Extent

Get Display Extent

Not used

OnButton38

setDisplayedMapExtent

Get Display Scale

None

Not used

OnButton41

getDisplayScale

Set Geodetic
Set Zoom by rect

None

Not used

OnButton43

setZoomByRectMode

LoadFile
Maximize Main Wnd

None

Not used

OnButtMaxmain

maximizeMainWnd

Move/Resize Main Wnd

None

Not used

OnButtMovemain

MoveMainWnd
x=100
y=100
nwidth=500
nheight=300

Minimize Main Wnd

None

Not used

OnButtMinmain

minimizeMainWnd

Restore Main Wnd

maximizeMainWnd or minimizeMainWnd

Not used

OnButtRstrovrwnd

restoreMainWnd

Open New View

None

Not used

OnButtOpenview

openNewView

Minimize Overview Wnd

None

Not used

OnButtMinovrwnd

minimizeOverviewWnd

Restore Overview Wnd

None

Not used

OnButtRstrovrwnd

restoreOverviewWnd

Load File

None

1. Full Path

OnLoadFile

OpenNewForFile
Path = text1

Redraw Current

None

Not used

OnRedraw

RedrawCurrent

Button Title

Prerequisites

Text Entry Fields

Callback

API Method

5. Miscellaneous

Copy to Clipboard

openNewView or view opened by SDM

Not used

OnButtC2CLPBRD

copyToClipboard

Print Current Display

None

Not used

OnButton42

printCurrentDisplay

6. PlugIn

Do composition

None

Not Used

OnButton4

doComposition

Start SSM

Add tracks to SDM

Not Used

OnbuttonssmSt

None

Kill SSM

SSM running

 

Button Title

Prerequisites

Text Entry Fields

Callback

API Method

 

Appendix >>>>