Home
SIMGRAPHICS II User's Manual
Contents
1. essere 58 SetFrameTranslation eese 58 SetGraph cuisine ro tei aed 91 SetHe adings eet 121 SetHeight sieeuaeteee 117 SetIconNames essent eene 59 Senn albatate essere 58 183 SIMGRAPHICS II User s Manual SetMappingMode AAA 52 SetMoveMonitoring eee 53 erh Gomm ane eet tette ree ee ee tates 55 SEO Set O er ROGER 74 SetOptiODS mesias 117 SetOrientation iere petet eene 74 SEtPAME Wide des 55 E EE 155 SAPO ia 75 SetPS Target ae oett end 75 SetRGBColor o eere 50 SetRotationSpeed sss 78 SetScale5peed dope inte 78 A ten ote 104 SetSbhow Wimdow esee 75 Dette ee EES EEN 49 121 152 SELSIZES cuite NH REIR sg 74 SetSOrted E 117 setSpeed re e eet a ia Ed eo 78 SetSubWindow eese 58 SetTranslation esses 49 SANO AAA e 121 SetVisibleSize nennen aa t ett 121 SetWindowName ooccccocccocccononononcnncnonnnnononncnnncconos 75 AA old idad 67 SetY2AxisTitle e eee edet 103 NU NICIDCAMET EE 55 ShowWorld eese 51 55 simple ploti n ati sis 86 SA m tette 70 solar SYSTEM x eet oc er ee 63 stacking enne pap 86 stacking order 15 16 Start MOTION victoria raros TI StartSimulation einean ia inasi 123 status bar AEAEE EEA EEE TE 49 55 StopMotion usina TI style palette 5 eret 9 18 sub window 0 0 eeeeceeeeeseeceeeeceeeeeeceeeeeseeneeeneeeeee 57 SySLeTECUESOT ird tre
2. Fn at the top of the keyboard Use Alt Use Ctrl Use Shift Specifies which modifier key must be held down in conjunction with the accelerator key described above e Accelerator Key Label This is the name appended to the menu item label used to describe how to invoke the keyboard accelerator For example the string Ctrl C could describe an accelerator activated by holding down the Ctrl key and pressing c Status Message If the window containing this menu bar has a status bar this help message will appear in the first status bar pane The text will be displayed whenever this menu item is highlighted by the pointer not necessarily activated e Checked Menu items can have an off on state shown by a small check mark next to the label The initial state is defined by the Checked attribute Note This state is NOT changed automatically when the item is clicked on but must be updated by the application program 40 Chapter 2 SIMDRAW 2 17 Using the Palette Editor The Palette Editor figure 2 5 provides a fast and easy to use drag and drop facility for cre ating and editing palettes toolbars etc A palette is usually attached to the side of your window but is sometimes a separate window and contains an array of buttons The face of each button can contain a bitmap icon or show a color Separator objects can be added to the palettes to produce space between groups of buttons You can d
3. one eoe 51 67 WorldYlo nitent 51 67 X Xd i E aces 20 RW uis iiti eet e PERRO ER RR 70 Y Ke G ME 21 Z ZOOM 30205 ces Ee eege 17 36 71 144
4. Carts Checkout Counters Aisles Cart 1 Cart 2 Cartn Counter 1 Counter 2 bos Countern Aisle 1 Aisle2 Aislen Figure 5 3 Image Tree for a Grocery Store 62 Chapter 5 Images An image tree can be built within SIMDRAW using SIMDRAW s grouping facility or can be constructed dynamically at runtime The Add and Remove methods inherited from GraphicVOb j are used to build and manipulate the tree structure For example suppose you wanted to graphically model the solar system You could do this by creating an ImageObj instance for the entire solar system and then add ten ImageOb j instances to it that represented the planets and sun VAR solarSystem ImageObj sun mercury venus earth mars ImageObj Get or create planet and sun images NEW solarSystem ASK solarSystem TO AddGraphic sun ASK solarSystem TO AddGraphic mercury ASK solarSystem TO AddGraphic venus ASK solarSystem TO AddGraphic earth ASK solarSystem TO AddGraphic mars When an operation is performed upon an image the operation is automatically performed upon its children in the tree In the example above if you were to draw the solar system image the planets would be drawn also Erasing the solar system would cause all the plan ets to be erased If you scaled down the solar system in size the planets would automati cally appear smaller as well as having the physical distances between them shrink Position a
5. VAR win Window3dObj lib GraphicLibObj camera CameraObj light LightObj cube Image3dObj front back left right top bottom Polygon3dObj toppts botmpts leftpts rightpts frontpts backpts PointArray3dType Closed BOOLEAN BEGIN 148 create a window to contain the cube NEW win ASK win TO SetTitle 3D Cube ASK win TO SetTranslation 25 15 ASK win TO SetSize 50 70 ASK win TO SetRenderMode SmoothShadeMode ASK win TO SetBackgroundColor MidnightBlue Set up global lighting ASK win TO SetLighting 0 1 O0 ASK win TO SetColor White create the cube Image3dObj It will contain six sides NEW cube ASK win TO AddGraphic cube to draw a cube we must create each of six of the cube s sides NEW frontpts 1 4 plane z 1 frontpts 1 x 1 0 frontpts 1 y 1 0 frontpts 1 z 1 0 frontpts 2 x 1 0 frontpts 2 y 1 0 frontpts 2 z 1 0 frontpts 3 x 1 0 frontpts 3 y 1 0 frontpts 3 z 1 frontpts 4 x 1 0 frontpts 4 y 1 0 frontpts 4 z 1 NEW backpts 1 4 plane z 1 backpts 1 x 1 0 backpts 1 y 1 0 backpts 1 z 1 0 backpts 2 x 1 0 backpts 2 y 1 0 backpts 2 z 1 0 Appendix B SIMGRAPHICS II 3 D backpts 3 x 1 0 backpts 3 y 1 0 backpts 3 z 1 0 backpts 4 x 1 0 backpts 4 y 1 0 backpts 4 z 1 0 NEW toppts 1 4 plan
6. ASK METHOD SetInitialState IN position WindowStateType Sets initial state minimized maximized of the sub window NormalWindowState means the sub window will appear somewhere within the frame window at less than maximized size MinimizedWindowState means the window will appear as anicon MaximizedWindowState means the window will appear maximized to the full extent of the frame window Implemented for Windows NT and Windows 95 platforms only Has no effect on other platforms Chapter 4 Windows ASK METHOD SetAutoGeometry IN useDefaultSizeAndPosition BOOLEAN Sets flag enabling the frame window to determine initial size and position of a sub window IF TRUE window Translation Width and Height fields are ignored ASK METHOD SetIconNames IN sIconName lIconName STRING Sets the names of icon bitmaps shown when the window is minimized Implement ed for Windows NT and Windows 95 platforms only Has no effect on other plat forms ASK METHOD BeActivated This method is called when the you activate a sub window Override this method to be notified of when a sub window is brought to the front 4 12 Control Windows SIMGRAPHICS II offers the ability to add controls like buttons and value boxes to win dows rather than just dialogs A control window is a window that contains any controls nor mally found inside a dialog box Control windows are implemented via the ControlWindowOb j object found in definition module Window
7. ASK METHOD SetY2AxisTitle IN y2AxisTitle STRING These methods set the text title display along one of the three axes Y axis title text will be automatically rotated 90 degrees while the Y2 axis title will be rotated 270 degrees ASK METHOD AddDataSet Adds a new data set to the chart Should be called once for every data set the chart is to contain Must be called BEFORE a new data set can be referenced ASK METHOD RemoveDataSet IN dsnum DSRefType Removes a data set from the chart All data contained in the data set is discarded and erased from the plot area Higher numbered data sets will be consecutively renumbered ASK METHOD ClearDataSet IN dsnum DSRefType All data contained in the data set is discarded and erased from the plot area ASK METHOD SetDSTitle IN dsnum DSRefType IN dataSetLegend STRING Sets the text shown in the legend for the specified data set ASK METHOD SetDSInterval IN dsnum DSRefType IN interval REAL Sets the width of each data cell for a discrete data set between the successive data cells of a discrete data set ASK METHOD ClearDataSet IN dsnum DSRefType Discards all previously plotted data in the given data set ASK METHOD SetDSInterval IN dsnum DSRefType IN width REAL Sets the cell width along the X axis for a Discrete type data set If this parameter Is O then the cell width will be the X tick mark interval ASK METHOD SetDSTitle IN dsnum DSRefType IN title
8. S path name Specifies the path to system files needed to run SIMDRAW trailing delimiter or V must be included W path name Specifies path to user SIMGRAPHICS II files 2 13 Using the Image Editor The Image Editor is used to create and edit primitives such as lines polygons circular ob jects and bitmaps Primitives can be grouped hierarchically into images The editor win dow contains three palettes Mode Style and Color The Mode palette on the left side of the window is used for adding primitives Chapter 2 SIMDRAW CA Simdraw 24 Pile Edi Figure 2 2 Image Editor 2 13 1 Mode Style and Color Palettes The Style palette contains the set of dash styles hatch styles line widths and text fonts that can be applied to the primitives The Color palette contains 64 colors that can also be ap plied to the primitives When a primitive is selected the Style and Color palettes will be up dated to reflect the style and color of that primitive At this time Style and Color palette changes will also be applied to the selected primitive The Mode palette is shown on the left hand side of the Image Editor window Use it to add primitives to your drawing Refer to paragraph 2 13 5 SIMGRAPHICS II User s Manual 2 13 2 Selecting Moving and Resizing Shapes are selected by clicking the mouse button over the desired shape For example polylines must be selected by clicking on the line itsel
9. If ClickMonitoring is set the window s MouseClick method will be called when the user pushes a mouse button within the largest centered square of the window Analogously if MoveMonitoring is set the window s MouseMove method will be called continuously as the mouse moves across the window This behavior is useful if you want to be notified of mouse movement and button clicking Within MouseClick and MouseMove you can examine several WindowObj fields that give more detailed information on the state of the mouse ButtonDown is TRUE if the mouse button is currently down Button gives the number of the button that was pressed or released 53 SIMGRAPHICS User s Manual SecondClick is True if the most recent click is the second click of a double click and BackgroundClick is TRUE unless the mouse was clicked down on a selectable object To monitor mouse clicks or mouse moves define an object that is derived from WindowObj and that overrides the MouseMove and MouseClick methods The definition for this object would look something like this DEFINITION MODULE Example4 FROM Window IMPORT WindowObj TYPE MyWindowObj OBJECT WindowObj OVERRIDE ASK METHOD MouseMove IN x y REAL ASK METHOD MouseClick IN mouseX mouseY REAL IN buttonDown BOOLEAN END OBJECT END MODULE and the implementation module like this IMPLEMENTATION MODULE Example4 OBJECT MyWindowObj ASK METHOD MouseMove IN x y REAL BEGIN OUTPUT The
10. SIMGRAPHICS II User s Manual A property of graphical objects is that they contain a set of other objects The methods used to add and remove objects from these sets are similar to those of a MODSIM III QueueObj The names these methods are identical to QueueOb j names but have had the word Graphic suffixed to them There are three additional methods of a GraphicVOb3 that are not present in a QueueObj These are AddChild RemoveChild and Child AddChild takes a graphical object an Id and a ReferenceName as its arguments The graphical object s ReferenceName and Id fields are set to these arguments These fields are used to later retrieve an object from the list using the Chi 1d method This method also takes an Id and ReferenceName as arguments and returns the graphical object in the list that matches both the ReferenceName and Id Note that the reference name and id of a graphical object can be set in the graphics editor The Child method can be used to get a handle to this object The Descendant method is identical to Child except that if no matching child is found the objects in the CHILDREN s sets will be recursively searched For example suppose you wanted to add the ImageOb j truck to a window get a handle to its child with the reference name load and then remove the first graphical object in this load ASK window TO AddGraphic truck load ASK truck Child load 0 firstInLoad ASK load TO RemoveGraphic
11. e Construction A graph is built using SIMDRAW e Automatic rescaling 2 D graphs dials and level meters are rescaled automatically if one of the values in its data sets exceeds its range e Easy updating lf a new value is set in a graph the Draw method will do whatever is necessary to redisplay this value Because all graphs are derived from ImageObj any operation that can be performed on an image can also be performed on a graph 7 1 Objects Derived from Graph VObj These are the presentation graphics objects GraphVOb j Generic object meaning any graph type ChartObj A chart containing a data plot legends and titles ClockVOb j A generic object describing a clock AnalogClockObj A graphical display of an analog clock DigitalClockObj A graphical display of a digital clock PiechartOb j A piechart containing slices legends and titling MeterVOb A generic object for any graphical display of a single numerical value DialOb j A graphical display of an analog dial DigitalDisplayObj A simple display of a single value LevelMeterOb j A graphical display of a level meter TextDisplayOb j A graphical display of a text string The class inheritance tree for MODSIM III presentation graphics looks like this 83 SIMGRAPHICS II User s Manual GraphVObj ChartObj IN M DigitalClockObj AnalogClockObj acc occ ue ee DynDClockObj DynAClockObj Figure 7 1 Inheritance Tree for Pre
12. Figure 5 4 Figure 5 5 Figure 7 1 Figure 7 2 Figure 7 3 Figure 7 4 Figure 7 5 Figure 7 6 Figure 7 7 Figure 7 8 Figure 7 9 Figure 7 10 Figure 8 1 Figure 8 2 Figure 8 3 Figure 8 4 Figure 8 5 Figure 8 6 Figure 8 7 Figure 8 8 Figure 8 9 Figure 8 10 Figure 8 11 Figure 8 12 Figure 8 13 Figure 8 14 Figure 8 15 Figure 8 16 Figure 8 17 Figure 8 18 Figure B 1 Figure B 2 Figure F 1 List of Figures Main WINGO E r Image EANO cis tete due tuis ice a Dialog Editor eere ER tette cote aia Menu Bar Editor Palette Editor Inheritance Tree for Graphical Objects O Image Tree for a Grocery Cart Grouping of Grocery Carte Image Tree for a Grocery Store ssssssssssssssseeee eret nen nennen Image Priority Solar System Coordinate System RO ee ee eee Inheritance Tree for Presentation Graphics p UP ORCI M MR LL LT T E 2 D Plot Pie rr A A EE Digital Glo CK otro ii Analog Clas Uae m idt Dial c L Level Meter iia Dia Digital Ge TT Text Display Trace Plot Inheritance Tree for Controls AAT Deactivated Contro l bass isti ice shea Ecos tano sa ear a n eed CEPR ER CN a a sineret CLIE EHI Check BOX EERE tacit tests Fe ette tts bust ettet ce eov etos fe tod e te A La al Text BOX unis iin tritici uaa tremere i divinis des Value BOX ee cone e e
13. in any order At some point you will want to find out what the user has selected Accept Input does not return until the dialog box is erased which usually happens because a terminating button is pressed AcceptInput returns the contents of the LastPicked field after the selection has been made If you ask a menu bar to AcceptInput the program will stop execution until one of the menu items has been selected item ASK MenuBar to AcceptInput CASE ASK item ReferenceName WHEN file CASE item LastPicked ReferenceName WHEN exit HALT END CASE To examine the state of a control you interrogate a field of the object which contains its state information Please note that the TextBoxObj and ValueBoxObj BeSelected methods are not called unless their ReturnSelectable field is TRUE You must use the Text method of the text box to return its contents Value must be used to return the contents of a ValueBox 8 3 Receiving Asynchronous Input from Controls If your program needs immediate notification of control interaction without waiting for Accept Input toreturn after a terminating button has been pressed you can OVERRIDE the BeSelected method of the DialogBoxObj PaletteObj orMenuBarOb j The BeSelected method is called automatically when one of the following events happens 1 The user clicks on a button palette button check box radio button list box item tree item or menu item 2 The user presses Retu
14. 159 O ObjInit ute eee 141 OutputLine n erret Rene 74 P palette button 4 ees 44 Palette Editor coins 5 palette Separators iinr n 44 palette colot virilidad 8 18 palette mode orrn en ei Eoi 8 41 palette style one 8 18 PaletteOb ete oreet 2 po Em 17 panes ertt ber REPE 55 parent case di RE E t o 61 paste option ini ea tier petet 10 PctWidlth dci eerte 155 pie chart sese Rien 23 88 94 pie slice numbering ees 93 BiechartOb cirios 83 lup 85 PlotEabel cernens 86 PointArrayType eee 155 points array A teen d erepto senses 155 polygonma zac Ae qe iy 156 Polygon3dOD J neget 145 DO sees id pen eei int 12 Polyline3dObJ meet 145 PolylineObj un emet 155 polyImes eegen 11 155 PostScript and peor erp aan 57 73 Points amay ote reote 156 presentation graphics sess 1 83 prtimitives esee 11 155 PUM sees cbse rre ide 57 R radio box sees enne 30 115 radio buttons oei ree nE E Ee EEs 115 RadioBoxOb n ettet 106 RadioButtonOb sese 106 raster file importing eene 14 RDataPtMObj A 91 ReadFromEile 2 eet 2 ReadFromHile esee 2 real world x y coordinates usse 159 real time soie aded 163 RectCursorObj eee 151 RemoveChild ess
15. 7 4 3 Showing Arrays of Variables Using Charts An array of variables can be shown using a chart or pie chart The array type must be of type LMONITORED RDataSet BY RDataSetMObj for REAL arrays and of type LMONITORED IDataSet BY IDataSetMObj for INTEGER arrays Elements in the array conform to either bars in a chart or slices in a pie chart The order of the array ele ment determines what slice or bar will show its value The first element in the array is shown by the first bar or slice in the chart the second element by the second bar etc To show the array valueArray with a chart the following code could be used From Graph IMPORT RDataSet RDataSetMObj VAR valueArray LMONITORED RDataSet BY RDataSetMObj chart ChartObj NEW valueArray 1 10 ASK GETMONITOR valueArray RDataSetMObj TO SetGraph chart valueArray 3 27 0 automatically updates chart Note Definitions for Dat aPtMOb Jj objects are found in the module Graph There are also several predefined types provided in this module that may be useful in defining monitored variables 94 7 5 Graph Monitoring Table Chapter 7 Graphs Monitor Monitor Monitoring Needs Graph Objects g H Objects Methods Single variable of type INTEGER or DigitalDisplayObj RDataPtMObj SetGraph REAL Dial0bj IDataPtMObj LevelMeterObj Single variable of type STRING TextDisplayObj SDataPtMObj SetGraph Histogram of a single variable ChartObj RDataPt
16. A menu item can only be contained on a menu pane and cannot contain other items Your application program is only informed of selections of a menu option not of a menu or menu bar Double click or use the Edit Properties menu option to change the attributes of a menu option Reference Name Id Any menu item can be accessed from inside an application by specifying its Reference Name and or Id Label The name identifying the menu item appearing within the container menu e Mnemonic A letter in the item s label that can be can be typed from the keyboard while holding down the Alt key to activate the item The mnemonic character will appear underscored in your application e Accelerator Key Name While running the application you can use the keyboard to activate menu options instead of using the mouse Any menu item can have its own accelerator key This attribute determines which key will be mapped to this menu item To use enable keys such as a z 0 9 and other punctuation and symbols keys to activate the menu item just type the key character directly The naming convention for keys performing functions are defined below escape Names the Esc or Escape key delete Names the Del or Delete key return Names the Enter or Return key backspace Names the lt or the Backspace key tab Names the Tab key f1 f2 fn Names the function keys F1 F2
17. Appendix D Creating Images at Runtime Although images can be created within SIMDRAW a user may occasionally want to create them dynamically at runtime This can be done for all primitives Doing this involves per forming a NEW on the object setting its attributes and then drawing the object All at tributes of a visible object can be reset at runtime with changes being seen at the time a Draw is done Creating primitives dynamically is quite simple It involves setting the fields of the prim itive and then adding it to a window or image Note Fields of a primitive are always initialized to some appropriate default value D 1 Objects PrimitiveVObj All primitives are derived from this object Primitives include polylines polygons polymarks text arcs circles and sectors Primitives are not hierarchical you should not ask a primitive to AddGraphic another primitive or ImageObj The only attribute of a PrimitiveVObj is its Points array The Points field is of type PointArrayType which is a one dimensional array of PointType records These types are found in the GTypes module The points of a primitive define what its shape will be The SetPoints method sets the points of a primitive The number of points defining the primitive is determined by the size of the given points array All primitives are drawn using the color attributes derived from Image0b3 Primitives cannot hold other primitives Do not try to add to polygons polylines
18. Library files streets 2 Laght bj nee e tette hese 145 UTC 145 lights postponal seen 145 lights spot eet ettet 145 LineCursorObj eee 151 LineStyleType esee 155 Jet hee taste teorie bro e 30 113 ListBoxItemOb esee 105 ListBoxMultOb eee 59 105 O A oerte 105 listing ODJEC S eiii itor Hen 7 LoadFromLibrary eren TI M MainEX ceni et RUPEE 4 55 making a duplicate of an object 7 Marko ocio tas eoe teet e des 159 MASK tese EEEE tein 70 MENU bat aon ee terrre Een 37 129 Menu Bar Editor esee 5 men ite oce eei ete reci ien 40 MenuBarObj sese 2 105 106 MenultemOb sse 105 VETO a Meter VOD 2820 ail oasis o 89 mnemonics a a aae re A E 131 mode palette eee dem nee 9 monitor variables oooooonnnnococcnnnonnocnnnnononnnononononns 91 monitored a Aen or AR d 92 ele e 95 MonitoringClicks eee 151 mouse movement cesses 59 MouseClick tri RES 53 MouseMowve encoccccncooonnnncnconanonocononanonononononnnnnnncnonos 53 MoveMonitoring eee 53 151 MOVelO sie at Pe 78 MovingOb iiie eit tt eei depen 78 multi line text box 30 118 MultiLineBoxOb j eee 59 multivariable monitoring esses 93 N NI A eene aue H uci D E 164 lat 164 normalized device coordinates 17
19. PopupMenuObj cutItem copyltem pasteltem pickedItem MenuItemObj BEGIN IF window Button 1 only respond to right mouse button NEW popupMenu NEW cutItem NEW copyItem NEW pasteItem set the labels appearing in the menu build the menu ASK cutItem TO SetLabel Cut ASK copyItem TO SetLabel Copy ASK pasteltem TO SetLabel Paste ASK popupMenu TO AddChild cutItem cut 0 ASK popupMenu TO AddChild copyItem copy 0 ASK popupMenu TO AddChild pasteItem paste 0 ASK window TO AddGraphic popupMenu pickedItem ASK popupMenu TO AcceptInput CASE pickedItem ReferenceName WHEN cut ASK SELF TO Cut WHEN copy ASK SELF TO Copy WHEN delete DISPOSE SELF END CASE DISPOSE popupMenu END IF END METHOD Popup menus can also be attached to Cont rolWindowOb j andDialogBoxOb j objects and be displayed in response to a right mouse button press The controls TreeObj ListBoxMultOb j ListBoxObj and TableOb jcanreceive right mouse input You can override the BeRightSelected of the DialogBoxObj to receive instant notification of a right mouse input At this time the popup menu can be displayed using the AcceptInput method The following example is similar to the above PopupMenuObj example except the menu is attached to a DialogBoxOb 3 instead of a WindowOb j MyDialogBoxOb j OBJECT DialogBoxObj OVERRIDE ASK METHOD BeRightSelected END OBJECT OBJECT MyDialogBox
20. Remember that the intersection of the X axis and y axis of a shape is its center point defined using the Edit Recenter menu op tion Before flipping or rotating a shape first make sure that its center point is defined ap propriately 2 13 12 Align and Distribute Multiple shapes can be aligned either vertically or horizontally to the primary selection shown enclosed by green selection handles They can be aligned vertically with respect to either their left edge right edge or center Shapes can be aligned horizontally with re spect to their top edge bottom edge or center To align first select multiple objects using the Shift key and then use the Layout Align menu option Select an alignment scheme from the resulting dialog box The Layout Distribute menu option allows you to distribute three or more shapes in relation to each other Shapes can be distributed horizontally so that the same space exists between left and right edges of adjacent shapes Distributing vertically will reposition the shapes so that the same space exists between bottom and top edges of adjacent shapes Shapes can be distributed uniformly along the circumference of a circle Chapter 2 SIMDRAW 2 13 13 Using Grid Lines x A grid can be used to perform precise positioning and sizing of shapes by breaking the ed itor window up into divisions You can show or hide grid lines by toggling the View Grid menu option You can change the color of the grid by
21. add menus only menus can add menu items only etc GRAPHICS ERROR 205 Attempt to attach a control which is al ready attached You must remove a control before you can add it again GRAPHICS ERROR 206 Attempt to reset course while moving to a destination You must stop motion before changing the course 175 SIMGRAPHICS II User s Manual GRAPHICS ERROR 207 Attempt to Moveto while moving to a des tination You must stop motion before changing the destination GRAPHICS ERROR 208 Attempt to FollowPath while moving to a destination You must stop motion before changing the destination GRAPHICS ERROR 209 Path array must contain at least 2 points Make sure at least two points that have been defined in the array passed to FollowPath GRAPHICS ERROR 210 Attempt to perform RotateTo while ro tating to an angle You must stop motion before changing the angle to rotate to GRAPHICS ERROR 211 Attempt to perform ScaleTo while scaling to a factor You must stop motion before changing the size you are scaling to GRAPHICS ERROR 212 Form must be attached to a visible window before updating or drawing it You must add the menu bar or dialog box to a window before drawing it GRAPHICS ERROR 213 Attempt to add invalid object to dialog box Make sure the dialog box is a container for the type of object you are trying to add to it GRAPHICS ERROR 214 Graph not attached to tree You must attach the graph to a
22. anItem ASK listbox FirstGraphic WHILE anItem lt gt NILOBJ IF ASK anItem IsSelected END IF anItem ASK listbox NextGraphic anItem END WHILE The current list box selection in a ListBoxObj can be set as follows ASK listbox TO SetSelectedItem ListBoxIteml ASK listbox TO Draw or by the short cut ASK listbox TO DisplaySelectedItem ListBoxIteml The current selection in a ListBoxObj can be retrieved as follows currentitem ASK listbox SelectedItem Detection of double clicks on list box items is usually used as a short cut for selecting an item and then picking an edit button ListBoxObj has the following field SecondClick BOOLEAN TRUE if last item selected was double clicked on j To use this the List BoxOb j or its parent DialogBox0b3 should be subclassed and have its BeSelected method overridden When the BeSelected method is called the listbox s SecondClick field will be TRUE if the last item selected was double clicked 114 Chapter 8 Controls 8 15 Radio Box and Radio Button eessen Aere Figure 8 8 Radio Box The radio box is a container for radio buttons The position of the radio buttons are deter mined by the position of the radio box Each of the radio buttons appears in a vertical col umn starting at the radio box position The currently selected radio button can be retrieved from either the radio box or from the individual radio buttons The following retrieves it from the
23. lated time and finish when the object has arrived at its destination 6 3 DynClockVObj Objects derived from DynClockVObj DynAClockObj and DynDClockOb j are used to display simulated time As a default elapsed simulation time is displayed as hours on the clock The method Set TimeScale can be used to specify the number of clock hours per unit of simulated time A dynamic clock must be asked to StartMotion before it will show simulation time The following code sets up a dynamic clock that was named Analog Clock in the editor VAR dynclock DynAClockObj window WindowObj library GraphicLibObj NEW dynclock ASK dynclock TO LoadFromLibrary library Analog Clock ASK window TO AddGraphic dynclock ASK dynclock TO StartMotion StartSimulation 6 4 Time Scaling When using animated graphics within a simulation simulation time elapsed in a WAIT statement must also elapse real time The global variable Timescale found in module SimMod specifies the number of real seconds that will pass for each unit of simulation time Its default value is 1 0 Note When the first graphical object is created this variable is initialized to 1 0 Be sure to set Timescale after creating the first graphical object 79 SIMGRAPHICS II User s Manual 6 5 Example of a Small Graphical Simulation The following example creates a clock to display simulation time and moves a truck image to the center of the window using the MoveTo me
24. 22 86 controls aa diee 26 28 35 controls creating esee 107 Control VOD arrani eeens 45 106 Control WindowOD esee 58 59 COVE baca rie 74 coordinate space boundaries 17 coordinate space coococcccoccconcononancnnnnnnona conc noncrnonns 155 coordinate system eee 51 52 69 171 coordinate units esee 84 CODY ODptIOD onec eerie pendet AEN 10 CUTS OD i chin ise ie EE ee Ee 151 A e tpe ds 10 D data poit aii emer eme 91 data Set E 22 data set options oo seen 10 100 depth of Delt o ege eech 144 147 Descendant eie nettement TI descendants atem een 61 Cal teu eb BUDE 24 REI RE ER dialog DX neret 27 33 122 dialog box tabbed A 35 Dialog Editor ciiasan a 5 26 DialogBoxOb esses 2 105 106 Ci 24 digital display ies 25 DigitalDisplayObj esses 83 90 dimen SiON aa a EE E 17 discrete Surface i retener teens 22 86 Display At IN x y READ ueni TI Display Selectedltem esses 114 DisplayShice 4 htm 88 E GE 141 Di aw sis ii ninia 2 47 49 77 110 141 drawing mode eet sisas irte 164 181 SIMGRAPHICS II User s Manual DualLineCursorObj eee 152 DynAClockOb j 25 ttt 79 DynamicUpdate seen 78 DynClockObj eee 79 DynClock VOD eee 79 DynDClockOb
25. 3 Move each control which must go onto this Page from the saved area 4 Repeat steps two and three until all Pages have been created and filled with con trols 5 Select each Page and use the Edit Properties menu option to set the label and icon on its Tab Message Boxes Message boxes are modal dialogs whose appearance is predefined by the MS Windows or MOTIF toolkits Their purpose is to present a message to you requiring only acknowledg ment or to ask a question with a simple Yes No or Yes No Cancel response Alert boxes are not created from the Dialog Box Editor but from the SIMDRAW main window Using the Edit Properties menu option from the main window s menu bar you can define the fol lowing attributes of the message dialog Title Text displayed in the dialog s header bar Library Name Name used to load the dialog into your program Message Text Type the message you want displayed here Any number of lines of text can be used in the message Style This radio box determines which icon will be placed onto the alert box Responses Determines the set of buttons on the dialog for user responses e Default Button Button that is activated when you press Enter 2 15 4 1 Align and Distribute Multiple controls can be aligned either vertically or horizontally to the primary selection shown enclosed by green selection handles They can be aligned vertically with respect to either their left edge right
26. Another property of graphical objects is that they can be loaded and saved from graphical object libraries A GraphicLibObj keeps libraries of graphical objects The GraphicVObj methods LoadFromLibrary and SaveToLibrary load and save graphical descriptions to a library A name not the reference name is given to the objects for reference within the library This is the same name given to the object when it is saved in the editor For example this code loads in the graphical description of a truck from a library VAR truck DynImageObj library GraphicLibObj ASK truck TO LoadFromLibrary library Truck A GraphicLibOb j is also used to retrieve objects created within SIMDRAW Within SIMDRAW you create a library of objects SIMDRAW saves this library to a file whose name you specify At runtime you create an instance of a GraphicLibOb j and ask it to ReadFromFile to obtain a copy of this library Objects can be loaded from the library with the ASK METHOD LoadFromLibrary For example suppose you have created a library of objects within SIMDRAW and named them MERCURY VENUS and 46 Chapter 3 Basic Graphic Object Methods EARTH To load the graphic descriptions of these objects the following block of code could be used Assume file SolarSys sg2 was created by SIMDRAW and contains the objects named MERCURY VENUS and EARTH VAR library GraphicLibObj mercury venus earth ImageObj NEW library
27. FILES n 24A EDITING AN EXISTING OBJEGT ento esee aida 2 5 ADDING AN OBJECT TO THE LIBRARY cc ceecececeesecececeseceueeeceeceuueueseceaueea ca an anar ono non ana nn nn nana sas asse dana 2 6 REMOVING AN OBJECT FROM THE LIBRARY u esccecesececeecececeseeueeeeseceaueea ce anar cn ono nn naaa cananea na dass d nnda nan 2 7 MAKING A DUPLICATE OF AN OBJECT 2 8 CHANGING THE NAME OF AN OBJECT 2 9 ADDING AN OBJECT FROM ANOTHER LIBRARY 2 10 EDITING IMAGES AND GRAPHS IN SAME WINDOW 2 11 UsER PREFERENCES ttt stt 2 12 COMMAND LINE ARGUMENTS 2 13 USING THE IMAGE EDITOR T 2 13 1 Mode Style and Color Palettes 2 13 2 Selecting Moving and Resizing d 2 13 3 Using the Clipboard Cut Copy Paste Commands seta eter e ub Eer 2 13 4 Importing Ta to Other KE File Formats Rata sete 2 13 5 Creating Primitives sicot esl 2 13 6 Creating Images EUST 2 13 7 Editing the Root Image 2 13 8 Editing Points on a Primitive 2 13 9 Defining Stacking Order or Priority TE 2 13 10 Defining the Center Point of a Shape RR HEINSIO SI Iii cA ILI aM anh dada 2 13 11 Using the Flip and Rotate Tools sse eem 2 13 12 Align and RE le 2 13 13 Using Grid Lines 2 13 14 Changing Views Panning and Zooming AAA RE Atina diia 2 13 15 Changing Dimension Coordinate Se gege AA a 2 13 16 Changing the Layout Size and Color Te 2 19 17 le elle 2 14 USING
28. STRING Sets the data set description text shown in the legend 7 7 13 Example of Program Code for Creating a Chart Suppose we wanted to create a chart showing plots of the mathethematical functions y 1 and y The following code will accomplish this 103 SIMGRAPHICS II User s Manual 104 NEW chart ASK chart TO SetTitle Example of two continuous data sets ASK chart TO SetAxisTitles Time in seconds f t create two data sets chart TO AddDataSet chart TO AddDataSet ASK ASK ASK ASK ASK ASK FOR ASK ASK ASK ASK ASK END ASK ASK ASK ASK ASK ASK ASK ASK FOR t END ASK ASK ASK set up options for chart and data set chart chart chart chart TO TO TO TO set data i FOR 1T chart chart chart chart chart SetOption ChartShowLegend TRUE SetOption ChartShowBox TRUE SetDSTitle 1 Plot of y t t SetDSTitle 2 Plot of y t t t set options O 2 TO SetDSOption ChartDSFill i FALSE TO SetDSOption ChartDSLine i TRUE TO SetDSOption ChartDSDiscrete i FALSE TO SetDSOption ChartDSSurface i TRUE TO SetDSOption ChartDSStatic i TRUE set chart fields chart chart chart chart chart chart chart chart TO TO TO TO TO TO TO TO SetAxisField ChartXMin 1 0 SetAxisField ChartYMin 1 0 SetAxisField ChartXMax 1 0 SetAxisField ChartYMax 1 0 SetAxisField ChartXI
29. THE GRAPH EDITOR sss eese eene entere sn nennen nennen tene nenne nennen nens 214 1 Style and Color Palettes nico ii eet xor p Ionio nao eh 2 14 2 Selecting Moving and Heslzimg eene enne 2 1403 er CR E e NEE 214 4 E EE Set ualet cedet eet te e Sege EE ER ues E E DS E 24 7 Level Meters iniciacion tada aa 2 14 8 Digital Displays o bt RE EHE geet inch P sone kd eund ee elie feine da 2 14 9 Text Meters necp inet GE x Rea Ted e ety Eten toe dicen 2 15 USING THE DIALOG EDITOR 2 15 1 Selecting Moving and Resizing 2 15 2 Dialog Box Coordinate System nn 2 15 3 Using the Clipboard Cut Copy Paste Commands Rye cen dida 2 15 44 Controls c mco dm tee e EE 2 16 USING THE MENU Bar EDITOR 2 16 1 Selecting and Moving Transferring 00 woooocooo o nols gm SIMGRAPHICS II User s Manual 2 16 2 Using the Clipboard Cut itin and Paste uM d 2 16 3 Editing the Menu Bar 2 16 4 Editing a Menu 2 16 5 Editing a Menu Item 2 17 UsiNG THE PALETTE EDITOR 2 17 1 Selecting and Moving Rearrangement of Buttons 2 17 2 Using the Clipboard Pe lee and Mid end A OMM MAT M Es 2 17 3 Editing the Palette 2 17 4 Editing a Palette Button 2 17 5 Editing Palette SE ME URP NEUE HN ODER REM Chapter 3 Graphic Objects and Methods esses eene nnns 3 1 PROPERTIES OF GRAPHICAL OBJECTS comonocccnononononancnnnnonananancnononnn nan
30. Text button on the Mode palette Point to where you want the center of the text to go and click the mouse button Use the Edit Properties menu option to define the text string to be displayed There are two different types of text vector text and system text Vector text fonts are fully scalable in any dimension and are portable between MS Windows and X Windows plat forms A vector text font can be assigned to a primitive by pressing any of the eight Style palette buttons showing Ab System text fonts are built in to the tool kit on which your server is running Text defined using a system font is non scalable and can only be resized by changing the font A system font is defined by font name point size and whether or not its uses italic and or boldface calligraphy To assign a system font to a text primitive select the primitive and then press the Dialog Box button on the lower right hand corner of the Style palette The resulting Font box will display all fonts point sizes and calligraphy styles loaded on your server The font you select will be applied to the selected text primitive This same font can now be applied to other primitives using the ST button at the lower left corner of the Style palette Text alignment with respect to the image can also be defined For example if you wanted a text primitive defined with a system font to remain centered as an image is scaled its alignment should be centered horizontally and vertically us
31. The depth of field for the cam era controls the near and far viewing limits Objects and parts of objects which lie closer than the near distance or greater than the far distance are not displayed 144 Appendix B SIMGRAPHICS II 3 D The camera s zoom factor controls the viewing angle You may zoom in or out Zooming in decreases the viewing angle and enlarges the scene Zooming out decreases the viewing angle and reduces the scene LightObj Light objects can be created to help illuminate a scene Light objects can be positioned and oriented in 3 D space Any number of lights up to the maximum allowed by the 3 D hard ware can be created 3 D images are automatically shaded using the lights color and posi tion The three different types of lights available are directional positional and spot lights Directional lights are similar to sunlight and are often the only lights used to illuminate a 3 D scene Directional lights shine on all objects with the same intensity regardless of the object s location The light s position and its aim point determine a vector which represents the light s direction Positional lights are similar to uncovered light bulbs They illuminate in all directions with intensity diminishing with distance A positional light will illuminate an object differently depending upon the position of the object and the light source The attenuation field deter mines how the light will fade with distance Spot lights a
32. You can tell the table to automatically add a new row of cells to its bottom row whenever the you attempt to move past the last row using the down arrow key Use the Edit Properties menu option to set the following attributes Viewed Width The total width in font units of space occupied by the entire table including row headers and scroll bar Viewed Height The total height in font units of space occupied by the entire table including column headers and scroll bar Number Columns Number of columns of cells not including headers Number Rows Number of rows of cells not including headers Column Headers If checked the table will contain a separate row of column head ers at the top of the cells Row Headers If checked the table will contain a separate column of row headers on the left of the cells Automatic Grow If checked the table will automatically add a row if the you at tempt to move past the last row with the down arrow key The attributes of all columns in the table are shown within a separate Column Detail table invoked by clicking on the Columns button Column 1 2 Width The number of characters shown in the cells of a particular column Select the cell in the column corresponding to the one you want to change and type in a new width e Column 1 2 Alignment Text in a table cell can be justified to the left or right or can be centered Within the Column Detail
33. a check mark next to a menu option label ASK menuItem TO DisplayCheck TRUE 8 24 3 Accelerators MenuItemOb Jj can be assigned an Accelerator a set of keys that selects a menu choice even when the choice is not visible Of course no two MenuItemObjs in the same MenuBarObj should be assigned the same accelerator Accelerators are usually dis played in a menu option by displaying a descriptive string to the right of the menu string If your toolkit does not support accelerators then assigning them has no effect The key press that makes up the accelerator can be any combination of the Alt key the Ctrl key and a printable ascii character or one of the function keys written as f1 f2 etc You must also specify the descriptive string that appears to the right of a menu string 131 SIMGRAPHICS II User s Manual To identify keys such as a z 0 9 and other punctuation and symbols use the key char acter directly The naming convention for function keys is defined below a escape Names the Esc or escape key b delete Names the Delete or delete key c return Names the Enter or return key d backspace Names the or the Backspace key e tab Names the Tab key f 1 2 f fn Name the function keys F1 F2 Fn at the top of the key board The following code assigns an accelerator for item1 and item2 To activate item1 you would hold down the Ctrl key while typing a to activate item2 you would p
34. a set of images is grouped within SIMDRAW an image is created for that set Components of a group are optionally given STRING reference names and INTEGER id tags They are set in SIMDRAW using Edit Properties menu option These are used by the application program to get handles to children of the image or grouping that SIMDRAW has created The GraphicVObj ask method Child returns the child of the image that has this unique name and Id Suppose a solar system was created within SIMDRAW If the planet groupings seen in the editor were given the reference names Mercury Venus Earth and Mars the following block of code could be used to get pointers to the planets of the solar system VAR library GraphicLibObj VAR mercury venus earth mars ImageObj VAR solarSystem ImageObj NEW library NEW solarSystem ASK library TO ReadFromFile SolarSys sg2 ASK solarSystem TO LoadFromLibrary library SOLAR SYSTEM mercury ASK solarSystem Child MERCURY 0 venus 2 ASK solarSystem Child VENUS 0 earth 2 ASK solarSystem Child EARTH 0 mars 2 ASK solarSystem Child MARS 0 65 SIMGRAPHICS II User s Manual Before any image can be drawn or updated its image tree must be added to the window in which it is going to appear The following code shows how to bring up a window and add an image to it VAR window WindowObj image ImageObj NEW window create the window ASK window TO Draw bring
35. an application frame window One common frame window will contain all sub windows The frame window is constructed automatically by the applica tion when the first sub window is displayed These sub windows can be tiled cascaded or arranged as you desire but they always remain within the main frame window of the appli cation The Window menu which is displayed automatically provides these capabilities When a sub window is brought to the front its palettes and menu bar will become part of the frame In addition the first and last menus of the first sub window usually the File and Help menus will be shared among all other sub windows The following procedures are available for manipulating the frame window 57 SIMGRAPHICS User s Manual PROCEDURE SetFrameTitle IN title STRING This procedure will reset the title displayed on the header bar of the frame window The procedure can be called before or after the frame window has been made visi ble and will automatically update the title PROCEDURE SetFrameIconNames IN smalllIconName largeIconName STRING Sets the icons used when the frame window is minimized If the application con tains a frame and sub windows this procedure will identify either the resource or bitmap file names of the icons representing the minimized application PROCEDURE SetFrameTranslation IN tx ty PctType Tf the application contains a frame and sub windows this procedure will specify the initial pos
36. arcs circles snapshots etc PolylineObj A polyline is a line that connects the points of the Points array One of the attributes used in drawing a line is its Style which determines the line style to be used in drawing This attribute s type is LineStyleType which is defined in the GTypes module and can take on the following values LineStyleType SolidLine LongDashedLine DottedLine DashDottedLine DashedLine DashDotDottedLine ShortDashedLine AlternateLine Two more attributes of a polyline are its Width and PctWidth The Width attribute determines the line s width in terms of real world x y coordinate space If a line s Width is set then the line width will be scaled whenever the line or one of its ancestor images is scaled The PctWidth attribute determines a line s width in terms of percentage of win dow size When you set the PctWidth attribute of a line its width is NOT scaled when the line is scaled or an ancestor is scaled the line will stay the same width regardless of what its size 1s 155 SIMGRAPHICS II User s Manual ArcObj Since ArcOb j and PolylineObj are derived from a common object LineVOb 3 an arc contains the same style and width attributes as a polyline An arc is defined by 3 points in the points array The first point identifies the center of the arc The second point a point on the circumference is the beginning of the arc The arc is drawn counterclockwise to the third point also on the circu
37. being generated whenever the specified font can not be loaded Default is TRUE D 3 Using System Text Here are the steps involved in using system text 1 2 Set the font to SystemText SetFont Set the font alignments SetAlignment This determines the position of the text relative to the reference point and translation SetTranslation to move the text to the desired position Note that the text will be positioned relative to the specified point according to the alignments selected Use the Set Text and or SetTextBuf fer methods to set the desired text posi tion Set the Family Size Weight and Slant fields using SetSysFont The most direct way to get these is by using the system font browser dialog box Note that by default if the specified font cannot be found a default system font will be used Using method SetNoSy sFontNoError this behavior can be changed so that an error will occur if the font cannot be found EXAMPLE NEW text ASK text TO SetFont SystemText ASK text TO SetTranslation 6000 0 8000 0 ASK text TO SetAlignment HorizLeft VertMiddle ASK text TO SetSysFont Times Roman 12 100 0 ASK text TO SetText Hello World D 4 Portability Issues 158 T For Unix X Windows platforms the Family field can be a complete X11 font name as might be obtained from the xfontsel or xlsfonts programs usually included with the X Windows release In this case the size weight and slant fields will be i
38. default world ASK solarSystem TO SetTranslation WorldXlo 2 0 WorldYlo 2 0 67 SIMGRAPHICS II User s Manual By default the physical size of an image s world coordinate space is the largest centered square of the window in which the image lies An important note is that when a transfor mation scale rotation or translation is applied to an image its coordinate system s phys ical size and position with respect to the window is the ONLY thing that actually changes This means that none of the real world points of an image actually change when it is scaled or rotated but it physically changes size and position because its entire coordinate system has physically changed in size and position If the solar system image in the above example were to be scaled by 0 5 0 5 the distance of the earth from the sun would remain at 8 31 but the solar system s world coordinate space would now only occupy one quarter the size of the window SolarSystem 12 68 12 68 Figure 5 5 Solar System Coordinate System 5 5 Deriving from Images You may derive new objects from ImageOb 3 however you should not use multiple inher itance to derive from the two graphical objects such as ImageObj and PolygonObj or ButtonObj and Image0b3 The most common case for deriving from ImageOb j is to add additional fields and methods or to override the BeSelected method to obtain no tification when the user has clicked on it 5 6 Dete
39. difficult than it is for two dimensions because there are cameras and lights to consider It is easy to overlook a detail and not get anything to appear on the screen If this happens make sure a CameraOb j has been cre 146 Appendix B SIMGRAPHICS II 3 D ated and added to the either the window or the graphics hierarchy The camera s depth of field must be set so that the objects being viewed are between the near and far clipping planes see figure B 2 Also make sure the camera is pointing toward the objects you are viewing Near clipping plane Far clipping plane Camera x Depth of Field Figure B 2 The Camera Can See the Palm Trees but not the Lunar Module or the Tank B 7 Example 3 D Graphics Program The following program creates a three dimensional CUBE and displays itin a window The cube is created from program code MAIN MODULE cube3d kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkxk xk This test creates a cube kk kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkxk FROM View3 IMPORT CameraObj LightObj FROM Image3 IMPORT Image3dObj 147 SIMGRAPHICS II User s Manual FROM Prim3 IMPORT Polygon3dObj FROM Window3 IMPORT Window3d0b3 FROM GProcs IMPORT HandleEvents FROM GTypes IMPORT ALL ColorType FROM Graphic IMPORT GraphicLibObj FROM GTypes3 IMPORT ALL RenderModeType ALL LightType PointArray3dType
40. edge or center Controls can be aligned horizontally with re spect to their top edge bottom edge or center To align first select multiple objects using the Shift key and then use the Layout Align menu option Select an alignment scheme from the resulting dialog box The Layout Distribute menu option allows you to distribute three or more controls in rela tion to each other Controls can be distributed horizontally so that the same space exists be 35 SIMGRAPHICS II User s Manual tween left and right edges of adjacent controls Distributing vertically will reposition the controls so that the same space exists between the bottom and top edges of adjacent con trols 2 15 4 2 Using Grid Lines x A grid can be used to perform precise positioning and sizing of controls by breaking the editor window up into divisions You can show or hide grid lines by toggling the View Grid menu option You can change the color of the grid by selecting a color from the Color palette and then using the View Grid Color menu option The granularity of the grid can be adjusted using the View Grid Spacing menu option Granularity can be Fine Medium or Coarse e Fine 1 font unit wide 0 25 font units high Medium 2 Font units wide 0 5 font units high e Coarse 3 Font units wide 1 font unit high By toggling the View Snap menu option you can restrain positioning and resizing of shapes to the intersections of the grid 2 15 4 3 Changin
41. eee 79 DynlImageObj eee 2 78 E editing objects eater 6 editor palette scsi aia dd 4l EPSOD 5 bete e 73 Eras duke ca EE sive te 2 49 77 Examplel 3 noie neon tee 3 Example ett nte ete la 96 Example6 5 5 eni asrasa ie 80 F Feld Width 2 et e 90 FixedA spCursorOb esses 152 FixedCursorOb sess 151 152 flip and rotate tools sse 16 FollowPath t tte 78 FormVObJ EERSTEN Eer 106 frame window sese 57 G EE S EERE EE N 73 GetBoundingBox eee 69 A rena tres 58 GetFrameTranslation sees 58 GETMONITOR 5 2 enter tpe 93 Graph Pditor eee ege 5 GPtOoCS eebe Een 171 graph component isses 97 graphic library eee 45 GraphicLibObj esee 2 GraphicSetOb i rennen 113 Graphie VOD saesae iee te aaie 45 graphs sierras arresa reo eee 97 Graph VOD es ret ER IURE 83 Bd iui deep nete edens 36 eh I RR 17 GTypes iet EES 51 67 155 H Handl Events 4 teme 171 A eode 61 HISTO STAM e are 22 85 92 I IDataPtMOb teret 91 Image Editor cei i e a 5 8 9 10 ImageOb tenente 2 45 69 182 Images cipere neg pr EAE FERE 14 K Ky Press aise entres Dre RO RERO CHER S 122 L label i5 stp iE 31 Layout Editor eet tei 5 7 Layout Group option 14 level meter eie ettet 25 LevelMeterObj nee 83
42. enumeration ASK METHOD SetAxisField IN field ChartAxisFieldType possible fields de scribed below IN fieldValue REAL 101 SIMGRAPHICS II User s Manual ChartX Min ChartYMin ChartY2Min ChartXMax ChartYMax ChartY2Max These are the boundaries of each axis These values are displayed on the left and right of the X axis and the top and bottom of both Y axes ChartX Interval ChartYInterval ChartY2Interval These fields are the tick mark intervals The X tick interval is used for the discrete data set cell width if this value is zero ChartX Minor Interval ChartYMinorInterval Chart Y2MinorInterval These fields are for the smaller minor tick marks shown between the larger ma jor ticks Generally speaking the major interval should be a multiple of the minor ChartX NumInterval ChartY NumlInterval ChartY2Numlnterval These fields specify the interval between successive numberings on an axis ChartXGridInterval ChartYGridInterval ChartY2GridInterval These fields specify the interval between successive grid lines on an axis Grid lines are only shown if the appropriate option has been set to TRUE ChartX Intercept Point along the X axis where the Y axis intersects ChartY Intercept Point along the Y axis where the X axis intersects ChartX2Intercept Point along the X axis where the second right Y axis intersects ChartXScaleFactor ChartYScaleFactor ChartY2ScaleF actor These fields are the scale fact
43. from this object The control inheritance tree is as shown in figure 8 1 106 ControlVObj 8 1 Creating Controls Chapter 8 Controls CheckBoxObj ToggleVObj zc RadioButtonObj ButtonObj File DialogBoxObj SysFormVObj FormVObj FontDialogBoxObj DialogBoxObj TableObj MessageDialogBoxObj LabelObj ListBoxltemObj ListBoxMulttOBj 9 ListBoxObj MenuObj MenultemObj PaletteObj PaletteButtonObj PaletteSeparatorObj PopupMenuObj RadioBoxObj TabObj TreeObj TreeltemObj ComboBoxObj A MultiLineBoxObj ValueBoxObj gt ProgressBarObj Figure 8 1 Inheritance Tree for Controls Controls are created interactively using the SIMGRAPHICS II editor SIMDRAW stores a description of the controls it has created in a library file Part of the control description includes a reference string and ID value which form a unique concatenated key used to identify the control within a MODSIM III program Using the controls created by SIMDRAW involves loading the library description and finding the individual controls using the reference string and ID A control can be found using the following method control ASK dialogbox Child referenceName id 107 SIMGRAPHICS II User s Manual 8 2 Retrieving Synchronous Input from Controls After a D alogBoxOb j has been asked to AcceptInput the user may click on check boxes to change their state enter text into text boxes enter values into value boxes and press on buttons
44. given array of STRINGs ASK METHOD SetHeight IN height INTEGER Sets the number of option items that can be concurrently viewed in the drop down list If the number of items exceeds height then the list will be scrollable ASK METHOD SetEditable IN editable BOOLEAN Sets whether or not the text shown in the text field can be edited by the user If editable is FALSE then this field can only be set by selecting one of the displayed options ASK METHOD SetSorted IN sorted BOOLEAN Sorted sets whether or not the items in the option list will appear alphabetically 117 SIMGRAPHICS II User s Manual The following TextBoxOb j methods are useful for a ComboBoxObj ASK METHOD SetWidth IN width INTEGER ASK METHOD Text STRING ASK METHOD SetText IN text STRING ASK METHOD SetReturnSelectable IN selectWithEnter BOOLEAN The BeSelected method is called whenever an item in the option list is selected The currently selected displayed item can be retrieved using the Text method Note If the ReturnSelectable flag is TRUE then BeSelected will be called whenever the user presses the Return key while the text field has input focus 8 19 MultiLineBoxObj A fully editable multi line text box can be created and added to your dialog box It can con tain any number of lines of readable writable text Text box contents can be set by passing an array of STRINGS to the SetTextBuffer method For example Multi l
45. have two data sets plotted using a bar chart representation whose first cell values are 1 and 3 respectively If stacking is off the second data set bar would cover the first data set bar completely With stacking on the first data set value is represented as a bar extending from 0 to 1 and the second data set value is plotted as a bar extending above the first from 1 to 4 Data sets of the histogram and bar chart variety can be displayed side by side In this case individual bars and rectangles are made thin enough to allow room for bars and rectangles from the other data sets Therefore all data sets of the same representation can be seen within a single cell Laying data sets side by side can be useful because no data sets are obscured A value plotted in a data set can be retrieved using the ChartObj method Y datasetnum x Given a data set number and an x coordinate the y value plotted at that coordinate is returned If the representation of the data set is of the simple plot variety linear interpolation is used to get the exact y value shown at the given x value Suppose a user wanted to know what was plotted at x 20 0 in data set 2 VAR yval REAL yval ASK chart Y 2 20 0 Another property that charts have is the ability to label key parts of their 2 D plot Labels will automatically move with the rest of the plotted data when the graph is rescaled La beling is done using the P1otLabel method This takes an x y coordinate
46. implemented through the Mes sageDialogBoxObj The message box can be of the OK only OK Cancel Yes No Yes No Cancel Retry Cancel or Abort Retry lgnore variety Any of the buttons on a message box can be the default button The AcceptSysInput method should be used to display the dialog and wait for a reply This method will return TRUE if either the Ok Yes or Retry buttons are clicked A Selected Button field contains the enumeration value of the selected button after returning from AcceptSysInput Message dialogs are modal thereby requiring a response before mouse or keyboard interaction with any other objects can proceed Figure 8 15 is an example of a MessageDialogBoxOb j Figure 8 15 Alert Dialog Box A Message Dialog can be creating by SIMDRAW or programmatically For creation by program code the following methods are useful ASK METHOD SetText IN message STRING Sets the message to be displayed in the dialog ASK METHOD SetTextBuffer IN messageLines TextBufferType Sets the message to be displayed in the dialog The message is provided as an array of text Each element is a line of text in the message ASK METHOD SetStyle IN style MessageStyleType Sets the nature of the message An icon may be subsequently shown with the dialog alerting the user as to this nature The following styles are available Plain no icon stop sign question alert exclamation point and information circled 1 ASK M
47. is played by creating a SoundObj object imported from module GMedia The sound is first asked to SetFile given the name of the audio data file including extension and then asked to Play For example to play the sound stored in BANGBANG WAV VAR sound SoundObj NEW sound ASK sound TO SetFile BANGBANG WAV ASK sound TO Play Currently there is sound support only for Microsoft Windows NT 95 systems Only wave WAV files can be played back 173 SIMGRAPHICS II User s Manual 174 Appendix I Runtime Graphics Errors GRAPHICS ERROR 200 Unexpected NIL arg to method Make sure you have created an instance of a graphic object before adding it GRAPHICS ERROR 201 Replacement must involve object of same type Only objects of the same type may be replaced GRAPHICS ERROR 202 Attempt to update or draw a control which has not been attached to a container control Check to see if a control has been added to a container control such as a dialog box menu bar list box or radio box before asking it to update or draw GRAPHICS ERROR 203 Attempt to update or draw a control whose parent control has not been drawn The dialog box or menu bar must be drawn before attempting to draw a control it contains The same is true for list boxes and radio boxes GRAPHICS ERROR 204 Attempt to attach an object to a non con tainer control There are restrictions on the type of objects which can be attached Menu bars can
48. is x deactivated Manage Library Exit Esc Figure 8 2 Deactivated Control 109 SIMGRAPHICS II User s Manual The control can be reactivated using the Set Draw methods ASK control TO SetSelectable TRUE ASK control TO Draw or by the shortcut ASK control TO Activate Activating a control which is already activated or deactivating a previously deactivated control has no effect 8 6 Setting the Control s Label A control can have its optional label set using the Set Draw methods ASK control TO SetLabel label ASK control TO Draw 8 7 Disposing Controls Any control can be disposed using the DI SPOSE procedure Disposing a control automat ically disposes of all the controls attached to it In addition disposing a window or a dialog box causes all of the controls attached to it to be disposed 8 8 Updating Controls Any control can be asked to draw Draw causes the attributes of the control and any control attached to it to take effect 8 9 Buttons Figure 8 3 Button A button is used to receive a simple input event Clicking on the button selects it It is also used to verify controls and terminate dialog boxes Buttons can be verifying and or terminating A verifying button causes all value boxes in the dialog box to check their contents when it is pressed Buttons can also be terminating A terminating button causes its parent dialog box to be erased when it is selected 110 Cha
49. it up on the screen ASK window TO AddGraphic image add an image to it The following example gets a solar system from a library and draws it on the screen 66 MAIN FROM FROM FROM FROM FROM VAR MODULE Example2 Window IMPORT WindowObj GTypes IMPORT WaitForEvent GProcs IMPORT HandleEvents Graphic IMPORT GraphicLibObj Image IMPORT ImageObj parentWindow WindowObj solarSystem ImageObj library GraphicLibObj BEGIN NEW parentWindow create a window ASK parentWindow TO Draw bring it up on the screen NEW library create a library ASK library TO ReadFromFile Example2 sg2 read the editor file NEW solarSystem ASK solarSystem TO LoadFromLibrary library SOLAR SYSTEM get a SOLAR SYSTEM from library ASK parentWindow TO AddGraphic solarSystem add the solar system to the window ASK solarSystem TO Draw draw the entire solar system Chapter 5 Images LOOP wait forever HandleEvents WaitForEvent END LOOP END MODULE 5 4 Coordinate Systems When animating graphics you must have a knowledge of the coordinate system in which the graphical objects live in order to specify their new positions In MODSIM III a coor dinate system can be attached to any image and the CHILDREN of the image live within this system This means that all real world coordinates of an image s children must be spec ified in this coordinate system Th
50. items to appear The menu bar is attached to a window by ASK window TO AddGraphic menubar 129 SIMGRAPHICS II User s Manual Edit Group Canvas Ctrl I Save Ctrl s Import gt Export Manage Library Exit Esc Figure 8 16 Menu Bar After a menu bar is attached to a window and drawn it can receive input This is done using the AcceptInput method item ASK menubar TO AcceptInput AcceptInput returns the menu option which was picked You may perform various ac tions depending on which item was selected CASE ASK item ReferenceName WHEN Exit HALT WHEN Redo GoAgain OTHERWISE END CASE To receive a menu selection while a simulation is running you can do the following 1 Create your own menu bar object and override the menu bar s BeSelected method NEW MyMenuBar 2 Askthe menu bar object to load its graphic description from the library ASKMyMenuBar TO LoadFromLibrary lib MenuBar 3 Attach the menu bar to the window ASK window TO AddGraphic MyMenuBar 4 Display the menu bar and initiate interaction item ASK MyMenuBar TO AcceptInput 5 Start the simulation StartSimulation 6 The BeSelected method of MyMenuBar will be called whenever there is a menu selection and the LastPicked field of the menu bar will point to the item which was selected The BeSelected method should be overridden to look something like this 130 Chapter 8 Controls ASK METHO
51. its BeSelected method will be invoked automatically This method should be overridden to obtain notification of selection If the INHERITED BeSelected statement is included in this code then BeSelected will be called for the object s parent If you putthe INHERITED BeSelected statement at the top of the selection routine for an object then notification of selection will proceed in a top down fashion The selection code for the object s parent will be executed first Putting the statement at the bottom of the routine will inform in a bottom up fashion For example the code MyDynImageObj OBJECT DynImageObj OVERRIDE ASK METHOD BeSelected END OBJECT could be used to define an object to be notified of selection The implementation code for such an object could look like this ASK METHOD BeSelected top down selection BEGIN INHERITED BeSelected inform parent of selection OUTPUT I was clicked on END METHOD or like this ASK METHOD BeSelected bottom up selection BEGIN OUTPUT I was clicked on INHERITED BeSelected inform parent of selection END METHOD 48 Chapter 4 Windows One of the most useful objects within the MODSIM III graphics library is aWindowObj A WindowObj represents a window on the screen that contains graphics All graphic ob jects including images forms and graphs must be added to a window before they can be displayed A WindowObj has the following properties e Appearanc
52. method finishes when the object has arrived at the last point in the array Use Interrupt to stop it from continuing RotatingOb j ASK METHOD SetRotationSpeed IN rotationSpeed REAL Sets the speed of rotation in radians per second Negative values cause clockwise rotation TELL METHOD RotateTo IN theta REAL Waits for an object to rotate to theta radians using RotationSpeed The ro tation speed should be set before invoking this method ScalingObj ASK METHOD SetScaleSpeed IN scaleSpeed REAL Sets the amount that 1s added to an objects scaling factor every time unit For ex ample with a scale speed of 1 0 an object will become twice as large after 1 time 78 Chapter 2 SIMDRAW unit 3 times as large after 2 time units etc TELL METHOD ScaleTo IN xScale yScale REAL Waits for an object to scale to xScale yScale using scaleSpeed The scale speed should be set before invoking this method Note DynamicObj MovingObj RotatingObj and ScalingObj are not graphical objects and cannot be displayed Use a DynImageObj object which inherits all functionality of these objects Animating a DynImageOb j can be done in one of two ways One way is to set the course and speed of the object and ask it to StartMotion This will cause it to move with re spect to these attribute settings indefinitely Another way is to TELL or WAIT FOR the object to MoveTo ScaleTo or RotateTo a destination These methods elapse simu
53. onto the top Page will automatically attach it to that Page Controls can be dragged from the Mode palette pasted from the clipboard or moved onto the top Page The Page area is not automatically resized when controls are dropped onto the Page It should be sized manually prior to adding controls To remove a Page first remove all controls it contains and then use the Edit Cut or Edit Delete menu options Using the Edit Properties menu option you can set the following at tributes of the selected Tab Field e Label The text label shown on the tab part of the Page Icon Name The resource or file name without extension of the bitmap shown on the front of the tab You can use the Browse Resources or Browse Files buttons on the Properties Dialog to se lect a bitmap to be displayed on the tab portion Currently on MOTIF systems you can only select an X Windows dump file x wd and on MS Windows you can only select from the list of built in bitmap resources 34 Chapter 2 SIMDRAW Converting Conventional Dialog Boxes to be Tabbed Perform the following steps to add tabs to an existing untabbed dialog box 1 Create space for the tab area by selecting all controls using the Edit Select All menu option and moving them into a saved area on the dialog box move them down or to the right by a liberal amount 2 Draga Page onto the dialog box from the Mode palette Resize the Page according to how much space it needs
54. palette selections while a simulation is running do the following 1 Create an instance of your own palette object NEW MyPalette 2 Askthe palette to load its description from the library ASK MyPalette TO LoadFromLibrary lib PaletteLibName 3 Attach the palette to the window ASK window TO AddGraphic MyPalette 136 Chapter 8 Controls 4 Draw the window or the palette to display the palette ASK window TO Draw Convoy Convoy File Edit View Simulation Window Help Er ett NNNM NN Figure 8 18 Palette Example PALETTE EXAMPLE PROGRAM MAIN MODULE Example8 Simple Palette FROM Window IMPORT WindowObj FROM GPaletIMPORT PaletteObj FROM GProcsIMPORT HandleEvents FROM GraphicIMPORT GraphicLibObj TYPE MyPaletteObj OBJECT PaletteObj OVERRIDE ASK METHOD BeSelected END OBJECT VAR myPalette MyPaletteObj window WindowObj 137 SIMGRAPHICS II User s Manual library GraphicLibObj done BOOLEAN OBJECT MyPaletteObj ASK METHOD BeSelected BEGIN CASE ASK LastPicked ReferenceName WHEN cut OUTPUT Cut operation selected WHEN copy OUTPUT Copy operation selected WHEN paste OUTPUT Paste operation selected WHEN quit done TRUE END CASE END METHOD END OBJECT BEGIN Init graphics and create window NEW window ASK window TO Draw load description of palette from the library file created by SIMDRAW NEW library ASK library
55. position of the mouse is x x y y INHERITED MouseMove x y this sets the window fields END METHOD ASK METHOD MouseClick IN x y REAL IN buttonDown BOOLEAN BEGIN OUTPUT Mouse was clicked at x x y y OUTPUT Mouse Button Button clicked OUTPUT The state of the button is ORD buttonDown 0 Up 1 Down IF SecondClick OUTPUT A SecondClick END IF IF BackgroundClick OUTPUT A BackgroundClick END IF INHERITED MouseClick x y buttonDown END METHOD END OBJECT END MODULE 54 Chapter 4 Windows A simple program that used these objects to report mouse movement and clicking to the user would look like MAIN MODULE MainEx4 FROM GTypes IMPORT WaitForEvent FROM GProcs IMPORT HandleEvents FROM Example4 IMPORT MyWindowObj VAR mywindow MyWindowObj BEGIN Create window with overridden mouse click and mouse move methods NEW mywindow ASK mywindow TO Draw Now wait in a loop handling user input LOOP HandleEvents WaitForEvent END LOOP END MODULE All mouse coordinates are specified using the world coordinate system given to the window with the ShowWorld method If the world is not specified then the default world is used 0 32767 0 32767 4 7 Scroll Bars Window0b3 objects can contain both vertical and horizontal scroll bars The size and position of the thumb contained in a scroll bar can be set programmatically using the
56. radio box currentbutton ASK radiobox SelectedButton The selected button in a radio box can be set using the Set Draw method ASK radiobox TO SetSelectedButton button ASK radiobox TO Draw or by the shortcut ASK radiobox TO DisplaySelectedButton button 8 16 Tree View Control Tree view control figure 8 9 is a special list box control that displays a set of objects as an indented outline based on their logical hierarchical relationship The control includes buttons that allow the outline to be expanded and collapsed You can use a tree view con trol to display the relationship between a set of containers or other hierarchical elements See the Windows95 Explorer for an example The tree view control itself is implemented by creating a TreeOb j found in Gtree The TreeObj contains TreeItemObj objects representing each item in the list Each item is shown with a text label and a bitmap icon The hierarchy is built by adding TreeItemOb js to other TreeItemObj objects A TreeObj is defined below SelectedItem TreeItemObj Currently selected list box item Jj Width INTEGER Widthofthelistboxinfontunits Height INTEGER Height of the list box in font units Maximized BOOLEAN Tree will be maximized upon creation SecondClick BOOLEAN Was last TreeItemObj selection a double click 115 SIMGRAPHICS II User s Manual 116 Tree Window D SIMGRAFHICS Icons O Sit stra fee FILENEW_S FILE
57. selecting a color from the color palette and then using the View Grid Color option The granularity of the grid can be adjusted using the View Grid spacing option Using this option you can define the grid line interval by specifying either the total number of grid lines or the distance in real world coordinates between suc cessive grid lines in both X and Y dimensions By toggling the View Snap menu option you can restrain positioning and resizing of shapes to the intersections of the grid If the Snap mode is active the View Snap From menu option allows you to specify which corner of a shape s bounding box will be aligned to the grid intersections during reposition ing If View Snap from Center is selected a repositioned shape s center point will be glued to the grid intersections 2 13 14 Changing Views Panning and Zooming Q If working on a highly detailed portion of the image you may want to magnify a portion of the window To zoom in to some area of the window first select the View Zoom In menu option Drag out a rectangle with the mouse over the area of detail When the mouse button is released the area inside the rectangle will be expanded to encompass the entire window To zoom back out use the View Zoom Out menu option When zoomed in you can pan to other areas of the window using the horizontal and vertical scroll bars Return to the default view by using the View View 1 1 Fit to window menu option Unless the w
58. set is represented by a fixed number of data cells The width of a data cell is set with the SetDSInterval method When a value is plotted to a discrete data set the data bar whose X center point is closest to the given X coor dinate will be modified This type of data set can only accumulate as much data as there are cells in the chart If this option is FALSE the data set is continuous and will accumulate as much data as is plotted In this case the value plotted will be the exact point specified to SetCoordinate orPlot The default value is TRUE Chapter 7 Graphs ChartDSStatic Applies to continuous data sets only This option should be enabled if the data to be plotted to the chart is known off line i e all data is to be plotted at the same time This will dramatically improve plotting time for charts showing large amounts of static data The default value is FALSE ChartDS Surface Setting this option will show the data set as a continuous surface connecting succes sive data points Surfacing can be enabled for both discrete and continuous data sets In the continuous case it should ALWAYS be enabled The default value is FALSE ChartDS Centered Applies to discrete data sets only If TRUE the center point of the bar is equal to the center point of the data cell Generally for histograms this option should be TRUE and for surface and bar charts it should be FALSE Default value is TRUE ChartDS Narrow Applies to discrete non s
59. sets within its 2 D plot Within SIMDRAW you can specify whether the 2 D plot is a trace plot or a simple plot You also specify how each of the data sets is to be represented 2 D Plot 0 50 X axis EN 023 RI pataset2 Figure 7 2 2 D Plot The Plot method is used to plot a point within one of the data sets in the chart The num ber of the data set to plot and the x and y coordinates are given to the method If the Y value plotted extends beyond the Y axis boundaries that axis is automatically rescaled The plot s X axis is rescaled only if that plot is a trace plot For example to see y 50 0 plotted at x 2 20 0 within data set 1 the following code is used ASK chart TO Plot 1 20 0 50 0 A chart can also be plotted with the SetCoordinate method Using this method the change to the graph is not made visually apparent until it is asked to Draw Therefore mul tiple points can be plotted without seeing the effect until a Draw is done A chart can optionally contain legends for each of the data sets The name used in the leg end is the name given to the data set within SIMDRAW The data sets contained in the 2 D plot can be represented as follows Histogram Used to plot a fixed number of values A plotted value or data cell is shown using a rectangle Each rectangle spans across adjacent X axis tick marks Therefore the width of each data cell is exactly the X axis tick mark interval Bar chart This data set also co
60. shown to the right of the plot area Each data set in your chart can belong to either the left or right second Y axis Static This item is used to enhance performance whenever you do not intend the plot to be modified once it has been displayed In this case a single polygon or polyline will be used to display all cells in the data set 2 14 3 6 Creating a Time Trace Plot If you want the chart to be used to plot the value of a single variable over simulation time a time trace plot should be used To create a trace plot select the graph and use the Edit Properties option Set the Time Trace Plot checkbox in the Chart Detail Dialog 2 14 4 Pie Charts A pie chart can depict a fixed sized array of scalar values in relation to one another By selecting the Pie Chart and using the Edit Properties menu option you can change the names and initial values shown by each pie slice The color and fill style of individual slices and other components including legend text title and borders can be changed by selecting them and using the Style or Color palettes The Detail Dialog for a pie chart contains the following Library Name The name of the object within the current graphics library Title Text of title displayed on top Show borders Determines whether to put borders around the legend title and plot of a pie chart Slice List Box This list box contains the names of all slices in the chart 1 To add a slice set
61. take a long time to ren der or would crash the program because of a lack of memory You may use the SetPortion method of the SnapShotOb j to limit the area of the bit map that is drawn This is useful when zooming to prevent the entire bitmap from being scaled For example to zoom into the rectangle 8192 8192 16383 16383 in the above example add the following code ASK bitmap TO SetPortion 8192 0 8192 0 16384 0 16384 0 ASK window TO ZoomIn 8192 0 8192 0 16384 0 16384 0 5 8 2 Bitmap Alignment Centering Normally the position of a SnapShotOb j object is specified with respect to its center point at the lower left hand corner The center point can be changed through the 71 SIMGRAPHICS II User s Manual SetAlignment method For example to center a non scalable bitmap in the window assuming you are using the default coordinate system use the following code ASK snapShot TO SetAlignment SnapHorizCentered SnapVertMiddle ASK snapShot TO SetTranslation WorldXhi 2 0 WorldYhi 2 0 5 8 3 Programmatic Definition of Bitmaps There may be cases where off line definition of the bitmap is not possible A bitmap can be constructed from within a MODSIM III program using the SetNumPixels SetPixelColor and SetPixelRGBColor methods of SnapShotObj Use the SetNumPixels method to define the size in pixels of the bitmap Whenever SIMGRAPHICS II requires the pixels of the bitmap to be defined the object s BePainted m
62. text alignment of all cells in the specified column Only call this method after Set Size ASK METHOD SetHeadings IN haveRowHeadings haveColumnHeadings BOOLEAN Sets whether special scrolling panes containing row or column headings will be in cluded with the table The default is no headings ASK METHOD SetVerticalGrow IN addRowsWithScroll BOOLEAN Sets whether rows will be automatically added to the bottom of the table when the user attempts to scroll vertically past the last row The default is no headings 121 SIMGRAPHICS II User s Manual ASK METHOD SetMaximized IN maximized BOOLEAN Sets the table to become maximized within a ControlWindow0b3 when it is created This method only has an effect when the parent window is a ControlWindow0b3 This method invalidates any calls to SetSize ASK METHOD Keypress IN keyPressed STRING Callback for when a key is pressed Called automatically whenever a character is typed while focus is set to one of the table cells A string representing the activated key is provided Generally this string will be of length 1 ASK METHOD BeExpanded Called automatically whenever an expandable table is increased in size through the use of the down arrow key The BeSelected method is called whenever a cell is clicked on The SelectedColumn and SelectedRow fields can then be used to take the appropriate action 8 21 Calling BeSelected for the TextBoxObj ValueBoxObj and ComboBoxObj T
63. the library are show at the bottom of the list 2 Alphabetical Alphabetical order based on name 3 Categorical Objects are listed by category The categories are Image 3 D Image Graph Dialog Box Menu Bar and Palette A heading is created for each category with the objects listed alphabetically under the appropriate heading Click on the to the left of the heading to expose the names of the objects To collapse the list click on the SIMGRAPHICS II User s Manual The Preferences dialog also has options for specifying how SIMDRAW is started up SIMDRAW can be configured to remember its previous window position and which library file was loaded Objects being edited in either the Layout Editor or a single editor can optionally be reloaded at start up 2 12 Command Line Arguments SYNOPSIS simdraw 1 file name S sys path name B sys path name sim e dim xlo ylo xhi yhi nodialog noimage nograph nomenu nopalette W path name object names The following command line arguments are recognized by SIMDRAW 1 file name Specifies the name of the SIMGRAPHICS II graphics file to edit e single Specifies single edit mode The specified objects will be edited with no control window containing library informa tion dim xlo ylo Specifies the default real world coordinate space used by xhi ylo the Image Editor B path_name Specifies the path to bitmap files used by SIMDRAW
64. the new slice s name and value in the Slice Name and Slice Value text boxes below and press the Add button To remove a slice select its name in the list box and press the Remove button To change the name or value of a slice first select its name in the list box and then update the Slice Name and Slice Value text boxes and press the Update button 23 SIMGRAPHICS II User s Manual 2 14 5 Clocks C Ia Clocks are used to display simulation time within a program Both analog and digital va rieties of clocks are available By selecting the clock and using the Edit Properties menu option you can change its various attributes including axis scaling parameters as well as whether or not to display hours minutes and seconds The color and fill style of individual components including face title and border can be changed by selecting them and using the Style or Color palettes The Detail dialog for a clock contains the following Library Name The name of the object within the current graphics library Title Text of title displayed on bottom Interval Analog clock only Distance between tic marks around the face Num Interval Analog clock only Distance between numbers around the face Max Hours The maximum number of hours the clock shown at the top of the face that the clock is capable of showing generally 12 or 24 As this value is exceeded the time display will start over from 0 00 00 Show Hours Show Mi
65. the respective axis The default values are FALSE ChartRescaleX ChartRescaleY ChartRescaleY2 These options specify as to whether an axis will be re numbered scaled when one of the data points extends beyond its limit Note that re scaling will modify the tick mark numbering and grid line intervals to maintain a similar visual representation ofthe chart If RescaleXOption is FALSE data points falling beyond the limits of the X axis will be discarded A data point whose Y value is out of range of a non re scaleable Y axis is highlighted The default value of these options is TRUE ChartCompressX When this option is TRUE re scaling the X axis will increase the coordinate area of the chart enough to encompass the offending data point As a result existing data will shrink in size Setting the option to FALSE is equivalent to having data scrolled along the X axis during rescaling In this case data scrolled out of view will be discarded The default value is FALSE 7 7 9 Setting Chart Data Set Options Data set options apply only to a individual data set Values in the DSOptionType enu meration specify the option to be changed An option of a particular data set can be mod ified only AFTER that data set has been added to the chart 100 ASK METHOD SetDSOption IN dsNum DSRefType possible option s shown below IN option ChartDSOptionType dsNum DSRefType IN optionOn BOOLEAN ChartDSDiscrete If TRUE the data
66. to each vertex to be replaced by a rounded corner This value is specified with respect to the real world coordinate space or dimension of the editor the default dimension is 0 0 32767 32767 A value of 1000 0 is reasonable for rounding corners SIMGRAPHICS II User s Manual Polygons Ay nu Polygons are created by clicking either the freehand polygon or rectangle buttons on the Mode palette To create a polygon press the Polygon button on the Mode palette Point and click in the window to define vertices Double click to create the last vertex and return to Select mode To create a freehand polygon press the Freehand fill button on the Mode palette Drag the mouse around the canvas area to draw the shape Release the mouse button to return to Select mode To create a simple rectangle press the Rectangle button on the Mode palette Point to where you want the lower left hand corner of the rectangle to start and drag the mouse to the de sired top right corner Release the mouse button to return to Select mode Use the Style palette to define a hatch pattern There are eight patterns to choose from Circles Circles are added by pressing the Circle button on the Mode palette In Circle mode point to where you want the center of the circle to go and drag the mouse to define the radius Release the mouse button to draw the circle and return to the Select mode Use the Style palette to give the circle a hatch pattern There are ei
67. used to display status bar messages shown when the pointer passes over a menu item See MenuItemObj SetMessage In addition the width of this pane varies with the width of the window Therefore the space for panes 1 2 n will not be truncated unless absolutely necessary 4 9 Notification of Window Close and Resize Events Many toolkits provide a mechanism for closing windows while an application is running Whenever a user closes a SIMGRAPHICS II window that window s BeClosed method is automatically invoked The default behavior of BeClosed is to terminate the applica tion but you can OVERRIDE this method to do something else EXAMPLE MyWindowObj OBJECT Window0b3 OVERRIDE ASK METHOD BeClosed END OBJECT OBJECT MyWindowObj ASK METHOD BeClosed BEGIN OUTPUT Window has been closed by the user ASK window TO Erase don t quit just get rid of window END METHOD END OBJECT Similarly for resize events MyWindowObj OBJECT WindowOb Jj OVERRIDE ASK METHOD BeResized END OBJECT OBJECT MyWindowObj ASK METHOD BeResized BEGIN OUTPUT Window has been resized by the user END METHOD END OBJECT Whenever you resize a window that window s BeResized method is automatically invoked You may override the BeResized method but you should do an inherited BeResized for all of the window s contents to be rendered 56 Chapter 4 Windows 4 10 Printing the Contents of a Window The system specif
68. 0 draw the entire solar system ASK solarSystem TO Draw Each earth hour compute the amount of rotation of each planet and planet orbit then rotate planets and orbits LOOP compute rotations of planets mercuryRot TRUNC earthHours MercuryDay 360 0 venusRot TRUNC earthHours VenusDay 360 0 earthRot TRUNC earthHours EarthDay 360 0 marsRot TRUNC earthHours MarsDay 360 0 compute rotations of orbits of planets mercuryOrbitRot TRUNC earthHours EarthDay MercuryYear 360 0 venusOrbitRot TRUNC earthHours EarthDay Appendix F Complete Solar System Example VenusYear 360 0 earthOrbitRot TRUNC earthHours EarthDay EarthYear 360 0 marsOrbitRot TRUNC earthHours EarthDay MarsYear 360 0 rotate the planets ASK mercury TO SetRotation mercuryRot ASK venus TO SetRotation venusRot ASK earth TO SetRotation earthRot ASK mars TO SetRotation marsRot rotate the planets around the sun ASK mercuryOrbit TO Rotate mercuryOrbitRot ASK venusOrbit TO Rotate venusOrbitRot ASK earthOrbit TO Rotate earthOrbitRot ASK marsOrbit TO Rotate marsOrbitRot update every 6 earth hours earthHours earthHours 6 0 END LOOP END MODULE 169 SIMGRAPHIC S Il User s Manual 170 Appendix G Utility Procedures G 1 Utilities There are some procedures available to perform various functions r
69. 00 0 VAR meter MeterVObj ASK meter TO DisplayValue 100 0 MeterVOb js have a new method called SetRange which sets the Min and Max fields for the meter One of the meter objects is a D alObj this is a graphical display of a dial It can have numbering on the inside or outside Figure 7 6 Dial 89 SIMGRAPHICS II User s Manual 100 80 60 40 20 0 Level Meter Figure 7 7 Level Meter DialObjs have methods SetBounds SetNumOutside and SetRange SetBounds sets the position in degrees of the maximum and minimum values on the dial MinTheta and MaxTheta are integer fields that specify the minimum and maximum angular positions given in degrees SetNumOutside sets whether numbering will be outside the dial NumOut side is a Boolean field that is TRUE if numbering is outside the face of the dial and false otherwise The default is FALSE SetRange is inherited from MeterVObj Another meter is a LevelMeterObj A level meter is a small rectangular 1 D graph con taining a bar whose height represents the value being displayed LevelMeterObj has amethod SetGridLines which turns grid lines on and off If the Boolean variable Gridlines is TRUE grid lines are turned on otherwise they are off SetRange is inherited from MeterVObj A DigitalDisplayOb j is another meter type This is a simple box with a title containing the value The FieldWidth attribute of the digital display specifies the total number of spaces that
70. 2 Chapter 4 Windows EXAMPLE VAR xlo ylo xhi yhi REAL ASK window TO SetMappingMode XMajorMap ASK window TO SetSize 80 0 20 0 ASK window ViewableArea xlo ylo xhi yhi You may also wantto SET the viewable portion of the window thereby letting you decide what part of the window s coordinate system is visible This can be done using the SetAspectRatio method The aspect ratio of a window is its width height If the map ping mode is XMajorMap the height of the window is modified to reflect the aspect ra tio Otherwise window width is changed EXAMPLE Suppose you wanted the viewable portion of the windows contents to be xlo 0 0 ylo 0 0 xhi 32767 0 yhi 22000 0 ASK window TO SetSize 80 0 80 0 ASK window TO SetMappingMode XMa jorMap ASK window TO SetAspectRatio 32767 0 22000 0 window height is changed ASK window TO Draw 4 6 Mouse Monitoring Another property of a window is that it can monitor the mouse The window optionally can be informed of both mouse movement and mouse button clicking The default is to monitor both Monitoring of mouse movement is turned on and off by the method SetMoveMonitoring Monitoring of mouse button clicks is turned on and off by the SetClickMonitoring method For example to tell a window to monitor mouse movement only the following code is used VAR window WindowObj ASK window TO SetClickMonitoring FALSE ASK window TO SetMoveMonitoring TRUE
71. AW or programatically In SIMGRAPHICS II a tab page is implemented through a TabOb J object found in the module GTab TabObj objects are added directly to the DialogBox0b3 while controls are added to the appro 124 Chapter 8 Controls priate TabOb j The tab area s size and position can be changed using the following meth od of the DialogBoxObj ASK METHOD SetTabPosition IN x y REAL ASK METHOD SetTabSize IN width REAL IN height REAL Sets the position of the top left corner and size in font units of the tab area Fields and methods of the TabOb j found in the module Gt ab are defined as follows IconName STRING Name of the bitmap shown in tab part of the Page ASK METHOD SetIconName IN Name STRING Sets the name of the icon that appears to the left of the text in the tab In MS Win dows systems this refers to the name of the resource containing the bitmap data On X Window systems it is the name of the window dump xwd file containing the bitmap A path can be prepended to this file name but the extention should NOT be included Path names will be ignored on MS Windows ASK METHOD SetVerify IN verifyData BOOLEAN If the VerifyData field is TRUE selecting a different tab when this object is the top Page invokes verification processing for all value boxes contained by this Page Pages are not switched until all value boxes pass the verification tests ASK METHOD SetTabMultiRow IN tabMultiRow BO
72. D BeSelected VAR menuitem MenultemObj BEGIN menuitem LastPicked CASE ASK LastPicked ReferenceName WHEN Exit HALT WHEN Redo GoAgain END CASE END METHOD 8 24 1 Mnemonics Mnemonics are one character keystrokes that enable you to pull down a menu or select a menu option using the keyboard while the menu or menu option is visible On most sys tems the mnemonic that activates a menu or menu option is displayed by underlining the mnemonic character in the menu string On most systems you would press Alt plus the mnemonic to pull down a menu and then another mnemonic to select one of the items in the menu Both MenuOb j and MenuItemObj can be assigned mnemonics either using SIMDRAW or using the SIMGRAPHIC s method SetMnemonic Of course no two MenuItemOb js in the same MenuOb j should be assigned the same mnemonic If your toolkit does not support mnemonics then assigning them has no effect The following code assigns the File menu the mnemonic f and the Save item in the File menu the mnemonic non S ASK FileMenu TO SetMnemonic f ASK Saveltem TO SetMnemonic s 8 24 2 Check Uncheck Menu Options A small check mark can be displayed next to the right of the label on a menu option This is useful for indicating to the user whether an option in your program is currently on or off Check marks are displayed and hidden using the Set Check and DisplayCheck methods The following code puts
73. E O AE AEE E EEA E EEO E IEEE D 5 MARKERS D 6 SNAPSHOT OBJECT ME D 7 ExAMPLE PROGRAM Appendix E Animation Speed Optimization Deere celui TNE E es etn E MELLE TP oca E 1 REAL TIME ANIMATION MODE ee Re emn enn cnnnnan nennen ers nn iieri seen sese ansa sein sas se aa nsns E 2 SETSNAPSHOT Samil ici tao om eo base voe cede ed bua dni E 3 SETREDRAWABLE E 4 EXCLUSIVE OR DRAWING MODE i E 5 MISCELLANEOUS TIPS ON FASTER ANIMATION E 6 COMMAND LINE OPTIONS Appendix F Complete Solar System Example Appendix G Utility Procedures sees EE eeeeeenen nenne nennen na nnn nn nhan ntn rna tents G 1 UTILITIES 8 Appendix H Audio o Supportfa for r SIMGRAPHICS I ll Appendix I Runtime Graphics Errors cscsccesccceceeeeesese narra 8 24 MENU Bar MENU MENU ITEM E wee 131 wee 134 8 24 4 Menu Bar Example Program TEE 129 132 wise 133 8 25 PALETTES PALLETTE BUTTONS PALETTE SEPARATORS ctc 136 139 Appendix B SIMGRAPHICS ll 3D ceres en nr eene tnter nnns nnne nn nnns B 1 LIGHTS CAMERAS ACTIONI oo ccccccccccceccsceces sees ee cee ceca no no rrnnn nn nana na na nan anno nono no nene near ne rra B2 BUIEDING A 3D MODEL AA a AN sss 144 coo 145 s 145 wee 146 147 143 143 143 151 151 155 Figure 2 1 Figure 2 2 Figure 2 3 Figure 2 4 Figure 2 5 Figure 3 1 Figure 5 1 Figure 5 2 Figure 5 3
74. EGIN END METHOD END OBJECT The BeSelected method will be called automatically when the user clicks on the graphical object 5 7 Getting Image Bounding Boxes To aid in properly positioning and aligning images the new ImageObj method GetBoundingBox can be used to obtain the bounding box in raw Normalized Display Coordinates NDC This is the same coordinate system used for the coordinates in the WindowObj MouseMove and MouseClick callback methods To convert these coordinates to a system defined by another image use the GProcs module procedure Transform specifying NILOBJ for the from image ASK image TO GetBoundingBox xlo ylo xhi yhi Transform NILOBJ image Parent xlo ylo txlo tylo Transform NILOBJ image Parent xli yhi txhi tyhi Your image must be attached to an image tree which is attached to a window before this method can be used 69 SIMGRAPHICS II User s Manual 5 8 Bitmapped Graphics SIMGRAPHICS provides integrated vector and raster capabilities Raster format files can be displayed as backgrounds or icons and combined with vector icons The raster format supported is that of the one most commonly used on the target platform On X Windows based workstations the xwd format is used on machines running Microsoft Windows the BMP format is used A SnapShotObj is used to display bitmaps The bitmap to display is loaded from the file named in the File fieldofa SnapShotObj more accurately the bitmap i
75. ETHOD SetResponses IN buttonSet MessageResponse Type Defines the set of response buttons on the dialog You can have one of the follow ing sets of buttons on your Message Dialog box 128 Chapter 8 Controls OK button only OK and Cancel buttons Yes and No buttons a b c d Yes No and Cancel buttons e Retry and Cancel buttons f Abort Retry and Ignore buttons ASK METHOD SetDefaultButton IN defButton MessageButtonType Defines which of the buttons is default The default button can be activated by pressing Return EXAMPLE The following code will show how to create and display a simple Yes No Cancel box pos sibly responding to a user s request to exit the application VAR messageBox MessageDialogBoxObj NEW messageBox ASK messageBox TO SetText Save changes to file junk er dat 7 ASK messageBox TO SetStyle QuestionMessage ASK messageBox TO SetResponses YesNoCancelResponse ASK messageBox TO SetDefaultButton CancelButton ASK window TO AddGraphic messageBox bool ASK messageBox TO AcceptSysInput CASE messageBox SelectedButton WHEN YesButton OUTPUT Exit and save the changes WHEN NoButton OUTPUT Exit but don t save the changes WHEN CancelButton OUTPUT Forget it Don t exit END CASE 8 24 Menu Bar Menu Menu Item The menu bar figure 8 16 is a container for menus Menus are containers for menu items Selecting a menu causes the menu
76. IM III program To use an image graph or form created by the editor you must do the following 1 Create a window NEW window 2 Create a GraphicLib object NEW GraphicLib 3 Askit to read the file containing the objects created in the editor ASK GraphicLib TO ReadFromFile graphics sg2 4 Create instances of objects you want NEW TruckImage Chapter 1 Introduction to SIMGRAPHICS 5 Ask the instances to customize their appearance by copying an object in the library ASK TruckImage TO LoadFromLibrary GraphicLib truck 6 Add the instances to the window ASK window TO AddGraphic TruckImage 7 Draw either the window or object ASK window TO Draw 1 3 A Simple Program MAIN MODULE Examplel This program gets a truck created in the editor and displays it for 10 seconds FROM OSMod IMPORT Delay FROM Graphic IMPORT GraphicLibObj FROM Window IMPORT WindowObj FROM Animate IMPORT DynImageObj VAR GraphicLib GraphicLibObj window WindowObj truck DynlImageObj BEGIN NEW window NEW GraphicLib ASK GraphicLib TO ReadFromFile graphics sg2 NEW truck ASK truck TO LoadFromLibrary GraphicLib truck ASK window TO AddGraphic truck ASK window TO Draw Delay 10 END MODULE SIMGRAPHICS II User s Manual Chapter 2 SIMDRAW 2 1 SIMDRAW Overview SIMDRAW is an interactive menu based program for creating and editing SIMGRAPHICS II objects These objects
77. INHERITED BeSelected ASK textbox TO DisplayText Text SelectedColumn SelectedRow END METHOD OVERRIDE the BeSelected method on a TextBoxObj which accepts the text ASK METHOD BeSelected BEGIN INHERITED BeSelected ASK table TO SetText Text table SelectedColumn table SelectedRow END METHOD 120 Chapter 8 Controls Table with headers Cell 3 2 contents 32 Cancel block Den 32 42 52 33 43 53 34 44 54 Figure 8 13 Table with Headers TableObj defines the following ASK METHODs ASK METHOD SetText IN text STRING IN column row INTEGER Sets the text shown in the cell at the given column and row ASK METHOD SetSelected IN column row INTEGER Sets the input focus to the cell at column row and makes the it appear as selected The cell will automatically be scrolled into view if necessary ASK METHOD Text IN row column INTEGER STRING Returns the text in the cell at the given column and row ASK METHOD SetSize IN numColumns numRows INTEGER Sets the number of columns and rows of cells in the table ASK METHOD SetVisibleSize IN width height INTEGER Sets the size in font units of the visible portion of the table not including scroll bars ASK METHOD SetColumnWidth IN columnNumber width INTEGER Sets the width in font units of the given column number ASK METHOD SetColumnAlignment IN columnNumber INTEGER IN align TextHorizType Sets the
78. MObj SetGraph IDataPtMObj SetHistMode Single variable plotted over time ChartObj trace plot in edi RDataPtMObj SetGraph tor IDataPtMObj Many single variables in the same ChartObj RDataPtMObj SetGraph graph each shown as a bar or pie PieChartObj IDataPtMObj SetElement slice Histograms of 2 or more variables in ChartObj RDataPtMObj SetGraph the same graph IDataPtMObj SetHistMode SetDataSet 2 or more variables plotted over time ChartOb j trace plot in edi RDataPtMObj SetGraph in the same graph tor IDataPtMObj SetDataSet 2 or more sets of many single vari ChartObj RDataPtMObj SetGraph ables in the same graph each single IDataPtMObj SetDataSet variable shown as a bar in a chart SetElement Array of variables of type REAL or ChartObj RDataSetMObj SetGraph INTEGER PiechartObj IDataPtMObj 2 or more arrays of variables of type ChartObj RDataSetMObj SetGraph REAL or INTEGER on the same graph IDataPtMObj SetDataSet 95 SIMGRAPHICS II User s Manual 7 6 Graph Example Here is an example program using a chart 96 MAIN MODULE Example5 This small program loads in a chart from a library and plots a curve within it We assume that the editor has created a chart named Chart This graph should have it s XMin at 2 0 XMax at 2 0 YMin at 8 0 and YMax at 8 0 and have 2 data sets These data sets should be of the simple plot representation It should be saved in Example5 sg2 FROM Window IM
79. N graphic GraphicVObj Converts graphic into postscript At this point the file is opened for writing if File lt gt i ASK METHOD OutputLine IN pstring STRING This method is called for each postscript line that is generated The default behavior of this method is to write the line out to the file ASK METHOD SetCopies IN PageCount INTEGER Sets number of copies to print ASK METHOD SetSize IN size REAL Sets size of output copy in inches It is always square Equivalent to SetSizes size size ASK METHOD SetSizes IN width height REAL Sets output area of page in inches This is a new routine to support non square win dow output and enable full page use ASK METHOD SetOrientation IN orient PSOrientationType Sets orientation of image on page This is a new routine to support non square window output and enables full page use Landscape orientation will cause the X axis of the image to be aligned along the long dimension of the paper the same direction specified by the SetSizes height argument Default is Portrait ASK METHOD SetSizeToFit IN flag BOOLEAN Allows image to be scaled to fit drawing area Supports non square window output and enables full page use If set TRUE the ImageObj or WindowObj graphics will be scaled by the same amount in both x and y to fit in the specified output area See SetSizes ASK METHOD SetOffset IN x y REAL Sets offset from lower left corner of page in inches Note
80. NEW mercury NEW venus NEW earth ASK library TO ReadFromFile SolarSys sg2 ASK mercury TO LoadFromLibrary library MERCURY ASK venus TO LoadFromLibrary library VENUS ASK earth TO LoadFromLibrary library EARTH 3 2 Behaviors of Graphical Objects When an operation is performed on a graphical object that begins with Set the effect of that operation is not seen visually until the object is asked to Draw Operations not begin ning with Set have immediate effect For example if you wanted to change the position of a graphical object and actually see this position change the following code could be used ASK graphic TO SetTranslation x y sets the position ASK graphic TO Draw updates object display The DisplayAt method is equivalent to the code above Since DisplayAt does not begin with Set the operation takes immediate effect ASK graphic TO DisplayAt x y Whenever a graphical object is asked to Draw all of its children will be asked to draw as well Any objects that were previously erased will now be shown in the window To main tain visibility status the Update method should be used This method will redraw only those objects that are currently visible Another behavior common to all graphical objects is that they have an automatic asynchronous selection capability Whenever a leaf graphical object within the tree is 47 SIMGRAPHICS II User s Manual clicked on with the mouse
81. OLEAN If the TabMultiRow field is TRUE page tabs at the top of the Page area will be shown in multiple rows Otherwise a single scrollable row is used The SetLabel method is used to set the text appearing in the tab 8 22 3 Dialog Box Example Program The next example accepts input from a dialog box created by SIMDRAW The dialog box contains OK and Cancel buttons It is displayed until one of the buttons is selected Ok was selected or Cancel was selected is output 125 SIMGRAPHICS II User s Manual 126 MAIN MODULE Example7 Simple dialog box FROM Window IMPORT WindowObj FROM Graphic IMPORT GraphicLibObj FROM Form IMPORT DialogBoxObJj FROM Button IMPORT ButtonObj FROM Value IMPORT ValueBoxObj VAR window WindowObj dialog DialogBoxObj button ButtonObj library GraphicLibObj valuebox ValueBoxObJj BEGIN Initialize graphics and create a window NEW window ASK window TO Draw Load description of menu bar from the library NEW library ASK library TO ReadFromFile Example7 sg2 NEW dialog ASK dialog TO LoadFromLibrary library DialogBox valuebox ASK dialog Child capacity 0 ASK window TO AddGraphic dialog ASK valuebox TO SetValue 47 3 Wait for terminating button to be selected before exiting button ASK dialog TO AcceptInput CASE ASK button ReferenceName WHEN ok OUTPUT Capacity valuebox Value OUTPUT Ok was sele
82. OPEN_S FILESAVE S CUT S COPY S PASTE S CLEAR S 2 DETAIL S D Simulation Icons D Miscellaneous Icons D METAEDITOR Icons IN SIMFLOW Icons Figure 8 9 Tree View Control ASK METHOD SetIsSelected IN item TreeItemObj IN isSelected BOOLEAN SetIsSelected ofitem Assumes item is in the graphical set ASK METHOD DisplayIsSelected IN item TreeItemObj IN isSelected BOOLEAN Selects an item in the tree and updates the tree display Assumes item is in the graphical set belonging to the TreeObj and the TreeOb j has already been dis played ASK METHOD SetSize IN width height INTEGER Sets the width and height of the tree in font units ASK METHOD SetMaximized IN maximized BOOLEAN Sets the tree to become maximized within a Cont ro1WindowObj This method only has an effect when the tree is attached to a ControlWindowObj This method invalidates any calls to Set Size A TreeItemObj defines the following fields and methods IsSelected BOOLEAN TRUE if this item is currently selected IconName STRING Icon name to appear in the TreeObj adjacent to this TreeItemObj ASK METHOD SetIconName IN iconname STRING Sets the resource or file name of the bitmap to be used in the face of the button In MS Windows systems this refers to the name of the resource containing the bitmap data On X Window systems itis the name of the window dump xwd file con taining the bitmap A path can be prepended to
83. Obj 135 SIMGRAPHICS II User s Manual ASK METHOD BeRightSelected BEGIN Only display the popup menu if the tree control was right clicked on IF LastPicked ReferenceName tree Build the popup menu as in the example above Add it to this dialog box AddGraphic popupMenu Wait for the user to make a selection pickedItem ASK popupMenu TO AcceptInput handle user response as above Get rid of the menu DISPOSE popupMenu END IF END METHOD END OBJECT 8 25 Palettes Pallette Buttons Palette Separators Palettes PaletteObJj can be created and attached to the sides of a SIMGRAPHICS II window A palette contains rows and columns of selectable square palette buttons PaletteButtonObj Each palette button shows a bitmap icon on its face On MS Windows systems palettes can be dockable At runtime you can reattach a dockable palette to a different side of its window Palettes not docked to any edge of the window are called floating and behave like modeless dialog boxes Figure 8 18 shows a window containing two palettes docked on the top and left a menu bar and a status bar A palette can be created in SIMDRAW or programmatically To use a palette define a new type of object derived from PaletteObj and override the BeSelected method This method will be invoked whenever the user presses one of the palette buttons The LastPicked field will point to the last palette button selected To receive
84. PHICS ERROR 240 Pane number exceeds total number of status panes When using the ShowStatus or Set PaneWidth methods of WindowObj the given pane number must be 0 and the number of panes 1 GRAPHICS ERROR 241 Button face icon path num could not be loaded An attempt was made to load in a bitmap file for a palette button that was either non existent read protected or of the wrong format To disable printing of this error use the PaletteButtonObj SetNoError method or set the IgnoreSSLoadErrors variable in the module GSnap to TRUE In this case the FileStatus field will contain the status of the last Read attempt GRAPHICS ERROR 242 3d Graphics not available on this system An attempt was made to display 3 D graphics under a toolkit not currently support ing 3 D graphics 180 Index Numerics SERA e 19 3 D polygon oeste eed 146 3 D polyline needs 146 3 D Prmitives eoe eres 145 A animation ede ERR s 164 acceleratoE aii 131 AcceptInput eese 68 108 130 171 AcceptSysI nput eseeesseesrsesrererrerssrersrrereseeresee 127 KEE 109 AddChild eiii 46 AddDataSet n aterert 103 AddGraphic esses 2 77 113 adding an object to the library 6 P D M 128 align and distribute shape 16 alignment bitmap seen 71 AnalogClockOb se
85. PORT WindowObj FROM Graphic IMPORT GraphicLibObj FROM Chart IMPORT ChartObj FROM GProcs IMPORT HandleEvents VAR window WindowObj library GraphicLibObj chart ChartObj x REAL BEGIN create a window and open it up NEW window ASK window TO Draw read a Example5 sg2 into a library and get a chart called Chart NEW library ASK library TO ReadFromFile Example5 sg2 NEW chart ASK chart TO LoadFromLibrary library Chart Add the chart to the window ASK window TO AddGraphic chart Plot the curve y x 2 in dataset 1 and y x 3 in data set 2 x 2 0 WHILE x lt 2 0 ASK chart TO SetCoordinate 1 x x x ASK chart TO SetCoordinate 2 x x x x x x 0 1 END WHILE Now see the chart and the results of the plotting Chapter 7 Graphs ASK chart TO Draw wait LOOP HandleEvents TRUE END LOOP END MODULE 7 7 Creating Graphs at Runtime Using a set of provided ASK methods a programmer can create any graph that can be created by SIMDRAW Fill styles line styles mark styles colors and fonts of graph components can be specified These components are identified in the enumerated type GraphPart Type found in the GTypes module The ChartDataSet and PieSlice parts must be used in conjunction with an integer identifying which data set component to modify The fol lowing methods can be used to program the appearance of a graph 7 7 1 Methods to Set the Color of a Gra
86. ROM Dynamic IMPORT RealTimeAnimation BEGIN RealTimeAnimation TRUE StartSimulation E 2 SetSnapShot A snapshot bitmap can be taken of an image and used for animation This snapshot can be drawn to the window faster than the vector representation of the image A complicated snapshot is drawn in the same time as a simple snapshot The SetSnapShot method marks an image so that snapshots are taken automatically ASK truck TO SetSnapShot TRUE SnapShot should only be used on images whose appearance remains static An image that is continually scaled and rotated or an image whose children are continually modified or repositioned should not set snapshot When the description of an image changes the library must throw away its snapshot and construct a new one This can be expensive if the image s description is continually changing E 3 SetRedrawable When the Redrawable flag of an image is set it will be automatically repainted if anoth er image on top of it is erased This is why you need not worry about redrawing images that have been run over by another image Images are created with the Redrawable flag set to TRUE but this flag can be cleared using the SetRedrawable method Images that will never be run over by another image can have the Redrawable flag set to FALSE and some animation speed improvement may be seen For example suppose you had an image named shoreLine that could never be obscured by another image 163
87. SIMGRAPHICS II User s Manual Object Oriented Simulation Copvright 1997 CACI Products Co August 1997 All rights reserved No part of this publication may be reproduced by any means without written permission from CACI For product information or technical support contact In the US and Pacific Rim In Europe CACI Products Companv CACI Products Division 3333 North Torrev Pines Court Coliseum Business Centre La Jolla California 92037 Riverside Wav Phone 619 824 5200 Camberlev Surrey Fax 619 457 1184 GUI53YL UK Phone 44 0 1276 671 671 Fax 44 0 1276 670 677 The information in this publication is believed to be accurate in all respects However CACI cannot assume the respon sibilitv for anv conseauences resulting from the use thereof The information contained herein is subject to change Re visions to this publication or new editions of it may be issued to incorporate such change SIMGRAPHICS II and MODSIM III are registered trademarks of CACI Products Company Contents Preface E Chapier T 1 Introduction to o SIMGRAPHICS II ID 1 1 SIMGRAPHICS II ENVIRONMENT een e cceceeececeeeeseeau ae set etes sr sedet esas sa atis etes sanas sia RER ER Ek 1 3 2A SIMPEE PROGRAM 5 5 aeter te te vo eroe da e dE Chapter 2 SIMDRAW ici ii did ee 2 1 SIMDRAW OVERVIEW eese a eaaa asks nsi assa sa sese sas ad sn danda 2 2 RUNNING SIMDRAW T eeben AE 2 3 LOADING AND SAVING SIMGRAPHICS u
88. SIMGRAPHICS II User s Manual ASK shoreLine TO SetRedrawable FALSE This flag could also be cleared if you wanted to see an image be eaten away by another im age E 4 Exclusive OR Drawing Mode SIMGRAPHICS II provides an exclusive or drawing mode When using this mode the graphics library does not have to repair parts of the scene that are run over by a moving image thus leading to faster animation This mode is recommended only for simple scenes and is best suited for images that are composed of polylines The WindowObj method SetFastDraw sets the exclusive or drawing mode Note that the mode applies to ALL objects in the window E 5 Miscellaneous Tips on Faster Animation Remember that the time it takes to draw an image is proportional to the size of the bounding box the smallest rectangle that encloses the image A big image takes much longer to draw than a small one Therefore if you had an image whose children were positioned far apart from each other this image would take a long time to draw since the bounding box of the image is huge In this case it is advisable to draw the children of the image instead of the image itself For example suppose bigImage was composed of the two images farChildl and farChild2 and that these children were translated to opposite corners of the window The code ASK farChildl TO Draw farChildl at 0 0 0 0 ASK farChild2 TO Draw farChild2 at 32767 0 32767 0 is prefe
89. Set the Color of a Graph Component See AER 97 7 7 2 Methods to Set the Fill Line or Mark Styles of a Graph on TE 97 7 7 3 Methods to Set the Text Fonts of Graph LL Bean esos 7 7 4 Method to Hide a Graph Component 7 7 5 Additional Methods for Programmatic Creation ote a Coon ica 7 7 6 PieChartObj Methods 7 7 7 Methods for Programmatic Creation ofe a deitsch 7 7 8 Setting Chart Options 7 7 9 Setting Chart Data Set Options H A 7 7 10 Setting Chart Fields 7 7 11 Chart Components Listed in the GraphPartType E Enumeration 7 7 12 Other Methods of ChartObj 7 7 13 Example of Program Code for Creating a Chart Chapter 8 Controls 8 1 CREATING do 8 2 RETRIEVING SYNCHRONOUS INPUT F FROM 1 CONTROLS IP cate 8 3 RECEIVING ASYNCHRONOUS INPUT FROM CONTROLS u cccccccecceeeceeeeeeeeaee ceca cacaceeeeeeeeseseeananenaeass 8 4 DRAWING AND ERASING ccccecsceeeeesceceaeeeneeensecauee sacs ececeanaeseceeeessaeasaceeae se sese eeeaeaeaeeeeseeeeaaaeeees 8 5 DEACTIVATING AND ACTIVATING uiro tel go eet dug Pos EE a di 8 6 SETTING THE GONTROL S LABEL Ani aaa de ra he ht Pe ur D C visit dnt rd rade Pini d Gd 8 7 DISPOSING CONTROLS ades va ee n e sa d da e a oc bec e T n Waleed d a i evi a vo Qa d a 8 8 UPDATING GONTROUS 55 iesvxs od coe sota bete Ad tea Pao terrere dee 8 9 BUTTONS 8 10 CHECK Box 8 11 TExT CT aan eaten aa RO IN ooh eet alee ree e
90. SetGraph tracePlot ASK GETMONITOR Acceleration RDataPtMObj TO SetGraph tracePlot ASK GETMONITOR Position RDataPtMObj TO SetDataSet 1 ASK GETMONITOR Velocity RDataPtMObj TO SetDataSet 2 ASK GETMONITOR Acceleration RDataPtMObj TO SetDataSet 3 A single variable can also be shown as the bar on a chart or a slice on a pie chart The SetElement method takes the bar or slice number of the chart that the data point is to be shown in Bars on a chart are numbered from 1 to N going left to right Slices on a pie chart are numbered from 1 to N going counter clockwise starting at the 3 00 position in the pie The following code would be used to show the variables bostonSales detroitSales and chicagoSales in a piechart 93 SIMGRAPHICS II User s Manual VAR bostonSales detroitSales chicagoSales RDataPt piechart PiechartObj ASK GETMONITOR bostonSales RDataPtMObj TO SetGraph piechart ASK GETMONITOR detroitSales RDataPtMObj TO SetGraph piechart ASK GETMONITOR chicagoSales RDataPtMObj TO SetGraph piechart ASK GETMONITOR bostonSales RDataPtMOb3 TO SetElement 1 ASK GETMONITOR detroitSales RDataPtMObj TO SetElement 2 ASK GETMONITOR chicagoSales RDataPtMOb3 TO SetElement 3 Variables of type STRING can be shown using a TextDisplayObj object The variable must be defined as being monitored by an SDataPtMObj Setting up the monitoring is the same as with other types of variables
91. SetThumbSize and SetThumbPosition methods You can set the horizontal and vertical arrow step sizes using the SetThumbStep method Thumb size and step are specified as a percentage of the total scroll bar size as a REAL in the interval 0 0 1 0 The horizontal scroll position is specified as the distance of the leftmost side of the thumb from the left side of the scrollbar as a REAL in 0 0 1 0 ThumbWidth Vertical scroll position is the distance of the top side of the thumb from the top of the vertical scroll bar as a REAL in 0 0 1 0 ThumbHeight Whenever a thumb position is changed by the user the BeScrolled method is called Note Window contents are NOT scrolled automatically This is the responsibility of the programmer 4 8 Using the Status Bar on a Window Windows can also have status bars A status bar is a set of text output boxes or panes at tached to the bottom of a window The text in these panes can be set programmatically but cannot be changed by a user Panes are numbered from left to right starting with pane 0 The SetNumPanes method defines how many status bar panes to show No status bar will appear if the number of panes is zero The width in character units of each pane ex cept pane 0 can be defined using the SetPaneWidth method To update the text shown in a particular pane use the ShowStatus method 55 SIMGRAPHICS User s Manual The leftmost status pane or pane 0 is special for two reasons First it is
92. TO ReadFromFile Example8 sg2 NEW myPalette ASK myPalette TO LoadFromLibrary library Palette Add palette to the window and display it ASK window TO AddGraphic myPalette ASK myPalette TO Draw Get input from the palette WHILE NOT done HandleEvents TRUE END WHILE END MODULE 138 Appendices 139 SIMGRAPHICS II User s Manual 140 Appendix A Common Pitfalls The following is a list of DOs and DON Ts to keep in mind when programming a SIMGRAPHICS II application Violating these rules may result in crashes which are difficult to diagnose DO NOT Attempt to draw a graphical object that is not attached to an image tree or window Attempt to draw a control that is not attached to a control tree or window Set an attribute of an ancestor and then ask one of its descendants in the tree to Draw without first asking the ancestor to Draw The results of this type of operation are ill defined However itis OK to set an attribute of a child and then ask its parent to Draw Set the RotationSpeed or other speed methods of dynamic image objects to extremely high values such as 999999999 9 or a floating point exception call will be generated Set any of the attributes of a graphical object directly Always invoke the correct Set method to set any attribute DO Remember to invoke the INHERITED behavior of any graphical object s method you have overridden especially the ObjInit method Remember
93. The following fea tures apply to control windows 1 Control windows are sized and positioned exactly like conventional windows using the SetSize and SetTranslation methods with the parameters given in Screen Space 0 0 to 100 100 2 Unlike dialog boxes you can resize a control window You can also minimize and maximize a control window 3 Control windows do not automatically grow to fit their contents like dialog boxes A control window will automatically attach and manage scroll bars if there is not enough visible area to show all of its controls 4 Acontrol window can be managed as a sub window inside a frame window The ListBoxMultObj TableObj TreeObj and MultiLineBoxObj controls can be maximized inside a control window In this case the control will occupy the full width and height of the canvas and automatically resize with the window This allows you to have table windows tree windows and text ed itor windows Control windows handle their own mouse events There is no notification of mouse move ment scroll bar manipulation or background clicking in a control window as there is with a standard window 59 SIMGRAPHICS User s Manual 60 Chapter 5 Images In MODSIM III mages are shapes that are seen on the canvas of a window The image provides many capabilities The basic ones are e Animation In MODSIM III images are easily animated When images in the same window pass over the top of ea
94. Width refers to the default x direction narrow dimension of paper RE GARDLESS of the orientation of the image See SetOrientation ASK METHOD SetBackground IN r g b REAL Sets background color for the image that is printed Notice that printed pages are usually white while SG2 application windows rarely are If the application s text Chapter 5 Images was white for instance it would be invisible on a white page Use this method to change the background to a contrasting color such as black ASK METHOD SetShowWindow IN show BOOLEAN If show TRUE displays a window around the printed image ASK METHOD SetWindowName IN name STRING Displays name at top of image if SetShowWindow TRUE ASK METHOD SetPSFont IN UseBuiltInFont BOOLEAN If SetFont TRUE substitutes PostScript fonts for stroked SG2 fonts PostScript fonts are always substituted for System Text fonts ASK METHOD SetPSTarget IN target PSTargetType Specifies how SnapShotObjs are encoded into PostScript Generates SnapShotOb j Postscript for Level 1 black and white PSTGrey color Level 2 PSTColor or portable format for both PSTBoth Default is PSTBoth Note that the portable format will result in a larger file than the others the black white grey format is the smallest 75 SIMGRAPHICS II User s Manual 76 Chapter 6 Dynamic Objects MODSIM III provides for a connection between graphical objects and simulation Objects that form this connecti
95. a nnnonnncn nana conan an cn nn serit ana 3 2 BEHAVIORS OF GRAPHICAL OBJECTS ccononocncnononononancnnnnnnananancn ono nnn nana nn conan anna canon anar sr sa nina Chapter 2 WINdOWS PEE 4 1 SIZE AND POSITIONING 4 2 BACKGROUND COLOR T 4 3 ADDING GRAPHICAL OBJECTS TO A a WINDOW 4 4 COORDINATE SYSTEMS FOR WINDOWS sse eee cesececeseeseeeseeuueueeuseaeseauasesseeae cnn 4 5 CREATING NON SQUARE WINDOWS occcnoncncnnccononononancncnnnnananananonnnnanana nano nn nan nnnncn nan an aran one nn nana cana 46 MOUSE MONITORING est is edades espe ee s bor P a 4 7 SCROLL BARS 4 8 USING THE STATUS BAR ONA A WINDOW 4 9 NOTIFICATION OF WINDOW CLOSE AND RESIZE EVENTS EE 4 10 PRINTING THE CONTENTS OF A WINDOW issesseeenee e emen en eren enne ann nn nn nan nerens nan 4 10 1 Rules for System Printing sss eene en rns 4 11 FRAME AND SUBSWINDOWS 24 e aberit Penta de eade TED FRE tr xe bed TR RA AER RR A 4 42 CONTROL WINDOWS ici t E cis Chapter 5 Images EEE E AE Lee ee ect es Dd EI E 5 1 IMAGE TREE USED IN GRAPHICS APPLICATIONS ca ceseeeeae suse eeseeauananeness 5 2 IMAGE PRIORITY 5 3 CREATING AND USING IMAGES 5 4 COORDINATE ER EE 5 5 DERIVING FROM IMAGES ccccsccceseseseceaeceanececece sess ea nter nine sisi ses ia ise ases sn sr sr enses sese sr sr sane se se rase 5 6 DETECTING IMAGE SELECTIONS 4 ciii ee tt Aer cre a Lari LP vA UTE Fea va esoe ss P
96. ace provided by the window If the window is wider than it is tall some the window s contents may be clipped along the top For windows that are taller than wide extra non writable space will be seen at the top Using this mode window contents are never clipped along the side nor is there ever any non writable space along the side YMajorMap Regardless of window size the entire Y axis extent of the window s coordinate sys tem can be viewed in exactly the space provided by the window If the window is taller than it is wide some the window s contents may be clipped along the right For windows that are wider than tall extra non writable space will be seen at the right Using this mode window contents are never clipped along the top nor is there ever any non writable space along the top Note The aspect ratio of images seen in a window is never distorted under any mapping mode EXAMPLE Suppose we wanted to see an image move along the bottom of the entire canvas of a short but wide window ASK window TO SetTranslation 0 0 40 0 ASK window TO SetSize 100 0 20 0 ASK window TO SetMappingMode XMa jorMap ASK dynimage TO SetSpeed 1000 0 ASK dynimage TO SetTranslation 0 0 0 0 ASK dynimage TO MoveTo 32767 0 0 0 Using modes XMajorMap and YMajorMap it is possible that not all of the windows contents can be seen You can discover the portion the window s coordinate system that is visible using the ViewableArea method 5
97. ace to another drop it over the top of the button whose position you want it to occupy You can select the palette and edit its properties but it cannot be moved You are not allowed to resize palette buttons or the palette All palette buttons are sized equally based on the size of the first button at top left hand corner of the palette This first palette button is automatically made big enough to contain its bitmap icon However palette separators can be resized Resizing a separator has the effect of adjusting the space between palette buttons To resize the separator first select it and then drag the green resize handle shown on a side of the selection rectangle 42 Chapter 2 SIMDRAW 2 17 2 Using the Clipboard Cut Copy and Paste 5 E The Palette Editor supports the standard cut copy and paste operations found under the Edit menu The Cut option deletes selected items and places them in the clipboard The de leted item remains on the clipboard until the next time you use the Edit Cut or Edit Copy options You can use the Edit Paste option to paste as many copies as you want from the clipboard onto any open menu pane Items can be deleted without changing the clipboard by using the Edit Delete option The clipboard is shared among all active Palette Editor sessions You can copy graphics from one palette into another by activating the source edit window using the Copy option and then activating the destination edito
98. ack 0 NEW left ASK left TO SetColor Green ASK left TO SetPoints leftpts ASK cube TO AddChild left left 0 NEW right ASK right TO SetColor Green 149 SIMGRAPHICS II User s Manual ASK right TO SetPoints rightpts ASK cube TO AddChild right right 0 NEW bottom ASK bottom TO SetColor Green ASK bottom TO SetPoints botmpts ASK cube TO AddChild bottom bottom 0 NEW top ASK top TO SetColor Green ASK top TO SetPoints toppts ASK cube TO AddChild top top 0 Create a camera and position in upper right front aim at origin where cube is set distance from camera of front and back clipping planes then add it to the window NEW camera ASK camera TO SetPosition 5 2 5 2 5 ASK camera TO SetAimPoint 0 0 0 ASK camera TO SetDepthOfField 1 100 ASK win TO AddGraphic camera Create a white positional light NEW light ASK light TO SetColor White ASK light TO SetPosition 5 2 5 2 5 ASK light TO SetType PositionalLight ASK light TO SetAttenuation 0 0 ASK win TO AddGraphic light Make everything visible Ask window to Draw ASK win TO Draw WHILE NOT Closed HandleEvents FALSE END WHILE Cleanup Disposing of the window will dispose of everything DISPOSE win END MODULE 150 Appendix C Canvas and System Cursors A window can optionally have a system or canvas cursor A canvas c
99. afely added to an image tree If you do not want the ImageOb 3 or rubber band cursor to be displayed exactly at the cur rent cursor position you can specify an x y offset from the mouse position to where it will be drawn This is done using the Set CursorOffset method The following code frag ment causes any cursor attached to the window to be drawn at pointer x coordinate 5000 0 pointer y coordinate 2000 0 ASK window TO SetCursorOffset 5000 0 2000 0 There are five cursor objects which provide efficient rubber band cursors These are LineCursorObj RectCursorObj FixedAspCursorObj FixedCursorObj 151 SIMGRAPHICS II User s Manual and DualLineCursorObj Each of these has an anchor point from which the base of the rubber band line is drawn The SetAnchor method sets the anchor point Here is a description of each LineCursorObj The LineCursorObj is used to draw a rubber band line from an anchor point to the current mouse position RectCursorObj The RectCursorOb j is used to draw a rubber band rectangle from an anchor point to the current mouse position FixedAspCursorObj The FixedAspCursorObj is used to draw a rubber band square or other rectangle with a fixed aspect ratio from the anchor point to the cur rent mouse position The aspect ratio of the cursor remains constant by using the max imum of the horizontal or vertical distances from the anchor point as the dimension for the side of the rectangle The ra
100. and an object as the label For example suppose you want to label the point 20 0 30 0 with the string lt Peak Value You also want this label to be rotated 45 degrees and the lt character in the label to rest over the 20 0 30 0 point The following code would accom plish this VAR label TextObj chart ChartObj 86 Chapter 7 Graphs NEW label ASK label TO SetText Peak Value ASK label TO SetAlignment HorizLeft VertMiddle ASK label TO SetRotation pi 4 0 ASK chart TO PlotLabel label 20 0 30 0 Occasionally it may be necessary to change some of the attributes of a ChartObj e g Intervals X axis minimum Y axis minimum to fit the set of data that will be plotted There are several methods of ChartObj that can do this ASK METHOD SetRanges IN xmin xmax ymin ymax REAL Sets the maximum and minimum values shown on the ends of the axes of a ChartObj ASK METHOD SetIntervals IN xinterval yinterval REAL Sets the X axis and Y axis tick mark intervals Also sets the X axis bar width in terval ASK METHOD SetNumIntervals IN xnuminterval ynuminterval REAL Sets the X axis and Y axis numbering intervals ASK METHOD SetGridIntervals IN xgridinterval ygridinterval REAL Sets the X axis and Y axis grid line intervals ASK METHOD SetIntercepts IN xintercept yintercept REAL Sets the axis intercepts xintercept is the point along the X axis where the Y axis crosses ov
101. are associated with MODSIM III objects There SIMGRAPHICS II User s Manual fore using graphics involves creating and manipulating objects Many basic objects have already been provided The most important are WindowObj Standard system window which can be moved resized etc Acts as a container for all graphical objects ImageObj Basic object used for static icons and backgrounds DynImageObJj Basic graphic object used for animation DialogBox0bj Receives various types of input from the user Controls such as buttons check boxes list boxes radio boxes value boxes and text boxes can be part of a dialog box MenuBarObj Receives simple menu selections PaletteObj Receives input from two state palette buttons Since there can be multiple windows on the screen images dialog boxes and menu bars must be added to a specific window This is done using the AddGraphic method of the window For instance to add an image to a window the method call would be ASK MyWindow TO AddGraphic MyImage To make an object visible on the screen you must ask it to draw ASK MyWindow TO Draw ASK MyImage TO Draw To erase an object ASK MyImage TO Erase All of the objects created by the editor can be saved in a single file This single file is called a Library file and has an associated object in MODSIM III called a GraphicLibObj It is used to re create the objects built in the editor so they can be used within the MODS
102. bar is a programmatically adjustable horizontal bar usually used to indicate the completion status of a task The length of the bar is proportional to the value given to it by the program The bar cannot be adjusted by the user only by the program Using Edit Properties you can set the following attributes of the bar e Label The text on the left hand side of the bar identifying it to the user e Width The maximum visible size in font units of the bar 31 SIMGRAPHICS II User s Manual Min The bar will have zero length when set to this value Max The bar will have maximum length when set to this value e Value The initial value displayed by the bar Tables E A table is a two dimensional array of selectable text fields or cells The table can be hor izontally and vertically scrollable All cells in the same column have the same width but you can define the width of columns individually A table can have both column and row headers A row of column headers is shown on top of the array of cells This special row of cells will scroll horizontally with the rest of the table but not vertically Row headers are shown in a column to the left of the table This column scrolls with the table only in the vertical direction You can navigate through a table using the left right up and down arrow keys The program will be informed of cell selection whenever an arrow key is used to move to a different cell
103. box bigger The actual dialog box you are working on can be displayed using the Layout Show Dialog menu Double click on the in the header bar of the dialog window to make it disappear 26 Chapter 2 SIMDRAW F Simdraw C SiMSCRIFADEMGS IMAGE3 MEE Image Demo Timescale value Speed ofimage Number of rotations Figure 2 3 Dialog Editor 2 15 1 Selecting Moving and Resizing An item in a dialog box or control is selected by clicking the mouse button over its visible portion Multiple controls can be selected by either holding down the Shift key and clicking on several items or by dragging the selection box over the controls you want to select Selected controls are marked by a bordering green or cyan box Sides and corners of this box may contain small square resize handles A resize handle is present for each dimension that the control can logically be resized in Resizing is performed by clicking down and dragging a resize handle To move a control click down on it and drag to the desired location 2 15 2 Dialog Box Coordinate System Controls are positioned in font units The width of a font unit is the width occupied by a single digit within a dialog box The height of a font unit is the maximum of button and text box heights The origin of a dialog box s coordinate system is at its top left hand cor ner with Y values increasing downward 27 SIMGRAPHICS II User s Manual 2 15 3 Usin
104. can be used for animation presentation graphics and interactive graphical input Types of objects include images dialog boxes menu bars palettes and various charts and graphs These objects are saved to and loaded from SIMGRAPHICS II sg2 files that can be accessed by a MODSIM III program Animation graphics or images are built by drawing lines circles polygons arcs sectors bitmaps and text These primitives can be grouped together to form more complex images containing parts that can be manipulated independently by the application program Images are built by the Image Editor Presentation graphs are constructed by setting attributes such as titles minimums maxi mums etc Several different graph types can be built They include 2 D plots level meters pie charts trace plots clocks dials text displays and digital displays All graph types are built with the Graph Editor A Layout Editor is available for sizing and positioning multiple graphs and images within the same window Using the dialog boxes can be constructed for receiving interactive modal or modeless data input The dialog box can contain buttons check boxes text boxes combo boxes list boxes and radio button fields A dialog box can also contain the more compli cated multi line text boxes and 2 D tables Tabbed dialog boxes can be created Menu bars can be built with the Menu Bar Editor For receiving modeless command input Menus can be attached to other men
105. ccur if the library is asked to SetNoError TRUE GRAPHICS ERROR 235 Bad version library file You tried to read in a library file created by a version of the editor newer than the runtime library you are using GRAPHICS ERROR 236 Snap shot file filename could not be read An attempt was made to load in a bitmap file that was either non existent read protected or of the wrong format To disable printing of this error use the SnapShotObj SetNoError method or set the IgnoreSSLoadErrors variable in the module GSnap to TRUE In this case the FileStatus field will contain the status of the last Read attempt GRAPHICS ERROR 237 Attempt to add a control to a file dialog box The structure of the file font and message dialog boxes is defined by the toolkit You are not allowed to add controls to these objects GRAPHICS ERROR 238 System font family family name size pt size weight weight could not be found A font matching the given font description could not be found on the server The TextObj SetNoFontError method can be used to disable printing of this er ror message In this case the SysFontStatus field will contain the status of the last attempt to display the text See Appendix D GRAPHICS ERROR 239 Object to convert not a WindowObj or ImageObj Only objects derived from ImageObj can be converted to EPS PostScript Dia logs menus and palettes cannot be converted 179 SIMGRAPHICS II User s Manual GRA
106. ch other they will be automatically repaired by the runtime library e Color Each ImageObj can have its own color This color can either be defined by an enumerated constant of type ColorType or be defined in terms of its RGB intensities e Scaling The size of an image can be scaled in both x and y directions e Rotation An image can be rotated a certain number of radians e SnapShot For optimal animation performance the library can optionally construct a snapshot for an image It can be used to draw a complicated image with no per formance penalty e Hierarchically described An image can have subcomponents that are scaled rotat ed and positioned with the whole image but that can be manipulated individually 5 1 Image Tree Used in Graphics Applications In MODSIM III an image can be organized into a hierarchy using ImageObj objects An ImageObj inherits the ability to contain graphical objects from GraphicVObj Since objects contained in an ImageOb j can also contain ImageOb j objects a hierarchy of im ages or an image tree can be constructed to represent the system that is to be graphically modeled The images contained in an image will be referred to as its children The collec tion of the children the childrens children etc will be referred to as an image s descen dants The container of an image is called its parent The collection of an image s parent its parent s parent etc is called its ancestors The ability
107. chically with an unbounded depth In other words a MenuOb j can contain menu option items and other menus A menu con tained in another menu will usually be shown with a small arrow gt and can be brought down by dragging the mouse over this arrow and to the right When a menu option con tained by one of the menus is selected the BeSelected methods for all container menus will be called in a bottom up fashion Cascadable menus can be created programmatically with the AddGraphic and AddChild methods or by using SIMDRAW 8 24 6 Popup Menus A right mouse click on an object in the canvas of a WindowOb j can bring up a pop up context menu containing commands that apply to the object Examples for commands ap pearing on this menu would be Print Cut Copy Paste Delete Rename and Properties A popup menu is implemented through a PopupMenuObj object found in the Menu mod ule and contains MenuItemObj objects A popup menu can be displayed allowing user interaction with the AcceptInput method This menu will be displayed until the user either selects a menu option or clicks in the background A popup menu in a window is shown in figure 8 17 133 SIMGRAPHICS II User s Manual Convoy Convoy CH Cut Copy Paste h Properties Figure 8 17 Pop Up Menu Example 134 Chapter 8 Controls Here is an example of how to use a popup menu override ImageObj BeSelected method ASK METHOD BeSelected VAR popupMenu
108. contents of a window are viewed is the ZoomIn method When given a box in real world window coordinates this method will zoom the contents of that box to become the entire window The aspect ratio of the scene will be distorted if this box is not square The ZoomIn method will automatically redraw the contents of the window Suppose you wanted to set the world coordinate system of a window to 100 100 100 100 and zoom in to the 0 0 10 10 square ASK window TO AddGraphic truck ASK window TO ShowWorld 100 0 100 0 100 0 100 0 ASK window TO ZoomIn 0 0 0 0 10 0 10 0 51 SIMGRAPHICS User s Manual 4 5 Creating Non square Windows On occasion you may want to display images on a rectangular non square window In or der to be able to do this and write to the entire contents of the window not just its largest centered square you must use the SetMappingMode method of WindowObj This method allows you to specify a major axis of the window that will contain the full width or height of the window s world coordinate space e g 0 32767 while the other axis shows only a portion The individual modes are described as follows CenteredSquareMap default The window s contents are viewed in the largest centered square of the win dow canvas Graphics cannot be seen outside of this square XMajorMap Regardless of window size the entire X axis extent of the window s coordinate sys tem can be viewed in exactly the sp
109. cted WHEN cancel OUTPUT Cancel was selected OTHERWISE END CASE DISPOSE window END MODULE Chapter 8 Controls 8 22 4 System File Browser Dialogs The System File Browser dialog boxes take on the look and feel of the underlying graphical environment It provides an easy method for saving and loading files allowing the user to browse the file system Below are the detailed descriptions of this object The AcceptSysInput method accepts input ona File Dialog box Control will not be returned until you select the OK or CANCEL buttons on the form TRUE is returned on selection of the OK button FALSE means that the CANCEL button was pressed The following methods are useful to initialize the File dialog ASK METHOD SetFilterList IN filterList NameListType Set a list of filter strings Supplies an optional list of filters and associated descrip tive text The effect is system dependant For example NEW list 1 3 list 1 Windows bitmap bmp list 2 Windows metafile wmf list 3 AutoCAD dxf dxf ASK fileDialog TO SetFilterList list ASK METHOD SetFilter IN filterOrDefaultFile STRING Sets the string that will be used as an initial file name filter for browsing through the file system The can generally be used as a wild card but some systems may also support regular expressions A default file name can be given instead of the fil ter Remember to use the AcceptSysI
110. cting Image Selection Often it is useful to be able to have a user make a selection between a number of images This is done using the Accept Input method and LastPicked field Every graphical object has a LastPicked field If LastPicked lt gt NILOBJ it holds the highest descendant whichis Selectable which has a non 0 Id or non null ReferenceName and which was last clicked upon or had a descendant last clicked upon The AcceptInput method waits until such a descendant is clicked upon and then returns LastPicked As an example assume PanelImage contains two objects with ReferenceNames Truck and Car assume further that Car contains two 68 Chapter 5 Images images Body and Wheel Then the following code waits for a mouse click on a descendant of PanelImage and determines exactly what was clicked upon selectedItem ASK PanelImage TO Accept Input CASE ASK selectedItem ReferenceName WHEN Truck WHEN Car selectedItem2 ASK selectedItem LastPicked CASE ASK selectedItem2 ReferenceName WHEN Body WHEN Wheel ENDCASE OTHERWISE END CASE If you need to detect image selection while a simulation is running you must override its BeSelected method and insert the code you want to execute when the image is selected Within BeSelected you can use the methods CLickButton andClickIsSecond to find out the button used to select and whether or not this is a double click OBJECT Truck ASK METHOD BeSelected B
111. d WriteToFile methods described in Chapter 3 Then load the image into the SIMDRAW Image Editor and use the File Export menu option The fol lowing options are available for conversion Use built in PostScript fonts instead of SIMGRAPHICS II fonts 2 Specify the number of copies to print 3 Show or not show the background 4 Setbackground color to RGB values between 0 0 and 100 0 5 Draw a window border and generate a title 6 Specify width and height of window in inches 7 Position image window on paper in inches from the lower left of the page 8 Convert bitmaps using color or greyscale pixel values A specific image or the entire contents of a window can be converted into PostScript using program code through the EPSOb3 object found the module GEPS Use the SetFile method to set the name of the EPS file you wish to write to Use other set methods to set up conversion options Pass either aWindowObj or ImageOb j object to the Convert method to create the EPS postscript file The following code could be used to perform con version VAR eps EPSObj window WindowObj NEW eps ASK eps TO SetFile tempfile eps ASK eps TO Convert window 73 SIMGRAPHICS II User s Manual The EPSObj object provides the following ASK methods 74 ASK METHOD SetFile IN pathName STRING Sets the name of the file which will be opened If no file name is set Output Line will do nothing ASK METHOD Convert I
112. d by a SnapShotoOb j consult the platform specific re lease notes for the supported formats Any scanning or painting package that can generate an appropriate format may be used to create a bitmap file Another possibility is to draw an object using SIMDRAW SIMDRAW can create an appropriate bitmap file from any picture you can draw by selecting File Export menu option A final possibility is to write a MODSIM program that creates an ImageObj then the WriteSnapShot method can be used to generate an appropriate bitmap file The following is an example of reading in a scalable bitmap called coast and displaying it The bitmap is scaled to 1 2 the size of the window 70 Chapter 5 Images FROM GTypes IMPORT PointArrayType FROM GSnap IMPORT SnapShotObj PROCEDURE ReadBitmap IN window WindowObj VAR bitmap SnapShotObj points PointArrayType BEGIN NEW bitmap ASK window TO AddGraphic bitmap ASK bitmap TO SetFile coast NEW points 0 1 points 0 x 0 0 points 0 y 0 0 points 1 x 16384 0 1 2 the window size in ndc s points 1 y 16384 0 ASK bitmap TO SetPoints points DISPOSE points ASK bitmap TO Draw END PROCEDURE 5 8 1 Zooming into Bitmaps You must be careful when scaling bitmaps since they can easily consume large amounts of memory This problem becomes apparent if you zoom into a section of a bitmap The scaling operation could produce an enormous bitmap which would
113. dow 2 13 16 Changing the Layout Size and Color To change the editor window s background color select the desired color from the Color palette and then use the Layout Layout Color menu option If you want to increase the size of the editing area beyond what is defined by the boundaries of the world coordinate system use the Layout Layout Size menu option A dialog will be displayed allowing you to increase the number of screens thereby adding space to the right and bottom sides of the editing area This new space can be scrolled to using the right and bottom scroll bars attached to the editor window 2 13 17 Program Access Any image or primitive added to the root image can be accessed from inside an application by specifying a Reference or Field name and or Id through the Properties dialog box The Reference Name and Id are used as parameters to the GraphicVObj Child and GraphicVobj Descendant methods in your program to obtain a pointer to the shape 2 14 Using the Graph Editor The Graph Editor can be used to create and edit a variety of graphical objects whose purpose is to depict a single value or set of numerical values 2 D plots pie charts clocks level meters dials and digital displays are some of the graph objects that can be created Graphs are not built by the user as in the Image Editor Instead you start off with a template which can be modified as necessary 2 14 1 Style and Color Palettes The Style palette on the
114. e A WindowOb j can be made visible and invisible using the Draw and Erase ask methods You can also change its size and position on the screen e Color You can change the background color of a WindowOb Jj e Contents A Window0b3 can contain images dialog boxes a menu bar and pal ettes e Mouse Monitoring A WindowObj can receive mouse clicks and monitor mouse movement within its largest centered square e Cursor 4A Window0b3 can have a cursor that tracks the mouse Scroll Bars A Window can have vertical and horizontal scroll bars The size and position of the thumb on the scroll bar can be set programmatically e Status Bar A multi paned status bar can be contained by a window Text in the status bar can be programmatically changed 4 1 Size and Positioning The default size and position of a W ndowOb j is the largest possible centered window The Set Translation method is used to position a WindowOb j at a specific location on the screen The Translation specifies the position of its lower left hand corner in screen coordinates The screen coordinate system has 0 0 0 0 at the lower left hand cor ner of the screen and 100 0 100 0 at the upper right corner The WindowOb j ASK METHOD SetSize sets the size of the window Size is specified in width and height and is given with respect to the same coordinate system as described above For example to set the size of a window to 50 of the screen h
115. e y 1 toppts 1 x 1 0 toppts 1 y 1 0 toppts 1 z 1 0 toppts 2 x 1 0 toppts 2 y 1 0 toppts 2 z 1 0 toppts 3 x 1 0 toppts 3 y 1 0 toppts 3 z 1 0 toppts 4 x 1 0 toppts 4 y 1 0 toppts 4 z 1 0 NEW botmpts 1 4 plane y 1 botmpts 1 x 1 0 botmpts 1 y 1 0 botmpts 1 z 1 0 botmpts 2 x 1 0 botmpts 2 y 1 0 botmpts 2 z 1 0 botmpts 3 x 1 0 botmpts 3 y 1 0 botmpts 3 z 1 0 botmpts 4 x 1 0 botmpts 4 y 1 0 botmpts 4 z 1 0 NEW leftpts 1 4 plane x 1 leftpts 1 x 1 0 leftpts 1 y 1 0 leftpts 1 z 1 0 leftpts 2 x 1 0 leftpts 2 y 1 0 leftpts 2 z 1 0 leftpts 3 x 1 0 leftpts 3 y 1 0 leftpts 3 z 1 0 leftpts 4 x 1 0 leftpts 4 y 1 0 leftpts 4 z 1 0 NEW rightpts 1 4 plane x 1 rightpts 1 x 1 0 rightpts 1 y 1 0 rightpts 1 z 1 0 rightpts 2 x 1 0 rightpts 2 y 1 0 rightpts 2 z 1 0 rightpts 3 x 1 0 rightpts 3 y 1 0 rightpts 3 z 1 0 rightpts 4 x 1 0 rightpts 4 y 1 0 rightpts 4 z 1 0 create a Polygon3dObj for each side of the cube using these points NEW front ASK front TO SetPoints frontpts ASK front TO SetColor Green ASK cube TO AddChild front front 0 NEW back ASK back TO SetColor Green ASK back TO SetPoints backpts ASK cube TO AddChild back b
116. e Edit Properties menu option you can set the following attributes of a button Label This is the text shown on the face of the button Default Setting this item will make this button the default button This button will be pressed when you press the Enter key Verifying This will cause the button to check the contents of all value boxes in the same dialog when it is pressed Terminating Setting this check box will make the button erase its dialog box when pressed 28 Chapter 2 SIMDRAW Text Boxes Text Text boxes are used to receive single line text string input Using the Edit Properties menu option you can set the following attributes of a text box Label The text appearing on the left hand side of the box Width The number of characters that the text box can show Text The text string initially shown in the box Selectable Using Return Defines whether the application program will be notified when you press the Return key while this text box has input focus Value Boxes 92 A value box is used to receive or show a single numerical value to the user Using the Edit Properties menu option you can set the following attributes of a value box Label The text on the left hand side of the box identifying value type to the user Min The minimum value the box can contain If a value typed into the box is out of range the user will be informed whenever a verifying button is pre
117. e point on the screen and an alignment relative to that point respectively Note that the units used in 123 SIMGRAPHICS II User s Manual SetTranslation are screen units 0 lt x lt 100 0 lt y lt 100 as used when po sitioning WindowObjs The Translation field is automatically updated whenever you move the dialog box 8 22 1 User controlled Dialog Box Fonts Microsoft WindowsWindows 3 1 users can specify the font used for dialog box labels and controls using a command line argument of the form font font family lt size gt bold where font family isa string quoted with double quotes if it contains embedded spaces size is an optional integer point size and bold is optional It is currently not possible to specify bold without specifying the point size also The following are all valid examples font MS Sans Serif font MS Sans Serif 14 font MS Sans Serif 12 bold 8 22 2 Tabbed Dialogs An application can define multiple logical pages or sections of information within a single dialog by using fonts This will help reduce the clutter in a dialog and also cut down on the multiple levels of dialog nesting otherwise needed Pages of controls in a Tabbed Dialog can be brought to the front by selecting its tab at the top of the page c General Resources ch Expressions Textbox 3 Figure 8 14 Tabbed Dialog Tabbed Dialog Tabbed Dialogs can be created in SIMDR
118. ecognize a virtual object is that they normally end in VOb j Virtual objects pass on their attributes to more specific objects which you can use more easily All MODSIM III graphical objects that can have a physical appearance are derived from the GraphicVObj object This object provides the capabilities of drawing positioning and selection Another property of graphical objects is the ability to contain sets of other objects In other words all graphical objects can have other objects added to or removed from them With an understanding of this basic object in mind we can examine the capabilities of more useful objects that are derived from GraphicVOb j A Windowo0b 3 represents a window in the computer screen Since it is derived from GraphicVOb j it can be drawn posi tioned selected or have objects added to or removed from it An ImageObj is an object appearing on the canvas of a window It has the ability to be scaled rotated and to have color Since it is derived from GraphicVOb3 it can be drawn positioned and selected as well Graphical objects which use the vendor based tool kits to receive input are derived from ControlVObj Controls which act as containers are derived from a FormVObj The two types of forms are Dialog boxes Menu bars and Palettes 3 1 Properties of Graphical Objects SC2VObJ ee GraphicLibOb ControlVObj Graphic3dVObj Image0b WindowOb Figure 3 1 Inheritance Tree for Graphical Objects 45
119. ee E te eed n ee nt tee E t v e Be EE IS le Re EE Tree View COntt OL us ei dv xe Ea dead e ieu sa di ud Le qu leto Pe ada aae eI M vance Combo BOX aia doceo eee Prev dL ae vede ce deer a RD Eu a ER A o date Multi line Text Box Table Table with Headers a a id decides Tabbed Dialog getto AA eee Alert Dialog Box Menu Bar ges Pop Up Menu Example Palette Example New Triangle Formed by Point 4i in 1 the Triangular Mesh Array The Camera Can See the Palm Trees but not the Lunar Module or r the Tank anh fee Solar System SIMGRAPHICS II User s Manual vi Preface This Document This manual is intended to both teach and serve as a user s manual for SIMGRAPHICS II SIMGRAPHICS II is a graphical tool kit built on MODSIM III Using SIMGRAPHICS II you can easily incorporate animation presentation graphics and graphical user interfaces into your MODSIM III programs Some familiarity with MODSIM III is assumed Free Trial amp Training SIMGRAPHICS II is available exclusively from CACI Products Company MODSIM III can be sent to your organization for a free trial We provide everything needed for a com plete evaluation on your computer software documentation sample models and immedi ate support when you need it Training courses in MODSIM III are scheduled on a recurring basis in the following loca tions La Jolla California Washington D C London United Kingdom For information on
120. ee ER Taia 152 system fonts EE 157 SyStemitext cr RFT EERERATR 13 system text font esser 13 157 T Tab Field sisi tete 34 Tabbed Dialog 34 124 table uon ege tee 32 119 Table OD cnn ias hits 59 106 121 Jet ee ett TORRE pedian EE 121 text alignment issii e i 156 SIZING sees a ata ese 157 184 lex DOX cease ee Deo NE 29 111 DA ete e ertet prie 26 text primitive Seinien eeu i eeen EEEE 13 Ii A EEEAEEEAEEE SEENEN 106 118 TextDisplayObj eee 83 91 94 TIME Scaling is eate 79 time trace plot seen 23 Timescale scalenia usce net 79 Time Seale is da 164 Toggle VOD ecos eerte 106 trace Plots inc ses Ai di 92 transferring a menu or menu item 38 Transform ote 171 translations vcio tre ERREUR 157 tree BCEE ide rette da 63 TreeOb 5 eee sente metet 59 TraneularMesbtbt 145 146 U Upd te 4 eost erp ees 47 V MEI EE 108 E 29 112 ValueBoxOb eedem e 106 variable monitor ng 91 MECO ION s Recetas BA AAR ARR e 13 vertices defining a primitive oo eee 15 virtual object Sariren eee ere 45 A Rate Totes 52 W WATT zi egeo moie REUS 79 Wall clock time teretes 163 Madthi ziii nnne hp ee 155 SA nter 1 59 Window objecti seeiis iinne as ain 144 window Control 59 WindowObj eee 2 45 49 58 windows non square occoccoccconcnononnnonnnononancnncnnonn 52 WorldXhi 2 tace 51 67 WorldXlo tte 51 67 WorldYhi
121. efine the number of columns or rows that the palette contains For palettes at tached to the left and right sides of the window or for floating palettes the number of col umns is specified The number of rows is used for palettes glued to the top or bottom window edges Palette buttons and separators are created and added to the palette via the Mode palette on the left hand side of the edit window To create a palette button first select the Button icon from the Mode palette Position the pointer over where in the palette you want the buttons to go and click the mouse The palette will automatically resize as needed to fit the buttons it contains It is OK to drop a button outside of the palette in order to make it larger The actual palette you are working on can be displayed and tested using the Layout Show Palette menu option Double click on the in the header bar of the palette test window to make it go away 41 SIMGRAPHICS II User s Manual Simdraw D helpipalette scZ mainp2ictte iv File Edi Vie Layo Window Help e Figure 2 5 Palette Editor 2 17 1 Selecting and Moving Rearrangement of Buttons A palette button or separator item can be selected by clicking the mouse button over the top of it Selected buttons are marked by a bordering green or cyan box Multiple items can be selected by holding down the Shift key and clicking on several items To move a palette button from one pl
122. egarding graphical objects These procedures are found in the module GProcs and are listed below PROCEDURE HandleEvents IN waitForEvent BOOLEAN This procedure calls the low level event handler for a system It is used to detect mouse clicks mouse movement image selection and form input It is called auto matically if you perform an AcceptInput method or are running a simulation It must be called at least four times a second to receive mouse input from the user if waitForEvent is FALSE PROCEDURE GetRGBColor IN color ColorType OUT r g b PctType Given a predefined color its red green and blue triple is computed and returned PROCEDURE ScreenRatio REAL Returns the ratio of screen width to screen height on a given system PROCEDURE Transform IN sourceImage destImage ImageObj IN sourceX sourceY REAL OUT destX destY REAL This procedure transforms a point given under sourceImage s world coordinate system to one given in dest Image s coordinate system If NILOBJ is given as the source or destination image the DefaultWorld is used as the coordinate sys tem for this image Both images must be attached to the same tree at the time this procedure is called Referring to the solar system example of Appendix F suppose we had a point in Earth coordinate system units that we wanted to transform into Mars coordinates Transform earth mars earthPt x earthPt y marsPt x marsPt y Or to transform a default
123. eight and width and display the window in the center of the screen the following code could be used VAR window WindowObj NEW window ASK window TO SetSize 50 0 50 0 ASK window TO SetTranslation 25 0 25 0 ASK window TO Draw 49 SIMGRAPHICS User s Manual 4 2 Background Color The background color of a window can also be set This color can be set to one of the pre defined colors or be described in terms of its RGB components The SetColor and SetRGBColor methods accomplish this For example to set the background color of a window to Blue ASK window TO SetColor Blue ASK window TO Draw 4 3 Adding Graphical Objects to a Window Since a WindowObj inherits grouping capabilities from GraphicVOb3 it contains a list of graphical objects There are a number of graphical objects that can be added to a win dow s list These include images menu bars and dialog boxes Any number of images and dialog boxes can be added to a window but it can contain only one menu bar A window can have up to four docked palettes For example if you had a menu bar dialog box and an image and wanted them to appear within a window VAR window WindowObj dialogBox DialogBoxObj menuBar MenuBarObj rootlImage ImageObj ASK window TO AddGraphic dialogBox ASK window TO AddGraphic menuBar ASK window TO AddGraphic root Image ASK window TO Draw Note Whenever a window is disposed of drawn or erased all of
124. en 46 RemoveDoataSet essen 103 RemoveThisGraphic ss TT 113 f presentation ur rt e PEERS retos 22 EE TAN 59 ReturnSelectable sse 118 RGB estote eite ee les 61 RGBCol 255 5 at OI OR er rei 171 Rotate TO talas 78 Rotating Obj eire 78 IOfatlOD MATE ERA E EE EENET 16 61 63 DEE 11 rubberband cursors cccccnnoconnccnononnnnnonononnnnannnnnnns 151 Running SIMDRAW seseeseeeee 3 S scalable esses 70 78 79 83 160 SC e ES 79 Scaling cocodrilo nerd oe ORE 61 SCalin GOD risa 78 Sereen RAO see EE R 171 scroll Daria 49 55 59 SDataPIMOD rn eerte 91 SOC LOUS e ee e D EDU QN 12 155 KE E UE 68 selecting moving and resizing 10 DC ek tte ae kets Seared kee 47 SetAutoGeometry cococcoccconccnnonnccnnonnconoconocnncnnonnnono 59 SetAxis Titles usce eH S 103 SetBackground sese 74 SetClickMonitoring eee 53 NO iai ee See e S Qs 50 SetColumnAlignment esee 121 SetColumnWidth ooooooccnnnionccnonononancnononnnnnnnos 121 SetCoordinate essen 96 104 SetCODI6S Dre Rp HEURE ERR e 74 SEENEN ORDER ARS 78 SEIQUESOE an tie eret ed eeu 151 Seas 93 SetfSloterval a r eae raS 103 SetDS Ti fleien Eeer 103 SetEditable iia e Ra Edit 117 SetElement esses esee eene 93 Ot lessees pies EPUM 74 SetFramelconNames eese 58 SetErameS1ze o ord ies 58 SetFrameTitle
125. er yintercept is the point where the X axis crosses over Note The above methods should only be called AFTER a chart has been loaded in from a graphic library e g the LoadFromLibrary method Refer to paragraph 7 7 for more information concerning programmatic setting of graph attributes 7 3 2 PiechartObj A PiechartOb j is a graph containing a piechart a title and legends for the pie slices Each slice in the pie shows a value as a percentage of the sum of all the values Pie Chart P SES p e BW slice 1 33 Slice 2 33 SE Slice 3 33 Figure 7 3 Pie Chart 87 SIMGRAPHICS II User s Manual The slices in a pie chart are numbered starting with 1 The numbering of slices begins at the 3 00 position with respect to the pie and continues in a counter clockwise direction The DisplaySlice method is used to set the value of a pie slice given its number The percentage value of the slice is automatically computed and displayed in the legend for the pie slice For example to change the value of slice number 2 to 57 0 ASK piechart TO DisplaySlice 2 57 0 7 3 3 ClockVObj A ClockVObj is a generic object describing a clock Clocks are either analog or digital Time is specified in hours minutes and seconds The time value seen within a clock is bounded by the attributes MaxHours MinutesPerHour and SecondsPerMinute set within SIMDRAW You can however set the clock to a time value that goes past one or m
126. er to the entire block of text not a single line The SetAlignment method specifies how the text is to be aligned upon its position Text can be aligned horizontally and vertically Vertical text alignment is done based on a 156 Appendix D Creating Images at Runtime character cell which extends both above and below the actual character Horizontal align ment is done with respect to the length of the entire string The alignments available are TextHorizType HorizLeft HorizCentered HorizRight TextVertType VertBottom VertMiddle VertTop VertCellBottom VertCellTop Text sizing can be specified in one of two ways You can use the SetSize method to specify a box to fit the text string into This box s width and height are given in real world coordinate space Text with sizing specified in this manner will be scaled in size whenever the object is scaled The SetPctHeight method is another way of giving text size This method specifies text height as a percentage of window height Text with this type of sizing is not ever scaled therefore it will always appear the same size Text can be rotated using the Set Bot at ion method D 2 System Text Previously only vector based fonts could be displayed in a graphics window System text provides access to all system fonts available on the underlying graphics system An option al translation file provides the capability to remap fonts when the application is moved to a differen
127. erefore the position of any image in the image tree is always specified as the coordinates of its center point in PARENT coordinate system units The center of any image is always point 0 0 0 0 Coordinate systems are specified for an image using the SetWorld method If no world is set for an image it will use its parent s world coordinate system If none of the ancestors of an image contain a coordinate system a default system is used In this system WorldXlo WorldYlo is the lower left hand corner of the world and WorldXhi WorldYhi is the upper right hand corner These constants are found in the library module GTypes For example suppose we wanted the positions of the planets within the solar system to be specified in terms of light minutes We also want the solar system to include Mars as the furthest planet out with the Sun as the solar system s center The world boundaries would then be the distance of Mars from the Sun This is illustrated by the following block of code ASK solarSystem TO SetWorld 12 662 12 662 12 662 12 662 ASK sun TO SetTranslation 0 0 0 0 sun is center of solar system ASK mercury TO SetTranslation 3 217 0 0 merc dist from sun ASK venus TO SetTranslation 6 011 0 0 venus dist from sun ASK earth TO SetTranslation 8 310 0 0 earth dist from sun ASK mars TO SetTranslation 12 662 0 0 mars dist from sun assume no world is set for solar system parent use
128. etailed information on variable monitors 7 4 1 Single Variable Monitoring Meters A data point is used to monitor a single changing variable There are three monitor objects provided by the SIMGRAPHICS II runtime library for data points IDataPtMOb3 mon itors an INTEGER RDataPtMObj monitors a REAL and SDataPtMOb3 monitors a STRING variable A variable must be defined as being left monitored by one of these ob jects before its value can be shown on a graph The SetGraph method of these objects makes the association between a SIMGRAPHICS II graph and the monitor object The fol lowing code loads in a dial from a graphic library and uses it to show the monitored vari able fuelRemaining 91 SIMGRAPHICS II User s Manual VAR fuelRemaining LMONITORED REAL BY RDataPtMObj dial DialObj NEW dial ASK dial TO LoadFromLibrary graphicLib dial ASK window TO AddGraphic dial ASK GETMONITOR fuelRemaining RDataPtMObj TO SetGraph dial fuelRemaining 12 0 Histograms A data point can also be monitored using a histogram In this case a ChartObj object must be used for the graph This chart should be set up from the editor with the represen tation Histogram Bar Chart or Surface Chart In addition the SetHistMode method of the monitor object should be invoked with the parameter TRUE The following code mon itors the variable queueLength with a histogram VAR queueLength LMONITORED INTEGER BY IDataPtMObj hist
129. ethod is called This method should be overridden in your program to de fine the pixels of the bitmap The following code defines a bitmap programmatically OBJECT MySnapShotObj ASK METHOD BePainted VAR r g b REAL i j INTEGER BEGIN FOR i 0 TO NumberRows 1 FOR j O TO NumberColumns 1 r Random 100 0 g Random 100 0 b Random 100 0 SetPixelRGBColor j i r g b END FOR END FOR END METHOD END OBJECT NEW mySnapShot ASK mySnapShot TO SetNumPixels 100 100 The frequency of calls to BePainted depends on flags defined by the SetRetainOriginal and SetScalable methods If the RetainOriginal and Scalable flags are TRUE a copy of the bitmap will be kept in memory and be used as a template for when the SnapShotObj objectis re scaled Otherwise the BePainted methodis called to acquire pixel definitions each time the size of the bitmap somehow changes The RetainOriginal 72 Chapter 5 Images flag has the side effect of slowing down methods SetPixelColor and SetPixelRGBColor NOTE For maximum overall performance the flags RetainOriginal Scalable and Maskable should be FALSE 5 9 Converting Images into PostScript Any ImageObj object can be converted to EPS PostScript using either SIMDRAW or program code ImageOb j objects can be converted to PostScript using SIMDRAW To do this first save the object you wish to convert to a SIMGRAPHICS II library file using the SaveToLibrary an
130. export file but will have a m character appended to the filename Exporting to the file test bmp will automatically create testm bmp SIMGRAPHICS II will automatically try to load the mask file whenever the original bitmap is loaded The mask can be deleted if it is not needed 2 13 5 Creating Primitives The Image Editor supports creating and editing seven different primitive types The primi tives are polygons polylines circles arcs sectors text and bitmaps Polylines E Polylines are created by clicking either the freehand or polyline buttons on the Mode pal ette To create a polyline select the polyline button on the mode palette Point to where you want to start the line and drag to draw a line segment Continue pointing and clicking until all but the last line segment has been defined Double click to create the last vertex and return to Select mode To creat a freehand polyline press the freehand line button on the Mode palette Drag the mouse around the canvas area to draw the line Releasing the mouse button will return you to Select mode Use the Style palette to define dash style and line width There are eight dash styles and six line widths to choose from Another attribute of the polyline is rounding Corners defined by intersecting line segments can be given a rounded edge by selecting the polyline and using the Edit Properties menu option The Round Corners By value box contains the length of segment adjacent
131. f NOT in the line s bounding box Multiple shapes are selected by holding down the Shift key and clicking on several shapes Multiple shapes may also be selected by clicking in the background of the window and dragging the mouse over the shapes you want to select A group of shapes or images is selected by clicking on one of the objects in the group Subsequent clicks over the group will select shapes within that group Primitives inside a group can be selected directly by holding down the Ctrl key and clicking on the shape Us ing the Ctrl key subsequent clicks will select the groups containing the currently selected shape Selected shapes are marked by a bordering green or cyan box Sides and corners of this box contain eight small square resize handles Resizing is performed by clicking down and dragging a resize handle Click and drag a shape to move it to the desired position Be careful not to click down on the resize or point handles 2 13 3 Using the Clipboard Cut Copy Paste Commands do E The Image Editor supports the standard cut copy and paste operations found under the Edit menu The Cut option deletes selected shapes and places them in the clipboard The deleted item remains on the clipboard until the next time you use the a Cut or Copy is performed You can use the Paste option to paste as many copies as you want from the clipboard into the image Shapes can be deleted without changing the clipboard by using the Delete opt
132. f or behind other shapes use the Bring to Front or Send to Back options from the Layout menu SIMGRAPHICS II User s Manual Stacking order is with respect only to other shapes in the same group or image In other words the Bring to Front menu option will bring the selected shape to the front of all other shapes in that group but not necessarily to the front of all shapes in the window 2 13 10 Defining the Center Point of a Shape The center point of any image or primitive can be changed by selecting the shape then us ing the Edit Recenter menu option A set of green cross hairs will appear showing the cur rent center point Point to where you want the center point of the object to be and click To leave the Recenter mode press either the OK or Cancel buttons on the dialog box You can reset the center point of the entire drawing root image by using the Edit Image menu option and then clicking on the Select button to reset the center 2 13 11 Using the Flip and Rotate Tools Jos of de Any selected shape can be rotated about its center point by any amount To do this select the shape s and then use the Edit Rotation Clockwise or the Edit Rotation Counter Clock wise menu options If you want to set the angle by which an object is rotated use to Edit Rotation Set Angle menu option To flip an object about its x axis use the Edit Flip Horizontal menu option To flip an object about the y axis use Edit Flip Vertical menu option
133. free trials or training please contact the following In the U S and Pacific Rim In Europe CACI Products Company CACI Products Division 3333 N Torrey Pines Ct Coliseum Business Centre La Jolla CA 92037 Camberley Surrey 619 824 5200 GUI5 3YL Fax 619 457 1184 United Kingdom 444 0 1276 671 671 Fax 44 0 1276 670 677 SIMGRAPHICS II User s Manual Chapter 1 Introduction to SIMGRAPHICS II The MODSIM III Graphics package allows easy access to animation presentation graph ics and user interface toolkits using a graphics editor SIMDRAW to simplify construc tion Animation is produced by drawing objects using SIMDRAW and then animating them within a MODSIM III program Operations such as scaling rotating and positioning can be performed The animated objects or images can have subcomponents which move along with the whole object but can be manipulated individually For example a dump truck can have a bed subcomponent which is rotated independently of the base of the truck Presentation graphics or graphs such as pie charts level meters bar graphs etc are also created using SIMDRAW and are then used within the MODSIM III program by asking the graphs to plot values The visual appearance of the graph is updated automatically Access to the user interface toolkits or forms allows input using menu bars dialog boxes and palettes The appearance of the forms conforms to the style of the system MODSIM III is running on On
134. g Views Panning and Zooming Sr You may want to magnify a portion of the dialog To zoom in to some area of the window first use the View Zoom In menu option Then drag out a rectangle with the mouse over the area of detail When the mouse button is released the area inside the rectangle will be ex panded to encompass the entire window To zoom back out use the View Zoom Out menu option When zoomed in you can pan to other areas of the window using the horizontal and vertical scroll bars You can return to the default view by using the View View 1 1 menu option Unless the window is square the top or bottom portion of the view may not be visible To see the entire coordinate space use the View Fit In Window menu option This viewing mode will leave dead space off to the right of the window but guarantee the entire coordinate space will be seen 2 15 4 4 Changing the Layout Size Color and Font To change the editor window s background color use the Layout Set Color menu option Select the RGB values of the background color 36 Chapter 2 SIMDRAW Use the Layout Set size menu option if you want to increase the size of the editing area to allow you to create or edit very large dialog boxes A dialog will be displayed allowing you to increase the number of screens thereby adding space to the right and bottom sides of the editing area This new space can be scrolled to using the right and bottom scroll bars attached to
135. g the Clipboard Cut Copy Paste Commands d E The Dialog Editor supports the standard Cut Copy and Paste operations found under the Edit menu option The Cut option deletes selected controls and places them in the clipboard The deleted item remains on the clipboard until the next time you use the Edit Cut or Edit Copy option Use the Edit Paste option to paste as many copies as you want from the clip board into the image Controls can be deleted without changing the clipboard by using the Edit Delete option The clipboard is shared among all active Dialog Editor sessions You can copy graphics from one image into another by activating the source edit window using the Copy option and activating the destination editor and using the Paste option Note The dialog box itself can never be cut or deleted It can however be selected for the purpose of changing its properties 2 15 4 Controls To create a control check box button text box etc select the appropriate control from the Mode palette and drag its outline to where you want it to go on the dialog box All con trols have the following attributes XY Position Position in font units from the upper left hand corner of the dialog box Reference Name Id Any control added to the dialog can be accessed from inside an application by specifying a Reference Name and or Id Buttons A button receives simple input and contains no data from the user Using th
136. ght patterns to choose from Sectors ei A sectoris a filled semicircular shape similar to a pie slice Sectors are composed of a center point a starting point and an ending point and are drawn counter clock wise from the start ing point to the ending point To draw a sector first press the Sector button on the Mode palette Point to where you want the center point of the sector to go and drag the mouse Release the mouse over where you want the starting point of the arc to go Drag the mouse to where you want the sector to end and release to return to Select mode Use the Style palette to give the sector a hatch pattern There are eight patterns to choose from Chapter 2 SIMDRAW Arcs y An arc is a curved line contained on the circumference of a circle Arcs are composed by a center point a starting point and an ending point and are drawn counter clock wise from the starting point to the ending point To draw an arc first press the Arc button on the Mode palette Point to where you want the center point of the arc and drag the mouse Release the mouse over where you want the starting point of the arc Drag the mouse to where you want the arc to end and release to return to Select mode Use the Style palette to define dash style and line width There are eight dash styles and six line widths to choose from Text T Single line text primitives can be created and added to your image To create a text primi tive press the
137. gnored If only the foundry and font family names are used separated by a hyphen the size slant and weight fields will be used to construct a standard X11 font specification The following are all possible Family strings for X11 plat forms fixed adobe new century schoolbook adobe times medium i 140 iso8859 1 Any rotation can be specified the text will be rendered at the nearest increment of PI 2 Appendix D Creating Images at Runtime 3 The size of system text is determined by the font selected and so unlike stroked text does not change with resizing of windows or setting the scaling factor of an cestors in the image tree Therefore when the window is resized the bounding box in Normalized Display Coordinates or NDCs will change See the note on bound ing boxes above 4 Toenhance portability a font translation file can be created which provides aliases for the font s Family field This file is read in using the new Text module proce dure LoadSFontFile This is a text file consisting of pairs of strings enclosed in double quotes and separated by white space the first is a string that may be spec ified as the Family field of a TextObj the second is a translation that will be substituted by the graphics library when searching for fonts to use to render the text Note that the aliases are substituted and searched for until a valid font is found and there can more than one translation for a g
138. he BeSelected method of a Text BoxObj ValueBoxObj and ComboBoxObj will be called whenever the Return key is pressed while typing into a field if the ReturnSelectable field is set to true If this behavior is desired call the SetReturnSelectable method passing TRUE orsetthe ReturnSelectable checkbox from within SIMDRAW 8 22 Dialog Box The dialog box is a container for buttons check boxes list boxes radio boxes and labels The size of the dialog box automatically adjusts to just fit its contents The dialog box al ways appears centered in its parent window by default The dialog box is attached to a window by ASK window TO AddGraphic dialogbox After a dialog box is attached to a window and drawn it can receive input from the user This is done using the Accept Input method button ASK dialogbox TO AcceptInput After a terminating button is selected the dialog box is erased and the terminating button is returned To receive dialog box selections while a simulation is running perform the following steps 1 Create your own dialog box object and override its BeSelected method NEW MyDialogBox 2 Ask the dialog box object to load its graphic description from a library ASK MyDialogBox TO LoadFromLibrary lib DialogBox 122 Chapter 8 Controls 3 Attach the dialog box to the window ASK window TO AddGraphic MyDialogBox 4 Display the dialog box and begin accepting input button ASK MyDialogBox TO AcceptI
139. he Image Detail dialog can be used to specify the size and angle of rotation of the image by editing the fields Width Height and Rotate by Another way to resize the root image is to use the Edit Select AII option to select all of its shapes and then use Layout Group to make a group Dragging the square resize handles on the green selection box will resize this group When the root image is appropriately sized use the Layout Ungroup menu option to eliminate the grouping 2 13 8 Editing Points on a Primitive Rn The vertices defining a primitive can be moved added and deleted using Image Editor Clicking on a selected primitive will enable point editing for that primitive A primitive in point edit contains a green skeleton which connects its vertices Representing each vertex point is a hollow green square or point handle The currently selected point is shown by a blue point handle To move a point select and drag the appropriate point handle To delete a point select its point handle and use the Edit Delete menu option or press the Delete key To add a new point to the primitive click on the green skeleton and drag the mouse When the mouse but ton is released a new point is inserted between the indicated vertices To leave Point Edit mode click on the background or another shape 2 13 9 Defining Stacking Order or Priority LI You can specify how shapes are stacked when they overlap stacking order To move shapes in front o
140. hen dragging a menu item from the Mode palette to the position in the pane where you want it to go A usable menu bar can be interacted with using the Layout Show Menu Bar menu option A temporary window will be displayed containing a test menu bar Double click on the in the header bar of the temporary window to make disappear 2 16 1 Selecting and Moving Transferring A menu or menu item can be selected by clicking the mouse button over its label Selected menus are marked by a bordering green or cyan box Selecting the label of a menu will drop down its pane showing all the items it contains Multiple items can be selected by holding down the Shift key and then clicking on several items To add a menu or item to another menu drop it onto the menu s open pane 38 Chapter 2 SIMDRAW You can also select the menu bar and edit its properties but the bar cannot be moved You are not allowed to resize menus or the menu bar they are resized automatically when new items are added to them 2 16 2 Using the Clipboard Cut Copy and Paste Commands 5 Ce The Menu Bar Editor supports the standard cut copy and paste operations found under the Edit menu The Cut option deletes selected items and places them in the clipboard The de leted item remains on the clipboard until the next time you use the Edit Cut or Edit Copy options You can use the Edit Paste option to paste as many copies as you want from the clipboard onto any open men
141. ibutes which are adjustable via the Edit Properties menu option e Reference Name Id Any button added to the palette can be accessed from inside an application by specifying a Reference Name and or Id e Icon Name The name of the bitmap resource or file without extension icon dis played on the front of the palette button Remember that any bitmap file MUST be in the same directory as your library sg2 file e Status Message Text displayed in pane O of the parent windows status bar if present whenever the pointer passes over this button e Tool Tip Identifies the tool tip pop up message shown at the pointer s current lo cation when it passes over this button e Momentary Draggable Toggle Determines the variety of input interaction One of three button types can be selected 1 Momentary Button will automatically pop back up after it is pressed 2 Toggle Two state button The state up or down alternates with each acti vation 3 Draggable Like Toggle but allows you to hold the mouse button down and drag an outline of the palette button bitmap onto the window e Icon Button Color Button If the Icon Button item is activated the face of the palette button will show the bitmap defined by the Icon Name field above For Color Buttons the button will be colored using the R G B parameters defined below Button Face Color Red Green Blue You can set the color of the Color Buttons through the
142. ic print dialog and print mechanism allows individual SIMGRAPHICS IL image trees as well as entire windows to be dumped to any installed printer This is a big advantage under Microsoft Windows where the standard system print dialog allows print ing to a wide variety of printers For systems that do not have native printing facilities a generic print dialog box is provided which generates Encapsulated Postscript files The fol lowing method is defined in module Graphic ASK METHOD PrintGraphic IN usedialog BOOLEAN BOOLEAN This procedure prints the contents of a visible WindowObj or ImageOb j in a system specific manner If usedialog is TRUE a modal system print dialog box will appear if appropriate for the platform to allow printer selection format options etc If FALSE cur rent defaults will be used Return values are TRUE for success and FALSE for failure 4 10 1 Rules for System Printing 1 Only WindowObjs or ImageOb js or user derived subclasses of them can be printed 2 Dialog boxes palettes menu bars and 3d graphics cannot be printed 3 Any ImageObj to be printed should be attached to an image tree rooted at a WindowOb j which has been asked to Draw otherwise certain internal scaling information will not be computed correctly WindowObjs asked to PrintGraphic should be visible 4 11 Frame and Sub windows This feature is implemented for Windows NT and Windows 95 only All windows can be made sub windows of
143. in an earth day MarsDay 24 616 4 earth hours in a mars day MercDist 3 217 mercury light minutes from sun VenusDist 6 011 venus light minutes from sun EarthDist 8 310 earth light minutes from sun MarsDist 12 662 mars light minutes from sun SystSize 15 0 radius in light minutes of this model VAR library GraphicLibObj window WindowObj solarSystem ImageObj sun mercury venus earth mars ImageObj mercuryOrbit venusOrbit earthOrbit marsOrbit ImageObj mercuryRot venusRot earthRot marsRot INTEGER mercuryOrbitRot venusOrbitRot earthOrbitRot marsOrbitRot INTEGER earthHours REAL BEGIN create a window for the solar system and bring it up on the screen NEW window ASK window TO Draw create a library and have it read the saved library Example3 sg2 NEW library ASK library TO ReadFromFile Example3 sg2 166 get planets from the library Assume they have Appendix F Complete Solar System Example been saved using the names SUN MERCURY VENUS EARTH and MARS in SIMDRAW NEW sun NEW mercury NEW venus NEW earth ASK sun TO LoadFromLibrary library SUN ASK mercury TO LoadFromLibrary library MERCURY ASK venus TO LoadFromLibrary library VENUS ASK earth TO LoadFromLibrary library EARTH ASK mars TO LoadFromLibrary library MARS Build the solar system Special Orbi
144. indow is square the top or bottom portion of the view may not be visible To see the entire coordinate space use the View Fit in WindowView 1 1 menu option This viewing mode will leave dead space off to the right of the window but guarantee the entire coordi nate space will be seen 2 13 15 Changing Dimension Coordinate Space Boundaries Coordinate space boundaries or dimension can be assigned to the editor window The de fault coordinate space is the common Normalized device coordinates or xlo 0 ylo 0 xhi 32767 yhi 32767 These dimensions determine an object s coordinate system when it is saved The dimension should be set to match the world coordinate system used within the program This ensures that the positions of shapes defined from the Image Editor will SIMGRAPHICS II User s Manual remain the same when they are displayed within that program Use the Layout Dimension menu option to change the dimension in the Image Editor The Allow Icons to Scale check box specifies the rule defining how the image is scaled when used in the application program If this item is checked the image will automatically be scaled according to the world coordinate system defined by the application program If this item is not set the shape will stay the same size no matter what world it is attached to The current x y location with respect to the above units will be displayed in the status bar at the lower right hand corner of the editor win
145. ine Text The quick brown RES jumped over the lazy dog s back Figure 8 11 Multi line Text Box FROM GTypesIMPORT TextBufferType VAR buffer TextBufferType multiLineBox MultiLineBoxObj NEW buffer 1 3 buffer 1 The quick brown foxes buffer 2 jumped over buffer 3 lazy dog s back ASK multiLineBox TO SetTextBuffer buffer ASK multiLineBox TO Draw You can get the current contents of the box with the TextBuffer method Do not DISPOSE of the array returned by this method Use the CLONE operation if the contents are to be saved after the multi line box has been destroyed For example buffer CLONE ASK multiLineBox TextBuffer FOR I LOW buffer TO HIGH buffer OUTPUT i buffer i END FOR 118 Chapter 8 Controls ASK METHOD SetSize IN numColumns numRows INTEGER Sets the width and height in character units of the text box This includes the size of the scroll bars ASK METHOD SetTextBuffer IN lines TextBufferType Sets the entire contents of the Multi line box Each element in the given array cor responds to a line of text ASK METHOD TextBuffer TextBufferType Returns the text buffer containing all current text CAUTION The buffer will be DISPOSEd of when this object is disposed Use CLONE if this data is to be saved ASK METHOD SetHorizontalScrolling IN HorzScrolling BOOLEAN Selects between horizontal scrolling or automatic line wrap
146. ing the Edit Properties menu option SIMGRAPHICS II User s Manual Bitmaps Bitmaps or snap shots are not created directly by the Image Editor but can be created using another drawing tool and imported On MS Windows systems Windows bitmap files with the bmp extension can be imported and added to your image On X Windows systems X Windows dump file formats ending in xwd can be imported To add a raster file to your image use the File Import menu option Select a bmp or xwd file from the dialog box and press the OK button to import the bitmap Once in the Image Editor bitmaps can be resizeable or non resizeable To change the scal ability select the bitmap and use the Edit Properties menu option Remember that resize able bitmaps may take longer to render the first time and can loose meaningful pictorial information if made smaller Alignment can be applied to bitmaps as well as text primitives For example if you wanted a non scalable bitmap to remain centered as an image is scaled its alignment should be cen tered horizontally and vertically from the Properties dialog 2 13 6 Creating Images y An image represents a grouping of primitives and or other images Images can contain oth er images forming a hierarchy To create an image select the shapes to be grouped using the Shift key and then select the Layout Group menu option The resulting group will be shown bounded by the green selection b
147. ion The clipboard is shared among all active Image Editor sessions You can copy graphics from one image into another by activating the source edit window using the Copy option and activating the destination editor and using the Paste option 2 13 4 Importing Exporting to Other Graphics File Formats Using SIMDRAW you can import graphics created by other graphics editors This is ac complished by invoking the Image Editor and using the File Import menu option Graphics files in any of the following formats can be loaded into the editor e MS Windows Bitmaps bmp MS Windows only Note that the bitmap file must reside in the same folder as your 392 file e X Window Dump xwd Motif only The raster file must reside in the same di rectory as your sg2 file Chapter 2 SIMDRAW e AutoCAD files dx Simple 2d AutoCAD files can be imported The vector description will be maintained e Windows Metafile wmf MS Windows only The vector description will be maintained You can also convert an existing SIMGRAPHICS II drawing into one of the following for mats through the File Export option MS Windows Bitmaps bmp MS Windows only e X Window Dump xwd Motif only e EPS Color PostScript eps ps When exporting to bmp or xwd files a mask bitmap will automatically be created The mask file is needed to maintain transparency when rendering non rectangular bitmaps The mask file will be named after the
148. ion call will cause the object to be periodically 77 SIMGRAPHICS II User s Manual updated by the simulation timing routine The StopMotion method will stop the object from being updated The DynamicUpdate method is called by the timing mechanism to update the state of the object It takes as arguments the current simulation time and the elapsed simulation time since the last call You can override this method to perform some appropriate action 6 2 DynlmageObj A DynImageOb j object combines the functionality of an Image0b3 with that of a DynamicObj It may be moved scaled and rotated with respect to simulation time It inherits the properties of three other objects MovingObj RotatingObj and ScalingObj The functions of these objects and hence a DynImageObj are as follows MovingObj ASK METHOD SetCourse IN course REAL Sets direction which the object will travel The course is specified in radians mea sured counter clockwise from the positive x axis of the world coordinate system ASK METHOD SetSpeed IN speed REAL Sets the speed of the object in world coordinate units per time unit TELL METHOD MoveTo IN XDestination YDestination REAL Moves the object to a specific point The method finishes when the object arrives at the destination The object s speed should be set before invoking MoveTo TELL METHOD FollowPath IN path PointArrayType Moves the object along a path defined by the array of points This
149. is 0 0 and the upper right corner is 100 100 This procedure must be called before the first sub window is drawn PROCEDURE SetFrameSize IN width height PctType If the application contains a frame and sub windows this procedure will specify the initial size in screen coordinates 0 100 0 100 of the frame window This procedure must be called before the first sub window is drawn PROCEDURE GetFrameTranslation OUT tx ty PctType Ifthe application contains a frame and sub windows this procedure will retrieve the current position of the lower left hand corner of the frame window Position is spec ified in screen coordinates 0 100 0 100 PROCEDURE GetFrameSize OUT width height PctType Gets the current size of the frame window If a sub windowed style application is being used this procedure will retrieve the current size in screen coordinates 0 100 0 100 of the frame window Appendix H Audio Support for SIMGRAPHICS II SIMGRAPHICS II can be used to play sounds while your simulation is running A sound can be played in response to a specific event occurring in the simulation A sound is played in a separate process thread thus allowing its audio playback and the simulation to proceed concurrently Currently only one sound can be played at a time Playback of a new sound will preempt an existing one Sound information is contained in a data file such as a WAV file on Microsoft Windows NT 95 A sound
150. is to construct them at runtime by cre ating instances and setting their display specific attributes such as points color and style This can be time consuming because there are very many attributes that define what an im age will look like Also the programmer cannot see what the images will look like on the screen until the program is compiled and run For this reason the MODSIM III graphics package comes with SIMDRAW an interactive user friendly graphics editor Refer to chapter 2 SIMDRAW can be used to construct simple primitives or entire image trees Within SIMDRAW you name the images and primitives you have constructed and would like to use in your program SIMDRAW then creates a library of these objects and saves it to a file As described in Chapter 3 a GraphicLibObj is used to obtain instances of the objects created in SIMDRAW 64 Chapter 5 Images Assume file SolarSys sg2 was created by SIMDRAW and contains the objects named MERCURY VENUS EARTH etc VAR library GraphicLibObj mercury venus earth mars ImageObj NEW library NEW mercury NEW venus NEW earth NEW mars ASK library TO ReadFromFile SolarSys sg2 ASK mercury TO LoadFromLibrary library MERCURY ASK venus TO LoadFromLibrary library VENUS ASK earth TO LoadFromLibrary library EARTH ASK mars TO LoadFromLibrary library MARS The grouping facility of SIMDRAW is used to create images When
151. itch to a dif ferent tab page Tab pages are not switched until validation is successful The contents of the value box can be read as follows value ASK valuebox Value Value returns a REAL number The content of a value box can be set using the Set Draw methods ASK valuebox TO SetValue 1 222 ASK valuebox TO Draw or by using the shortcut ASK valuebox TO DisplayValue 1 222 8 13 Progress Bar A progress bar is a programmatically adjustable horizontal bar usually used to indicate the completion status of a task The length of the bar is proportional to the value given to it by your program A user cannot adjust the bar Progress bars have Minimum and Maximum fields derived from ValueBoxObj which bound the numerical value assigned to it The SetValue method can be used to set the length of the bar as follows ASK progressBar TO SetValue 10 3 ASK progressBar TO Draw or by the shortcut ASK progressBar TO DisplayValue 10 3 112 Chapter 8 Controls 8 14 List Box and List Box Item Figure 8 7 List Box The list box allows list box items to be selected Any number of list box items may be at tached to the list box control There are two types of list boxes a List BoxMu1tObj al lows any number of ListBoxItemOb js to be selected a ListBoxObj allows exactly one ListBoxItemObj to be selected List box items are added and removed from the list box using the standard GraphicSetObj AddGraphic and RemoveGra
152. ition of the lower left hand corner of the frame window Position is spec ified in screen coordinates where the lower left hand corner of the computer screen is 0 0 and the upper right corner is 100 100 This procedure must be called before the first sub window is drawn PROCEDURE SetFrameSize IN width height PctType If the application contains a frame and sub windows this procedure will specify the initial size in screen coordinates 0 100 0 100 of the frame window This procedure must be called before the first sub window is drawn PROCEDURE GetFrameTranslation OUT tx ty PctType Ifthe application contains a frame and sub windows this procedure will retrieve the current position of the lower left hand corner of the frame window Position is spec ified in screen coordinates 0 100 0 100 PROCEDURE GetFrameSize OUT width height PctType Gets the current size of the frame window If a sub windowed style application is being used this procedure will retrieve the current size in screen coordinates 0 100 0 100 of the frame window Methods of WindowOb j and Cont ro1WindowOb 3 relating to sub windows 58 ASK METHOD SetSubWindow IN isSubWindow BOOLEAN Enables the application frame sub window interaction Instructs the window to be a sub window inside a frame window The frame window does not correspond to any particular WindowObj object but is manipulated through procedures in the module GProcs
153. its contents are also dis posed of drawn or erased 50 Chapter 4 Windows 4 4 Coordinate Systems for Windows A coordinate system can be set up for a window which its image children will obey Coordinate systems physically apply to the largest centered square in the window or to the largest square defined by the width of the window if XMajorMap is used or the largest square defined by the height if YMa jorMap is used Graphics cannot be drawn beyond the extent of the largest centered square unless the mapping mode for the window is set to XMajorMap or YMajorMap An image that has no ancestor image containing a coordinate system will be positioned with respect to its window s world The ShowWorld method sets the world coordinate system of a window When this method is called all images contained in the window will be redrawn with respect to the new coordinate system Images that are to be added to a window should be saved from SIMDRAW using that window s dimensionality Use the Layout Dimension option If the ShowWorld method is never called then the default world is used The boundaries of this world are found in the GTypes module In this world WorldXlo WorldYlo is the lower left hand corner of the largest centered square and WorldXhi WorldYhi is the upper right corner The aspect ratio of the screen may be distorted depending on how the graphical objects map to their new distorted world One useful method for changing how the
154. iven alias so that a single translation file can be used on more than one platform For example loading a translation file con taining these lines Times adobe times Times Times Roman and setting Family to Times will match an Adobe Times font on an X11 plat form and a Times Roman font on Microsoft Windows D 5 Markers PolymarkOb j A polymarker is a set of small graphical markers drawn at every point in the points array The markers have both a size and style The style of a marker identifies what shape the marker has The following styles are available MarkStyleType DotMark CrossMark StarMark SquareMark XMark DiamondMark Marker size is specified much the same way as text size is The SetSize specifies a size in real world x y coordinates This method will scale marker size with the object it s at tached to SetPctSize method gives a percentage of window height After this method is called a marker will not scale in size These methods have the following format ASK METHOD SetSize IN heightOfMarker REAL ASK METHOD SetPctSize IN pctOfWindow PctType 0 0 to 100 0 D 6 SnapShot Object The SnapShotObj is a bitmapped graphic primitive that can be attached to an image like any other primitive The file containing bitmap data files with extensions xwd on X Windows and bmp on MS Windows is given using the SetFile method The first point in the Points array field is the lower left hand corner
155. l The 3 D polyline object allows a line with an arbitrary number of line segments to be drawn The number of points that a polyline can contain is limited only by the display hard ware Polygon3dObj The 3 D polygon primitive allows a polygon with an arbitrary number of vertices to be drawn The points in the polygon must be planar i e all points should line up in a plane The polygon3d object can be used build complex objects by adding polygons to a 3 D image or dynamic image objects It would therefore take six Po1ygon3dObj objects to compose a three dimensional cube i e front back top bottom left and right sides TriangularMeshObj The triangular mesh primitive is the most efficient primitive in terms of rendering speed and memory usage Each new point in the points array for the triangular mesh defines a new triangle using itself and the two points immediately preceding it in the array See fig ure B 1 Old Triangle 7 1 2 3 Lo 2 Figure B 1 New Triangle Formed by Point 4 in the Triangular Mesh Array AnnotationText3dObj Three dimensional text can also be displayed The 3 D text primitive is similar to the 2 D TextOb j object The SetText method is used to define the text string while the system font family size weight and slant are initialized through the SetSysFont method only system defined text fonts can be used in 3 D B 6 Tips for 3 D Simulation Setting up a 3 D simulation model is a little more
156. l eoe dp da den v D ea 5 7 GETTING IMAGE BOUNDING BOXES cocccononccccononononinconocanonananananna nana nono conc ono case sere casa caseeeeeeeeeeeesess 5 8 BITMAPPED GRAPHICS 5 8 1 Zooming into Bitmaps 5 8 2 Bitmap Alignment Centering 5 8 3 Programmatic Definition of Bitmaps 5 9 CONVERTING IMAGES INTO POSTSCRIPT Chapter 6 Dynamic Objects eeeeieei en rro rc 6 1 DYNAMIGOBJ c iei tpa epit e 6 2 DYNIMAGEOBU S Sus Leia rts ltd oce te teeth nio Saas cis eoe eeen eaea of iL 6 3 DYNCLOCK VOB EE 6 4 TIME SCALING 6 5 EXAMPLE OF A SMALL GRAPHICAL SIMULATION A Or pe cette b Ee 6 6 DERIVING OBJECTS FROM DYNIMAGEOBS esses eene e e nancnnnnananccn canon eres nasse sese ass Chapter 7 LC 7 1 OBJECTS DERIVED FROM GRAPHVOBJ cccccccccnccccnoncnnncncncnononono sesceeueeseceseuaeaceseeeeeeaesasesseasae nana ase 7 2 CREATING AND USING GRAPHS 7 3 DESCRIPTION OF VARIOUS GRAPH OBJECTS MA Decii aa Deui pae et c War e ca a DUTY dt uva da Era E Ghana atrial dabas F232 O A a O 7 3 3 o do ee 7 3 4 MeterVObj 7 3 5 TextDisplayObj mS 7 4 USING PRESENTATION GRAPHICS T TO gt MONITOR VARIABLES 7 4 1 Single Variable Monitoring 7 4 2 Showing More Than One Variable i in n the Same Chart 7 4 8 Showing Arrays of Variables us Charts A ATA 7 5 GRAPH MONITORING TABLE 7 6 GRAPH EXAMPLE 7 7 CREATING GRAPHS A AT T RUNTIME E Contents 7 7 1 Methods to
157. l in the list box and then press the Remove button To change the attributes of a buttons select its label in the list box modify its label reference name or id and then press the Update button List Boxes F xj A list box is used to accept input from a list of text values The list may vary in length and will be scrollable if needed You can define the list to accept only single item selections or accept multiple item selections using the Shift and or Ctrl keys Using the Edit Properties menu option you can set the following attributes Width The width in font units of the list including scroll bars Height The height in font units of the list Allow Multiple Selections Allows the user to select several items in the list using the Shift and Ctrl keys Multi line Text Box A multi line text box can receive and show unlimited lines of text Horizontal and vertical scroll bars are attached if needed You can easily edit the text it contains using the mouse Using the Edit Properties menu option you can set the following attributes Width The width in font units of the box including scroll bar Height The height in font units of the box including scroll bar Text The text initially displayed in the box Allow Horizontal Scrolling If checked a horizontal scroll bar will be attached whenever a line of text is too long to be viewed in the text box If not checked a long text line will be tru
158. ly put your object into the image tree at the time a LoadFromLibrary is performed TYPE TurretObj OBJECT DynImageObj TELL METHOD PointTo IN angle DegreeType END OBJECT TankObj OBJECT DynImageObj TELL METHOD Fire END OBJECT Assume the turret made in SIMDRAW has reference name Tur ret and id 0 Also assume it is a subgouping attached to a TANK VAR turret TurretObj tank TankObj NEW tank NEW turret ASK tank TO Associate turret Turret 0 ASK tank TO LoadFromLibrary library TANK My TurretObj object will now be automatically put into the image tree and have all the graphical attributes set up in the editor This is the mechanism used to substitute user defined images for images created by SIMDRAW All of the attributes and child images of the old image are copied to the new image and then the old image is disposed of 81 SIMGRAPHICS II User s Manual 82 Chapter 7 Graphs In SIMGRAPHICS II graph objects are used to graphically display a dynamically chang ing value or set of values The generic GraphVOb j object is used to refer to a graph ob ject There are a number of objects derived from GraphVObj and a variety of ways that data can be displayed A set of data can be displayed using a piechart or a 2 D chart Single values can be displayed using a dial level meter or digital display and time can be shown with a clock A GraphVObj has the following properties
159. mference Any points after the third are ignored PolygonObj The real world points in the points array describe the boundaries of an area to be filled Fill primitives polygons sectors and circles have a Style attribute identifying the fill style used in drawing This attribute is of type FillStyleType which is defined in the GTypes module as follows FillStyleType HollowFill SolidFill NarrowDiagonal Fill MediumDiagonalFill WideDiagonalFill NarrowCross hatchFill MediumCrosshatchFill WideCrosshatchFill CircleObj A circle is described by the first two points in the points array The first point is the center of the circle and the second is any point on its circumference SectorObj A sector is a sector of a circle It is a fill primitive like a circle but is described in the same way as an arc TextOb j A TextOb Jj primitive is a graphical display of a text string It has attributes describing its alignment size font and the string value displayed The font attribute is the font in which the text value will be drawn The following fonts are available TextFontType SystemFont SimpleFont RomanFont BoldRomanFont ItalicFont ScriptFont GreekFont GothicFont SystemText The SetText method defines the text string to be displayed You can display multiple lines of text using one text object with the Set TextBuffer method which accepts an array of text lines In this case vertical text alignment values ref
160. n The defaults for the lighting equation work for most situations Note Not all lighting and shading options are supported on all 3 D platforms Image3dObj and DynImage3dObj 3 D Images are similar to the 2 D images They can be positioned rotated and scaled They can also be instructed to aim at a point or to track another 3 D object Like 2 D im ages 3 D images can be hierarchical A 3 D image can contain sub images which in turn contain sub images For example a 3 D tank can have a 3 D turret attached to it as a sep arate object which moves rotates and scales along with the tank Dynamic 3 D images can move to a 3 D point in the modelling space scale to any size and rotate to any angle over simulation time It can also follow a path defined by an array of 3 D points CameraOb j A least one camera must be Cued to view the 3 D world Cameras are positioned in 3 D space and are oriented either by rotation or by aiming at a location Cameras can also Track 3 D objects A tracking camera will automatically adjust itself to point at the tracked object whenever the tracked object changes location Cameras can be attached to any moving or rotating 3 D object enabling you to see from the object s vantage point Any number of cameras can simultaneously view a scene The output of each camera goes ee to a section of the 3 D window described by the camera s view port Cameras also have a depth of field and can zoom in and out
161. ncated 30 Chapter 2 SIMDRAW Labels amp Group Boxes T A label is used to place explanatory text or titles in a dialog box It can be positioned any where within the dialog A group box can be attached to the label and sized to enclose a set of controls with some common property Using the Edit Properties menu option you can set the following attributes Label The text of the label Show Group Box Defines whether a group box will be shown Width The width in font units of the group box Height The height in font units of the group box Combo Boxes B A combo combination box is a text box containing a small drop down button When that button is pressed a scrollable list of choices for the text field is displayed The combo box can be defined to allow only those alternatives shown in the list entered or to be fully editable like a text box Using the Edit Properties menu option you can set the following attributes Label The text on the left hand side of the box identifying the box Width The width in font units of the text box plus the drop down button Height The number of visible items in the drop down list Editable Defines whether or not you can edit the text field or if it is restricted to contain only one of the items shown in the drop down list Sorted Alphabetically If checked items in the drop down list will be shown in al phabetical order Progress Bar A progress
162. nd sizing attributes of an image such as scaling rotation and translation are al ways set with respect to the image s parent in the image tree not the window in which it lies If an image rotation was set to 45 degrees this means that the image would appear rotated 45 degrees from its parent in the tree If the image s parent had also been rotated 45 degrees then total rotation of the image seen in the window would be 90 degrees In the above solar system example suppose we wanted to move one of the planets We would then specify a new position for the planet relative to the center of the solar system Then if we moved the solar system around the window the planets would automatically move with it since their positioning relative to the solar system center has not changed 5 2 Image Priority Any image will appear on top of other images that come before it in its parent s list of chil dren It therefore appears beneath other images that come after it in the list In the above block of code the Earth comes after Mercury and Venus in the solar system s list of chil 63 SIMGRAPHICS II User s Manual dren Therefore at times when the planets overlap the earth would appear on top of Venus and Mercury But since Earth comes BEFORE Mars in the list Mars would appear on top of Earth during an overlap PirstGraphic LastGraphic Figure 5 4 Image Priority 5 3 Creating and Using Images Images can be created in one of two ways One way
163. nput 5 Start the simulation StartSimulation 6 The BeSelected method of MyDialogBox will be called whenever there is a control selection and the Last Picked field of the dialog box will point to the control which was selected The BeSelected method should be overridden to look something like this ASK METHOD BeSelected VAR control ControlVObj BEGIN control LastPicked CASE ASK control ReferenceName WHEN MyCheckbox WHEN MyRadioBox OTHERWISE END CASE END METHOD Dialog boxes are positionable independently of their parent window s position It is not necessary to use dummy windows to position dialog boxes at various screen positions DialogBox0bj has the following method ASK METHOD SetPositioning IN align DBPositionType Sets the Positioning field Centered gt Dialog box is centered within its parent window Other values gt Dialog box is positioned using its Translation As an example BottomRight positioning means the bot tom right corner of the dialog will be located at the posi tion on the screen specified by the Translation field Note that the Translation is specified in screen co ordinates as is done for Window0b3 s That is 25 0 75 0 would refer to the point on the display 1 4 screen width to the right of and 3 4 screen height up from the bottom left corner of the screen Positioning default value Centered Use methods Set Translation and SetPositioning to specify a referenc
164. nput method instead of Accept Input when using asystem dialog When AcceptSysInput returns the fields File and Path will con tain the file name and its path as selected by the user 8 22 5 System Font Dialog The standard system font selection dialog is available On Motif and OPEN LOOK a ge neric font specification dialog is provided The FontDialogBoxObj is included in the module Form This object represents a system specific font browser dialog box The Family Size Weight and Slant fields can be set using the SetInitialFont method defined be low before asking the dialog box to AcceptSysInput ASK METHOD SetInitialFont IN family STRING IN size INTEGER IN weight INTEGER IN slant INTEGER Use this method to set the initial font to be displayed in the browser when it is next drawn The Size field is described in point size units Weight is an integer be tween 0 and 100 O no boldface 100 maximum boldface while Slant is an integer between 0 and 1 O normal 1 italics 127 SIMGRAPHICS II User s Manual When AcceptSysInput returns the Family Weight Size and Slant fields can be passed directly to the TextObj method SetSysFont Remember to use the AcceptSysInput method instead of Accept Input when using a system dialog 8 23 Alert Boxes SIMGRAPHICS II supports interfaces to the standard built in alert information and question message boxes found under the MS Windows and X Windows toolkits These are
165. ns at X Minimum Cell Width 2 units Continuous Surface Variable number of cells i e a new cell is added to the graph each time a data point is plotted at the given x y location Neighboring cells are connected Plot Type A data set can be shown using a filled region or a simple surface line with or without markers 1 Fill Plot a data cell using a filled polygon The fill style can be reset using the Style palette Line Plot data cell using a polyline Use the Style palette to reset the line width or dash style Marker Use a small marker to represent the data point The specific marker used for the data point is determined from the Edit Mark Style menu option menu Markers are only valid for the continuous surface representation Chapter 2 SIMDRAW Cell Width For bar histogram and discrete surface data sets this is the size of each data cell For histograms the first data cell begins at the X axis minimum For bar and surface graphs the first cell begins at X Minimum Cell Width 2 units Interpolate This check box determines whether there is linear interpolation in forming the connecting surface between consecutive data points If this item is NOT checked the surface will be shown with only horizontal and vertical lines Use Left Axis Use Right Axis Your chart can be defined to simultaneously show two sets of independently scaled data by using a second Y axis generally
166. ntains a fixed number of cells Each bar is a rectangle centered directly over an X axis tick mark When a coordinate is plotted the bar near est to the given x coordinate is modified to reflect the magnitude of the given y coor dinate 85 SIMGRAPHICS II User s Manual Discrete surface A surface chart data set contains a fixed number of cells A series of polygons or lines is used to show the entire data set as a surface Each point is plotted directly over each x axis tick mark Continuous Surface A simple plot has a variable number of cells Data is always add ed to this data set in other words data cells are never replotted as in the above repre sentations This representation can be useful in post processing a large amount of data when every piece of the data must be seen somewhere in the plot Data sets shown in a trace plot are always represented in this fashion Plot stacking is useful when multiple sets with approximately the same values are plot ted where they would tend to obscure each other or when it s desirable to present each data set value in relation to the sum of all data set values for a given cell in the manner of a pie chart Fixed width data sets with the same representation can be displayed in stacked form where the values plotted for each data set are added to the sum of the previously plotted values The data sets are plotted from the bottom up in order of increasing data set number For example suppose we
167. nterval 0 1 SetAxisField ChartYInterval 0 1 SetAxisField ChartXNumInterval 0 5 SetAxisField ChartYNumInterval 0 5 plot values to the chart i 10 0 TO 100 FLOAT i 0 01 ASK chart TO SetCoordinate 1 t t t ASK chart TO SetCoordinate 2 t t t t FOR finally display the chart window TO AddGraphic chart chart TO SetScaling 0 5 0 5 chart TO DisplayAt 8192 0 8192 0 wait for user to click on something picked ASK window TO AcceptInput Chapter 8 Controls The MODSIM III Graphical User Interface GUI provides a connection to the underlying vendor toolkit Each control is associated with an object and is used to accept user input Different control types are provided to allow various types of input to be accepted CONTROL TYPES ButtonObj Receives simple selection CheckBoxOb j Receives YES NO input ComboBoxOb j A combo box that allows you to either select from a list or type in your own selection DialogBox0b j Modal or modeless container of controls FileDialogBox0bj Allows you to browse the file system and select a file FontDialogBoxOb j Allows you to browse and select installed text fonts Label0bj PDisplays a STRING or a group box ListBoxItemoOb j Label inside a list box which can be selected ListBoxObj Allows selection of a exactly one item out of many Contains list box items ListBoxMultob3j Allows selection of a variable numbe
168. nutes Show Seconds Y ou can control displaying the hour minute and second hands with these items Hours Per Day Currently this parameter has no effect on the layout of the clock Itis only used within the application program Minutes Per Hour Defines the time interval before the hours are incremented by one Seconds Per Minute Defines the time interval before minutes are incremented Show Borders Analog clock only Determines whether to put borders around the legend title and plot of a pie chart 2 14 6 Dials d A dial can be created in the Graph Editor for displaying a single scalar value The hand of the dial rotates clockwise as its value gets larger By selecting the dial and using the Edit Properties menu option you can change the various attributes shown below Library Name The name of the object within the current graphics library Title Text of title displayed on bottom Minimum Maximum Defines the range of values shown by the dial Interval Distance between tic marks around the face Num Interval Distance between numbers around the face 24 Chapter 2 SIMDRAW Min Theta Angle in degrees where the minimum value is placed around the dial circumference Max Theta Angle in degrees where the maximum value is placed around the dial circumference Scale Factor Factor multiplied by value before being displayed in the dial Show Border A square backgr
169. ob tain a dialog box showing the object s attributes Change the Library Name text field to the new name and then save the object with the File Save menu option 2 9 Adding an Object from Another Library If you want to add object s contained in a different SIMGRAPHICS II file use the File Merge menu option Once a file is selected a list box containing the names of all objects in this source library will be displayed Choose the objects you wish to copy to your library The Shift and Ctrl keys can be used in conjunction with the mouse to select multiple objects 2 10 Editing Images and Graphs in Same Window Sometimes a set of images and or graphs must be displayed in the same context to get their size and position correct Multiple objects can be positioned and resized from within one window using the Layout Editor Select the Layout button on the far right hand side of the toolbar Using the Shift and Ctrl keys select the set of images and graphs to be resized and positioned from the list box After editing the objects Use the File Save menu option to save all edited objects to the SIMGRAPHICS II file 2 11 User Preferences You can set preferences regarding the order in which objects in the currently loaded library are listed using the Options Preferences menu option One of the following three methods can be used to list your objects 1 Time of creation Objects are ordered based on time of creation The objects last added to
170. odel 1 Create objects for background and animation using SIMDRAW in 3 D mode 2 Create a 3 D window object Window3dObj 3 Create a library object and load the file created by SIMDRAW GraphicLibObj 4 Create static and dynamic 3 D images and load their graphic representations from the library Add them to the 3 D window Image3dObj DynImage3dObj 5 Create and position a light to illuminate the 3 D world LightObj 6 Create and position a camera and direct it to look at a location or object in the 3 D world Add it to the 3 D window CameraObj 7 Ask the 3 D window to draw Start the simulation To animate the 3 D objects give them a speed and then ask them to 1 Move to a specific coordinate ASK obj TO MoveTo x y z 143 SIMGRAPHICS II User s Manual 2 Follow a path defined by an array of 3 D points ASK obj TO FollowPath points 3 Rotate to an angle ASK obj TO RotateTo xangle yangle zangle 4 Scale to a size ASK obj TO ScaleTo xsize ysize zsize B 3 Objects Used Window3dObj The 3 D Window object acts as a container for all 3 D images dynamic images and prim itives The 3 D window is created positioned and sized identically to the 2 D window ob ject The rendering mode for all graphics drawn in the window can be set to wireframe solid or solid with shading modes The 3 D window object also controls the lighting equa tion by setting the amount of ambient diffuse and specular reflectio
171. of the bitmap and the second 159 SIMGRAPHICS II User s Manual point is its upper left hand corner Ifthe bitmap is non scalable these points will be defined automatically by SIMGRAPHICS II For scalable bitmaps the programmer must define these points See Chapter 5 8 for more information on using the SnapShotObj D 7 Example Program The following example creates a small cart dynamically MAIN MODULE Example7 This module creates a 2 level Cart and displays it on the screen using program code FROM GTypes IMPORT PointArrayType FillStyleType SolidFill MediumDiagonalFill ColorType Green Yellow FROM GTypes IMPORT HandleEvents FROM Window IMPORT WindowObj FROM Fill IMPORT CircleObj PolygonObj FROM Image IMPORT ImageObj VAR window WindowObj wheell wheel2 CircleObj cart ImageObj body PolygonObj wheelpoints PointArrayType bodypoints PointArrayType BEGIN bring up the window NEW window ASK window TO Draw assign points for all wheels NEW wheelpoints 0 1 wheelpoints 0 x 0 0 wheelpoints 0 y 0 0 wheelpoints 1 x 1500 0 wheelpoints 1 y 0 0 assign points for body image NEW bodypoints 0 3 bodypoints 0 x 0 0 bodypoints 0 y 0 0 bodypoints 1 x 10000 0 bodypoints 1 y 0 0 bodypoints 2 x 10000 0 bodypoints 2 y 6000 0 bodypoints 3 x 0 0 bodypoints 3 y 6000 0 160 Appendix D Creating Images at R
172. ogram ChartObj NEW histogram ASK histogram TO LoadFromLibrary graphicLib Oueue Length ASK GETMONITOR queueLength IDataPtMObj TO SetGraph histogram ASK GETMONITOR queueLength IDataPtMObj TO SetHistMode TRUE queueLength 12 Trace Plots A single variable can be monitored with respect to time using a Trace plot The Trace plot is shown with a ChartObj object which must be set up as a Time Trace Plot in the SIMDRAW The monitoring is set up in the same fashion as dials level meters and digital displays When the value of the monitored variable changes a point is plotted to the chart The variable s new value is the y coordinate of the point and simulation time is the x coordinate thus producing a graph of the variable over time 92 Chapter 7 Graphs Trace Plot DataSetl DataSet2 Figure 7 10 Trace Plot 7 4 2 Showing More Than One Variable in the Same Chart In SIMGRAPHICS II two or more monitored variables can be shown in the same chart This is accomplished with the SetDataSet method of the monitor object This method is given the data set number the variable is to be shown in For example to show the mon itored variables Position Velocity and Acceleration in the same chart the fol lowing code would be used VAR Position Velocity Acceleration RDataPt tracePlot ChartObj ASK GETMONITOR Position RDataPtMObj TO SetGraph tracePlot ASK GETMONITOR Velocity RDataPtMObj TO
173. on are called dynamic objects All dynamic objects inherit the prop erties of Image0b3 which inherits properties of GraphicVObj Some of the most useful inherited methods are summarized below ASK METHOD Draw Draws a graphical object ASK METHOD Erase Erases a graphical object ASK METHOD DisplayAt IN x y REAL Displays a graphical object at x y ASK METHOD LoadFromLibrary IN library GraphicLibObj IN name STRING Loads the description of a graphical object from a library ASK METHOD BeSelected Automatically invoked when object is clicked on Can be overridden to receive asynchronous selection ASK METHOD AddGraphic IN graphic GraphicVObj Adds an object to the end of the set of graphical objects ASK METHOD RemoveThisGraphic IN graphic GraphicVObj Removes a specific object from the set of graphical objects ASK METHOD Descendant IN refName STRING IN id INTEGER Returns the object in the set with Reference Name refName and Id id Recursively searches through sets of objects in set Note These are only some of the methods inherited by dynamic objects Other methods are outlined in Chapter 5 6 1 DynamicObj There are several objects which provide access to the built in simulation features of MODSIM III These objects are called dynamic objects and are derived from a common object called a Dynami cOb j The three methods of all dynamic objects are StartMotion StopMotion and DynamicUpdate A StartMot
174. on or the Properties toolbar option A new window containing the appropriate ed itor will appear showing its graphical representation After moving resizing or changing attributes of the object and its sub components select the File Save or File Save As menu option to write this object to its SIMGRAPHICS II library file To end editing of this ob ject close its editor s window using the go away button in the top left corner of the win dow s header bar 2 5 Adding an Object to the Library Objects can be added to this library file by clicking on one of the create buttons on the left palette or by using the File Insert menu option Creating an object will automatically invoke the editor for that object Chapter 2 SIMDRAW 2 6 Removing an Object from the Library To remove an unwanted object from the current library select the object s name in the list ing then use the Edit Clear menu option The library must be saved using File Save before this change is permanent 2 7 Making a Duplicate of an Object Any graphical object in the library can be duplicated by selecting its name in the main list and then using the Edit Duplicate menu option The library must be saved using File Save before this change is permanent 2 8 Changing the Name of an Object To change the name of an object shown in the main list select it and use the Edit Properties menu option to bring up its editor Use the Edit Properties menu option of this editor to
175. ore of these boundaries If you do your value will be rolled over to the next highest place For example if you specified a time value of 120 seconds to a clock with the SecondsPerMinute field set to 60 the clock would display 2 00 The time value displayed in a clock is specified by the DisplayTime method ASK clock TO DisplayTime 6 45 30 set time to 6 45 30 h m s 0 45 22 Digital Clock Figure 7 4 Digital Clock Figure 7 5 Analog Clock 88 Chapter 7 Graphs A DigitalClockObj is a graphical display of a digital clock It is shown by a box con taining a readout of the time displayed in hours minutes seconds format An AnalogClockObj is a graphical display of an analog clock Like a conventional clock it has hour minute and second hands If you are using the clock with a simulation you can use a DynAClockObj or DynDClockObj instead These dynamic clock objects are automatically updated as simulation time advances See paragraph 6 3 for more details 7 3 4 MeterVObj A MeterVObj is a generic object used to represent a single real value A meter can be a dial level meter or digital display All meters have a Max and Min field that specify their range They also have a ScaleFactor set within SIMDRAW The value seen in the meter is actually the meter s value set by the user multiplied by its scale factor This value is set using the DisplayValue method Suppose you wanted to graphically display the value 1
176. ors applied to the data Coordinates passed to the SetCoordinate and Plot methods will be multiplied by these factors before being displayed on the chart However the Y method returns the original un modified Y coordinate value Default values are 1 0 7 7 11 Chart Components Listed in the GraphPartType Enumeration ChartTitle ChartXTitle ChartYTitle ChartY2Title Specifies one of the text string labels around the plot area on the chart face Text font and color can be set ChartXAxis ChartYAxis ChartY2Axis Refers to an axis including the axis line and tick marks Only the color attribute can be set ChartXNumbering ChartYNumbering ChartY2Numbering Refer to all numbers on an axis Text font and color can be set ChartXGrid ChartYGrid ChartY2Grid Refers to the grid line fora particular axis Line style and color attributes can be set ChartBorder Refers to the rectangular background encompassing the entire chart Fill style and color attributes can be set 102 Chapter 7 Graphs ChartLegend Refers to the text describing data set contents in all legends Text font and color can be set ChartDataSet Refers to the primitives composing the data set specified by the dsnum parameter Line style fill style mark style and color can be set 7 7 12 Other Methods of ChartObj Other miscellaneous attributes of a chart can be set up using the following methods ASK METHOD SetAxisTitles IN xAxisTitle yAxisTitle STRING
177. other property associated with the Y axis double click on the axis or choose the axis or one of its components and use the Edit Properties menu option The Y axis has the following properties Title Label for Y axis displayed to the left of its numbering Rescaleable Specifies whether the Y axis will be re numbered scaled when one of the data points extends beyond its range Note that re scaling may modify the tic mark numbering and grid line intervals to maintain a similar visual repre sentation of the chart If this item is not checked data points falling beyond the limits of the Y axis will be clipped Show Grid Lines If the this item is on grid lines will be shown crossing the Y axis Tics Centered Tics Inside Tics Outside Defines the tic mark alignment with re spect to the Y axis line Tic marks can be attached to the Y axis from their center left or right sides Minimum Maximum Defines the initial Y axis data range of the chart Tic Interval Major amp Minor Defines the distance along the Y axis between con secutive tic marks If an interval is zero tic marks will not be displayed Numbering Interval Defines the distance along the Y axis between consecutive number labels on the axis Grid Line Interval Defines the distance along the Y axis between consecutive grid lines X Intersection Point Defines the point in y axis coordinates along the Y axis where the X axis inte
178. ound can be shown under the dial face and title 2 14 7 Level Meters A level meter shows a single scalar numerical value The level meter is composed of a bar which grows and shrinks along a vertical axis The height of the bar reflects the magnitude of the value being plotted By selecting the meter and using the Edit Properties menu op tion you can change the attributes shown below Library Name The name of the object within the current graphics library Title Text of title displayed on bottom Minimum Maximum Defines the range of values shown by the meter Interval Distance between tic marks along the axis Num Interval Distance between numbers along the axis Show Grid Lines Horizontal grid lines extending across the plot area can be shown Scale Factor Factor multiplied by value before being displayed in the meter 2 14 8 Digital Displays A digital display is for showing a single scalar numerical value The value is shown explic itly as numerical text and is enclosed by a box By selecting the display and using the Edit Properties menu option you can change its various attributes shown below Library Name The name of the object within the current graphics library Title Text of title displayed on bottom Minimum Maximum Defines the range of values shown by the meter Field Width Number of places allotted for the entire value including decimal point Precision Number of place
179. our secondsPerMinute REAL Sets the number of hours in a day the number of minutes in an hour and the number of seconds in a minute The default values are 24 60 and 60 respectively ASK METHOD SetMaxHours IN maxShown REAL Sets the highest hour displayed on the clock i e the number at the top of an analog clock The default value is 12 ASK METHOD SetNumInterval IN numHoursBetweenLabel REAL AnalogClockOb j only Sets the number of hours between consecutive numbering The default value is 3 ASK METHOD SetInterval IN ticInterval REAL AnalogClockOb j only Sets the tick marking interval in hours 7 7 6 PieChartObj Methods The following methods enable programmatic creation of a pie chart ASK METHOD AddSlice Adds a slice to the pie chart The new slice will be the last slice in the order ASK METHOD RemoveSlice IN sliceNumber SliceRefType Removes a pie slice from the chart given its number order High numbered slices will be consecutively renumbered ASK METHOD SetSliceTitle IN sliceNumber SliceRefType IN sliceLegendText STRING Sets the text shown in the legend for a particular pie slice 98 Chapter 7 Graphs 7 7 7 Methods for Programmatic Creation of a ChartObj Generally speaking charts are defined through the SetAxisField SetOption and the SetDSOption These methods accept enumerated type constants specifying which particular field or option of the chart is to be set Data sets a
180. ox Use the Layout Ungroup menu option to destroy an image An image is selected by clicking on one of the primitives within it Repeated selections of an image will select the shapes within it Select primitives directly by clicking on them while holding down the Ctrl key Shapes can be removed from an image by selecting the shape and using the Layout Remove from Group menu option You can also add shapes to an existing image by selecting first the existing group then the shapes to add and using the Layout Add to Group menu option 2 13 7 Editing the Root Image ao AR The editor s window shows all objects contained by the image being edited or the root image To change properties of this image use the Edit Image option to display the Image Detail dialog Chapter 2 SIMDRAW This dialog can be used to set the library name or name used to load the object into your program via the LoadFromLibrary method To reset the center point of the root image first click on the Select button in the Properties Dialog Next position the mouse in the canvas of the edit window over where you want the center point and click The center can also be defined by editing the fields directly in the Properties Dialog If the Automatic Re center option is checked SIMDRAW will automatically re center the image whenever a change to its geometry is made Otherwise the image center point should always be defined before saving to the graphics library file T
181. pecified in screen coordinates where the width and height of the computer screen each are 100 units Tab Ordering of Members If you wish to use the Tab key to transfer input focus from one control to the next while interacting with the dialog box the order in which this traversal takes place can be established ahead of time A list box shows the labels of all controls in the dialog that can have input focus The order of items in this list is the order in which input focus will proceed when the Tab key is pressed Use the up and down arrow keys to shift the tab ordering of controls Tabbed Dialogs Tab The Dialog editor can be used to create Tabbed Dialogs or to convert existing dialogs to be tabbed Using a Tabbed Dialog you can attach sets of controls to overlapping Pages Only the top Page can be seen all other Pages and attached controls remain hidden underneath The only visible portion of a Hidden Page is a small rectangular area containing its name or a tab Clicking on the tab will bring its Page to the top and show all controls attached to it To create a Tabbed Dialog you must first make sure that the area on the dialog box where the Page Area is to be placed is cleared of controls they should be moved or temporarily cut to the clipboard Create a Page by dragging it from the palette onto the dialog box Any number of Pages can be dropped onto the dialog box The Page Area can be resized and moved Dropping a control
182. ph Component ASK METHOD SetPartColor IN part GraphPartType IN dsid INTEGER IN color ColorType ASK METHOD SetPartRGBColor IN part GraphPartType IN dsid INTEGER IN r g b PctType 7 7 2 Methods to Set the Fill Line or Mark Styles of a Graph Component ASK METHOD SetPartFillStyle IN part GraphPartType IN dsid INTEGER IN fs FillStyleType ASK METHOD SetPartLineStyle IN part GraphPartType IN dsid INTEGER IN 1s LineStyleType IN linePctWidth range 0 to 1 REAL ASK METHOD SetPartMarkStyle IN part GraphPartType IN dsid INTEGER IN ms MarkStyleType 7 7 3 Methods to Set the Text Fonts of Graph Components ASK METHOD SetPartTextFont IN part GraphPartType IN dsid INTEGER IN font TextFontType ASK METHOD SetPartTextSysFont IN part GraphPartType IN dsid INTEGER IN family STRING IN ptSize weight slant INTEGER 97 SIMGRAPHICS II User s Manual 7 7 4 Method to Hide a Graph Component ASK METHOD SetPartHidden IN part GraphPartType IN dsid INTEGER hiddenFlag BOOLEAN 7 7 5 Additional Methods for Programmatic Creation of a ClockVObj The following methods are available for programmatic creation of a Clock ASK METHOD SetHandShowing IN showHours showMinutes showSeconds BOOLEAN Controls the display of the hour minute and second indicators Default is TRUE for displaying each indicator ASK METHOD SetHandScaling IN hoursPerDay minutesPerH
183. phic methods The order of the list box items in the list box is determined by their order in the graphical set The following code creates initializes and adds several items to a list box NEW ListBoxIteml NEW ListBoxItem2 NEW ListBoxItem3 NEW listbox ASK ListBoxIteml TO SetLabel item number 1 ASK ListBoxItem2 TO SetLabel item number 2 ASK ListBoxItem3 TO SetLabel item number 3 ASK listbox TO AddGraphic ListBoxIteml ASK listbox TO AddGraphic ListBoxItem2 ASK listbox TO AddGraphic ListBoxItem3 ASK listbox TO Draw Items can be removed using the standard RemoveGraphic or RemoveThisGraphic methods as follows ASK listbox TO RemoveThisGraphic ListBoxItem1 ASK listbox TO Draw If the items are added using the AddAlpha method then the items in the list box will appear in sorted order ASK listbox TO AddAlpha ListBoxItem All items in a list box can be removed by doing the following ASK listbox TO RemoveAll The selection status of an item in a ListBoxMultoOb j can be set using either the listbox s or the listbox item s Set IsSelected method 113 SIMGRAPHICS II User s Manual ASK listbox TO SetIsSelected ListBoxIteml TRUE ASK ListBoxItem2 TO SetIsSelected FALSE ASK listbox TO Update You can find out which items in a list box are currently selected by iterating through the children of the list box and examining their IsSelected fields VAR anItem ListBoxItemObj
184. ping If TRUE a hori zontal scroll bar will be added to allow viewing long lines FALSE will cause long lines to automatically wrap at word boundaries ASK METHOD SetMaximized IN maximized BOOLEAN Sets the control to become maximized within a ControlWindowOb j when it is created This method only has an effect when the parent window is a ControlWindow0b3 This method invalidates any calls to SetSize Note The BeSelected method is not called when the user presses the Return key However the BeModi fied method will be called whenever any change is made to the text contents by the user The multi line text box can be maximized to create a text edit window if it has been added to a ControlWindowObj object This is performed via the SetMaximized method 8 20 TableObj A Table is a two dimensional array of selectable cells or text labels The number of col umns and rows of cells can be defined both programmatically and through SIMDRAW Also de finable is the width of each column and the size of the visible portion If the table size exceeds its visible size in width or height the table is automatically made scrollable in that direction The left most column is numbered 1 while the top most row is numbered 1 Mean Temperature and Rainfall Figure 8 12 Table 119 SIMGRAPHICS II User s Manual A table can also have row and or column headers Column headers are shown by a row of cells on top of the table Col
185. pter 8 Controls 8 10 Check Box Figure 8 4 Check Box The check box is used to receive YES NO input The Checked field shows the state of the check box You can set the state of the check box using the Set Check method as fol lows ASK checkbox TO SetCheck TRUE ASK checkbox TO Draw or by the shortcut ASK checkbox TO DisplayCheck TRUE 8 11 Text Box ee Name Rufus T Firefly Figure 8 5 Text Box The text box is used to receive a string of characters The contents of the text box can be read using the following method textstring ASK textbox Text The contents of a text box can be changed using the Set Draw methods ASK textbox TO SetText new contents ASK textbox TO Draw or by using the shortcut ASK textbox TO DisplayText new contents 111 SIMGRAPHICS II User s Manual 8 12 Value Box m Tare Weight lbs 32761 Figure 8 6 Value Box A value box receives numeric data between a specified minimum and maximum The data can be entered in standard or scientific notation The contents of a value box is considered valid if it falls between the Minimum and Maximum fields and is numeric Validity is checked whenever you click on a Butt onObj object whose VerifyData field is TRUE If the value is invalid a gt character is placed next to it If the value box is added to a tab page in a tabbed dialog box its value will also be checked when you try to sw
186. r and using the Paste option Note The palette itself can never be cut copied or deleted It can however be selected for the purpose of changing its properties 2 17 3 Editing the Palette A palette contains an array of selectable palette buttons Palettes can be attached to any edge of the application window or be floating not unlike a modeless dialog box On MS Windows systems palettes can be dockable meaning they can be moved from one edge of the window to another while running the application Palettes cannot be resized they are automatically sized to fit their contents Double clicking on a palette will display the fol lowing detail Library Name The name of this palette in the graphics library e Title Title text displayed in the header bar of a floating palette Columns for Left Right Dock Number of columns of palette buttons and separa tors whenever the palette is docked on the left or right edges of the window or the palette is floating Rows for Top Bottom Dock Number of rows of palette buttons and separators whenever the palette is docked on the top or bottom edges of the window Columns for Floating Number of columns of palette buttons and separators whenever the palette is not docked on a window edge but floating free 43 SIMGRAPHICS II User s Manual 2 17 4 Editing a Palette Button Palettes are occupied by an array of palette buttons A palette button has the following at tr
187. r of items Contains list box items MessageDialogBoxOb j Receives simple yes no input or alerts users MenuBarObj Contains menus MenuItemObj Receives simple selection MenuOb j Contains menu items MultiLineBoxObj Receives multi line text input PaletteObj Allows modeless selection from an array of one or two state buttons PaletteButtonObj Receives simple selection or YES NO input from inside a palette PaletteSeparatorOb j Separates groups of palette buttons 105 SIMGRAPHICS II User s Manual PopupMenuOb j Contains menu items ProgressBarObj Displays a single numerical value as a horizontal bar RadioBox0Ob j Contains a group of radio buttons RadioButtonObj Receives YES NO input which is mutually exclusive among a group of radio buttons TableObj Receives row column input TextBox0bj Receives text string input TreeObj Allows selection of one item out of many TreeItemOb j Label inside a TreeOb j ValueBoxOb j Receives numeric input Several objects are used as intermediate object types They should not be used directly These intermediate types include ControlVOb j Basic control object which all specific controls are derived from FormVObj Object which is a parent to other controls but does not have a parent control The MenuBarOb j and DialogBoxObj are derived from this object ToggleVObj Obiject used to receive ON OFF input CheckBoxObj and RadioButtonOb j are derived
188. rable to ASK biglImage TO Draw E 6 Command Line Options Two command line options may be passed to SIMGRAPHICS II executables nograp This option causes your executable to run without displaying any graphics including user input dialog boxes and menu bars noimage This option causes the executable to run without displaying animation but it will display dialog boxes and menu bars to allow user input In both cases TimeScale is set to run the simulation as fast as possible 164 Appendix F Complete Solar System Example SolarSystem Figure F 1 Solar System MAIN MODULE Example3 Example3 Complete model of solar system The following example graphically models the solar system and the rotating planets Planets spin on their axis while rotating around the sun Every earth hour the planet po sitions and rotational spins are updated FROM GTypes IMPORT WorldXhi WorldYhi FROM Graphic IMPORT GraphicLibObj FROM Window IMPORT WindowObj FROM Icon IMPORT IconVObj FROM Image IMPORT ImageObj CONST MercuryYear 87 784 earth days in a mercury year VenusYear 224 013 4 earth days in a venus year EarthYear 365 25 earth days in an earth year MarsYear 685 15 earth days in a mars year MercuryDay 1416 0 earth hours in a mercury day VenusDay 6000 0 earth hours in a venus day 165 SIMGRAPHIC S II User s Manual EarthDay 24 0 4 earth hours
189. rcepts Data Scaling Factor Defines the factor multiplied to the Y component of all data plotted to the chart at runtime 2 14 3 4 Modifying the Second Y Axis To change the range numbering interval or any other property associated with the second Y axis double click on the axis or choose the axis or one of its components and use the Edit Properties menu option The second Y axis has the following properties Title Label for Y axis displayed to the left of its numbering Rescaleable Specifies whether the Y axis will be re numbered scaled when one of the data points extends beyond its range Note that re scaling may modify the tic mark numbering and grid line intervals to maintain a similar visual repre sentation of the chart If this item is not checked data points falling beyond the limits of the second Y axis will be highlighted Show Grid Lines If the this itemis on grid lines will be shown crossing the second Y axis Tics Centered Tics inside Tics Outside Defines the tic mark alignment with re spect to the second Y axis line Tics marks can be attached to the Y axis from their center left or right sides 21 SIMGRAPHICS II User s Manual Minimum Maximum Defines the initial data range of the second Y axis Tic Interval Major amp Minor Defines the distance along the second Y axis be tween consecutive tic marks If an interval is zero tic marks will not be displayed Numbering Inte
190. re added and removed with the AddDat aSet and RemoveDataSet methods As before a data set is specified by its ordinal number within the chart an integer ranging from 1 to the total number of data sets 7 7 8 Setting Chart Options The SetOption method given below turns on or off an option for the chart The options available are described by the Chart OptionType enumeration ASK METHOD SetOption IN option ChartOptionType possible values listed below IN optionOn BOOLEAN ChartShowLegend If TRUE chart will show a legend below the plot area Calling the SetDSTitle method will set the data set description appearing in the legend The default value is FALSE ChartShowBox If TRUE numbering and tick marks will be forced to appear on the edges of the plot area For better visual reference two extra axes will be drawn on both the top and right sides of the plot area The default value is FALSE ChartTime Trace Setting this option implies that the chart is a time trace plot Whenever a variable being monitored by the chart is modified its new value is plotted along the Y axis and the current simulation time is plotted along the X axis See the paragraph on single variable monitoring The default value is FALSE ChartStacked If TRUE all discrete data sets will be stacked on top of each other In other words the value plotted in a data cell is reflected as the height of the bar not its top There fore stacking means that
191. re similar to covered lights They produce cones of illumination which dimin ish with distance The spot light s position and aim point determine the line of maximum illumination Its spread angle determines the width of the illumination cone and its concen tration determines how the light varies as distance is increased from the center of the illu mination cone Attenuation determines how the light fades with distance Spot lights can also track 3 D objects to keep maximum illumination focussed on the tracked object Lights can be oriented through rotation or can be asked to aim at a point Like cameras a light can be attached to a hierarchy of 3 D images and automatically moves and rotates with its parent B 4 Combining 2 D and 3 D Graphics One application can have both 2 D and 3 D graphics windows but only 2 D graphic ob jects can be displayed in the 2 D window and only 3 D objects can be displayed in the 3 D window B 5 3 D Primitives There are three 3 D primitives available Polyline3dObj Polygon3d0b3 and TriangularMeshObj SIMDRAW builds objects using only Polyline3d0b3 and Polygon3dOb js However all three primitives can be created programmatically The SetPoints method is used to define the shape of the primitive in three dimensions Color is defined by methods SetColor and SetRGBColor Primitives should be added to an Image3d0b 3 object which is added to the Window3d0b 3 Polyline3dObj 145 SIMGRAPHICS II User s Manua
192. ress f2 ASK iteml TO SetAccelerator FALSE TRUE a ctrl a ASK item2 TO SetAccelerator FALSE FALSE f2 funkey 2 8 24 4 Menu Bar Example Program The following example accepts input using a menu bar created by SIMDRAW When Print is chosen print selected is output Selecting Exit terminates the program MAIN MODULE Example6 Simple menu bar FROM Window IMPORT WindowObj FROM Graphic IMPORT GraphicLibObj FROM Menu IMPORT MenuBarObj MenuItemObj FROM GProcs IMPORT HandleEvents FROM GTypes IMPORT WaitForEvent VAR window WindowObj menubar MenuBarObj item MenuItemObj library GraphicLibObj Done BOOLEAN BEGIN Initialize graphics and create a window NEW window ASK window TO Draw Load description of menu bar from the library NEW library ASK library TO ReadFromFile Example6 sg2 132 Chapter 8 Controls NEW menubar ASK menubar TO LoadFromLibrary library MenuBar Add menubar to window and display it ASK window TO AddGraphic menubar ASK menubar TO Draw Wait until exit is selected before exiting WHILE NOT Done item ASK menubar TO AcceptInput CASE ASK item ReferenceName WHEN Exit Done TRUE WHEN Print OUTPUT print selected OTHERWISE END CASE END WHILE Dispose window and all attached objects DISPOSE window END MODULE 8 24 5 Cascadable Menus Menus in SIMGRAPHICS II can be arranged hierar
193. right hand side of the window contains the set of dash styles hatch styles line widths and text fonts that can be applied to the selected graph components The Color palette on the bottom of the window contains 64 colors that can be applied to a com ponent When a component is selected the Style and Color palettes will be updated to re flect the style and color of that graph part At this time Style and Color palette changes will be applied to the selected part 2 14 2 Selecting Moving and Resizing Graph parts are selected by clicking the mouse button over a visible portion Selected parts are marked by a bordering green or cyan box Multiple components can be selected by holding down the Chapter 2 SIMDRAW Shift key and clicking on several parts You can also select multiple components by clicking in the back ground of the window and dragging the mouse over the parts you want to select For resizing it is necessary to select the entire graph Use the Edit Select All menu option or drag the Select rectangle over the whole graph Sides and corners of the selection box contain eight small square resize handles Resizing is performed by clicking on down and dragging the appropriate resize handle To move the graph select the graph or any of its components and drag it to the desired lo cation 2 14 3 Charts 2 D Plots A chart is a 2 D plot used to display one or more data sets represented as histograms bar graphs surface char
194. rn inside a text box combo box or value box whose ReturnSelectable field is TRUE 3 The user clicks on a cell inside a table Within the BeSelected method you can check the Last Picked field to see which control was just clicked on To do this you will need to create your own variety of DialogBoxObj MenuBarObj or PaletteObj For example MyDialogBoxObj OBJECT DialogBoxObj OVERRIDE ASK METHOD BeSelected END OBJECT 108 Chapter 8 Controls The implementation of BeSelected could look something like this OBJECT MyDialogBoxOb j ASK METHOD BeSelected BEGIN browse itemlist and radiobox are names assigned within SIMDRAW CASE LastPicked ReferenceName WHEN browse OUTPUT Browse button selected WHEN itemlist OUTPUT List box item selected WHEN radiobox OUTPUT Radio button selected END CASE END METHOD END OBJECT 8 4 Drawing and Erasing Any control may be drawn or erased using the GraphicVOb j Draw and Erase methods If the FormVOb3 containing the control has not been drawn then drawing and erasing a child control has no effect 8 5 Deactivating and Activating All controls can be activated or deactivated If a control is deactivated it will not accept user input and is dimmed A control is deactivated by the following Set Draw methods ASK control TO SetSelectable FALSE ASK control TO Draw or by the shortcut ASK control TO Deactivate Ctrl H Ctrl s gt Export
195. rval Defines the distance along the second Y axis between con secutive number labels on the axis Grid Line Interval Defines the distance along the second Y axis between consec utive grid lines Data Scaling Factor Defines the factor multiplied to the Y component of all data plotted to the chart at runtime 2 14 3 5 Attributes of a Data Set You can edit individual attributes of a data set by selecting the bars or plot line of the de sired data set and using the Edit Properties menu option Its Detail Dialog detail includes 22 Representation Defines how the overall data set is structured You can choose one of the following data set types 1 Bar Graph Contains a fixed number of cells Each new data point changes the nearest cell s plot Neighboring cells are NOT connected The first cell begins at X Minimum Cell Width 2 units The individual bar is centered over the cell and there is a small gap between bars Histogram Also contains a fixed number of cells Each new data point chang es the nearest cell s bar There is no connection between neighboring cells The bar is set at the left edge of the cell and there is no gap between bars The first data cell begins at the X axis minimum Discrete Surface Neighboring cells are connected to form a surface however there are still a fixed number of cells Each new data point changes the nearest peak or valley on the surface The first cell begi
196. s loaded from the file whose name is formed by concatenating File with a system dependent ex tension A SnapShotObj also supports optional bitmap masks which are used for showing bit maps that allow parts of the background to shine through A mask bitmap is the same shape as the real bitmap but contains only two colors pixels colored with the minimum color index denote pixels where the background should show through and all other pixels have the maximum color index After loading a bitmap from File the SnapShot Obj looks for a file named File m if it finds one its assumes that it contains a mask bitmap for the bitmap in File The bitmap is not actually read in until it is asked to Draw The mask bitmap is used to define which areas of the bitmap should be displayed If there is not a mask bitmap the entire rectangle of the bitmap is used Masks can be used to pro duce irregular shaped renderings of bitmaps including holes A SnapShotObj can be defined as Scalable If it is scalable it can grow and shrink like any ImageObj Non scalable bitmaps always appear at the same size and shape A SnapShotObj never changes its appearance when asked to Rotate SnapShotObj behaves like other primitives such as polygons polylines circles etc except that it cannot be rotated and it scales more slowly than the vector primitives SnapShotObj s may be added to image hierarchies along with vector primitives To create a bitmap that can be use
197. s to the right of the decimal point If zero an integer value is shown Scale Factor Factor multiplied by value before being displayed in the meter 25 SIMGRAPHICS II User s Manual 2 14 9 Text Meters TEXT This is a titled text value enclosed by a box The following attributes can be set Library Name The name of the object within the current graphics library Title Text of title displayed on bottom Width Number of places allotted for the text value 2 15 Using the Dialog Editor The Dialog Editor figure 2 3 provides a fast and easy to use drag and drop facility for cre ating and editing dialog boxes A dialog box is a container for controls which accept var ious types of input A dialog box can contain buttons single and multi line text boxes combo boxes value boxes a progress bar tree view lists list boxes radio boxes check boxes text labels and tables Tabbed dialog boxes can also be created Items contained by a dialog box or a dialog box tab are called controls Controls are created and added to the dialog box via the Mode palette on the left hand side of the window To create a control first select the control type from the Mode palette Po sition the pointer over where you want the control to go into the dialog box and press the mouse button The dialog box will automatically resize as needed to fit the controls it con tains Its OK to drop a control outside of the dialog box in order to make the
198. se 83 ATICESLOTS ere IER IER Ee RE NIE ERU 61 animation mode sse 163 animation speed sss 163 Md e TET 13 156 ALCOD EE 156 array of variables eei 94 aspect fatio oo ei ie Ree Rer E 1 52 asynchronous notification oooocnnccnonnnoccnnnocnnonnnnss 56 B bar ch rt a eR ode eee deret rie ns 85 bar graphs teret Oe 22 BeActivated uiui eee rit 59 BeClosed i4 5 negate e 56 B Bxpanded 5 nhe 122 BeSelected 48 77 108 118 122 141 bitmap ions rn 14 159 bounding box neat 69 bur c tad ins dede dls det 127 DUO tees 119 C Camera obiect snnoeses ss 143 A A 143 144 CameraOb acne oae 144 CANVAS CUESOE eret i etre m REESE 151 center point auna ista 16 center point shape 0 eee eee cee csecseeseceeeeeees 16 changing the name of an object seesesseseseeeeeee 7 Chart 1 niente nere 19 94 96 chart Helds cia 101 check DOK ceri ees aep deeds 29 111 CheckBoxObj ee 105 106 folii NE 12 156 ClearDataSet 2 tette 103 ClickMonitoring eene 53 clipboard 5 o nete 10 28 clipping tee tette ee 52 CIOCKS i ierit rr Rte 24 COMO ies ae ale DRE a ee RS 18 color palette 2 etre 9 18 Color TYPE enteras 61 combo box ATES E EEEE EERE NEEE 31 117 ComboBoxOb eee 105 command line argument sese 8 command line opt ons 164 continuous surface ccconoococnnonononnnnncnnananananonos
199. se value boxes Color is defined by the percentage of Red Green and Blue range 0 100 You can use the Browse Resources or Browse Files buttons on the Properties Dialog to se lect a bitmap to be displayed on the face ofthe palette button Currently on MOTIF systems you can only select an X Windows dumpfile xwd 2 17 5 Editing Palette Separators ki Palette separators receive no user input and cannot be seen on the test palette They only serve to provide a gap between buttons This separation can be changed either by dragging the resize tag on a selected separator or by using the Edit Properties menu option Separa tion is defined by percentage of button width or height and ranges from 0 to 100 44 Chapter 3 Graphic Objects and Methods The MODSIM III graphic library provides animation presentation graphs and user input forms These three broad object categories have overlapping requirements For instance you need to be able to draw and erase all of them The graphic library was written in MODSIM III to take advantage of MODSIM III s object oriented facilities The library is built around a few objects which encapsulate the attributes common to many different objects and pass on these attributes to less fundamental objects by inheritance A number of objects have been constructed just to pass on their fundamental attributes and are not intended to be used directly Such objects are termed virtual objects One way to r
200. sentation Graphics 7 2 Creating and Using Graphs The above types of graphs are created using SIMDRAW Since a GraphVObj is inherited from ImageOb all operations that can be performed upon an image can also be per formed on a graph Therefore loading a graph from a library is done in the same manner as for any image For example if you wanted to get a dial that was given the name Fuel Gauge in SIMDRAW the following code would be used VAR library GraphicLibObj fuelGauge DialObj NEW library ASK library TO ReadFromFile graphs sg2 NEW fuelGauge ASK fuelGauge TO LoadFromLibrary library Fuel Gauge If not set within SIMDRAW the size of a graph can be set using the Set Viewbox ask method Its arguments are width and height specified in parent coordinate space units To set the size of a dial to 10000 0 units wide by 10000 0 units tall ASK dial TO SetViewbox 10000 0 10000 0 The position of the graph is set within SIMDRAW but can be set at runtime in the same manner that images are positioned using the SetTranslation method ASK fuelGauge TO SetTranslation x y SetTranslation sets the upper left corner for all graph types 84 Chapter 7 Graphs 7 3 Description of Various Graph Objects 7 3 1 ChartObj A chart is used to present a 2 D plot containing a number of data sets It has a title for itself and for each of the axes of its 2 D plot It also optionally contains legends for each of the data
201. ssed Max The maximum value the box can contain Precision Precision is used to format output and round input It defines the num ber of digits to the right of the decimal point 0 integer value 1 0 1 2 0 01 rounded to 10 s 2 rounded to 100 s etc Value The initial value displayed in the value box Use Scientific Notation Indicates whether output should be formatted using scien tific notation i e 71 7 le 1 Selectable Using Return Defines whether the application program will be notified when the user presses the Return key while this text box has input focus Check Boxes j A check box is used to receive and show yes no input Using the Edit Properties menu op tion you can set the following attributes Label The text on the right hand side of the box identifying it to the user Checked Initial state of the check box 29 SIMGRAPHICS II User s Manual Radio Boxes c C C The radio box accepts input from a fixed list of alternatives It contains a set of radio but tons You can only select one radio button at a time when you select a new button the pre viously selected button pops up automatically You can add and remove radio buttons from the radio box using the Edit Properties menu option To add a button enter its label reference name and id in the Radio Buttons area of the Properties dialog and then press the Add button To remove a button select its labe
202. t images are added as parents of the planets Rotating these will cause the planets to rotate around the sun Rotating the planets themselves causes them to spin on their axes NEW solarSystem create the solar system NEW mercuryOrbit create new orbit images NEW venusOrbit NEW earthOrbit NEW marsOrbit ASK solarSystem TO AddGraphic mercuryOrbit add the orbit images to the ASK solarSystem TO AddGraphic venusOrbit solar system ASK solarSystem TO AddGraphic earthOrbit ASK solarSystem TO AddGraphic marsOrbit ASK solarSystem TO AddGraphic sun ASK mercuryOrbit TO AddGraphic mercury add the planets to their orbit ASK venusOrbit TO AddGraphic venus images ASK earthOrbit TO AddGraphic earth 167 SIMGRAPHIC S II User s Manual 168 ASK marsOrbit TO AddGraphic mars add solar system to the universe ASK universe TO AddGraphic solarSystem Now set the world coordinate system of the solar system Positioning of the solar system is then given with respect to to the default world and positioning of planets is given with respect to the solar system world ASK solarSystem TO SetWorld SystSize SystSize SystSize SystSize ASK solarSystem TO SetTranslation WorldXhi 2 0 WorldYhi 2 0 ASK mercury TO SetTranslation MercDist 0 0 ASK venus TO SetTranslation VenusDist 0 0 ASK earth TO SetTranslation EarthDist 0 0 ASK mars TO SetTranslation MarsDist 0
203. t drawn An image must be attached to a window that is visible before drawing or updating the icon GRAPHICS ERROR 225 Low world boundary equal to high Make sure the SetWor 1d call for the image does not set the low values equal to the high values GRAPHICS ERROR 226 Attempt to add non icon to an Image Only images and their derived types may be added to an image GRAPHICS ERROR 227 Attempt to add icon already in tree You must remove the image before adding it again GRAPHICS ERROR 228 Attempt to add non list box item to list box Only list box items may be added to a list box GRAPHICS ERROR 229 Attempt to add non menu items to menu bar Only menus may be added to a menu bar GRAPHICS ERROR 230 Attempt to add non menu item to menu Only menu items may be added to a menu GRAPHICS ERROR 231 Slice number not found Pie slice numbers start at 1 Make sure you have created as many slices in SIMDRAW as you are trying to access from the program GRAPHICS ERROR 232 Data set number not found Data set numbers start at 1 Make sure you have created as many data sets in SIMDRAW as you are trying to access from the program 178 Appendix H Runtime Graphics Errors GRAPHICS ERROR 233 Attempt to add non radio button object to radio box Only radio buttons may be added to a radio box object GRAPHICS ERROR 234 Non existent library file filename You tried to read in a library file that does not exist This error does not o
204. t graphical environment See the library module Text These are the TextObj fields and methods relating to system text Family STRING System font family Weight INTEGER System font weight 0 lightest 50 normal 100 2 boldest Size INTEGER System font size in points Slant INTEGER System font slant 0 normal 1 italics SysFontStatus INTEGER 0 bad system font spec found font Here are some methods and procedures used for system text PROCEDURE LoadSFontFile IN filename STRING FileStatusType Attempts to load the specified file of system text font name translations Each entry in this file consists of a pair of double quoted strings on each line the first is aname to be translated the second is the translation The intent is that font names for one platform will be translated to an appropriate name on another Note that there are built in translations any translations loaded by LoadSFontFile will be searched before the built in translations ASK METHOD SetSysFont IN Family STRING IN Size INTEGER IN Weight INTEGER IN Slant INTEGER Sets the system text font to use if the Font field is SystemText An appropriate font specification can be obtained from the Form module FontDialogBoxObj object 157 SIMGRAPHICS II User s Manual ASK METHOD SetNoFontError IN ignoreSysFontErrors BOOLEAN IfignoreSysFontErrors is TRUE the SysFontStatus variable will be set without a runtime error
205. table I Left justified c Centered and r Right justified 32 Chapter 2 SIMDRAW You can also set the initial contents of the cells in the table by clicking on the Contents button A duplicate table of the one your working on will show the initial contents of all cells To change the initial contents of a cell select the corresponding cell in the Cell Detail table and then type in the new text and press Return Tree A Tree View control or hierarchical list can be created and added to your dialog box Items in the tree are shown by a text label with an optional bitmap picture to its left In addition any item in the tree can contain other items You can see all the items in a sublist by click ing on the on the left of the item text or collapse a sublist by clicking on the Items can be added to the tree or to other items by program code or from SIMDRAW through the Properties dialog Add item to tree To add an item the tree itself first set the Reference Name Id and Label of the new item Use the Browse button to select a bitmap if you want a small picture next to your tree item Click on the Add to Tree button Add item to item First select the item you want to add to Follow the steps above for defining the new item Click on the Add to item button Changing an item Select the item to change Reset the attributes and then click on the Update button Removing an item Select
206. that the default behavior of the BeSelected method is to invoke an object s parent s BeSelected method Remember that when a graphical object is disposed of all of the child objects in its list are automatically disposed of 141 SIMGRAPHICS II User s Manual 142 Appendix B SIMGRAPHICS Il 3D B 1 Lights Cameras Action Note 3 D is presently available on Microsoft Windows NT 95 SIMGRAPHICS II 3D is capable of real time 3 D solids animation with multiple light sources and cameras It takes advantage of 3 D hardware accelerators to animate 3 D sim ulation objects The interface to 3 D graphics is similar to the 2 D interface 3 D image objects provide roughly the same capabilities as their 2 D counterparts Primitives including polygons polylines text and triangular meshes can also be created within a program and added to a 3 D window Camera objects provide an intuitive interface to viewing They can be positioned and aimed at objects or in specified directions In addition cameras can be attached to 3 D im ages and move with their parent B 2 Building a 3 D Model Constructing a simulation using 3 D is similar to building it using 2 D graphics Like the 2 D library the 3 D interface is provided through objects You must create 3 D objects add at least one light to make the objects visible and add a camera to view the scene The fol lowing is a summary of the steps and objects involved in creating a 3 D simulation m
207. the X axis Tics Centered Tics Inside Tics Outside Defines the tic mark alignment with re spect to the X axis line Tics marks can be attached to the X axis from their cen ter left or right sides Compress Data When this item is set re scaling the X axis will increase the co ordinate area of the chart enough to encompass the offending data point As a re sult existing data will shrink in size Clearing this item will have data scrolled along the X axis during axis rescale In this case data scrolled out of view will be discarded Minimum Maximum Defines the initial X axis data range of the chart Tic Interval Major amp Minor Defines the distance along the X axis between con secutive tic marks If an interval is zero tic marks will not be displayed Numbering Interval Defines the distance along the X axis between consecutive number labels on the axis Grid line Interval Defines the distance along the X axis between consecutive grid lines Y Intersection Point Defines the point in x axis coordinates along the X axis where the Y axis intercepts Y2 Intersection Point Defines the point in x axis coordinates along the X axis where the second Y axis intercepts Data Scaling Factor Defines the factor multiplied to the X component of all data plotted to the chart at runtime 20 Chapter 2 SIMDRAW 2 14 3 3 Modifying the Y Axis To change the range numbering interval or any
208. the bottom of a cell in data set n is equal to the top of the same cell in data set n i e higher numbered data sets are stacked onto the lower numbered ones The default value is FALSE ChartAdjacent If TRUE all bars mapping to the same physical cell in the plot area will be made thinner and shown side by side This guarantees that any bar in a particular data cell can not hide a shorter bar in any lower numbered data set For this option to work properly all data sets should be set up with the same options The default val ue is FALSE 99 SIMGRAPHICS II User s Manual ChartXTicsInside ChartYTicsInside These options set the tick mark alignment with respect to the axis lines for X and Y axes If TRUE the bottom X axis tick marks will be bottom justified while top tics are top justified Left Y axis ticks will be left justified while right ticks are right justified The default values are FALSE ChartXTicsOutside ChartYTics OutSide These options set the tick mark alignment with respect to the axis lines for X and Y axes If TRUE the bottom X axis tick marks will be top justified while top ticks are bottom justified Left Y axis ticks will be right justified while right ticks are left justified If neither or both of nside and outside options are set then tick marks are centered over the axis The default values are FALSE ChartXGrid ChartYGrid ChartY2Grid These options specify whether grid lines will be shown crossing
209. the editor window The font used to depict labels and other text shown in a dialog can be reset with the Layout Set Font menu option To have the icons representing your controls appear smaller or larger simply select a smaller or bigger font 2 16 Using the Menu Bar Editor File Edit Mew GR LI A menu bar contains menus which can contain either menu items or other menus The Menu Bar Editor figure 2 4 allows you to construct a menu bar by interactively dragging and dropping icons representing menus and menu items onto a menu bar icon Menus and menu items items are created and added to the menu bar via the Mode palette on the left hand side of the window To create a menu first press the Menu button on the Mode palette Position the pointer over where you want the menu to go onto the menu bar and press the mouse button The menu will automatically be inserted into the menu bar 37 SIMGRAPHICS II User s Manual Simdraw Diiheipimenubar 2342 mainmsaubar Hg e Eite Edit f View Insert Options Help Duplicate Clear Properties Save Save As Print Merge Exit Figure 2 4 Menu Bar Editor Menu panes can be displayed by simply clicking on the menu label Unlike a real menu bar multiple menu panes can be dropped down at the same time allowing you to transfer their menu items from one menu to another A new menu item can be added to a menu by first dropping down the menu pane t
210. the item to remove and then click on the Remove but ton Any items contained by this item will also be deleted You can use the Browse Resources or Browse Files buttons on the Properties Dialog to se lect a bitmap to be displayed next to the item s label Currently on MOTIF systems you can only select an X Windows dump file xwd and on MS Windows you can only select from the list of built in bitmap resources Dialog Box Although the dialog box annotation cannot be moved or resized it can still be edited by se lecting it and using the Edit Properties menu option The dialog box can be defined with the following attributes Library Name The name used to access the dialog box from inside the application Title The text shown on the header bar of the dialog e Modal Interaction Defines whether the dialog is modal or modeless When a modal dialog box is displayed the user cannot interact with any other component of the application but the contents of that dialog box Modeless dialogs can be in teracted with asynchronously 33 SIMGRAPHICS II User s Manual Position with Respect to Screen Specifies which corner of the dialog box will be offset from the lower left hand corner of the screen For example if top right posi tioning is selected the X Offset and Y Offset fields define the distance from the bot tom left hand corner of the screen to the top right hand corner of the dialog box This distance is s
211. the value will occupy including decimal point and fractional part The Precision attribute specifies the number of decimal places displayed SetFieldWidth sets the number of spaces in the box for the value SetPrecision sets the number of spaces allowed for any fractional part Digital Display Figure 7 8 Digital Display 90 Chapter 7 Graphs 7 3 5 TextDisplayObj A TextDisplayOb j contains a graphical display of a value of type STRING It has a title and is composed of a simple box containing the string The field width of a text meter is set within SIMDRAW and if the length of the string is greater than this field width then the string is truncated This string is always aligned to the right end of the box It can also be set with the method SetFieldWidth The contents of a text meter are set by the DisplayText method For example VAR textMeter TextDisplayObj ASK textMeter TO DisplayText Waiting For Input ABCDEF Text Display Figure 7 9 Text Display 7 4 Using Presentation Graphics to Monitor Variables In MODSIM III a single variable or array of variables can be monitored using a SIMGRAPHICS II presentation graph A single variable can be monitored by a level meter dial digital display trace plot chart or pie chart An array of variables can be monitored by a chart or pie chart STRING variables can be monitored by a text display Refer to the paragraph on monitoring in the MODSIM III Reference Manual for d
212. this file name but the extention should NOT be included Chapter 8 Controls ASK METHOD SetIsSelected IN isselected BOOLEAN Notify the parent tree and show this item as either selected or not selected ASK METHOD SetExpanded IN expand BOOLEAN Expands or contracts the list of associated child items There is no effect if the tree item has no children 8 17 LabelObj A LabelObj displays a non user editable STRING in a dialogbox You can set the text of a LabelObj using the Set Label method The position of a label can be set with the Set Translation method the Translation corresponds to the location of the upper left corner of the label 8 18 ComboBoxObj SIMGRAPHICS II supports a combination box control figure 8 10 A combo box resides in a dialog box and is composed of an editable text field and a drop down list When the button to the right of the text field is clicked on the list of choices for that field appears allowing the user to make a selection The selected list item is then displayed in the text field The list of options can be defined programmatically or from within SIMDRAW This list can be sorted alphabetically and the text field is optionally editable A ComboBoxObj is derived from a Text BoxObj and is described below Sa pe Color Fiolet Figure 8 10 Combo Box ASK METHOD SetOptions IN options OptionListType Sets the items in the drop down option list to the text values contained by the
213. thod MAIN MODULE Example6 FROM Animate IMPORT DynImageObj DynAClockObj FROM Window IMPORT WindowObj FROM Graphic IMPORT GraphicLibObj FROM SimMod IMPORT StartSimulation Timescale VAR truck DynImageObj clock DynAClockObj window WindowObj lib GraphicLibObj BEGIN create objects NEW window NEW lib NEW truck NEW clock load in defs of objects ASK lib TO ReadFromFile Example6 sg2 ASK truck TO LoadFromLibrary lib Truck ASK clock TO LoadFromLibrary lib Clock add objects to the window ASK window TO AddGraphic truck ASK window TO AddGraphic clock ASK window TO Draw start the clock s motion ASK clock TO StartMotion set speed of truck ASK truck TO SetSpeed 1000 0 move truck to window center TELL truck TO MoveTo 16384 0 16384 0 two seconds for every time unit Timescale 2 0 start animation StartSimulation END MODULE 80 Chapter 2 SIMDRAW 6 6 Deriving Objects from DynlmageObj There is a general problem of allowing the methods of an ImageObj to be overridden when the Image has been created by SIMDRAW You may need to create your own object derived from some graphical object but you need your new object to have all of the information set in SIMDRAW This is accomplished using the Associate method The Associate method copies all of the data set by SIMDRAW into the user defined object It will also automatical
214. tio is specified using the Set Ratio ASK method The ratio is given as width height ASK fixedcursor TO SetRatio 2 0 FixedCursorObj The FixedCursorOb j is used to draw a fixed rectangle with its lower left corner placed at the current mouse position The size of the rectangle is specified using the Set Size method ASK fixedcursor TO SetSize width height DualLineCursorObj The DualLineCursorObj is used to draw two rubber band lines from two anchor points to the current pointer position The second anchor point is specified using the SetDualAnchor method ASK duallinecursor TO SetDualAnchor x y C 2 Using System Cursors An hour glass stop watch etc can be displayed instead of the system cursor See the mod ules Form and Window The following field and method are new in both the WindowObj and DialogBoxOb j objects SysCursor SysCursorType Current system cursor type ASK METHOD SetSysCursor IN cursorType SysCursorType Changes the system cursor used when the pointer is within this window or dialog box See GTypes for a list of supported cursor types To use the system cursor ask each window or dialog box to SetSysCursor 152 Appendix C Cursors FROM GTypes IMPORT ALL SysCursorType ASK win TO SetSysCursor BusyCursor ASK db TO SetSysCursor BusyCursor ASK win TO SetSysCursor NormalCursor ASK db TO SetSysCursor NormalCursor 153 SIMGRAPHICS II User s Manual 154
215. to organize an image hierarchically is a powerful feature and can be used in a variety of ways First it can be used to break an object down into its subcomponents Sup pose you wanted to depict an image of a shopping cart This cart could be broken down into a body a front wheel and a back wheel You could use a hatched polygon for the body and circles for the wheels The image tree for the cart would look something like this 61 SIMGRAPHICS II User s Manual body front wheel back wheel Figure 5 1 Image Tree for a Grocery Cart Another way of using an image tree is for simple grouping Suppose you had created a number of these carts You could group them together into a common image called carts Since any operation performed on an image is automatically performed on its children this grouping would prove useful to you if you wanted to do something to all carts at once like erase move or scale them Grouping can also be used as an organizational conve nience The image tree that groups the carts looks like this Carts Cart 1 Cart 2 Cart 3 Cart n body front wheel back wheel Figure 5 2 Grouping of Grocery Carts The image tree is also used to describe the entire model Suppose we were modeling a gro cery store Within the model we wanted to show shopping carts checkout counters and grocery aisles The carts counters and aisles would simply be children of their grocery store image Grocery Store
216. ts or simple plots of 2 D data Charts have one x axis one or two y axes data sets a title and an optional legend 2 14 3 1 Modifying Chart Attributes To modify the title legend display or any attribute of the chart itself select the the title Then use the Edit Properties menu option The Chart Detail dialog box will be displayed It contains the following information Library Name The name used to load the chart into your application program Title The title shown on the top of the chart Axes on Edges If checked numbering and tic marks will be forced to appear on the edges of the plot area For better visual reference two extra axes will be drawn on both the top and right sides of the plot area Time Trace Plot Setting this item implies that the chart is a time trace plot Whenever a variable being monitored by the chart is modified its new value is plotted along the Y axis and the current simulation time is plotted along the X ax is Show Legend Chart will show a legend below the plot area The fill style and color of each data set is shown preceding its name Show Border A chart can be defined to draw a rectangular background under neath Data Sets A data set can be added using the Add button or removed by selecting its name in the list box and then pressing the Remove button To change the name of a data set select its current name in the list box and then press the Edit button see Attrib
217. u pane Items can be deleted without changing the clipboard by using the Edit Delete option The clipboard is shared among all active Menu Bar Editor sessions You can copy graphics from one menu bar into another by activating the source edit window using the Copy op tion and then activating the destination editor and using the Paste option Note The menu bar itself can never be cut copied or deleted It can however be selected for the purpose of changing its properties 2 16 3 Editing the Menu Bar File Edit E The menu bar is not movable or resizeable but using the Edit Properties menu option you can modify the Library Name of the menu bar 2 16 4 Editing a Menu T PITT HKH You can add menus to the menu bar or other menus by dragging and dropping The menu s pane can be displayed or hidden by clicking on its text label within its container A menu is defined by the following parameters e Reference Name ld Any menu added to the menu bar or another menu can be accessed from inside an application by specifying a Reference Name and or Id Label The name identifying the menu which appears within the container menu bar or menu e Mnemonic A letter in the menu s label that can be typed from the keyboard while holding down the Alt key to bring down the menu pane The mnemonic character will appear underscored in your application 39 SIMGRAPHICS II User s Manual 2 16 5 Editing a Menu Item item
218. umn headers scroll in the horizontal direction but remain fixed vertically referred to as row 0 The row headers are a column of cells attached to the left side of the table which scrolls in the vertical direction only referred to as column 0 Cells for the column and row headers can be selected and defined just like cells in the table con tent area The user can use the keyboard arrow keys left right up down to navigate through a table Each time focus is changed to a different cell using the arrow keys the method will be called If the VerticalGrow option is turned on and the DOWN arrow key is pressed when the focus is on the last row in the table a new row will automatically be added to the table At this time the BeExpanded method is called to inform the program that the table has increased in height If a non arrow key is pressed when the focus is on a table cell the Keypress method is called This method can then be used to change focus to a text box allowing you to set the text of the selected cell without the user having to use the mouse The following code can be used to aid in implementing a mechanism for allowing a user to easily set the contents of a table OVERRIDE the Keypress method on a TableObj ASK METHOD Keypress IN in keyPressed STRING BEGIN ASK textbox TO DisplayText keyPressed ASK textbox TO ReceiveFocus END METHOD OVERRIDE the BeSelected method on the TableObj ASK METHOD BeSelected BEGIN
219. untime create a body primitive NEW body ASK body TO SetPoints bodypoints ASK body TO SetColor Yellow ASK body TO SetStyle SolidFill create a wheel primitive NEW wheell ASK wheell TO SetColor Green ASK wheell TO SetStyle MediumDiagonalFill ASK wheell TO SetPoints wheelpoints make a copy of it wheel2 ASK wheell TO Copy now build the tree and add it to the root j NEW cart ASK window TO AddGraphic cart ASK cart TO AddGraphic body ASK cart TO AddGraphic wheell ASK cart TO AddGraphic wheel2 set position of wheels in relation to their parent ASK wheell TO SetTranslation 2000 0 0 0 ASK wheel2 TO SetTranslation 8000 0 0 0 Draw the cart ASK cart TO DisplayAt 16383 0 16383 0 LOOP HandleEvents TRUE END LOOP END MODULE 161 SIMGRAPHICS II User s Manual 162 Appendix E Animation Speed Optimization SIMGRAPHICS II is designed for fast and smooth animation It contains some features that can be used to obtain even faster animation Certain rules can also be followed to ob tain maximum performance E 1 Real time Animation Mode A real time animation mode has been added to provide faster smoother animation during a simulation The time taken for each animation movement is compared to the elapsed wall clock time if the simulation begins to fall behind graphical updates are skipped as required to keep up To invoke real time animation F
220. urface data sets only Makes bars thinner so that gaps can be seen in betweenin between them Should be TRUE for bar charts The de fault value is FALSE ChartDS Y2Axis If TRUE this data set will belong to the second right Y axis In this case Y coor dinate values passed to the SetCoordinate and Plot methods should fall with in the Y2 axis boundaries If this option is FALSE for all data sets then the right Y axis is not shown The default value is FALSE ChartDS Interpolate Applies to surface charts only If TRUE successive data points are connected by a straight line Otherwise a horizontal line will fill the gap This line is positioned vertically at the leftmost data point The default value of the option is TRUE ChartDSFill ChartDS Line ChartDSMark These options determine which primitive types to use in showing the data set Usually only the fill option is enabled for histograms and bar charts The default value for FillOption is TRUE and for LineOption and MarkOption itis FALSE 7 7 10 Setting Chart Fields The chart fields are values of type REAL defining various intervals and boundaries pertain ing to the axes Numbering tick mark and grid line intervals are expressed with respect to the range implied by the axis boundaries The item is not be displayed if the interval for an item is zero The SetAxisField method given below modifies a particular field in the chart The fields available are described by the ChartFieldType
221. ursor is an object de rived from Imageob j that tracks with the mouse A system cursor can be the normal sys tem pointer or a busy cursor such as an hourglass or watch C 1 Using Canvas Cursors Since a canvas cursor is an object derived from ImageObj any object can be used as a cursor If a window s MoveMonitoring flag is set this cursor will automatically move with the mouse pointer If the MonitoringClicks flag is set the cursor will appear at the pointer position every time the mouse button is pressed The SetCursor method is used to set the cursor of a window Any object derived from ImageOb j can be used as a cursor However the Cursor mod ule contains several predefined cursor objects derived from PolylineObj that provide for efficient rubberband cursors The line cursor is the simplest of them It draws a line from an anchor point to the current cursor position The following code sets the anchor point for the line cursor and initiates tracking FROM Cursor IMPORT LineCursorObj VAR linecursor LineCursorObj NEW linecursor ASK linecursor TO SetAnchor WorldXlo WorldYlo ASK window TO SetCursor linecursor Note User defined cursors must be attached to a window or image tree before being set as the window s cursor However the special predefined cursors should NOT be attached to a window or image tree This is because the special cursors bypass the standard graphics library to perform drawing and therefore can not be s
222. us producing any desired level of depth Menu option keyboard accelerators and mnemonic keys can be defined Palettes are built with the Palette Editor for receiving simple command input They can be initially docked on any edge of the window or can be floating A palette contains palette buttons and separators Simple message boxes can be defined which will allow you to inform warn or ask a ques tion of a user 2 2 Running SIMDRAW SIMDRAW can be started from within the MODSIM III Workbench or from the command line Upon execution a main window containing a palette and toolbar is displayed figure 2 1 The window will contain a listing in the currently loaded SIMGRAPHICS II library The palette on the left is used to add new objects to the library SIMGRAPHICS II User s Manual amp Dialog Box Ar Graph Image menubar E H ER Palette Figure 2 1 Main Window 2 3 Loading and Saving SIMGRAPHICS II Files The File Open menu option will load an existing SIMGRAPHICS II library file and show its objects in the list window Use the File Save or File Save As menu option to save all objects shown in the list window including objects being edited Use the Options Binary File menu option to toggle between saving the file in ASCII or binary format 2 4 Editing an Existing Object To edit one of these objects select its name in the listing and then use the Edit Properties menu opti
223. utes of a Data Set Handling of Multiple Data Sets If stacked all discrete data sets will be stacked on top of each other In other words the value plotted in a data cell is reflected as the height of the bar not its top Therefore stacking means that the bottom of a SIMGRAPHICS II User s Manual cell in data set n is equal to the top of the same cell in data set n Le higher num bered data sets are stacked onto the lower numbered ones 2 14 3 2 Modifying the X Axis To change the range numbering interval or any other property associated with the X axis first choose the axis or one of its components double click on the axis or choose the axis or one of its components and use the Edit Properties menu option The X axis has the following properties Title Label for X axis displayed below numbering Rescaleable Specifies whether the X axis will be re numbered scaled when one of the data points extends beyond its limit In this case the Compress Data item determines whether a scrolling window is used and whether old data is dis carded or the range of the graph is to be expanded showing all data Note that re scaling may modify the tic mark numbering and grid line intervals to maintain a similar visual representation of the chart If this item is not checked data points falling beyond the limits of the X axis will be discarded Show Grid Lines If the this item is on grid lines will be shown crossing
224. window or an image object before drawing or up dating 176 Appendix H Runtime Graphics Errors GRAPHICS ERROR 215 Attempt to replace a NIL object Only non nil objects may be replaced GRAPHICS ERROR 216 Attempt to re associate object You must disassociate an object before associating it again GRAPHICS ERROR 217 Object not associated Object which you are trying to disassociate has not been associated GRAPHICS ERROR 218 Attempt to save to a NIL library You must create an instance of the library by performing a NEW before saving it GRAPHICS ERROR 219 Attempt to load from a NIL library You must create an instance of the library by performing a NEW before saving it GRAPHICS ERROR 220 Object not found in library Make sure the object name you pass to LoadFromLibrary isinthe library GRAPHICS ERROR 221 Library object of wrong type Make sure the type of object asked to LoadF romLibrary matches the type of object created in SIMDRAW Also make sure that you perform the INHERITED Ob jInit for any graphic objects which have Ob jInit overridden otherwise the object type is not defined GRAPHICS ERROR 222 Image s tree not attached to window An icon s parent or ancestor must be attached to a window before the icon is drawn or updated GRAPHICS ERROR 223 Image not attached to tree An icon must be attached to a window or an image before drawing or updating it 177 SIMGRAPHICS II User s Manual GRAPHICS ERROR 224 Image s window no
225. workstations MOTIF dialog boxes are used on Microsoft Windows sys tems Windows dialog boxes pull down menus and palettes are produced All elements of the MODSIM III graphics library are portable which means if you take a MODSIM III graphics program which runs on one system and move it onto a new system it will run without modifying any code The forms will change their appearance to conform to the new system they are running on The images and graphs will have the same appear ance as on the previous system 1 1 SIMGRAPHICS II Environment The world in which SIMGRAPHICS II lives can be described in terms of a screen and win dows The computer screen can have multiple windows Each window can contain images graphs and forms The windows are provided by the system and can be moved and resized When the window is resized its contents always maintain the same height to width relationship or aspect ratio Graphic images created in the editor can be placed inside the window The images can be used to provide a background or they can be animated Each window can have a menu bar for making menu selections and multiple dialog boxes for accepting input of various types such as numerical values yes no responses and text Windows can also contain palettes for changing modes or selecting operations 1 2 Interface Since MODSIM III is an Object Oriented Language the graphical interface is implemented using objects Images graphs and forms
226. world coordinate into Earth coordinates Transform NILOBJ earth mouseX mouseY earthPt x earthPt y 171 SIMGRAPHICS II User s Manual 172 PROCEDURE SnapShotFileExtension STRING Returns the extension of a SnapShot raster file in the form xwd bmp etc depending on which toolkit the host machine is running under PROCEDURE Is3DGraphicsAvailable BOOLEAN Returns TRUE if 3 Dimensional Graphics is available The machine must support the OpenGL Graphics library in order for SIMGRAPHICS II 3 D support to func tion PROCEDURE SetFrameTitle IN title STRING Sets the title displayed on the frame window This procedure will reset the title dis played on the header bar of the frame window The procedure can be called before or after the frame window has been made visible and will automatically update the title PROCEDURE SetFrameIconNames IN smallIconName largeIcon Name STRING Sets the icons used when the frame window is minimized If the application con tains a frame and sub windows this procedure will identify either the resource or bitmap file names of the icons representing the minimized application PROCEDURE SetFrameTranslation IN tx ty PctType If the application contains a frame and sub windows this procedure will specify the initial position of the lower left hand corner of the frame window Position is spec ified in screen coordinates where the lower left hand corner of the computer screen
227. y one eee eae ate 82 VABUE BOX EHE 8 13 PROGRESS BAR 8 14 List BOX AND List Box ITEM 8 15 RADIO Box AND RADIO BUTTON c EE 8 16 TREE VIEW CONTRO Deed iater baee ra ee ea atcha sot a b Ee dE 847 EABEEOBJA tuens torva dvecectes tens Dre don E gt d Glawel dv pv aud ube do dau a e 8 118 COMBOBOXOB lit dida ru Von exar E 8 19 MuLTILINEBOXOBJ 8 20 TABLEOBJ 8 21 CALLING BESELECTED F FOR THE E TEXTBOXOBJ VALUEBOXOR AND gt COMBOBOXORJ 8 22 DIALOG Box 8 22 1 User controlled Dialog Box Fonts D 8 22 2 Tabbed Dialogs 8 22 3 Dialog Box Example Program 8 22 4 System File Browser Dialogs 8 22 5 System Font Dialog t ele And de ee a etae te ag a ete dad 122 SIMGRAPHICS II User s Manual 8 23 ALERT BOXES 8 24 1 Mnemonics 8 24 2 Check Uncheck Menu Options 8 24 3 Accelerators 8 24 5 Cascadable Menus 8 24 6 Popup Menus Appendices TEL RS Appendix A Common Pitfalls B 3 OBJECTS USED B 4 COMBINING 2 D A AND 5 3 D GRAPHICS B 5 3 D PRIMITIVES ee B 6 TIPS FOR 3 D SIMULATION B 7 EXAMPLE 3 D GRAPHICS PROGRAM PETENS Appendix C Canvas and System Cirsors D E e Sut tas o id toc C 1 USING CANVAS CURSORS ccooccccoccnconononcnnncnnonanancnono nono sesueuuee see eeuaeauaeeeeeeueuacesseeeauaeanceeeeanaeananes 152 155 C 2 USING SYSTEM CURSORS sbi Appendix D Creating Images at Runtime Dl OBJECTS anal bici DE Lonn EAA N E
Download Pdf Manuals
Related Search
Related Contents
traitements de contrôle des populations de tordeuse des bourgeons Guía del Usuario Télécharger - Ducatillon キャプチャーフード風量計 計測ソフトウェア 取扱説明書 Ley Contra la Usura - Banco Central de Reserva Untitled - Commrider 取扱説明書(応用編) Philips GOGEAR SA1916 User's Manual 08 MBE 4000-1 Rev Copyright © All rights reserved.
Failed to retrieve file