SansGUI Data Type Funneling


A SansGUI Data Object is an instance of the SG_OBJ Data Structure that holds the data of an object, a part, or a link to be sent to other program modules for processing. In order to ease data handling processes with SansGUI Data Objects, we implement a mechanism that funnels the GUI control types of data into a smaller set of object data types. Furthermore, SansGUI turns the object data types into six data types in the SansGUI value structure (SG_VALU Data Structure) to simplify programming in various languages.

Cell and Array Attributes

Before starting to examine the data type funneling mechanism, we need to refresh the definitions of cell and array attributes.

Data Type Funneling

The following table explains the data type funneling mechanism, from the GUI control types for data entry and display to the data types in the value structure for program access.

 

GUI Control Type

Object Data Type

Programming Data Type

Number - Integer

SG_TYPE_INT

int[] (C) or INTEGER*4 (*) (Fortran)

Number - Single Precision

SG_TYPE_FLT

float[] or REAL*4 (*)

Number - Double Precision

SG_TYPE_DBL

double[] or REAL*8 (*)

String - Regular (cell)

SG_TYPE_CHAR

char[] or CHARACTER (*)

String - Regular (array)

SG_TYPE_STR

char*[] with jagged char arrays

String - Masked

SG_TYPE_STR

char*[] with jagged char arrays

String - Encrypted

SG_TYPE_STR

char*[] with jagged char arrays

URL/File

SG_TYPE_URL

char*[] with jagged char arrays

Date

SG_TYPE_DATE

5 integers in each array element

Time

SG_TYPE_TIME

3 integers in each array element

On-Off Switch

SG_TYPE_INT

int[] or INTEGER*4 (*)

Tri-State Switch

SG_TYPE_INT

int[] or INTEGER*4 (*)

Enumerated Items

SG_TYPE_INT

int[] or INTEGER*4 (*)

Object Reference

SG_TYPE_REF

char*[] with jagged char arrays

Quality

SG_TYPE_QUAL

int[] or INTEGER*4 (*)

Symbolic Parameters

SG_TYPE_NULL

or resolved to a fixed type above

 

With this mechanism, all the GUI control types are converted into one of the int, float, double, or char types for C programming and INTEGER*4, REAL*4, REAL*8, and CHARACTER for Fortran programming. A few notes follow:

 



C:\FH_Suite\htmlgifs\home.gif Object Data Representation SansGUI Data Object Format

SansGUI Modeling and Simulation Environment Version 1.2

Copyright © 2000-2003 ProtoDesign, Inc. All rights reserved.

http://protodesign-inc.com