• Keine Ergebnisse gefunden

GIN Windows and Areas

Im Dokument 4110 SERIES HOST PROGRAMMERS (Seite 100-103)

GIN Windows and Areas

You can control the mapping of GIN space into terminal space with the two commands SET-GIN-WINDOW and SET-GIN-AREA. The command SET-GIN-WINDOW estab-lishes a rectangular GIN window (similar to a window for a view) in terminal space. The command SET-GIN-AREA es-tablishes a rectangular area (similar to a viewport) in GIN space and links it to a GIN window. The terminal maps pOints from the GIN area into either the GIN window or the

window associated with the viewport specified in the SET-GIN-AREA command. The terminal sends GIN reports to the host in terms of terminal space.

You can define multiple GIN areas on tablets and plotters.

The terminal retains GIN areas until you completely cover them with a new GIN area. GIN that is not within a GIN area is mapped into the default 4095 x 4095 GIN window. Figure 9-2 shows how several GIN areas map into windows in ter-minal space.

Figure 9-2. GIN Areas Mapped on GIN Windows.

9-4 4110 SERIES HOST

(

(

When the operator causes a GIN event, the terminal com-pares the GIN device location with all active GIN areas for that device and function and translates it into terminal space accordingly. If GIN areas overlap, the terminal uses the most recently defined GIN area for the transformation into terminal space. The terminal then updates the GIN cursor, and sends a GIN function report.

GIN Function Reports

Each GIN event causes the terminal to send a GIN function report to the host. The format of all three GIN function re-ports is very similar. The GIN-Locate-report and GIN Stroke report have the same format, while the GIN-Pick-report also returns the segment number and Pick ID of the Picked seg-ment. GIN function reports include:

1. The Signature-character (if used) for that device and function

2. The key-character (the ASCII code for the key pressed or button pushed) reached, or the device~function is disabled with a DISABLE-GIN command, CANCEL command, or CANCEL keystroke.

The final GIN function report sends a normal GIN report and appends:

7. The terminal-signature-character (if used) 8. The EOM indicator

4110 SERIES HOST

GIN

Parsing GIN Function Reports

You can use the same algorithm for parsing all three GIN function reports. A general-purpose algorithm is:

Input-character: (key-char) Input-xy: (x),(y)

If (function) is (pick) Input-int: (segment) Input-int: (pickID)

(function) may be an input argument to this procedure or could be determined from the signature-character

GIN COMMANDS

The names of most GIN commands suggest their action.

The following list of GIN commands includes notes on when and how you might use these commands. See the 4100 Se-ries Command Reference Manual for the syntax and another discussion of these commands.

Enabling and Disabling GIN

ENABLE-GIN. This command turns on GIN. The parameters of this command (1) enable GIN for a number of GIN-Events and (2) enable a particular device for a single function. While you can enable each device for only one function at a time, you can enable more than one device at one time.

DISABLE-GIN. This command disables GIN. You can dis-able a specific device and function with a device-function code, or you can disable all GIN with a parameter of -1.

When you disable a GIN device, it always sends a terminat-ing-GIN report.

REPORT-GIN-POINT. This command forces the terminal to return a GIN report. If you want the current graphics beam position rather than the current GIN position, you can use a device-function-code of -2. If the device-function is not en-abled, the device will send a terminating-GIN report.

Emulating Earlier Terminals. The commands that allow you to emulate a 4010 Series terminal with a 4110 series

GIN

Setting GIN Parameters

SET -GIN-AREA. This command establishes a mapping from GIN space to terminal space for a device function.

Many such mappings for each device function can be de-fined at the same time. A mapping is deleted when its GIN area is totally covered by a new GIN area. All mappings are deleted when you set the GIN area to full GIN space.

A GIN area is associated with a GIN window (not associated with any viewport and set by the SET-GIN-WINDOW com-mand), or associated with a window that in turn is associ-ated with a viewport that you specify as a parameter to the SET-GIN-AREA command.

SET-GIN-WINDOW. This command establishes a rectangu-lar area in terminal space as the GIN window. You can use this window with the SET-GIN-AREA command.

SET -GIN-CURSOR. This command selects a segment for use as the graphics cursor for a particular device-function-code. You may want to choose different shaped segments for each device and function you use to help the operator differentiate between the device functions.

SET -GIN-GRIDDING. When you want to restrict the set of possible GIN positions for Locate or Pick functions, you can use GIN-gridding. You specify the spacing of an invisible grid in terminal space. The GIN device location is always translated to the next smaller intersection of the permissible GIN grid positions.

SET -GIN-INKING. You can use inking in Locate or Stroke functions so the operator can see where the GIN device has moved. When the operator causes a GIN event, the terminal draws a line from the location of the last GIN event to the current GIN location. You can start inking after the first point is entered if you enable inking with a parameter of 1 , or start inking immediately from the GIN-Display-Start-Point if you enable inking with a parameter of 2.

SET -GIN-RUBBERBANDING. You can use rubberbanding with the Locate function to draw an elastic line between the current cursor position and the location of the GIN-Display-Start-Point or last GIN event. As with inking, you can control rubberbanding with parameters to the command. The termi-nal draws the elastic line in the current line index and style.

Raster display terminals draw the elastic line in XOR mode while DVST terminals draw it in refresh mode.

SET-GIN-DISPLAY-START-POINT. Use this command to set an initial pOint for GIN inking or GIN rubberbanding.

9·6

SET-GIN-STROKE~FILTERING. When you are using Stroke function with a graphics tablet, you might want to restrict the volume of GIN Stroke reports that the terminal gener-ates. You can specify (1) the minimum distance the tablet device moves before sending a report with a distance filter and (2) the minimum time between reports with a time filter.

The two filters act as thresholds and must both be ex-ceeded before the terminal will send a GIN Stroke report.

SET ·PICK-APERTURE. This command sets the size of the aperture, or acceptance area around the graphics cursor.

The pick aperture is a square in normalized screen space centered on the GIN location. To pick a segment, the pick aperture (nust cover at least a portion of the segment you want to pick.

Hint. You can make the pick aperture visible to the operator by defining a GIN cursor segment as a box the same size as the pick aperture, although the segment image can change size if the terminal zooms. If a pick aperture of approxi-mately 40 units on a side is usable, you can use a marker (box shape), as the graphics cursor. Markers do not change size when zoomed.

HINTS AND EXAMPLES Picking and Dragging

You can let an operator choose a shape from a menu and move it to a desired location by following this sequence:

1. Prepare a menu of segment shapes for the operator to select. Be sure that the segments are detectable when you define them.

2. Give the command ENABLE-GIN for one pick function from the thumbwheels. Instruct the operator to move the graphics cursor to point to the selection and press a key.

4. When the operator causes the GIN event, make the se-lected segment the graphics cursor. Instruct the operator to move the shape to the desired location.

5. The operator can now move the shape with the thumbwheels. When the shape is in position and the op-erator causes a GIN event, leave the segment there.

Your program then could copy the segment and return the shape to its position in the menu.

Hint. Don't set the pick aperture too small. If the aperture is too small, the operator will find it almost impossible to put the aperture on a a segment.

Hint. Keep segments fairly simple if you plan to pick and drag them. If they get too complex, segments take too long to redraw.

4110 SERIES HOST

(

(

(~

Section 10

Im Dokument 4110 SERIES HOST PROGRAMMERS (Seite 100-103)