Contents 1 AVS/Express overview 1.1 Overview 1-2 1.1.1 Working with AVS/Express 1-3 1.1.1.1 The Network Editor 1-3 1.1.1.2 V language 1-4 1.1.1.3 The NE versus V 1-5 1.1.1.4 Application Programming Interfaces 1-5 1.1.2 AVS/Express kits 1-6 1.1.3 Object-oriented techniques in AVS/Express 1-7 1.1.4 Connections and object execution 1-9 1.1.5 Object Manager 1-11 1.2 Project mechanism 1-13 1.3 Application components 1-15 1.4 Building applications and application components 1-18 1.4.1 Building an application using AVS/Express 1-18 1.4.2 Building application components with AVS/Express 1-18 1.4.3 Adding modules to AVS/Express 1-19 1.5 AVS/Express object hierarchy 1-20 2 Defining and manipulating objects in AVS/Express 2.1 Terms and concepts 2-2 2.1.1 Objects 2-2 2.1.2 Base types 2-2 2.1.3 Templates 2-3 2.1.4 Instances 2-3 2.1.5 Object-oriented paradigm 2-3 2.2 Object hierarchy 2-4 2.3 Object characteristics 2-7 2.3.1 Name 2-7 2.3.2 Derivation hierarchy 2-7 2.3.3 Declaring the dimensions of an array 2-7 2.3.4 Properties and attributes 2-12 2.3.5 Subobjects 2-12 2.3.6 Values and connections 2-13 2.4 Defining primitive data objects 2-14 2.4.1 Using ptr objects 2-14 2.4.2 Constraining primitive data objects 2-15 2.4.2.1 boolean base type 2-16 2.4.2.2 enum base type 2-16 2.4.3 Connection rules for primitive data objects 2-17 2.5 Defining groups, modules, and macros 2-19 2.6 Inheritance and the derivation hierarchy 2-21 2.6.1 Single and multiple inheritance 2-21 2.6.2 Derivation hierarchy 2-24 2.6.3 Modifications to templates, derived templates, and instances 2-25 2.7 Setting the reference mode of a group, module, or macro 2-27 2.8 Value expressions 2-31 2.8.1 Scalar expressions 2-33 2.8.1.1 Examples of scalar expressions 2-35 2.8.2 Array value expression 2-36 2.8.3 Dimension conversion in an array expression 2-39 2.8.4 Uninitialized objects have a null value 2-40 2.8.5 Data-type conversion 2-40 2.8.6 Concatenating strings 2-41 2.8.7 Read-only connections 2-41 2.9 Connecting objects by name 2-43 2.9.1 Connecting to a peer by name 2-44 2.9.2 Connecting to a peer of an ancestor 2-44 2.9.3 Connecting to a subobject of a peer 2-45 2.9.4 Resolving an ambiguous reference 2-45 2.9.5 Limiting connections to one-level 2-46 2.9.6 Connections to and from arrays 2-46 2.9.7 Forward references 2-49 2.9.8 Recursive references 2-49 2.10 Defining combinations of properties and attributes 2-50 2.10.1 The merge operation 2-50 2.10.2 Maintaining properties and attributes 2-50 2.11 Defining link objects 2-52 2.12 Defining arrays of groups, modules, and macros 2-55 2.12.1 Arrays of group references 2-55 2.12.2 Array of group pointers 2-56 2.12.3 Array of group values 2-56 2.12.3.1 Subobjects in the array connect to a common subobject 2-58 2.12.3.2 Subobjects in the array connect to a parallel array 2-58 2.12.3.3 An object outside of the array connects to a single element in the array 2-59 2.12.3.4 Treat the subobjects of the group array as an array itself 2-59 2.13 Instancing and de-instancing objects 2-60 2.13.1 Setting the instanced property 2-60 2.13.2 Using ScratchPad 2-60 2.14 Built-in functions 2-61 2.14.1 Mathematical functions 2-61 2.14.2 Logical functions 2-62 2.14.3 Array functions 2-63 2.14.4 cache function 2-66 2.14.5 index_of function 2-66 2.14.6 merge function 2-67 2.14.7 name_of function 2-68 2.14.8 str_array function 2-68 2.14.9 str_format function 2-68 2.14.10 switch function 2-69 3 V and the V Command Processor 3.1 Introduction 3-2 3.2 V Command Processor 3-3 3.2.1 Examples 3-3 3.2.2 VCP's appearance 3-4 3.2.3 Entering statements and commands 3-4 3.2.4 Navigating the object hierarchy 3-5 3.2.4.1 Current object 3-5 3.2.4.2 Navigating 3-5 3.2.4.3 Navigating through Applications and libraries 3-6 3.2.4.4 Navigation commands are really V modify statements 3-8 3.2.4.5 V statement rules apply 3-8 3.3 V comments 3-10 3.3.1 C-style comments 3-10 3.3.2 C++-style comments 3-10 3.3.3 Special comments 3-11 3.4 V statements 3-12 3.4.1 General coding rules 3-12 3.4.1.1 Clauses 3-12 3.4.1.2 Order of clauses 3-13 3.4.1.3 Operators 3-13 3.4.1.4 Where a statement can start 3-13 3.4.1.5 Separators 3-13 3.4.1.6 Continuation lines 3-14 3.4.1.7 Continuing character strings 3-14 3.4.1.8 Case sensitivity 3-14 3.4.2 Create statement 3-15 3.4.3 Modify statement 3-20 3.4.4 Delete statement 3-23 4 Projects, libraries, and processes 4.1 Introduction 4-2 4.2 Install area project 4-4 4.3 Creating and using your own projects 4-6 4.3.1 Derived projects and project chaining 4-6 4.3.2 Creating a project 4-7 4.3.3 Starting AVS/Express with a specified project 4-8 4.3.4 Saving a project 4-8 4.4 Understanding libraries 4-10 4.4.1 Templates and Libraries objects 4-10 4.4.1.1 Changing the Libraries hierarchy 4-11 4.4.2 Global libraries 4-13 4.4.3 Derived copies of objects 4-13 4.4.4 Defining a library that does not make derived copies 4-14 4.4.5 Creating a new library 4-15 4.4.5.1 Creating a Network Editor library 4-15 4.4.5.2 Creating a V language library 4-16 4.4.5.3 Defining libraries in the VCP 4-18 4.5 Understanding processes 4-19 4.5.1 Defining the modules in a process 4-20 4.5.2 Setting the process name 4-21 4.5.3 Defining the main process 4-21 4.5.4 Initializing AVS/Express 4-23 4.5.5 Processing Events 4-23 4.5.6 Defining a main for your process 4-24 4.5.6.1 C or C++? 4-24 4.5.6.2 Integrating AVS/Express objects into Motif/Xt-based applications 4-24 4.5.7 Adding your own event handlers 4-27 4.5.8 Exiting a process 4-28 4.6 Defining an object's process 4-29 4.7 Compiling a process 4-31 4.7.1 Shared libraries in AVS/Express 4-31 4.7.2 Compiling a single process 4-32 4.7.3 Compiling the express process 4-33 4.7.4 Compiling all processes 4-34 4.7.5 Creating a new process 4-34 4.7.6 Common error messages 4-35 4.7.7 Editing source code 4-36 4.8 Understanding the compile process 4-37 4.8.1 Marking all needed objects 4-37 4.8.1.1 Handling library dependencies 4-38 4.8.1.2 Handling dynamic object dependencies 4-38 4.8.2 Generating code for objects 4-38 4.8.2.1 Code generated for each method 4-39 4.8.2.2 Current build directory 4-39 4.8.2.3 Code generated for cxx_hdr_files and c_hdr_files 4-40 4.8.2.4 Code generated for cxx_src_files and c_src_files 4-40 4.8.2.5 Handling the src_file property 4-40 4.9 Project architecture 4-41 4.9.1 Project directory 4-41 4.9.2 XP_PATH and avsenv 4-41 4.9.2.1 XP_PATH 4-41 4.9.2.2 $XP_PATH<0> 4-42 4.9.2.3 avsenv 4-42 4.9.3 templ.v 4-43 4.9.4 proc.v 4-44 4.9.5 libs.v 4-44 4.10 Save Compiled Project 4-46 4.10.1 Save Compiled Project Dialog 4-46 4.10.1.1 Project directory name 4-47 4.10.1.2 Object selection mode 4-48 4.10.1.3 Instance objects automatically on restore 4-48 4.10.1.4 Include Network Editor in project 4-48 4.10.1.5 Build V into executable 4-49 4.10.1.6 Compile/Generate project modes 4-49 4.10.2 Dependences on the original project 4-50 4.10.3 Files in a compiled project 4-50 4.10.4 Save Compiled Project examples 4-51 5 Integrating user code 5.1 Introduction 5-2 5.1.1 Adding new modules 5-2 5.1.2 Manipulating instances of objects 5-2 5.2 Adding new AVS/Express modules 5-4 5.3 Module creation overview 5-5 5.3.1 Methods 5-5 5.3.2 Method naming restrictions 5-6 5.3.3 Calling methods for instance/de-instance 5-6 5.3.4 Defining parameter attributes for methods 5-7 5.3.4.1 Defining parameter attributes on a per-method basis 5-9 5.3.4.2 Setting parameter attributes on hierarchical parameters 5-9 5.3.4.3 Specifying the req attribute for a method 5-10 5.3.5 Defining the scope of an update method 5-11 5.3.6 Controlling method execution 5-12 5.3.7 Controlling method execution order 5-14 5.4 Code management properties for modules 5-16 5.5 Adding modules using the C API 5-17 5.6 Adding modules using the C++ API 5-20 5.6.1 Adding C++ methods 5-20 5.6.2 Specifying the location of cxxmethod source code 5-21 5.6.2.1 Using the src_file property 5-22 5.6.2.2 Using the string value to specify method source 5-23 5.6.2.3 Detaching cxxmethod from source generation 5-24 5.6.3 Example C++ module 5-25 5.7 Adding modules using the FORTRAN API 5-27 5.8 Manipulating AVS/Express objects using the C API 5-30 5.8.1 Understanding OM data structures 5-30 5.8.1.1 Object ids 5-30 5.8.1.2 Object name 5-31 5.8.2 Understanding return values 5-31 5.8.3 Using mode arguments 5-32 5.8.4 Accessing the object hierarchy 5-32 5.8.4.1 Accessing the root objects 5-32 5.8.4.2 Moving up the object hierarchy 5-33 5.8.4.3 Finding subobjects by name 5-33 5.8.4.4 Traversing subobjects as a list 5-35 5.8.5 Determining when a parameter has changed 5-36 5.8.6 Setting and getting data values 5-36 5.8.6.1 Scalar primitive values 5-38 5.8.6.2 array primitive values 5-40 5.8.6.3 Setting values to the "unset" state 5-44 5.8.7 Creating and destroying objects 5-44 5.8.7.1 Creating objects 5-44 5.8.7.2 Creating objects through V 5-46 5.8.7.3 Destroying objects 5-46 5.8.8 Manipulating connections 5-47 5.8.8.1 Following connections, pointers, and references 5-48 5.8.9 Managing arrays of groups, modules, macros 5-51 5.8.9.1 Accessing arrays of groups 5-51 5.8.9.2 Creating arrays of groups 5-52 5.8.9.3 Creating new array elements 5-54 5.8.10 Manipulating properties and attributes 5-55 5.8.11 Saving and restoring object descriptions 5-56 5.8.11.1 Save using V language 5-57 5.8.11.2 Reading V files 5-58 5.8.11.3 Save using a binary file 5-59 5.8.11.4 Reading binary V files 5-60 5.9 Manipulating AVS/Express objects using the C++ API 5-61 5.9.1 Getting a pointer to the C++ object 5-62 5.9.2 Accessing values for AVS/Express subobjects 5-63 5.9.3 C++ interface to scalar data 5-65 5.9.4 C++ interface to array data 5-66 5.9.5 C++ interface to group arrays 5-69 5.9.6 Additional C++ methods 5-70 5.9.7 Using OM routines 5-71 5.9.8 Determining when a parameter has changed 5-71 5.9.9 Manipulating connections 5-72 5.9.10 Mapping AVS/Express object names to C++ class names 5-73 5.9.11 Managing C++ generated files 5-74 5.9.12 Managing dependencies on other code 5-74 5.9.13 Importing existing C++ classes 5-76 5.9.14 Constructing user classes 5-78 5.9.15 Defining abstract user classes 5-79 5.9.16 Adding your own member variables 5-79 5.9.17 Exporting C++ classes 5-80 5.9.18 Example of generated C++ classes 5-83 5.10 Manipulating AVS/Express objects using the FORTRAN API 5-88 5.10.1 Understanding OM data structures 5-88 5.10.1.1 Object ids 5-88 5.10.1.2 Object name 5-88 5.10.2 Understanding return values 5-89 5.10.3 Using mode arguments 5-89 5.10.4 Accessing the object hierarchy 5-89 5.10.4.1 Finding subobjects by name 5-90 5.10.5 Determining when a parameter has changed 5-91 5.10.6 Setting and getting data values 5-91 5.10.6.1 Scalar primitive values 5-94 5.10.6.2 array primitive values 5-94 5.10.6.3 Setting values to the "unset" state 5-100 6 Adding status and interrupt controls 6.1 Introduction 6-2 6.1.1 Status information 6-2 6.1.2 Interrupt capabilities 6-2 6.2 Scheduler object 6-4 6.3 Connecting a user interface to Scheduler 6-6 6.3.1 To use the standard interface 6-6 6.3.2 To build your own interface 6-6 6.3.3 UIdynamic_toggle 6-7 6.4 Declaring a module's behavior 6-8 6.4.1 To enable or disable status information 6-8 6.4.2 To enable or disable interruptability 6-8 6.5 Setting and querying information from a function 6-9 6.5.1 To access Scheduler information 6-9 6.5.2 To set a range for percent done 6-9 6.5.3 Example module code 6-10 7 Importing data from simple files using File Access objects 7.1 Overview 8-2 7.2 file 8-4 7.3 file_obj(file, offset, type, columns, ascii_binary [,stride]) 8-5 7.4 file_obj_bin (file, offset, type [,stride]) 8-7 7.5 file_scalar_ascii (file, offset, type) 8-9 7.6 file_array_ascii(file, offset, type, columns) 8-10 7.7 file_find_expr(file, offset, regular_expression) 8-11 7.8 file_skip_lines (file, offset, nlines) 8-12 7.9 file_skip_words (file, offset, nwords) 8-12 7.10 Example of importing a file with a uniform field 8-13 7.11 Example of importing a simple UCD ASCII File 8-15 8 Debugging objects 8.1 Debugging networks 9-2 8.1.1 Accessing object information 9-2 8.1.2 Tracing method execution 9-3 8.1.2.1 Message for invalid methods 9-4 8.1.2.2 Message for methods that return 0 status 9-5 8.1.3 Tracing operations on specific objects 9-5 8.2 Debugging modules 9-7 8.2.1 Using a source debugger on the main process 9-7 8.2.2 Using a source debugger on an external process 9-7 8.2.3 Getting object information while debugging your module 9-8 8.2.3.1 Invoking the VCP from the debugger 9-8 8.2.3.2 Printing an object's path from the debugger 9-8 8.2.3.3 Problems passing OMobj_ids as arguments 9-9 8.2.4 Determining why a method will not execute 9-9 8.2.5 Finding problems with execution order 9-10 1 Properties, attributes, primitives, and functions 1.1 Properties and attributes A-2 1.1.1 General properties and attributes A-2 1.1.2 Network Editor properties and attributes A-5 1.1.3 Module control properties A-9 1.1.4 Code management properties A-12 1.1.5 C++ interface properties A-18 1.2 Base types A-22 1.3 Built-in functions A-24 2 Worldwide language and font support 2.1 Introduction B-2 2.2 Language support B-3 2.2.1 Text representations B-3 2.2.2 Local character sets B-4 2.3 Locales B-7 2.3.1 Locale model B-7 2.3.2 Levels of support B-8 2.3.3 Initialization B-8 2.3.4 Keyboard input B-10 2.3.5 Input encoding B-10 2.3.6 Output encoding B-11 2.3.7 Errors B-11 2.3.8 Environment information B-12 2.3.9 Supported locales B-13 2.3.9.1 Default locale B-13 2.3.9.2 Western European languages B-14 2.3.9.3 Eastern European languages B-15 2.3.9.4 Cyrillic, Greek and Turkish B-15 2.3.9.5 Japanese locale B-16 2.3.9.6 Korean locale B-17 2.3.9.7 Simplified Chinese locale B-18 2.4 Text processing B-20 2.4.1 Pathways B-20 2.4.2 Strings in V B-22 2.4.3 Hexadecimal format B-24 2.4.4 V output B-25 2.5 Localization B-27 2.5.1 Username property B-27 2.5.1.1 Object Manager interface B-28 2.5.1.2 Network Editor interface B-28 2.5.2 Localized projects B-28 2.5.3 Examples B-29 2.5.3.1 Local object name B-29 2.5.3.2 Local string object value B-30 2.6 Internationalization B-32 2.6.1 Dictionary property B-32 2.6.2 Dictionary files B-33 2.6.2.1 Object Manager interface B-34 2.6.2.2 Network Editor interface B-34 2.6.3 Internationalized projects B-35 2.6.3.1 Original text entries B-37 2.6.3.2 Keyword entries B-37 2.6.4 Internationalizing a localized project B-38 2.6.5 Examples B-39 2.6.5.1 Translation of object basename B-39 2.6.5.2 Translation of string object value B-40 2.7 Adding fonts to AVS/Express B-43 2.7.1 fonts.v B-43 A User Code Interface (UCI) reference A.1 Encapsulating a C or C++ structure with the UCI E-2 A.1.1 Encapsulating a structure without an update method E-2 A.1.2 Referencing structures within a structure E-4 A.1.3 Encapsulating a structure with an update method E-5 A.1.4 Resolving structure pointers E-8 A.1.5 Setting an object's data E-9 A.2 Encapsulating an existing C or C++ function with the UCI E-11 A.2.1 Calling a C function directly from the UCI E-11 A.2.2 What actually happens E-12 A.2.3 Data mappings and pointers E-12 A.2.4 Image example E-14 A.3 UCI reference E-16 A.3.1 UCI properties E-16 A.3.2 Table of data-type mappings E-18
Copyright © 2001 Advanced Visual Systems Inc. All rights reserved.