Home

SilTools Developer`s Guide

image

Contents

1. Figure 1 4 The SIL runtime model Compilation is also possible see Loading SIL Code on page 11 5 1 8 SilTools The SIL Runtime Model Environments o D d 42 Environments are either permanent or temporary The permanent environment is called the global environment The global environment contains bindings for 9 lt o c 2 3 le d E All type names E Function procedure names Global variables Local environments contain bindings for E The parameters of a function procedure E The local variables of a function procedure Local environments may be considered temporary extensions of the global environment which are created when a function procedure is called and destroyed when the function procedure terminates Some expressions modify an environment when they are evaluated by the interpreter For example definitions create new bindings in the global environment while assignment statements change the value associated with a symbol in an existing binding Developer s Guide 1 9 7 96 Introduction to the SIL Language Values Values or data objects are the scalars and data structures such as numbers strings records and arrays that inhabit the computer s memory and represent abstract entities in the problem domain The generic term used in SIL to describe all of these objects is lispob which was derived fr
2. REMINDER All icons should be placed under the cim gui icons directory Customizing the Layout A product may save the location and size of certain panels to be restored each time the product is started To create a new layout arrange the panels inside the product then call save_r_current_layout So O Do ELS EL cpe S Do a Developer s Guide 6 31 7 96 Programming the User Interface This must be done for every screen geometry on which this product will be run To add more information to the settings i e save the position of new panels a new layout constructor must be written The layout constructor must be of the type function setting Taking no arguments this function must return a setting object The function to create a new setting is std_mk_layout_settings nm id Is list of setting The functions to create a specific setting include the following mk_panel_geom_setting nm id panel id pos id xt id where nm is the name of the setting panel is the name of the panel pos and xt are the names of the global variables which optionally may be set when the layout is restored If no such global variables exist nil may be substituted mk_panel_pos_setting nm id panel id pos id Similar to mk_panel_geom_setting except only the pos and not the extent of the panel is saved mk_global_var_setting nm id where nm is the name of a glo
3. Chapter 5 Classes provides detailed information about rE the above concepts Concurrency SIL supports concurrent execution of multiple tasks within one state or data space The SIL implementation provides its own scheduler Procedures intended for concurrent execution are indicated by using the keyword task rather than the keywords function or procedure Tasks may include any code which would be legal in procedure or function and may include primitives for synchronization SilTools The SIL Runtime Model To introduce new threads of computation use the start operator If f is a task then 3 oe e o d Dc oO 8 5 On 2D start f lt arg1 gt lt argn gt is an expression which will cause the execution of f on the given arguments to start as a separate concurrent thread The start expression evaluates to an object of type activation corresponding to for example the process class in SmallTalk or the thread type in the BSD UNIX lightweight process facility The activation is a handle to the ongoing computation of f SIL provides various synchronization primitives all of which rest on two basic primitives the semaphore and the delay A delay is a suspension for a given amount of time In this case time is measured by the real world clock or by an internal simulated clock depending on the application Chapter 10 Concurrency provides detailed information
4. Methods can be declared to be tasks rather than procedures by using the keyword tmethod rather than method Developer s Guide 5 25 7 96 Classes 5 26 Example 5 25 shows how abstract classes can be added onto existing objects This means that old SIL classes can be given new and cleaner abstract interfaces without rewriting the old code This is one of the many differences to C In C an abstract class must be designed before its implementation which must be a derived class This prevents the kind of retrofitting shown above Here is another simple working example SilTools Abstract Classes Developer s Guide 5 27 7 96 Chapter 6 Programming the User Interface The mnode Class The user interface consists of background panel Graphics Window top bar menu bar tool bar Quick Access and Quick Pick Window In addition to this many panels provide custom functionality to a product The mnode Class This section describes the mnode class The word mnode comes from node in the menu tree mnode is an abstract class and is the class of all screen items widgets Actual widgets are built by subclassing and or splicing an mnode To use the information in this chapter effectively you should be familiar with widgets Refer toChapter 7 Customizing the Menu Interface in the Si Tools User s Manual available from SILMA Division of Adept Technology Inc Widgets There are two aspe
5. Applications Applications are entities that remember a function and a list of arguments They are similar to closures with the added feature of an argument list that can be stored and passed to the function when the application is executed N Q gt m ao Q 65 gt 5 lt Developer s Guide 9 11 7 96 Advanced Data Types This function constructs an application function mk_application fn id args list of universal application An application contains the identification id of a function and the arguments to be passed to it when executed This function executes an application function execute app application universal The application function is called with the included arguments Casting In SIL an expression s type can be modified by the as_type operator The effect of this operator is analogous to that of the C cast primitive it asserts that the value of the expression should be treated as belonging to a specified type whatever the type originally assigned to the expression may have been The syntax is lt expression gt as_type lt type gt This has a similar meaning to the C syntax lt type gt expression Not all as_types are legal The rule which has a few exceptions given later is that the data format of the value to be cast must agree with the data format of the type to which it is being cast Another restriction is that
6. This is almost exactly as fast as ordinary function applications it is equivalent to the application of an indirect function in C The only overhead is chasing a pointer to a function 3 Application of an sconst as in apply vp list 2 as_type ob 3 as_type ob The application itself is just as fast as a closure application However in this example there is some overhead for the casting to lispob 4 Application of an id to a list of universals as in apply plus 3 as_type universal 4 This could be considerably more expensive than the other kinds of apply because it involves searching at runtime through the variants of plus for one that works Developer s Guide 9 13 7 96 Advanced Data Types SIL Constants 9 14 All SIL definitions have internal representations called sconsts SIL constants An sconst is like a descriptor which contains type name and value fields for the defined object Because SIL is a polymorphic language a single id x can be the name of several sconsts However only one of these sconsts can represent a non function type This sconst is the data variant of x the other sconsts are the function variants of x The following operators help locate an sconst using an id function data_variant x id sconst function has_data_variant x id boolean function function_variants x id list of sconst function has_function_variant x id boolean Because two function variants with the
7. Additional SIL functionality is provided for auto level This function automatically keeps the camera horizontal views never become upside down or sideways the camera will always have a horizontal horizon This procedure installs a new camera into the workcell procedure install_cam The camera is installed automatically named and painted Cameras are painted a lt color gt and automatically named cam_ lt color gt This procedure sets the target for a specified camera procedure target c targ string where is the camera and targ is the target This function returns the target for a specified camera function target c string string where C is the camera This procedure sets the tracking status of a specified camera procedure tracking c string op boole where c is the camera op true switches tracking on and op false switches tracking off This function returns the tracking status of a specified camera function tracking c string boole where c is the camera Developer s Guide 7 1 7 96 Vision This function sets the focal length for a camera This function returns the focal length of a camera This procedure sets the auto level status of a specified camera procedure focal c string fl real where c is the camera fl is the focal length function focal c string real where C is the camera procedure a
8. SilTools Orientation Figure 3 12 illustrates that this is not the case for orientations involving more than one principle axis rotation Yaw pitc h roll 90 90 90 Z REF Y z X REF Voce X 2 3 X Y Z Euler 90 90 90 X Z REF 6 a fo y Z Ns X REF Y REF Equivalent angle axis 90 90 90 Z REF Y X REF Z Y REF Figure 3 12 Orientations with multiple axis rotations Developer s Guide 3 15 7 96 SiTools Geometry Poses Every shape including World has an associated local reference frame which is called its pose The pose of the World is the master reference system and every other shape in the World tree has a pose which is specified relative to the World pose When you select a reference frame using the menus the pose of some shape is always selected The default reference frame is the pose of the World and may sometimes be called the Universe coordinate system In SilTools a pose is described using six values that combine its position and orientation x y Z yaw pitch roll A Z E a Pose x Eor Figure 3 13 Pose Describing position and orientation is simply a matter of combining a position and orientation using the geometric type pose The general form of the command is mk_pose lt position gt lt orientation gt where lt position gt and lt orientation gt may be any of the types described above Either or both position and orientation may be spe
9. This is a list of ntypes The class of an object is given by the function my_class Developer s Guide 5 11 7 96 Classes Changing Views Object Oriented Terminology on page 5 1 showed how methods and attributes of an object A can be used by specializations of A without specifically coercing to the class of A Because referentially equivalent objects represent the same entity we would like all views of A i e not just the specializations of A to be able to use the methods and attributes of A Doing this requires changing views using the as_view or to_view infix operator lt object gt as_view lt class gt lt object gt to_view lt class gt 5 12 SilTools Views The as view Operator vs the to_view Operator When lt object gt has no view in lt class gt lt object gt as_view lt class gt generates an error message while lt object gt to_view lt class gt returns a null object which can be tested for using the nul predicate illustrated in Example 5 13 Developer s Guide 5 13 7 96 Classes Multiple Inheritance Example 5 1 on page 5 2 shows a class having several superclasses student_programmer which had programmer and employee as superclasses In this situation however it was possible to identify one of these superclasses programmer as the immediate superclass of student_programmer This means that all other superclasses of student_programmer were also superclas
10. cim gui panels lt module gt top_bar The top bar panel may then be customized using the Visual SIL Window for the new product Add the top bar to the new build area by editing the file cim builds lt first version gt panels and adding the line top_bar When the product is built the new top bar will be included Edit the product s top_init sil replacing the line top_bar ibaseStop with top_bar lt module gt S top_bar When the product is built the new top bar will replace the default SilTools Compiling SIL Code 7 Copy the file cim gui help mgui help sil into the new help directory by entering cp cim gui help mgui help sil cim gui help lt product gt 8 Edit the file cim gui help lt product gt help silto add online help for panels new to the product Online help is optional The help files should be placed in the cim gui help lt product gt directory 9 Edit the top_init sil file and add the line 1ld cim gui help lt product gt help 10 Once all code has been written and the SIL code has been compiled enter scope_out lt product gt 11 For each module which contains new code use remake lt module gt lt product gt to execute the second stage of compilation from C to binary To build the product which will create the new executable and heap_ file call rbuild lt product gt base Do not use sspa to build products with SilTools as it was not designed to work in a devel
11. if arc mybuild mybuild12 appsup fi In this example robot version 13 is specified the current version of paint is specified and spot version 14 is specified Then the if block indicates that if any version of arc is included in the build then mybuild version 12 and the current version of appsup should also be included Support Only Builds Areas A builds area which is used only as a supporting module for some other builds area s can be marked so that it is not offered to the user as an option when using the Product Administration panel sspa script to create a product To mark a builds area as support only create an empty directory in the supporting module build area with the name support_only SilTools Patching in Interpreted Code Application Solutions Header Module If your project involves a number of builds areas you can create an application solutions header module To do this make an entry in the cim options versions file and create a directory in the cim builds directory such as MYPROJECT1 0 Within that directory create an empty file called appsol and a comodules and or supmodules file When you use the Product Administration panel to create a product and you select your application solution MYPROJECT1 0 all of the comodules and supmodules files from the builds areas which comprise the application solution will be read Based on the information that is read the Product Administration
12. lt local variable declarations gt lt task body gt where lt private pipe gt lt pipe name gt lt pipe name gt lt pipe name gt lt type gt and lt private pipes gt lt private pipe gt lt private pipe gt The key word process alerts the task defining machine that the parameters are to be interpreted as private pipes rather than parameters SIL provides a variant of signal for sending a message lt msg gt to a private pipe lt ppipe gt owned by process lt proc gt signal lt proc gt lt ppipe gt lt msg gt SIL also provides a variant of wait for removing messages from a private pipe The command wait x 10 12 SilTools Processes and tclosures causes the current process i e the one calling wait to suspend itself if the pipe x is empty When a message arrives in x the process will resume If x is not empty then the first value in x is assigned to the parameter x and can be referenced that way until the next time wait x is executed Just as with public pipes wait will return the first value stored in a pipe or suspend itself if the pipe is empty gt o a gt 5 lt e Oo Developer s Guide 10 13 7 96 Concurnency tclosures A tclosure is to a task what a closure is to a function a passable data item whose value is a task rather than a function Notice that the type of a task with no return value is task lispob integer
13. on page 4 12 describes strings The complete NOTE SIL data type structure is shown in Figure 1 5 Data type classifications on page 1 11 Developer s Guide 9 1 7 96 Advanced Data Types ntype The type ntype the type of all types can be defined grammatically by lt ntype gt lt dtype gt lt polymorphic type gt lt dtype gt lt primitive type gt lt constructed type gt lt primitive type gt lt user defined type gt lt atomic type gt lt atomic type gt lt scalar type gt lt metatype gt lt supertype gt lt scalar type gt integer boolean char string real lt metatype gt id sconst ntype tform iform net event lt supertype gt universal lispob lt constructed type gt array_of lt dtype gt list_of lt dtype gt sarray_of lt dtype gt closure lt return type gt lt input type gt lt input type gt tclosure lt return type gt lt input type gt lt input type gt lt polymorphic type gt function lt return type gt lt input type gt lt input type gt procedure lt input type gt lt input type gt task lt return type gt lt input type gt lt input type gt lt input type gt lt dtype gt lt return type gt lt dtype gt Notice that ntype appears to be a member of itself However it is really the syntactic expression ntype that is a member of the data type ntype
14. s new orientation after each successive rotation called Euler angles E A single rotation of the frame about a generalized axis pointing out from the origin of the reference frame copy called equivalent angle axis Within the Euler and fixed representations there are 24 combinations gt for specifying orientations Use the input representation from the following list which matches your situation and the SIL function 8 to_frame to convert general orientations to SilTools frames o xyz_fixed yzx_fixed xyx_fixed yzy_fixed 3 xyz_euler yzx_euler xyx_euler yzy_euler D xzy_ fixed zxy_fixed XzZX_fixed zxz_fixed xzy_euler zxy_euler Xzx_euler zxz_euler yxz_fixed zyx_fixed yxy_fixed zyz_fixed yxz_euler zyx_euler yxy_euler zyz_euler Developer s Guide 3 9 7 96 SiTools Geometry 3 10 Yaw Pitc h Roll In SilTools terminology yaw pitch and roll refer to rotation about the X Y Z axes in that order about a fixed reference frame In the case of robot end effectors the Z axis points outward along the centerline of the flange Therefore the roll of the wrist always occurs about the Z axis of the tool or mounting flange see Figure 3 9 Pes Mounting Flange Pe ii Z Roll Figure 3 9 Yaw Pitch Roll Yaw pitch roll is convenient for describing the orientation of any object s frame The rotations are performed sequentially about the axes of the initial orientation of the frame and always performed in this order 1 Ya
15. where app is an application to run and intv is the time interval at which to run NOTE Applications are described in Applications on page 9 11 These procedures start and stop a ticker procedure activate tck ticker procedure deactivate tck ticker Semaphores The basic synchronization mechanism in SIL is the semaphore Other methods of synchronization such as pipes and process lines are available but they all depend on semaphores semaphore is a SIL type with the following operations wait lt semaphore gt signal lt semaphore gt value lt semaphore gt integer new_semaphore semaphore 10 6 SilTools Semaphores A semaphore s with value n may be thought of as representing n units of some resource The wait s operation when executed by a task is a request for one unit of the resource If the value of the semaphore is greater than 0 then the value is simply reduced by 1 and the wait returns If however the value is 0 when wait s is executed the task which executes the wait is suspended until some other task makes a unit of the resource available If other tasks are already waiting for the resource that is have executed wait s then our task is added to the end of a queue associated with the semaphore The command signal s adds a unit of resource to the semaphore If there is a queue of tasks waiting for the resource the first element of the queue is resumed If
16. a G faa o c ae When ged 15 12 is called this local environment is created symbol value xX 15 y 12 But before the interpreter finishes evaluating the body of this call and before the local environment is discarded the call ged 12 3 is made This call sets up the following local environment symbol value xX 12 y 3 Before this environment is discarded the call ged 3 0 is made and this local environment is created symbol value x 3 y 0 At this point we have three distinct local environments created by three distinct calls to the same function Developer s Guide 2 9 7 96 The Basics 2 10 Closures Closures are entities in SIL which allow functions to be manipulated as data to be passed to functions inserted in data structures etc function shorter x y string boolean begin shorter length x lt length y end shorterc mk_closure shorter function boolean string string The shortere variable s value is the function shorter Its type is closure boolean string string The least function is used as follows function least x list of string y closure boolean string string string var rs string begin if null x then error attempt to apply least to an empty list of strings r car x for i in cdr x do if y i rs then rs i least rs end least finds the least member of x according to the ordering given by y Example 2 8 SIL
17. end This is identical in effect to the C declaration struct erb int xc double yc then new erb returns a value of type erb i e pointer to erb which is equivalent to the C type erb Developer s Guide 9 15 7 96 Advanced Data Types 9 16 The usual SIL syntax can be used to select and set the fields of an erb ee new erb ee xc 56 ee yc 5 4 ee XC Similarly a carray is an array without tag or length fields A carray can be created with cc Carray_create integer 10 The A syntax can be used to make a pointer as in aa ee xc or aa Acc 4 The type of aa is integer The only legal arguments to are fields of crecords and entries in carrays Pointers are de referenced as follows aa then aa aa aa will double the integer value pointed to by a crecords and carrays can be built from the primitive types cchar cshort integer real sreal or from other crecords or carrays but not from other SIL types For example type oo crecord my_ob lispob my_point point end is illegal twice over SIL Type Identical to C Type cchar char cshort short sreal float single precision real integer int real double SilTools C Data Types The types cchar cshort and sreal should appear only as the subtypes of carrays pointers or crecords as in type noo crecord my_char cchar my_sreal srea
18. ntype function subtypes x ntype list_of_ntype function mk_list_type x ntype ntype function mk_array_type x ntype ntype function is_function n ntype boolean Assume X result type y input types function mk_function_type x ntype y list_of_ntype ntype assumes a real function type is the input function is_task x sconst boolean function is_closure x sconst boolean function is_tclosure x sconst boolean function input_types x ntype list_of_ntype function result_type x ntype ntype Developer s Guide 9 3 7 96 Advanced Data Types lispobs 9 4 The type lispob is the SIL type whose values include all SIL values lispob was derived from LISP OBject Any expression can be as_typed to lispob and a lispob can be as_typed to any type So lispobs offer a kind of escape from the usually strong typing of the SIL type system into a domain of untyped data similar to that of Lisp The type char plays a similar role in C to that of lispob in SIL in that it is conventionally used to designate a raw pointer to data of unspecified type So 3 as_type lispob as_type integer is a legal SIL expression with value 3 An as_type from lispob although always legal as a SIL expression may generate problems at runtime if the format of the lispob datum does not agree with that required by the type to which it is being cast For example aa a as_type lispob as_type rri_lrec will r
19. pcurve adding 8 3 pcurvelist adding 8 3 pick_extended_info lrecord 6 19 pipe operator 8 13 pipes 10 10 adding 8 13 creating 10 10 messages queue 10 10 10 11 private 10 12 SilTools waiters queue 10 10 10 11 pitch see geometry plane surface adding 8 5 plus function 2 12 9 6 9 8 9 13 point adding 8 2 point type 11 27 pointer 9 16 pointer management 1 2 polygon circular 8 4 convex planar 8 4 polymorphism 1 2 2 2 2 12 5 3 pop up boxes 6 23 6 26 pose see geometry position see geometry ppause command 11 20 predicates 9 5 printer 2 12 procedure applications 1 14 call 1 14 definition 1 21 recursive 2 8 syntax for 2 3 procedure constructor 4 1 process 10 12 syntax for 10 12 product building 11 7 creating 11 5 11 7 11 10 11 11 help file adding 11 7 rebuilding 11 10 11 11 support only 11 14 umodules file including 11 13 Product Administration panel 11 11 11 12 11 15 programming methods 1 1 protection 11 1 pseudo code 1 2 pspline adding 8 10 psurf_to_gsurf operator 8 5 pulldown menu 6 5 Developer s Guide 7 96 Index put_up command 6 10 Quick Access 6 29 6 33 Quick Pick Window selecting objects from 6 23 R rational B spline surface 8 7 rbspline adding 8 3 rbuild command 11 7 11 10 rctcurve adding 8 2 read_char function 2 14 read_line function 2 14 read_token function 2 14 readin read commands 2 13 2 14 2 17 real time 10 1 real type 4 2 9 1 reals is_real opera
20. see SIL code compiling compound statements 1 14 1 15 concatenation 2 21 concurrency 1 1 1 6 10 1 10 14 conditional statement 1 15 cone operator 8 13 cone adding 8 9 8 13 confirmation requestor 6 27 cons operator 4 4 const declaration 3 3 constants 1 12 9 14 variants 9 14 constructed types 1 10 4 1 contents 9 17 Coons surface 8 8 coordinate system CS 3 1 copyto procedure 9 18 Create Edit Group panel 6 24 create_rolodex_mnode_nm command 6 29 create_toolbar_mnode command 6 29 crecord 9 15 crt type 3 5 current_authorization global 11 1 curve adding 8 11 cyl type 3 6 cylinder operator 8 13 cylinder adding 8 13 8 23 cylinder tabulated 8 7 D data fields 1 23 tag 1 23 data types annotated 6 27 boolean type 9 1 C data types see C cchar type 9 16 closure type 2 10 SilTools constructed types 1 10 4 1 cshort type 9 16 defining new 1 20 integer predicate 9 3 integer type 9 1 9 16 lispob see lispob lists 4 4 Ipoint type 11 27 metatypes 9 1 mismatch error 4 8 model data type 8 1 new 9 6 ntype see ntype pipe 10 10 point type 11 27 pose 3 16 real type 9 1 9 16 represented types 9 6 is_reptyp function 9 3 scalar 4 2 9 1 semaphore type 10 6 shape 3 2 sreal type 9 16 string type 9 1 11 27 symbols 2 20 system defined 1 10 4 2 9 1 tclosure type 10 14 type expressions 9 2 lt type gt p 11 27 universal see universal type user defined 1 10 4 2 data variant 2 11
21. then rotating about the new Y axis and finally rotating about the new Z axis The geometric type provided by SIL for describing X Y Z Euler angle orientations is xyz X axis Y axis Z axis You may construct an X Y Z Euler angle orientation with the command mk_xyz lt rotx gt lt roty gt lt rotz gt As with yaw pitch roll the order in which the rotations are performed is crucial in describing orientations using either set of Euler angles SilTools Orientation Equivalent Angle Axis One of Euler s theorems states that any orientation may be achieved with an appropriate rotation of the frame about a general axis through the origin of the reference frame copy This is called the equivalent angle axis rotation The equivalent axis of rotation may be represented as a unit vector from the origin of the reference frame copy The formula for finding a unit vector from a set of XYZ Cartesian coordinates through which the positive axis of rotation passes is a a u where u is the desired unit vector a is the Cartesian point in vector form and a is the vector magnitude of a For instance a unit vector through the Cartesian point 1 1 1 is 4 6 8 3 3 3 A unit vector through the point 1 2 0 is 5550 A unit vector along the X axis is simply 1 0 0 The equivalent angle axis representation is constructed by multiplying the unit vector of the equivalent axis by the equivalent angle The geometric ty
22. 2 frame numbers 11 18 free variables 2 6 free_cstring procedure 9 18 frustrum operator 8 14 frustum adding 8 14 function application syntax 1 5 definition 1 21 definition syntax 1 5 is_function function 9 3 recursive 2 8 2 9 syntax for 2 3 system defined 2 12 function applications 1 12 function constructor 4 1 function_variants function 9 14 funnel operator 8 7 funnel adding 8 7 G garbage collection 1 23 9 15 general tools see gtools generation scavenging algorithm 1 3 geometry definition 3 1 equivalent angle axis 3 9 3 13 3 15 INDEX 4 Euler angles 3 9 3 12 Z Y Z 3 12 frame 3 2 orientation 3 8 pose 3 1 3 16 position 3 4 3 7 Cartesian description 3 5 cylindrical description 3 6 spherical description 3 7 roll pitch yaw 3 10 terms 3 1 units 3 3 yaw pitch roll 3 9 3 10 3 11 get_a_boole_ tf function 6 28 get_a_boole_yn function 6 28 get_a_real function 6 28 get_a_string function 6 28 get_an_integer function 6 28 get_graphics_pick function 6 23 get_pick_extended_info function 6 19 getob mode 6 12 global environment 1 9 global_browser_kind shape field 6 11 6 13 global_getob_kind shape field 6 12 6 13 globals 1 19 gluing objects 8 15 go command 11 20 graphics tools see gtools Graphics Window selecting objects in the 6 23 grid surface adding 8 5 8 22 group tools see gtools groups 6 24 gtools 6 11 6 14 6 18 activating 6 18 deactivating 6 18 general tools 6 15 6 18 group tools 6 15 6 18 mo
23. 6 4 8 4 11 4 12 4 14 4 14 4 15 4 15 4 17 Table of Contents Handlers Monitors Footers Displaying Panels Advanced Widget Programming Shape Fields and Graphics Tools Shape Fields Graphics Tools Shape Click Tools Group Tools General Tools Making Shape Fields and Graphics Tools Work Tool Sets and Tool Bodies Binding a Mouse Button Controlling which Tools are Active Tool Set and Tool Body Methods Specifying Tool Actions for Graphics Tools Other gtool Methods Obtaining Additional Information Widget Toggles Examples Graphical Picking Groups File Browsing Requestor and Message Panels Pop Up Boxes Annotated Types Online Help Installing Panels Adding a Panel into the Pulldown Menus Adding a Panel into the Quick Access Adding a Panel into the Tool Bar Making a Panel Operational Customizing the Application The Menu Bar Customizing the Logo Customizing the Layout 6 7 6 8 6 10 6 10 6 11 6 11 6 11 6 14 6 14 6 15 6 15 6 15 6 15 6 17 6 17 6 17 6 17 6 18 6 19 6 20 6 21 6 22 6 24 6 25 6 26 6 26 6 27 6 28 6 29 6 29 6 29 6 29 6 30 6 31 6 31 6 31 6 31 SilTools Customizing the Start Up Screen Chapter 7 Vision Chapter 8 Modeling Using SIL Commands The model Data Type Modeling Constructors Curves Conics Surfaces Cap Facet Plane Surface Grid Surface Surface of Revolution Tube as rvsurf Funnel as rvsurf Tabulated Cylinder Rational B Spline Surface Coons Surface Geometric Construc
24. Create Edit Group panel mk_group name id members list of pathname group This command constructs a group that will not appear to the user in the user interface mk_tmp_group name id members list of pathname group This command must be called after mk_group or mk_tmp_group add_group gr group SilTools File Browsing This command deletes a group delete_group gr group File Browsing The file browser is a panel which enables the user to browse the file system and select a file To activate the file browser use the function procedure ib_pop_file mn mnode ttl string nm string sd string ext string fn id flgs integer where mn is an optional argument that specifies which panel the file browser will appear next to on the screen and this can be nil ttl is a title shown at the top of the file browser nm is a label for the kind of entity the file will select e g cell movie sd is a subdirectory to search when the current directory is a library ext is a file extension to search for fn is the name of a function to call once a selection has been made This function will be passed two strings the first specifies the name of the file and the second specifies the full pathname flgs are flags which can set various options ib_file_save An additional text field prompts the user to enter a new filename ib_file_no_save_list The file browser will not show the fil
25. MOTE about the above concepts The SIL Runtime Model This section contains the following topics gt Environments gt Values gt Expressions E Terms E Statements E Definitions Developer s Guide 1 7 7 96 Introduction to the SIL Language SIL is an interpreted language This means that an expression is read from a file or the keyboard and is passed to the SIL interpreter which then computes the value of the expression The computed value is passed to a printer which writes it to a file or the screen and the cycle repeats This sequence in SIL is illustrated below repeat write SIL gt the prompt prompts exp read_and_parse the reader reads val value_of exp the interpreter evaluates writeln val the printer prints until false To compute the value of an expression the interpreter must be able to look up the values associated with any symbolic names that might occur in the expression For example to evaluate the expression 2 sin x pi the interpreter must look up the values associated with the names sin x and pi These associations called bindings are stored in symbol tables called environments that reside in the SIL virtual memory space Figure 1 4 shows a representation of the relationships between the components of the SIL runtime model Expressions Values Reader Interpreter Printer Symbols amp Denon pee Virtual Memory
26. Tree Structure 11 3 Loading SIL Code 11 5 Creating a New Product 11 5 Compiling SIL Code 11 7 Creating New Versions 11 10 Including Modules and Products in the Product Administration Panel 11 11 Adding New Modules 11 11 Adding New Products 11 12 Dependency Management 11 12 Modules 11 12 umodules 11 13 if Syntax 11 14 Support Only Builds Areas 11 14 Application Solutions Header Module 11 15 Patching in Interpreted Code 11 15 Debugging 11 16 Debugging in Menu Mode 11 22 Calling C Code from SIL 11 22 Sample c and h Files 11 23 Passing Data Types to C 11 27 Appendix Using SilTools in a Non English Environment Using SilTools in a Non English Environment SGI only A 1 Localizing SilTools Panels A 1 Localizing SilTools Panels at Build Time A 2 Index Developer s Guide vii 7 96 Using this Manual Using this Manual Manual Conventions viii The following sections describe conventions which have been used in this manual to denote specific concepts For the following this typeface is used E booleans E variables E statements E object names E commands E operators Example mk_rctcurve pts darray of pnt3dr n integer is an operator The SIL Prompt The SIL prompt is shown by SIL gt When you see the prompt it means that the code following it can be entered exactly as shown If the line following the SIL gt prompt line is inthis font this is the result of the command Example SIL gt monthly_salar
27. a local environment which contains the bindings of the formal parameters to the actual parameters For example the local environment created by the call average 2 3 is symbol value x 2 y 3 The interpreter then executes the body relative to this environment begin average X y 2 end When the interpreter encounters a name which is not bound in the local environment such as count in the body of the procedure inc_count it attempts to look up the value in the global environment Variables occurring in function procedure bodies that are not bound in the local environment are called free variables In addition to parameter bindings the local environment contains bindings of local variables Example 2 5 The procedure application fo0 1 2 3 where foo is defined by procedure foo x y z integer var a b c integer e darray of integer begin end continued on next page 2 6 SilTools Procedures and Functions n gt 7 a o S ae Note that a b and are initially assigned O values Generally when the type of a local variable is simple the var declaration will attempt to determine initial values for them For more complex types like records and arrays the locals are left uninitialized Several points should be made here First the bindings in a local symbol table are accessible inside of the function procedure body only Second the local environment is destroyed w
28. a record cannot be cast to an Irecord nor an Irecord to a record illustrated in Example 9 8 Example 9 8 type type_a lrecord xc real yc real zc integer end Then any value of type type_a can be legally as_typed to the rri_Irec given above but not to rri_rec nor to i_rri_Irec 9 12 SilTools Efficiency Considerations Efficiency Considerations In this section we consider the efficiency of casting as_type and of the various kinds of applications of function like objects to their inputs Most casting is free in the sense that it results in no runtime code Casting of integers reals and records but not Irecords to lispob requires copying the object in question into the heap Irecords strings ids and booleans are already in the heap so can be cast to lispob for free Casting to universal requires adding a type tag except in the case of objects see Object Oriented Terminology on page 5 1 In this chapter we have introduced several ways of applying a function like object to a list of inputs There are substantial differences in efficiency between the various kinds of applications The ranking from fastest to slowest is 1 Ordinary function application e g twice 4 This is the fastest of all and when compiled is equivalent in efficiency to a C function application N o S Ee S a Q Q c o gt lt 2 Closure application e g shorterc a ab
29. adding monitors and handlers setting methods and initializing the state of the widgets This is done in the initialize method of the panel which can be set using the Visual SIL Window or calling set_method in line the SIL file Example 6 12 procedure init_test_panel mn mnode begin add_monitor mn toggle test_toggle_monitor end set_method itest test_panel initialize init_test_panel list mnode The next step is to optionally set the at_pop method of the panel Setting the at_pop method both initializes the panel for use the first time and every time it is brought up The at_dismiss method may also be set and will be called each time the panel is brought down 6 30 SilTools Customizing the Application Customizing the Application The Menu Bar The menu bar is specified in each product s top_init sil file Set the top_bar variable to be the menu s panel Customizing the Logo The logo is a small panel which contains a button with the product s logo When the button is pressed an action may take place To change the product s logo use set_label_icon ikern logo command pixmap_file string By default a small panel pops up with text inside To change this text use install_new_list_entries ikern logo_info list entries sarray_of Istring To change the action that occurs when the button is pressed use set_handler ikern logo command id
30. and is identified by the name of its module together with its name SilTools The mnode Class An item panel can interact with WM though WM handlers Currently four kinds of WM handlers are defined activate Left mouse button is clicked inside panel the first time after cursor moves into it move Panel is moved interactively resize Panel is resized interactively quit Panel is to be closed using panel WM menu Named handlers defined for item panel popup Called right before the panel is seen on the screen An item panel can have built in command buttons shown at the bottom of the panel called footers to be used as the action area for those panels whose widgets do not cause immediate actions Menu Menu is a container mnode for menu items There are two kinds of menus menu bar Always displayed at top of a top panel pulldown menu Popped up when a menu button is activated A pulldown menu can include the following kinds of mnode as its children e Menu button Command button e Panel button e Switch e Separator oO So Pe Eg ES hg ia i Developer s Guide 6 5 o 7 96 Programming the User Interface Simple Widget Programming 6 6 Panels created using the Visual SIL Window are saved in the file system under cim gui panels lt module gt lt name_of_panel gt lt version gt Using the Visual SIL Window is described in Chapter 7 NOTE Customizing the Menu Interface in the Si T
31. and that the type of delayc is tclosure lispob integer 10 14 SilTools Chapter 11 Working with SIL Code Protection This chapter explains how to load compile and debug code and how your SIL code is protected Protection In order to keep users from overwriting system code each SIL entity global function task etc is assigned an integer protection level The global current_authorization controls the protections assigned to SIL entities Any attempt to redefine an entity with protection level greater than that defined by current_authorization will result in an error Resetting the value of an existing global with the symbol does not require any authorization however resetting this type and value with this symbol does require adequate authorization System functions generally use a 0 as their protection level The default value of current_authorization is 1 You can set authorizations to the level you wish by using current_authorization lt level gt O 8 D z d 5 Developer s Guide 11 1 7 96 Working with SILCode Code Organization The SilTools environment provides facilities for compiling and linking in SIL code These facilities make use of a well defined directory structure for storing the various files relevant to the system The procedures used to compile are more complex than those used to load interpreted code partly because the underlying structure has been s
32. by John J Craig Addison Wesley 1989 provides detailed information on the concepts in this chapter Developer s Guide 3 1 7 96 SiTools Geometry Every point on an object has a fixed location relative to its pose When you manipulate objects you only need to be concerned with their poses NOTE Poses on page 3 16 describes poses Shape To simulate objects in a three dimensional space SilTools manipulates a data structure in which all simulated objects are represented by a type called shape To handle multiple shapes SilTools arranges all shapes in the simulated world in a tree structure The root of this tree is a special shape which lacks any associated geometry and is called world Frame SilTools provides a special kind of shape called a frame which is used primarily for teaching desired positions of objects e g via points in a path along which another shape will move The geometry of a frame shape is shown on the right hand side of Figure 3 1 one axis looks like an X one like a Y and the Z axis looks like a pointer Because a frame is also a kind of shape it has a pose which lies coincidently with the frame s geometry Frame Pose d Figure 3 1 Coordinate frames 3 2 SilTools Understanding SilTools Geometry Geometric Units To specify positions and orientations you need a way of specifying lengths and rotations The default unit for length in SilTools is centimeters All other u
33. evaluating the point on the parametric surface at u v is pnt eval_at ps u v The command to evaluate the normal at u v is nrm normal_at ps u v Considerations regarding seg_pose with parametric surfaces are similar to those regarding seg_pose with parametric curves The syntax to evaluate points and normals on a parametric surface ps in absolute World coordinates is pnt seg_pose ps eval_at ps u v nrm ornt seg_pose ps normal_at ps u v Wireframe Models Operator Resulting Shape chain list lt point1 gt lt point2 gt lt pointn gt open chain 8 12 SilTools Modeling Constructors Volume Models Cylinder resolution number of facets in circumference of the cylinder if omitted c_circ_res is used D V angle between 0 and 360 creates partial cylinder 2 E Operator Resulting Shape 2 E cylinder lt radius gt lt angle gt lt height gt cylinder 3 2 20 kresolution gt Block Operator Resulting Shape block lt length gt lt width gt lt height gt block Pipe radius1 outside radius radius inside radius resolution number of trapezoidal prisms in the pipe if omitted c_circ_res is used Operator Resulting Shape pipe lt radius1 gt lt radius2 gt lt height gt cylindrical L lt resolution gt volume model with inside and outside radius Cone resolution specifies the number of triangular facets in the circumference of
34. functions while 3 and 4 are the frames of the user functions CALLS _BLOW_UP and BLOW_UP The tb command works for both interpreted and compiled code When it is used with compiled code however only function names and not local values are available To see the values of local values in the compiled code for a function we can patch in its source code and the local values for that function will be available to tb and other stack examination facilities This means we do not need to regenerate the error using interpreted code to see local values patching the function into the existing error break is adequate SilTools Debugging If tb is given an integer argument only the specified number of frames above the debug frame will be printed For example the following tb command with its argument would only print frames 4 and 5 from Example 11 2 Error gt tb 2 The command Error gt tbn is identical to tb except that it prints no local or parameter values The example below illustrates the use of the tbn command The following command returns the value of the given variable in the given frame as a universal Error gt ev lt variable name gt lt frame numbers For example The debug_frame variable is initially set to the frame number of the function in which the error occurred The following commands are equivalent O Ss 72 3 D E b O Error gt ev lt variable name gt Err
35. hooks them to their widgets will typically appear in the same code module where the panel s code resides Footers Footers behave like push buttons executing an action when the button is clicked However footers are automatically laid out across the bottom of a panel and cannot be manipulated like other visual elements To associate an action with a footer command use set_footer_handler pn mnode ft id hd id This function adds a handler to the footer ft in panel pn Displaying Panels For testing it is often useful to be able to install a panel constructed by the Visual SIL Window without having to do a build This can is done by using load_panel module_name string panel_name string The panel may then be displayed by calling put_up mn mnode The panel may be removed from the display by calling bring_down mn mnode 6 10 SilTools Advanced Widget Programming Advanced Widget Programming Developer s Guide 6 11 7 96 This section describes how to program shape fields and graphics tools gtools Shape fields and graphics tools gtools are powerful interface elements allowing graphical shape picking and general graphics operations in panels respectively The Move Object panel is a good example of shape fields and gtools in action The shape field at the top of the panel picks the object to move and gtool linked to a container performs the actual move function
36. is released and the group_of is filled in with the shapes within the 2D box indicated by the drag A group tool is created with the constructor function mk_group_gtool name id gtool The operation to access a group tool is function is_group_gtool gt gtool boolean General Tools Tools that do all their own computations that can act in whatever manner the programmer sees fit when the mouse is pressed dragged and released A general tool is created with the constructor function mk_general_gtool name id gtool The operation to access a general tool is function is_general_gtool gt gtool boolean Making Shape Fields and Graphics Tools Work A tool set attachment must be added to each panel which has a shape field or gtool wired to the mouse These shape fields and gtools are generally called tools Tool Sets and Tool Bodies Only one tool set may be active at a time and tool sets are always associated with panels clicking the mouse button with the cursor in the panel activates the panel s tool set and changes the border color Tools are active only when their tool set is active In the simplest case a tool set can hold two tools which bind both mouse buttons Because a panel may have many tools which need to be wired and there is only one mouse tool bodies support switching of So 3 Dos cos EL Epe S Do a Programming the User Interface 6 16 tools wi
37. length by array_length O 8 D z d E 5 Developer s Guide 11 27 7 96 Working with SILCode Example 11 7 provides a more complete example in which functions for doubling an Ipoint and for doubling an array of points are imported 11 28 SilTools Calling C Code from SIL O S 2 E D E b O Developer s Guide 11 29 7 96 Working with SILCode 11 30 SilTools Calling C Code from SIL 5 O S 72 zl E D E O Developer s Guide 11 31 7 96 Working with SILCode 11 32 Protecting the Data Space when Passing Strings As mentioned earlier SIL strings are passed to C with the type stringob SIL strings differ from C strings in that they include a header which consists of a type tag and a length and are not necessarily null terminated the length field in the header determines how long the string is not the first occurrence of a nul in the sequence of bytes which make up the string The C function strlen will return the length of a stringob while STRING_BODY will yield a pointer to the beginning of the string itself The functions 12c_str and c2l_str convert back and forth between the SIL and C representations of strings l2c_str converts from SIL to C strings and c2l_str should only be used to return a single value directly to SIL as in return c2l_str lt a C string gt If c2I_str is not used in this fashion the d
38. model Therefore you do not have access to any of the children individually once the model is glued If the model or any of its children are parametric shapes glue will remove the parametric information about these shapes For this reason models which have been glued require less memory space since SilTools keeps only the discrete information about the shapes this significantly increases the efficiency of workcell simulation D a E 36 2E De 36 Ep P You can use glue for shapes which do not exist in the workcell also glue lt name gt lt shape1 gt lt shapeN gt This version of glue returns a rigid shape lt name gt whose body is the combination of the bodies of lt shape1 gt through lt shapeN gt DO NOT use this command if any of the shapes from Lhe a ALE lt shape1 gt through lt shapeN gt exist in the workcell When this version of glue is invoked SilTools defines a reference frame for the resulting shape and places it on the shape at the same place as the World coordinate frame This makes it seem as though an invisible copy of the World coordinate frame were included with the shape when itis glued Because a rigid shape only has one reference frame any rigid shapes which are subsequently glued lose their reference frames The glue operator makes no attempt to resolve duplicate elements of the body shape which results SilTools does not glue models with dissimilar body types wireframe or su
39. no tasks are waiting the value of the semaphore is incremented gt o a 3 O Z fe 8 Developer s Guide 10 7 7 96 Concurnency 10 8 SilTools Semaphores In Example 10 4 value parts_at_L will always be the number of parts at L Note that a little thought is required to verify the correctness of even this simple example Suppose that when C1 waits for parts_at_L a part is available In the course of waiting for L to be clear however that part is taken away Such an occurrence would represent a failure of synchronization This scenario will not occur since when C1 waits for parts_at_L the execution of the wait decrements parts_at_L This decrement in effect reserves a part for C1 which no other task can take away gt o fa a 3 fa e oO Developer s Guide 10 9 7 96 Concurnency Pipes 10 10 Pipes are used for communication between tasks A pipe of type pipe lt type gt is a structure of the form pipe lrecord messages queue of lt type gt waiters queue of tasks end Tasks can either place messages at the end of the messages queue of a pipe or remove messages from the front of the messages queue If a task tries to remove a message when the messages queue is empty then the task suspends itself on the waiters queue of the pipe until a message arrives Note that messages does not have specific tasks as destinations To create a p
40. non terminal symbols have been replaced Five conventions are associated with the rules used in this manual These conventions provide readers with a means of denoting specific types of symbols and of writing rules in an abbreviated fashion 1 Rules with the same left hand side lt A gt exp1 lt A gt exp2 lt A gt exp3 can be rewritten in a single line as lt A gt exp1 exp2 exp3 Developer s Guide xi 7 96 Using this Manual xii Rules with the same right hand side lt A1 gt exp lt A2 gt exp lt A3 gt exp can be rewritten in a single line as lt A1 gt lt A2 gt lt A3 gt exp Rules in which one right hand side is a substring of another lt A gt ac abc can be rewritten as a single rule lt A gt a b c Here b indicates that the string b is optional Recursive forms can be written with rules such as lt A gt e e lt A gt or lt A gt Here e e means that A can be replaced by a string of one or more e s A non terminal symbol is any character string enclosed by angle brackets lt gt lt parameter list gt lt function application gt lt etc gt SilTools Notation All other character strings are terminals Developer s Guide xiii 7 96 Chapter 1 Introduction to the SIL Language SIL Language Overview Although the SilTools menus provide most of the commands you need you can also create your own com
41. panel will create a new modules file and write it to your product area All the components of the application solution will be included in this newly created modules file Various initialization files and start_up msg will also be copied from the application solution MYPROJECT1 0 to your product area Patc hing in Interpreted Code SIL allows interpreted versions of functions to overwrite their compiled versions For instance suppose that a function teds_function has been compiled into a product If we wish to test a modification to this function we can load or paste in a new version of code for the function and the new code will take effect immediately That is whenever teds_function is called by any other function in the system whether compiled or interpreted it is the most recently loaded version that is called not the original compiled version The process of overwriting compiled with interpreted code for a function is called patching the function The ability to patch code is very useful since it allows code to be enhanced tested and debugged without going through a compile and link cycle Developer s Guide 11 15 7 96 O 8 D z d E 5 Working with SILCode Debugging Whenever possible debugging should be done with SilTools in Text Mode Catching errors while still using the menus and panels is discussed at the end of this section Text Mode is obtained by selecting Exit Menus fro
42. same name must have distinct input types a name and a list of input types uniquely specify an sconst for a function variant We can fetch this sconst with function find_variant x id intps list of ntype sconst More generally an id and a type specify an sconst which can be fetched by function find_variant x id tp ntype sconst If there is no variant of the indicated type a special sconst undefined_sconst is returned To test for undefined_sconst function is_undefined x sconst boolean This function applies the given sconst to the given arguments apply op sconst a list of lispob SilTools C Data Types For example Example 9 9 SIL gt vp find_variant plus list integer integer SIL gt apply vp list 3 as_type ob 4 as_type ob C Data Types C Records and C Anays Any SIL record or Irecord includes a tag word at the beginning for use by the garbage collector Any SIL array or string has such a tag word too as well as a length field The crecord facility in SIL allows records and arrays to be declared without including these additional tag words and length fields The main motivation for this is to allow direct manipulation by SIL code of any C data structure N o S amp S a Q Q c o gt lt The syntax of a crecord declaration is just like that of a record or Irecord type erb crecord xc integer yc real
43. selector list To display textual data text To display graphic data canvas To display static text label To separate other widgets separator Table 6 2 Primitive widgets 6 2 SilTools The mnode Class Behavior Behavior is defined as how the widget will respond to user actions There are several types of widget behavior active Sensitive to keyboard mouse input passive Insensitive to keyboard mouse input monitored Having a value of certain type associated to it such that changes in the widget value by code or as result of certain user action can be monitored handled Can accept one or more handlers to respond to certain user actions entried Having an sarray of Istring as its entries and its value being the ordering of one of its entries All monitored widgets have a ucap view of simple type boolean integer real or Istring to store its value and to monitor changes in its value except fields whose ucap view is of type numstring There are many kinds of widgets each having its own appearance and behavior Operations on any kind of widget usually work directly on its mnode view However there are some widget operations which work only on its panel view There are two types of operations working on mnode view general Work on all or more than one kinds of mnodes specialized Work on only a single kind of mnodes names of such operations usually include name of the widget kind All operat
44. tag The tag indicates the layout of the fields making up the data Consider the type type rri_lrec irecord real1 real real2 real int1 integer end with rriv mk_rri_lrec 2 3 4 Then the datum representing the value rriv has the format lt tag 2 0 3 0 4 gt When a stackval appears as a field of a record or Irecord its own fields are embedded within the record or Irecord Example 1 14 type rri_rec record real1 real2 real int1 integer end type i_rri_rec Irecord f1 integer f2 rri_rec end i_rri_v mk_i_rri_rec 99 mk_rri_rec 5 6 7 Then the format of i_rri_v is lt tag 99 tag 5 0 6 0 7 gt Developer s Guide 1 23 7 96 Intoduction to the SIL Language When a heapval appears as a field of a record or Irecord the heapval datum is not embedded in the record but rather represented by a pointer as in Example 1 15 1 24 SilTools Chapter 2 The Basics Accessing Help This chapter describes some of the basic features of the SIL language including on line help procedures functions polymorphism and input output Accessing Help SIL includes a simple help facility help lt name gt N A a G a v G n The help command prints out all of the variants of the given name their types and the name of the file in which they were defined Example 2 2 shows part of the information printed out for the plus command in a SilTools state Developer
45. use SIL gt compile lt module gt lt version gt lt file gt For example SIL gt compile ted ted1 file1 If we are executing these commands in a product which already includes version ted1 of the module ted the version information is not necessary In this case the commands are SIL gt compile_area lt module gt and SIL gt compile lt module gt lt file gt For example SIL gt compile_area ted SIL gt compile ted file1 Once the SIL files are compiled the second stage of compilation from C to binary is accomplished via the following shell command gt remake lt module gt lt product gt This remakes the given module for inclusion in the given product The version used is determined from the versions file in the product NOTE The first module must be included in the product s umodules file and the scope_out script must be run For example gt remake ted tedsproduct Developer s Guide 11 9 7 96 O 8 D z d E 5 Working with SILCode In this example the remake command also compiles any code included in c_files In our example these files are called cfile1 and cfile2 Whenever SIL code is re compiled from SIL to C the next remake done on the module re compiles the newly generated C code However editing a hand written C code file will not by itself force remake to re compile that file To re compile a file add the name of the modifie
46. where lt type gt is any type expression and indicates the base type of the empty list returned by this call Of course you must be able to determine whether or not a list is empty To check whether or not a list is empty use the predicate null lt list gt which returns true if lt list gt is an empty list of any base type SilTools Lists Other List Operations Besides the basic list operations introduced in List Types on page 4 4 SIL provides many other list operations Example 4 4 illustrates some of these other list operations Destructive List Operations All of the list operations discussed above are non destructive functions This means that they return a value without modifying their inputs as a side effect By contrast set_car and set_cedr are procedures which redefine the car and cdr of their first argument illustrated in Example 4 5 N Q Q gt Ee m Exercise caution when using destructive operations Programs that destructively modify a global list may create unpredictable results in other programs which reference this list Developer s Guide 4 5 7 96 Data Types List Rec ursion and Iteration The most effective method of demonstrating the use of list recursion is through the use of an example 4 6 SilTools Lists To write an iterative algorithm with the same functionality a special iterative control structure would be used which enables yo
47. with one property for each class to which the object belongs Developer s Guide 1 5 7 96 Introduction to the SIL Language SIL provides direct and flexible access to the views of an object The function views x A returns the view list of any object of any class A It is possible to edit view lists by adding or removing members View lists admit object mixins rather than just class mixins For example to endow an object with both color and weight attributes simply splice color and weight views onto that object it is not necessary to define a class which mixes color and weight in advance SIL provides both early binding compile time and late binding runtime mechanisms for method selection For example let B be a subclass of A and suppose that f is a method for A but not B and that e is an expression of type B In the expression f e e will inherit the method f from A This inheritance or method selection occurs at compile time so that no runtime overhead is induced this is like ordinary method selection in C On the other hand in the following expression apply g e the views of the object e will be searched at runtime until one to which g applies is found this will occur if e is of universal type and its runtime value is an object also This is known as late binding which is the scheme used in SmallTalk and Objective C SIL also provides the equivalent of the virtual function facility in C
48. you choose Collision Detection from the Utilities pulldown menu Pulldown Selections and Commands Selections from the pulldown menus commands and command buttons are indicated with Italics in this Typeface Examples Install is a selection from the Layout menu Apply is a command Toggle Choices Toggle choices are shown with a symbol in front of the label Example Checks is a toggle choice Switches Switches are shown with a H symbol in front of the label Example Ll Show Reference Frame x SilTools Notation Fields and Messages The label and the information in the field are in this typeface Example Edge Length displays 1 0 in its field Messages such as instructions and error messages that pop up or are displayed in the panels are quoted using this typeface Example Pick any edge of an object Notation This manual uses simplified grammatical rules which resemble BNF to describe syntactic forms This section describes these rules completely These rules use the following form lt A gt exp where lt A gt is a non terminal symbol and exp is a string of terminal and non terminal symbols Interpret the above rule to mean that all occurrences of the non terminal symbol lt A gt can be replaced by the string exp The goal of a rule such as that described above is to derive syntactically valid strings of non terminal symbols by repeatedly applying all available rules to a given string until all
49. 1 14 atomic 1 14 compound 1 14 1 15 conditional 1 15 constructors 1 15 iteration 1 17 static 9 17 static polymorphism 1 2 std_mk_layout_settings function 6 32 storage 1 23 string type 4 2 9 1 11 27 strings 4 12 4 17 capacity 4 16 comparisons 4 14 comparisons lexicographical 4 14 concat_onto procedure 4 16 conversions 4 14 copy function 4 16 copying 4 15 Developer s Guide 7 96 Index cstrings 9 17 copying 9 18 creating 9 18 printing 9 18 equal function 4 16 find function 4 16 float2Istr function 4 16 indx operator 4 15 integer_to_string command 4 14 intern constructor 2 20 is_string operator 9 6 length 4 13 lowercase operator 4 13 4 16 Istr_to_str function 4 16 Istrings 4 15 4 16 9 17 match operator 4 14 memory allocation 4 16 mk_Istring function 4 16 mk_static_Istring function 9 19 null terminated 9 18 operations 4 13 4 15 real_to_string command 4 14 select function 4 16 setindx operator 4 15 string_to_integer command 4 14 string_to_real command 4 14 substring function 4 16 symbol changing a string to 2 20 to_string function 4 16 uppercase operator 4 13 struct declaration 11 27 subtype function 9 3 supertypes 9 1 supmodules file 11 12 11 14 11 15 syntax 11 13 support only builds area 11 14 sure function 6 27 surface of revolution 8 6 8 23 symbols 2 19 2 21 concatenation 2 21 data type 2 20 i_tsetq operator 2 21 id 2 20 INDEX 11 Index id2string operator 2 21 identifiers 2 20 op
50. 2 a1 h real rvsurf a funnel r1 r2 h real rvsurf Tabulated Cylinder endpt endpoint of generatrix base directrix Operator Resulting Shape mk_tcsurf endpt pnt3dr base list of pcurve tcsurf Rational B Spline Surface knts1 knts2 u v knots cpts control points wghts rational part of control points weights Operator Resulting Shape mk_rbsurf knts1 knts2 wghts darray of real rbsurf cpts darray of pnt3dr mk_rbsurf knts1 knts2 darray of real rbsurf cpts darray of pnt3dr Developer s Guide 8 7 7 96 Modeling Using SL Commands 8 8 d1 d2 degrees in the u v directions fno is a formno gives a simple description of what type of surface this really is such as cylinder sphere etc coefs coefficients of spline surf Operator Resulting Shape mk_bsurf fno d1 d2 integer rbsurf knts1 knts2 darray of real coefs darray of pnt3dr mk_bsurf d1 d2 integer rbsurf knts1 knts2 darray of real coefs darray of pnt3dr Coons Surface sg1 sg2 sg3 sg4 line segment boundaries pc1 pc2 pc3 pc4 pcurve boundaries k specifies the type 0 for linear and 1 for cubic Operator Resulting Shape mk_cnsurf g1 sg2 sg3 sg4 seg3dr k integer cnsurf mk_cnsurf pc1 pc2 pc3 pc4 pcurve k cnsurf integer The next variants for surfaces ensure that if any rectilinear curve is revolved about an axis or if any cylinder is built on a rectilinear curve the subdivision that is generated will re
51. 5 16 bindings 1 8 2 6 2 7 early 1 6 9 9 late 1 6 5 16 9 9 block operator 8 13 8 21 block adding 8 13 8 21 boolean type 4 2 9 1 break pause 11 20 bring_down command 6 10 bug tracking 11 22 build area 6 30 build time 9 19 builds directory 11 4 C C compiler 1 2 c files 11 23 C language arrays 9 16 build time 9 19 calling C code from SIL 11 22 11 31 carrays 9 16 cast primitive 9 12 char type 9 4 9 16 compiling 11 7 crecords 9 15 cstring_constant constructor 9 19 INDEX 1 Index data structures 9 19 data types 9 15 9 19 double type 9 16 erb type 9 15 float type 9 16 11 23 int type 9 16 11 23 pointer 9 16 records 9 15 short type 9 16 strings 9 17 copying 9 18 creating 9 18 mk_static_Istring function 9 19 null terminated 9 18 printing 9 18 c_import command 11 23 call stack 11 16 camera programming 7 1 7 3 cap adding 8 4 capacity 4 16 car operator 4 4 9 5 carat 9 16 case construct 1 16 casting 5 11 9 12 9 13 cdr operator 4 4 9 5 chain operator 8 12 CIM environment variable 11 2 cim tree 11 2 circle adding 8 2 8 10 class 1 5 5 2 abstract see abstract class facility C 5 23 inheritance 5 6 superclasses 5 14 clock variable 10 1 10 3 close command 2 17 closures 2 10 9 13 is_closure function 9 3 code modules 11 2 organization 1 2 comodules file 11 12 11 14 11 15 syntax 11 13 INDEX 2 compile command 11 9 compile time 5 16 compile_area command 11 9 compiling SIL code
52. 6 Modeling Using SL Commands Converting SilTools Models to IGES files In order to convert a SilTools model to an IGES file the model you wish to convert must be in the SilTools product that you are using If it is not already there you can bring it into the product with the following function restore lt filename gt where the lt filename gt must be a string Note that restore is a function which returns the value of the model so it must be assigned a model variable type in order to make use of the returned model The command to convert a model to an IGES file is model_to_iges lt model gt lt filename gt where lt model gt is the variable containing the value of the model to be converted If you do not specify a lt filename gt SilTools will prompt you for it during the conversion routine After you enter the model_to_iges command SilTools displays a list of IGES global default parameter values and asks you if any are to be changed If you answer yes the program steps through these parameters one at a time and asks for changes If you answer no SilTools prompts you for the name of an IGES file and converts the model writing to this file 8 18 SilTools Modeling Examples Modeling Examples The following examples illustrate the use of some of the models constructors described above and demonstrate several useful modeling concepts You are not limited to using SIL commands to create these examples all
53. C Data Types If you want to allocate an Istring to be passed to C you may wish to use function mk_static_Istring x string n integer Istring or function mk_static_Istring x string Istring Either of the above functions are used to construct Istrings that are already static and null terminated This procedure will cause the contents of x to become static and null terminated if they are not already procedure mk_static x Istring C Constants at Build Time Builds are described in Chapter 11 Working with ae SIL Code N o S Ee S py Q Q c gt lt C data structures cannot be safely created at build time except as described below For example if you compile a file in which the line aa mk_cstring abc appears and then start up the resulting state aa will contain garbage This is because starting a state almost always moves the heap so that the pointer that is the value of aa is no longer valid To get around the problem use this construct instead cstring_constant aa abc This has exactly the same effect as aa mk_cstring abc except that cstring_constant records the need to reset aa when a state starts up making it safe for use in compiled code Developer s Guide 9 19 7 96 Chapter 10 Concurrency Temporal amp Instantaneous Commands This chapter explains how to use SIL for concurrent execution of multip
54. OIE 1 5 Data type classifications on page 1 11 Constructed Types Constructed types are built from existing types using type constructors Some type constructors are list_of array_of function and procedure E list_of integer is the type of all integer lists 7 2 He Se m The base type of the type list_of integer is integer Notice that list_of list_of integer is another constructed type with base type list_of integer list of integer is the alternative syntax for list_of integer Lists are described on page 4 3 E array_of integer is the type of all arrays of integers regardless of size The base type in this case is integer darray of integer is the alternative syntax for array_of integer Arrays are described on page 4 8 Developer s Guide 4 1 7 96 Data Types function real integer integer is the type of all functions that take two integer inputs and return a real output Integer division is a function in this type procedure real integer is the type of all procedures which expect a real valued and integer valued input NOTE Procedures and functions are described on page 2 2 System Defined Types SIL system defined types include the basic scalar types integer real boolean string Strings are described on page 4 12 User Defined Types User defined types are created by type definitions type lt name gt lt type expression gt Any kind of type express
55. SilTools Developer s Guide SILMA Division of Adept Technology Inc Copyright July 1996 Adept Technology Inc ALL RIGHTS RESERVED This material is the property of Adept Technology Inc and contains confidential information No part of this publication may be reproduced published stored in a retrieval system or disclosed to others without prior written permission from Adept Technology Inc The use of general descriptive names trade names trademarks etc in this manual even if they are not especially identified does not mean that such names as understood by the Trade Marks and Merchandise Marks Act may accordingly be used freely by anyone The material contained herein is subject to change without notice Table of Contents Using this Manual Manual Conventions Notation Chapter 1 Introduction to the SIL Language SIL Language Overview SIL Compared to Pascal The SIL Programming Environment Entering SIL Commands Extended Types The Object System Concurrency The SIL Runtime Model Environments Values Expressions Terms Statements Definitions Globals Types Functions and Procedures Variable Declarations Storage Model Chapter 2 The Basics Accessing Help Procedures and Functions Defining Procedures and Functions Local Environments Nested Definitions Recursive Functions and Procedures Developer s Guide 7 96 2 1 2 2 2 3 2 6 2 7 2 8 Table of Contents Closures Polymorphism General I
56. adding a shape speedup field Graphical Picking The preceding section explained how to add graphics picking to a panel This section explains how to enable the user to perform a graphics pick without using a panel that has been displayed from the menus This facility is included primarily to support older pre Release V versions of SILMA software 6 22 SilTools Graphical Picking To prompt the user to select an object from the Graphics Window or Quick Pick Window use the function get_graphics_pick message string boolean When this function is executed a pop up box is displayed The pop up box instructs the user to pick an object by clicking on one in the Graphics Window or the Quick Pick Window After the pick is made you can obtain information about the graphics pick by using the function described in Obtaining Additional Information on page 6 19 The get_graphics_pick function returns TRUE if something is selected and FALSE if the user aborts by clicking the Cancel selection in the pop up box A more powerful version of the command is get_graphics_pick message string screening_function id boolean This command applies the screening_function to each object that a user selects and returns only when this screening function returns true Example 6 9 requires the user to pick until a frame or the teacher is selected or the selection is aborted Example 6 9 var pick boole
57. allation is done by explicit uses of set_method As a result the user of astack need not worry about views being added later that might have a rogue pop operator C SIL abstract classes and their methods resemble C classes with virtual functions but are considerably more flexible On the other hand the SIL apply construct resembles normal messaging in objective C or SmallTalk On the whole abstract classes are both the cleaner and the more efficient alternative Additional Methods Primitives The following are more primitives for methods pmethods x lt any_type gt prints out the methods currently installed in x This is useful for debugging Developer s Guide 5 23 7 96 Classes define_method astack Istack ipop pop Instead of installing a method into any particular astack the preceding use of define_method defines a standard method to use for ipop for any object that is an astack implemented by an Istack For astack a use_methods a stack installs all of the standard methods for astack associated with Istack into a An advantage of use_methods is that it saves space by just putting a pointer to a block of methods associated with the Istack class into a Instead of needing two words per method in a this requires just three words for the whole collection of methods Usually the method machinery is used to install the methods of a concrete class into the method store of an abstract view so us
58. aluate other definitions which refer to the name before the value is known this is known as forward referencing and will be discussed in the next section In the case of simple types the declaration attempts to compute an initial value of the appropriate type and assign it to the name Again notice the extra semicolon at the end of the declaration Example 1 13 Several variables can be declared in a single declaration var X y Z integer a b c real i j k darray of integer SIL will initialize integers to 0 reals to 0 0 and arrays to length 0 arrays You should not however depend on this you should always initialize your own variables 1 22 SilTools Storage Model Storage Model o o 22 5 5 gt ae SES u eD Z Most types of SIL data are stored in a memory area called the heap Allocation and reclamation of storage in the heap is managed automatically by an algorithm called a garbage collector The design of the heap and its management is similar to that used in modern implementations of Lisp and SmallTalk The only pieces of data that are not stored in the heap are the values of local variables of type integer real or record This data is kept in another structure called the stack Any SIL data value other than an integer real or record is called a heapval Integers reals and records are called stackvals All SIL data except integers and reals include a word called the
59. an function is_frame_or_teacher x object boolean begin is_frame_or_teacher is_frame x or is_teacher x end pick get_graphics_pick Pick a frame is _frame_or_teacher 8 Ds oS EE T Dw oD a Developer s Guide 6 23 7 96 Programming the User Interface Groups 6 24 The grouping mechanism provides a way to perform the same operations on more than one shape at a time A group is treated by the user interface as a shape even though its members are not a part of the World shape tree There are several ways to create a group for example you can create one by clicking and dragging a rubber band object in the Graphics Window or using the Create Edit Group panel If you are planning on using multiple object shape selectors you should first familiarize yourself with the information in Shape Fields and Graphics Tools on page 6 11 on how to enable a shape field to select groups of shapes then use the commands in this section This command determines if an object is a group shape is_group object model boolean This command returns the members of a group treated as a list of pathnames value gr group list of pathname wlkup pathname can be called on each element to get the shape A group can be created by calling a short set of API functions This command constructs a group that the user can select in the Quick Pick Window and edit from the
60. an be applied to inputs of types astack lt input_type gt lt input_type gt and will return the given return type So for example push takes an astack and an ob and returns an ob The first argument to any method is the class for which the method is defined so it need not be specified explicitly It is for this reason that we write method ob ob rather than the redundant method ob astack ob Now the method slots in a class definition are filled by ordinary SIL functions which take a view of the astack as first argument For example the operator installed in the push slot will be a procedure which takes a view of an astack as its first argument and an ob as its second The intent of this should become clear as we proceed with this example 5 20 SilTools Abstract Classes Installation of Methods Installation of methods is done using the following primitives If ais a particular astack which is also an Istack we can set the method push in a to be push on the Istack a mk_astack mk_Istack a emptylist ob set_method a push push list Istack ob That is when push is called on a it delegates the work to the push variant on Istack So push a x is equivalent in effect to push a as_ view Istack x As illustrated above the operator method_defined x lt any type gt y id determines whether the given method has been installed in x Developer s Guide 5 21 7 96 Cla
61. and updating the build area where the top bar panel resides Adding a Panel into the Quick Access A panel may be added into the Quick Access using the Visual SIL Window or during initialization by calling create_rolodex_mnode_nm mn mnode If a panel will be used as a tool set it should first be made into a tool_set before adding it to the Quick Access NOTE Adding a Panel into the Tool Bar A panel may be added into the tool bar using the Visual SIL Window or during initialization by first calling create_toolbar_mnode mn mnode bid id pict string where bid is an id given to the new button to be created and added into the tool bar and pict is the relative pathname of the icon pixmap All pixmaps and bitmaps should reside under the cim gui icons directory To make the panel appear in the tool bar call add_panel_to_toolbar tm toolbar_mnode o So O Do c EL fe S Do 2 gt a Developer s Guide 6 29 7 96 Programming the User Interface Example 6 11 aaa create_toolbar_mnode itest test1 test1 test_icon sets itest test1 siconto cim gui icons test_icon add_panel_to_toolbar itest test1 to_view toolbar_mnode Making a Panel Operational All panels belong to a particular build area so code associated with making a panel work should be placed in that same build area The first step in making a panel operational is to hook up a panel by
62. andard behavior The difference between the two languages emerges when examining pointer types SIL maintains pointer structures in a Lisp or SmallTalk like heap so that pointer management is different from and simpler than Pascal Still another feature which distinguishes SIL from Pascal is its polymorphism SIL is polymorphic in the sense that the same symbol may be used to denote functions of differing input types For example the function double may be defined both for reals and points without conflict This is known as static polymorphism SIL supports other kinds as well Because the decision of which function variant to use is made at compile time no performance slowdown occurs The SIL Programming Environment The SIL programming environment like that of Lisp or SmallTalk is interactive Any legal expression can be typed or cut and pasted into the SIL gt prompt including new functions type definitions or global assignments Typing or pasting in expressions results in these new entities being added to the current programming state In Text Mode the mouse buttons have different functions such as cutting and pasting text which are defined by the operating system Uncompiled SIL code is executed by a fast pseudo code based interpreter It is possible to compile SIL code also to do this the code is translated first into C and then to binary using the host machine s C compiler The performance of compiled SIL code is simil
63. ar to that of corresponding code written directly in C or Pascal Interpreted and compiled code may be freely mixed compiled functions may be replaced at will by modified interpreted variants allowing fast bug fixing and testing SilTools SIL Language Overview SIL uses a generation scavenging garbage collection algorithm Even for very large applications garbage collects are fast less than one second and infrequent enough that you will not be able to detect them as long as you are working on standard UNIX workstation hardware such as Sun SPARCstations See Storage Model on page 1 23 3 Q gt a e o op Dc Oo G 5 pa 2D Entering SIL Commands To access the SIL language you must have a product running The Starting SilTools section in Chapter 2 of the SilTools User s Manual explains how to start a product The SIL Window can be used to enter SIL language commands while retaining access to the menus and panels The SIL Window is displayed under the Graphics Window Figure 1 2 The SIL Window You can also change to Text Mode to enter SIL language commands In Text Mode you have full editing capability and direct access to the operating system Change to Text Mode by selecting Exit Menus from the File pulldown menu The menus are disabled and the SIL gt prompt is displayed in the shell window that you used to start SilTools Sil gt function plusx y list of integer list
64. ata space of SIL may be corrupted SilTools Appendix Using SilTools in a Non English Environment Using SilTools in a Non English Environment SGI only Using SilTools in a Non English Environment SGI only 1 Specify the desired locale in 1lang e g ja_JP EUC Refer to the SGI documentation for further information 2 Log out and log in again so that the environment variable LANG is set to the desired locale e g ja JP EUC 3 Add the following line into top_init sil if it does not exist international_release true 4 For Japanese edit the X application resource file Cimstation to change all font List resources as follows Cimstation fontList helvetica bold r 14 mincho 14 an 4 Cimstation XmText fontList 7x14 mincho 14 14 Cimstation XmRowColumn XmCascadeButton fontList helvetica bold r 14 mincho 14 14 Cimstation XmMenuShell XmRowColumn fontList helvetica bold o 14 mincho 14 14 and add the following resource Cimstation XmText columns 10 5 Start SilTools The user should be able to enter local language into text fields Loc alizing SilTools Panels 1 Start SilTools 2 Generate the localization header file to_localize under the template directory and the localization data files under z cim gui locales to_localize by executing the SIL a5 5 o command SpE gue SIL gt to_localize 252 2u Develo
65. ation The widget toggle associated with a list of container widgets automatically displays the appropriate container widget_toggle is a subclass of toggle_mnode associating a container widget with each toggle item such that selecting a toggle item causes the associated container to be displayed and the remaining containers to be hidden If these containers are in the tool_body class selecting the toggle item will activate the associated tool_body mk_widget_toggle mn toggle_mnode cnts list of mnode To install new container widgets use this procedure install_new_widget_toggle_entries mn mnode cnts list of mnode To add container widgets use this procedure add_widget_toggle_entry mn mnode cnts mnode add_widget_toggle_entry mn mnode cnts mnode index integer To remove container widgets use this procedure remove_widget_toggle_entry mn mnode cnts mnode remove_widget_toggle_entry mn mnode index integer The common panel organization has a toggle widget at top under which multiple container widgets are stacked on top of each other with only one being visible at a time SilTools Advanced Widget Programming Examples Example 6 7 illustrates simple shape picking and adding a shape field to a panel to 8 DG t 32 Eps O Do 2 gt A Developer s Guide 6 21 7 96 Programming the User Interface Example 6 8 illustrates speedup shape picking and
66. bal SIL variable The value of this variable will be saved and restored 6 32 SilTools Customizing the Application Example 6 13 function mk_test_layout_settings setting begin mk_test_layout_settings std_mk_layout_settings test_layout list mk_panel_geom_setting test1_geom itest test1 nil nil mk_panel_geom_setting test2_geom itest test2 test2_pos test2_xt mk_panel_pos _setting test3_pos itest test3 test3_pos mk_global_var_setting test_var end the_layout_constructor mk_test_layout_settings To relocate the Quick Access you need to add the following code to top_init sil base_rolodex top_init newx newy as pnt2dr base_rolodex top_loc newx newy 8 as pnt2dr moveto ikern rolodex base_rolodex top_ init where newx and newy is the new location of the Quick Access Customizing the Start Up Screen The start up screen is displayed while the menus are initializing The start up screen can be configured in the file cim templates lt product gt startup msg The format is as follows FONT lt STRING gt Sets the font Example FONT adobe helvetica bold r normal 12 120 75 75 p 70 iso0o8859 1 TEXTCOLOR lt STRING gt Sets the text color Example TEXTCOLOR blue o So Do cos EL fe S Do 2 gt a Developer s Guide 6 33 7 96 Programming the User Interface 6 34 FOREGROUND lt STRING gt Se
67. be the major subdirectories of cim cim templates This directory contains all the SilTools products A product contains an executable version of a CimStation state Usually a product is started by using the Product Administration panel which is displayed by entering sspa in a shell window To start the product lt product gt you can also use the following commands SIL gt cd cim templates lt product gt SIL gt start Each product contains a umodules file The umodules file specifies which modules are included in the product and which versions of those modules should be used Each line of the umodules file contains a module name followed by a version name For example the umodules file of a product might consist of the two lines conveyor conveyor2 press press3 This signifies that version 3 of the press code is to be included in this product cim sil lt modules gt All SIL code resides in this directory The notation lt modules gt indicates that there is one subdirectory of cim sil for each code module cim mccode lt modules gt All C code resides in this directory including both C code generated from SIL and C code written by hand Developer s Guide 11 3 7 96 O 8 D z d E 5 Working with SILCode cim mhfiles lt modules gt The header h files for C code generated from SIL are stored in this directory cim actions lt modules gt This dir
68. cified If you omit position it is assumed to be 0 0 0 Likewise if you omit orientation it is assumed to be 0 0 0 For added convenience a pose may be specified with six numbers The first three indicate the Cartesian position and the last three indicate the yaw pitch roll orientation mk_pose lt xc gt lt yc gt lt zc gt lt yaw gt lt pitch gt lt roll gt 3 16 SilTools Geometric Operators This Cartesian yaw pitch roll description is the default of poses used in SilTools Example 3 2 Some examples specifying poses are mk_pose mk_sph 1 2 3 mk_ypr 90 0 30 mk_pose position_1 mk_xyz 30 45 0 mk_pose table_orientation mk_pose 30 50 74 2 90 90 0 As an aid in visualizing poses they can be displayed as frames using the show command show lt pose gt The specified pose will be displayed as a frame whose origin is the point specified by the position component of the pose and whose axes represent the orientation component of the pose Poses displayed with the show command remain visible as frames only temporarily they disappear the next time the graphics display is updated gt D fo 0 a 8 a Geometric Operators All positions orientations and poses are absolute In other words the assumed reference is the Universe frame whose pose is the null absolute pose described in Cartesian and yaw pitch roll terms as 0 0 0 0 0 0 You may find it convenient to th
69. command 4 4 operations 4 5 recursion 4 6 reverse operator 4 5 select operator 4 5 set_car procedure 4 5 set_cdr procedure 4 5 type 4 4 load_panel command 6 10 local environment 1 9 2 6 2 7 local variable declarations 2 4 logo 6 31 lowercase operator 4 13 Ipoint type 11 27 lrecords 4 20 9 12 11 23 heapval 1 24 objects compared to 5 1 passing to C 11 27 stackval 1 23 syntax for 4 20 Istack 5 24 Istrings 4 15 4 16 9 17 mk_static_Istring function 9 19 M make_prompt function 6 26 match operator 4 14 memory allocation 4 13 memory area 1 23 Menu Mode 11 16 11 22 message displaying a message in a pop up box 6 26 send_message command 5 3 messages 10 12 messages queue 10 10 10 11 meta programming 1 1 metaobjects 9 1 metatypes 1 4 9 1 method definition 5 3 method abstract class SilTools apply using method instead of 5 23 define_method command 5 24 5 25 fields 5 20 pop method 5 23 primitives 5 23 push method 5 20 set_method command 5 24 task declaring as 5 25 tmethod 5 25 underflow 5 22 mk_aax command 3 13 mk_application function 9 12 mk_array_type function 9 3 mk_bsurf operator 8 8 mk_cap operator 8 4 mk_circle operator 8 2 mk_circular_arc operator 8 10 mk_cnsurf operator 8 8 mk_crt command 3 5 mk_cstring function 9 18 mk_cyl command 3 6 mk_ellipse operator 8 3 8 10 mk_file command 2 16 mk_function_type function 9 3 mk_general_gtool constructor 6 15 mk_global_var_setting command 6 32 mk_
70. cts of widgets appearance and behavior Every widget has a panel view for visual representation Appearance Appearance is defined as how the widget will be displayed on the screen There are two categories container widgets widgets with children and primitive widgets leaf widgets Table 6 1 describes the kinds of container widgets Widget Kind Description top_panel_kind Main top level window top panel item_panel_kind Secondary top level window item panel top_bar_kind Top bar menu menu Imenu_kind Pulldown menu menu Table 6 1 Container widgets So 3 Dos cos EL Epe S Do a Developer s Guide 6 1 7 96 Programming the User Interface Widget Kind Description xcontainer_kind xscroller_kind Lower level window subpanel Scrollable lower level window scroller Table 6 1 Container widgets continued Table 6 2 describes the kinds of primitive widgets Widget Kind Description xbutton_kind xswitch_kind xchoice_kind xtoggle_kind xcombo _ kind xfield_kind xslider_kind xlist_kind xtext_kind xcanvas_kind xlabel_ kind xseparator_kind Push button command button panel button menu button message button and select button Two state toggle switch Multiple state toggle choice Multiple state toggle toggle Multiple state toggle combo For alphabetic numeric input field For numeric input slider Multiple entry
71. d C file to the end of cim builds lt version gt new_c_code The next time the module is remade the code file in question will be re compiled Finally to rebuild a product use gt rbuild lt product gt For example gt rbuild tedsproduct Again to create a completely new product use newproduct lt product gt After these products and files have been created and the relevant compiles and remakes have been done the rbuild command will complete the process After rbuild is finished the start command starts up the product The rbuild command may be used repeatedly on the same product as modifications are made and compiled into that product Creating New Versions 11 10 This section describes the process of adding new versions of a module to the original module For example suppose we wish to add enhancements to the ted module without disturbing the working version ted1 A new version of module ted may be created using gt newversion ted ted2 SilTools Including Modules and Products in the Product Administration Panel This command will set up the directory cim builds ted2 with contents that are initially identical to those of ted1 Suppose next that we create a new version of our file1 sil SIL file and call it f ilel_2 sil This new version should be placed in cim sil ted the same directory in which file1 sil resides To compile it use SIL gt compile ted ted2 file1_ 2 To include file1_2 sil in ted2 y
72. data variant is allowed Developer s Guide 2 11 7 96 The Basics 2 12 Polymorphism Tricks You can define your own variants of system defined functions This introduces some interesting possibilities For example the parser parses infix operators to prefix operators By defining custom variants of these prefix operators you can take advantage of the infix syntax see Example 2 9 The printer in the read eval print loop of the SIL control loop is called tprint Defining your own variant of tprint causes your printer to be invoked each time SIL prints one of your objects see Example 2 10 SilTools Input Output Input Output This section contains the following topics gt Reading from the Keyboard gt Writing to the Screen gt Reading and Writing to a File gt EOF Presenting SIL I O capabilities consists mainly of listing conventions which because of their simplicity need no explanation For this reason this section contains a series of annotated examples These examples will serve to demonstrate how to use the I O conventions and in what context n gt D G m o lt n Reading from the Keyboard More specifically read x causes the next token in the input stream to be read in The type of x must be string integer real id or lispob If the token can be interpreted as a data item of the kind indicated by the type of x then x will be assigned this value otherwise an error will occu
73. data_variant operator 9 14 deactivate procedure 10 6 debug_frame variable 11 19 debugging 11 16 call stack 11 16 error break 11 20 Error gt prompt 11 16 patching a function 11 18 pause break 11 20 ppause command 11 20 to_text_mode_on_error flag 11 22 Developer s Guide 7 96 Index trace back 11 16 define_method command 5 24 5 25 definitions 1 12 1 19 delay command 10 2 delayed tasks 10 4 delete_group command 6 25 dependencies 11 12 11 15 dispatch 2 5 dispatch procedure 9 7 dispatch procedure 9 9 dynamic list 4 3 E early binding see bindings early 9 9 early binding mechanisms 1 6 ellipse adding 8 3 8 10 ellipsoid operator 8 11 empty lists 4 4 emptysarray command 4 11 end effectors 3 10 environments global 1 9 local 1 9 2 6 EOF 2 18 equivalent angle axis 3 9 3 13 3 15 erb type 9 15 error break 11 16 11 20 error procedure 2 5 Error gt prompt 11 16 Euler angles 3 9 3 12 see also geometry ev command 11 19 11 20 execute function 9 12 F facet adding 8 4 facet operator 8 4 field selectors 1 13 file il extension 11 5 ASCII 2 16 c files 11 23 INDEX 3 Index compiling 11 9 directories and organization 11 2 h files 11 4 11 23 header 11 4 initialization 11 5 loading 11 5 reading 2 16 2 17 writing to 2 16 file browser 6 25 filter function 6 8 find_variant function 9 14 focal procedure 7 2 footers 6 5 6 10 for statement 1 17 1 18 forward referencing 1 22 2 8 frame 3
74. ding when active even if it does not contain tools which bind the mouse buttons a panel which does not have browser shape fields or gtools does not need nor should have a tool set To turn a panel into a tool set use mk_tool_set mn mnode To turn a container into a tool body use mk_tool_body mn mnode ts tool_set SilTools Advanced Widget Programming Binding a Mouse Button The bind_button command is used to add a tool to either a tool body or the tool set as the default tool function bind_button mn mnode bt integer shs shape_selector where bt is always the middle_button 2 function bind_button mn mnode gt gtool Controlling which Tools are Active This procedure activates the given body that is this body will replace the current body if any set_body ts tool_set tb tool_body Tool Setand Tool Body Methods Two methods are called when the tool set and tool body are activated and deactivated at_activate called when the tool set or tool body is activated at_deactivate called when the tool set or tool body is deactivated Specifying Tool Actions for Graphics Tools The action taken by each kind of tool is specified by defining its execute method For a shape click tool the execute method will be run when the mouse button is released When the execute method is run the following occurs E The pos field is filled in with the scree
75. dius from the origin of the reference frame its angular distance from the X axis longitude and its angular distance from the XY plane latitude X Y Figure 3 6 Spherical coordinates Use the type sph to construct a spherical position using this command and syntax gt D Z fo 0 8 a mk_sph lt rad gt lt Ing gt lt lat gt Developer s Guide 3 7 7 96 SiTools Geometry Orientation Orientation is a property of objects that describes how the object s frame is aligned relative to a reference frame Orientation is specified in terms of rotations of the object s frame about the axes Reference Frame Reference Frame Copy Z 2 Z obj Y obj x y X obj Figure 3 7 Orientation With the two frames initially coincident the rotations are performed in a specific order to arrive at the stated orientation Using a copy of the reference frame is important to prevent inadvertent position changing That is if the rotations are conducted about the axes of the reference frame itself the position and the orientation will change Figure 3 8 Frame rotated about Y axis 3 8 SilTools Orientation Using SilTools there are three main ways to specify the rotations that describe the orientation of a frame M Sequential rotations of the frame about the fixed X Y and Z axes of the reference frame copy called yaw pitch roll E Sequential rotations about the X Y and Z axes of the frame
76. e 7 96 pcurvelist pcurve pcurve Modeling Using SL Commands Surfaces Cap angle 0 to 360 degrees creates partial cap The edge of a partial cap starts at x lt radius gt y 0 sweeps counter clockwise lt angle gt degrees around the Z axis and has an additional edge to close the polygon resolution number of facets in cap if omitted c_circ_res is used Operator Resulting Shape mk_cap lt radius gt lt angle gt circular polygon mk_cap lt radius gt lt angle gt lt resolution gt circular polygon Facet The first three points establish the plane of the facet and all points specified subsequent to them must lie in that plane Order the points in the counterclockwise direction looking toward the facet from its outside This establishes the direction of the facet s normal Operator Resulting Shape facet list lt point1 gt lt point2 gt lt point3 gt convex planar L lt pointn gt polygon facet array lt point1 gt lt point2 gt lt point3 gt convex planar L lt pointn gt polygon SilTools 8 4 Plane Surface n normal d distance to origin sz extents pl plane structure Modeling Constructors Operator mk_plsurf n dir3dr d sz real mk_plsurf n dir3dr d real mk_plsurf pl plane Grid Surface g point grid ng normal grid Resulting Shape plsurf plsurf plsurf Operator Resulting Shape mk_gsurface g ng grid makes grid g
77. e integer employee begin mk_employee mk_employee name jones age 30000 00 end 4 18 SilTools Records and Irecords lrecords Record parameters are passed by value This means that a function procedure that is passed a record as an input actually makes a private copy of the record input before it modifies any of its fields In SIL records are used to represent non mutable entities such as vectors complex numbers etc In Example 4 22 a record is used to represent a complex number n Q Q gt a m Developer s Guide 4 19 7 96 Data Types In SIL Irecords are used to represent mutable structures like employees An Irecord is just a pointer to a record trecord parameters are passed by reference rather than by value This means that a function procedure only gets a pointer to an Irecord not a private copy 4 20 SilTools Chapter 5 Classes Object Oriented Terminology This chapter describes classes objects inheritance how objects are viewed relative to each other and how to manipulate the views Object Oriented Terminology An object is similar to an Irecord Wherever an Irecord might be used an object can also be used Thus objects can be used to represent entities with mutable properties such as devices people factories organizations etc The main feature that distinguishes objects from lrecords is inheritance Briefly two objects A and B belo
78. e contents of the current directory ib file _no_lib The user will not be given the option of changing directory ib_file_save_confirm Prompts the user to confirm his selection if the file already exists This is used only when ib_file_save is set Developer s Guide 6 25 7 96 o dD z d fe o f3 amp m o p I a D Programming the User Interface Example 6 10 This example illustrates how to save data collected from a simulation procedure save_my_data filename string pathname string begin This is where I save it end ib_pop_file mymodule mypanel Save Simulation Data simulation data data sim_data save_my_data ib_file_save ib_file_save_confirm Requestor and Message Panels Pop Up Boxes Pop up boxes are modal panels which prevent the user from taking further action until the pop up box is dismissed Pop up boxes can display messages present choices and request information make_prompt string intf_prompt info_dialog list of intf_prompt Display a message for the user to acknowledge make_prompt message string intf_prompt Constructs an intf_prompt info_dialog message list of intf_prompt Displays a message in a pop up box that the user must acknowledge Program execution is halted until the user clicks OK 6 26 SilTools Requestor and Message Panels sure list of
79. e_methods is the typical primitive to use rather than the more direct and low level set_method construct For example our implementation of Istacks might include the following Example 5 24 define_method astack Istack push push define_method astack Istack empty empty define_method astack stack pop pop function mk_Istack var a astack lstack begin a mk_astack mk_Istack a emptylist ob use_methods a Istack end When the abstract and concrete methods have the same name you need not repeat the name in the set_method or define_method construct For example define_method astack stack push 5 24 SilTools Abstract Classes is equivalent to define_method astack Istack push push and set_method a push list Istack is equivalent to set_method a push push list Istack Finally define_methods astack stack means that the standard astack methods associated with Istack are those operators on Istack with the same names as the astack methods So define_methods astack stack is equivalent to define _method astack Istack push define_method astack Istack empty The pop method does not get installed by define_methods because ipop is the abstract method name while pop is the implementation name To remember the argument order for the above primitives an easy rule is Abstract information always precedes the concrete information in the argument order
80. ecord field or an es ke e m ke c oo l array component o o lt fe c fe oO gt xo e 5 Compound statements are built up from atomic statements using statement constructors There are three categories of statement constructors conditionals and case statements sequences and iterations see Rule 1 5 gt ry lt compound statement gt lt conditional gt lt case gt lt sequence gt lt iteration gt Sequences are groups of statements that are combined into a single statement by bracketing them between the key words begin and end Rule 1 6 lt sequence gt begin lt statements gt lt statement gt end The format of a conditional statement is expressed in Rule 1 7 lt conditional gt if lt test gt then lt action1 gt else lt action2 gt where lt test gt is a Boolean valued term and lt action1 gt and lt action2 gt are arbitrary statements Note that the else clause is optional Developer s Guide 1 15 7 96 Introduction to the SIL Language If lt test gt evaluates to true then lt action1 gt is evaluated otherwise lt action2 gt is evaluated Example 1 6 If x and y are real valued variables then the following statement assigns the absolute value of x to y if x gt 0 then y X else y X A typical programming error occurs when lt action1 gt is itself a conditiona
81. ectory contains auxiliary information needed for SIL code It is generated automatically by the translator and need not concern the user cim builds lt versions gt There is one subdirectory of cim builds for each version of a module Each version directory under cim builds has the following files sil_files A file listing the names of SIL files in the module c_files A file listing the names of hand written C code s A link to cim sil lt my module gt mc A link to cim mccode lt my module gt mh A link to cim mhfiles lt my module gt a A link to cim actions lt my module gt For example the following directories might exist in the press module cim sil press cim mccode press cim mhfiles press cim actions press along with three versions cim builds press1 cim builds press2 cim builds press3 A few other directories may be present in any cim tree but they are immaterial to the users of this manual 11 4 SilTools Loading SIL Code Loading SILCode SIL files should be named with a sil extension To load a file containing SIL code use this syntax SIL gt _ sil_load lt pathnames gt For instance SIL gt _ sil_load mysil application1 sil A shorter form is SIL gt _ Id lt pathname without extension gt For example SIL gt _ Id mysil application1 sil_load commands may appear inside of files loaded using sil_load This allows you to set up initialization sequ
82. ences of arbitrary complexity a master initialization file might load a series of files which in turn load other files and so forth Creating a New Product The following is a step by step description on how to create a new product 1 Enter this command in a shell window newproduct lt product gt This script will create the following directory cim templates lt product gt file cim templates lt product gt top_init sil file cim templates lt product gt base file cim templates lt product gt umodules directory cim gui help lt product gt Developer s Guide 11 5 7 96 O iS D r z d E 5 Working with SILCode top_init sil contains special initializing information for a product base are the layout configurations for the product umodules initially empty lists the modules comprising the product cim gui help lt product gt is a directory to hold online help files Create at least one new module so there is a place to put code specific for this product To do this enter newmodule lt module gt lt first version gt newmodule creates directories for the module as well as the first build area to include in the new product Add the following line to the file cim templates lt product gt umodules lt module gt lt first version gt Copy the top bar panel from cim gui panels mgui into the new module s panel area by entering cp cim gui panels mgui top_bar
83. ent to u mk_universal 3 as_type lispob integer Developer s Guide 9 7 7 96 Advanced Data Types Furthermore as_type can be used to cast u back to an integer Assume var n integer then n u as_type integer If u were not an integer the above statement would generate an error Applying Procedures 9 8 To write a dispatch procedure using universals we need to answer one more question assuming that all parts will be represented as universals how do we apply the appropriate assemble procedure This is accomplished with the apply operator function apply op id arg1 arg2 universal where op is the name of an operator and arg1 arg2 are the arguments to op For example Example 9 3 apply plus 3 as_type universal 4 as_type universal will return 7 tagged as a universal while apply plus 1 2 3 as point as_type universal 2 4 6 as point as_type universal will return the point 3 6 9 as a universal SilTools Applying Procedures Another example Example 9 4 function twice x universal universal begin twice apply plus x x end will double any type of input The apply operator will generate an error if no appropriate variant is found The arguments to apply need not all be universals For example the following arguments used with apply would be successful apply plus 3 as_type universal 4 The apply operator prov
84. eometry Euler Angles Euler pronounced oiler angles are named after a Swiss mathematician Leonhard Euler 1707 1783 who contributed many important theorems to the science of kinematics Like yaw pitch roll Euler angles describe orientation by sequential axis rotations The difference is that the rotations are not about the axes of the fixed reference frame copy as they are with yaw pitch roll rotations they occur about the new axes of the frame after each rotation In general any series of three rotations in which each successive rotation is about one of the new X Y or Z axes is a set of Euler angles For example one commonly used convention is Z Y Z Euler angles An orientation given in Z Y Z Euler angles is the result of first rotating the frame about the Z axis of the reference frame copy with which it is initially coincident then rotating about the new Y axis and finally rotating about the new Z axis Many six degree of freedom robots have wrists which emulate this Z Y Z orientation The geometric type provided by SIL for describing Z Y Z Euler angle orientations is zyz Z axis Y axis Z axis A Z Y Z Euler angle orientation may be constructed with the command mk_zyz lt rotz1 gt lt roty gt lt rotz2 gt Another Euler angle set is X Y Z An orientation given in X Y Z Euler angles is the result of first rotating the frame about the X axis of the reference frame copy with which it is initially coincident
85. er describes how to create models using SIL commands The last part of this chapter provides examples of models The model Data Type All SilTools models both rigid and structured are represented internally with the same data type model The model data type is a data structure with fields for the following 1 The name of the model This name is used during a simulation to refer to the model and its components Names are always given as strings Its kind rigid or structured The model body The color of the body Pointers to the model s submodels if any PWN Modeling Constructors Because SilTools models are represented by their boundaries which are in turn limited to vertices edges and facets you will need only a few basic constructors to build even the most complex models For convenience you may build more sophisticated constructors out of these basic ones SilTools provides some of these more sophisticated constructors you can create the others using the following examples as guides The World coordinate frame is the base coordinate system used by all the modeling constructors For this reason all geometric values specified in the constructors are absolute values Most constructors Developer s Guide 8 1 7 96 D a 9 36 JE De 36 BT 2 0 Modeling Using SL Commands return models centered on the origin of the World coordinate frame They may be transformed to new locations with the moveto and m
86. erations 2 20 string changing to a symbol 2 20 system defined types 1 10 4 2 9 1 T tag 1 23 task 1 6 tasks 10 1 clock variable 10 3 communication 10 10 control flow 10 2 defining 10 1 delayed 10 4 instantaneous blocks 10 2 instantaneous commands 10 1 10 3 is_task function 9 3 messages 10 12 pipes 10 10 messages queue 10 10 10 11 private 10 12 waiters queue 10 10 10 11 processes 10 12 run queue 10 3 placing tasks in 10 4 Scheduler 10 3 signal command 10 7 10 11 10 12 start command 10 4 synchronization 10 6 tclosure type 10 14 temporal commands 10 1 10 2 defining 10 3 delay command 10 2 notify command 10 3 wait command 10 12 wait operator 10 7 10 11 tb command 11 16 11 18 11 19 tbn command 11 19 tclosure 10 14 is_tclosure function 9 3 tclosure type 10 14 temporal commands see tasks INDEX 12 terms 1 12 Text Mode 1 3 10 4 11 16 11 22 tickers 10 6 time 10 1 commands see tasks simulated 10 1 10 4 tmethod 5 25 to_cstring function 9 17 to_frame function 3 9 to_localize command A 1 to_text_mode_on_error flag 11 22 to_view operator 5 13 5 16 token 2 13 tool bar 6 29 tool body 6 16 activating 6 17 binding a mouse button 6 17 deactivating 6 17 tool set 6 15 activating 6 17 binding a mouse button 6 17 deactivating 6 17 tool_body class 6 20 tools graphical see gtools top bar 6 1 6 5 11 6 tprint 2 12 trace back 11 16 11 18 11 19 tracking function 7 1 tube operator 8 6 tube adding 8 6 t
87. esult in a value which SIL thinks is an rri_Irec but is really a string The consequences of such a miscast can be serious For example aa f1 4 5 will smash the memory location just after the tag in aa with 4 5 since aa is really a string whose first word past the tag is a length field Filling this field with the bits for 4 5 results in a corrupted string data structure and this in turn will generate garbage collection errors So you should be very careful when using as_type just as the C programmer needs to exercise care when using the C cast operation When a heapval i e a value which is not a record nor an integer or real is as_typed to the type lispob this amounts only to a compile time assertion of type it does not induce any actual runtime operation When a stackval is as_typed to lispob it is copied into the heap The constant NIL of type lispob can be used to represent a null or undefined value for any lispob type The predicate null x lispob boolean SilTools lispobs tests for equality to NIL nul x lt type gt boolean for any lt type gt is equivalent to null x as_ type ob So for example nul nil as_type rri_lrec will return TRUE lispob Operations Pair constructor function cons x y lispob lispob cons x y x y Pair selectors m 2 m 3 Q S gt lt function car x lispob lispob car x y x function cdr x lis
88. et up to support the maintenance of multiple versions of compiled code You should understand this structure before compiling your code All files having to do with SilTools reside under a master directory called cim The collection of all SilTools files and directories that is all the files and directories under cim is referred to as the cim tree The cim tree may be located anywhere in a UNIX file system All SilTools users should have a CIM environment variable whose value is the pathname of the cim tree It is also helpful to have a link from the home directory to the cim tree called cim The following information assumes that cim points at the cim tree Code in SilTools is divided into modules A module is simply a grouping of related code The source code for SilTools itself is spread throughout approximately 100 modules one for 2D geometry one for 3D geometry one for menu handling etc Each module may have an unlimited number of versions The SilTools tree structure is set up so that different versions of the same modules share files Each module and each of its versions has a name There are no hard and fast rules for naming the module and its versions but the usual convention is lt module name gt with a version being named lt module name gt lt version gt For instance the fifteenth version of the module geom is called geom15 SilTools Code Organization The Cim Tree Stucture The following sections descri
89. etric Shapes Use the commands in this section through page 8 14 to evaluate points tangents and normals of parametric curves and parametric surfaces Parametric Curves Given a parametric curve pe and a parametric variable t the command for evaluating the point on the parametric curve at t is pnt eval_at pc t where pnt is the point on the parametric curve pe at t The command for evaluating the tangent of the parametric curve at tis tangt tangent_at pc t where tangt is the tangent of pe at t In SilTools each shape has a frame known as its seg_pose The seg_pose of a shape is the frame that locates the shape from its default location to a desired location in the workcell Developer s Guide 8 11 7 96 Modeling Using SL Commands For example the seg_pose of a surface of revolution is at the pose of the World when it is created However when the surface of revolution is moved to another location the seg_pose is no longer at the pose of the World Note that both eval_at and tangent_at evaluate points and tangents at the default location Therefore if a parametric shape is moved to a new location and you wish to evaluate both the point and tangent with respect to this new location use the following syntax instead pnt seg_pose pc eval_at pc t tangt ornt seg_pose pc tangent_at pc t Parametric Surfaces Given a parametric surface ps and parametric variables u and v the command for
90. etween SIL and the application Sample c and h Files The remaining issue is what C declarations should be given to inputs from SIL SIL provides a facility for automatically generating such declarations Namely whenever a SIL file which contains c_imports is compiled sample c and h files are generated These sample c and h files contain these declarations and samples of their use The sample files are placed in O 8 D z d E 5 cim mccode lt filename gt _sample c Developer s Guide 11 23 7 96 Working with SILCode and cim mhfiles lt filename gt _sample h These sample files are meant to be copied to your own files with different names so that they will not be overwritten where the function bodies will be filled in The include line in the c file which mentions the sample h file should be changed Alternatively the sample files may be used solely as documentation The types which will appear in the sample h file will include all those referenced in the c_import commands not just those that happen to be defined in the file containing the c_import commands 11 24 SilTools Calling C Code from SIL 5 O S 72 E D E b O Developer s Guide 11 25 7 96 Working with SILCode 11 26 SilTools Calling C Code from SIL Passing Data Types to C Passing Records to C Records as well as Irecords can be passed to C Records are pas
91. filter method ifilter method if any determines which shapes are legal selections If no filter method is defined a default filter is used which screens out shapes which are internal parts of a compacted model If a value for a shape field is picked in the Graphics Window the value returned is the nearest ancestor which satisfies the filter Again if no filter is specified the tree is climbed to the nearest ancestor which is not a component of a compacted model A shape field is created by first creating a selector widget using the Visual SIL Window and then applying either global_getob_kind or global_browser_kind to add the shape selection functionality In each case a shape_selector view is spliced onto the selected mnode To create a shape field use mk_shape_field selector_widget mnode knd integer bt button mnode left_button middle_button To add highlighting such that the shape field s value is shown graphically use function mk_hl_shape_field selector_widget mnode hl_shape_selector When a shape is deleted from the World a shape field which previously had the shape as current value may substitute it with another A ts oe fs E2 ERS JF ke ai o5 Developer s Guide 6 13 o 7 96 Programming the User Interface To add re initialization if shape is deleted use function mk_initializing_shape_field selector_widget mnode a_closure closure ob initializing s
92. finitions This is expressed as Rule 1 2 lt expression gt lt term gt lt statement gt lt definition gt Tems There are three types of terms in SIL constants variables and function applications This is expressed as Rule 1 3 lt term gt lt constant gt lt variable gt lt function application gt Terms represent values lispobs although some function applications will also modify an environment as a side effect The general form of a function application is lt operator gt lt term gt lt term gt where lt operator gt is the name of a function The terms appearing inside of the parentheses are referred to variously as the inputs arguments operands or actual parameters Notice that operands can also be function applications Example 1 3 Constants 2 1 1 pi a_symbol a string nil true false Variables x room_temperature part35 Applications sin pi max 2 x mod trunc sin x 50 SilTools The SIL Runtime Model In addition to the general form of a function application there are some special forms Most notable is the case of infix operators which use the form is 0 of G a o dp E oOo amp 5 O S5 lt term gt lt operator gt lt term gt Other examples include special syntax for accessing fields of records and components of arrays as illustrated in Example 1 4 Evaluating a term containin
93. g multiple special operators can be ambiguous For example the term 5 34 2 might evaluate to 0 or 4 depending on which operation is performed first Similarly the term not true or true Developer s Guide 1 13 7 96 Introduction to the SIL Language might evaluate to true or false depending on which operation is performed first Of course you can dictate the order of evaluation by inserting parentheses at appropriate places in terms In the absence of parentheses the interpreter uses precedence rules similar to those used by Pascal to decide the order of evaluation For example unary operations and not are always performed first and and are performed before and or Statements Generally a statement alters an environment Statements can be grouped into atomic statements and compound statements lt statement gt lt atomic statement gt lt compound statement gt Atomic statements are assignment statements and procedure applications The form of an assignment statement is lt variable gt lt term gt The form of a procedure application also known as a procedure call is the same as that of a function application lt operator gt lt term gt lt term gt where lt operator gt names a procedure instead of a function SilTools The SIL Runtime Model Assignment statement form varies For instance the left hand side of the symbol can be a term that references a r
94. ger by string_to_integer lt string gt Conversely an integer can be converted to a string by integer_to_string lt integer gt Similarly we can convert reals to strings and back with real_to_string lt real gt and string_to_real lt string gt SilTools Strings Other Operations on Stings The function indx x string n integer integer extracts the nth character from the string and returns its ASCII code The following function setindx x string n v integer will set the nth character to v ASCII indx and setindx start at zero that is indx x 0 is the first character in the string The function mk_string n integer string returns a string of length n 1 A string is represented internally as a contiguous array of bytes indx and setindx give direct access to this representation Strings can of course be used to describe things other than sequences of textual characters For example digitized images with 8 bits per pixel can be represented by strings Strings can be as large as will fit in the process space of the computer running SIL For some applications strings of several megabytes of length will be needed Here are some other operations N o gt Ee s function copy x string string function substring x string n m integer string function length x string integer substring x n m returns the substring of x of length m starting at the nth character Istings Consider t
95. gin to the positioned point Position Vectors Figure 3 3 Position vectors A point s position is specified by its reference frame coordinates SilTools provides three useful coordinate descriptions Cartesian cylindrical and spherical 3 4 SilTools Understanding SilTools Geometry Cartesian Description The most common is the Cartesian description where the point s coordinates are its X Y and Z distances from the reference frame s origin Cartesian coordinates Figure 3 4 Cartesian coordinates Use the type ert to construct a Cartesian position using this command and syntax mk_crt lt xc gt lt yc gt lt zc gt gt D Z fo 0 8 D or mk_point lt xc gt lt yc gt lt zc gt Developer s Guide 3 5 7 96 SiTools Geometry Cylindrical Desc ription Another type of position is the cylindrical description in which the point s coordinates are its angular distance from the X axis measured counter clockwise in the XY plane of the reference frame its radius normal to the Z axis and its height along the Z axis Z Theta X Radius Figure 3 5 Cylindrical coordinates Use the type cyl to construct a cylindrical position using this command and syntax mk_cyl lt rad gt lt theta gt lt zc gt 3 6 SilTools Understanding SilTools Geometry Spherical Description The final description is spherical in which the point s coordinates are its ra
96. ging in Menu Mode This section discusses debugging code which causes errors while you are still using the menus and panels The SIL flag to_text_mode_on_error controls what happens when an error condition is encountered in Menu Mode When the flag is set to true any error encountered by the system will cause SilTools to switch to Text Mode automatically and display the ERROR gt prompt This flag is useful when tracking bugs The default setting of the flag is false When it is set to false errors are reported but panels stay up and no error prompt results Calling C Code from SIL 11 22 This section describes how C code can be called from SIL Topics in this section are gt Sample c and h Files gt Passing Data Types to C The procedure for including hand written C code ina REMINDER module was discussed in Loading SIL Code on page 11 5 The following command imports the given C function and assigns it the given SIL type c_import lt function name gt lt type gt For example c_import foo map integer integer will import a C function foo on integers After that process is complete foo can be treated just like any other SIL function on integers it can be called freely from SIL code as in SIL gt fori 1 to 10 do writein foo of lt i foo i SilTools Calling C Code from SIL The only restriction is that the SIL file in which the c_import occurs must be compiled not interpreted Fu
97. graphically Before using the information on shape selectors selector widgets need to have been created using the Visual SIL Window Graphics tools can only be created by programming Using the Visual SIL Window is described in Chapter 7 NOTE Customizing the Menu Interface in the Si Tools User s Manual available from SILMA Division of Adept Technology Inc Shape Fields and Graphics Tools Shape Fields Shape fields are widgets that enable shape picking inside panels gtools differ from shape fields in that they support more general interactive graphics operations There are two kinds of shape fields global_browser_kind and global_getob_kind A global_browser_kind This is the kind for shape processors which are wired to the middle mouse button this is also called speedup The selector widget binds a mouse button always the middle button whenever the selector is active That is when this selector is up and active selecting an object in either the So 3 Dos cos EL Epe S Do a Programming the User Interface Quick Pick Window or Graphics Window automatically changes the selector s value there is no need for the user to click the selector global_getob_kind This is the kind for shape selectors which borrows the mouse temporarily Clicking on the selector widget puts the interface into getob mode In getob mode the user must select a shape or cancel The left mouse b
98. group command 6 24 mk_group_gtool constructor 6 15 mk_gsurface operator 8 5 mk_hl_shape_field command 6 13 mk_hyperbola operator 8 3 8 10 mk_initializing_shape_field command 6 14 mk_list_type function 9 3 mk_panel_geom_seiting function 6 32 mk_panel_pos_ setting command 6 32 mk_parabola operator 8 3 8 10 mk_plsurf operator 8 5 mk_point command 3 5 mk_point operator 8 19 mk_pose command 3 16 mk_pspline operator 8 10 mk_psurf operator 8 11 mk_rbspline operator 8 3 Developer s Guide 7 96 Index mk_rbsurf operator 8 7 mk_rctcurve operator 8 2 mk_rsurf operator 8 23 8 24 mk_rvsurf operator 8 6 8 23 8 24 mk_rvsurf_shape operator 8 9 mk_shape_click_gtool constructor 6 14 mk_shape_field command 6 13 mk_sph command 3 7 mk_static procedure 9 19 mk_static_Istring function 9 19 mk_string operator 4 15 mk_ticker function 10 6 mk_tmp_group command 6 24 mk_tool_body command 6 16 mk_tool_set command 6 16 mk_universal constructor 9 7 mk_widget_toggle function 6 20 mk_xyz command 3 12 mk_ypr command 3 11 mk_zyz command 3 12 mnode class 6 1 6 6 mnode view 6 3 see also panels and widgets mnode view 6 3 model data type 8 1 model operators 8 14 modeling constructors 8 1 8 11 8 19 8 24 examples 8 19 IGES file converting to 8 18 IGES models converting with text 8 17 link example 8 19 wireframe 8 12 module creating a new 11 7 11 11 definition 11 2 version creating a new 11 10 monitors 6 8 mouse button 6 14 binding 6 17 pr
99. gt least list ab abcd e hello shorterc iS Note that least list ab abcd e hello shorter would not work shorter is a function not a data value Besides if there were more than one variant of shorter you could not easily determine which version is meant SilTools Polymorphism Polymorphism General Infomation Consider the following SIL code 2 7 function twice x integer integer E begin twice X X end function twice x string string begin twice X x end In Pascal these two definitions could not coexist but they can in SIL because of a feature called polymorphism A polymorphic typing system permits one name such as twice to name several objects at the same time as long as the objects have distinct types and as long as a selection of which object is meant by the name can be made based on the context in which the name appears We call objects having the same name variants of the name When SIL encounters a name applied to a list of arguments as in twice hello it looks through the function variants of twice to find one whose input types match the types of the arguments In this case the second version of twice above is selected A name can have a data variant as well as function variants For example twice twice can be added without disturbing the meanings of twice as a string or integer function Only one such
100. h exist localization will be done for those data files under cim gui locales SCIM_LOCALE which are listed in to_localize Appendix 2 SilTools Index A aax geometric type 3 13 abstract class facility 5 19 5 27 astack 5 19 C 5 23 concrete classes 5 19 method see method actions directory 11 4 actions tool 6 17 activate procedure 10 6 add_group command 6 24 add_monitor procedure 6 8 add_panel_to_toolbar command 6 29 add_widget_toggle_entry procedure 6 20 ambiguity 5 15 anno_ types 6 28 annotated types 6 27 announce_click procedure 6 7 announce_number procedure 6 8 appearance 6 1 application solutions 11 15 applications 9 11 apply operator 1 4 9 8 9 11 failure testing 5 17 method using instead 5 23 view changing and 5 16 applyn operator 5 17 9 11 arc operator 8 2 ARRAY_BODY macro 11 27 array_of constructor 4 1 arrays 4 8 4 10 11 23 2D 4 8 array_create command 4 8 carray 9 16 components 1 13 creating 4 8 integer 4 1 is_array function 9 3 length operator 4 10 mismatch error 4 8 passing to C 11 27 resizing dynamic 4 9 sarray 4 11 Developer s Guide 7 96 Index syntax for 4 8 as_type operator 9 4 9 6 9 12 efficiency of 9 13 as_view operator 5 13 5 16 ASCII code 4 15 ASCII file 2 16 assignment statements 1 14 atomic statements 1 14 authorization 11 1 autolevel procedure 7 2 B base_rolodex top_init command 6 33 Bezier curve 8 10 Bezier patch 8 11 bind_button command 6 17 binding time
101. hape_selector The initializing _shape_selector has a reinit closure which when called should return the new value initializing _shape_selector reinit shape closure ob To add the multiple selection option use function set_supports_multi selector_widget mnode is_multi boolean Graphics Tools Graphics tools gtools are entities which support general graphics operations and can respond to mouse activity within the Graphics Window gtools assign meaning to a click or drag in the Graphics Window but not the Quick Pick Window By convention gtools are always bound to the left mouse button While there is no widget associated with the gtool they can easily be added to a panel and hooked up much in the same way as shape selectors There are three kinds of gtools shape click tools group tools and general tools Shape Click Tools Tools whose action is determined only by the position of the mouse when the button is released Such a tool will fill in the shape_of field with the shape under the mouse A shape click tool is created with the constructor function mk_shape_click_gtool name id gtool The operation to access a shape click tool is function is_shape_click_gtool gt gtool boolean 6 14 SilTools Developer s Guide 6 15 7 96 Advanced Widget Programming Group Tools Tools that act on a group defined by dragging Here the tool is activated when the mouse
102. he following assignments x abcdffg X substring x 2 3 Developer s Guide 4 15 7 96 Data Types 4 16 These assignments result in the value of x being bed The SIL interpreter will construct a new three character string for the second assignment Repeated assignments like these can result in an inefficient consumption of memory To combat this problem SIL provides an Istring which can be defined as follows Istring irecord length integer contents string end The length of the contents field of an Istring is called its capacity The idea behind this is that only the first length lt Istring gt characters of contents lt Istring gt are meaningful The remainder of contents lt Istring gt is spare storage which may be used if the Istring grows in length For now we just list some of the primitive operations on Istrings None of these except copy allocates new memory they all re use existing storage Primitive operations on Istrings function mk_Istring x string Istring function mk_Istring x string n integer Istring function copy x Istring Istring Allocates a new string function substring x Istring n m integer Istring function select x Istring n m integer Istring function equal x Istring y string boolean function select x Istring y integer procedure lowercase x Istring procedure concat_onto y string x Istring function I
103. he sarray and s i lt term gt sets the index i component of s to be the value of lt term gt Also like arrays lt term gt must match the base type of s or a type mismatch error will occur N o Qa gt Ee m The command emptysarray lt type gt returns a new sarray The command sarray_create lt type gt lt integer gt returns an sarray with some number of elements already allocated Developer s Guide 4 11 7 96 Data Types Strings 4 12 This section contains explanations and examples of the following topics gt String Comparisons gt String Conversions gt Other Operations on Strings gt Istrings Strings are dynamic in SIL SilTools Strings In the above example we assign a length 7 string goodbye to the same variable Memory allocation for the additional characters is handled automatically Of course shorter strings can be assigned to msg msg bye Example 4 15 illustrates other string operations no Q Q gt a m Developer s Guide 4 13 7 96 Data Types 4 14 String Comparisons In SIL users make lexicographical comparisons using the syntax lt string gt lt lt string gt Additionally we can compare strings using lt gt gt and lt gt The match operator compares strings that may contain wildcards String Conversions A string composed of numerals can be converted to an inte
104. hen the interpreter finishes evaluating the body of the function procedure When the function procedure is called again a new local environment is created Nested Definitions SIL does not permit nested definitions The only exception to this rule is in the case of variable declarations which can occur inside of procedure function definitions This is a significant departure from Pascal which allows type and function procedure definitions to be nested inside of other function procedure definitions Because SIL does not permit nested definitions all user level support function procedures are defined in the global environment and can be called from the top level control loop just like their user level client Developer s Guide 2 7 7 96 The Basics Recursive Functions and Procedures A recursive function or procedure is a function which calls itself Recursive functions can cut through complex programming problems by repeatedly dividing a problem into smaller versions of itself Because a recursive function calls itself the system must know something about the function before the function is defined This can be accomplished by using what is known as a forward reference A function type and therefore variable declaration has the form function lt output type gt lt input type 1 gt lt input type n gt 2 8 SilTools Procedures and Functions Example 2 7 is a traditional example of a recursive function N o
105. ides what is called late binding Late binding means that the decision as to which variant of a function is designated by a function name is made at the latest possible moment when the function application is actually being executed Ordinary function application in SIL is of the early binding style the selection of variant is made at the earliest possible time when the code is read in Early binding has the advantage of being efficient since the variant selection effort happens only once before the code is executed Late binding however provides the flexibility of allowing the same code to treat various types of inputs In object oriented terminology variant selection is referred to as binding of methods to messages hence the names early binding and late binding Among object oriented languages C uses early binding for all but virtual functions while SmallTalk and Objective C always employ late binding N o S amp S a Q Q c o gt lt We are now ready to write dispatch procedure dispatch part universal begin apply assemble part end Developer s Guide 9 9 7 96 Advanced Data Types A call to dispatch would look like dispatch part as_type universal 9 10 SilTools Applications The applyn operator works in a similar fashion but it returns a failure indicator when no variant is found The function is_fail determines whether or not a universal value indicates failure
106. ink of poses in relation to reference frames other than the Universe frame For instance given a pallet full of parts it is easier to specify the poses of those parts relative to the frame of the pallet rather than to the Universe frame especially if the absolute pose of the pallet is unknown beforehand Developer s Guide 3 17 7 96 SiTools Geometry Sometimes you know the poses of two frames relative to the Universe but would like to know the pose of one in the frame of the other For this you use the in_frame operator lt geometric type gt in_frame lt pose gt 3 18 SilTools Geometric Operators where the argument preceding in_frame can be any absolute position orientation or pose relative to the Universe and the argument following in_frame is a pose relative to the Universe The value returned is always a position orientation or pose with the pose specified after the in_frame operator as its reference instead of the Universe The in_frame operator is useful if you need to rearrange components of a simulated workcell without changing their poses relative to one another gt fo 0 at E 77 Developer s Guide 3 19 7 96 SiTools Geometry 3 20 SilTools Chapter 4 Data Types This chapter describes the basic data types including lists arrays records strings Figure 4 1 Basic SIL data types The complete SIL data type structure is shown in Figure N
107. intf_prompt boolean Presents the user with a yes or no choice sure message list of intf_prompt boolean sure boolean Displays a message in a pop up box and presents the user with an option of selecting OK or Cancel Program execution is halted until a selection is made The function returns when either selection is chosen NOTE This is also called a confirmation requestor get_a_string list of intf_prompt anno_string Requests a string from the user The user is given the option of cancelling the selection anno_string ia defined in the following section Additional similar functions are also described in the following section Additional functions are documented in the Si Tools NOTE Command Reference available from SILMA Division of Adept Technology Inc Annotated Types Annotated types are useful when a function can return a value or no value such as the case of get_a_string where a user can either enter a string or cancel Annotated types include anno_string anno_boolean anno_integer and anno_real These types are defined as records that have two fields anno A boolean that records whether or not a value was entered oO val A value if one was entered Eg Pe Eg ES hg ia Do oD Developer s Guide 6 27 o 7 96 Programming the User Interface The following functions return an annotated value get_a_real message list of intf_prompt anno_real get_a_real an
108. ion can be used in a type definition Example 4 1 type age integer height real name string Two of the most commonly used of these types records and Irecords are described on page 4 17 Classes are described in Chapter 5 Classes 4 2 SilTools Lists This section contains the following topics gt List Types gt Other List Operations gt Destructive List Operations gt List Recursion and Iteration A dynamic list is a sequence of objects all of the same type which can grow and shrink during program execution You can define and manipulate dynamic lists using the traditional Lisp operations car cdr and cons Examples 4 2 and 4 3 demonstrate the use of the list operator as well as car cdr and cons Developer s Guide 4 3 7 96 no Q Q gt Ee m Data Types 4 4 List Types The base type of a list is the type of the members of the list The list operations ensure that the base type of a list is well defined For example the call list 1 2 hello world results in a type mismatch error since all of the arguments are not of the same type This seems fairly straightforward until we consider empty lists lists with 0 members What is the base type of an empty list To solve this problem in SIL you need to declare the base type whenever you create an empty list A call to the empty list constructor has the form emptylist lt type gt
109. ions on panel view work on all kind of mnodes So 3 Dos cos EL Epe S Do a Developer s Guide 6 3 7 96 Programming the User Interface 6 4 Top Panel Top panel is top level container mnode whose existence is independent of other panels A top panel can be pushed popped or iconized independently of other top panels Each top panel must belong to some module and is identified by the name of its module together with its name Top panel can interact with WM though WM handlers Currently four kinds of WM handlers are defined activate Left mouse button is clicked inside panel the first time after cursor moves into it move Panel is moved interactively resize Panel is resized interactively quit Panel is to be closed using panel WM menu Named handlers defined for top panel popup Called right before the panel is seen on the screen A top panel besides its own widgets can include a menu bar at the top for pulldown menus A top panel can include menus as its only children such a top panel called a top bar shows only the menu bar for pulldown menus Item Panel Item panel is top level container mnode which is logically dependent on a top panel or another item panel called its owner or parent An item panel is always displayed on top of its owner cannot be iconized and will be dismissed when its ancestor top panel is iconized or dismissed Each item panel must belong to some module
110. ipe of type lt type gt we use the new_pipe command p new_pipe lt type gt SilTools Pipes To place a message lt msg gt of type lt type gt in p we use signal signal lt msg gt p If the waiters queue is empty then signal simply adds lt msgp gt to the messages queue of p If the waiters queue is not empty the messages queue will be empty and signal wakes up the first task on the waiters queue and personally delivers lt msg gt The wait command returns the next message in a pipe if there is one Otherwise it will suspend the current task and add it to the waiters queue Both wait and signal are temporal commands that return control to the scheduler when they complete gt o a 3 o fa e Oo Developer s Guide 10 11 7 96 Concurrency Proc esses and tclosures When a task places a message in a pipe there is no guarantee as to which task will receive this message since any task can extract messages from any pipe Alternatively a task can have private pipes While any task can place a message in a private pipe only the owner task can extract messages from the pipe Tasks with private pipes are for the purpose of compatibility with pre 4 2 releases called processes Processes are parameterless tasks that do not return values The syntax for defining a process is a little different from the syntax used for defining tasks process lt name gt lt private pipes gt
111. l my_thing carray_of cshort end Alignment is done as in C each type is aligned to an even multiple of its length cchars and cshorts when extracted turn into SIL integers and sreals into SIL reals illustrated in Example 9 10 g gt Ee Example 9 10 a nn new noo 3 nn my_char 45 use an integer not a char or cchar 2 nn my_char returns an integer E lt C Stings There are a couple of utilities for going back and forth between SIL Istrings and C strings An Istring is a string called the contents together with an associated length which specifies the part of the contents in use See Istrings on page 4 15 for more information The type estring is defined just to be a synonym for carray_of cchar The following operations are provided function to_cstring x Istring cstring This first checks that the contents string of x is static does not get moved around by the garbage collector and null terminated If either of these conditions is violated a new contents which is tenured and null terminated is generated and set up as the contents part of x The cstring returned is a pointer to the raw untagged contents of x So Developer s Guide 9 17 7 96 Advanced Data Types 9 18 the cstring will occupy the same storage as the contents of x and will be null terminated Since the storage for the resulting cstring cannot be freed this fu
112. l statement with no else clause For example consider the statement if test1 then if test2 then writeln hello else writeln bye If test1 fails should bye be written or not The problem is that ambiguity arises when determining whether else is part of the outer conditional statement or the inner statement In this situation the convention is to group the else clause with the outer if statement We can group it with the inner statement by inserting begin and end statements if test1 then begin if test2 then writeln hello else writeln bye end The case construct in SIL uses the following form case lt variable gt of lt value gt lt value gt lt value gt lt statement gt lt value gt lt value gt lt value gt lt statement gt else lt statement gt end SilTools The SIL Runtime Model o f Q o G f o op gt S oOo 8 25 l 0 There are several types of iteration statements repeat while and for The repeat and while statements behave similarly The syntax for these statements is expressed in Rule 1 8 Rule 1 8 lt iteration gt lt while gt lt repeat gt lt for gt lt repeat gt repeat lt actions gt until lt condition gt lt while gt while lt condition gt do lt action gt lt actions gt lt action gt lt action gt where lt action gt is an arbitrary statement and lt conditi
113. le tasks within one state or data space Temporal amp Instantaneous Commands SIL maintains a global variable called clock which measures the passing of simulated time Certain SIL commands cause clock to be advanced when they are called Commands that consume simulated time are called temporal Non temporal commands are called instantaneous A block of instantaneous commands is called an instantaneous block Temporal commands are useful in simulations that model time For example SilTools commands that move or operate simulated kinematic devices like machines or tools are temporal All SIL function and procedure calls are instantaneous Therefore no temporal commands can be called in the body of a function or procedure Procedures intended for concurrent execution are indicated by using the keyword task rather than the keywords function or procedure Tasks may include any code which would be legal in a procedure or function and may include primitives for synchronization The syntax for defining a task is similar to the syntax for defining functions and procedures gt o j o am 3 e S task lt name gt lt formal parameters gt lt type gt lt local variable declarations gt lt task body gt where lt task body gt is either a procedure or function body depending on whether or not a return value is indicated Do not confuse simulated time with real time For example ca
114. lling a procedure containing an infinite loop will consume an infinite amount of real time but 0 seconds of simulated time IMPORTANT Developer s Guide 10 1 7 96 Concurnency Of course calling any temporal command from inside of a task will cause the task to consume simulated time Therefore tasks which call temporal commands are themselves temporal commands In fact the body of a task can be viewed as being composed of several instantaneous blocks separated by calls to temporal commands instantaneous block temporal command instantaneous block temporal command instantaneous block Figure 10 1 Typical control flow for a task Delay The simplest way to consume simulated time from inside of a task is to call the most primitive temporal command delay lt seconds gt When called from inside of a task foo delay will cause foo to suspend itself until the clock has advanced the indicated number of seconds SilTools The Scheduler Example 10 1 defines a temporal command The Scheduler gt o o ES 3 O Z fe 8 The body of a task can be viewed as a sequence of blocks consisting of a sequence of instantaneous commands terminated by a temporal command The Scheduler is a SilTools program that simulates concurrent execution of tasks by interleaving the execution of blocks from two or more tasks Tasks wait in the run queue to have their next block executed The terminating temporal command
115. lt type gt In this case lt type gt is a term that evaluates to a data type Notice the extra semicolon at the end of the declaration This tells the interpreter not to expect more type definitions SilTools The SIL Runtime Model Functions and Procedures o D d S 42 The format of function and procedure definitions follows Pascal syntax illustrated in Example 1 12 Procedures and Functions on page 2 2 defines functions and procedures in detail o lt fe c 2 3 le d Variable Declarations The format of a variable declaration is var lt variable declarations gt lt variable declarations gt where lt variable declarations is a list of variables followed by a type expression lt variable declarations gt lt variable list gt lt type gt Variable lists are variables separated by commas lt variable list gt lt variable gt lt variable gt Developer s Guide 1 21 7 96 Introduction to the SIL Language In the global environment be sure to place a double semi colon at the end of the variable declaration so that the interpreter will not expect more variable declarations Technically a variable declaration is not a definition in the sense that a definition associates a value with a name Instead a variable declaration associates a type with a name The type information is needed by the interpreter to ev
116. ltering the selection 6 13 getob mode 6 12 global_browser_kind 6 11 global_getob_kind 6 12 highlighting 6 13 mouse wiring 6 15 multi pick 6 12 6 14 6 24 multiple object selection 6 12 6 14 6 24 reinitializing 6 14 shape processors 6 11 shape selectors 6 12 types of 6 11 value 6 12 shape fields see widgets shape fields shape adding 8 9 8 24 shape_field_has_shape function 6 12 shape_field_shape_value function 6 12 shape_field_string_value function 6 12 shape_selector class 6 12 shape click tools see gtools shorter function 2 10 shorterc variable 2 10 show command 3 17 signal command 10 7 10 11 10 12 SIL arrays see arrays class 1 5 5 2 code calling C code from 11 22 11 32 compiling 11 2 11 7 11 11 rbuild command 11 10 remake command 11 10 debugging see debugging importing C functions 11 23 interpreted 11 15 recompiling 11 10 definitions 1 19 environment 1 2 expressions 1 2 1 12 help 2 1 implementation 1 1 interpreted language 1 8 SilTools interpreter 1 14 2 6 2 13 4 16 statements 1 14 terms 1 12 type system 1 4 uncompiled code 1 2 SIL I O 2 13 sil_load command 11 5 simulated time 10 1 sleeping tasks 10 4 slider_value function 6 9 SmallTalk 1 2 1 6 1 7 5 23 spatial geometry see geometry speedup 6 11 sph type 3 7 sphere adding 8 23 splice operator 5 17 sspa script 11 7 11 11 stack 1 23 11 16 stackvals 1 23 start command 10 4 11 10 start up 9 19 start up screen 6 33 statements 1 12
117. m REM the File pulldown menu In Text Mode the menus and INDER panels are disabled and the SIL gt prompt is displayed in the shell window you used to start the session When an error occurs while running SIL in Text Mode an error message is printed along with the following prompt instead of the SIL prompt Error gt The Error gt prompt indicates that an error break has occurred During an error break any SIL command is legal In addition the call stack becomes accessible for examination The call stack is a data structure which describes the function which was running when the error occurred and the sequence of function calls which led to the function invocation The call stack also contains the values of all local variables in the functions on the stack This SIL command is used to examine the stack by printing a trace back Error gt tb 11 16 SilTools Debugging Example 11 2 shows a typical function function call error message and trace back O S 2 E D E b O Developer s Guide 11 17 7 96 Working with SILCode 11 18 The numbers in the 0 column are the indices of the stack frames and are called frame numbers These numbers are used to refer to frames in commands described in the succeeding pages The values of all local variables including parameters are printed parameters however are labeled ARG In Example 11 2 the frames numbered 0 1 2 and 5 designate system
118. mands by writing programs in a language called SIL Using the SIL language you can develop your own SilTools applications which take advantage of the capabilities that SIL offers SilTools in fact is a SIL application This manual explains how to program in the SIL language To use this manual to write your own programs requires some previous programming experience SIL is a powerful general purpose programming language that lies at the heart of SilTools and supports advanced programming methods such as object oriented programming concurrent programming and meta programming This chapter provides an overview of the SIL language including a simplified model of SIL s runtime environment and the storage model SIL Language Overview The layers of SIL implementation are arranged in the following fashion Metaprogramming Extended Types Polymorphic Interactive Pascal Figure 1 1 The SIL language Developer s Guide 1 1 7 96 o lt fe c 2 3 le d o D d 42 Introduction to the SIL Language SIL Compared to Pascal SIL and Pascal share many syntactic features Programmers familiar with Pascal but new to SIL can get started by treating SIL as an interactive implementation of Pascal SIL syntax is a superset of Pascal syntax and all of the control structures have their usual Pascal meanings basic data types such as reals integers booleans and records have st
119. n SIL is very similar to a Pascal or SIL record definition type lt new class gt class superclass lt class1 gt superclass lt class2 gt lt instance var 1 gt lt type1 gt lt instance var 2 gt lt type2 gt end Example 5 1 introduces the concept of class using object oriented terminology 5 2 SilTools Classes Developer s Guide 5 3 7 96 Classes Inheritance Example 5 2 introduces the principles of inheritance In this example we will continue to use the material from Example 5 1 5 4 SilTools Inheritance The class manager is a subclass of employee because conceptually all managers are employees Developer s Guide 5 5 7 96 Classes 5 6 In Example 5 3 team1_leader specializes smith therefore all employee methods can be applied to team1_leader without explicitly coercing or casting team1_leader to the class employee This process is called inheritance because team1_leader inherits all methods and attributes of smith In addition the attributes of smith can be accessed through team1_leader Because all managers are employees it always makes sense to apply employee methods to managers But because some employees are not managers it does not always make sense to apply manager methods to employees SilTools Inheritance Example 5 7 illustrates how the above method can be followed to add more classes objects and methods Develope
120. n coordinates where the click occurred E The previous pos is copied into last_pos So 3 Dos cos EL Epe S Do a Developer s Guide 6 17 7 96 Programming the User Interface mM The shape_of field is filled in with the shape selected by the click The predicate method of the tool determines which shapes are available for selection by a shape click tool A group tool is similar to a shape click tool but will show a box on the screen when the mouse is dragged and fills in the group_of field when the mouse is released with the group of shapes in the box It will also set the shape_of field to the group shape representing the group In the case of a general tool the execute method is run whenever the mouse button is pressed released or moved while pressed pos and last_pos and action fields are filled in The values of the action field are buttonpress buttonrelease motionnotify leavenotify The mouse cursor was moved out of the Graphics Window while the mouse button remained pressed enternotify The mouse cursor returned to the Graphics Window while the mouse button remained pressed Other gtool Methods Two methods are called when a gtool is activated and deactivated at_activate called when the gtool is activated at_deactivate called when the gtool is deactivated 6 18 SilTools Obtaining Additional Information Advanced Widget Programming If you would like more information about the re
121. nction should be used only to create permanent cstrings The following function statically allocates a brand new null terminated cstring with capacity equal to that of x and copies x into it Since the storage for the resulting cstring cannot be freed this function should be used only to create permanent cstrings function mk_cstring x Istring cstring The capacity of an Istring is usually bigger than its current length REMINDER The following function dynamically allocates a brand new null terminated estring with capacity equal to that of x and copies x into it The storage for the resulting cstring can be freed with free_cstring function new_cstring x Istring cstring This procedure frees the x cstring which has been created dynamically by new_cstring procedure free_cstring x cstring This procedure copies c to x stopping at a null in c or the capacity of x whichever comes first procedure copyto x Istring c cstring The following procedure copies x into c Since c has no length indication this can be dangerous if c was allocated to be shorter than the current length of x then the memory after e s length allocation will be deleted procedure copyto c cstring x Istring The print function for estrings will print characters until a null is hit or the limit max_cstring_print_length is reached max_cstring_print_length is initially 100 SilTools
122. nformation Polymorphism Tricks Input Output Reading from the Keyboard Writing to the Screen Reading and Writing to a File EOF Symbols Identifiers Useful Symbol Operations Intern Concatenation i_tsetq id2string Chapter 3 SilTools Geometry Understanding SilTools Geometry Geometric Terms Shape Frame Geometric Units Position Cartesian Description Cylindrical Description Spherical Description Orientation Yaw Pitch Roll Euler Angles Equivalent Angle Axis Poses Geometric Operators Chapter 4 Data Types Lists List Types 2 10 2 11 2 11 2 12 2 13 2 13 2 16 2 16 2 18 2 19 2 20 2 20 2 20 2 21 2 21 2 21 3 1 3 1 3 2 3 2 3 3 3 4 3 5 3 6 3 7 3 8 3 10 3 12 3 13 3 16 3 17 4 3 4 4 SilTools Other List Operations Destructive List Operations List Recursion and Iteration Arrays sarrays Strings String Comparisons String Conversions Other Operations on Strings Istrings Records and Irecords Chapter 5 Classes Object Oriented Terminology Classes Inheritance Views Changing Views The as_view Operator vs the to_view Operator Multiple Inheritance Using apply on Views View Manipulation Abstract Classes Installation of Methods Using Methods Instead of apply C Additional Methods Primitives Chapter 6 Programming the User Interface The mnode Class Widgets Appearance Behavior Top Panel Item Panel Menu Simple Widget Programming Developer s Guide 7 96 Table of Contents 4 5 4 5 4
123. nging to different types classes can be related in such a way that all properties of A are also properties of B We say that B inherits A s properties Logically we can interpret this to mean that B is a specialization of A or A is a generalization of B since B may have additional properties apart from those inherited from A The advantage of inheritance is that you don t have to build the object B from the ground up By declaring B to be a specialization of A the properties of A automatically become properties of B This can be a huge time saver if A is a system defined object with lots of useful but low level properties For example B might be a tin can with physical properties such as weight material pressure etc whereas A might be a cylinder with geometric and graphical properties such as tangent plane at a point boundary representation mouse selectable etc Clearly a scientist or engineer simulating a tin can should be expected to define the domain specific properties of the tin can like weight and pressure but should not be expected to define the lower level properties of a cylinder even though these properties are necessary for displaying and manipulating the tin can in simulation Because SilTools provides a type class cylinder our scientist engineer need only define A to be a cylinder and declare B to be a specialization of A Developer s Guide 5 1 7 96 Classes Classes The definition of a class i
124. nits of length are based on this default and are easily defined gt fe 0 at O D Some units of length are already pre defined as global constants in SilTools They are inch 2 54 centimeters foot 30 48 centimeters mm 0 1 centimeters and mil 0 00254 centimeters The default unit for rotation is degrees The size of a rotation is the number of degrees in the swept angle Positive rotations are taken to be counter clockwise looking down the positive axis of rotation toward the plane of rotation Negative rotations are clockwise A pre defined constant rad 180 pi degrees is provided for working in radians The following equation returns a value of 180 pi rad Developer s Guide 3 3 7 96 SiTools Geometry Position A position is a property of points that describes a point s location relative to some known reference frame The position of the point is at X Y Z in Cartesian coordinates In SilTools the units of position are specified by centimeters by default but can be changed easily to the units of your choice Position seen X Y Z 0 0 0 Z Figure 3 2 Position For example every point on an object has a position relative to the frame of that object Every frame has a position relative to some other frame determined by the location of its origin a point in that frame A convenient way to depict position is with a vector pointing from the reference frame s ori
125. no_real get_an_integer message list of intf_prompt anno_integer get_an_integer anno_integer get_a_boole_tf message list of intf_prompt anno_boole get_a_boole_tf anno_boole get_a_boole_yn message list of intf_prompt anno_boole get_a_boole_yn anno_boole get_a_boole message list of intf_prompt anno_boole get_a_boole anno_boole get_a_string message list of intf_prompt anno_string get_a_string anno_ string Pops up a message in a pop up box prompting the user to input a value Program execution is halted until the user enters the value or cancels the selection Online Help 6 28 A panel may have a help file available online Pressing the lt HELP gt key while the cursor is on the panel will display the help information To set help use set_help mn mnode file string where file is a relative pathname from cim gui help The help file is an ASCII text file Formatting should be kept simple and every paragraph placed in a single line Since the help text will wrap around to the next line automatically you do not need to be concerned about the size of the Help Window SilTools Installing Panels Installing Panels Adding a Panel into the Pulldown Menus A panel may be added to a product by editing the top bar panel for that product This can be accomplished using the Visual SIL Window by loading and editing in the current top bar panel then saving the revised panel into a new file
126. nters would result A view which has been removed should not be referenced after its removal For example Example 5 20 chs mk_chess_player 1700 san francisco splice chs student9 remove_this_view chs The resulting value of chs is a dead view which should not be referenced in subsequent code SilTools Abstract Classes Abstract Classes This section describes the abstract class facility Topics in this section include gt Installation of Methods gt Using Methods Instead of apply gt C gt Additional Methods Primitives The abstract class facility provides the same sort of functionality as C virtual functions you can define abstract classes whose methods can be implemented by a variety of concrete classes The facility is more flexible than anything available in C in that it allows dynamic modification of the implementing classes and methods of an abstract class Abstract classes can also be spliced on to pre existing concrete classes allowing abstractions to be layered onto existing bodies of concrete code Example 5 21 introduces abstract classes by showing a conventional example an abstract stack class The method fields are slots which hold operators on astack just as ordinary fields of a class hold data The usage method lt return_type gt lt input_type gt lt input_typen gt Developer s Guide 5 19 7 96 Classes specifies a method which c
127. ocal variables gt lt variable declarations gt lt variable declarations gt lt formal parameters gt lt variable declarations gt lt variable declarations gt The procedure body is an arbitrary begin end statement lt procedure body gt begin lt statement gt lt statement gt end A function body is also a begin end statement but requires the presence of a return statement which has the form lt operator gt lt term gt This causes the function to return the value of lt term gt when the function completes execution Developer s Guide 7 96 The Basics Unlike global variable declarations local variable declarations do not require an extra semicolon Examples 2 3 and 2 4 illustrate the use of simple functions and procedures 2 4 SilTools Procedures and Functions N 2 a G a o T Note the use of the error procedure in Example 2 4 The error procedure prints its arguments and returns control to the top level control loop instead of the function procedure that called dispatch This is useful because an error in dispatch probably means that the function procedure calling dispatch will also have an error as will its caller its caller s caller etc up to the top level control loop Developer s Guide 2 5 7 96 The Basics Local Environments When a function procedure is called the body of the function procedure is evaluated by the interpreter in
128. of a block suspends or reschedules i e places at the end of the run queue the current task and returns control to the scheduler which begins executing the next block from the next task in the run queue This continues until all tasks are suspended and the run queue is empty Since clock never advances during execution of these instantaneous blocks the blocks have executed concurrently in simulated time Since all tasks are now suspended everything that could possibly happen in that simulated instant has happened and the clock advances Developer s Guide 10 3 7 96 Concurrency Delayed tasks 1 e tasks that have suspended themselves for a specific length of time wait in a queue of delayed tasks prioritized by wake up times When all tasks are suspended and the run queue is empty the scheduler advances clock to the wakeup time of the next task on the delay queue and resumes execution of this task Startand Run Although a single task can be executed by calling it in the same manner as a function or procedure it will not work when executing many tasks concurrently To do this you need to first place the tasks to be executed in the run queue by using the start command start lt task gt lt arg gt lt arg gt where lt arg gt lt arg gt are optional arguments to lt task gt Example 10 2 In this example assume t1 t2 and t3 are tasks which accept integers SlL gt begin start t1 0 sta
129. of an object splice and remove_this_view The splice operator simply appends the views of object1 onto those of object2 So object1 and object2 are unified they become referentially equivalent object1 may not be spliced onto object2 if any view of object1 has the same class as a view of object2 The splice operator works like this splice lt object1 gt lt object2 gt Example 5 18 type chess _ player class rating real uscf_chapter string end Then if student9 is a chess player as well as a student and an employee we can add this data as follows splice mk_chess_player 1700 san francisco student9 Developer s Guide 5 17 7 96 Classes 5 18 In Example 5 18 chess playing and employment are non interacting properties so there is no need to define a class of chess playing employees since you can splice chess data as needed onto individual students who play chess The remove_this_view operator works like this remove_this_view lt object gt For example if student9 in Example 5 18 gives up chess Example 5 19 After issuing this command student9 will no longer have a chess_ player view remove_this_view student9 as_view chess_player The remove_this_view operator will generate an error if the class of any other view of the object is a subclass of the class of the view being removed If this restriction were not observed objects with dangling superclass poi
130. of integer begin plus appendix y end PLUS ok shiz VIsta 2 D list 4 5 6 DEIST 1 2 3 4 5 6 Sib D Figure 1 3 Shell window example Developer s Guide 1 3 7 96 Introduction to the SIL Language Enter menus at the SIL gt prompt to restore access to the menus If the system has become disabled enter r at the Error gt prompt to reset the system Extended Types The SIL type system uses the Pascal typing structure as a starting point and expands on it First SIL provides types which are dynamically allocated and automatically collected from a heap These types include dynamic lists arrays strings trees and a special type lispobs SIL data objects which is shortened to ob All SIL data are of type ob SIL permits C style casting in particular any SIL expression can be cast to ob and back which allows typed and untyped styles of programming to be freely mixed SIL also includes metatypes types which range across language entities rather than across the usual sorts of data The most important metatype is ntype All types are ntype All SIL data tagged by type is type universal As with ob any SIL expression can be cast to universal and back The apply operator provides runtime or late binding polymorphism If some or all of the expressions e1 en are of type universal then apply f e1 en will search at runtime for a variant of f whose input types match the types of e1 en Chapte
131. of these models could haven been built using the panels ann Eg 36 nae cE 58 6 Z0 Developer s Guide 8 19 7 96 Modeling Using SLCommands 8 20 SilTools Modeling Examples D N 2 36 may cE 38 6 Z0 Developer s Guide 8 21 7 96 Modeling Using SLCommands SilTools Modeling Examples D N Eg 36 may cE 38 6 Z0 Developer s Guide 8 23 7 96 Modeling Using SLCommands 8 24 SilTools Chapter 9 Advanced Data Types System Defined Types This chapter describes supertypes metatypes SIL constants and C data types System Defined Types SIL system defined types include the basic scalar types integer real boolean string But SIL also provides some fairly exotic types For example internal representations of SIL expressions and their components are also ordinary SIL data objects which can be manipulated by SIL programs the same way that scalars can These are called metaobjects and the types to which they belong are called metatypes Another category of useful system defined types is the supertypes If we think of types as sets of values then all types can be regarded as subsets of the supertypes The two supertypes are lispob and universal m 2 m 3 Q fa S gt lt Scalartypes Supertypes string integer boolean real ntype lispob universal Figure 9 1 System defined type classifications Strings
132. ogramming object selection 6 11 wiring 6 15 moveby command 8 16 INDEX 7 Index moveto command 8 16 multiple inheritance 5 14 my_class function 5 11 N names 2 11 ncreate_template command 11 14 nested definitions 2 7 new_cstring function 9 18 new_pipe command 10 10 newmodule command 11 6 11 8 newproduct command 11 5 11 10 NIL 9 4 notify command 10 3 ntype 1 4 9 2 is_primitive function 9 3 primitive operations 9 3 nul 5 13 null list 4 4 null predicate 9 4 null terminated 5 13 O ob see lispob object casting 5 11 data 9 1 9 2 definition 5 1 gluing 8 15 metaobjects 9 1 naming 2 11 referred to as views 5 10 selecting 6 23 selecting see shape fields terminology 5 2 object oriented programming 1 1 object oriented terminology 5 2 open procedure 2 17 operators 1 13 orientation see geometry INDEX 8 P pair constructor 9 5 is_pair operator 9 6 mutators 9 5 selectors 9 5 panels 6 1 build area 6 30 buttons 6 7 displaying 6 10 file browser 6 25 footers 6 5 6 10 help files 6 28 item 6 4 layout 6 31 logo 6 31 monitors 6 8 pop up boxes 6 23 6 26 pulldown menu 6 5 Quick Access 6 29 6 33 removing from display 6 10 testing 6 10 tool bar 6 29 tool set turning a panel into 6 16 top 6 4 top bar 6 5 6 29 11 6 widgets see widgets WM handlers 6 4 parabola adding 8 3 8 10 parametric curve 8 11 parametric surface 8 12 Pascal 1 2 1 4 1 14 1 21 patching a function 11 15 11 18 pause break 11 20
133. om LISP OBject Lispobs may be classified into data types or to put it the other way around a data type can be viewed as a collection of similar lispobs Knowing the data type of a lispob is important For example this information is used to compute the amount of memory space required to store the lispob or to detect inconsistencies in a SIL program SIL data types fall into one of three broad categories E System defined types integer real boolean string Constructed types list types array types function types mM User defined types record types classes SilTools The SIL Runtime Model ca D 3 d Sr d Arrays 3 lt a e g c e gt ge e 2 i Lists Functions Procedures integer real Scalartypes boolean string Metatypes ntype Supertypes lispob universal Records Classes Figure 1 5 Data type classifications Chapter 4 Data Types Chapter 5 Classes Chapter 9 NOTE Advanced Data Types and Procedures and Functions on page 2 2 explain the data types in detail Developer s Guide 1 11 7 96 Introduction to the SIL Language Expressions This section describes features in SIL which are identical NOTE to Pascal so you may want to skim or even skip this section if you know Pascal There are three types of SIL expressions terms statements and de
134. on gt is a Boolean valued term In the repeat statement lt action gt is repeatedly evaluated until lt condition gt becomes true Since lt condition gt is evaluated after each evaluation of lt action gt lt action gt will be evaluated at least once even if lt condition gt is initially true On the other hand the while statement evaluates lt action gt until lt condition gt becomes false In this case lt condition gt is evaluated before each evaluation of lt action gt so if lt condition gt is initially false then lt action gt will never be evaluated Developer s Guide 1 17 7 96 Introduction to the SIL Language The for statement has two possibilities E Iteration by incrementing or decrementing an integer valued loop control variable Iteration through a list lt for gt for lt Icv gt in lt list gt while lt condition gt do lt statement gt for lt lcv gt lt start gt down to lt stop gt while lt condition gt do lt statement gt where lt list gt is a list valued term lt start gt and lt stop gt are integer valued terms and lt condition gt is a Boolean valued term lt l v gt loop control variable is an arbitrary variable In both types of for statements it is not necessary to declare the loop control variable lt Icv gt The while lt condition gt is used to terminate a loop before lt Icv gt reaches its final value In the first for statemen
135. ools User s Manual available from SILMA Division of Adept Technology Inc The file cim builds lt versioned_area gt panels lists the panels to be included in the given area When a build is done the panels indicated in the panels file are loaded in For example in the itest area there is a panel named test_panel The cim builds itest1 panel1s file contains a line test_panel 5 The file containing the panel is in cim gui panels itest test_panel 5 This panel was saved under the name test_panel 5 is the version number A panel is represented in SIL by a value of type mnode See The mnode Class on page 6 1 for more information NE on mnodes You can access all panels using pathname syntax in the following way lt module_name gt lt panel_name gt This is a SIL expression whose value is the given panel For example the test panel is itest test_panel SilTools Simple Widget Programming The components of a panel such as containers and other widgets can be selected by pathname as in this example The behavior of a panel is specified by giving SIL callbacks for its widgets There are two kinds of callbacks handlers and monitors Handlers A widget such as a button which records an action has a handler The handler is set with this procedure set_handler mn mnode i id The handler should take an mnode as input it will be called with the mnode that generated the e
136. opment environment Compiling SLCode This section contains descriptions of the procedures used to create a module of SIL and C code to compile this code and to create a product which includes the code Suppose that the module in question is to be called ted If no version of ted exists the following command creates a completely new module with one version ted1 O 8 D E d E 5 gt newmodule ted ted1 Developer s Guide 11 7 7 96 Working with SILCode The newmodule command automatically sets up all the directories listed at the top of the page cim mcecode ted cim sil ted cim mhfiles ted cim actions ted and cim builds ted1 The newmodule command also sets up the s mc mh links in the cim builds ted1 directory Example 11 1 shows how each of sil_files and c_files isa two line text file giving the names of the files to be included without their silor c extensions Compiling the code is a two step process First the SIL code is translated to C and then compiled to binary The first step is accomplished with a SIL command and the second step with a shell window command SilTools Compiling SIL Code The SIL command SIL gt compile_area lt module gt lt version gt compiles all of the SIL files in the given version of the given module For example SIL gt compile_area ted ted1 compiles the SIL files for ted To compile an individual SIL file
137. or gt evw lt variable name gt debug_frame Developer s Guide 11 19 7 96 Working with SILCode 11 20 You are free to reset debug_frame thus changing the behavior of the single argument variant of ev In our example the error was caused by an explicit SIL error statement Other errors arise from the usual UNIX error conditions access violations arithmetic errors interrupt signals etc Regardless of the source of the error the behavior of the error break is the same The command Error gt r0 returns control to the top level SIL loop that is it exits the error break and cleans up the stack Continuing from the error along the same course of computation that caused the error is not possible However you can include statements in your code which will cause a pause break a break with behavior identical to an error break but one from which computation can be continued using the go command This command is ppause x string Using the command and argument above results in x being printed out when the pause break is entered Example 11 5 provides an extended example of ppause Example 11 5 procedure test_pause n integer begin for i 1 to n do ppause testing end SIL gt test_pause 20 pausing at testing gor CO Contine continued on next page SilTools Debugging 5 O S 72 zl E D E b O Developer s Guide 11 21 7 96 Working with SILCode Debug
138. ou can simply edit cim builds ted2 sil_files to mention file1_2 instead of filel To include ted2 instead of ted1 in tedsproduct we edit its version file cim templates tedsproduct versions The following command gt remake ted tedsproduct will remake ted2 and gt rbuild tedsproduct will rebuild the product with ted2 Including Modules and Products in the Product Administration Panel The Product Administration panel is used to create and start new products The panel is displayed by entering sspa in a shell window Adding New Modules All the available modules should be listed in the Available Modules list in the Create Product panel which is displayed by selecting Create from the Products pulldown menu in the Product Administration panel Modules may be made available for use in the Product Administration panel by editing the file cim options versions and adding the line O 8 D z d E 5 lt module gt lt version gt A module should be listed only once Developer s Guide 11 11 7 96 Working with SILCode Adding New Products All the available products should be listed in the Select Product to Start list in the Product Administration panel Products may be made available to be built in the Product Administration panel by creating an application solution module appsol which should contain the following files 1 supmodules lists the modules to be included in the product
139. oveby commands Operator Resulting Shape mk_point lt xc gt lt yc gt lt zc gt Cartesian point Curves Operator Resulting Shape mk_rctcurve pts darray of pnt3dr retcurve mk_rctcurve pts darray of pnt3dr n integer rctcurve n use 0 n points as input mk_rctcurve p q pnt3dr rctcurve mk_circle r real circle centered at origin mk_circle radius real p pnt3dr circle p center mk_circle radius real f frame circle f circle defined w r t the frame arc r a real res integer circle r radius a angle in degrees 0 360 0 res resolution arc r a real circle r radius a angle in degrees 0 360 0 arc r_ real circle r radius 8 2 SilTools Conics a x coefficients b y coefficients Modeling Constructors Operator Resulting Shape mk_ellipse a b real mk_parabola a real mk_hyperbola a b real ellipse parabola hyperbola D a 9 36 a De 36 E P Operator Resulting Shape mk_rbspline knts wghts darray of real cpts darray of pnt3dr rbspline knts knots wghts rational part of the point called weights cpts control points mk_rbspline knts darray of real cpts darray of pnt3dr knts knots wghts all weights equal to 1 0 cpts control points Operator rbspline Resulting Shape mk_pcurvelist pcs list of pcurve mk_pcurve p pnt3dr p point mk_pcurve p seg3dr p line segment Developer s Guid
140. paint paint14 is indicated Since no version is specified for arc the current version is used listed in cim options versions umodules umodules is a file which can be used to specify all modules to be included in a product The umodules file which resides in cim templates lt mytemplate gt area has syntax like the supmodules and comodules files For example to create a product with appsup11 the current version of rkint arcweld7 and the current version of paint the umodules file would read 8 appsup appsup11 rkintf E arcweld arcweld7 paint O To set up your product with a umodules file 1 Create a directory for your product cim template lt mytemplate gt 2 Create the umodules file Developer s Guide 11 13 7 96 Working with SILCode 11 14 3 Use the ncreate_template script by entering ncreate_template template_name to create your product While creating a product ncreate_template calls the scope_out script The scope_out script reads the umodules file does the dependency checking and writes the traditional modules and versions files to your product area Using the umodules file is helpful when you want to remake an existing product and want to change the version of one of the modules you include or make an addition or deletion af Synta xX supmodules comodules and umodules files can also use if syntax An example of this syntax is robot robot13 paint spot spotl14
141. pe provided by SIL for describing equivalent angle axis orientations is aax equivalent angle axis You may construct an equivalent angle axis orientation with the command mk_aax lt xeq gt lt yeq gt lt zeq gt Developer s Guide 3 13 7 96 gt 5 cb e O Oo a 8 SiTools Geometry 3 14 Although it is not easy to determine the appropriate general axis and proper rotation to produce a desired orientation the equivalent angle axis representation is useful for producing complex orientations when you know both the axis and amount of rotation Consider the antenna in Figure 3 11 Figure 3 11 Angle axis orientation The Z axis of the dish s frame is normal to the dish at its center and is tilted 30 degrees from vertical in its YZ plane To rotate the dish 90 degrees while maintaining the same tilt you must determine the unit vector of rotation along the vertical axis in the dish s frame which is 0 sin30 cos30 Next multiply the vector by the desired rotation of 90 The resultant orientation with respect to the initial orientation is 0 45 77 9 as aax When orientations involve only a single rotation about the X Y or Z axis of the reference frame copy it makes no difference whether you describe them using yaw pitch roll X Y Z Euler angles or equivalent angle axis For example the following commands each describe the same orientation 0 70 0 as ypr 0 70 0 as xyz 0 70 0 as aax
142. per s Guide Appendix 1 3 7 96 Using SilTools in a Non English Environment The file to_localize simply contains the names of data files generated Each generated data file corresponds to a panel that needs to be localized 3 Quit SilTools 4 Use a text editor to localize those data files and save them under cim gui locales lt local_laguage gt where lt local_language gt is the name of the local language e g cim gui locales japanese 5 Set the environment variable CIM_LOCALE to the local language e g setenv CIM_LOCALE japanese 6 Restart SilTools to create a localized version of the heap_file and the localization process is done Actually whenever SilTools is brought up it checks the environment variable CIM_LOCALE and the localization header file to_localize in the template area If both exist and to_localize is newer than heap_file localization will be done for those data files under cim gui locales CIM_LOCALE which are listed in to_localize Thus partial localization can be done by editing to_localize before restarting SilTools Localizing SilTools Panels at Build Time The localization can also be done at build time by setting the environment variable CIM_LOCALE and creating the header file to_localize in the relative build area before rebuilding a template At build time SilTools checks the environment variable CIM_LOCALE and the localization header file to_localize in the template area If bot
143. plus x y degree degree begin plus x as_type real y as_type real as_type degree end SIL gt 34 0 as_type degree 350 0 as_type degree 24 0 9 6 SilTools Universals Universals All SIL data tagged by type is type universal As with lispob any SIL expression can be cast to universal and back Consider the following situation A robot can assemble three types of parts procedure assemble part top_part procedure assemble part middle_part procedure assemble part bottom_part A dispatch procedure identifies the part and invokes the appropriate assembly routine But how do we define the dispatch routine If we assume that the part is a parameter to dispatch how can we know which type it will be procedure dispatch part _part N o S Ee S a Q Q c gt lt We could declare part to be a lispob procedure dispatch part lispob but then we would not have any way of figuring out the type of the part later when we need to call the proper assemble procedure One solution to this dilemma is to use universals A universal is a type tagged lispob implemented as a SIL type type universal Irecord value_of lispob type_of ntype end Like any other records universals can be constructed either by using the automatically defined constructor mk_universal or by using as_type Assume var u universal then u 3 as_type universal is equival
144. pob lispob cdr x y y These operations will be familiar to Lisp programmers as will the following abbreviations for common compositions of car and cdr cadr x abbreviates car cdr x caddr x abbreviates car cdr cdr x cddr x abbreviates cdr cdr x etc Pair mutators procedure set_car x y lispob changes car x to y procedure set_cdr x y lispob changes cdr x to y Predicates used to test for equality between two lispobs function eq x y lispob boolean Developer s Guide 9 5 7 96 Advanced Data Types Here are some operations that use the tag of a lispob datum to extract some basic information function is_real x lispob boolean function is_integer x lispob boolean function is_string x lispob boolean function is_pair x lispob boolean Finally ob is short for lispob i e ob lispob Represented Types Suppose that we want to introduce a new type called degree to be used in representing angles This can be done with the declaration type degree real degree is a new type that is distinct from real but its data values are represented by reals Another syntax for the same declaration is real represents degree Initially no operations are defined on degree since it is a new type Since real and degree have the same format for their data as_type can be used to get back and forth between real and degree illustrated in Example 9 2 Example 9 2 function
145. r Developer s Guide 8 9 7 96 Modeling Using SL Commands Operator Resulting Shape mk_ellipse z tp ellipse mk_ellipse z ellipse mk_hyperbola z tp hyperbola mk_hyperbola z hyperbola mk_parabola z tp parabola mk_parabola z parabola Operator Resulting Shape mk_circular_arc center begpt endpt pnt2dr circle zt real mk_circular_arc center begpt endpt pnt2dr circle Bezier Curve Constructor We string together Bezier curves defined by four successive points If necessary some points at the end are duplicated Operator Resulting Shape mk_pspline p0 p1 p2 p3 pnt3dr pspline pO p3 are the control points of the Bezier curve mk_psplines pts darray of pnt3dr pspline Similar to mk_psplines except here the resulting curve has continuous tangent vectors Operator Resulting Shape mk_pspline pts darray of pnt3dr n integer pspline mk_pspline pts darray of pnt3dr pspline 8 10 SilTools Modeling Constructors Bezier Patch Constructor Operator Resulting Shape mk_psurf cpts darray of pnt3dr psurf cpts 0 15 is an array of control points for the Bezier patch Sa SU g u v 1 u u u u u u B S Bt 1 v v v v v vjt a S ke Conic Surface Constructors 8 Sir Operator Resulting Shape o ellipsoid a b c real sdiv integer shape ellipsoid a b c real shape These functions construct the ellipsoid of dimension a b and c about origin Evaluating Param
146. r Any token can be interpreted as a string or lispob The obvious Developer s Guide 2 13 7 96 The Basics restrictions apply to integers and reals IDs must follow the SIL rules for IDs alphabetic character followed by a sequence of non delimiters Reading a token as a lispob and a string may yield different results The readin command reads one token from the input and then discards the rest of the line if any on which the token appears In addition to the read and readin procedures the following functions are available M read_char reads just one character and returns its ASCII code E read_token reads one token and returns it as a lispob E read_line reads an entire line and returns it as a string independent of what may appear in the line 2 14 SilTools Input Output Example 2 13 shows examples of read and readin N 3 a G a v ae Developer s Guide 7 96 The Basics Whiting to the Screen Reading and Writing to a File 2 16 SilTools Input Output N 3 a G a v Developer s Guide 7 96 The Basics Additional operations on files are read_char lt text gt read_token lt text gt read_line lt text gt 2 18 SilTools Symbols Symbols This section contains explanations and examples of the following topics gt Identifiers gt Useful Symbol Operations N AS o m v S E Intern E Concatenation E i
147. r s Guide 5 7 7 96 Classes 5 8 SilTools Views Views This section contains the following topics gt Changing Views gt The as_view Operator vs the to_view Operator Preceding sections showed how objects can be related to each other through specialization generalization This section defines a new relation between objects called referential equivalence that extends specialization generalization Developer s Guide 5 9 7 96 Classes 5 10 Example 5 10 defined the student programmer student the programmer programmer5 the foreign employee f_emp12 and the employee wong In fact all of these objects represent the same person dynamic entity but from different points of view For this reason objects are sometimes referred to as views SilTools Views Two objects are referentially equivalent if they are both views of the same entity Clearly if object A generalizes object B then A and B are referentially equivalent But two objects can be referentially equivalent without one generalizing the other In our example f_emp12 and student9 are referentially equivalent but neither generalizes the other The list of all views referentially equivalent to an object is given by the function views The views function returns a list of universals objects like any other SIL data can be cast to and from universals The list of classes to which these views belong is given by the function classes
148. r 9 Advanced Data Types provides detailed pools information about the above concepts 1 4 SilTools SIL Language Overview The Object System The definition of a class in SIL is very similar to a Pascal or SIL record definition 3 te oe 5 Dc oO 8 5 ze Aen 2D type lt new class gt class superclass lt class1 gt superclass lt class2 gt lt instance var 1 gt lt type1 gt lt instance var 2 gt lt type2 gt end Rather than introducing a special syntax for passing messages SIL uses ordinary function application syntax For example if x is an object and you want to send it the message f with additional arguments a1 an you would enter f x a1 an Also to define a method f for a class A you would use ordinary function definition syntax function f x A lt a1 gt lt type1 gt lt result type gt Var begin end In SIL as in any object oriented language an object usually belongs to several classes if it belongs to a class A it will also belong to each of the superclasses of A and their superclasses and so forth Internally an object is represented in SIL by a linked list of views and one view exists for each class to which the object belongs A view is a record structure containing the values of instance variables for its class and a few words of object system overhead A SIL object can be visualized as a property list
149. r your IGES to SilTools or SilTools to IGES conversions you can also do so using SIL language commands IMPORTANT You must have the IGES interface installed in your product SilTools IGES Conversions Converting IGES Files to SiTools Models You may convert IGES model files to SilTools models with the iges_to_model function The variants for this function are listed below There are four variants for the iges_to_model function lt filename gt is a string giving the pathname of the IGES file to be converted lt model name gt is a string which names the converted model lt level list gt is an integer list specifying the levels of the IGES file to be converted iges_to_model If you do not specify a lt filename gt in this variant SilTools will prompt you for it If you specify a lt filename gt the converted model receives the product identification name from the globals section of the IGES file and SilTools processes all IGES entity levels iges_to_model lt filename gt iges_to_model lt filename gt lt model name gt lt level list gt This variant specifies a level list which will be the only level converted Specifying a level list prevents SilTools from converting all levels SilTools will return the model value type iges_to_model lt filename gt lt model name gt This variant reads all entities and converts all levels ann 9 36 ME De 36 Bg P Developer s Guide 8 17 7 9
150. ression gt lt expression gt Example 5 17 SIL gt apply monthly_ salary programmer5 LUNTVER SAT ZOSS SSIZ52 Oln Aes IavALs The apply operator scans the list of views in the reverse order in which the views were created searching for an object that can respond to the desired method Thus apply implements late binding of methods to messages the method is determined at runtime not compile time Runtime denotes the time at which code executes while compile time denotes the time at which code is read in whether or not it will be compiled or interpreted The apply operator searches views of its first argument If the first argument is a universal which at runtime turns out to be an object the view search will still take place 5 16 SilTools View Manipulation The applyn operator works in the same way as apply but returns a failure indicator when no method is found rather than generating an error Use is_fail to test for failure apply provides the kind of late binding which underlies the SmallTalk and Objective C object systems An alternative SIL late binding mechanism which resembles the C virtual NOTE function facility is described in Abstract Classes on page 5 19 We recommend this mechanism over using apply The reasons for this are explained in Using Methods Instead of apply on page 5 23 View Manipulation Two simple operators are provided for directly manipulating the views
151. rface together the resulting glued object will consist of two parts a glued surface and a glued wireframe Developer s Guide 8 15 7 96 Modeling Using SL Commands The moveto Operator The moveto operator returns a model which is lt model gt moved to the absolute coordinates lt goal gt lt goal gt may be either a position orientation is unchanged an orientation position is unchanged or a complete pose Note that moveto does not redefine the reference frame of the returned model the reference frame goes with the model moveto lt model gt lt goal gt The imoveto Operator The imoveto operator is similar to moveto but does not move the object along a straight line path towards the goal imoveto instantaneously places the object at the goal without consuming any simulated time The moveby Operator The moveby operator is similar to moveto but the model value that moveby returns is lt model gt moved by the specified lt increment gt The increment may be a position orientation is unchanged and orientation position is unchanged or a complete pose Note that the lt increment gt specified causes an incremental move along or about the axes of the World coordinate frame not the axes of the lt model gt s reference frame moveby lt model gt lt increment gt IGES Conversions 8 16 Although you use the CAD Interfaces panel displayed by selecting Import Export from the Modeling pulldown menu fo
152. rt t2 1 start t3 2 end adds t1 t2 and t3 to the run queue with the given inputs In Text Mode run initiates their concurrent execution The behavior of tasks run differs slightly depending on if you are programming using the menus or in Text Mode When using the menus the Scheduler is active whenever tasks have been started or called In Text Mode the Scheduler is activated only by NOTE explicitly calling a task or executing the following command run The start command may be used at the top level or within a task Use the run command only at the top level SilTools The Scheduler gt o a 3 0 fa e Oo If the global flag sched_verbose is set to true then the scheduler will print out a very detailed account of its activities one descriptive line for every task call start return and delay Developer s Guide 10 5 7 96 Concurrency Tickers Tickers are instantaneous commands that run at regular intervals during a simulation Care must be taken when writing a ticker if it is computationally intensive or runs too often the simulation may slow considerably Tickers are useful for gathering data during a simulation and for applying rules and laws to the simulated environment This function constructs a ticker which runs an application at the given interval of the simulation clock function mk_ticker app application intv real ticker
153. rthermore patching over a compiled c_import will prevent it from functioning thereafter Importing a C function into SIL is quite simple For integers and reals only a c_import command is needed One restriction exists all C functions imported into SIL must obey the reals last rule which requires real parameters to appear after parameters of other types in the parameter list Irecords or arrays can be used to pass structured data back and forth to C C code may read values from these Irecords and arrays and stuff new values into them as a way of returning structured data Alternatively the types described in C Data Types on page 9 15 may be used to create data structures in SIL which are identical to C data structures and can be freely shared between SIL and C code The only style of sharing which will not work is to attempt to build SIL data structures like Irecords and SIL arrays in C code This is because all structured data in SIL needs to be allocated in a way that is consistent with garbage collection methods in SIL so simple C mallocs will not do NOTE SIL integers correspond to the C type int and SIL reals correspond to the C type double Interfacing to Existing C Code Of course in many applications the task will be to interface to an existing body of C code rather than to write new C code for use with SIL In the former case unless it is very simple wrappers written in C will be needed for transporting data b
154. ructor 2 20 interpreted code 11 15 interpreter SIL 1 8 1 14 2 6 2 13 4 16 invert operator 8 14 is_array function 9 3 is_closure function 9 3 is_fail function 5 17 9 11 is_frame_or_teacher function 6 23 is function function 9 3 is_general_gtool operator 6 15 is_group command 6 24 is_group_gtool operator 6 15 is_integer operator 9 6 is_list function 9 3 is_mounted function 7 3 is_pair operator 9 6 is_primitive function 9 3 is_real operator 9 6 is_reptyp function 9 3 is_shape_click_gtool operator 6 14 is_string operator 9 6 is_task function 9 3 is_tclosure function 9 3 is_tracking function 7 2 is_undefined function 9 14 INDEX 5 Index iteration statement 1 15 1 17 iterative algorithm 4 7 J Japanese language A 1 K k variable 4 7 keyboard reading from 2 13 L label command 7 3 language non english A 1 late binding see bindings late 9 9 late binding mechanisms 1 6 lev see variables loop control least function 2 10 link 8 19 Lisp 1 2 lispob 1 4 9 4 11 27 casting 9 4 9 13 definition 1 4 1 10 9 4 operations on 9 5 9 6 pair constructor 9 5 mutators 9 5 selector 9 5 symbols 2 19 testing for equality 9 5 list operator 4 3 list_of constructor 4 1 list_subtype function 9 3 lists 4 3 4 7 car operator 4 4 cdr operator 4 4 cons operator 4 4 destructive operations 4 5 dynamic 4 3 empty 4 4 is_list function 9 3 iteration 4 7 length operator 4 5 INDEX 6 non destructive functions 4 5 null
155. s Guide 2 1 7 96 The Basics The help command also prints out type definitions as illustrated in Example 2 2 Procedures and Functions This section contains the following topics gt Defining Procedures and Functions gt Local Environments gt Nested Definitions gt Recursive Functions and Procedures gt Closures This section and Local Environments on page 2 6 describe features in SIL which are identical to Pascal so you may want to skim or even skip these sections if you know Pascal 2 2 SilTools Procedures and Functions Defining Procedures and Functions SIL can be used to define several types of programs The most common programs are procedures and functions but SIL also supports tasks processes and closures Tasks processes and closures will be discussed in later NOTE chapters N 77 m o p The primary difference between a procedure and a function is that a function returns a value whereas a procedure operates purely by side effect The syntax for defining procedures and functions is procedure lt operator gt lt formal parameters gt var lt local variables gt lt procedure body gt function lt operator gt lt formal parameters gt lt type gt var lt local variables gt lt function body gt The optional formal parameters and local variable declarations in the following code are sequences of variable declarations lt l
156. s and mnode class wireframe models 8 12 WM handlers 6 4 write statement 2 16 writeln write commands 2 17 X xyz geometric type 3 12 Y yaw see geometry yaw pitch roll see geometry Z Z Y Z Euler angles 3 12 zyz geometric type 3 12 INDEX 13
157. sed by reference even though they are passed to SIL functions by value No problems will arise from passing records to C but attempting to return values in records rather than Irecords is discouraged A SIL Irecord or record type lt type gt generates a corresponding struct declaration of the same name and defines lt type gt p to be the type of pointer to this type lt type gt p is the type assigned to incoming arguments from SIL Since passing of records and Irecords to C is identical the type Ipoint and point generate C declarations of identical structure Notice however that an array of points and an array of Ipoints differ the former is given by a pointer to a point and the latter by a pointer to a pointer to an Ipoint Passing Other SIL Types The SIL type string is passed to C as stringob discussed further in the Protecting the Data Space when Passing Strings on page 11 32 The rest of the SIL types excluding the ones already mentioned are passed simply as lispob The sample C file starts with a few includes These inclusions bring in various basic definitions associated with the underlying implementation of SIL in C It is here that the types stringob lispob real and integer are defined Passing a SIL Array A SIL array is passed to C as a pointer to some header information used in SIL not to the beginning of the array itself The first element of the array is arrived at by using the macro ARRAY_BODY and its
158. ses of programmer In SIL it is possible to define a class with two immediate superclasses For example 5 14 SilTools Multiple Inheritance Multiple inheritance can be used only when the superclasses given for a new class were derived from some common ancestor Ambiguity Accessing the language attributes of c_c1 causes some ambiguity It is unclear whether to expect programming languages or spoken languages to be returned In this example methods are applied to the second generalization before the first There is no satisfactory rule for deciding how to make messages less ambiguous Ambiguous messages should be avoided or you should explicitly change views For example It is our experience that the availability of as_view and to_view combined with the dangers of multiple inheritance makes multiple inheritance an unsatisfactory choice for most applications Developer s Guide 5 15 7 96 Classes Using apply on Views Views on page 5 9 showed how the methods and attributes of an object can be accessed by any referentially equivalent object by performing the appropriate view change using to_view or as_view When using to_view or as_view the class of the new view must be known in advance An expression like foo student9 to_view cadr views x where x is a variable will cause an error We can put off the view change until runtime by using apply apply lt method gt lt object gt lt exp
159. so Russell s paradox is avoided Type Expressions 9 2 An interesting feature of SIL is that type expressions like integer and list_of array_of real are data objects themselves Thus we can create and evaluate expressions like foo integer or foo integer All type expressions are ntype This may seem a little paradoxical i e can we define the type of all types that are not members of themselves until you realize that type expressions are just syntactic entities that evaluate to types SilTools Type Expressions Example 9 1 An integer predicate type is any type of the form function boolean integer integer The following is a predicate that determines if a type is an integer predicate type function integer_predicate_type tp ntype boolean var temp boolean begin temp is_function tp and result_type tp boolean if temp then for iin input_types tp while temp do temp i integer integer_predicate_type temp end N o S Ee S 2 Q c gt lt The following is a partial list of the primitive operations on ntype The names of the functions are self documenting function is_primitive n ntype boolean function is_reptyp n ntype boolean function is_array n ntype boolean function is_list n ntype boolean function rep_of n ntype ntype assumes n is represented type function list_subtype x ntype ntype function subtype x ntype
160. spect the vertices of the curve and not round them Note that a shape is returned and not one of the surface types The subshapes of this shape are the rectilinear dsurface and or smooth psurface pieces of the shape The variables with_top and with_bottom give the resultant shape a top or bottom respectively Note that the axis of rotation is along the Z axis of the World coordinate system SilTools Modeling Constructors Operator Resulting Shape mk_rvsurf_shape pc pcurve theta real shape with_bottom with_top boolean mk_rvsurf_shape pc pcurve theta real shape Do mk_rvsurf_shape pc pcurve shape z S mk_rvsurf_shape pcs list of pcurve theta real shape 2 with_bottom with_top boolean 3 e mk_rvsurf_shape pcs list of pcurve theta real shape Z0 mk_rvsurf_shape pcs list of pcurve shape mk_rvsurf_shape ax seg3dr pcs list of pcurve shape theta real with_bottom with_top boolean mk_rvsurf_shape ax seg3dr pcs list of pcurve shape theta real mk_rvsurf_shape ax seg3dr pcs list of pcurve shape with_bottom with_top boolean mk_rvsurf_shape ax seg3dr pcs list of pcurve shape Geometic Constructors Conic Constructors Let z be of type conic2dr structure has general conic coefficients Let tp be an integer from hyperb_type elips_type parab_type The next mk_ellipse and mk_hyperbola function below NOTE use type conic_data tuple_of frame real real intege
161. sses The following operator makes an astack with the Istack implementation function mk_Istack astack var a astack l Istack begin a mk_astack mk_Istack a emptylist ob set_method a push push list Istack ob set_method a ipop pop list Istack set_method a empty empty list Istack mk_Istack a end Note that no method is assigned to on_underflow A user of astack is free at any time to execute a set_method to install a method for underflow For example Consider what we have done in Example 5 23 astack is abstract because no aspect of its implementation is specified We have given one concrete implementation Istack but there could be many others Code that makes use of astacks will work with any concrete implementation 5 22 SilTools Abstract Classes Using Methods Instead of apply In earlier versions of SilTools you needed to use this kind of code to implement abstract classes in SIL procedure pop x astack begin apply pop1 x end Here the manner of pop done depends on the views that x has at runtime Using methods instead of apply has two advantages 1 Invoking a method is faster than performing an apply it only involves a couple of pointer chases to find the implementation of a method rather than a search 2 The method style gives the builder of an object control of the methods installed into the object s abstract views because this inst
162. str_to_str x Istring string function to_Istring x string Istring procedure float2lstr y real Is Istring function find cnx string Inx integer cny string Iny integer integer function find x string y string integer function find x Istring y string integer function find x Istring y Istring integer procedure concat_onto x Istring n char SilTools Records and Irecords Records and lrecords This section describes the user defined types records and Irecords Records are always defined within the scope of a type definition at the top level The syntax follows Pascal type lt name gt record lt field gt lt field gt lt type gt lt field gt lt field gt lt type gt end where lt field gt and lt name gt are identifiers n Q Q gt s a Developer s Guide 7 96 Data Types Unlike Pascal records defining a record in SIL automatically defines a constructor function that enables you to create records in a single statement The name of the constructor function adds the prefix mk_ to the name of the record illustrated in Example 4 20 Unlike Pascal SIL functions can return records as values A simple example is the definition of a customized constructor Defining customized constructors is a good technique if several fields have standard default values see page 4 19 function mk_employee name string ag
163. sults of using the shape field or gtool you can use this function after the pick is made get_pick_extended_info pick_extended_info Detailed information on the result of the pick will be returned The structure of the pick_extended_info Irecord includes the following fields Variable Type Meaning something_selected boolean Was anything selected selected_object object The selected object point_was_selected boolean Was a vertex selected selected_vertex point Coordinates of the selected point seg_was_ selected boolean Was a line segment selected selected_seg seg The selected line segment facet_was_selected boolean Was a facet selected selected_facet_point point selected _facet_normal dir3dr selected_screen_point pnt2di The point selected on the facet The normal to the selected facet The screen coordinates of the mouse selection Table 6 3 Graphical picking global variables Developer s Guide 7 96 o So O Do ST EL ES 0 gt Do oD a 6 19 Programming the User Interface 6 20 Widget Toggles A common use of the toggle is to switch between distinct but related operations To conserve panel space multiple container widgets are overlaid beneath the toggle Adding a monitor to the toggle enables the container to be initialized when it s displayed Selecting an operation with the toggle displays a specific container that has all widgets needed to perform the oper
164. surface mk_gsurface g grid makes grid gsurface for which normals are calculated automatically psurf_to_gsurf z psurface generates discrete grid surface out of psurface crvs1 crvs2 gsurface gsurface gsurface first and second curve list Operator Resulting Shape mk_rsurf crvs1 crvs2 list of pcurve rsurf Be sure that pcurves are oriented correctly to avoid twisted ruled surfaces Developer s Guide 7 96 D a 9 36 JE De 36 Bg P Modeling Using SL Commands Surface of Revolution crvs generatrix curves theta angle revolution in rad ax axis of revolution Operator Resulting Shape mk_rvsurf crvs list of pcurve theta real rvsurf mk_rvsurf crvs list of pcurve rvsurf mk_rvsurf ax seg3dr crvs list of pcurve rvsurf theta real mk_rvsurf ax seg3dr crvs list of pcurve rvsurf Tube as rvsurf r radius of tube a angle revolution in degrees 0 to 360 h height of tube ur resolution in circular direction if omitted c_circe_res is used Operator Resulting Shape tube r a h real ur integer rvsurf tube r a h real rvsurf tube r h real rvsurf SilTools Modeling Constructors Funnel as rvsurf r1 r2 first and second radii of funnel al angle revolution in rad h height of tube D V ur resolution in circular direction 3 2 Operator Resulting Shape 2 E funnel r1 r2 a1 h real ur integer rvsurf 3 a funnel r1 r
165. t lt Icv gt successively takes on each value in lt list gt and evaluates lt statement gt See Lists on page 4 3 for examples of this In the second kind of for statement lt Icv gt is initially set to lt first gt and lt statement gt is evaluated Thereafter lt Icv gt is incremented or SilTools The SIL Runtime Model decremented depending on which key word to or downto is used After each increment decrement lt statement gt is evaluated After lt Icv gt reaches the value lt stop gt unless the while clause is used control passes to the next statement is 0 of c 53 o dD mm Oo 0G 5 O F7 Definitions SIL uses five categories of definitions Rule 1 10 lt definition gt lt global variable definition gt lt variable declaration gt lt type definition gt lt procedure definition gt lt function definition gt Globals The syntax for defining a new global variable or re defining an old global is lt variable gt lt term gt Developer s Guide 1 19 7 96 Intoduction to the SIL Language 1 20 This statement assigns the value of lt term gt to lt variable gt even if lt variable gt was not previously declared or was assigned a value of a different type Types To define new data types use the following syntax type lt type definition gt lt type definition gt where lt type definition gt lt type name gt
166. the cone if omitted the value of the global variable c_circ_res is used Operator Resulting Shape cone lt radius gt lt height gt lt resolution gt cone Developer s Guide 8 13 7 96 Modeling Using SL Commands Frustum radius1 base radius radius2 top radius resolution specifies the number of trapezoidal facets in the circumference of the frustum if omitted the value of the global variable c_circ_res is used Operator Resulting Shape frustrum lt radius1 gt lt radius2 gt lt height gt truncated cone L lt resolution gt Model Operators 8 14 In addition to the model constructors SilTools provides a number of functions which you may apply to models in order to change their characteristics These functions are called model operators A list of the model operators and a brief description of each follows The invert Operator The invert operator returns a model whose facets face in the direction of their original direction This has the effect of turning the model inside out invert lt shape gt The glue Operator The glue operator is used to convert a workcell model into a rigid model glue lt model_name gt where lt model_name gt is the name of a model existing in the workcell SilTools Model Operators A workcell model may be an object tree which has several child objects If an object tree is glued SilTools replaces the tree structure of the object tree with a rigid
167. thin a tool set Tool bodies are holders for one or more shape selectors or gtools which bind one or both of the mouse buttons Tool bodies are always associated with container widgets often overlaid such that only one is visible at a time In a typical scenario a panel consists of a switch a set of operations where selecting an operation causes a particular container to appear and its tool body to be activated Each tool set has at most one current tool body which will be activated when the tool set is and the tool set can bind one or both of the mouse buttons as default if the current tool body does not Example 6 6 The move tool set includes a shape_field which determines which shape will be moved The tool set has many tool bodies one of which is the XY tool_body The tool set in this case binds the middle button and the XY body binds the left button In particular clicking the middle mouse button in the Graphics Window or the Quick Pick Window updates shape_field field to that shape Clicking or dragging the left mouse button causes the current shape_field shape to jump or drag to the location on the XY plane over which the mouse is clicked or held down In general browser shape fields should be used only in cases where an operation is primarily graphical in nature meaning that the mouse will remain in the graphics views for the duration of the operation Because a tool set takes over the current mouse bin
168. top_init sil welcome msg startup msg PWN layout files 6 appsol marking the module as an appsol The appsol can then be used in the Product Administration panel by first editing the file cim options versions and adding the line lt module gt lt version gt Again a module should be listed only once Dependency Management 11 12 SilTools has a mechanism for handling dependencies between modules build areas which ensures that dependent and supporting modules are included during product creation Modules Two files can be created and placed in the cim build lt mybuild gt directory to supply information about any dependencies in the mybuild build area These two files are supmodules This file specifies the build areas that must come before the mybuild build area when creating a product SilTools Dependency Management comodules This file specifies the build areas that must also be included when the mybuild build area is included in a product when the order is unimportant Both supmodules and comodules have the same syntax Modules listed in the supmodules file within the cim build lt mybuild gt directory will be linked in before the mybuild build area during product creation A simple example of a supmodules or comodules file is robot paint paint14 arc In this example no version is specified for robot Therefore the current version for robot will be used listed in cim silspec versions For
169. tor 9 6 reals last rule 11 23 stackval 1 23 records 4 17 4 20 casting 9 12 constructor 4 18 customized 4 18 crecords 9 15 defining 4 17 heapval 1 24 lrecords 4 20 9 15 mk_ prefix 4 18 passing to C 11 27 stackval 1 23 syntax for 4 17 recursive functions 2 8 2 9 reference system 3 1 referential equivalence 5 9 5 11 rel operator 3 18 remake command 11 9 11 10 remove_view operator 5 17 remove_widget_toggle_entry procedure 6 20 rep_of function 9 3 INDEX 9 Index repeat statement 1 17 result_type function 9 3 roll see geometry rotation 3 3 ruled surface 8 23 run command 10 4 run queue 10 4 runtime 5 16 Russell s paradox 9 2 rvsurf shape 8 6 S sarray 4 11 sarray_create command 4 11 save_my_data procedure 6 26 save_r_current_layout command 6 31 scalar types 4 2 9 1 sched_verbose global 10 5 Scheduler 10 3 sconst 9 13 9 14 undefined_sconst 9 14 scope_out script 11 14 screen writing to 2 16 seg_pose frame 8 11 selector see shape fields semaphore 10 6 10 9 semicolon use of 1 20 2 4 send_message command 5 3 sequences 1 15 set_body procedure 6 17 set_car procedure 9 5 set_cdr procedure 9 5 set_field_filter command 6 8 set_footer_handler command 6 10 set_handler command 6 31 set_handler procedure 6 7 set_help command 6 28 set_label_icon command 6 31 set_method command 5 25 set_supports_multi function 6 14 shape data type 3 2 shape fields 6 11 creating 6 13 INDEX 10 fi
170. tors Conic Constructors Bezier Curve Constructor Bezier Patch Constructor Conic Surface Constructors Evaluating Parametric Shapes Parametric Curves Parametric Surfaces Wireframe Models Volume Models Cylinder Block Pipe Cone Frustum Model Operators The invert Operator Developer s Guide 7 96 Table of Contents 6 33 8 1 8 1 8 2 8 3 8 4 8 4 8 4 8 5 8 5 8 6 8 6 8 7 8 7 8 7 8 8 8 9 8 9 8 10 8 11 8 11 8 11 8 11 8 12 8 12 8 13 8 13 8 13 8 13 8 13 8 14 8 14 8 14 Table of Contents The glue Operator The moveto Operator The imoveto Operator The moveby Operator IGES Conversions Converting IGES Files to SilTools Models Converting SilTools Models to IGES files Modeling Examples Chapter 9 Advanced Data Types System Defined Types ntype Type Expressions lispobs lispob Operations Represented Types Universals Applying Procedures Applications Casting Efficiency Considerations SIL Constants C Data Types C Records and C Arrays C Strings C Constants at Build Time Chapter 10 Concurrency vi Temporal amp Instantaneous Commands The Scheduler Tickers Semaphores Pipes Processes and tclosures pa pe a EE a OMAANINDNDAAAY WWD OO OO O0 O0 OC 9 2 9 2 9 4 9 5 9 6 9 7 9 8 9 11 9 12 9 13 9 14 9 15 9 15 9 17 9 19 10 1 10 3 10 6 10 6 10 10 10 12 SilTools Table of Contents Chapter 11 Working with SIL Code Protection 11 1 Code Organization 11 2 The Cim
171. ts the foreground color for all monochrome bitmaps BACKGROUND lt STRING gt Sets the background color for all monochrome bitmaps TEXT LEFT lt X COORD gt lt Y COORD gt lt STRING gt Writes text left justified starting at X Y Example TEXT LEFT 200 100 This is a test product TEXT RIGHT lt X COORD gt lt Y COORD gt lt STRING gt Writes text right justified ending at X Y TEXT CENTER lt X1 COORD gt lt X2 COORD gt lt Y COORD gt lt STRING gt Writes text centered between X1 and X2 at Y IMAGE PLACE lt X COORD gt lt Y COORD gt lt LOGO FILE gt Shows image as location X Y Example IMAGE PLACE START START test_logo IMAGE CENTER lt X1 COORD gt lt Y1 COORD gt lt X2 COORD gt lt Y2 COORD gt lt LOGO FILE gt Shows image centered between X1 Y1 and X2 Y2 COORD START END The edge of the screen number Offset from the lower right corner number Offset from the upper left corner STRING R C TM LOGO FILE A bitmap or pixmap from the cim gui icons logo directory SilTools Chapter 7 Vision SIL functions can be installed inside user programs to perform the same actions as selecting the Vision panel selections Using SIL functions in this way enables users to create programs for simulating vision or even choreographing their simulations In the case of choreography the cameras can be hidden so that the camera ring is not visible when enabling vision
172. tsetq E id2string A symbol is a name Constants variables type names and function procedure names are examples of symbols SIL features symbols that not only name data objects lispobs but are data objects themselves In this way a symbol can be passed to a function procedure as a parameter returned from a function as a value or can be named by another symbol which might be a variable or a constant Developer s Guide 2 19 7 96 The Basics 2 20 Identifiers The SIL data type of all symbols is called id which is short for IDentifier Of course SIL expressions must distinguish between use and mention of an id To make this distinction precede all mentions of an id with double quotes Useful Symbol Operations The following section contains descriptions and examples of commonly used symbol operations Intern To promote a string to a symbol use the following construction intern lt string gt This constructs and returns a symbol with print name lt string gt SilTools Symbols Concatenation To concatenate two or more symbols and return a new symbol lt symbol1 gt lt symbol2 gt N o D e faa o S i_tsetq To assign a lispob lt value gt of type lt type gt to lt symbol gt from inside of a program use i_tsetq lt symbol gt lt value gt lt type gt id2string To get the print name of an id use id2string lt symbol gt Developer s G
173. u to iterate over lists illustrated in Example 4 7 a Q Q gt a m In Example 4 8 we change sum2 to take an arbitrary number of integers as input and return their sum This is slightly different from Example 4 5 where sum1 expects a single list as input Developer s Guide 4 7 7 96 Data Types Arrays Like lists SIL arrays are also dynamic This means that arrays can be created during program execution The call array_create lt type gt lt integer gt returns an array of base type lt type gt indexed from 0 to lt integer gt As in Pascal if v is an array and i is a valid index then v i is an expression whose value is the element of v with index i and v i lt term gt sets the index i component of v to be the value of lt term gt As with lists the type of lt term gt must match the base type of v or a type mismatch error will result 4 8 SilTools Arrays no Q Q gt a a Developer s Guide 7 96 Data Types 4 10 SilTools sarrays Unlike Pascal SIL functions can return arrays as values illustrated in Example 4 12 sanays An sarray is a dynamically allocated array which can grow and shrink during program execution You can add items to the sarray and the sarray will automatically resize itself to fit the new elements As with standard arrays if s is an sarray and i is a valid index then s i returns the ith element of t
174. uide 2 21 7 96 Chapter 3 SilTools Geometry Understanding SilTools Geometry This chapter explains the geometric terms used in SilTools and contains instructions for manipulating geometry with SIL commands instead of the menus These instructions are provided for programmers who need a fairly detailed guide for performing geometric manipulations Understanding SiTools Geometry Spatial geometry or simply geometry is the means of describing how objects are situated in the region of three dimensional space being simulated With SilTools geometric descriptions are used to construct and locate simulated objects SilTools uses those same geometric descriptions to perform kinematic transformations on the simulated objects for moving them around the simulated space gt D fo 0 a 8 a Geometic Tems The language used in this manual and when speaking about SilTools entities contains terms like coordinate system frame pose and reference system The following items explain the distinctions between these terms E All shapes have a pose E Frame shapes are a special kind of shape which also possess a pose E The current reference frame is some shape s pose E Frame shapes are physical objects in the simulated world and can usually be picked with the mouse like any other shape E Poses can be displayed but are ephemeral they cannot be selected Chapter 2 of Introduction to Robotics
175. use movement 6 17 mouse wiring 6 15 shape click tools 6 14 6 17 tool actions 6 17 SilTools H h files 11 4 11 23 handler 6 7 6 31 has_data_variant function 9 14 has_function_variant function 9 14 heap 1 4 1 23 9 13 9 19 heapval 1 23 help command 2 1 help files 6 28 help files adding 11 7 home directory 11 2 hyperbola adding 8 3 8 10 I T O 2 13 ASCII files 2 16 EOF 2 18 files reading amp writing to 2 16 read command 2 13 read_char function 2 14 read_line function 2 14 read_token function 2 14 readin command 2 14 i_tsetq operator 2 21 ib_pop_file procedure 6 25 id 9 14 id2string operator 2 21 identifiers 2 20 ifilter method 6 13 IGES converting a model to a file 8 18 converting with text 8 17 imoveto command 8 16 importing C functions 11 23 in_frame operator 3 18 infix operators 1 13 syntax 2 12 info_dialog function 6 26 inheritance 5 1 5 4 5 6 multiple 5 14 init sil file 11 5 11 6 initialization file 11 5 11 6 Developer s Guide 7 96 Index initializing shape_selector command 6 14 input output see I O input_types function 9 3 install_new_list_entries command 6 31 install_new_widget_toggle_eniries procedure 6 20 instantaneous block 10 1 instantaneous commands see tasks integer constructor 4 1 data type 4 1 division 4 2 is_integer operator 9 6 pipe 10 10 stackval 1 23 string converting to 4 14 integer type 4 2 9 1 integer_predicate_type function 9 3 intern const
176. utolevel c string op boole where C is the camera op true switches auto level on and op false switches auto level off default This function returns the auto level status of a specified camera This procedure activates vision in the current view This function provides information about the tracking status function autolevel c string boole where C is the camera procedure vision c string op boole where c is the camera that will have vision enabled for it op true switches vision on and op false switches vision off function is_tracking anno_shape Returns if the camera in the current window is tracking and what the target is provided vision is switched on in the current view Returns false empty shape if vision is switched off SilTools This function provides information about where the lens is located function is_mounted anno_shape Returns TRUE provided vision is switched on The shape that is returned is the object the lens is affixed to To find out which camera has vision switched on use label parent is_mounted val Developer s Guide 7 3 7 96 Vision 7 4 SilTools Chapter 8 Modeling Using SIL Commands The model Data Type Creating models using the menus and panels is usually the most efficient way to create models You can also however create models using the SIL language The first part of this chapt
177. utton is always used for selecting global_getob_kind should not to be confused with NOTE the shape_selector object mentioned below Both shape processors and shape selectors have an option that enables the user to select more than one object if desired If this option has been added to the shape field the widget looks different Multi Pick Shape Processor Multi Pick Shape Selector Figure 6 1 Multiple object shape fields Groups on page 6 24 provides additional commands or used in multiple object shape selection The value of a shape field can either be a shape or a string The function shape_field_has_shape is used to test for which one it is Two accessor functions are used to get the appropriate value shape_field_shape_value for a shape and shape_field_string_value for a string If more than one shape was selected the group shape is returned The shape_selector class provides a way of indicating a shape by abstracting the common functionality of the shape fields As a special case a shape field is hooked up slightly differently than other widgets 6 12 SilTools Advanced Widget Programming To run an action whenever a shape or shapes is selected set the shape selector s iexecute method iexecute method if any is called when the value of the shape field is changed Note that the execute method if set should take an mnode as argument To add a filter to the shape field set the shape selector s i
178. vent eb 8 Do sT 32 EPS 6 Do o gt A Developer s Guide 6 7 7 96 Programming the User Interface Monitors Widgets such as sliders and text fields which record a value entered by the user have a kind of callback called a monitor A monitor is very close to a handler it is a SIL procedure taking an mnode as input that is run whenever a new value is entered in a widget add_monitor mn mnode h id adds a monitor to mn Optionally filters may be added to a field such that only certain legal values may be entered The filter function is called before the value is accepted by the widget and returns TRUE or FALSE indicating whether the value is legal If the filter returns FALSE the value will not be accepted and the field s monitors not called set_field_filter mn mnode h id adds a filter to mn 6 8 SilTools Developer s Guide 6 9 7 96 Simple Widget Programming You need to reset the field s value in case the filter rejects the new value or else the illegal value will remain in the field s display You can also notify the user that a illegal value was entered by displaying an information box Each kind of widget has an accessing function that allows the current value to be read as in this example o o t5 D G COS 2 Ss O Do 2 gt ra Programming the User Interface The SIL code implementing handlers and monitors and also the code which
179. w about X 2 Pitch about Y 3 Roll about Z The order in which the rotations are performed is important In general a rotation about x followed by a rotation about y followed by a rotation about Z yaw pitch roll will not produce the same orientation as a rotation about Z then about Y then about X roll pitch yaw SilTools Orientation Figure 3 10 shows the difference between a yaw pitch roll of 90 90 90 and a roll pitch yaw of 90 90 90 Roll Pitc h Yaw 90 90 90 Pee ae a ae PN T ae Y n X Z REF X REF O REF Z XREF YREF p REF Y REF Yaw Pitc h Roll 90 90 90 E ae yee raw 9 o YZ e ee Z 7 a Z REF 3 7 x REF 9 REF XREF Y REF a REF YREF Figure 3 10 Roll Pitch Yaw vs Yaw Pitch Roll For mnemonic reasons the rotations will always be performed in the order in which they are specified Because X Y Z is a familiar order yaw pitch roll is only used in SilTools for rotations about the fixed axes of the reference frame copy Because all three rotations are defined relative to the same initial frame orientation these rotations are relative to fixed axes This is a key point since Euler angles are rotations which are not relative to fixed axes The geometric type provided by SIL for describing yaw pitch roll orientations is ypr yaw pitch roll You may construct a yaw pitch roll orientation with the command mk_ypr lt yaw gt lt pitch gt lt roll gt Developer s Guide 3 11 7 96 SiTools G
180. y team1_leader 3541 666748 In this example you would enter monthly_salary team1_leader at the SIL gt prompt After you press lt RETURN gt 3541 666748 would be displayed in the shell window SilTools Manual Conventions SIL Syntax Sections showing syntax of more than one line have a box around them The code sometimes contains variables indicated by lt gt symbols function f x A lt a1 gt lt type1 gt lt result type gt Var begin end SiILCode Examples The examples are printed in gray boxes They include explanatory text and code The code may be entered as shown Rules Rules are shown with a dark gray title bar and a box around the rule lt sequence gt begin lt statement gt lt statement gt end Windows Windows that are part of the display are indicated in talics Examples Quick Pick Window and Graphics Window Developer s Guide ix 7 96 Using this Manual Filenames This typeface is used for filenames Example default sil isa file Keys Keyboard keys are indicated by the lt gt symbols enclosing the key in capital letters in THIS TYPEFACE Example lt RETURN gt is a key The Top Bar Pulldown menus from the top bar are indicated with bold letters in This Typeface Example File is a pulldown menu Panels Panels are indicated with This Typeface Example Collision Detection is the title of the panel that is displayed when
181. ype definitions 2 2 type expressions 9 2 lt type gt p type 11 27 U ucap view 6 3 umodules file 11 6 11 13 unary operators 1 13 1 14 undefined_sconst 9 14 underflow method for 5 22 universal type 1 4 9 7 11 19 casting to 9 13 Universe coordinate system 3 16 SilTools uppercase operator 4 13 user defined types 1 10 4 2 V variable declarations 1 21 variables 1 12 declarations 2 3 defining 1 9 free 2 6 global 1 9 1 19 local declaration 2 4 loop control 1 18 4 7 variants 2 11 9 14 version creating a new 11 10 views 5 9 5 13 5 17 as_view operator 5 13 5 16 changing 5 12 definition 1 5 manipulating 5 17 mnode view 6 3 referential equivalence 5 11 remove_this_view operator 5 17 splice operator 5 17 to_view operator 5 13 5 16 ucap view 6 3 views function 5 11 vision commands 7 1 7 3 vision procedure 7 2 Visual SIL Window 6 6 6 13 11 6 W wait command 10 12 wait operator 10 7 10 11 waiters queue 10 10 10 11 while statement 1 17 widgets 6 1 actions 6 17 appearance 6 1 behavior 6 3 buttons 6 7 container 6 1 6 16 fields 6 8 Developer s Guide 7 96 Index filters 6 9 graphical tools see gtools gtools 6 14 6 18 see also gtools handlers 6 7 monitored 6 3 monitors 6 20 operations 6 3 panel see panel primitive 6 2 shape fields see shape fields sliders 6 8 6 9 text fields 6 8 tool actions 6 17 tool body 6 16 tool set 6 16 ucap view 6 3 widget toggles 6 20 see also panel

Download Pdf Manuals

image

Related Search

Related Contents

マドリード 施工説明書  Netgear GS724T-300EUS network switch  組立説明書 【GR-99S/H GR  2big dual Manual    Installation manual eSaver iConnect Gateway  Presentación de PowerPoint  EcoSmart 701156 Instructions / Assembly  ÿþE SCO 0Ã0º0ñ‡ž−«0ü0É0  Installation Instructions Instructions d`installation  

Copyright © All rights reserved.
Failed to retrieve file