Home

esim User Manual Supplement 7.0

image

Contents

1. GRAPHIC DISPLAY INTERMEDIATE OBJECT update BUFFER lt updateAll updateOnRequest mode any change updatelmmediately mode updateForBuffer 3 updateAllForBuffer 3 any change buffer1 buffer2 buffer3 active updateOnRequest mode updatelmmediately mode t copyBuffer copyAreaOfBuffer copyStatusOfBuffer NOTE Changing the active buffer see Setting and Getting the Active Buffer on p 12 46 resizing the buffer s clipping rectangle or relocating the clipping rectangle on the buffer or on the graphic display see Clipping Rectangles on p 12 47 also initiate an update of the intermediate buffer e Intermediate buffer This buffer exists for every graphic display It is always the same size as the graphic display All changes to the graphic display appearance are implemented first on the intermediate buffer If the graphic display is in updatelmmediately mode the changes to the intermediate buffer appear automatically and immediately on the graphic display itself If the graphic display is in updateOnRequest mode changes to the intermediate buffer appear on the graphic display only after calling one of the update functions shown in the schematic e User defined buffers buffer1 buffer2 buffer3 These buffers exist because they were defined in the graphic display s More and or Advanced dialog boxes see Defining Buffers on p 12
2. Note the checking of the return value of routeEvent If routeEvent returns FALSE it means that the recorder intercepted the event and wants to prevent it from happening In that case the Bean object should not trigger the event nor increment the counter Step 4 Implement injectRoutableValue Now you need to implement the injectRoutableValue method in order to play back recordable events Again the RapidRoutingSupport class provides methods to analyze the received event You can extract the event description and one of its arguments if it has arguments In the case of Bean object we need to check for one event type the clicked event Here is the code that checks for it Inject a routable value This should cause the receiver to trigger a change in state identical to that caused by an event that generated the routable value USING JAVABEANS IN RAPIDPLUS 19 18 A new routableValue event should not be fired param value java lang Object public void injectRoutableValue Object value extracts the event description String desc RapidRoutingSupport extractDescription value handle the clicked event if desc equals clicked fireAction simulate push button click That s it The Bean object now fully supports one recordable event clicked The button is fully usable for scenario recording just like a regular RapidPLUS button Step 5 Compare the
3. o ooo oo 18 33 Communicating with DDE Objects ooo oooooo ooo 18 33 Properties Methods and Events o oo e e e 18 34 POPE la o ne Eros 18 34 MED it a e TA EN RA A at A BN 18 38 EVEN iia ia A e ee he Dl a gd a has 18 46 CHAPTER 19 USING JAVABEANS IN RAPIDPLUS 19 1 Integrating JavaBean Objects into RapidPLUS o ooo oooooo o 19 2 The Search Path for JavaBean Objects o o ooooocoo ooo e 19 2 Adding a JavaBean to RapidPLUS 0 0 000000 o 19 3 Registering a JavaBean in RapidPLUS o oo oooooo ooo o 19 4 Windowed vs Non Windowed JavaBean ObjectS o o oooooo oo 19 4 Logi for JavaBean Objects imita Saag A A Be a PAR 19 6 Supported JavaBean Types ee ee ee 19 7 PLOPOLHES 2 oa nce a A E e da 19 9 FUNCIONS ee tir AE Y A A Ar ES a fants a DEA 19 10 Events AA AS o A EDESA Daren A 19 11 Using the BeanInfo Class to Define the Logic Interface of JavaBeans 19 12 Checking the Running Status of JavaBean Objects o oo ooo ooo oo 19 13 Step 1 Implement BeanContextChild o oooocoocoo oo 19 13 Step 2 Supply a BeanContext Object to Query Status o o ooo oo 19 13 xiii xiv CONTENTS Implementing Recordable Events for JavaBean Objects o o ooooo 19 14 Step 1 Implement RapidAccessible o ooo oo
4. 49 Logging Application Execution 2 2 ee ee 4 10 Enabling and Viewing the Log ee ee ee e 4 10 Understanding the Logger Icons and Descriptions 4 4 12 Configuring Log Data oc a ie Sete a ae ae eee eter 4 16 Managing Logs as a ls a get PEL tine Cnet ld Matt Sets AG oto A ad N 4 21 Navigating with the Logger ee eee 4 22 Log Usage Examples iio acs hae ha es gee A Geet a s Hach a so ale Ma he oe es BA a ae 4 23 Tracing a Bug in the Application Logic Flow ooo oo 4 23 Mery High CPU Usage ue odie 1 ob Be a Oe Ee CA en Bo ints A 4 24 Using the Call Stack o gt esa sig eee sw EE is 4 24 Viewing the Call Stack 2 ee eee 4 24 Examining the Logic Location 2 2 0 eee ee ee ee 4 26 Activating a Stack Frame 1 ee ee 4 27 The Inspector Window se ase erage a eo A RE ee Pe ee ed ere a ee 4 27 Opening Inspector Windows 2 2 0 2c ee ee ee 4 28 Navigating Opened Inspector Windows 0 0 0 0 0020 e eee 4 29 Closing Inspector WindoWS ee ee 4 30 vi CONTENTS CHAPTER 5 LOGIC ERROR VIEW 2 4525 4 veses rr ea RY 5 1 Examples of Irivalid Logie 6200 Pees Pee a A es a RRL a ae Es eee 5 2 Viewing Invalid Logics sacas bee ocios eae E R eRe bee 5 4 Reverifying Logic tna di eo date a hte CE Bt We Se Bnd pean a ees 5 6 CHAPTER 6 PASTING OPERATIONS o o eee ao 6 1 Elements You Can Cut Copy and Paste 2
5. RAPID APPLICATION CDPLAYER 01 30 03 11 03 08 AM Modes Tree Report electricPlugln l gt power0ff iD gt powerOn noDisk D gt diskIn gt operate C gt stop D l gt run gt play D gt paused gt display C gt remain D gt lap To generate a Mode Tree report 1 In the Mode Tree select the mode for which you want to generate a report or you can type a mode name in the dialog box If you want a report about all of the application s modes select the root mode 2 Inthe Application Manager choose Reports Modes Tree the Mode Tree Report dialog box opens 3 Click OK the Report Viewer opens displaying the mode s hierarchy You can print or save the report as explained in Working with Reports in the Report Viewer on p 25 3 MODE REPORTS 25 13 Mode Data Report This report is an ASCII text file that summarizes mode information A typical report as viewed in the Report Viewer looks like this A Mode Data Report for CDPLAYER lol x File Edit Help Br RAPID APPLICATION CDPLAYER 02 02 03 12 48 20 PM Mode Data Report Parameters Scope Subtree Order Hierarchy Includes Transitions Triggers Actions l MODE operate 2 MODE stop Transitions a Destination run Entry type Default al Trigger play_Pb in amp 3 MODE run Transitions a Destination stop Entry type Default To generate a Mode Data report 1 I
6. This is a screen font The closest matching printer font will be used for printing 13 12 BITMAP IMAGE AND FONT OBJECTS 2 Select the font style size and script for the font object and click OK The Font Object dialog box displays the new settings NOTE Selection of an appropriate script is essential for multi lingual support See Language on p 10 43 for details Creating a font gallery If you intend to use a variety of fonts in your graphic displays either within a single language or because you plan to switch among languages you may want to consider creating a nongraphic user object that acts as a font gallery It would work something like this 1 In the Object Layout add a graphic display to be deleted later and then create a font object for each required language and or font style In the Function Editor create an exported function for each font object The purpose of the function is to set the font object as the active font for any graphic display For example if you added a font object called ArialBold10 you would then create an exported function called setArialBold10For lt Graphic_Display Display1 gt whose logic is lt Display1 gt fontSet ArialBold10 After you have finished creating the series of exported functions go back to the Object Layout and delete the graphic display In the top panel More dialog box click Registration and register the user object in the display ob
7. 18 12 Example of Getting Data Initiated by the Host Document 18 12 Getting Data Initiated by the RapidPLUS Simulation 18 14 Procedure for Getting Data Initiated by the RapidPLUS Simulation 18 15 Example of Getting Data Initiated by the RapidPLUS Simulation 18 17 Sending Data to the RapidPLUS Simulation o ooo o 18 19 Procedure for Sending Data o ooo e e e e 18 19 Example of Sending Data ooo o e 18 20 Sending External Actions to the RapidPLUS Simulation 18 22 Modifying the Rapid Simulator to Accept External Acti0NS 18 23 Modifying the Host Document to Send External Actions 18 23 Setting the Rapid Simulator s Routing Mode o o oo oo ooo ooo o 18 24 Setting the Routing Mode 0 0 0 eee ee eee 18 25 Monitoring User Actions in the RapidPLUS Simulation 18 26 Getting User Actions from the Simulation 0 18 26 Modifying the Host Document to Monitor User Actions 18 27 Displaying User Actions in the Host DocuMeNt o ooo oo oo oo 18 28 Rerouting User Acti0MS o 18 29 Modifying the Host Document to Respond to User Actions 18 30 Controlling the Rapid Recorder o ooo ooo o e e 18 32 Controlling the RapidPLUS Simulation s State
8. FUNCTION pullColumns From lt integer gt to lt integer gt DESCRIPTION Removes the columns between the specified points The columns after the pulled section move left to close the gap A series of new columns is created at the end of the array containing the initial value defined in the Object Layout The array size does not change pullRowsFrom lt integer gt to Same as the function described lt integer gt above except it works on the rows pushColumns Moves the columns between the From first specified point and the end of lt integer gt the array to the specified column to lt integer gt A series of new columns is created in the vacated space containing the initial value defined in the Object Layout Any columns pushed beyond the end of the array are deleted The array size does not change pushRows From lt integer gt to lt integer gt Same as the function described above except it works on the rows 26 11 EXAMPLE See Usage Examples on pp 26 13 to 26 16 searchFor lt value gt inColumn lt integer gt Returns the row index if a match is found for the specified value in the specified column Otherwise returns 0 See Usage Examples on pp 26 13 to 26 16 searchFor lt value gt inColumn lt integer gt fromRow lt integer gt toRow lt integer gt Returns the row index if a match is found for the specifie
9. The following instructions apply to all nongraphic objects To add a nongraphic object to the Object Layout 1 Select the object you want to add To do so either Choose Objects Add then select the object from the New Objects list Or From the Object Palette select an object class in the left column and the object in the right column ADDING NONGRAPHIC OBJECTS 10 3 2 A dialog box like the one shown below opens A sample dialog box for adding a nongraphic object a To change its name overtype the default name in the Name box b To change its value click the More button to open the object s dialog box Refer to each object s section in this chapter for an explanation of its parameters c Click OK The Nongraphic Objects Icon After you have added a nongraphic object the nongraphic objects icon appears in the top left corner of the layout frame If this icon is hidden behind a graphic object you can show it as follows To show a hidden nonngraphic objects icon 1 Select the graphic object that is hiding the icon 2 Place the cursor in the upper left corner where the icon is located then press the Tab key the icon is selected 3 Choose Layout Order Bring to Front NONGRAPHIC OBJECTS 10 4 MANAGING NONGRAPHIC OBJECTS Once you have added a nongraphic object to the layout you can rename edit copy duplicate delete or replace it using the Nongraphic Objects dialog box You can a
10. Browse m Embed in Rapid format Embed in its original format Help Link to file Y Clip The Image Management and Clip options are described on the previous page IMAGE OBJECT 13 5 Lower section of the Image dialog box m Image manipulation A Cumulative changes Non cumulative changes 7 Logic Editor order Ei Predefined order Properties Advanced Setting the Image Manipulation Mode The default manipulation mode is Cumulative changes In this mode each manipulation changes the image and redraws it in its modified state Each additional manipulation is performed on the last redrawn image In other words the very first manipulation modifies the original image the second manipulation modifies the modified image the third manipulation modifies the modified image resulting from the second manipulation and so on There are also two non cumulative manipulation modes In these modes manipulations are always performed on the original image The original image is kept intact as well as a list of all the relevant preceding manipulations This list is updated by each additional manipulation as explained in the next paragraph Each time the list changes RapidPLUS applies all the manipulations on the list to the original image then redraws the resulting image The list of manipulations is updated differently for the quantitative functions set change and rotate and the
11. HOST DOCUMENT PROCEDURE Microsoft Word Exit Design mode Microsoft PowerPoint Run the slide show Authorware Run in the Presentation window ToolBook II Run in the Viewer Viewing the RapidPLUS Simulation in a Browser In the RapidPLUS Document Manager generate the simulation as an HTML file and then view it by choosing File View The simulation will open in your default browser Refer to the Generating Documents manual for details about working with the Document Manager USING A RAPID SIMULATOR OBJECT 18 9 Resizing the RapidPLUS Simulation There are several ways to resize the simulation During Design Mode Using the sizing handles 1 Re enter Design mode the simulation does not appear in Design mode 2 Use the sizing handles to change the object s size Using the ActiveX Properties list e Ifthe host application has Height and Width properties for its ActiveX controls use them to resize the RapidPLUS simulation Using the host document s programming language e Use the following properties in the host document s programming language e g Microsoft Visual Basic WindowHeight WindowWidth These properties are for resizing a Rapid Simulator in stand alone view during runtime During Runtime You can only resize the window during runtime when the simulation is in Stand alone view with borders so that you see the Reviewer window e Use the sizing handles or e The Reviewer window s Contro
12. 10 35 El Timer The timer object counts down from an initial value and stops when it reaches zero generating the event tick The timer can be paused before it reaches zero in which case it resumes counting from where it was interrupted when started again The timer can also be reset in which case it starts counting from the initial value when started again The timer also has a restart function so that when it reaches zero it generates a tick event then starts at the initial value once again Use the Timer dialog box to set the initial count value and the counting units Timer Timer1 Ea Initial Value Units 10 Initial counting value in the Prototyper an integer tlk Stopwatch The stopwatch object counts up from zero in the selected time units and generates an event tick as each time unit passes by It can be stopped then restarted from either its current time value or the initial time value The stopwatch s value i e the elapsed time can be read at any time NOTE If the stopwatch is counting in milliseconds the tick is not generated Use the Stopwatch dialog box to select the counting units Cancel zl Help NONGRAPHIC OBJECTS 10 36 Date The date object allows you to set a date and display it in an application Date Date1 Ed Format Gomy Ej MbY 7 YMD Day Name None y Month Name E y Help Cancel d m Day Leading Zero Separato
13. Font FUNCTION DESCRIPTION EXAMPLE i Assigns the attributes of one font SActiveX1 font property to another font property ActiveX2 font Returns TRUE if the font properties amp ActiveX1 font have the same properties ActiveX2 font boldGet Returns 1 if the bold attribute is set O Intl ActiveX1 font if not boldGet boldSet Sets the font to bold 1 or non bold ActiveX1 font boldSet lt integer gt 0 ActiveX2 font boldGet charsetGet Returns the font character set Int1 ActiveX1 font according to the following charsetGet enumeration ANSI_CHARSET 0 JOHAB_CHARSET 130 DEFAULT_CHARSET 1 HEBREW_CHARSET 177 SYMBOL_CHARSET 2 ARABIC_CHARSET 178 SHIFTJIS_CHARSET 128 GREEK_CHARSET 161 GB2312_CHARSET 129 TURKISH_CHARSET 162 HANGEUL_CHARSET 134 THAI_CHARSET 222 CHINESEBIGS_CHARSET 136 EASTEUROPE_CHARSET 238 RUSSIAN_CHARSET 204 MAC_CHARSET 77 charsetSet Sets the font s character set according ActiveX1 font lt integer gt to the enumeration shown above charsetSet 161 italicGet Returns 1 if the italic attribute is set O amp ActiveX1 font italicGet if not 1 italicSet Sets the font to italic 1 or non italic ActiveX1 font italicSet 0 lt integer gt 0 nameGet Returns the font name as a string Str1 ActiveX1 font nameGet SUPPORTED ACTIVEX DATA TYPES 17 13 FUNCTION DESCRIPTION EXAMPLE nameSet Sets the font name to the specified ActiveX 1 font nameSet lt stri
14. If the Prototyper is running and you select a project component that is not already in edit mode the selected component opens in read only mode This is indicated by the Edit button next to the Project Components list becoming available If you click the Edit button the selected component opens in edit mode and only then does the Prototyper stop running MANAGING PROJECTS OPENING A PROJECT When you open an application RapidPLUS treats it as a project It scans the interfaces of all the components to see if any updates are required Updates are needed when changes made in the individual components affect their interfaces to the parent applications refer to Changing a User Defined Object that is Part of an Application on p 19 21 of the Rapid User Manual When RapidPLUS detects mismatches it automatically updates the interface Mismatches that generated error messages are available in a report that you can print and save Automatic Interface Updates RapidPLUS uses the following rules to make the needed interface changes in the parent application e Exported properties and functions that exist in the user object interface to the parent application but not in the user object are removed from the interface The logic is re evaluated and where necessary commented out Otherwise this process is transparent to the user e Exported properties events and functions that were modified in the user object but not in it
15. 3 9 Going to an Item Selected in the Differencing Tool 3 You can select an object mode or logic statement in one of the panes and then go to the selected item in the application that is currently open in RapidPLUS If the item is in an application that is not currently open in RapidPLUS the Go to operation is unavailable To open the application choose Edit Edit Left Right Application or click the Open Application button To go to an item in the open application 1 Select the item you want to go to You can select an object or mode in the upper pane or a logic statement in the detailed information pane 2 Right click to open the popup menu and choose Go to or click the Go to item button The corresponding window opens either the Object Layout Mode Tree or Logic Editor and the item is selected In the following example the Differencing Tool is in Modes view A mode was selected and the Go to button was clicked The Mode Tree opens with the same mode highlighted ES Mode Tree CDPLAYER Al x File Edit Tree Logic Help oleja xas lE a Differencing Tool Fie Edit Filters Browse Report Help ala 5 ial e a Cdplayer C RAPIDSAPPLICS CD_PLAYER CDPLA pelectricPugOut Revision 30 21 07 03 11 06 43 electricPlugln powerD ff power n Project Modes Objects User Funct diskIn El Cdplayer operate electricPlugOut D stop El electricPlugln tun powerDff D
16. A user action is placed in a queue awaiting a response either an acknowledge or a deny event For example if a student has pressed a switch in the RapidPLUS simulation and the host document detects that it is the wrong switch for the given task the host document will deny the user action This means that from the student s point of view the switch does not respond to his or her mouse click The host document could also provide some form of message such as a beep or an error message 18 30 HOSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS Rapid Simulator Host Document Rapid simulation User Action User action sent to host Acknowledge or deny response sent to simulation Flow of user actions in reroute mode When the queue contains one or more actions the simulation does not send notifications about additional user actions until the first action receives a response Modifying the Host Document to Respond to User Actions In order to respond to user actions both the Rapid Simulator and the host document must be modified 1 Set the Rapid Simulator s routing mode to Reroute see p 18 25 for instructions 2 In the script add the UserActionFired event and a response value RapidSiml_UserActionFired ByVal objectName As String ByVal propertyName As String ByVal eventName As String ByVal time As Single ByVal id As Long response As Long response lt Acknowledg
17. GENERATING REPORTS 25 32 TAG _methodFixed desti nationID DESCRIPTION ID of the destination mode when the compiled method is a trigger of a non internal transition 0 for an internal destination _methodFixed holder ID of the method when it is a user function see RPSubroutineHolder Element below RPSubroutineHolder Element This element contains definitions of all user functions in the application It contains several types of information including a collection of compiled method elements one for each user function the compiled code and a pointer to the user function s source code which is stored in an RPSource element It also contains these nested tags TAG DESCRIPTION _descriptors Number of user functions in the application count _oper Name of the user function _verbId ID of the user function linked to the _method Fixed holder tag described in the previous table _numArgs Number of arguments that the function accepts classKey Type class ID of the argument or return value There is one classKey tag per argument and one for the return value The return value is always the last classKey tag in the group XML REPORTS Following the Path from a Mode to Its Logic Although the XML code appears long and unwieldy it is actually not difficult to follow the path from a mode element to its source code that is the code as it appears in the Logic Editor The f
18. HOW ACTIVEX INTERFACES ARE CONVERTED TO RAPIDPLUS LOGIC When you register or add an ActiveX control to RapidPLUS its interface of properties methods that is functions and events is translated into RapidPLUS logic equivalents Its custom commands or verbs if any are translated into menu commands in the Object Layout The following diagram summarizes the translation process 17 16 USING ACTIVEX CONTROLS ACTIVEX CONTROL INTERFACE PROPERTIES BINDABLE RAPID OBJECT LOGIC PROPERTIES usable in that is notify when condition triggers amp the property changes mode activities not usable in NONBINDABLE condition triggers amp mode activities INDEXED FUNCTIONS METHODS with Rapid compatible FUNCTIONS parameters EVENTS EVENTS EVENTS EVENT PARAMETERS EVENT PROPERTIES RETURN VALUE EVENT PROPERTY_Return VERBS Menu commands in the Object Layout HOW ACTIVEX INTERFACES ARE CONVERTED TO RAPID L Properties There are three types of ActiveX control properties Bindable that is they notify the container in our case RapidPLUS when their value has changed Nonbindable that is changes to their values are not broadcast to the container Indexed that is an array like proper
19. When a data object is a property of another object RECO TOTOBIECE it will have a _locallId tag containing a unique index of the data object within the properties of the containing object Also the parent of the data object will be the containing object AXGraphicWrapper Tags for ActiveX objects AXNonGraphic Wrapper JBGraphicWrapper Tags for JavaBean objects JBNonGraphic Wrapper Nested elements that apply to the root object These elements apply only to RPTopPanel which is the element for the root graphic object TAG DESCRIPTION _displayList List of all visible graphic objects in the application sorted by their Z order from the bottom most to the top most Included in the list is the graphic for the Nongraphic Objects Icon _subroutines IDREF to the element that defines user functions see RPSubroutineHolder Element on p 25 32 XML REPORTS 25 29 Nested elements that apply to application object elements TAG DESCRIPTION _parent IDREF to the application object that is the parent of this object _children List of application objects that are children of this object Contains the following nested tags count number of children _ children for each child object an IDREF to the child _properties List of the object s properties This tag contains a nested count tag with the number of properties followed by a tag for each property _name Name of the object _notesHandle ID of
20. deactivateAny COMMENTS An activity that deactivates any active message structure in the union no error occurs if the function is called while there is no currently active structure Syntax UserObject1 Union1 deactivateAny anyMessage Received An event triggered automatically at the union level after every messageReceived event triggered at the structure level see below NOTE This event can be used in the code generation context to handle the arrival of unexpected structures See the usage example on p 22 22 Syntax UserObject1 UnionlanyMessageReceived USER OBJECTS WITH MESSAGES 22 18 For Each Structure of the User Object FUNCTION EVENT PROPERTY Any of the union structures defined by the user COMMENTS Assigns the contents of one structure to another overwriting the previous contents Both structures must have the same field types and the fields must be in the same order Assignment between structures with pointer type memory allocation will only work if the structures are generated as user objects UDO and not as interface only UDI send An activity that copies the data to the application if called from the user object or to the user object if called from the application and then activates the structure on the receiving side in order to properly interpret the data The send activity automatically triggers the messageReceived event on the side receiv
21. e How to add or register JavaBeans in the Object Layout e How to use JavaBean objects in RapidPLUS logic e How to determine the runtime behavior of JavaBean objects e How to debug JavaBean objects NOTE In order to use a JavaBean object effectively in RapidPLUS we recommend that you be thoroughly familiar with its specific interface elements We also recommend that you be familiar with Java programming especially if you want to develop your own JavaBeans USING JAVABEANS IN RAPIDPLUS 19 2 INTEGRATING JAVABEAN OBJECTS INTO RAPIDPLUS There are two ways to add a JavaBean to an application e Add it straight from a file without registering it e Register it and then add it like any other object When registered a JavaBean object is added to the Object Palette and New Objects dialog box Before you can add or register a JavaBean in RapidPLUS you must make sure that it is located in an appropriate folder as described in the next section The Search Path for JavaBean Objects JavaBeans are stored in JAR files Each JAR file contains one or more JavaBeans The JAR file also contains a manifest file whose contents enable RapidPLUS to find and use the JavaBeans stored in the file When adding or registering a JavaBean RapidPLUS searches for JAR files in e The application folder and its subfolders e The RapidPLUS objects folder e The RapidPLUS applics folder e The RapidPLUS folder wherever Rapidxx exe is loca
22. 2 ee ee ee 11 7 Using in the Logic Editor s a me 65 2 a PS we a Ra Se Bk EM 11 8 EXGIMPles sche ts fn Bog Seatac tty a Pat o Bhat o LO Ams tl a Sad Os 11 8 Generating Constant Objects 2 a 11 9 CHAPTER 12 GRAPHIC DISPLAYS o a 12 1 The Basics of Using Graphic Displays ooooo ooo e 12 2 Adding and Defining a Graphic Display o ooo 0000008 12 4 The Graphic Display Parameters 1 0 0 0000 20 eee e 12 4 Setting the Size and Grids eae cir a eee ea eae 12 6 Changing the Grid Color ee ee eee 12 7 Selecting a Background Color 2 2 ee eee 12 7 Defining the Palette for a Graphic Display o o o 12 8 Defining Buffers Votadas ls ts A A Aa 12 12 Connecting an External DLL to a Graphic Display 12 13 Defining the Logics Drago si a a ei ls oar 12 15 Working with Colors 5 205 6s etal ee ri A a tee A a eB a ne 12 15 Clearing the Graphic Display o ooo o e 12 20 Checking Display Height or Width o ooo o 12 21 Displaying Text ari a A iS 12 21 Displaying Images rocio e A A eS N 12 25 Drawing Empty and Filled RectangleS ooo oooo ooo o 12 26 Drawing LINES p cis tenon antler Riga ge AAA gee atte gh ASS 12 27 Drawing Arcs una ceed ae aos HB akg E A Re ae Eg 2 12 28 Drawing Empty and Filled Circles and Ellipses
23. Bitmaps and images are used to enhance the visual appeal of simulations and make them more realistic In simulations that have a graphic display bitmaps and images together with text strings and font objects play an essential part they constitute the content to be presented on the graphic display Chapter 14 Touch Screen Object describes how to incorporate a touch screen into a RapidPLUS application Chapter 15 Database Access Object presents an object that links the RapidPLUS application to any database that supports the ODBC Open Database Connectivity driver version 2 0 or higher In the Object Layout you define the link parameters and build an initial SQL Structured Query Language statement to retrieve the desired records from the database The resulting query result table is available to all objects in the RapidPLUS application The SQL statement can be changed and the query rerun dynamically during runtime Depending on the nature of the link it is also possible to add delete and modify records in the database itself Chapter 16 Applink Object describes how to use the Applink object to enable RapidPLUS applications to communicate with external applications via shared memory Chapter 17 Using ActiveX Controls describes how to add register and use ActiveX controls as objects in RapidPLUS applications Chapter 18 Hosting RapidPLUS Simulations in Windows Programs describes how to use the
24. C Rapid_Demo CDPLAYER Current Settings Reviewer location C Rapid Application C Rapid applics CD_Player CDPLAYER RPD These folders and files will be added to the package Files CDPLAYER RPD HELP UDO C Rapid objects rapS wav The package will create the program folder Rapid Shortcut text for application icon Rapid Application Fonts to add Font Arial Bold ARIALBD TTF Font Courier New Bold COURBD TTF NOTE If the Package destination folder does not exist the Application Packager will prompt you to create it after you click the Build button 2 Check the Current Settings then click Build The Application Packager builds the package All of the installation files are placed in the Package destination folder An additional file lt application name gt pak is located in the application folder This file is useful for editing a package as described on the next page IMPORTANT If you have already created a package in the selected Package destination folder creating an additional package will overwrite the first without warning Be sure to use different folders for each package that you want to keep 28 9 APPLICATION PACKAGER 28 10 EDITING A PACKAGE You may want to edit a package after you have made changes to the application or any of its user objects The editing procedure uses the PAK file that was saved when the package was built This file is located
25. Example Let s assume the following SQL query for our database access object SELECT DISTINCT employees employeeID employees employeeName employees employeeRate employees deptID FROM employees WHERE employees employeeName IN AND employees deptID Before running this query you must provide a parameter for the employee Name and deptID fields as follows DB1 employeeName setParameter Travolta John Dean James DB1 debtID setParameter ACCOUNTING DB1 runQuery In this case the WHERE clause of the query becomes WHERE employees employeeName IN Travolta John Dean James AND employees deptID ACCOUNTING and the query result will include all employees named John Travolta and James Dean in the accounting department Sending Non Query SQL Statements You might want to send a non query SQL statement in order to for example create insert or delete a database table during runtime To support this capability use the following function of the database access object s self property executeSQL lt string gt where the lt string gt argument is any SQL statement enclosed in single quotes NOTE This function operates on the database itself not on the record set ERROR HANDLING 15 15 ERROR HANDLING There are two types of errors handled by the database access object e Database errors e RapidPLUS runtime errors Many differen
26. Example Let s assume a query that links the database access object to the employeelD employeeName and deptID fields of the EMPLOYEES table You want to change the department for John Smith from Sports to Appliances The following series of activities would make the desired change assuming that you are pointing to the appropriate record DB1 edit DB1 deptID APPLIANCES DB1 update 15 12 DATABASE ACCESS OBJECT When will changes be visible Assuming that you are displaying the database data in one of the RapidPLUS display objects you may be confused by the fact that the changes you make are not immediately visible How you see the changes depends on the query type defined in the DBAccess dialog box Advanced tab see the illustration on p 15 6 and the table on p 15 7 If the query type is Dynaset the changes are visible the next time you access the record If the query type is Snapshot the query must be run again in order to see the changes Performing Transactions An ODBC driver that supports transactions has a transaction buffer to store changes made to the database and only implements those changes upon a specific command As illustrated on the following page the database access object has three functions that control the transaction buffer e transactionBegin opens a link to the database s transaction buffer e transactionCommit implements all the database changes made since the last call to transact
27. To switch to Objects view Click the Objects tab Project Mode Dbiects ise Functions Interface By default properties parameters and notes are compared To change the default setting use the Filters dialog box see p 3 8 for details about setting the filters The following illustration shows the Differencing Tool in Objects view The detailed information panes list the properties of the selected objects See the Comparison table on p 3 5 for an explanation of the comparison icons and colors C RAPIDSAPPLICS XPRESS MAIN RPD C RAPID 72 APPLICS XPRESS MAIN RPD Revision 118 23 07 03 07 40 03 Revision 114 21 05 03 20 00 06 Project Modes Objects User Functions Interface a MAIN NonGraphics 4 NonGraphics Y Framel Y Framel Y Frame3 Y Frame3 Y Label Y Label3 Y Talking_Imp Y Talking_Imp Y Label5 Y Label Y Framed Y Framed Y MAIN MENU C ARAPIDSAPPLI v MAIN MENU C RAPID72 applics lt press MAl a4 KEYPAD O PARAPINLADDI e al KEYPAN PARAPINTA annlins evra 434 389 alse Y IDunamin false MODE DESTINA TRIGGER ACTION Browse Differences First Previous Next Differences found 1 TON ACTION Browse Matches First Previous Next Last Number of differences Detailed Information panes COMPARING USER FUNCTIONS 3 15 COMPARING USER FUNCTIONS In the User Functions view you
28. Xon Xoff flow control The following two values should not be sent when Xon Xoff flow control is used e 0x11 hex 17 dec This value stops the flow of data e 0x13 hex 19 dec This value starts the flow of data Input Output by Byte Depending on the requirements of the device connected to the serial port you can send output and receive input byte by byte By default the object manages input and output as strings To enable input by byte e Inthe Commlink dialog box select the Input by byte check box ENHANCEMENTS Commlink x COM Options Port COM1 M Data Bits Parity Cancel 5 E None 6 Help 5 EJ Odd Z m Link Options fis Even Delimiter Stop Bits Flow Control LA Use for input el 1 E Xonsxott ASCII Value 10 1 5 DTR DSR These options are 2 CTS RTS A Add to output unavailable when input is by bytes Baud Rate 9600 y LA Filter non printable Timeout After sec When selected input from the serial port is byte by byte e Atruntime In the Logic Editor use the enableInputByByte and disableInputByByte functions as follows Commlink1 enableInputByByte to enable Commlink1 disablelnputByByte to disable To read an input byte e Use the getInputByte function as follows Strl append Commlink1 getinputByte As long as the input buffer is not empty this function returns the next byte and removes it from the buffer otherwise it returns 1 NOTE The condition is
29. gt ja ore fae Applink_PhoneNumber open phone_number Send Send amp Applink_PhoneNumber is open Activities Applink_PhoneNumber open phone_number This condition makes sure that the channel is open LOGIC EXAMPLES 16 7 Send mode In Send mode there are two transition destinations e An internal transition e A transition to Close mode 22 Send Send gt internal Of x File Edit View Logic Functions Debug Help AISEE ajja se Y GSI EB sal x Applink_PhoneNumber acknowledged L Condtion joneNumber acknowledged Counter changeBy 1 entry Applink_PhoneNumber sendD ata Arr_PhoneNumbers Counter id 2 mode exit i When Send mode becomes active the entry activity is executed sending the first element in the array to the shared memory ii After the external application reads the data and sends an acknowledged event back to RapidPLUS RapidPLUS uses the acknowledged event in an internal transition iii There are two actions The Counter integer increments the array element by 1 the Applink object sends the second element in the array to the shared memory iv This process continues until all 10 array elements have been sent The condition amp Counter gt 9 triggers the transition to Close mode Close mode Close mode contains e An entry activity that closes the channel Applink_PhoneNumber close APPLINK OBJECT 16 8 Example 2 Receiving Da
30. it references a non existing object property or mode is commented out with two backslashes and three asterisks 11 in the Logic Editor and is appropriately tagged in the Logic Error View window See Chapter 5 Logic Error View for details about invalid logic and working with the Logic Error View window RESOLVING DUPLICATE ELEMENT CONFLICTS The major challenge when pasting elements between RapidPLUS applications is resolving conflicts between the elements cut copied from the source application and existing duplicate elements in the target application As described in detail in A Paste Glossary on pp 6 7 to 6 8 the duplicate element can be an object a mode an interface element property event union or definition only structure or a user function The options for resolving duplicate element conflicts differ somewhat depending on whether the paste element such as a mode or an object was cut copied directly in the source application or whether it is being pasted as a related element of another pasted element PASTING OPERATIONS 6 16 Resolving Conflicts for Pasted Elements When you cut copy a mode or an object in the source application and a duplicate mode or object exists in the target application the following dialog box opens in which you resolve the conflict The pasted element is added to the target application without replacing the duplicate element A numeric suffix is added to the name of the
31. mode activities Functions get_index and or METHODS Methods with Rapid compatible parameters set_index FUNCTIONS Functions EVENTS Events EVENTS Events Event Arguments Event Properties LOGIC FOR JAVABEAN OBJECTS 19 7 Supported JavaBean Types JavaBean objects use Java language types for properties function parameters and return values The following table summarizes the equivalent RapidPLUS data type for each Java type RapidPLUS JAVA TYPE COMMENTS TYPE int byte short Integer boolean Integer where O false and 1 or lt gt 0 true float double Number String String Java color RapidPLUS color Like the lineColor or fillColor java awt Color properties char Character where character an element of a string Java image Image java awt Image Java font Font java awt Font The Java image and Java font types are special types that were added to support JavaBeans that require them Although they are not the same as RapidPLUS image and font objects you can assign a RapidPLUS bitmap to a JavaBean object s image property For example JavaBean1 image Bitmap1 This assignment capability is expensive and should be used sparingly Functions for the JavaBean object s image and font properties are described in
32. on p 12 17 DEFINING THE LOGIC 12 23 Example A cell phone s LCD display shows a welcome message when it is activated The logic for this is LCD1 drawText Welcome atx 2 y 3 The coordinates atx 2 y 3 are the upper left Current background color as determined corner of the string at design time or by calling the setBackgroundColor function Current draw color The default is black or specify a different color using the setDrawColor function Font style as defined by the current font object Parsing a String When displaying a long string on a graphic display it is often necessary to divide or parse the string into substrings that fit the width of the display For a discussion and usage examples of the font object functions that enable parsing see p 13 14 Drawing Text with a Transparent Background The drawText function draws text in label format i e a rectangular box where the characters are in the draw color and the rest of the box is in the background color The drawTransparentText function makes the background color transparent so the effect is like writing on paper i e only the characters are drawn NOTES When the text background color is the same as the display background color the distinction between the two functions is visible only when one text string is imposed on another The runtime performance of the drawTransparentText function is significantly slower than the drawText function
33. 0 0 0 0 0 00 0 ee eae xix About the User Manual Supplement 0 2 000020000048 xix Conventions Used in This Manual 1 2 0 2 ce ee ee eee xxi RapidPLUS Hel py hmm lls aa e Fae oy Sa tat es leat BN eo a xxii CHAPTER 1 MANAGING PROJECTS o ee eee eee eee 1 1 Switching Among Project Components 2 0 0 0 00 2 eee eee ee eee 1 2 Opening a Project s ic li A A Se BIE nF a a e weld oe 1 4 Automatic Interface Updates o ooo o 1 4 Automatic Interface Logic Reverificati0N o ooo ooo o 1 4 Missing or Defective User Objects o o ooo ooo o 1 5 Examples Of USA88 0 cio oe a a 1 5 Editing Project Components ee eee 1 7 Replacing and Renaming User Objects o o ooooo ooo e 1 7 Replacing a User ODJECt erine ek da Ge le a Ta es eer 1 7 Renaming a User Obj Ctia sosa a GB be ease na lo wee woe dade 1 8 Compacting Files e serere See AAA kG O SAR Et ae 1 9 Entire Project vs Single Component Operations o o o o 1 9 Reverifying Logic for an Entire Project o oooooo ooo 1 10 Compacting an Entire Project o o oo ooo ooo ee eee 1 10 Savins an Entire Project tii A A ee 1 10 Upgrading Applications Created in a Lower Version o o oo oo o o 1 10 Using the Application Properties Dialog BOX ooo o o 1 11 Notes on Modes and Objects
34. 27 20 Example If the user function contains logic for Switch1 Switch1 position1 Switch1 position2 and Switch1 position3 then that equals four uses Should you need to build a user function that requires more than 255 objects you must divide the user function into two user functions and either nest one in the other or have one user function call the other User Functions Returning Specified Values User functions can return e No value void functions e Boolean values conditional functions e A value that you specify The specified return value can be a data type integer number or string any RapidPLUS object or a user object UDO The return value of an integer or number is the value of the integer or number The return value of a string is a copy of the string The return value for all the other RapidPLUS objects and user objects is a pointer to the object User functions that do not need explicit return statements or return Boolean values are described in Chapter 18 of the Rapid User Manual Example You have several strings of different lengths The strings must be centered in a text display You can create a user function centerString to determine the necessary amount of padding and return a new string with the padding plus the original text centerString lt String TempString gt total lt Integer charsInDisplay gt declare lt Integer i gt lt i gt lt charsInDisplay gt lt TempString gt length
35. 6 18 PASTING ELEMENTS INTO AN APPLICATION 6 9 PASTING ELEMENTS INTO AN APPLICATION This section describes how RapidPLUS handles objects modes and logic elements that are taken from a source application and pasted into a target application Multiple paste operations Each copy and paste operation is unique to the editing context in which it takes place Thus for example in the source application you can copy both an object in the Object Layout and a mode subtree in the Mode Tree without the second copy operation overwriting the first In the target application selecting Edit Paste Object in the Object Layout pastes the object and selecting Tree Paste in the Mode Tree pastes the subtree In the Object Layout Each of the following object types is a unique copy paste operation e Graphic objects e User object events e Nongraphic objects e User object unions and top level structures e User object properties e User functions In the Logic Editor Each of the following logic types is a unique copy paste operation e Transitions e Triggers and user condition function lines e Function lines actions entry exit activities and mode activities PASTING OPERATIONS 6 10 Pasting Objects in the Object Layout 1 In the source application s Object Layout cut or copy the desired objects 2 In the target application s Object Layout e For graphic objects choose Edit Paste Object or click Paste Object Ctrl V
36. Array Existing Struct New Struct Adding Fields to a Structure There are five types of fields that can be added to a structure string integer number array and definition only structure existing structure NOTE An error message will appear if you try to close the User Object Properties dialog box when a structure has no fields Empty structures are not allowed To add a field to a structure e Select the structure and click one of the buttons in the Add Field group NOTE The buttons in the Fields group are unavailable until you have added at least one structure String Integer or Number Fields If you add a string integer or number field a field specific dialog box opens in which you can define various data attributes The table below summarizes the data attributes for each field type NOTE These attributes are only relevant in the context of code generation FIELD TYPE ATTRIBUTE COMMENTS String String length Defines the size of the string in bytes Integer Size Choose among long short int char or bits If you choose bits you must specify the number of bits per integer in your system Sign Integer is signed unless the check box is selected Number Element size Choose float double or long double String integer and number Pointer When selected indicates that the field is a pointer to data When not selected indicates that the memory allocation method is the
37. Component List report 25 18 constant objects adding constant array objects 11 2 adding constant integer number and string objects 11 2 adding constant set objects 11 4 creating from data objects 11 3 duplicating 11 6 to 11 7 examples of usage 11 8 functions unsupported 11 8 generating code 11 9 in If Else branches 7 15 in the Logic Editor 11 8 overview 11 2 replacing with non constant 11 9 constant set objects creating for ActiveX controls 17 6 defined as user object properties 27 13 importing data 11 5 to 11 6 maximum number of items 11 4 sending data from Applink object 16 4 constant set properties 10 14 27 13 to 27 15 continuing in a loop 7 10 copying in Logic Error View 5 7 nongraphic objects 10 5 See also pasting between applications Coverage Test report 25 20 CSX file code generation preferences 2 10 cutting See pasting between applications D data containers 22 22 to 22 23 data objects 10 8 to 10 34 c code generation 10 30 data property 16 5 data store objects 10 21 to 10 28 default maximum length 10 30 importing data into 10 23 to 10 28 maximum size for individual objects 10 31 sorting 26 4 to 26 7 dataArrived callback function 16 15 database access objects function 15 11 adding to Object Layout 15 2 adding deleting records 15 11 changing field values 15 11 database errors 15 15 filter WHERE clause operators 15 7 to 15 8 with parameterized values 15 13 Microsoft Excel databases 15 9 overvie
38. Example NumberArray 45 0100 5 42 5120 3 16 8132 4 1551270 lt empty line gt Data Store The data store object is a two dimensional matrix of integers numbers and or strings The structure of a data store can be compared to that of a table with varying numbers of columns and rows Each row is a record each column is a field A field can be either an integer number or string with the same rules that apply to integer number and string objects A single data store can contain all the field types In the Logic Palette each field appears as a property of the data store The illustration below shows a schematic representation of the data store structure Field 1 string Field 2 number Field 3 integer Field n Record 1 Record 2 Record 3 Record 4 Record n Basic Steps for Creating a Data Store 1 Add a data store object to the layout area then click the More button to open its dialog box 2 Inthe Number of Records box select the number of records and click the Update button 10 22 NONGRAPHIC OBJECTS For each field that you want to add click the Add Field button to open the Add Field dialog box in which you define the field s name type and initial value View the structure of the data store by clicking the View Records button In this view you can assign names to the records Optional Instead of inputting field and record information you c
39. F dialog box opens Rapid Inspect x Enter obiect name 2 Type in the name of the object you want to inspect or click the arrow to select an object from the list of objects then click OK View a list of application objects An Inspector window opens displaying the selected object s current status THE INSPECTOR WINDOW F6 F6 4 29 To open the Inspector window from the Logic Editor The Prototyper must be started 1 Inthe Edit line enter an object s name in one of the following ways e Type in the name e Click a logic line that contains the object and highlight the object 2 Choose Debug Inspect or click the Inspect button An Inspector window opens displaying the selected object s current status If the logic line contained more than one object and no object is highlighted a separate Inspector window opens for each one NOTE If the edit line is blank or does not contain an object name the Rapid Inspect dialog box opens see illustration above in which you select an object To open the Inspector window from the Logic Palette The Prototyper must be started 1 In the Object List select the object you want to inspect 2 Right click and choose Inspect or click the Inspect button An Inspector window opens displaying the selected object s current status To inspect other objects in an opened Inspector window e Overtype the current name with the name of another application object Navigating
40. Integer WORKING WITH FOR LOOPS 7 5 To define a While block The focus should be on the line under the header 1 Build an activity then accept it by either clicking the New Line button or pressing Enter The next line is selected and is indented exactly like the previous line 2 Continue adding activities until the While block is complete To end a While block e Click the New Line button twice or press enter twice See the tip below for more ways to end the block Ways to end an activity block e Click the New Line button twice e Press Enter twice e Right click in the empty line after the block to open the popup menu and choose Decrease Indent e In the edit line for the line after the block delete the symbolic tab gt WORKING WITH FOR LOOPS The For loop has two parts PART DESCRIPTION Header The line that holds the construct keyword for Designates the number of times the block of activities will be executed and the value for incrementing the counter Block Contains activities that will execute as long as the For condition is true 7 6 WRITING LOGIC USING LOOPS AND BRANCHES A typical For loop looks like for lt Integer i gt from 1 to LampArray size step 1 For header LampArray lt i gt on For block Notice that the block is indented and that each activity appears on its own line For more information about block indentation see Understanding Indentation in Lo
41. M Display M Icons M Keypad 4 Messages Y Util M Network Y Util Select deselect with children Logic from selected user objects will be included in the log pane and used for stepping filters Selecting the Select deselect with children check box automatically enables you to select or deselect all of a parent application s nested user objects MANAGING LOGS 4 21 Selecting modes General Filters User Objects Modes Select the modes whose logic and interface will be included in the log or stepped through using Step by filter Component list oe parent application or User object TEL_MAIN D RAPIDSAPPLICS CE one of it user objects For all included 4 tel_main user objects and M off the parent a Y on application S W operation M welcome Select all modes s 4 dialing E Deselect all modes E pod S M dialNumber M normal Mode list M overflow for the selected M rssiCheck component 4 noLink 8 4 communication a IA rall xl Select deselect mode with children Logic from selected modes will be included in the log pane and used for stepping filters MANAGING LOGS Logs can be saved and then reopened or printed The Logger pane can be cleared without stopping the Prototyper In addition you can search for text strings in the log and use log entries to go straight to the corresponding logic statement in
42. Neither of these actions should happen if the recorder vetoed the event In the CounterButton JavaBean object a button click occurs when the user presses and releases the mouse This event is handled in the mouseReleased method public void mouseReleased MouseEvent evt if isEnabled return if down down false repaint fireAction IMPLEMENTING RECORDABLE EVENTS FOR JAVABEAN OBJECTS 19 17 The fireAction call fires the action event and increments the button counter In that point we need to pass the event to the recorder Let s call the event clicked it can be given any name of course The code is modified as follows for the Bean object public void mouseReleased MouseEvent evt if lisEnabled return if down repaint the button so it would be shown in the released state this is done regardless if the clicked event is triggered or not down false repaint route event for recording routeEvent will return false if the event was vetoed by some listener in this case the event should not be fired and the change in the button state as a result of the event that is incrementing the counter should not be performed the routeEvent returns true if the event was approved router may veto the event the fireAction method will also increment the counter if routingSupport null routingSupport routeEvent clicked fireAction
43. Potentiometerl value param2 Potentiometer2 value param3 Potentiometer3 value param4 1 20 8 OPENGL OBJECT Properties and OpenGL Constant Values In addition to the self property each OpenGL object has three properties through which the OpenGL and GLU constant values are made available as read only functions These properties are PROPERTY FUNCTIONS cA All OpenGL constants whose names after the GL_ prefix begin with the letters A through L Names that begin with non alphabetic symbols are also included in this list cM All OpenGL constants whose names after the GL_ prefix begin with the letters M through Z cGLU All GLU and WGL constants NOTE The OpenGL and GLU constant prefixes GL_ and GLU respectively are lowercase in RapidPLUS Thus the OpenGL constant GL_LINE_STRIP is gl_LINE_STRIP in RapidPLUS Example Calling glBegin with the constant argument GL_LINE_STRIP IN C IN RapidPLUS glBegin GL_LINE_STRIP GLObj glBegin mode GLObj cA gl_LINE_STRIP Functions That Return Values Some OpenGL and GLU functions that return a value do so through two parameters e pname an OpenGL or GLU constant that identifies the parameter Pointer Parameters on p 20 7 e value the value returned by the function These functions are implemented in RapidPLUS by a single pname argument whose value is returned as the function result such as glGetBooleanv_pname glGetFloatv_pname IMPLEMENTING
44. RapidPLUS loads a user object but the mode tree is empty or the objects have disappeared a fatal error has occurred 2 5 RAPIDPLUS APPLICATIONS IN XML WORKING WITH THE XML OUTPUT There may be times when you will want to edit the RXD or UXO files outside of RapidPLUS for example when merging two revisions of the same file It is important that you be familiar with the structure of the files and the mechanics of handling the schema file This section presents information about the RXD and UXO files and the CSX settings file Before looking at the files however you should be aware of a setting that affects the XML output files A setting in the Configuration Management Options dialog box determines the type of indentation used in the XML files To set the indentation type 1 In the Application Manager choose Options Configuration Management Options 2 In the dialog box under the XML Output group the indentation type is set to Tabs by default To use spaces instead of tabs select the Spaces button WARNING When multiple developers work on an application they must all use the same indentation setting otherwise it will be difficult to merge the files RXD UXO File Structure The structure of RXD and UXO files is similar Both file types contain elements presenting document information metadata exported interface objects the mode tree transitions and logic Document Information The lt module gt eleme
45. To see how these logic items are used refer to Logic Examples on p 16 6 To receive data from the shared memory e Use the getData function in an activity or action For example Applink_Chan1 getData The data is placed in Applink_Chan1 data To display the data or assign it to another object e Use the data property For example TextDisplay1 contents Applink_Chan1 data ArrayOfDatalindex Applink_Chan1 data To check for additional data in the shared memory e Use the checkForData function For example Applink_Chan1 checkForData APPLINK OBJECT 16 6 LOGIC EXAMPLES The first example illustrates how an Applink object sends data to an external application the second example illustrates how an Applink object receives data from an external application Example 1 Sending Data to an External Application In the Object Layout The RapidPLUS application contains the following objects to facilitate the sending of data One Applink object Applink_PhoneNumber set to queued mode e An array object Arr_PhoneNumbers containing 10 phone numbers e An integer object Counter used to increment the array elements Its initial value is 1 In the Mode Tree There are three modes Open Send and Close In the Logic Editor Open mode Open mode contains an entry activity that opens a channel 5 Editing Activities in Open File Edit View Logic Functions Debug Help Se 0
46. buffer type NOTE If the structure s memory allocation method is pointer type each field can be either pointer or buffer type If the structure s memory allocation method is buffer type each field can only be buffer type 22 9 22 10 USER OBJECTS WITH MESSAGES Array Field When you add an array field to the structure a dialog box opens in which you define the array field s Data type integer string number or structure If there are no definition only structures the structure data type does not appear in the list Default structure If you selected a structure data type you must choose a definition only structure from this list For all other data types this element does not apply Number of elements Memory allocation method For buffer type memory allocation the array field s memory allocation method must be the same as the structure s In other words if the Pointer check box was not selected in the structure s dialog box it must also not be selected here Field Array Array1 x Data Default Structure Integer Cancel Advanced Pointer to the Array Help Structure Sample Array Field dialog box NOTE You can only add one dimensional arrays as fields in a structure To set the data attributes for the integer number and string data types 1 2 Click Advanced the corresponding field dialog box opens Set the attributes as needed To set an array
47. clock now popup_str the pop up message string with an initial value of Do you need help A graphic display Display1 with a width of 100 display pixels Two font objects arial_font Arial 9 regular used for the display string courier_font Courier New 8 regular used for the pop up message string One integer object numOfLines_int to hold the number of substrings another arrayIndex_int to serve as the index parameter and a number object yPos_num to manage the text s vertical location Two one dimensional string arrays parsedPopupLines_arr and parsedDisplayLines_arr to hold the parsed substrings for the pop up message string and the display string respectively DEFINING THE LOGIC 12 41 The application state chart looks as follows Transitions triggered by a Transitions triggered by a pushbutton power_pb pushbutton message_pb display message P parseSt display parseM display ring String essage Message Transition triggered when Transition triggered when the parsed substrings of the parsed substrings of the the display string have all popup message string have been written to the all been written to the parsedDisplayLines_arr parsedPopupLines_arr Parsing a String In the parseString and parseMessage modes the display and popup message strings are broken down or parsed into substrings that fit a specified width in display pixels for a particular font obje
48. e For nongraphic objects choose Edit Paste Nongraphics or open the Nongraphic Objects dialog box and click the Paste button To complete the paste operation EXPLANATION RapidPLUS Checks for a duplicate If there is a duplicate object the Paste object in the target Conflicts Duplicate Elements dialog box application opens For details about using the dialog box see Resolving Duplicate Element Conflicts on p 6 15 For a graphic object Click the mouse to paste the object at the displays the crosshairs crosshairs location For a nongraphic object The object is added to the list in the Nongraphic Objects dialog box Pasting User Object Interface Elements in the Object Layout 1 In the source application open the User Object Properties dialog box by choosing Edit User Object Properties 2 Go to the appropriate tab s and copy the desired interface element s NOTE You can use the standard Ctrl click and Shift click selection methods to select multiple elements in each tab In the Messages tab select the Show Top Level Only option see p 22 6 to facilitate multiple selection 3 Inthe target application open the User Object Properties dialog box select the appropriate tab s and click Paste If there is a duplicate interface element in the target application the Paste Conflicts Duplicate Elements dialog box opens For details about using the dialog box see Resolving Duplicate Element Conflicts
49. e JD is the ID number of the user action This value can be used when the Rapid Simulator is set to reroute mode to acknowledge or deny the action e Response is a placeholder for the response flag to be set by the host when the event handler is called to generate an immediate response to the action Modifying the Host Document to Monitor User Actions In order to monitor user actions both the Rapid Simulator and the host document must be modified To monitor user actions 1 Set the Rapid Simulator s routing mode to Monitor see p 18 25 for instructions 18 28 HOSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS 2 In the script add the UserActionFired event handler RapidSiml_UserActionFired ByVal objectName As String ByVal propertyName As String ByVal eventName As String ByVal time As Single ByVal id As Long response As Long This event handler gets user actions as they occur in the simulation As you can see from the script the information includes the object s name property event time stamp ID number and place holder for response All this information must appear in the event handler but it does not all have to be used For example you could use only the first three values objectName propertyName and eventName Displaying User Actions in the Host Document A Label object or other ActiveX object can be used to display user actions that take place in the RapidPLUS simulation The Label can display the
50. is on the first or last union structure or field pressing Alt or Alt W respectively has no effect Defining the Memory Allocation Method NOTE This information is only relevant in the context of code generation and is mainly used for user defined interfaces UDIs Because the user object message is a union of structures by definition all structures use the same memory space in the embedded system environment Memory can be allocated for a structure by one of two methods e Buffer whereby RapidPLUS internally allocates enough memory to accommodate the largest structure This is the default method e Pointer whereby the user object message uses memory supplied by the underlying embedded system You choose the memory allocation method when you create the structure see p 22 7 NOTE Once you have designated a structure as buffer memory type it cannot contain pointer type string fields or another structure that contains pointer type string fields USER OBJECTS WITH MESSAGES 22 14 To change the memory allocation method for the selected structure 1 Click Edit to open the Structure dialog box 2 Select the Pointer check box for the pointer allocation method or leave it clear for the buffer method When to Use an Array of Structures As you know a definition only structure is created to be reused as a union structure and as a structure field nested structure A definition only structure can also be placed
51. monitor mode e How to enable the host application to control user actions that occur in the RapidPLUS simulation reroute mode USING A RAPID SIMULATOR OBJECT A Rapid Simulator ActiveX object referred to as the Rapid Simulator is a container for a RapidPLUS application referred to as the RapidPLUS simulation However it is not only a container but has its own properties and logic as well A Rapid Simulator that has been embedded in another Windows program document referred to as the host document can e Run independently of the host document e Transfer data to and from the host document e Have its events controlled by the host document In the following illustration the host document powers the RapidPLUS simulation on and off Once the simulation is powered on it runs independently of the host document Host Document Rapid Simulator ActiveX Object These buttons power the lamp in the RapidPLUS simulation on and off USING A RAPID SIMULATOR OBJECT 18 3 Procedure for Adding a Rapid Simulator 1 Add the Rapid Simulator 2 Select the RapidPLUS application to be simulated 3 Configure the Rapid Simulator s properties These steps are described below Adding the Rapid Simulator Programs that use ActiveX controls have procedures for adding and manipulating the controls Please follow the appropriate procedures To add the Rapid Simulator e Add the Rapid Simulato
52. o o 12 30 Floodfilling an Enclosed Area 2 eee 12 31 Setting the Update Mode 2 6 ca ee ee tee eee 12 31 ix CONTENTS Setting the Drawing Mode e 12 33 Saving and Restoring Status ooo ooo o e 12 36 Saving and Restoring Area o o ee ee 12 38 Using the dump Function ee eee eee 12 43 Working with Buffets mns geia a hed gs Gi BS SE to EA 12 44 The Whole Picture 0 040 2408 ose bot ee oe bork bat Nea woh dus 12 45 Setting and Getting the Active Buffer 2 2 0 ee ee ee 12 46 Clipping Rectangles iu 64 sas aoe eee we BEE be we ee E 12 47 Buffer Usage Examples ee ee 12 49 CHAPTER 13 BITMAP IMAGE AND FONT OBJECTS 13 1 Bitmap Objects as eof csr ene A bee ui ae Bae dad SA ong eae 13 2 TMA ge Ob OCC ernaia acta ene a A ea em eaten ds 13 4 Setting the Image Manipulation Mode 0 0 0 0 00 02008 13 5 Using the setColorForRGB_Ranges function 0 00008 13 9 Using Transparent or Semi Transparent PNG Images 0 13 10 FOnt ODjecty e ta a da bet PAM Riad cote Buel Lites Saha la at BA 13 11 Advanced Font Object Settings o oo o 000000004 13 12 Parsing a String neor 5 ae eet da Se hy Be Swe ie ees 13 14 CHAPTER 14 TOUCH SCREEN OBJECT o 14 1 Adding in the Object Layout 2 ooo 14 2 Defining the Logia A den A o E eke este
53. on p 6 15 PASTING ELEMENTS INTO AN APPLICATION E Ctrl V 6 11 Pasting Logic in the Logic Editor NOTE For details about logic types that can be pasted and their related elements see Elements You Can Cut Copy and Paste on pp 6 2 to 6 6 In the source application cut or copy the desired logic element s 2 In the target application select a location for pasting the logic element and choose Edit Paste or Paste by Type or click Paste Logic To complete the paste operation RapidPLUS 1 Checks if there are duplicate objects i e same name and type for the objects being pasted as related elements EXPLANATION If there is a duplicate then the Paste Conflicts Duplicate Elements Referenced by Pasted Logic dialog box opens For details about using the dialog box see Resolving Duplicate Element Conflicts on p 6 15 2 Pastes the logic line into the target application If you are pasting a transition RapidPLUS tries to reconnect the transition with its destination mode e If there is no mode in the target application with the same name as the transition s destination mode the transition is commented out in the Logic Editor e If there is one matching mode the transition is reconstructed e If there are multiple duplicate modes the Transition Conflict dialog box opens as described on p 6 18 6 12 PASTING OPERATIONS To complete the paste operation Ra
54. or char 8 bit 3 Optional Select the Unsigned check box NOTE This dialog box is also available for integer properties of active primitive objects and user object properties of type integer Using Primitive Data Types in the Logic Any integer type can be assigned to the object however information may be lost when a type with more bits is assigned to a type with fewer bits truncation When calculating expressions with integers and advanced integer types the calculation of the expression will always be done using 32 bit precision When assigning the result truncation may occur Advanced integer data types can be passed to functions with integer type arguments or other advanced integer types only if the argument is passed by value that is only the value of the object is passed When the function is defined with an integer argument or advanced integer argument that is passed by reference that is the object itself is passed the RapidPLUS compiler will only allow passing variables of the exact same type to the function e g a function that receives a char argument by reference will only accept variables of char type TIME OBJECTS This class of nongraphic objects comprises objects that hold time data in a variable You can display the data use it in calculations or base triggers on it There are five types of time objects timer stopwatch date time and timer tick which is used in C code generation TIME OBJECTS
55. therefore the drawTransparentText function should be used only when necessary 12 24 GRAPHIC DISPLAYS Example In a cell phone application you want to display a string of underscores to mark the positions of the digits in the phone number with a string of digits above them when the user enters the phone number Both strings have the same x y coordinates If you use the drawTransparentText function for the second string the underscores continue to be visible even when digits are inserted above them Lentiy Display fontSet Font_Object1 entry Display1 setDrawColor 12 entry Display1 drawT ext e SIM atx 1 y 1 entry Display drawTransparentText ate 1y 25 entry Display drawTransparentT ext 0123 atx 1 y 25 mode With the drawTransparentText function M Prototyper TRANSTXT fx File Controls CBT Options Help 13 4 el Ela 4 the underscores gt rieg al remain visible and mat i Beta af m 1h Getting the Font Height and Text String Width The fontHeight function returns the maximum character height for the current font object in display pixels A j The font height is measured from the top of A to the bottom of g The fontStringWidth function calculates in display pixels the width of a specified text string according to the current font object Getting the font height and or text string width is necessary in instances when a text string is t
56. 0 The String dialog box opens when you add or edit a string object It is used to assign or change the string object s initial value in the Prototyper String String1 x Initial Value Cancel Opens a dialog box for setting a maximum string length value Advanced This value is applicable for C code generation For details see p 10 31 The string dialog box also opens when you define a string property for an active primitive object or for a user property of a user object Number 1 23 Number The number object is a variable that holds a real number If you enter an integer RapidPLUS converts it to a real number e g 3 is converted to 3 0 The Number dialog box opens when you add or edit a number object DATA OBJECTS Initial Value 483 LA Bounded Cancel Bound PEE Lower Upper Help 2 0 15 0 lu Wrap Around A sample Number dialog box OPTION Intial Value DESCRIPTION Intial value in the Prototyper 10 9 DEFAULT 0 0 Bounded number When selected sets bounds to prevent RapidPLUS from assigning numbers less than the lower bound or greater than the upper bound For example if the upper bound is set at 15 0 and the application logic assigns a value of 16 3 the actual value of the number object will be 15 0 Not selected Wrap Around When selected RapidPLUS wraps around to the lower bound when the value of the number exceeds the upper boun
57. 10 12 26 GRAPHIC DISPLAYS Drawing a Bitmap with a Transparent Color The drawBitmap atx y function draws every pixel of the bitmap rectangle blocking out the entire display area the bitmap covers The drawBitmap atx y transparentColor function ignores the pixels in the transparent color so that the corresponding pixels of the display remain visible Example You want to show an icon that appears on the display over other content and disappears at a specific point in a sequence of events If you use draw Bitmap atx y to draw the icon the display will show a super imposed icon that blocks out everything beneath it If you use drawBitmap atx y transparent Color lt ColorAroundIcon gt the display will show only the icon itself The logic for this is LCD1 drawBitmap Bitmap1 atx 10 y 10 transparentColor 16 NOTE The transparent color for a bitmap defined in the Object Layout Edit Colors and the transparent color defined in the drawBitmap function have no effect on one another The transparent color defined in the Object Layout cannot be changed at runtime while the transparent color specified in the function applies only to the draw operation the function performs Drawing Empty and Filled Rectangles There are two functions for drawing rectangles on the graphic display In each function you specify a coordinate on the graphic display for the rectangle s upper left corner and a size for its area To draw a rec
58. 2 ee ee eee 22 15 Message Properties Functions Conditions and Events 22 17 Using Arrays of Structures in Logic o ooo oo o 22 20 Runtime Errors ia p do a AA 22 20 Examples oPUsage gt iv see Sod A A ae a eed abe le EEG 22 21 Using Messages As Data Containers 2 0 2 ee ee ee 22 22 Importing Structures froma File ee 22 24 Importing a Structure ia ts Ca aie Oe a ee ese id 0 Ee a amp 22 26 How RapidPLUS Handles Various Items during Translation 22 28 CHAPTER 23 STATE MATRIX paimo p Hea ah Shel Se eh ee URS pe eee 23 1 OVELVIEW art ei eh ee ee Eee age OA Get EA eR rea ee eae 23 2 Exporting Logic Data occ ee ey av Stone Se res Bas Ges Se Re eos SA et ane 23 3 CHAPTER 24 EXPORTING STATE CHARTS TO VISIO 24 1 ONE Wa e SAIS oe tl Ltda la Be alt PAN Ds od A 24 2 Exporting a State Chalt ee eee 24 4 Choosing and Creating Schemes for Exported State Charts 24 6 XV xvi CONTENTS CHAPTER 25 GENERATING REPORTS o o o 25 1 Overview of the RapidPLUS Reports o oo o e e 25 2 Working with Reports in the Report Viewer o ooo o 25 3 Viewing Reports vu lie 25 4 Saving REPO ninia aa ii ad A 25 4 Printing Reports vs bis e e AA AS 25 4 Editing Reports ua A ees Ada 25 5 Object Reports act di Sade oat A tee gee a A adan dea 25 5 Object Layout Re
59. 2 return lt TempString gt padSpacesLeftTo lt TempString gt length lt i gt Specifying a Return Value in a User Function There are two stages in specifying a return value 1 Select the return type from a list of possible return values 2 Add one or more return statements in the Function Editor LOGIC EDITOR 27 21 These stages are described below To select the return type fol 1 Open the Function Editor lu Logic Editor Edit Activity Function File Edit View Logic Functions Debug Options Help Seo aaa error IE BE A lt no return gt functiont C Exported Notice the button labeled lt no return gt This button displays the currently selected return type When it displays lt no return gt the function does not return a value 2 Click the lt no return gt button The list of available return types opens Select the type to return x Objects No Retum lt no retum gt Data Objects Integer Number String Variant Data Arrays Integer Array 1 dim Number Array 1 dim String Array 1 dim NOTE Boolean does not appear as an available return type Instead you must define a conditional function where the return type is Boolean by default 3 Select a return type and click OK The selected return type is displayed on the button For example if you select Integer the button changes accordingly Logic Editor Edit Activity Function File Edit View Logic Functions
60. 2 2 0 00 00 0002 o 6 2 ODJECS a face A O A A AS 6 2 User Object Interface Elements o ooo ooo ee ee 6 3 DORE A E 4 et AE LA A 6 3 A Paste Glossary 0 ia E OE EEN SOA EG we ee E AA 6 7 Pasting Elements into an Application o ooo o e 6 9 Pasting Objects in the Object Layout 0 0 0 0 0 0002008 6 10 Pasting User Object Interface Elements in the Object LayoOute cose a eee o ere OSE RAE AA A Ye 6 10 Pasting Logic in the Logic Editor 2 2 2 00 0 0 0 00 02 6 11 Pasting Modes in the Mode Tree nauona ee ee 6 13 Resolving Duplicate Element ConflicCtS o ooo o e 6 15 Resolving Conflicts for Pasted Elements 1 0 0 00 00 000202 0a 6 16 Resolving Conflicts for Pasted Related Elements 6 17 Resolving Transition Conflicts ooo oo e e 6 18 Storing OBjects or A A A A A AA 6 18 CHAPTER 7 WRITING LOGIC USING LOOPS AND BRANCHES 7 1 New Buttons in the Logic Palette o ooo ooo e 7 2 Working with While L00pS ee ee 7 3 Defining a While Loop 2 2 ee 7 4 Working with For Loops 1 0 ee ee 7 5 Defining a For Loops heb a hee ead Pee bed dee totais 7 6 Understanding Indentation in Loops and Branches o ooo oo 7 9 Break Continue in For and While Loops o ooo ee eee 7 10 Working with If Else Bra
61. 27 6 redraw 20 11 to 20 12 related element defined 6 2 paste conflicts renaming nongraphic objects 10 5 replacing nongraphic objects 10 7 strings in logic 8 8 reports changing fonts 25 4 editing 25 5 in Differencing Tool 3 10 overview 25 2 printing 25 4 Report Viewer 25 3 saving 25 4 RequestDataFromDDEObject method 18 42 reserved names 27 10 resetPalette 12 20 ResetState method 18 42 resolving conflicts for pasted related elements 6 17 restoreArea 12 38 restoreAreaAtx y 12 39 restoreAreaAtx y from 12 39 restoreAreaFrom 12 39 6 17 restoreStatus 12 37 restoreStatusFrom 12 37 Resume method 18 42 reverifying logic in Logic Error View 5 6 in projects 1 4 1 9 reverseFromx y width height 12 16 rightAlign 26 22 root mode exit activities debugging 4 18 RoutingMode property 18 37 rpd_checkForData function 16 13 rpd_getData function 16 12 rpd_getMode function 16 14 rpd_getQueueSize function 16 14 rpd_mem dll 16 3 16 10 16 15 rpd_openChannel function 16 10 rpd_sendData function 16 12 rpd_setMode function 16 14 rpd_setQueueSize function 16 14 RPL files log files 4 21 to 4 22 runtime object status and value 4 27 to 4 30 runtime errors database access object 15 9 logged in Logger 4 14 user object message 22 20 RVR application files Rapid Reviewer 28 1 RXD files XML application files 2 2 S saveAreaAtx y width height 12 38 saveAreaAtx y width height in 12 39 SaveRecorderFile method 18 43 SaveState
62. 3 Click the Paste button the Paste Conflicts Duplicate Elements dialog box appears see Resolving Duplicate Element Conflicts on p 6 15 with the Keep Both button in focus 4 Click the Keep Both button the copied object is added to the Nongraphic Objects list and a numeric suffix is added to its name NOTE If you have copied a nongraphic object and then closed the Nongraphic Objects dialog box you can choose Edit Paste Nongraphic to paste the object Duplicating a Nongraphic Object The Duplicate button is used to copy and paste nongraphic objects within the same application It cannot be used to copy objects to other applications To duplicate a nongraphic object 1 Select the object in the Nongraphic Objects list 2 Click the Duplicate button the Duplicate dialog box opens Duplicate Time1 x Duplicate String1 x New Obiect Name New Obiect Name men Cancel Er Cancel Help O as Constant Hep Sample Duplicate dialog boxes The as Constant option appears only for nongraphic objects that can be constant data objects When selected the duplicate object becomes a constant data object 3 Click OK If the as Constant check box is not selected the copied object is added to the Nongraphic Objects list and a numeric suffix is added to its name If the as Constant check box is selected the copied object is added as a constant data object MANAGING NONGRAPHIC OBJECTS 10 7 Deletin
63. 32 See also buffers graphic display graphic display objects graphic objects cutting and deleting 6 2 stack order 21 1 to 21 4 gridColor property 12 18 groups stack order of 21 2 to 21 4 H h files importing message structures 22 24 to 22 27 has transactions condition 15 12 holder objects 10 12 hold constant set properties 27 15 hold data container 22 22 to 22 23 of arrays 10 15 of data stores 10 22 host document See Rapid Simulator ActiveX object If else branches defining 7 12 to 7 14 execution of logic 7 17 indentation 7 9 nested branches 7 14 overview 7 12 using constant objects 7 15 image data type JavaBean objects 19 8 image management options 13 3 image objects changing colors 13 9 to 13 10 overview 13 4 setting image manipulation mode 13 5 to 13 6 examples of usage 13 7 13 9 using in a graphic display 12 25 using PNG images for transparency 13 10 importing data into arrays 10 18 data into data stores 10 23 data to a constant set object 11 5 to 11 6 multiple bitmap files 27 11 structures 22 24 22 26 insertColumns copiesOf atColumn 26 9 insertRows copiesOf atRow 26 9 Inspector windows 4 27 to 4 30 instancesOf fromRow fromColumn toRow toColumn 26 9 integer objects 10 10 size for C code generation 10 33 intermediate buffer See buffers graphic display Internet Packager 27 5 iPack exe 27 5 is active condition 22 19 Java console 19 19 Java Virtual Machine 19 19 JavaBean objects adding to Ob
64. 4 events in RapidPLUS 17 19 to 17 20 generating from RapidPLUS 17 25 incompatibility with RapidPLUS 17 23 invalid control 17 2 methods in RapidPLUS 17 18 non windowed to windowed changing 17 8 online help 17 6 overview 17 1 portability 17 4 properties in RapidPLUS 17 17 RapidActiveXHelper object 17 20 to 17 22 registering in object palette 17 2 stack order z order 17 7 to 17 8 variant system object 17 10 verbs 17 20 add 15 11 adding nongraphic objects 10 2 anyMessageReceived event 22 17 22 22 AppActiveXGen exe 17 24 to 17 28 Application Packager 28 1 to 28 11 Application property 18 34 application termination debugging 4 18 ApplicationEventTriggered event 18 46 ApplicationPropertyChanged event 18 15 to 18 18 18 46 applications comparing in the Differencing Tool 3 4 naming 27 2 packaging in the Application Packager 28 1 properties 1 11 Log check box 1 12 1 19 3 11 upgrading 1 10 XML 2 1 to 2 14 See also XML applications See also projects Applink objects closing channels 16 3 getting data from 16 12 naming channels 16 3 opening channels 16 3 polling for data 16 16 queue size 16 14 receiving data 16 5 16 8 sending data 16 4 16 6 transmission modes overwrite 16 2 16 14 queued 16 2 16 10 16 14 Index 2 array objects 10 14 to 10 21 creating object arrays 10 18 default maximum size 10 30 importing data into 10 18 to 10 21 maximum size for individual objects sorting 26 4 to 26 7 See also one dimensional
65. 4 21 HA amd which application modes are to be Modes logged according to the filters defined in the Filters tab General Options The General tabbed page presents options for coordinating the application execution in the Prototyper its logging and following its logic in the Logic Editor General Filters User Objects Modes Check this option to force logging in real time Uncheck this option if logging NOTE You can also set affects the execution of the application e these options directly in A Synchronize logging with the logics execution the Debugger s Options menu without opening this dialog box Check this option if you want the Logic Editor to jump to the line of logic that is about to be executed whenever the Prototyper is paused A Follow execution Check this option if you want to break at or step through the logic that is performed after pressing the Prototyper s Stop button LJ Debug application termination 4 18 DEBUGGING APPLICATIONS Synchronizing the log with the logic s execution Selecting this option updates the log when the log pane is open at the end of the current state machine cycle Clearing this option updates the log when the Prototyper is idle and waiting for user input or when paused by a breakpoint after a step or by clicking the Pause button NOTE When looking for timing problems in an application it is advisable to clear this option When
66. 47 UserCursor objects 10 40 UT8 support 26 4 UXO files XML user object files 2 2 Vv variant system object 17 10 verification test 9 1 to 9 8 in projects 9 2 logic warnings 9 5 to 9 6 verifying logic after pasting 6 12 in Logic Error View reverifying 5 6 version control using XML files 1 16 to 1 19 Visio see state chart exporting to Visio WwW WGL 20 2 WGL functions 20 11 Index 14 While loops break continue 7 10 defining 7 4 to 7 5 execution of logic 7 16 indentation 7 9 overview 7 3 wild cards Find and Replace dialog box 8 3 WindowHeight property 18 37 WindowLeft property 18 37 WindowPositionChanged event 18 48 WindowSizeChanged event 18 48 WindowTop property 18 37 WindowWidth property 18 37 X XML applications clearing the Log check box 1 19 3 11 CSX file code generation preferences 2 10 editing 2 11 to 2 13 errors when opening 2 4 to 2 5 indentation in output files 2 6 opening 2 3 output file structure 2 6 to 2 10 saving 2 2 schema file 2 6 2 11 2 13 team development and version control 1 16 XML editors 2 11 to 2 12 XML reports 25 22 to 25 34 Z z order XML See stack order
67. 6 20 9 text display objects 26 22 three segment pointer offsetting the middle segment 26 20 time objects 10 34 to 10 38 timer objects 10 35 timer tick objects 10 38 ToolBook adding a Rapid Simulator ActiveX object 18 4 viewing a RapidPLUS simulation 18 8 touch screen objects 14 1 to 14 3 transactionBegin 15 12 transactionCommit 15 12 transactionRollback 15 12 transition conflict defined 6 8 resolving 6 18 when pasting modes 6 13 TriggerApplicationEvent method 18 45 true color graphic displays See graphic displays two dimensional arrays assign function changed 26 17 clearing specific elements 26 13 columns defined 26 8 examples of usage clearing a section 26 13 getting a two dimensional array 26 13 inserting columns rows 26 14 overwriting with another array 26 15 pulling pushing columns rows 26 16 getting a one dimensional array from a column orrow 26 9 two dimensional arrays cont getting a two dimensional array 26 8 getting number of columns or rows 26 9 getting number of instances of specific value 26 9 inserting a one dimensional array as column or row 26 9 overwriting column or row with one dimensional array 26 10 overwriting with two dimensional array 26 10 rows defined 26 8 searching for values 26 11 setting number of columns and rows 26 12 sorting multiple columns 26 6 U undo command 8 8 27 6 to 27 8 actions that cannot be undone 27 7 Unicode support 26 4 for language localization 10 43 up
68. ACCESS OBJECT if you use thisoperator BETWEEN A record will be included in the query result if the field s value is Between the specified integer or number values in the Value box For example the SOL clause WHERE employees employeeRate BETWEEN 5 1 AND 8 7 only includes records whose employeeRate field value in the employees table are between 5 1 and 8 7 NOTE Compare this with the example used above for the relational operators IN NOT IN Included not included in the list of strings specified in the Value box For example the SQL clause WHERE departments deptName IN SPORTS CLOTHING only picks out records where the value of the deptName field in the departments table is SPORTS or CLOTHING LIKE NOT LIKE The same not the same as the string specified in the Value box NOTE In the Value box you can use an underscore _ as a single character wildcard or a percentage sign as a substring wildcard where the substring can be of zero length For example the SQL clause WHERE dictionary phrase LIKE E R_ will include records where the phrase field value in the dictionary table is ERA or ENQUIRY NOTES To remove any filters from the selected field select lt no condition gt in the Condition list To create a parameterized value for a condition operator enter a question mark 2 in the Value box You can then use the field s setParameter functio
69. Buffer Clipping Rectangle on pp 12 47 If due to location and or size the active buffer s bitmap exceeds the dimensions of the intermediate buffer it is clipped like any bitmap or graphic element drawn on the graphic display Buffers and the drawing mode You can set a buffer s drawing mode to normal reverse or XOR as described in Setting the Drawing Mode on pp 12 33 to 12 36 However the drawing mode only affects how graphic elements are drawn on the buffer itself All transfers between buffers or between the active buffer and the intermediate buffer are implemented in the normal drawing mode Setting and Getting the Active Buffer To set the active buffer C eo Use the setDisplayBuffer function as follows GDO1 buffer setDisplayBuffer 3 NOTE Using O zero as the parameter makes the intermediate buffer the active buffer WORKING WITH BUFFERS To get the active buffer e The getDisplayBuffer returns the index of the active buffer as follows Int1 GDO1 buffer getDisplayBuffer Clipping Rectangles The graphic display and each of its user defined buffers have clipping rectangles The functionality of the clipping rectangles differ depending on whether the clipping rectangle is defined for the graphic display or for a user defined buffer Device Clipping Rectangle The graphic display s clipping rectangle is referred to as the device clipping rectangle It determines the location that is valid
70. Click the Constant Data class button then select an object button Integer bes Constant integer Mali Constant number Constant string 2 Edit the object s name as desired and click More to open its dialog box ADDING CONSTANT OBJECTS 3 Specify the value of the object Remember that this value cannot be changed during runtime 4 Click OK the object is added to the Constant Data class in the Nongraphic Objects dialog box where you can edit or delete it like any nongraphic object NOTE You can duplicate a constant data object either as a new constant object or as a regular variable RapidPLUS data object For details see Duplicating Constant Objects on p 11 6 To add a constant array object 1 Click the Constant Data class button then click the Constant Array button 2 Define the constant array as you would define a normal RapidPLUS array For more information on arrays see pp 5 11 to 5 14 in the Rapid User Manual NOTE A constant array can be of integer number or string type It cannot however be an array of objects Using the Duplicate Operation to Add a Constant Object You can duplicate an existing data object that is integer number string or array and turn it into a constant object To add a constant object by duplicating a data object 1 Open the Nongraphic Objects dialog box 2 Select the integer number string array object and click Duplicate The Duplicate dialog box op
71. EXTERNAL APPLICATION 16 13 Parameters channelld The channel s ID type Output pointer to data type data Pointer to the buffer in which received data is placed size Input length of buffer in bytes output size of data in bytes Return values RPD_SUCCESS No error RPD_ER_CHANNEL_NOT_OPEN The channel is not open RPD_ER_BUFFER_SMALL The buffer size is too small RPD_ER_NO_DATA The buffer is empty To check if there is more data in the shared memory file e Use the rpd_checkForData function Syntax long rpd_checkForData int channelId Parameters channelld The channel s ID Return values RPD_SUCCESS No error RPD_ER CHANNEL NOT_OPEN The channel is not open APPLINK OBJECT 16 14 Setting and Getting the Transmission Mode To set or get the transmission mode e Use the rpd_setMode and rpd_getMode functions Syntax int rpd_setMode int channelld int mode int rpd_getMode int channelld Parameters channelld The channel s ID mode Queued or overwrite Return values RPD_SUCCESS No error RPD_ER CHANNEL NOT_OPEN The channel is not open Setting and Getting the Size of the Queue To set or get the queue size e Use the rpd_setQueueSize and rpd_getQueueSize functions Syntax long rpd_setQueueSize int channelld long size long rpd_getQueueSize int channelld USING RPD_MEM DLL IN AN EXTERNAL APPLICATION 16 15 Parameters channelld The channel s ID size Size of the queue
72. IN THE APPLICATION LOGIC 20 9 Initializing and Using Quadric and Tessellator Data Objects RapidPLUS allocates memory for each quadric or tessellator data object added in the Object Layout see Adding Quadric and Tessellator Data Objects on p 20 6 Before you can use the object as an argument in a GLU function however you must initialize it by assigning the result of the gluNewQuadric or gluNewTess function as follows quadric1 OpenGL1 gluNewQuadric tess1 OpenGL1 gluNewTess Once initialized you can use the object in a GLU function as follows OpenGL1 gluDisk_qObj quadric1 innerRadius 0 5 outerRadius 0 8 slices 10 loops 5 NOTE Using an uninitialized quadric or tessellator data object causes a non fatal runtime error Should the user choose to continue the object is automatically initialized The runtime error is only significant if the application is for code generation You have to delete initialized quadric or tessellator objects before terminating the application as follows OpenGL1 gluDeleteQuadric quadric1 OpenGL1 gluDeleteTess tess1 NOTE Terminating the application without deleting an initialized object causes a non fatal runtime error The object is then automatically deleted The runtime error is only significant if the application is for code generation Error Handling OpenGL essentially ignores errors generated during runtime RapidPLUS however captures OpenGL errors as non fatal
73. Management Options 2 In the dialog box under the XML Output group select the Include Object s Default Values check box WORKING WITH THE XML OUTPUT When selected RapidPLUS saves all object attributes in the XML file When the check box is not selected only the object attributes that differ from the default values appear in the XML file The internal resources of the saved RapidPLUS objects including bitmaps and other graphic objects as well as binary data of ActiveX and JavaBean objects are embedded inside the file using Base64 encoding Objects lt private gt Element sy lt private gt lt object class TopPanel name traffic gt File Edit Layout Group Objects pera lt gt oem l o a This is the top panel for the application lt note gt lt rect x 0 y 0 width 140 height 365 gt lt boolean name enableQuickDraw gt true lt boolean gt lt object gt lt object class Filled_Ellipse name gt lt rect x 18 y 299 width 98 height 34 gt lt short name lineWidth gt 2 lt short gt lt Color name forground rgb 128 128 128 gt lt Color name indication rgb 0 0 0 gt lt Color name background rgb 0 0 0 gt lt Color name shade rgb 0 0 0 gt lt object gt lt object class Solid Line name gt lt rect x 54 y 240 width 26 height 81 gt lt point name initialStart x 13 y 13 gt lt point name initialEnd x 13 y 68 gt lt
74. Microsoft Windows Print dialog box opens 2 Click Print OBJECT REPORTS 25 5 Editing Reports Saved report files can be viewed and edited in any text editor By default RapidPLUS displays the files in Microsoft Notepad You can change the default text editor in the Report Editor dialog box To edit a report 1 In the Application Manager choose Options Edit the Open Report dialog box opens 2 Select a file then click Open the report opens in the default text editor To change the default text editor 1 In the Application Manager choose Options Report Editor 2 In the Report Editor dialog box click the Browse button to select the text editor s executable file EXE OBJECT REPORTS RapidPLUS can generate four types of reports about an application s objects e Object Layout report e Object Tree report e Object Data report e Prototyper Layout report Instructions for creating these reports are presented below Object Layout Report This report is a printed snapshot of the application in the Object Layout To print an Object Layout report 1 In the Application Manager choose Reports Objects Layout the following dialog box opens GENERATING REPORTS 25 6 Objects Layout UNTITLED xl Percent of Page Size oo Cancel Help 2 Either accept or change the Percent of Page Size value then click OK The default size is 100 which means that the image will be scaled to print as large
75. NOTE During runtime transparency is only relevant for non windowed OpenGL objects as described in Windowed vs Non Windowed on p 20 4 20 5 OPENGL OBJECT 20 6 Adding Quadric and Tessellator Data Objects Some of the GLU functions that support the drawing of simple three dimensional geometric shapes i e cones cylinders disks and spheres take quadric data objects as arguments Similarly some of the GLU functions that support the drawing of complex polygons and surfaces take tessellator data objects as arguments In order to implement these functions as explained in Initializing and Using Quadric and Tessellator Data Objects on p 20 9 you must first add an instance s of the quadric or tessellator data object in the Object Layout To add a quadric or tessellator data object in the Object Layout e Inthe Object Palette select the OpenGL class icon and then the Quadric or Tessellator object icon NOTE A single quadric or tessellator data object can be shared among multiple OpenGL objects IMPLEMENTING IN THE APPLICATION LOGIC OpenGL Functions and Constants in RapidPLUS Syntax Functions The OpenGL RPX function names preserve the OpenGL names with the first argument concatenated by an underscore For example glVertex2f Glfloat x Glfloat y gt glVertex2f_x y The OpenGL and GLU functions are accessed in the Logic Palette through the OpenGL object s self property IMPLEMENTING IN T
76. NOTE Without running the updatePalette function palette color changes will not affect the display even when it is in updatelmmediately mode or the updateAll function has been called Example When your defined palette contains standard menu colors but a custom color is required to display a bitmap use this logic LCD1 setPalettelndex 3 toRed 255 green 192 blue 255 LCD1 updatePalette To restore the color palette defined in the Graphic Display dialog box use the resetPalette function This function also redraws the graphic display making color and all other changes immediately visible Clearing the Graphic Display There are three functions for clearing a graphic display FUNCTION DESCRIPTION clearDisplay Clears the graphic display of all graphic elements by setting all the pixels to the current background color When used with setBackgroundColor it changes the entire background color see p 12 17 clearDisplayUsingColor Clears the graphic display by redrawing all of its pixels in the specified color NOTE This function does not change the object s current background color clearAreaAtx y width Clears the rectangular area specified by the x y height width and height parameters using the current background color Example To clear the top half of a graphic display LCD1 clearAreaAtx 0 y 0 width LCD1 getWidth height LCD1 getHeight 2 DEFINING THE LOGIC 12 21 Checking Display Hei
77. Object Tree Report dialog box opens 3 Click OK the Report Viewer opens displaying the selected object s hierarchy You can print or save the report as explained in Working with Reports in the Report Viewer on p 25 3 Object Data Report This report is an ASCII text file that summarizes object information A typical report as viewed in the Report Viewer looks like this A Object Data Report for CDPLAYER File Edit Help 6 9 8 RAPID APPLICATION CDPLAYER 01 29 03 04 29 31 PM Object Data Report Parameters Scope Subtree Order Hierarchy Content Graphical objects parent type notes size position colors parameters properties l OBJECT pause_Pb Parent CD_Group Type Flat Pushbutton Note Pauses the music Parameters Position pxl 356 A 126 Size pxl 53 A 20 Dynamic false Drag n Drop false Momentary true Autorepeat false Autorepeat period 500 Long press period 2000 To generate an Object Data report For a report about a specific object select it in the Object Layout For a report about the application without its user objects be sure that no object is selected in the layout area GENERATING REPORTS 25 8 1 Inthe Application Manager choose Reports Objects Data the Object Data Report dialog box opens Object Data Report CDPLAYER Xx r Report scope E Selected application Object _Cancel E Subtree Help Selected application and its user ob
78. Options dialog box limit the logic types to Activities Transitions Mode entry exit and Runtime errors Then run the application with logging enabled and the Logger pane open At the time that the runtime error occurs the log entries are _ At this point Integer 1 1 B Pushbutton in i g Condition Pushbutton in amp Integer 0 false Bl Transition Mode internal Trigger Pushbutton in Start actions Actions for transition Mode internal f Action Integer changeBy 1 e Mode activity Display1 contents 100 Integer pei Runtime error Display1 contents 1007 Integer1 Division by zero 4 24 DEBUGGING APPLICATIONS From the log it becomes clear that the RapidPLUS state machine executes the mode activity before the transition takes place thus unintentionally causing a runtime error Very High CPU Usage Condition only triggers on internal or recursive i e from the mode to itself transitions are repeatedly evaluated the entire time that the mode is active This virtually constant evaluation places serious demands on the CPU during runtime and can visibly slow down the application s execution or cause other performance difficulties With conditions included in the logging filters it is very easy to spot condition only triggers that are constantly demanding CPU time Even when the Prototyper is idle i e waiting for user input in order to continue condition log entries are being contin
79. Palette and Logic Editor You cannot edit or delete the system objects ASCII This object allows you to assign ASCII codes and string characters with specific ASCII values ASCII code values 1 31 are non printing or control character codes that are functions of the ASCII object Code values 32 127 are keyboard characters Code values 128 255 use the Windows ANSI character set and hold a combination of graphics and foreign language codes Using the ASCII object in conjunction with the keyboard object allows you to test for when the user presses certain ASCII codes for example bs backspace and cr carriage return Examples This logic statement assigns the character whose ASCII value is 169 the copyright symbol TextDisplay contents ASCII withValue 169 This logic statement changes a single byte 1 in the middle of a string toa double byte 1 string 5 ASCII withValue string 5 ASCIIValue 0x8e00 Keyboard When the keyboard object is activated Keyboard activate it allows the computer keyboard to become an object that you can use during runtime For example you could use the keyboard to enter text into a text display or text window The event keyUp is generated after a keypress when a key is released SYSTEM OBJECTS 10 43 Language The language object enables language localization Localization refers to switching among languages during runtime in order to display multi lingual text stri
80. RapidPLUS Help RapidPLUS offers you Help on procedures menu commands dialog boxes and object properties and functions You can open Help by choosing Help Rapid Help Topics in any of the RapidPLUS windows All of the RapidPLUS dialog boxes have a Help button allowing you to get explanations on how to use the dialog box 2 R You can also get context sensitive Help on a particular item button menu command etc by clicking the Help button in the tool bar and then clicking the item NOTES To get Help on a menu command or on a function in the Logic Palette you can also highlight the command or function with the mouse or using the keyboard arrow keys and press Fl 1 1 Managing Projects The main RapidPLUS application the RPD file typically includes multiple user objects the UDO files which themselves often contain other user objects Each user object is an autonomous unit which exists independently of the applications that include it When editing affects the interface of the user object to its parent application RapidPLUS automatically updates the interface and reverifies the logic In this chapter we use the following terminology A project is a RapidPLUS application RPD or UDO file that includes user objects Project components are all the applications that make up the project i e the RPD file and each of its UDO files Main application is used exclusively to refer to the RPD file RXD and UXO f
81. Records view In the logic you refer to each record by either its number or name Data Store Data_Storel mu Number Number of Records 1 4 Goto 6 2 Update 1 ruty fa F Tiger Records To edit field values 1 Select the cell you want to edit by clicking it or by moving to it using the Ctrl arrow keys 2 Overtype the element s value Importing Data into Data Stores Data can be imported into data stores from TXT CSV and RDS files e RDS files are RapidPLUS files that are created via data store logic e CSV comma delimited files are created in Microsoft Excel e TXT files are created in Microsoft Excel or any text editor TXT files containing Unicode cannot be imported Before you import data into a data store the data must be formatted correctly RDS files have preset formats that are created when the objects saveToFile function is used See Formatting Data in Microsoft Excel CSV files on p 10 24 and Formatting Data in a Text Editor TXT files on p 10 25 for information about formatting the files 10 24 NONGRAPHIC OBJECTS To import data into a data store 1 Open the data store s dialog box 2 If the data you will be importing includes all the information that is field names record names and element values click the Import button If the data you will be importing includes element values only add the appropriate fields then click the Impo
82. State Chart Plot the State Chart Plot dialog box opens MODE REPORTS 25 11 x Mode Name Cdplave No of Levels E Cancel Minimum Name Length E Font M Transitions Help Numbered e A Show m Size E Single Page Full Size In the No of Levels box specify how many mode levels you want to show below the selected mode In the Minimum Name Length box specify a limit for the length of mode names at the lowest plotted mode level which is based on the widest character of the selected font If you want to display transitions in the plot select the Show check box in the Transitions group If you want the displayed transitions to be numbered select the Numbered check box In the Size group select either Single Page or Full Size The Single Page option restricts the plot to a single printed page The Full Size option prints at the default size The single page format may be more convenient but the full size output usually provides a clearer result NOTE The minimum name length that you specify determines the size of the Full Size plot If you plot Single Page RapidPLUS may reduce the specified number of characters printed in order to improve clarity GENERATING REPORTS 25 12 Mode Tree Report This report is an ASCII text file that presents the hierarchy of the application s modes A typical report as viewed in the Report Viewer looks like this FI Edit Help slala
83. The arc is then drawn between the radial lines in a clockwise direction from the position on the start point radial line determined by the radius parameter to the end point radial line DEFINING THE LOGIC 12 29 In the following illustration the imaginary radial lines are represented as dashed lines and the center start and end points as small filled circles GDO1 drawArcAtcx 20 cy 20 radius 15 fromX 10 fromY 8 toX 30 toY 15 Result End Result NOTE The start and end points are only for drawing the imaginary radial lines and do not have to coincide with the points where the arc begins and ends The points where the arc begins and ends are those where the circle drawn with the specified center point and radius intersects the imaginary respective radials In the top illustration the arc s end is not identical with the end point parameter while in the bottom illustration the arc s beginning does not coincide with the start point parameter GRAPHIC DISPLAYS 12 30 Drawing Empty and Filled Circles and Ellipses The graphic display has four functions that facilitate drawing empty or filled circles and ellipses They are drawn in the graphic display s draw color by default black To draw an empty or filled circle e Use the drawCircleAtcx cy radius or drawFilledCircleAtcx cy radius function specifying the circle s center point and its radius Current draw color Center point show
84. VIEW Ctrl T Ctrl I COLUMN DESCRIPTION Contained In Lists the mode or user function to which the item belongs as follows e For an activity or action shows the mode name e For a trigger shows the source mode name e For a user function shows the user function name e Foran invalid RXD or UXO file this column is blank Text For logic lists the complete logic statement in which the edited item is contained For XML text lists the validation problem and its location line and column numbers in the XML file REVERIFYING LOGIC With the Logic Error View you can locate the problematic logic lines in the Logic Editor After you correct errors you can use the tool to reverify the logic and thus automatically remove the comment marks To correct an error 1 In the Logic Error View select a logic line 2 Choose Logic Go To or click the Go To button Alternatively double click the logic line 3 Correct the invalid logic as required e g add a missing item change an object s properties update the Mode Tree 4 Choose one of the Reverify options from the Logic menu or click one of the Reverify buttons in the Logic Error View If the logic is valid reverification will remove the comment marks and explanatory comments The invalid logic icon X will change to the valid logic icon If the logic is still not valid after reverification the invalid logic icon changes to the edited logic icon 1 Although
85. a source object see Source Element RPSource below containing notes about the object the same notes that are entered in the Application Manager s notes area Nested elements that apply to graphic object elements only These elements apply to objects defined as RPGraphicWrapper RPBitmap Object and RPImageObject TAG DESCRIPTION _left_top The bounding box of the object _right_bottom Source Element rPsource RPSource is a generic placeholder for text such as notes and logic Its nested tags include TAG DESCRIPTION text The element s source text as it appears in RapidPLUS GENERATING REPORTS 25 30 Mode Elements and Their Nested Tags This section presents important tags for the RapidPLUS modes Mode Elements TAG RPRootMode DESCRIPTION Root mode of the application RPXorMode Exclusive mode RPAndMode Concurrent mode Nested elements that apply to modes TAG _parent DESCRIPTION IDREF to the mode that is the parent of this mode _children List of modes that are children of this mode Contains the following nested tags count number of children _ children for each child mode an IDREF to the child _transitions List of transitions from this mode to other modes or internal transitions within the mode Each entry in the list is an IDREF to a transition element see the four transition elements described in the section Method Blo
86. about to be executed is highlighted in the Logic Editor e A breakpoint button in the Debugger window may turn yellow Status Messages The following status messages are displayed in the Debugger window status line and are reflected in the window s title bar DEBUGGER STATUS Stopped STATUS MESSAGE Ready to start Started in run mode Prototyper Running Started in stepping mode For destination mode entry and mode exit lt mode name gt Stepped At lt logic line description gt such as Destination Mode Entry Exit Activity Trigger etc For triggers actions and activities the actual logic line as it appears in the Logic Editor Paused by the user when no logic line is being executed such as when the application is waiting for user input lt mode name gt User Break At Idle Paused by the user at a trigger action or activity The logic line as it appears in the Logic Editor STEPPING INTO APPLICATIONS 4 9 DEBUGGER STATUS STATUS MESSAGE Paused at a breakpoint lt mode name gt Hit Breakpoint At lt breakpoint location gt such as Mode Exit Entry Activity etc In run or stepping mode when Prototyper Running a user action is required to continue The background of the status line message is yellow when no logic line is highlighted in yellow in the Logic Editor The background of the status line message is gray when a logic line is highlighted in the Logic Edit
87. alpha channel can be set during runtime using the setAlpha function NOTES The drawing of transparent PNG images is available from RapidPLUS 8 0 PNG images used in earlier versions of RapidPLUS will look differently in version 8 0 This feature is not supported for code generation however you can write code to support it in a customized format driver or replace the supplied graphics library FONT OBJECT 13 11 FONT OBJECT In the Object Palette the font object is located in the Display object class It is a nongraphic object that makes it possible to display text in a graphic display The font object is used in the Logic Editor to define the active font for the graphic display Without an active font object you cannot display text in a graphic display The Font Object dialog box is used to select the font and its attributes The default font definition is MS Sans Serif Regular 8 Font Object Font_Object1 Name MS Sans Serif Style Regular Size 8 13 Opens the Advanced dialog box for setting C code generation options see p 13 12 Change font settings To change the font settings 1 In the Font Object dialog box click Font a standard Windows font dialog box opens Font 12 x Font Font style Size Regular T Narkisim amp NewCenturySchlbk Bold Italic E Palatino O Palatino Linotype od AaBbYyZz Sample List of the available language scripts
88. application If you select 12 hour format you can edit the AM PM text If you select 24 hour or Unlimited format you can add text that will appear after the time e g hours Leading Zero When selected adds a zero before single digit hours e g 09 10 38 NONGRAPHIC OBJECTS OPTION DESCRIPTION Show Seconds When selected the seconds are displayed e g 8 23 00 Separator Sets the character that separates the hours minutes and seconds Initial Value Sets the time to either the current system time or to a manually selected time al TimerTick External Object A timer tick object is a nongraphic object similar to the timer object but more economical for C code generation Like the timer it generates an event tick at the end of a specified period but it does so without using a counter It therefore consumes less RAM in the generated application but should only be used when manipulation of the timer counter is not required The dialog box is used to set the period in milliseconds at the end of which a tick is generated The default period is 1000 msec SIGNAL OBJECTS This class of nongraphic objects comprises objects that emit some kind of signal either e To the user such as an audible beep e To RapidPLUS to instruct it to carry out some operation Event The event object is used to simplify RapidPLUS logic when designing complex applications For example you can generate the event
89. application for a pane the two applications are automatically compared Whenever you make a change in the application that is currently open in RapidPLUS the Differencing Tool prompts you to reload the application To manually compare the applications e Choose Edit Compare To compare one branch 1 Click a tab to choose a view Project Mode Object etc USING THE DIFFERENCING TOOL Na 1 3 5 2 Select an item in the tree and click the Compare Selected button NOTE The comparison operation is based on the text of the compared items If the items differ textually they will show up as different For example if a logic line in Application 1 is written as Lamp1 lt space gt on and in Application 2 as Lamp1 lt space gt lt space gt on the Differencing Tool will see them as different Comparing Project Components When you compare applications that contain components i e user objects you can compare the components without having to open each component separately To compare project components These instructions assume that the projects in the panes are different 1 In the Project view select one of the components listed under Application Components If this component exists in both projects and the Synchronize Selection option is selected it will be selected in both panes 2 Click the Compare Selected button Comparison Table The following icons and colors are used to illustrate differen
90. be changed when those changes are visible and whether you can scroll both backwards and forwards through the records See the following sample database DATABASE ACCESS OBJECT 15 6 Choose the desired query type The options are described in the table on the following page to or edit the database during runtime DB1 Selection Advanced SaL Select data source j RAPID46 Db employee Le 4 Read Only Table Query Type employees gt Ej Dynaset Snapshot Forward only Available Fields Selected Fields employeelD employeeName employeeR ate deptID 4 Query at start up When selected the SQL query runs when the RapidPLUS application is started in the Prototyper Add gt employeelD employeeN ame employeeR ate deptlD r Selected field fullname employees employeeName When selected you cannot add Sort l None When selected records with duplicate field values are not included in the query result Ascending E Descending r Condition fis NOT NULL Value s following page The data in the selected field is sorted in the order found in the data source none from the lowest value to highest value ascending from the highest value to the lowest value descending Select an operator from the list and enter a value in order to restrict the records included in the result of the SQL query The opera
91. box the Non cumulative options are unavailable To perform manipulations on the original image 1 Clear the Cumulative changes check box the Non cumulative options are available 2 Select either the Logic Editor order or the Predefined order IMAGE OBJECT Examples of Usage 13 7 The following examples illustrate the differences among the three image manipulation modes The same block of logic produces different results when applied to the same image The result varies according to the selected manipulation mode This is the original image This block of logic is applied to the image magel loadFromFile ciwinntpenguins bmp magel reshapeTo 31059 size 18089180 magel invert magel mirror magel flip magel invert magel invert magel changeRedBy 200 magel changeRedBy 80 mage rotateBy 90 mage rotateBy 90 13 8 BITMAP IMAGE AND FONT OBJECTS Cumulative changes manipulation In this mode each manipulation is applied directly to the image so the original image ceases to exist as soon as the first manipulation has been applied Each manipulation adds on to the current image So since the image was rotated 90 and then 90 it ends up non rotated Note that our image is flipped but not rotated Non cumulative changes Logic Editor order manipulation In this mode all manipulations are always applied to the original image When there are sev
92. cannot be dynamically resized during runtime and functions that modify the array size are not available These arrays cannot be used in logic that requires a dependency on them i e condition only transitions mode activities or exported conditions Definitions for Individual Integer Objects You can set the size of the C code that is generated for an integer object by selecting the data type that is generated for it By default an integer object is generated as a RapidPLUS object which endows it with certain characteristics including an ID number and the ability to be used in logic with dependencies i e condition only transitions mode activities or exported conditions The generated integer object has a structure which uses more memory than a generated primitive integer To reduce the memory used by the embedded system you can generate the object as a primitive data type however primitive integers have less features If you generate the object as a primitive type you cannot set bounds for it You also cannot use it in logic that requires dependencies as mentioned above To generate an integer object as a primitive data type 1 In the Integer dialog box click the Advanced button The Advanced Options dialog box opens 10 34 NONGRAPHIC OBJECTS Advanced Options Ace E Rapid Integer C I Primitive _Lancel long O unsigned Help short char 2 Select either long 32 bit short 16 bit
93. constant integer and can be used wherever an integer is required Examples Language set Language Korean Integer1 Language Korean Example In a cell phone application you want to provide a choice of display languages You first organize the various display strings in a two dimensional array with a column for each language Then to switch from one language to another during runtime you use the following logic sequence Display1 clearDisplay Clears the display Language set lt New_Language gt Sets the new language Display1 fontSet lt Font_Object gt Sets the appropriate font for the new language The font must be defined with the appropriate script for the active language Display1 drawText Array1 lt Lang_ID lt String_ID gt atx 10 y 30 Displays the string in the proper language on the specified area of the graphic display object This logic sequence is repeated for each language switch SYSTEM OBJECTS Organizing multi lingual text strings RapidPLUS supports multi lingual text strings which are typed into an array file RAR using an editor that is capable of saving in double byte or has a screen font option such as KEDIT The text strings are then loaded into a RapidPLUS array with the loadFromFile function e SIM has a tool for managing multi lingual text strings that is based on a Microsoft Excel spreadsheet For information about this tool please refer to the e SIM FTP site in the Widgets a
94. controls used in RapidPLUS simulations may not have been written or tested for portability and may not function properly when moved to another platform If your simulation is required to run on multiple platforms please check that its ActiveX controls also meet this requirement ACTIVEX CONTROLS IN THE OBJECT LAYOUT Changing Parameters Some ActiveX controls have parameters that can be changed during design time To change an ActiveX control s parameters 1 In the Object Layout open the control s parameter pane as you would for any graphic object Change its name size location and parent as desired ACTIVEX CONTROLS IN THE OBJECT LAYOUT 17 5 2 Click More to open the following dialog box A typical ActiveX control More dialog box ActiveX Properties Calendar_Control_8_01 r Object creation Windowed objects always appear on top of non windowed objects The behavior of windowed objects may be somewhat different than non windowed objects m Windowed Non windowed pObject properties Properties Constants Ze a Click to open tl Properties Browser For an explanation of these options see ActiveX Control Windowing and Stack Order Z Order on p 17 7 Cancel Whfn available click to view the control s constant sets enumerations and create equivalent RapidPLUS constant sets for use in the Logic Editor See Viewing and Creating Constant
95. deleted If you have specified a user object UDO as an argument or return type you will get a warning if you try to delete the last instances of that object type The warning reminds you that the object is used in logic and allows you to comment out the affected logic remove the logic or cancel the operation If you do delete the objects e The argument type is changed to Integer e The return type of the affected function is changed to void no return LOGIC EDITOR 27 23 If you replace the last instance of a user object with another the replacement is automatically made in any user function that uses this type as argument type or return type Viewing Values of Local Variables and User Function Arguments The values of local variables and of user function arguments are displayed in the Logic Palette s Object list when the Prototyper is paused at a breakpoint or when stepping in logic Each time a breakpoint is reached the values are updated The following illustration shows how status information is presented for local variables and user function arguments Object Property Function Local variables lt anArray gt Array Array lt D 3 a lt p 2 lt tempMax gt 0 Application Data abs Array arcCos arcSin newBlinkPeriod arcTan Lamp asBinaryString System asHexadecimalString asNumber bit nd fu Logic Editor Edit Activity Function File Edit View Logic Functions Debug Opt
96. different component from the Project Components list When you start the Prototyper e When you save the application e When you start the Code Generator Invalid logic is displayed in the Logic Error View window REPLACING AND RENAMING USER OBJECTS You can replace one user object by another You can also use this option to rename user objects NOTE You cannot replace nor rename the main application You can however use the Save as option to create the main application with a different name Replacing a User Object To replace a user object 1 Choose File Advanced Replace User Object the Replace User Object dialog box opens 1 8 MANAGING PROJECTS 2 Select the user object you want to replace Replace User Object x Replace user object TIMER DARAPIDASPPLICSATIMER y With User object m If the entry is not the name of a user object the original user object will be duplicated with the new name and replaced by the duplicate copy Cancel Heip To rename type in the new name for the user object Verify that a user object with this name does not already exist Browse To replace browse to select the substitute user object 3 Browse to select the substitute user object or type its name into the box 4 Click OK All the references to the original user object in the interface to the parent application as well as in all the relevant holders and arrays are aut
97. ee 14 3 CHAPTER 15 DATABASE ACCESS OBJECT o oooooooo oo 15 1 Adding in the Object Layout 2 2 ooo 15 2 Defining the Database Access Object o o o o oo ocooocooo es 15 2 Accessing a Database cn eek a E 15 3 Selecting Tables and Fields Database ooo oo 000084 15 4 Configuring the Query cota a ee Beak A A da 15 5 Working with Microsoft Excel Spreadsheets o ooo ooo o 15 9 Defining the Logic a EA A hy AA he de RE 15 9 Navigating Among the Records o o oo ooo coo o e 15 9 Changing Database Records 1 0 ooo o 15 10 Performing Transactions ie os Sn A da A es PS 15 12 Modifying Queries Dynamically o ooo ooo o 15 13 Sending Non Query SQL Statements 2 0 0 0 0 0 00000000048 15 14 Error Handling Vcc 4 0 0 oes Ros ea teed Le eo he oot dade 15 15 CHAPTER 16 APPLINK OBJEC Tiie ih vaa is ECG ee EV Ee EES ENS 16 1 Adding an Applink Object in the Object Layout 000 16 2 Using the Applink Object 0 0 0 0 0 00 02 eee ee eee 16 3 Opening and Closing a Channel o ooo oo eee 16 3 Sending Data ooo sek tare SER A teas Sew oe ke we 16 4 Receiving Datars age at anes beeps A beens ap Seberang geen 16 5 Logic Examples 223 e 3S Sea fe ts E le Ny A ee Bay 16 6 Example 1 Sending Data to an External Application 16 6 Example 2 Receiving Data from an External Applicati
98. file contains Age number Animal string Gender string element values field Fluffy 1 5 cat F names and types and Tiger 3 cat M record names Fido 25 dog M Cookie 4 dog F The empty space tab Mozart 1 cat M at the beginning of the file informs RapidPLUS that the values listed in Column A will be the record names in the Data Store Data_Store3 data store The CSV or TXT file imported into a data Record Number _ of Records store 1 Goto 6 E Update __ Name Age Animal Gender Notice that the Name a Fue ME Jos r column contains the values that appear in the first column of the CSV and TXT files The data store above shows a data store that received all of its values from an imported file DATA OBJECTS 10 29 Point x y Point The point object is a variable that holds a RapidPLUS coordinate x y You can use the point object to move dynamic graphic objects It is especially useful when your application contains several modes and you have an object that moves to different positions in each of the modes It is also useful when you want to place several objects in the same position In addition you can use the point object to resize dynamic active primitive objects You can assign its value to the e size property for frame imported bitmap and title text objects e radius property for circle objects e start and end properties for line objects The Po
99. fonts using with the font object 13 12 sort 26 6 sortAscending 26 4 sortDescending 26 4 sorting data in database access objects multiple key 26 6 to 26 7 single key 26 4 to 26 5 sound objects 10 39 Source property 18 37 SQL Structured Query Language sending non query statements stack frame activating 4 27 stack order ActiveX controls 17 7 to 17 8 graphic objects 21 1 to 21 4 in XML code of application files 2 8 JavaBean objects 19 5 OpenGL objects 20 4 Start method 18 45 State Chart Plot 25 10 state charts exporting to Visio 24 1 to 24 6 marking logic lines for export 24 5 schemes 24 6 unmarking logic lines for export 24 5 state files Rapid Simulator ActiveX object 18 33 state matrix exporting logic to Excel 23 3 to 23 4 marking lines for export 23 4 overview 23 2 unmarking logic lines for export 23 4 StateMachine object 10 45 Stepping buttons 4 7 stepping into user objects 1 3 Stop method 18 45 stopping Prototyper debugging 4 18 stopwatch objects 10 35 storing objects 6 18 string objects 10 8 default maximum length 10 30 maximum length for individual objects searching for substring 26 8 15 6 10 31 structures See user object messages Synchronize command Debugger and Logic Editor 4 9 to 4 10 system objects 10 42 to 10 46 SystemCursors 10 46 SystemDate object 10 46 SystemTime object 10 46 T Target Graphic Displays report 25 19 team development using XML files 1 16 to 1 19 tessellator data objects 20
100. fonts to the package select the Show System Fonts check box Select fonts from the system fonts list and click Add gt gt 4 When the right pane contains all of the additional files and fonts that you want to include in the package click Next Order of files in the Folders and Files to be Packaged pane The added files and folders are listed in the following order Folders Font files ActiveX objects DLL files JavaBean objects Files added from the Available Folders and Files pane N QA 0 Bb WN Application and supporting files Example Folders and Files to be Packaged Relative to Folder E Sort by Folder v Rapid applics CD_PlayeriDocs Rapid applics CD_PlayeriFonts Font Arial ARIAL TTF Font Arial Bold ASRIA4LBD TTF Font Courier New Bold COURBD TTF Font Digital Regular DIG___ OO TTF Activex WINNT System32 MSCAL OCX DLL Program Files iR apid R apidControl dil DLL rapid rapidres dil Rapid applics CD_Player CDPLAYER RPD rapid applics cd_player rap5 way Rapid objects HELP UDO APPLICATION PACKAGER 28 8 Step 3 Selecting Destination Folders Building the Package The third dialog box presents the destination folders and a summary of your settings The destination folders are FOLDER Package DESCRIPTION This destination folder contains all the setup files for installing the packaged application It will be created on your system when the packa
101. functions you reference palette colors by their respective indexes You also use the palette index to set the object s background color in the Graphic Display dialog box Creating a Color Palette This section applies to graphic displays and not to true color graphic displays You can create a palette for a graphic display and export it so that you can use it in the graphics tool you use to create your bitmaps NOTE The graphic display palette is independent of the RapidPLUS color palette To create a palette in RapidPLUS 1 In the Number of colors box select the palette size o E E OPS Space Screen pxls External palette Colors Read Advanced Number of buffers o Write Background color Help Number of colors 2 colors 1 bit 2 Click the Colors button to modify the palette For instructions see Defining the Palette for a Graphic Display on p 12 8 3 Click the Write button located in the External palette group The Save Palette File As dialog box opens 4 Either accept the default location the RapidPLUS folder and file name gdo pal or change them ADDING AND DEFINING A GRAPHIC DISPLAY Importing an External Palette This section applies to graphic displays and not to true color graphic displays You can create a palette outside of RapidPLUS through any program that produces a Windows PAL file or by writing the RGB values directly into the file and then importing it into Rap
102. gets the current value of the dial Dial 40 085041 When the Dial label is clicked the GetApplicationProperty method gets the current value of the dial HOSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS 18 14 GETTING DATA INITIATED BY THE RAPIDPLUS SIMULATION The following illustration shows how a change in the value of an exported property is sent to the host document Host Document Rapid Simulator ActiveX object b RapidSim notified about change Programming language c ApplicationProperty Changed event ApplicationPropertyChanged eoa handler called Rapid application a Value Exported changed properties i An exported property s value changes ii The Rapid Simulator object is notified of the change The type of notification can either be set in the object s Properties dialog box or in the host document s programming language These notification types are explained in Automatic notification on p 18 16 iii In the host document s programming language an event handler ApplicationPropertyChanged is written to get the property name and value from the Rapid Simulator The host document can then use the value For example it could display the value in another ActiveX control such as a Form label GETTING DATA INITIATED BY THE RAPIDPLUS SIMULATION 18 15 Procedure for Getting Data Initiated by the
103. graphic display have the same buffer functionality Click a buffer name to select i Y Generate true color bitmap Multiple selection is available for removing buffers Note that the names are for the purpose of display only In the graphic display functions buffers are always referenced by an integer parameter Graphic Display Advanced l x po t DLL oma i T Bitmap format DLL lt not defined gt Browse _Cancel J Generate palette Help Buffer Width Height j buffel 64 32 Case buffer2 64 32 Edit buffer3 64 32 Remove Buffers sizes A Adds another buffer of the default size _ Opens a dialog box in which you can change the width and or height of the selected buffer Removes the selected buffer s 2 To change the width and height of a buffer select the buffer and then click the Edit button which opens a dialog box for editing the size You can use a constant set to give meaningful names to the integer indexes used to reference buffers in the Logic Editor functions See Chapter 11 Constant Objects for information about constant sets CONNECTING AN EXTERNAL DLL TO A GRAPHIC DISPLAY Output of a graphic display can be drawn to an external device while the simulation is running in the Prototyper This output includes notification from RapidPLUS when the graphic display s contents change as well as the contents of the changed graphic display This commu
104. in the application folder Editing a PAK File in the Application Packager This editing method opens the Application Packager with the previous settings To edit the package file 1 Double click the lt application name gt PAK file 2 If you made changes to the application or any of its user objects click the Update Application Files button in the second dialog box It updates these files in the Folders and Files to be Packaged pane right pane 3 Add or remove other files as necessary 4 Click Next and then click Build The previously built package is replaced by the new package Editing a PAK File Without Opening the Application Packager This editing method contains a silent command that updates the Application Packager without actually opening it To edit the package file 1 Ina text editor create a BAT file with the following line C Rapidxx Packager Packager exe Silent C lt application path gt lt application name gt PAK For example C Rapidxx Packager Packager exe Silent C Rapidxx applics CD_Player CDPLAYER PAK 2 Each time you edit the RapidPLUS application or its user objects run the BAT file It automatically updates the PAK file and all the files in the destination folder DISTRIBUTING AND USING A PACKAGED APPLICATION 28 11 DISTRIBUTING AND USING A PACKAGED APPLICATION C TIP We suggest that you compress the files in the Package destination folder before you give them
105. internally and can be set to zero in the Logic Editor Same as above except that the pixels argument is a RapidPLUS bitmap of any size gluBuild1DMipmaps_target components width height format type data or gluBuild2DMipmaps_target components width height format type data The data argument must be a Windows bitmap with a height of 1 pixel The format and type arguments are set internally and can be set to zero Same as above except the data argument is a Windows bitmap of any size IMPLEMENTING IN THE APPLICATION LOGIC Implementing WGL Functions OpenGL is a graphics library leaving issues of user interaction and window handling to the host environment In order to allow window and user interface management in Windows a number of functions have been added to the OpenGL API The prefix for these functions is WGL The OpenGL object supports the following two WGL functions e wglUseFontBitmaps e wglUseFontOutlines NOTE These functions are not supported for code generation see Code Generation on p 20 12 Redrawing Swapping Buffers In order to support smooth drawing or animation Windows uses a double buffered pixel format In this format a window has a front displayed and back hidden image buffer Drawing commands are sent to the back buffer and the Windows SwapBuffers function has to be called to copy the contents of the hidden back buffer to the displayed front buffer The Ra
106. is the type of object user object is held but not an actual instance of the object user object NOTE Arrays and data stores can also be held by holders but not using the holder object For instructions about holding an array see Creating an Array on p 10 15 For instruction about holding a data store see Basic Steps for Creating a Data Store on p 10 21 An application can contain more than one holder but only one object can be held in each holder at a time In the application s logic you can only replace the object that is initially stored in the holder with objects of the same type To assign an object to a holder 1 In the Holder dialog box click the Browse button next to the Default Held Object box The Object Browser opens displaying a list of objects that have been added to the application Opens the Object Browser for selecting an application object m Default Held Object No Default gt Type sd Objects by Type lt No Default gt Time lu Show full path song_Stopwatch MultiMedia ae song_Wavy ane Cancel 2 Inthe Object Browser select an application object and click OK DATA OBJECTS 10 13 To assign an object type to a holder 1 In the Holder dialog box click either the User Object or the RapidPLUS Object button and select a user object type object type Opens the New Objects dialog box for selectin an object type Opens the Add User Object dialo
107. its interface are affected RapidPLUS can either mark these components as changed or not If they are not marked as changed they will not be saved unless you make direct changes in them Because the files are not saved RapidPLUS will perform the automatic interface update as described on p 1 4 each time the main application is opened which adds to the load time You can circumvent this process by using a command that updates the components that are affected by a changed component To update components that are affected by a changed component 1 Choose File Advanced Update Changed User Objects 2 Choose File Save All to save all the components Comparing Application and Component Versions You can use a version control system or a stand alone XML or compare tool to browse the differences between two versions of a RapidPLUS application or component Likewise you can use a directory comparison tool to compare two lists of project components TEAM DEVELOPMENT AND VERSION CONTROL USING XML FILES 1 19 Merging Applications and Components During group development developers may work in parallel on the same project or even the same component When the developers are ready to check in their versions they must merge the changes made on the same base versions The details of how to merge the versions depend on the version control system In RapidPLUS XML format every change in the application or component affects only a single plac
108. keypad button is pressed and then send the structure For example Transition internal Trigger Pb_1 in Actions keypad keyPress keyln ScanCode 1 keypad keyPress keyin send When this user object and its message interface is added to a parent application each key press generates a messageReceived event in the application You can use this trigger to activate application logic which for example displays the key s scan code Transition internal Trigger Keypad_UDO keyPress keyln messageReceived Actions Display1 contents append Keypad_UDO keyPress keyln ScanCode Message Sent from an Application to a User Object In your cellular phone application you may want to simulate the action of an outgoing call For example when the Send pushbutton is pressed in the application a structure is sent to a user object that represents the communications task of the embedded system In the RapidPLUS application you would assign values to the structure fields and then send the structure Your logic might look something like Transition internal Trigger Pb_Snd in Actions Calls_UDO Calls_union Call_Struct PhoneNumber Display1 contents Calls_UDO Calls_union Call_Struct callType 0 Calls_UDO Calls_union Call_Struct Time systemTime Calls_UDO Calls_union Call_Struct send 22 22 USER OBJECTS WITH MESSAGES The internal logic of the user object would then appropriately process the incoming message If the communications
109. lets you add custom cursors to your application to be used in the logic in conjunction with the mouse system object see p 10 45 for a brief description In this way you can specify a unique cursor other than the system cursors already supplied with RapidPLUS that will show when the mouse is located over a certain graphic object switch position group or user object You define a cursor by specifying a file in the UserCursor dialog box Cursor UserCursor1 x File name C Rapid rapidres ll C Resource name Pencil Hance Help He A sample UserCursor dialog box OPTION DESCRIPTION File name The name of the file containing the cursor definition either a CUR ANI EXE or DLL file You can click the Browse button to browse to the file Resource name If an EXE or DLL file is selected the resource name must be typed in Preview When clicked this button displays a preview of the cursor Message The message object displays a message in a pop up window In the Logic Editor you can construct actions and or activities that open and close the message in the Prototyper When you add a message object to the layout the Message dialog box opens together with the message window in the upper left corner of your screen SIGNAL OBJECTS The popup message window is designed here Message 10 41 Button Text Cancel A Closing Button T Font i hw Title DESSE Cl
110. manipulated via the RapidActiveXHelper object RAPIDACTIVEXHELPER OBJECT Nested properties of ActiveX controls are not visible in the Logic Palette A good working knowledge of the relevant ActiveX control is therefore necessary for successful manipulation of its nested properties via the RapidActiveX Helper object A RapidActiveX Helper object is added registered like any other ActiveX control The RapidActiveX Helper object has three functions setFocus getProperty and setProperty All three functions require an ActiveX control argument FUNCTION DESCRIPTION EXAMPLE getProperty_object Returns the current value of the String1 ActiveXHelper lt ActiveX_Object gt specified ActiveX control s getProperty_object name lt String gt property as a string Calendar_Control_8_01 name Year setFocus_object Places the specified ActiveX ActiveXHelper lt ActiveX_Object gt control in focus setFocus_object Calendar_Control_8_01 setProperty_object Sets the value of the specified ActiveXHelper lt ActiveX_Object gt ActiveX control s property setProperty_object name lt String gt Calendar_Control_8_01 value lt String gt name Month value 10 Manipulating Properties of Activex Controls The getProperty_object name and setProperty_object name value functions allow you to obtain and or change the values of specified properties of ActiveX controls These functions are especially us
111. memory makes it very easy to create a windowing effect in your application In the example application it is accomplished by two transition actions saving an area on the transition from display mode to message mode and restoring the area on the way back to display mode The saving transition action looks as follows Display1 saveAreaAtx LCD_WIDTH 2 POPUP_WIDTH 2 y 2 width POPUP_WIDTH height 45 in 1 where the area s x y coordinates and width height dimensions specify the area to be overlaid by the pop up message window and in specifies in which buffer to store the area in this case buffer1 The restoring transition action looks as follows Display1 restoreAreaFrom 1 where the area s x y coordinates and width height dimensions are unspecified indicating that these parameters should be taken from the last call to saveAreaAtx y width height and From specifies from which buffer to take the display the area in this case the same bufferl in which we saved the area of interest DEFINING THE LOGIC 12 43 Using the dump Function The dump function allows you to dump the display to a text file during runtime It can be useful in debugging the application When the dump function is first used it creates the file dumpgdo txt in the application folder Each time the function is called the graphic display map is added to the end of this file The function s string parameter provides a labe
112. mode and its child modes Cancel eik Exports selected mode and its child modes 4 Select the Export Logic format as follows e Marked exports a state matrix that displays modes triggers and destination transitions for the logic lines that you marked in the Mode Tree Logic Editor See instructions for marking and unmarking logic lines on the following page e All exports a state matrix that displays modes triggers and destination transitions for all logic lines both marked and unmarked None exports a state matrix that displays modes only 5 Click OK to export the data to Excel Excel opens displaying the spread sheet The new Excel workbook is automatically saved in the folder where the application is located 23 4 STATE MATRIX To mark logic lines for export e Right click the mode or logic line and choose Mark for Export or In the Mode Tree window In the Logic Editor window 1 Select the mode 1 Select the logic lines 2 Choose Tree Mark for Export 2 Choose Edit Mark for Export In the Logic Editor window the selector buttons of logic lines marked for export are colored blue Logic lines marked for export to Excel are saved with the application NOTE If a logic line is marked both as a breakpoint and for export the breakpoint green takes precedence over the export blue However the line will still be exported To clear marked logic lines e Right click the mode or log
113. new object is added to the Data class in the Nongraphic Objects dialog box NOTE If as String as Integer as Number as Array is not selected the new object is a constant string integer number or array object just like the original Duplicating Constant Set Objects You can duplicate a constant set and turn it into a user object property To duplicate a constant set as an exported property 1 Open the Nongraphic Objects dialog box 2 Select the constant set object you want to duplicate and click Duplicate The Duplicate dialog box opens Duplicate Constant_Set1 x New Name L as User Object Property Help CONSTANT OBJECTS 11 8 3 Assign a name to the new constant set object and select the as User Object Property check box 4 Click OK The new constant set property is added to the User Object Properties dialog box NOTE The new constant set property has no connection to the original constant set object Changes to the original does not affect the property and vice versa For information about using constant set properties see p 27 13 USING IN THE LOGIC EDITOR In the Object column of the Logic Palette constant objects appear under the Constant Data class In general the constant objects do not support functions that allow you to assign values to it or resize it All the items added to a constant set object appear in the Properties column of the Logic Palette as read only propert
114. o 19 14 Step 2 Use the Helper Class RapidRoutingSupport 0 19 15 Step 3 Implement Event Recording o o 19 16 Step 4 Implement injectRoutableValue o ooo oo o 19 17 Step 5 Compare the Recordable and Nonrecordable JavaBean Objects 19 18 Debugging JavaBean Objects o ooo ee ee 19 18 Using the Java Console ooo o 19 19 JavaBean Incompatibility o ooo o e 19 19 Debugging Java Code Running Inside RapidPLUS 19 19 Distributing Applications with JavaBean Objects ooo oo ooo oo 19 20 Code Generation Vi ADA E A eat as 19 20 CHAPTER 20 OPENGL OBJECT 2 sce at eee oe eh es a Bee ee et 20 1 OVETVICWE 5033 en Ghd SRB canal PRR EOE ef Sones elt ache alge be as We toy Sage e aS Ah 20 2 Adding an OpenGL Object to the Object LayQ0Ut o o ooooooo ooo 20 3 Setting the Object s Parameters ooo ooo ee e 20 3 About Your OpenGL and GLU DLLs o oooooooo ooo 20 5 Editing Colors sa sa wp ed gw Se AR a A de 20 5 Adding Quadric and Tessellator Data Objects o o ooo ooo ooo 20 6 Implementing in the Application Logic o oo ooo o 20 6 OpenGL Functions and Constants in RapidPLUS SynNtaX 20 6 Initializing and Using Quadric and Tessellator Data Objects 20 9 Error Handling sso oe x shee a a ee Ra Ge
115. of the definition only structure in the message interface To add a single instance structure to a union 1 2 3 Select the union In the Fields group click New Struct the Substructure dialog box opens The structure s default memory allocation method is the buffer method To use the pointer method select the Pointer check box For an explanation of these choices see Defining the Memory Allocation Method on p 22 13 NOTE The memory allocation method is only relevant if you are using RapidPLUS for code generation purposes Optional To cause the structure to generate as a union select the Generate as Union check box NOTE A single instance structure should be generated as a union only when the embedded system requires this type of message union Click OK to add the structure as a child of the union The structure s default name is Structurex where x is a number that increments with each structure added to the user object When subsequent structures are added to a union they appear under the union as follows If the union is selected when the structure is added the structure is added directly below it If another union structure was selected the new structure is added directly below it NOTE You can edit this structure s fields directly but you cannot reuse it in another union or structure ADDING MESSAGES TO A USER OBJECT Add Field String Integer Number
116. of the self property Epa Palette Event x Object Property Event Bitmap mouse_mouseE xite mouse_mousePressed Frame JavaBeans Molecule1 Label Pushbutton y alaam 10 oo td The event mouse_mouseClicked is triggered when the user clicks the mouse button in the Prototyper the event mouse_mouseReleased is triggered when the user releases the mouse button USING JAVABEANS IN RAPIDPLUS 19 12 The Mouse event object has properties In RapidPLUS these properties will be specialized properties of the JavaBean object Era Palette Activity Property Function ev_mouse_metaDown ev_mouse_modifiers ev_mouse_popupT rigger ev_mouse_ shiftDown Pushbutton FE V H Sinnal 12 soe a The properties circled above provide the location x and y integer values of the mouse when the event occurs Using the BeanInfo Class to Define the Logic Interface of JavaBeans The JavaBean interface to the RapidPLUS logic properties events and functions is derived from its Java class definition By default Java uses a process called introspection to look at the Bean public class methods and derive the JavaBean interface from there When this process is used usually the JavaBean object in RapidPLUS will have many properties events and functions not all of them relevant for the RapidPLUS user The JavaBean specification allows using a BeanInfo class to define the ex
117. on the first record and call movePrev a runtime error occurs Similarly if the query type is Forward only defined in the Advanced tab and you call movePrev a runtime error occurs To scroll backward or forward by a specified number of records e Use the moveBy function specifying the number of records to advance or go back by using a negative value A runtime error occurs if the function attempts to move to a record that is beyond the end of file or beginning of file boundaries Using Bookmarks To move to a specific record 1 First move to the record that you want to bookmark for example the employee with the highest rate and use the getBookmark function to get a read only integer marker for the record The logic would look something like maxRate_int DB1 getBookmark 2 To jump to a bookmarked record use the moveToBookmark function specifying the bookmark returned by the getBookmark function For example in continuation of the example shown in Step 1 DB1 moveToBookmark maxRate_int NOTE Bookmarks are not supported for the Forward only query type Changing Database Records If the query type as specified in the Advanced tab has not been defined as Forward only and if the database link is not read only see the Note below then you can use the functions described in this section to add delete records in the linked database and or assign values to database fields NOTE A database link will be
118. over again and how to use branch statements to execute a block when specified conditions are satisfied e Chapter 8 Find and Replace explains how to search for and replace strings in the application logic and logic references to specific objects e Chapter 9 Verification Test explains how to run a verification test to perform a basic check on an application s logic design e Chapter 10 Nongraphic Objects describes how to work with nongraphic objects in the Object Layout It describes the nongraphic objects in the data time and signal classes and system objects e Chapter 11 Constant Objects describes how to define and use this class of data objects whose values are defined in the Object Layout and cannot be changed dynamically during runtime Constant objects are generated as define and enum statements XX Chapter 12 Graphic Displays describes how to add and define a graphic display object graphic display true color in the Object Layout and define its logic The graphic display works in conjunction with the font object and with bitmap objects Topics covered include working with the object s colors working with text and bitmaps and various drawing modes This chapter also details how to use graphic display buffers to extend the object s functionality Chapter 13 Bitmap Image and Font Objects teaches how to define bitmap image and font objects in the Object Layout and Logic Editor
119. pela powerOn paused dla noDisk D premain W diskin lap Example of going to a selected mode COMPARING APPLICATIONS IN THE DIFFERENCING TOOL 3 10 Copying Items in the Differencing Tool The applications are displayed in read only view in the Differencing Tool Modes objects and logic can be copied from either application and then pasted in the application that is currently open in RapidPLUS To copy an item 1 Select the item you want to copy You can select an object or a mode in the upper pane or logic statements in the lower detailed information pane 2 Right click to open the popup menu and choose Copy The item is copied to the internal paste buffer The item can now be pasted an open application NOTE When you copy an item to the currently open application you have changed the application and must reload it to continue comparing items RapidPLUS will prompt you to reload it Generating Differences Reports You can generate reports about the applications that have been compared e A report about the left application project e A report about the right application project e A report about the selected application component The amount of information shown in the reports is determined by the items selected in the Filters dialog box see p 3 8 for details on setting the filters To generate a differences report for one of the applications in either pane 1 If necessary Modify the items selected in t
120. pointer type select the Pointer check box 3 Click OK the Add Structure dialog box then prompts you to select whether the definition only structure will be placed at the same level as the single instance structure a sibling or at the level of a field child Add structure as Lancel Sibling Child Select to place the definition ie only structure at the field level a nested structure Select to place the definition only structure at the same level as the single instance structure 4 Click OK USER OBJECTS WITH MESSAGES 22 12 NOTE You can add a definition only structure at the field level by selecting a field of the single instance structure and then clicking Existing Struct Editing Fields and Changing Names Once added to the structure you can change the field s name and or edit its data attributes To change the name of a field structure or union 1 Select the item 2 Make the changes in the Name box 3 Click Accept to apply the change To edit the data attributes of a field Select the field and click Edit the dialog box in which you originally defined the data attributes opens so that you can make your changes What happens when you edit a definition only structure that has been added to a union or a structure Refer to the example on p 22 11 of a definition only structure that was added as a field to another structure Any changes that you make to fields
121. previous versions of RapidPLUS cutting or copying a mode or subtree in the mode tree automatically deleted outgoing external transitions if any when the mode or subtree was pasted back into the tree Outgoing external transitions are now preserved when you paste A PASTE GLOSSARY 6 7 A PASTE GLOSSARY Since the following terms are used frequently throughout the rest of this chapter it is important that their meanings be clear and precise Related Element If a cut or copied element in a source application references other elements then these referenced elements are pasted as related elements For example when you paste an activity you are also pasting as a related element the RapidPLUS object referenced by the logic Example Copying and pasting the activity String1 String2 also pastes the two string objects reference by the logic Duplicate Object A duplicate object is an object in the target application with the same name and class as a pasted object either pasted directly or as a related element Duplicate User Function A duplicate user function is a user function in the target application with the same keywords as the paste function However RapidPLUS does not check the argument types Examples DUPLICATE NOT DUPLICATE USER FUNCTIONS USER FUNCTIONS User fuction to be pasted User fuction to be pasted write lt string gt at lt integer gt write lt string gt at lt integer gt User function in tar
122. print them Once a report has been saved it can be viewed in any text editor but it cannot be reopened in the Report Viewer The Object Layout Prototyper Layout and State Chart Plot reports are printed directly from RapidPLUS The XML reports are viewed and printed from a Web browser GENERATING REPORTS 25 4 Viewing Reports A generated report is displayed in the Report Viewer using a default font style You can change the display font To change the display font 1 In the Report Viewer choose File Set Font The standard Microsoft Windows Font dialog box opens 2 Change the font and or attributes as necessary then click OK Saving Reports The first time you save a report the default location is the Applics folder To save the report shown in the Report Viewer El 1 Choose File Save As or click the Save button The standard Microsoft Windows Save As dialog box opens with the RapidPLUS report file extension TRD as the default file type You can also save reports as text files TXT 2 Name the file then click Save Printing Reports Before you print a report you can change the printer font To change the printer font 1 In the Report Viewer choose File Set Printer Font The standard Microsoft Windows Font dialog box opens 2 Change the font and or attributes as necessary then click OK To print the report shown in the Report Viewer sa 1 Choose File Print or click the Print button The standard
123. provides a link to the external graphic file When the object s image file is linked to the application no graphic file is created A nested tag _imageFileName provides the path to the linked graphic file NOTE If you want linked image files to be included in the XML report s folder you must copy them to the folder manually RPDataStore RPDataRecord Tags for data store objects RPDataStore describes the data store object Its nested tags include _ properties defines field names and field types _editContents points to all of the records RPDataRecord describes each record Its nested tags include _ data presents the record contents as a sequence of numbers These numbers can be interpreted like this for each field in the data store definition there is the following data 2 bytes length of the field value and lt n gt bytes the field value Field values are stored according to field type For example integers are stored as 4 bytes 32 bit integer Strings are stored as a sequence of characters terminated by 0 It is difficult to see the actual values from the XML report because of the numeric representation but automatic convertors can easily interpret this data 25 28 GENERATING REPORTS TAG DESCRIPTION RPIntegerObject Tags for data objects Data objects can be properties RPNumberObject of other RapidPLUS objects or appear on their own as primitive types RPStringObject
124. read only if the Read only option is selected in the Advanced tab or according to criteria specific to your ODBC driver For example if you are using the Microsoft Access ODBC driver and your query joins tables DEFINING THE LOGIC 15 11 the database link is automatically read only You can check if the link is read only via the object s is readOnly condition To add a record to the database e Use the add function A new record with null field values is added after the last record The database access object points to the new record and you can change the field values as described in Steps 3 and 4 of the To change field values in the database procedure below To delete the current record from the database e Use the delete function The database access object points to the previous record To change field values in the database 1 Use one of the navigation functions as described in Navigating Among the Records on p 15 9 to go to the record that you want to change 2 Call the object s edit function to prepare the database for record changes 3 Use the field assignment function to make the desired changes to the record 4 Call the object s update function to transfer the changes made in Step 3 to the database or to the transaction buffer if using the transaction functions as described in Performing Transactions on p 15 12 5 Repeat Steps 1 through 4 for as many changes as you would like to make
125. runtime errors You can then choose to continue running the application or to stop the Prototyper You can incorporate the read only g GetError function into logic like the following in order to display the OpenGL error strings TextDisplay1 contents OpenGL1 gluErrorString_errCode OpenGL1 glGetError OPENGL OBJECT 20 10 Implementing Raster Images The OpenGL object uses RapidPLUS bitmaps to implement the rendering of full color raster images The following table presents a summary of the five OpenGL object functions that render raster images for drawing backgrounds and applying textures Table 1 OpenGL Object Functions that Support Raster Images FUNCTION glDrawPixels_width height format type pixels COMMENTS The pixels argument is a RapidPLUS bitmap The width height format and type arguments are set internally Since these arguments are ignored you can set them to zero in the Logic Editor NOTE RapidPLUS changes bitmap dimensions so that they are always a power of 2 without attempting to maintain aspect ratio This implementation may cause some bitmap images to appear distorted gl TexImage1D_target level internalformat width height border format type pixels or glTexImage2D_target level internalformat width height border format type pixels The pixels argument is a RapidPLUS bitmap with a height of 1 pixel All arguments except for pixels level and border are set
126. set properties appear as properties of the user object The illustration below shows a sample Logic Palette that contains constant set properties z Logic Palette Activity x Object Property Function hide Display Constant_Setl show System Red Green Blue Ail 21f80 fe itfetse tort tors white C X Aeraj e da Sample Logic Editor containing constant set properties These constant set properties have the same functions as a constant integer Example In the following logic Current_Color Applic2 Colors Red as number where e Current_Color is a number object e Applic2 is the application name e Colors is the name of the constant set and e Red is the name of an item in the constant set Current_Color receives the value of Red Converting Constant Sets to User Object Properties You can duplicate a constant set and turn it into a user object property OBJECT LAYOUT 27 15 To duplicate an existing constant set as an exported property 1 2 Open the Nongraphic Objects dialog box Select the constant set object you want to duplicate and click the Duplicate button the Duplicate dialog box opens Duplicate Constant_Set1 x Cancel Lj as User Object Property Help Conca _ Ho Assign a name to the new constant set object Select the as User Object property check box and click OK The new constant set object is added to the User
127. short name lineWidth gt 25 lt short gt lt object gt lt object class Timer name general_Timer gt lt long name initialCount gt 5 lt long gt lt object gt lt private gt NOTE Object coordinates are relative to the position of the object s upper left corner in the containing application user object RAPIDPLUS APPLICATIONS IN XML 2 10 Mode Tree Transitions and Logic The lt stateMachine gt element contains all the data from the Mode Tree and Logic Editor Mode tree transitions amp logic lt stateMachine gt Element lt stateMachine gt E Mode Tree TRAFFIC File Edit Tree Logic Help D s al MEISE sl3 x l lt exclusiveMode gt lt exclusiveMode name green gt lt transition type default red redYellow green destination flashingGreen gt flashingGreen A yelow lt event gt general_Timer tick lt event gt lt transition gt lt activities gt hu Logic Editor Editing Activities in green lt entry gt general_Timer initialCount File Edit yjew Logic Functions Debug Options Help 5 lt ent ry gt RISSE alla seen lt entry gt general_Timer restart fgeneralTimeriniiaiCount 5 lt entry gt Destinations lt entry gt green Lamp on lt entry gt general_Timer tick lt fact ivities gt lt exclusiveMode gt lt stateMachine gt The CSX Settings File This section applies to code generation only The CSX file which contains the code generation pr
128. state functions flip mirror and invert With quantitative functions each new instance of the function replaces the current list instance With state functions each new instance reverses the current list state Thus if there have been three instances of contrast manipulation only the last one is kept on the list If there have been four instances of mirroring the image is mirrored prior to the fourth instance mirror on and not mirrored mirror off following it BITMAP IMAGE AND FONT OBJECTS 13 6 In cumulative manipulation RapidPLUS performs a single manipulation before each redrawing of the image In non cumulative manipulation RapidPLUS usually performs several manipulations before each redrawing of the image The order in which the manipulations are applied may affect the appearance of the redrawn image Each of the two non cumulative manipulation modes uses a different order The two order types are Logic Order The manipulations are applied to the original image by the order of logic Predefined The manipulations are applied to the original Order image in the following order i Color component changes a set functions b change lt Color Component gt By functions c change lt Color Component gt ByPercent functions ii Brightness and contrast functions iii Invert iv Mirror v Flip vi Rotate To perform manipulations on the modified image e Select the Cumulative changes check
129. state transition charts and in Document Manager documents A missing defective graphic user object can be manipulated on the layout and in the logic like any other graphic object however it cannot be manipulated like a user object In other words it is not listed in the Project Components list and it has no interface More importantly it will cause a fatal runtime error when you run the application in the Prototyper A missing or defective nongraphic user object appears in the Nongraphic Objects dialog box but also cannot be manipulated like a user object Examples of Usage Adding a Property or Function to a User Object You have a project with many instances of EDITOR UDO in its components You edit EDITOR UDO by adding to it several new properties and functions When you open the main application after editing EDITOR UDO RapidPLUS automatically includes the new properties and functions in all the relevant interfaces and you can immediately proceed to use them in the Logic Editor Renaming a Property in a User Object You have an application with many instances of BUTTON UDO The user object has two properties width and height that control the size of the button These properties are used in many places throughout the project whenever the button user object is used You now want to add an optional bitmap on the button and allow control of the bitmap size You therefore add two new properties to the user object bitmap_width and
130. system p 27 9 settings settings in the Rapidxx ini file using one of two Save Settings commands Pasting text from Telelogic DOORS Notes for objects and modes can be created from requirements in DOORS using the popup menu Paste from DOORS command Refer to Rapid DOORS User Guide doc Rapid CD Util Doors Chinese language support Chinese text can be added to notes New in version 8 0 New in version 8 0 FEATURE Default scale dialog box 27 3 ENHANCEMENT REFERENCE This dialog box has been removed from RapidPLUS The application units are pixels only RapidPLUS Xpress Object Layout FEATURE Naming conventions RapidPLUS Xpress the tool for designing products quickly is accessed from the Options menu For information about RapidPLUS Xpress refer to the RapidPLUS Xpress User Manual ENHANCEMENT REFERENCE The rules for naming objects have been modified p 27 9 Root object The name of the root object of every RapidPLUS application is self In previous versions the root object name was the application name Select from List The dialog box displays each p 27 10 dialog box object its type and membership in a group when applicable Importing multiple You can import multiple bitmap p 27 11 bitmap files files in one import operation using the File Import Bitmaps command User Object The dialog box has been expanded p 27 11 Properties
131. that you can view by selecting the SQL tab This tab contains a non editable text pad displaying the SQL query statement For example DEFINING THE DATABASE ACCESS OBJECT FROM employees 15 5 The table selected for the SQL query from the table list The fields added to the Selected Fields list Selection Advanced SQL SELECT employees employeelD employees employeeN ame employees employeeR ate employees deptID To remove a field from the Selected Fields list In the Selection tab select the field s and click Remove The SQL statement changes accordingly as you remove fields from the list To rename a field in the Selected Fields list In the Selection tab select a field and type in another name NOTE Renaming the field in the Selected Fields list does not affect the selected field s full name as described in the illustration on p 15 6 Configuring the Query The Advanced page in the database object dialog box allows you to configure complex SQL query options as you add fields to the Selected Fields list These options include the sort order of the fields and any conditional statements that the field contents must meet to be included in the query In this tab you also specify whether or not The database is read only To run the SQL query when the application starts in the Prototyper To exclude records whose fields contain the same value The query result set can
132. the activities are performed if else if Integer1 1 Executes the first block of activities if the PowerSwitch on condition is true Lampl on If the condition is false the second block else BatteryLowLamp on of activities is executed if if Interger1 0 This is a nested branch It executes the first PowerSwitch off block of activities if the first condition is else if BackupLamp on true else else if Integer1 If the first condition is false the second PowerSwitch on condition is checked If it is true the and Lamp1 on second block of activities is executed so on else BatteryLowLamp on If the second condition is false the third block of activities is executed Notice that the blocks are indented and that each activity appears on its own line For more information about block indentation see Understanding Indentation in Loops and Branches on p 7 9 Defining an If Branch An If branch can be used in entry activities exit activities actions and user function activities To define an If header if 1 Inthe Logic Palette click the If button You can also type the keyword if in the edit line e The following logic is appended to the Logic Editor s edit line if lt Condition gt WORKING WITH IF ELSE BRANCHES else 7 13 e The Logic Palette is set to condition editing mode prompting you to enter a condition 2 Enter the condition 3 Accept the If header by either cl
133. the Delete button becomes unavailable Changing a Font Object s Default Character When a font is not used in its entirety RapidPLUS defines a default character to substitute for characters that are not in the active font s defined range To change the default character e Inthe Default Character edit box enter the ASCII value of a character that is within one of the font s character ranges Parsing a String When displaying a long string on a graphic display it is often necessary to divide or parse the string into substrings that fit the width of the display Since the active font object has an impact on string width the font object has two functions through which you e Count the number of substrings a string would be divided into in order for each substring to fit within the graphic display width given in display pixels e Retrieve a specified substring of appropriate length from a string In each case you must specify if the substrings are counted or retrieved from the beginning of the string that is leftAligned or from the end You must also specify if the parsing is by complete words that is wordWrap or by character FONT OBJECT 13 15 Example see also the popup overlay example on p 12 40 In the following example Font1 is Arial 8 regular the width of GDO1 is 64 pixels and the value of Str1 is Please enter the telephone number now The result of the substring count assigned to an integer obj
134. the Mode Tree window In the Logic Editor window 1 Select the mode 1 Select the logic lines 2 Choose Tree Unmark for Export 2 Choose Edit Unmark for Export Marking and unmarking logic lines for export to Visio Marking a mode for export to Visio automatically marks all of its child modes as well all the logic lines of the marked modes except for triggers and actions of internal transitions will be exported to Visio EXPORTING STATE CHARTS TO VISIO 24 6 To refine your mode marking you will have to unmark and re mark lower branches of the mode tree Note that the blue marked for export indicator is visible only in the Logic Editor window To control export to Visio at the level of individual logic lines use the Logic Editor window rather than the Mode Tree window Select the desired logic lines then mark or unmark them for export Note that marking or unmarking a logic line that is part of a logic block automatically applies to all the lines in the block Choosing and Creating Schemes for Exported State Charts The appearance of modes in exported state charts is determined by scheme masters provided by another RapidPLUS stencil schemes vss In RapidPLUS the masters are listed in the Chart Options dialog box s Scheme list The master named Default is the basis for all predefined and new masters You can use the supplied scheme masters or create your own e eo NOTE Only modify the Default master i
135. the behavior of an application by executing a block of logic and then pausing the Prototyper The Debugger contains the following controls for the application e Prototyper controls which run the application until it encounters a breakpoint and automatically pauses or until you pause the application manually e Stepping controls which automatically pause the Prototyper after executing one line or block of logic STEPPING INTO APPLICATIONS 4 7 Controlling the Application You can run an application from either the Prototyper or the Debugger If you run the application from the Prototyper be sure that the Debugger is already open Otherwise you will have to stop and restart the application to use the Debugger features The Debugger toolbar contains some of the same buttons for running the application as the Prototyper Stop Play Pause Resume You can also access these controls from the Debug menu in the Debugger menu bar Specific to the Debugger though are stepping buttons Step Into Step Over and Step by Filter which are used to execute a line or block of logic and then pause automatically These buttons can be used to start the application or to continue after it has been paused They are described in the following table BUTTON DESCRIPTION the highlighted logic line is a call to a user function Step Into stops at the first logic line in the user function 2 Step to the first or next logic line in the ap
136. the event takes place The parameters are read only unless they re pointers see When are event properties not read only below Their values remain unchanged until the next event occurrence Event parameters become specialized RapidPLUS properties with the following syntax ev_ lt eventName gt _ lt parameterName gt In the example given above therefore the event parameters would appear in the Properties column of the logic palette as ev_Click_X and ev_Click_Y NOTE Event properties are valid only after the event has occurred You get a runtime error if you attempt to read an event property s value without its event having been triggered When are event properties not read only The exception to the rule of event properties being read only are those cases where the event parameter is a pointer Some events use pointer parameters to get a return value from RapidPLUS For example an ActiveX control might have the event BeforeUpdate short Cancel The pointer parameter Cancel whose default value is O or FALSE appears in RapidPLUS as the event parameter ev_BeforeUpdate_Cancel If you assign a value of 1 that is ev_BeforeUpdate_Cancel 1 before the BeforeUpdate event is triggered then the BeforeUpdate event is canceled and the control is not updated The BeforeUpdate event 17 20 USING ACTIVEX CONTROLS remains blocked until you reassign 0 to the ev_BeforeUpdate_Cancel pointer param
137. the field type string integer or number See the example on p 10 27 to learn how field names and types are entered DATA OBJECTS 10 25 e Ifthe cell at position Al is left blank the elements listed in Column A will become record names in the data store See the example on p 10 28 to learn how record names are imported e If no field names are entered all of the element values will be imported as strings See the example on p 10 26 Formatting Data in a Text Editor TXT files The data should be arranged as follows Field _Namel lt type gt tab Field_Name2 lt type gt tab Field _Name3 lt type gt RecordName1 tab data_11 tab data_12 tab data_13 RecordName2 tab data_21 tab data_22 tab data_23 RecordName1 tab data_31 tab data_32 tab data_33 lt carriage return gt The first line and the record names are optional Field name types are not case sensitive For example you can enter a type as string or String If the last line is not blank data from the last line of text might not be read Example Name string Age number Birth Year integer Arlene45 01957 Mike42 51959 Ronniel6 81985 Karen15 5 1986 lt empty line gt See the following usage examples for more examples Usage Examples Formatting Data for Import Into Data Stores Each of the following three examples shows e A CSV file and a TXT file with a certain amount of data e A data store as it appears
138. time you start the simulation To reset the state e Use the ResetState method The simulation is reset to the initial state Communicating with DDE Objects Although the DDE Dynamic Data Exchange protocol is still supported by RapidPLUS its use is not recommended because the current methods for exchanging data between applications are quicker and more reliable than DDE The following logic items are available in RapidPLUS 6 0 to support backward compatibility NotifyOnDDEObjectChange RequestDataFromDDEObject PokeDataToDDEObject and DDEObjectChanged They are described in the Properties Methods and Events section that starts on p 18 34 HOSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS 18 34 PROPERTIES METHODS AND EVENTS This section describes the Rapid Simulator s properties methods and events Properties The properties described in this section are also defined in the Rapid Simulator s Properties dialog box and or ActiveX Properties list They determine how the Rapid Simulator behaves when it is run in the host document AcceptExternalActions Sets the simulation to accept external actions Default value True Application Returns the full path of the application currently loaded in the Rapid Simulator read only Borders Defines the appearance of the Reviewer in stand alone view DisplayMode Defines the appearance of the Reviewer in stand alone view Valid Values 0 Hidden 1 Norma
139. to 26 10 pullRowsFrom to 26 11 pushbutton objects 26 22 pushColumnsFrom to 26 11 pushRowsFrom to 26 11 Q quadric data objects 20 6 20 9 R 1 2 to 1 3 random number objects 10 11 Rapid Simulator ActiveX object accepting external actions 18 23 adding 18 3 18 5 automatic notification of property change 18 16 communicating with DDE objects 18 33 configuring 18 6 controlling the Recorder 18 32 controlling the simulation s state 18 33 examples of usage 18 12 18 17 18 20 18 24 18 28 18 30 to 18 31 getting data from RapidPLUS simulation 18 10 to 18 18 monitor mode 18 25 monitoring user actions 18 26 to 18 28 normal mode 18 24 overview 18 2 reroute mode 18 25 18 29 rerouting user actions 18 29 to 18 30 resizing 18 9 sending data to RapidPLUS simulation 18 19 to 18 22 sending external actions to RapidPLUS simulation 18 22 to 18 24 setting routing mode 18 24 to 18 26 RAPID_AUX_PATH environment variable 1 14 to 1 15 RapidActiveXHelper object 17 20 to 17 22 RapidControl dll 17 25 RapidPLUSBridge dll 17 24 raster images 20 10 RDO user object files Rapid Reviewer 28 1 Recorder controlled by the Rapid Simulator ActiveX object 18 32 RecorderControlsEnabled property 18 32 18 36 RecorderCue method 18 39 RecorderPlay method 18 40 RecorderPlayCase method 18 40 RecorderRecord method 18 40 RecorderRewind method 18 41 RecorderStep method 18 41 RecorderStop method 18 41 RecorderVisible property 18 32 18 36 redoing actions
140. transition is reconstructed If there are duplicate modes the Transition Conflict dialog box is displayed as described on p 6 18 6 14 PASTING OPERATIONS To complete the paste operation RapidPLUS 4 If replacing modes in the target application Tries to preserve incoming transitions EXPLANATION The illustration below shows that the replacing mode s incoming transition was preserved Situation B when the replaced mode in the target application already had an incoming transition from a mode with both the same name and hierarchical level IE C D je Pe Copy PRESERVED TARGET TARGET c 2 Paste and replace mo SITUATION A INCOMING TRANSITION NOT 1 SITUATION B INCOMING TRANSITION PRESERVED TARGET TARGET 3 Result 2 Paste and replace B pe C D or i G D E Ps G RESOLVING DUPLICATE ELEMENT CONFLICTS To complete the paste operation RapidPLUS 5 Verifies the application s logic 6 15 EXPLANATION RapidPLUS checks that e The pasted logic can be executed by the application e In the target application logic references to changed object s are valid C NOTE For examples see Step 3 on p 6 12 6 Displays the Logic Error View window All logic in the target application affected by the mode paste operation is displayed in the Logic Error View window A logic line that has become invalid e g
141. unexpected results in the displayed text string due to width and height variances between fonts Example A cell phone s LCD screen generally displays text in MS Sans Serif bold 8 point No Connection messages however are displayed in Courier 10 point The logic for this is LCD1 fontSet Courier_Font LCD1 drawText No Connection atx 10 y 10 where Courier_Font is a font object whose settings are Courier regular 10 point To revert to the LCD s default font style use another instance of the fontSet function that uses the font object msSansSerif whose font settings are MS Sans Serif bold 8 point Drawing Text on the Graphic Display Use the drawText atx y function to specify a text string and determine its placement on the graphic display The text string must be enclosed by single quotes in the function The position specified is the string s upper left corner NOTE Text that exceeds the object s size is clipped The graphic display does not wrap text to the next line The text is drawn in the current draw color which is black by default The draw color can be changed during runtime see Changing the Draw Color on p 12 16 The background pixels are drawn in the current background color which is white by default The background color can be set during design time see Selecting a Background Color on p 12 7 or changed during runtime see Changing the Background Color During Runtime
142. valid version the files should be made read only this reduces the risk that a developer will accidently save a file before checking it out of the version control system The project manager can declare a new release ready for additional work and the developers can then copy the new release to their working folder 1 18 MANAGING PROJECTS Recommendations for Checking In Resource Files External resources such as bitmaps may be checked into the version control system as individual files so that developers can lock individual files and work on them An alternative method is to compress all the bitmaps into a single ZIP file for easier check out In this latter case only one person at a time can lock the entire set of bitmap files in order to make changes on any given file For the purposes of team development and version control we recommend that all data for arrays and data stores be placed in external files TXT or CSV which can be called using the loadFromFile function Both TXT and CSV formats support change merges Merging is more difficult for RAR and RDS file formats Synchronizing Component Changes RapidPLUS s support for team development and version control enables developers to synchronize changed files that were checked out from a version control system or copied from another location without closing the project in RapidPLUS When a project component s interface has been changed the other components that use
143. want to designate more than one condition You can build these branches either in the traditional programming style with another indent for each new If condition or in a condensed style placing the Else and If condition on the same line Both styles are valid in RapidPLUS The table below presents each type If else if else if branch LONG STYLE ELSE IF STYLE if Integer1 1 if Integer1 1 Lamp1 on Lamp1 on else else if Integer1 2 if Integer1 2 Lamp2 on Lamp2 on else if Integer 1 3 else Lamp 3 on if Integer 1 3 else Lamp 3 on Lamp 4 on else Lamp 4 on As you can see the ability to place an If condition on an Else line enables you to build compact nested branches WORKING WITH IF ELSE BRANCHES 7 15 Defining If Else Branches That Use Constant Objects Constant objects can be used in If and Else conditional statements for example if Constant_Integer lt 2 When a constant object is used its value is immediately evaluated The logic lines in the If or Else blocks whose values evaluate to False are displayed with a gray background The logic lines whose values evaluate to True are displayed like other logic statements that is without the gray background Also the If and Else headers are displayed with a gray background Example Activities entry if Constant_Setl ASF Constant_Integer1 Integerl Constant_Integer1 else Integerl 0 The immediate evaluation is perform
144. was clicked the object s property that was affected and the event itself To understand how user actions are generated in RapidPLUS look at the following Recorder file Notice that every line in the body of the file contains one recorded user action Each line contains four fields that are separated by a hash sign MONITORING USER ACTIONS IN THE RAPIDPLUS SIMULATION 18 27 E App1 RCD Notepad olx Fie Edit Search Help APPLICATION PD March 6 2666 3 41 52 pm 13 7 Switch1 up make 1 44 Potentiometer1 value 16 711395 3 52 Potentiometer1 value 29 914961 5 68 Pushbutton1 self in 7 04 Pushbutton1 self out 7 44 Pushbutton1 self in 8 8 Pushbutton1 self out 8 96 Potentiometer1 value 11 924683 11 38 Potentiometer1 value 6 476522 12 3 Switch1 down make 13 7 e The first field is the object s name as it appears in the application e g Switch1 e The second field is the name of the object s property that was affected by the user action e g up e The third field is the name of the event e g make e The fourth field contains the time stamp the time elapsed in seconds since the start of the recording The information held in these four fields is passed to the host document when the Rapid Simulator is in monitor mode Additional information that is passed to the host document includes an ID number and a response number
145. well as the logged in user name and company name as they appear in the registry 1 12 MANAGING PROJECTS 3 The revision number is automatically incremented each time the application is loaded When the Log check box is selected RapidPLUS also adds a comment each time the application is loaded This comment consists of the version number the date the time and the name of the logged in user You can edit both version number and comments To add your own comments type directly into the Comments list C TIP We recommend that the Log check box always be selected so that projects can be accurately compared unless you are working with an external version control application For details about how this check box affects comparisons in the Differencing Tool see Comparing Projects on p 3 11 By default the language used for the application s compilation and code is the system s local language that was used when the application was created You can change the language in the Character set box The language selected will be used for the encoding of XML reports NOTE The automatically added log entry does not mark the file as having been changed The log entry is however saved with the properties when you save the application NOTES ON MODES AND OBJECTS 1 13 NOTES ON MODES AND OBJECTS Notes on modes and objects are added edited and viewed in the Application Manager window as shown below Status
146. when either of the files is imported NONGRAPHIC OBJECTS 10 26 Example of elements imported from CSV and TXT files Ej Records for animals elements only csv Of x l 1 5 cat F The CSV file in Tiger 3 cat M Microsoft Excel Fido 2 5 dog M This workbook Cookie 4 dog F contains element Mozart 1 cat M values only Cinnamon 2 5 dog F FIM Records for animals elements on fee gt File Edit Format Help Fluffy 1 5 cat F The TXT file in Tiger 3 cat M Microsoft Notepad Fido 25 dog M This file contains Cookie 4 dog F element values only Mozat 1 cat M The elements are Cinnamon 2 5 dog F separated by tabs o Data Store Data_Store1 Record Number Number of Records 15 Goto 6 Pipise The CSV or TX Seno zi update file imported into a data store Notice that the Name column is empty and the firelds have default names In the data store above the Field type for all of the fields is string because no fields were defined in either the CSV or TXT file DATA OBJECTS 10 27 Example of elements and field names imported from CSV and TXT files A B Age number Animal string Gender string This workbook ael 5 cat F contains element 3 cat M values and field 2 5 dog M names and types 4 dog F 1 cat M The field type must 2 5 dog F appear next to the field name and be enclosed Hh Records for animals elements an lal in pare
147. which the executed logic line is located Type Logic type e g transition action function line Description Logic line and or a description of the logic See Managing Logs on p 4 21 for more details To show or hide columns 1 With the Logger pane open choose View Logger 2 Select columns you want to show and clear the mark by columns to hide To enable automatic Logger scrolling while debugging In the Logger pane drag the scroll box to the bottom most position The Logger scrolls automatically so that the most recent entries are visible Understanding the Logger Icons and Descriptions The Logger pane can show icons for the different types of logic so that you can easily identify specific logic types in the application You can determine what kind of logic is logged through the Debug and Logging Options dialog box see Configuring Log Data on p 4 16 The following tables list logic types that are related to application execution and logic related to user object interface Note that listed logic types are used for stepping by filter as well as for the log LOGGING APPLICATION EXECUTION 4 13 Logic Related to Application Execution The following information can be displayed for a running application Note that by default the filters for user functions mode entry exit activities and mouse movements are not selected ICON LOGIC TYPE Activities E Entry Mode 4 Exit DESCRIPTION AND EX
148. width LCD1 fontStringWidth Option1 height LCD1 fontHeight Normal Reverse For instructions about calculating the string width and font height see Getting the Font Height and Text String Width on p 12 24 HINT A more precise way of controlling the background color is to draw a rectangle in XOR drawing mode while specifying the draw color See attributeSetX OR on p 12 35 for details about XOR mode Changing the Background Color During Runtime Use the setBackgroundColor function to specify a background color for both the graphic display and the background pixels of text strings This background color becomes effective only when a function using the background color is activated NOTE This function does not refresh the graphic display i e it does not change the background color of the graphic display or of graphic elements on the display The functions that use the background color are drawText atx y clearDisplay and clearAreaAtx y width height To change the graphic display s entire background color during runtime e Use the following functions in the logic LCD1 setBackgroundColor lt color palette index RGB value gt LCD1 clearDisplay 12 18 GRAPHIC DISPLAYS The first function specifies the new background color to be used and the second function draws every pixel with this color Example A cell phone s LCD displays the text string Standby when the power source is activat
149. you can make the logic line valid and manually remove a comment e g by right clicking the logic line and choosing Remove Comment you can no longer reverify this logic line through the Logic Error View REVERIFYING LOGIC 5 7 Copying logic lines You can copy a logic line as text from the Logic Error View by right clicking the line and choosing Copy to Clipboard You can paste the copied logic into the Logic Editor s edit line and edit as needed Example fixing a transition with a missing destination mode In the Mode Tree you pasted a mode with a transition to a mode that does not exist in the application and the Logic Error View opens To correct this error 1 In the Mode Tree add the missing mode 2 In the Logic Error View select the appropriate entry and click the Reverify Selected button If RapidPLUS can verify the transition to the destination mode it removes the comment from the logic line in the Logic Editor uncomments any associated triggers and changes its status in the Logic Error View window from invalid X to valid 6 1 Pasting Operations You can use the cut copy and paste operations to exchange lines of logic graphic and nongraphic objects or modes in an application or between two applications An application s objects logic and or modes can be reused in other RapidPLUS applications This chapter presents e Which application elements can be cut copied and pasted e Ho
150. you reach the state from which you want to collect data for the coverage test Choose Controls Coverage Test or click the Coverage Test button From this point all actions in the Prototyper including recording and playing back with the Recorder will be examined under the coverage test Continue to run the application until you have covered all of the actions required for the coverage test You can pause stop or restart the Prototyper as often as necessary To stop collecting data for the coverage test choose Controls Coverage Test or click the Coverage Test button NOTE Restarting data collection by clicking the Coverage Test button again overwrites the previous data To generate the Coverage Test report first stop the Prototyper In the Application Manager choose Reports Coverage Test the Report Viewer opens displaying the coverage test results You can print or save the report as explained in Working with Reports in the Report Viewer on p 25 3 You may want to run more than one coverage test while the application runs For example you may want to check the status of user objects at different stages in the application To generate multiple Coverage Test reports 1 Run the application in the Prototyper and choose Controls Coverage Test or click the Coverage Test button to begin data collection To generate the Coverage Test report first stop the Prototyper In the Application Manager choose Reports Co
151. 0 characters or is it two integers and three arrays HOW DOES A USER OBJECT MESSAGE WORK Thus the currently active structure must be deactivated either implicitly or explicitly as explained below before the user object or the parent application can place another set of data in the interface to change it to read it and or send it to the other side In the case of assigning a value to a structure field RapidPLUS automatically deactivates any other structure that may be active and activates the structure involved in the assignment In the following example the parent application might assign a value to Structure2 making it active in the parent application and send it to the user object making it active in the user object PARENT APPLICATION Union1 Structurel IntegerField1 StringField1 Structure2 NumberField1 ArrayField1 NOTE The user object message s functions and events are described in detail on pp 22 17 to 22 19 assign send activated in parent application Structure status A 4 assign send A activated in user object USER OBJECT Union1 Structurel IntegerField1 StringField1 Structure2 NumberField1 ArrayField1 22 3 USER OBJECTS WITH MESSAGES 22 4 USER OBJECT MESSAGE PARTS A GLOSSARY Before getting into the details of how to add messages to the user object interface it is important that you unders
152. 00000000000100000000 190999090901 00110090990909090000109990908 NOTE Java code is not generated for this function GRAPHIC DISPLAYS 12 44 WORKING WITH BUFFERS The graphic display has a buffer property in the Logic Palette The buffer property functions can be divided into two categories Standard graphic display functions for a specified buffer You use these functions to set a buffer s drawing and or update mode clear the buffer or an area draw graphic elements set the font set the colors and get information on the current font display width and height current colors etc A typical function in this category looks as follows GDO1 buffer clearDisplayForBuffer lt Integer gt NOTE The buffer integer index must be greater than O zero and equal to or less than the total number of buffers defined Unique buffer property functions You use these functions to perform logic that is unique to buffers such as copying a buffer s contents or status to another buffer This section presents How buffers interrelate with the graphic display How to use the unique buffer property functions Examples of how you can use buffers to achieve different effects such as a moving map windowing animation and an array of bitmaps WORKING WITH BUFFERS 12 45 The Whole Picture The following schematic illustrates the interrelationships among the graphic display the intermediate buffer and any defined buffers
153. 1 During runtime you would move the clipping rectangle over the buffer in order to change the map segment visible on the graphic display Animation On a buffer you draw the animation frames as one complex bitmap or as a series of bitmaps NOTE Take care to size the buffer properly to accommodate the required bitmap s The buffer s default size is the size of the graphic display any bitmaps you draw on the buffer that exceed its size are clipped You then size the clipping rectangle to the dimensions of a single frame and initialize its position on the buffer so that it encloses the first animation frame You position the clipping rectangle on the intermediate buffer at the location where the animation is to be displayed Note that the device clipping rectangle is set at its default size Refer to the following illustration WORKING WITH BUFFERS 12 51 buffer1 Framel INTERMEDIATE BUFFER Frame2 Frame3 Frame4 GDO1 buffer setClipRectPositionOnGDOtox 5 y 5 forBuffer 1 Other objects required e An index wrap around integer frame_int whose lower bound is 0 and upper bound is the number of frames minus 1 An entry activity initializes it to O e A constant integer FRAME_HEIGHT that holds the height of the frames During runtime you would 1 Make buffer1 the active buffer GDO1 buffer setDisplayBuffer 1 2 On an internal transition use a timer ti
154. 1 Integer3 Integer2 1 Mode3 StepperSw positionNumber BrlDial currentValue When the modes first become active the mode activities are performed one after the other according to the sequence of the modes in the mode tree and the order of the mode activities in each mode While the modes are active a mode activity is performed whenever an object on the right side of the mode activity assignment function changes For example activity 1 is performed when Integer2 changes or activity 4 is performed when the barrel dial s current value property changes If several object changes take place simultaneously the mode activities are performed in the sequence that the changes were passed on to the state machine Thus if the barrel dial s current value changed before String 1 changed activity 4 is performed first and activity 2 second If several mode activities reference the same changed object the mode activities are performed according to the sequence of the modes in the mode tree Thus if Integer2 changes activity 1 is performed before activity 3 User Functions Limit on Number of Objects A single user function can contain up to 255 different objects and or objects properties If you refer to the same object in two different lines it equals one use However if you use an object and its properties in the same function each one counts as a use of the object ADDITIONAL RAPIDPLUS ENHANCEMENTS
155. 1 11 IMPORTANT If you are using an external version control application we recoommend that you clear the Log check box because as it increases the version number it adds a line of code to the resulting XML file This change causes a conflict when merging application or component versions Keep in mind that clearing the Log check box will disable project comparisons in the Differencing Tool but modes objects etc can still be compared The following illustrations show the Differencing window in Project view See the Comparison table on p 3 5 for an explanation of the comparison icons and colors 3 12 COMPARING APPLICATIONS IN THE DIFFERENCING TOOL Upper section of the Differencing Tool window in Project view C RAPIDSAPPLICS XPRESS MAIN RPD C RAPID 72 APPLICS XPRESS MAIN RPD Revision 117 23 07 03 07 40 03 Revision 114 21 05 03 20 00 06 Project Modes Objects User Functions Interface 4 MAIN E ii Resources PF batterylow bmp batterynormal bmp Y button_click waw E Application Components E i Application Components EH MAIN lj MAIN KEYPAD KEYPAD EH MAIN_MENU E gj MAIN_MENU de KEYPAD KEYPAD E i Resources Y button_click wav batterylow bmp batterynormal bmp All of the application components are listed in the order in which they appear in the Project Components list All of the resources that are located in the application s search path ar
156. 1 12 select clear the item Help RPFunctionalT ype C cDataDbiject 1 cNonGraphicGroup 2 cGraphicPrimitive 3 OO m O g EA cDeep1 0 cSubtree 1 ype_123 cOne 1 cTwo 50 cThree 51 OO H O m 3 enum groups OOO Click here to select clear the entire group D O 2 cFour 0 cFive 88 Lu 1 El JOO 3 Select the items to import and click OK all existing items are cleared from the constant set and only the imported items appear in the constant set More dialog box NOTE Clearing all the items in a group automatically clears the group DUPLICATING CONSTANT OBJECTS In the Nongraphic Objects dialog box you can e Duplicate an existing constant integer number string or array object as the equivalent data object e Duplicate an existing constant set as an exported property DUPLICATING CONSTANT OBJECTS 11 7 Duplicating Constant Integer Number String and Array Objects To duplicate a constant data object 1 Open the Nongraphic Objects dialog box 2 Select the constant integer number string array object and click Duplicate The Duplicate dialog box opens Duplicate Constant_String1 x New Obiect Name Cancel L as String Help Canos tio Duplicating a constant string object example 3 Assign a name to the new object and select the as String as Integer as Number as Array check box 4 Click OK the
157. 12 They can differ in size from the graphic display as shown in the schematic The buffer s entire bitmap or an area of it can be copied to another buffer In the same way a buffer s status as defined on p 12 36 can be copied to another buffer e Active buffer Either no buffers can be active or one buffer can be active Any changes made to the active buffer are transferred to the intermediate buffer according to the update status of the active buffer 12 46 GRAPHIC DISPLAYS If the active buffer is in updatelmmediately mode the changes are transferred automatically and immediately to the intermediate buffer If the active buffer is in updateOnRequest mode the changes to the buffer are transferred to the intermediate buffer only after calling one of the updateForBuffer fanctions shown in the schematic NOTE A change to the active buffer s clipping rectangle see Clipping Rectangles on p 12 47 also initiates an update of the intermediate buffer Non active buffers You can make changes to the non active buffers independently and concurrently The non active buffers are not dependent on the graphic display on the intermediate buffer or on each other When one of the non active buffers becomes active its bitmap image is then transferred to the intermediate buffer according to the rules outlined above for the active buffer NOTE You can determine a buffer s location on the intermediate buffer as described in
158. 6 editing 10 5 notes 10 5 renaming 10 5 replacing 10 7 See also specific objects nongraphic objects icon 10 3 notes modes and objects 1 13 modes and objects using DOORS 27 2 nongraphic objects 10 5 NotifyOnApplicationPropertyChange property 18 36 NotifyOnDDEObjectChange property 18 36 number objects 10 8 O object arrays 10 18 Object Data report 25 7 25 9 Object Editor cursor coordinates status box 27 24 pasting bitmaps into 27 24 Object Layout report 25 5 object libraries obsolete 27 5 Object Tree report 25 6 objects find and replace 8 11 pasting between applications 6 2 rules for naming 27 9 selecting 27 10 status and value during runtime 4 27 to 4 30 storing 6 18 in XML elements 2 8 to 2 9 See also graphic objects nongraphic objects user objects and specific objects one dimensional arrays searching backwards 26 2 support for Unicode and UTF8 26 4 OnTop property 18 36 OpenGL objects 20 1 to 20 12 opening Find and Replace dialog box 8 2 Inspector windows 4 28 log files 4 22 Logic Error View 5 4 projects 1 4 XML applications 2 3 to 2 5 options changing RapidPLUS system fonts 27 8 defining a search path 1 14 saving system settings 27 9 Order Objects dialog box 21 2 orderPosition property 21 4 overwriteWith atRow 26 10 overwriteWith atRow atColumn 26 10 P packaging applications for distribution 28 1 to 28 11 PAL files 12 11 Palette property 18 36 palettes Object Editor 27 24 Rapid Simu
159. 9 15 15 Find and Replace 8 10 graphic display buffers 12 36 to 12 39 Logic Error View 5 4 to 5 6 OpenGL objects 20 9 user object messages 22 20 verification test 9 3 XML 2 4 to 2 5 event objects 10 38 examples of usage Applink objects 16 6 16 8 16 15 array of structures in a user object message 22 14 changing stack order 21 4 constant objects 11 8 database access objects 15 3 15 14 graphic displays buffers animation 12 50 buffers moving map 12 49 buffers windowing 12 51 displaying text without drawing the background color 12 24 parsing multi line strings 12 40 to 12 42 saving and restoring 12 40 to 12 42 transparent color in bitmaps 12 26 image objects manipulation mode 13 7 13 9 language localization 10 44 managing projects 1 5 to 1 6 OpenGL objects 20 7 Rapid Simulator ActiveX object 18 12 18 17 18 20 18 24 18 28 18 30 to 18 31 RapidActiveX Helper objects 17 21 returning values in user functions 27 20 two dimensional arrays clearing a section 26 13 getting a two dimensional array 26 13 inserting columns rows 26 14 overwriting with another array 26 15 pulling pushing columns rows 26 16 user object messages 22 21 viewing local variables and user function arguments 27 23 executeSQL 15 14 exit activities debugging 4 18 Export to Excel dialog box 23 3 exporting logic data to Excel 23 2 to 23 4 state charts to Visio 24 4 F Find and Replace dialog box Advanced tabbed page filters 8 11 debugging with
160. AL ARRAYS EXTENDED FUNCTIONALITY Much of the functionality of one dimensional arrays has been extended to two dimensional arrays The new functions summarized on the following pages frequently refer to columns and rows which should be understood as follows Columns E Dimensions 2 gt 2 mB Integer M Number of Elements kumberot a In the Prototyper m l HAET SETON Rows _ object inspector 10 gt 2 Number of columns In Object Layout E s FUNCTION DESCRIPTION EXAMPLE clearFromRow lt integer gt fromColumn lt integer gt toRow lt integer gt toColumn lt integer gt Resets the specified elements to a null value See Usage Examples on pp 26 13 to 26 16 deleteColumns From lt integer gt to integer gt Deletes the specified columns Array1 deleteColumnsFrom 2 to 3 If the array previously had 5 columns it now has 3 deleteRows From lt integer gt to integer gt Deletes the specified rows Array1 deleteRowsFrom 2 to 3 If the array previously had 5 rows it now has 3 TWO DIMENSIONAL ARRAYS EXTENDED FUNCTIONALITY FUNCTION getArrayFrom Row lt integer gt fromColumn lt integer gt toRow lt integer gt toColumn lt integer gt DESCRIPTION Returns a two dimensional array that has the values of the specified elements 26 9 EXAMPLE See Usage Examples on pp 26 13 to 26 16 getColumn lt integer gt Returns a
161. AMPLES Entry mode and exit activities Examples lamp1 on counter changeBy 1 lamp1 off Transitions a Internal E Default History El Deep history Type of transition default history deep history or internal its source and destination modes and the trigger Examples off internal Trigger Pushbutton1 in Off gt on Trigger Pushbutton1 in Off gt on Trigger Pushbutton1 in Off gt on Trigger Pushbutton1 in Conditions Condition Evaluation of a condition and the result true or false Example amp PB1 is in false DEBUGGING APPLICATIONS 4 14 ICON LOGIC TYPE Actions no icon Start actions Action Action E a DESCRIPTION AND EXAMPLES Transition actions preceded by the log entry Start actions which defines the transition Example Actions for transition gt on Timer1 start Lamp1 on User functions no icon Function line Logic line of a user function Example icons_Array lt Icon_idx gt on Mode entry exit tg Mode entered DO Mode exited Indication that a mode was entered or exited It can be useful to track the flow among modes if the application has no or few entry exit activities Example Mode outgoingCall was entered Mode outgoingCall was exited User input ra User event Event caused by user input in the Prototyper that is actions that can be recorded in
162. ANGING STACK ORDER DURING RUNTIME 21 3 2 Choose Layout Order Bring in Front of or Send to Back of The Order Object dialog box opens 3 In the Object Layout work area Alt click the object that the selected object s will move in front of or behind The selected object s name appears in the dialog box Order Objects xi Selected graphic Bring in front of o object bs 7 Pushbutton Cancel Select object with Alt key Help 4 Click OK the change in the stack order is executed CHANGING STACK ORDER DURING RUNTIME To change an object s stack order during runtime it must have been made dynamic in the parameter pane Moving Dynamic Graphic Objects to Front or Back The self property of all dynamic graphic objects has the following functions for changing stack order during runtime FUNCTION DESCRIPTION bringToFront Moves the object to the top of the stack order sendToBack Moves the object to the bottom of the stack order bringInFrontOf Moves the object one position higher in the stack lt graphic object gt order than the specified graphic object sendToBackOf Moves the object one position lower in the stack lt graphic object gt order than the specified graphic object NOTE If a graphic object is part of a group these functions only change the object stack order within that group GRAPHIC OBJECT STACK ORDER 21 4 Using the orderPosition Property to Change Stack Order Dy
163. ATHS o o ooo o ooo A 1 xix ABOUT THE RAPIDPLUS DOCUMENTATION About the User Manual Supplement This manual provides the information you need to use the new objects and features added since Rapid 4 0 It supplements the information found in the Rapid User Manual e Chapter 1 Managing Projects describes how to work with RapidPLUS on a project wide basis simultaneously editing the parent application and its user objects It also describes how to implement team development and version control using XML application files e Chapter 2 RapidPLUS Applications in XML explains how to work with applications saved to XML format and the benefits of working with projects in XML e Chapter 3 Comparing Applications in the Differencing Tool explains how to use the Differencing Tool to compare objects modes user objects and or interface of two applications e Chapter 4 Debugging Applications describes how to filter and capture the Debugger output in a log that can be viewed saved and printed e Chapter 5 Logic Error View describes how this tool displays errors and warnings for logic and XML applications e Chapter 6 Pasting Operations explains how to cut copy and paste objects modes and logic elements between RapidPLUS applications e Chapter 7 Writing Logic Using Loops and Branches describes how to use loop statements to execute a block i e a set of activities over and
164. ATION When an exported property is added to the RapidPLUS simulation the host document is able to get data from the Rapid Simulator A host document gets data from the RapidPLUS simulation in two ways e Initiated by the host document the host document sends a request for an exported property s value to the RapidPLUS simulation via the Rapid Simulator GETTING DATA INITIATED BY THE HOST DOCUMENT 18 11 e Initiated by the RapidPLUS simulation when the value of an exported property changes the RapidPLUS simulation notifies the Rapid Simulator which then sends the value to the host document Both of these methods are explained below together with procedures for setting up the host document and RapidPLUS simulation to get data GETTING DATA INITIATED BY THE HOST DOCUMENT The following illustration shows how the host document sends a request for the value of an exported property to the RapidPLUS simulation via the Rapid Simulator object Host Document l b Value requested a Property value from application lt getApplicationProperty requested by l getApplication Property Rapid application Exported f properties i c Value returned l gt d Property value Rapid Simulator ActiveX object returned to host Programming language i In the host document s programming language the GetApplication Property lt property name gt
165. Activity Property Name fer A User Functions FIND AND REPLACE 8 12 The filter options are OPTION DESCRIPTION Type Select the logic types to include in the search Object Name Select or type the name of an application object You can use wild cards such as Lamp for the search Property Name Select a property for the selected object If left blank the search will return all logic related to the specified object FIND AND REPLACE EXAMPLES The following examples show how you can combine various Find and Replace features to achieve certain results Example 1 Change Logic Scenario You implemented transitions between certain modes in subtree PowerOn via the event Pushbutton1 in and now you want to implement some of those transitions with the event Switch1 up make 1 In the Find tabbed page set the following e Find What Pushbutton1 in e Start in Mode PowerOn e Include Subtree selected In the Advanced tabbed page set the following e Type only Trigger should be selected e Object Name you could optionally enter Pushbutton here but your search string in the Find tabbed page eliminates this as a necessity Click the Find button When the search is complete click the Replace tab In the Replace With box type in Switch1 up make FIND AND REPLACE EXAMPLES 6 7 Select the triggers that you want to change Click Replace Example 2 Replace Text Scenario You want
166. Array The first object selected determines the default object of the array If any of the selected objects is not compatible with the default object RapidPLUS does not create the array and displays an appropriate message When the array is successfully created RapidPLUS displays the name of the created array The objects are entered into the array s Edit Elements dialog box in the order in which they were selected NOTE If you are working in Windows 2000 and you made the object array from imported bitmaps the bitmaps might not appear in the order in which they were selected due to a bug in the Windows 2000 Import Bitmap File dialog box Importing Data into Arrays Data can be imported into one and two dimensional arrays from TXT CSV and RAR files e RAR files are RAPIDPLUS files that are created via array logic e CSV comma delimited files are created in Microsoft Excel e TXT files are created in Microsoft Excel or any text editor TXT files containing Unicode cannot be imported Before you import data into an array the data must be formatted correctly RAR files have preset formats that are created when the objects saveToFile function is used See Formatting Data in Microsoft Excel CSV files on p 10 19 and Formatting Data in a Text Editor TXT files on p 10 20 for information about formatting the files To import data into an array 1 Optional Select the Number of Dimensions either 1 o
167. C programming An understanding of unions and structures in C is helpful HOW DOES A USER OBJECT MESSAGE WORK As shown in the illustration on the following page when you add a user object to the parent application its unions are automatically made available to the application along with its properties events and or functions if any Either the parent application or the user object can assign values to structure fields or assign one like structure to another and either side can pass a structure to the other side via the send function The send function automatically triggers the messageReceived event on the side receiving the data In a union only one structure can be active at any given time As shown on the following page assigning a value to a structure makes it active locally that is on the side either parent application or user object that called the assignment activity The value is not available to the other side until the structure is sent Sending a structure makes it active on the receiving side NOTE The structure must be active on the sending side before it can be sent The role of the active structure Messages are sent from the user object to its parent application or vice versa in a free form format The active structure defines the semantics of the message that is it defines how the collection of bytes currently located in the interface should be parsed is it for example a string of 10
168. CHART As shown in the illustrations above an exported state chart can include logic information The amount of logic presented is defined in the Export to Visio dialog box To export a state chart that includes selected logic you must first mark the logic to be exported see To mark logic lines for export to Visio on p 24 5 To export a state chart to Visio 1 Open the application in the State Chart 2 Select the mode whose state chart you want to export The number of levels included in the exported chart is determined by the number of levels set for the state chart in the Chart Options dialog box Tools Options State Chart tab 3 Choose Tools Export State Chart or click the State Chart button the Export to Visio dialog box opens Export to Yisio El m Export Logic E Marked i Exports mode and external transitions for selected mode and its child _Cancel modes triggers for marked logic lines Help E an Exports mode external transitions and triggers for selected mode and its child modes Exports selected mode and its child modes 4 Select the Export Logic format as follows e Marked exports a chart that displays modes external transitions and marked logic lines See instructions for marking and unmarking logic lines on the next page e All exports a chart that displays modes external transitions and all logic lines both marked and unmarked e None exports a chart that di
169. Changes to assign and loadFromFile p 26 17 function it is no longer an error to assign or load a two dimensional array of a different size Commlink e If requested by the user send output and p 26 17 receive input one byte at a time Pointer e A three segment pointer type has been p 26 19 added During runtime the middle segment can be offset from the pointer s axis of rotation 26 2 OBJECT ENHANCEMENTS OBJECT ENHANCEMENTS REFERENCE DLL e DLL functions are selected from a list not p 26 21 typed in The DLL function call can be performed in a separate process Pushbutton A new event longPress simulates an p 26 22 extended press on a pushbutton The long press period is set in the Pushbutton dialog box Text display Alignment functionality was added to p 26 22 enable changing alignment during design time and runtime ONE DIMENSIONAL ARRAYS Searching Backwards To search backwards in a one dimensional array e Call the searchFor from to function and provide a from value that is greater than the to value For example the following logic returns the index of the first element in str_Arr that starts with a capital A starting the search from the last array element and working towards the top int_Arr 1 str_Arr searchFor regexp A from str_Arr size to 1 To continue the search backwards e Call the searchNextBackward function The most recent search is cont
170. Click event Number of cells on the touch screen by rows and columns Touch Screen Number of cells Rows Columns fil mo Cell size Width Height fis fis pals Click delay 200 msec Grid width 1 pxls Size of each cell Minimal click event delay Width of the grid lines Hiding Grid Lines You can use either of the following ways to hide the grid lines e Set the Grid width to 0 Or e In the touch screen s Colors Edit dialog box select the Transparent check box and set the same color in Line Shading and Transparent DEFINING THE LOGIC 14 3 DEFINING THE LOGIC A touch screen is sensitive to the following operations touch drag and pressure In the simulation these operations are imitated by the mouse For each operation there is a distinct mouse activity counterpart Pressing the mouse left button constitutes touch and is supported in the logic by the touched and released events Keeping the left mouse button pressed while moving the mouse constitutes drag and is supported by the touchedDragged event Clicking the mouse pressing its left button at least for the Click delay period then releasing without having moved it constitutes pressure and is supported by the clicked event NOTES Numeration of the columns and rows in the touch screen object s matrix starts with
171. Debug Options Help y Se 19 6 Aa KA nren A Integer functor _ ADDITIONAL RAPIDPLUS ENHANCEMENTS 27 22 r eturn After you have selected the return type you build the user function All flow paths and in particular the last line of the logic must contain a return statement returning a value of the type you have specified To build a return statement 1 Select Logic Return or click the return button in the Logic Palette A line of logic is added to the edit line with return plus a prompt for the return type you have specified if any For example with a return type of Integer you will see return lt Integer gt 2 Complete the return logic statement then save the user function Possible Errors Below are possible errors that can occur when working with user functions that return values Path with no return value If you specify a return type for a user function all flow paths through the user function must return a value For example both blocks of an If Else statement must have a return statement if no return statement follows the If Else blocks If you do not include a return statement a warning message appears and you have the opportunity to fix it If you choose not to fix the function the function will return null O zero or empty string from the path with no return values according to the specified return type This may result in an error at runtime Object type
172. Debugger click the Show Hide Panes 2 Click the Logger tab to see log data NOTE Showing the pane while logging may slow down the application s execution If this creates a performance problem you should close the pane and let the Logger run in the background You can view the log data at any time by just opening the pane The following illustration shows a typical Logger pane after the Prototyper has started Show Hide Panes and Enable Disable Logging buttons El Prototyper Running Logger tab File Edit View Debug Logging Inspect Breakpoints Filters Option Resizable columns Cycle Time stamp Context Type Description E 2115 47801 TEL_MAIN on Transition on intemal Trigger s 2115 47801 2115 47801 currentT ime_Clock se if 2115 47802 E Action currentT ime_String if 2115 47805 Action Display displayT ime c fi 2115 47805 g Function call Display displayTime c Start actions Actions for transition Action 2115 47805 Display Function line clock_Display content Logic type icons The columns in the Logger pane present the following information COLUMN DESCRIPTION Logic type icons Icons to help easily identify logic types Cycle State machine cycle Time stamp Elapsed time in milliseconds 4 12 DEBUGGING APPLICATIONS COLUMN DESCRIPTION Context The component parent application or user object that contains the executed logic line Mode Mode in
173. Displays the Report Viewer opens displaying the components and their target graphic display 25 20 GENERATING REPORTS COVERAGE TEST REPORTS This report is an ASCII text file that presents coverage test results for an application that was run in the Prototyper This project wide test reports any modes transitions triggers user functions or objects that were not referenced while the Prototyper was running Coverage Test reports can be used with third party software that runs automatic tests on the application A typical report as viewed in the Report Viewer looks like this N Coverage Test Report for CDPLAYER Of x File Edit Help AEE RAPID APPLICATION CDPLAYER 03 02 04 09 31 12 AM Coverage Test Report COVERAGE RESULTS ROOT APPLICATION CDPLAYER TRANSITIONS TRIGGERS NOT ACTIVATED Cdplayer internal gt Pushbuttonl out 4 electricPlugIn to electricPlugOut Dj gt electricPlug Sw left make powerOn to powerOff D gt amp power Pb is out diskIn to noDisk Dj gt disk_Pb in amp run to stop D gt song Stopwatch time gt songTime_ Int OBJECTS NOT TESTED Cdplayer songTime_Int song_Waw HELP CD_Group Pushbuttonl simulation_Group USER OBJECT HELP OBJECTS NOT TESTED help HelpCall USER FUNCTIONS NOT TESTED contents contentsOf topic y COVERAGE TEST REPORTS E To generate a Coverage Test report 1 In the Prototyper run the application until
174. E 20 9 Implementing Raster Images 2 o oo o e e 20 10 Implementing WGL Functions o ooo o eee ee eee ee 20 11 Drawing Texte ii O A A AA E 20 11 Code Generation mirre A NAS A A Ae 20 12 CHAPTER 21 GRAPHIC OBJECT STACK ORDER 21 1 Changing Stack Order in the Object Layout ooo oooooocoo 0 0000 21 2 Bringing In Front Of or Sending To Back Of oo oooooooo oo 21 2 Changing Stack Order During Runtime o o o 21 3 Moving Dynamic Graphic Objects to Front or Back 21 3 Using the orderPosition Property to Change Stack Order 21 4 CHAPTER 22 USER OBJECTS WITH MESSAGES 22 1 How Does a User Object Message Work 2 2 oo ooo o 22 2 User Object Message Parts A Glossary 2 ooo ooo o o o 22 4 Adding Messages to a User Object o ooooooo ee e 22 5 Adding Unions and Structures e 22 7 Adding Fields to a StrUCtUIE e 22 9 Editing Fields and Changing NaMeS ooo o e 22 12 Deleting a Field Structure or Union o ooo oo e 22 13 Changing the Order of Unions Structures and Fields 22 13 Defining the Memory Allocation Method o o oo ooo o 22 13 When to Use an Array of Structures eee 22 14 Using the User Object Message Logic
175. E SOFTWARE Classes CLSID CLSID CAUTION Do not make changes to the Windows registry Only use this information for copying and pasting into the command line Example The following command generates an ActiveX control and assigns the specified CLSID A ProgID will be assigned automatically AppActiveXGen exe applics MyApp rpd Je E2F91AB8 E570 4a28 AEC6 5C40F3452F45 p lt ProgID gt Option This option specifies a unique programmatic identifier ProgID a string value that identifies the RapidPLUS ActiveX control If left empty a new ProgID will be assigned automatically The automatically generated format is RapidAXBridge RapidPLUS lt AppName gt Bridge RAPIDPLUS ACTIVEX BRIDGE UTILITY 17 27 The ProgID must comply with the following requirements e Start with a letter e Not exceed 39 characters e Not contain spaces or punctuation including underscores except for periods You can find the ProgID in the Windows Registry Editor at HKEY LOCAL MACHINE SOFTWARE Classes lt ProgID gt CAUTION Do not make changes to the Windows registry Only use this information for copying and pasting into the command line Example The following command generates an ActiveX control and assigns the specified ProgID A CLSID will be assigned automatically AppActiveXGen exe applics MyApp rpd p RapidAXBridge RapidPLUSMyAppBridge Updating the ActiveX Control If you update the exported properties or events in th
176. Function Function line 1 Function line n Logic Related Objects or Logic Related Interface Elements Related Objects or Related Interface Elements Not to be confused with argument variables Example When pasting the following user function Display1 is pasted but Stringl is not Function JuvriteS tring lt String Stringl gt fai Display contents lt Stringl gt NOTE A user function may include calls to other user functions A call to such a nested function is treated the same way as any logic line that calls a user function that is the entire user function is copied and pasted ELEMENTS YOU CAN CUT COPY AND PASTE Trigger The following chart illustrates the elements that are pasted when you copy and paste a trigger or Related Interface Elements Trigger CONDITIONS EVENTS ACTIONS if any Related Objects Action 1 or Related Interface Related Objects Logic Elements or Related Interface Elements Action n Related Objects Logic Transition The following chart summarizes the elements that are pasted when copying a transition Transition TRIGGERS Reference to the Trigger destination mode f not actually copied For a detailed description of what s included in each trigger block please refer to the Trigger chart on p 6 5 In addition RapidPLUS takes note of the tran
177. G CONSTANT OBJECTS 11 5 Importing Data to a Constant Set Object You can import data into a constant set object from one or more h files The import operation applies to the following h file data types define const integer types only and enum The imported data replaces the items currently in the constant set To import data from h files 1 In the constant set More dialog box click Import 2 In the Import Constants dialog box select the h source file s and click Open the Import Constant Set dialog box opens listing all the items that can be imported See a sample list in the following illustration The items are listed in a three level tree and are grouped as follows e All the define items are grouped under the define heading e All the const items are grouped under the const heading e The items of each enum form a separate group under the enum name when available or under the generic name enum followed by a consecutive number e The items of each enum form a separate group under the enum name when available or under the generic name enum followed by a consecutive number 11 6 CONSTANT OBJECTS Click here to select clear the entire tree Constant name Constant value Import Constant Set define group C SMALL_ENDIAN 0 C BIG_ENDIAN 1 const group e const Select All C itemi 123 C maxCount 1000 Deselect All Click here to cltem
178. HE APPLICATION LOGIC 20 7 Pointer Parameters Some OpenGL and GLU functions have pointers to arrays as parameters RapidPLUS functions however cannot use pointers as arguments Where the maximum size of the array pointer parameter is known the OpenGL function is supported in RapidPLUS by adding arguments that set the value of each array element Example The OpenGL library includes several variations of a glLight function for setting the light source parameters for one of the eight available light sources One of the OpenGL function declarations is as follows void GLLightfv GLenum light GLenum pname const GLfloat params where light is a constant that specifies which light source is being modified from GL_LIGHTO to GL_LIGHT7 pname is a constant that specifies which lighting parameter is being set params is anumber array with four elements For example the lighting parameter GL_POSITION uses the first three elements to specify the position of the light source and the fourth to specify whether or not the light source is directional In RapidPLUS this OpenGL function is implemented as follows glLightfv_light pname paraml param2 param3 param4 Thus if we wanted to use potentiometers to control the position gl_POSITION of a light source gl_LIGHTO the internal action or the mode activity would look something like OpenGL1 glLightfv_ light OpenGL1 cA gl_LIGHTO pname OpenGL1 cM gl POSITION parami
179. INATION TRIGGER ACTION internal Timer tick LCD1 setDrawColor 1 LCD1 drawPixelatx int_X y 0 LCD1 drawPixelatx int_X y 1 int_X changeBy 1 where Timerl is a one second timer that has been activated by the startRepeat function and int_X is a wraparound integer from 0 to the display width minus 1 At each timer tick a pixel at the same horizontal position in each of the LCD screen s two upper rows is drawn in the color specified by the setDrawColor function and int_X is incremented by one The effect is a two pixel bar scrolling across the top of the LCD screen Changing Palette Colors During Runtime This section applies to graphic display objects not to true color graphic displays Use the setPaletteIndex toRed green blue function to change the color of any entry in the graphic display object s palette during runtime The palette entry is referenced by its palette index see Color by number on p 12 10 and the color is specified by the values of its RGB components Palette color changes become visible on the display only after the updatePalette function is run This function updates the RGB values of the colors in the palette and then redraws the display exactly as the updateAll function does The updatePalette function does not redraw the display when there was no modification of palette colors For details about the update functions see Setting the Update Mode on p 12 31 12 20 GRAPHIC DISPLAYS
180. INE ae E Sees The message text is typed here To create a message window 1 In the Message dialog box a If you want to change the text that appears in the title bar overtype Message in the Title box b By default the message window contains a button for closing the window named OK If you want to change the name of the button overtype OK in the Button Text box If you don t want a button to appear in the window clear the Closing Button check box c The default color of the text that will appear in the message window is black To change the color select a different color in the palette The new color is shown in the T preview box d To change the font of the message text click the Font button and make changes in the Font dialog box 2 In the message window type the text message text If the text is too large for the window you can resize the window 3 Move the message window to the Object Layout and place it in the location at which you want it to appear in the Prototyper 4 Click OK in the Message dialog box 10 42 NONGRAPHIC OBJECTS SYSTEM OBJECTS RapidPLUS automatically generates the following nongraphic objects in every application ASCII keyboard language mouse StateMachine SystemCursor SystemDate and SystemTime They are referred to as system objects Because system objects are not added to the application in the Object Layout they are referenced only through the Logic
181. If you want to send more than one type of data you may want to use a constant set object to define the types of data For example sendData AddressList_Constant_Set name id 2 sendData AddressList_Constant_Set streetAddress id 3 NOTE The maximum size for sending data is 32 000 bytes Notification That the Data Was Received When the external application receives data from RapidPLUS the application reads the data and then generates an acknowledged event back to RapidPLUS This event is important when the RapidPLUS application needs to know that the data was received before it sends the next data string The acknowledged event can be used in a trigger in RapidPLUS For example Applink1 acknowledged USING THE APPLINK OBJECT 16 5 Receiving Data When data is sent to RapidPLUS i A dataReceived event is generated ii The string is placed in the Applink object s data property and iii The getData function can retrieve the data The Applink object continues to receive data as long as the mode containing the getData function is active Once that mode becomes inactive the Applink object cannot receive new data One way to restart the process of receiving data is to use the checkForData function This function checks if there is data in the shared memory If so it generates a dataReceived event and the string is placed in the Applink object s data property You can then use the getData function to retrieve the data
182. In Authorware you cannot embed a RapidPLUS simulation that is larger than 60 KB If the Embed in host document check box is not selected the RapidPLUS simulation will be linked to the host document HOSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS 18 6 Configuring the RapidPLUS Simulation You can choose how the simulation appears in the host document in the Rapid Simulator s Properties dialog box To configure the simulation 1 Click the View tab Properties x Application View cet Select Embedded to embed simulation in host document or Stand alone to display simulation is a new stand alone window C Embedded 5 r Stand alone view Select to apply window border M Borders MV Always on top Initial display state Normal Hidden Full screen C Maximized Minimized Color palette for 256 color display only Select Background palette if host document is a Microsoft Office document or if you are having palette problems Select Foreground palette to use simulation s original palette Background palette Foreground palette Cancel Apply Help 2 Select either Embedded view or Stand alone view Embedded view The simulation is displayed within the Rapid Simulator If the simulation is larger than the Rapid Simulator scroll bars are added Stand alone view The simulation is displayed in a Reviewer window The Reviewer s initial appear
183. Java code that outputs to the Java console System out println hello from javabean To open the Java console 1 In the Application Manager choose Options Java Console 2 The Java console opens displaying output from Java including debug output from the JavaBean object JavaBean Incompatibility RapidPLUS works best with the Java Virtual Machine JDK JRE version1 3 x If a JavaBean is not compatible with the JVM used the JavaBean object will either not run or will partially work You can manually select a different JVM for RapidPLUS to use To select a different Java Virtual Machine 1 In the Application Manager choose Options Select Java VM to Use a dialog box opens for selecting a jvm dll 2 Select the appropriate jvm dll and click Open jvm dll is located in the JDK JRE installation folder usually inside the jre bin folder 3 Close and reopen RapidPLUS so that the new JVM setting will take effect Debugging Java Code Running Inside RapidPLUS In order to debug JavaBean objects running inside RapidPLUS you must instruct the JVM to listen for Debugger connections To do so you must make certain modifications in the Rapidxx ini file under the RPJavaManager section In this section you specify extra arguments to the JVM in the form of JVMArgumentX lines where X is a number between 1 99 This can be used for other things such as specifying an extra class path 19 20 USING JAVABEANS IN RAPIDPLUS Exam
184. LUS Simulations in Windows Programs The Rapid Reviewer can be linked to or embedded in another Windows program using the Rapid Simulator ActiveX control This ActiveX control not only allows a RapidPLUS application to be imported into another Windows program but it also enables the Windows program to manipulate and control the RapidPLUS application In Microsoft Office programs such as Word and PowerPoint Visual Basic macros can be used to transfer data to and from the RapidPLUS application and control the events that are generated in it In Microsoft Internet Explorer 4 x or higher and Netscape Communicator 4 08 4 x JavaScript is used In computer based training CBT programs such as Authorware and ToolBook program specific tools are used to achieve the same results In all these programs referred to as host applications the Properties dialog box of the Rapid Simulator object enables you to import a RapidPLUS application set the appearance of the RapidPLUS application determine the routing mode and set control features This chapter presents e How to add a RapidPLUS simulation to a host application e How to transfer data between the RapidPLUS simulation and host application e How to enable the host application to send actions to the simulation HOSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS 18 2 e How to enable the host application to monitor user actions that occur in the RapidPLUS simulation
185. Logic Editor by adding two backslashes 11 at the beginning of the line Undo Comment button and menu item If the selected search result lines are comments this undoes the comment by removing the two backslashes at the beginning of the line Delete menu item Deletes the selected logic lines from the Logic Editor Remove From List menu item Removes the selected logic lines from the search results list Copy to Clipboard menu item Copies the selected logic lines as text from the search results list to the Clipboard FIND AND REPLACE 8 8 USING REPLACE After performing the Find operation you can replace any string contained in the search results list The string designated to replace on the Replace tabbed page can be different from the string that was used to perform the search Replacing a String Before you replace a string you must perform the Find operation from the Find tabbed page To replace any string in the listed search results 1 2 3 4 Click the Replace tab In the Replace What box type any string to replace in the search results In the Replace With box type the replacement string Replace selected or all instances of the string e To replace specific instances in the search results list select the lines to be changed and click Replace You can use the standard Windows functions of Shift click and Ctrl click to select multiple lines e To replace all the instances o
186. MEE File Edit View Logic Functions Debug Options Help HISE es A frenos Y QE EB le feendDatalampOfftiggered Display1 contents sendD ata ScrollB aryalue 18 21 HOSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS 18 22 In the host document Two Button objects control the state of the lamp A Scrollbar object controls the value displayed in the text display The following script is added in Visual Basic Private Sub OnButton Click RapidSiml TriggerApplicationEvent lampon End Sub Private Sub OffButton_Click RapidSiml TriggerApplicationEvent lampoff End Sub Private Sub ScrollBarl1_Change RapidSiml SetApplicationProperty ScrollBarValue ScrollBarl Value End Sub SENDING EXTERNAL ACTIONS TO THE RAPIDPLUS SIMULATION In order to send external actions both the Rapid Simulator and the host document must be modified The host document can generate user actions in the simulation only when the Rapid Simulator is set up to accept external actions An example of an external action is pressing a Button object in the host document that causes a switch in the simulation to move to the Up position SENDING EXTERNAL ACTIONS TO THE RAPIDPLUS SIMULATION 18 23 Modifying the Rapid Simulator to Accept External Actions 1 Open the Rapid Simulator Properties dialog box CBT tab Application View CBT Routing Mode Sel lormal mode to ignore user actions Select Monitor m
187. ODS 3 pack bes BO VS Ree ee REA OO ee ee OR AS Ore 17 18 EVENTS batas sort SSMS sat re Mad a a e IS Cuts Coot ea th a a bh hl 17 19 VES Seley EOS Le Lae A elds aie a aloes 17 20 RapidActiveXHelper Object 6 eee 17 20 ActiveX Controls for the Automotive Industry 000 17 22 ActiveX Incompatibility sah arean e ee ee ee eee 17 23 RapidPLUS ActiveX Bridge Utility o ooo 00 00 0008 17 24 Generating a RapidPLUS ActiveX Control 00 00 0080 17 25 Updating the ActiveX Control ooo ooo o e 17 27 CHAPTER 18 HOSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS o o ee 18 1 Using a Rapid Simulator Object ee eee 18 2 Adding the Rapid Simulator o oo o e 18 3 Selecting the RapidPLUS Application to Be Simulated 18 3 Configuring the RapidPLUS Simulation o o o 18 6 Viewing the RapidPLUS Simulation ooo oo o 18 8 Viewing the RapidPLUS Simulation in a Browser o ooo oo 18 8 Resizing the RapidPLUS Simulation oo oo 18 9 Overview of Communication Options o ooo o e 18 10 How the Host Document Gets Data from the Simulation 18 10 Getting Data Initiated by the Host Document o oooo ooo o 18 11 Procedure for Getting Data Initiated by the Host Document
188. OSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS 18 18 Setup for getting data from the RapidPLUS simulation In the RapidPLUS application e In the Object Layout an exported number property is added called DialReading e In the Logic Editor a mode activity is added App DialReading Indicator1 reading In the Rapid Simulator object By default the Notify on application property change check box is selected In the host document e A Label control object is added to the document that will display DialReading s value e The following event handler is added in Visual Basic Private Sub RapidSiml_ApplicationPropertyChanged ByVal propertyName As String ByVal value As Variant Label1 Caption value End Sub The ApplicationPropertyChanged event handler enables the label to display the dial indicator s value 100 0 100 000000 SENDING DATA TO THE RAPIDPLUS SIMULATION 18 19 SENDING DATA TO THE RAPIDPLUS SIMULATION When an exported property or exported event is added to the RapidPLUS application the host document is able to send data to the RapidPLUS simulation object The host document calls a method that sets the exported property s value or event s triggers via the Rapid Simulator object The following illustration shows how a host document changes the value of an exported property Host Document Rapid Simulator Programming language ActiveX object a setApplicat
189. OUT 1 From the Object Palette select the OpenGL class icon and then the OpenGL object icon 2 Place and size the OpenGL object on the Object Layout work area as you would any graphic object The size of the OpenGL object determines the default dimensions and proportions of the viewport within which the OpenGL image is displayed during runtime Setting the Object s Parameters e Click the More button in the parameter pane to open the OpenGL RPX Properties dialog box OpenGL RPX Properties x r Object Creation Windowed objects always appear on top of non windowed objects The behavior of windowed objects may be Cancel somewhat different Windowed E Non Windowed Selects the window status as explained in Windowed vs Non Windowed on p 20 4 m Display lists Sharing display lists enable other OpenGL objects to use this object s Display lists fa Share display lists Do not share display lists Selects the display list status as explained in Display Lists on p 20 4 Click to display information about the OpenGL and GLU DLLs currently installed on your computer 20 4 OPENGL OBJECT Windowed vs Non Windowed A non windowed OpenGL object runs directly in the Prototyper like most of the RapidPLUS graphic objects A windowed OpenGL object runs in its own window within the Prototyper window like windowed ActiveX controls the text window object the messa
190. Object Properties dialog box NOTE The new constant set property has no connection to the original constant set object Changes to the original do not affect the property and vice versa Using Constant Set Properties in a Holder Constant set properties of a holder object are accessible even if the holder is empty Example A user object constant udo contains an exported constant set property called Colors In the parent application there is a holder object Holder1 Holder1 s default object is constant udo The following logic can be executed without causing runtime errors Holder1 clear Integer1 Holder1 Colors Red Sharing global constants in a project You can define all your constant set objects as properties of a user object const udo You can then add a holder of type const udo to any user object in the project that needs to access these constant set objects As explained there is no need to initialize the holder to make the constants accessible ADDITIONAL RAPIDPLUS ENHANCEMENTS 27 16 LOGIC EDITOR Color Coding in the Logic Editor You can use colors to define logic in the Logic Editor Using different colors can make writing and reading logic clearer The default color settings are ITEM COLOR Object Black Property Dark gray Function Blue Literal value argument Red Accessory symbol Black Event Dark green Special construct Dark blue bold Comment Dark cyan Defau
191. Opened Inspector Windows Any number of Inspector windows can be opened at a time Each time an Inspector window is opened its object is added to the bottom of the Inspect menu in the Debugger To navigate among open Inspector windows 1 In the Debugger click the Inspect menu All of the open Inspector windows are displayed at the bottom of the menu 2 Choose an Inspector window from the list This window comes into focus DEBUGGING APPLICATIONS 4 30 Closing Inspector Windows You can close Inspector windows individually by clicking their Close buttons or you can close them all at once To close all Inspector windows from the Debugger e Choose Inspect Close all inspectors All the Inspector windows close but the Prototyper remains open To close all Inspector windows from the Logic Editor e Choose Debug Close all inspectors All the Inspector windows close but the Prototyper remains open To close all Inspector windows from the Prototyper e Close the Prototyper 5 1 Logic Error View The Logic Error View is a tool that displays errors and warnings for logic lines that may have become invalid extraneous or corrupted due to alterations It contains options for identifying problematic logic locating the logic in the Logic Editor and reverifying logic that has been changed The tool opens automatically any time problematic logic is detected that may require reverification The Logic Error View can a
192. PALETTE The Logic Palette now contains buttons for building While loops For loops and If else branches lu Logic Palette Activity x Object Property Function Bitmap Frame Label Pushbutton Signal System Time CA C1212 e oj al These buttons are described in the following sections WORKING WITH WHILE LOOPS 7 3 WORKING WITH WHILE LOOPS The While loop has two parts PART DESCRIPTION Header The line that holds the construct keyword while and the While condition Block Contains activities that will execute as long as the While condition is true A typical While loop looks like Int1 1 while Array Int1 modulo 2 lt gt 0 While header Intl changeBy 1 continue searching While block First_Even_Number Array Int1 Notice that the block is indented and that the block s single activity appears on its own line For more information about block indentation see Understanding Indentation in Loops and Branches on p 7 9 In this While loop the array index Intl continuously changes by 1 until an even number is encountered Don t create While loops that never execute or terminate During runtime a loop is performed as a single activity That is RapidPLUS executes the loop header and block as a single piece of logic When a loop is being performed RapidPLUS does not change the application s state except for the changes made by the
193. PORTS 25 34 A search for id1671 leads to lt RPSource type 131 ID id1671 ver 168 gt lt text gt lt CDATA power Lamp on gt lt text gt These three steps take you from the mode to its logic You can see from the above examples that powerOn mode s entry activity is power_Lamp on For a visual representation of these steps see the following chart Following the path from a mode to one of its activities lt _RPMode type ID ver gt lt _RPMethodBlock type ID n7 ver gt lt _RPSource type ID n2 ver gt lt _name gt lt CDATA Mode name gt lt _name gt lt _text gt Search for idn1 gt lt _methodFixed sourcelD gt n2 Search for idn2 lt CDATA logic text gt lt _transitions lt text gt lt _entryActivities IDREF idn1 gt lt _exitActivities 26 1 Object Enhancements The following enhancements have been implemented on existing objects since version 4 0 OBJECT ENHANCEMENTS REFERENCE One dimen Searching backwards through an entire p 26 2 sional array array or through a subset of its elements Datastores e Reading Unicode strings p 26 4 one and ae e Sorting by single or multiple fields data p 26 4 on stores and columns arrays arrays Two dimen e Functions previously reserved for one p 26 8 sional array dimensional arrays have been extended to two dimensional arrays e
194. RANSITIONS Tests all the transitions triggers and issues a warning for any trigger which simultaneously activates more than one transition Syntax Trigger lt trigger syntax gt lt source model gt to lt destination model gt lt transition type gt lt source model gt to lt destination mode2 gt lt transition type gt Example Trigger Pb power in Day to On D Day to Month D In the VER_TEST application this warning indicates that the same trigger activates both transitions out of Day mode During runtime when Day mode is active and Pb_power is pressed RapidPLUS activates the first transition in the list WARNING MESSAGES 9 7 PROBLEMATIC TRANSITIONS FROM PARENT MODE TO CHILD MODE Tests all the transitions and issues a warning for condition only transitions from parent to default child or from mode to itself containing actions Such transitions may cause unpredictable behavior and should be avoided Syntax lt parent mode gt to lt default child mode gt lt transition type gt Example On to Selftest D In the VER_TEST application this warning indicates that the parent to default child mode transition from On to Selftest is a condition only transition that contains actions PROBLEMATIC INTERNAL TRANSITIONS Tests all the transitions and issues a warning for condition only internal transitions containing actions Such transitions may cause intensive CPU usage and t
195. RPD This RPD file can then be used as your Object Library Simply copy objects from it and paste them into another application 27 6 ADDITIONAL RAPIDPLUS ENHANCEMENTS 191 Alt Alt gt MULTIPLE TOOL ENHANCEMENTS The following enhancements are available through more than one RapidPLUS tool Back and Forward Buttons Retracing Mode Selections As you select modes and user objects whether or not you edit them RapidPLUS logs the selections You can use the Back and Forward buttons to retrace your selections This can be helpful when trying to find your place after browsing through a long mode tree or through many user objects The Back and Forward buttons retrace modes that were selected through the Mode Tree State Chart and Logic Editor and shows the selected modes in each of these windows To select previously visited modes do one of the following e In the Application Manager click the View Back button or choose View Back e Inthe Mode Tree or Object Layout choose Edit Back e In the Logic Editor or State Chart choose View Back Undo Redo You can undo and then redo editing actions in RapidPLUS tools such as the Object Layout Mode Tree Logic Error View Logic and Function Editors and State Chart The capability is e Multilevel so that you can undo a sequence of actions one action at a time e Global so that you can undo actions from any of the tools regardless of the tool used
196. RapidPLUS Simulation 1 Add an exported property to the RapidPLUS application For details about adding an exported property refer to Chapter 19 of the Rapid User Manual Adding User Properties p 19 6 For example an exported number property could hold the value that the host document will get 2 Make sure the Notify on application property change check box is selected in the Rapid Simulator Property dialog box see Automatic notification below for details 3 In the host document s programming language use an event handler ApplicationPropertyChanged for the Rapid Simulator to get the exported property s value For example RapidSiml1_ApplicationPropertyChanged ByVal lt propertyName gt As String ByVal value As Variant When the Simulation Contains More than One Exported Property When the simulation contains more than one exported property you must check for the actual property name For example Private Sub RapidSiml ApplicationPropertyChanged ByVal propertyName As String ByVal value As Variant Called when RapidPLUS application property changes Handle Application property changes If propertyName lt Propertyl1 gt Then Object1 Caption value Else If propertyName lt Property2 gt Then Object2 Caption value End If End If End Sub HOSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS 18 16 Automatic Notification You can make the RapidPLUS simulation automatically notify the Rap
197. RapidPLUS Simulator ActiveX object to link or embed the Rapid Reviewer in a Windows program so that the Windows program can manipulate and control a RapidPLUS application Chapter 19 Using JavaBeans in RapidPLUS describes how to add register and use JavaBeans as objects in RapidPLUS applications Chapter 20 OpenGL Object describes how to use the OpenGL object to implement complex graphic objects in RapidPLUS applications OpenGL is a platform independent graphics language that supports the fast rendering of 2 D and 3 D graphics e Chapter 21 Graphic Object Stack Order explains how to control the graphic object stack order Z order in both the Object Layout at design time and in the Prototyper at runtime e Chapter 22 User Objects with Messages provides detailed information about how a user object message works how to build a user object message and use its logic how to use data containers and how to import a message structure from a header file e Chapter 23 State Matrix explains how to export logic data to Microsoft Excel The exported data appears in Excel s workbook format XLS A RapidPLUS application s state matrix enables you to systematically check the application s modes triggers and transitions e Chapter 24 Exporting State Charts to Visio explains how to export a state chart to Microsoft Visio The exported chart follows the UML conventions for state charts e Chapter 25 G
198. RapidPLUS cannot open files with invalid XML syntax that do not conform to the schema An invalid XML file will result in a fatal error in RapidPLUS You can work on an open application in RapidPLUS and an external editor If you make a change in the XML file in the external editor and save the file RapidPLUS detects that the file has changed and prompts you to reload it Likewise if you make and save a change in RapidPLUS you can reload the file and see the change in the external editor Embedded resources appear in the XML file in Base64 encoding All external resources remain external to the RXD and UXO files RAPIDPLUS APPLICATIONS IN XML 2 12 Changing the Default XML Editor The default XML editor is an internal text editor To change the default editor 1 In the Application Manager choose Options Configuration Management Options the Configuration Management Options dialog box opens From the External XML Editor group select the Use External XML Editor check box External XML Editor LA Browse External XML Editor Path and Name vs exe External Editor Command Line Options sst Bgoto line r Click the Help button for information about the script Click the Browse button to browse to the editor s EXE file In the External Editor Command Line Options box specify the command line options required by the external editor to open a specified XML file to a specified location in the
199. Recordable and Nonrecordable JavaBean Objects Several files are provided that demonstrate the differences between the recordable and nonrecordable JavaBean objects located in the Examples JavaBeans RecordableEvents folder The counterbuttons jar file contains both the CounterButton and CounterButtonRecordable JavaBean objects including source code and support classes RapidAccessible and RapidRoutingSupport These JavaBean objects are used in an example application Recordable_Events rpd A sample document created in the Document Manager contains use cases recorded for the two JavaBean objects Note that when a JavaBean object does not support recordable events does not implement the RapidAccessible interface RapidPLUS records all mouse and keyboard events related to the JavaBean object so it will still work but the use case will be much larger for example the use case for the CounterButton JavaBean object has many more events because it does not support recordable events DEBUGGING JAVABEAN OBJECTS JavaBean objects can be debugged like any other RapidPLUS object using the Debugger and Inspector When the code of JavaBean objects needs to be debugged a Java console is provided DEBUGGING JAVABEAN OBJECTS 19 19 Using the Java Console The Java console is a RapidPLUS supplied window that displays output from Java All output to the Java system output and error streams go to this Java console Here is an example of
200. S The second method is especially useful for drawing polygons and it makes use of the moveTox y and lineTox y functions The illustration below shows the sequence of function calls that you would use to draw a hexagon 0 0 1 LCD moveTox 5 y 5 _ 2 LCD lineTox 10 y 5 with an implicit call to LCD moveTox 10 y 5 7 LCD lineTox 5 y 5 6 LCD lineTox O y 10 3 LCD lineTox 15 y 10 4 LCD lineTox 10 y 15 5 LCD lineTox 15 y 15 The first step initializes the drawing session by bringing an imaginary draw pointer to the start position No line is actually drawn NOTE By default the draw pointer is located at 0 0 The subsequent steps draw lines from the draw pointer s current position up to but not including the pixel specified in the lineTox y function Each call to this function also implies a call to moveTox y with the same coordinates see Step 2 in the illustration In other words the last pixel of the line segment just drawn becomes the new position of the draw pointer In this way you can draw connected line segments without having to explicitly specify each segment s start point Drawing Arcs Arcs are drawn in the graphic display s draw color by default black You can draw arcs on a graphic display using a function that takes the arc s center point radius start point and end point as parameters Imaginary radial lines are drawn from the center point through the start and end points
201. S window In general when a JavaBean object is added to the layout frame its inherent Java definition determines whether it is windowed or not windowed in RapidPLUS A windowed JavaBean object cannot be changed to non windowed however non windowed JavaBean objects can be made windowed although some may not work correctly NOTE If Java code is generated for an application windowed and non windowed JavaBean objects are generated according to their inherent Java definitions regardless of settings in RapidPLUS INTEGRATING JAVABEAN OBJECTS INTO RAPIDPLUS 19 5 To change a non windowed JavaBean object s window definition e Ina JavaBean object s parameter pane click the More button to open the its dialog box JavaBean Properties Moleculel M Object creation Windowed objects always appear on top of non windowed objects TER These two options Cancel determine whether the The behavior of windowed objects may be object will appear in its somewhat different than non windowed objects Help own window or as part K gt of the RapidPLUS Windowed window El Ni This button is available when__ f Object properties the object is customizable 7 Properties Constants Click it to open a properties dialog box A sample JavaBean object dialog box NOTE All RapidPLUS graphic objects are non windowed except for the text window object message object and graphic multi
202. Save As dialog box select XML User Defined Object UXO in the Save as type box 4 Type in a file name change the path if necessary and then click Save The UXO file is written to the specified folder and the UDO file is written in the cache Designating XML as the Default Application Format By default RapidPLUS applications are saved in the binary RPD format You can make XML format the default file format To designated XML as the default format 1 In the Application Manager choose Options Configuration Management Options 2 In the dialog box under the Default Format for New Applications group select the XML Format button Configuration Management Options x Default Format for New Applications Native Format RPD UDO A Use Cache When Opening XML Application RXD UXO OPENING APPLICATIONS IN XML FORMAT When an RXD or UXO file is opened either the XML formatted file or the binary RPD file stored in the cache is loaded The file type that is loaded depends on a setting in the Configuration Management Options dialog box The Use Cache When Opening XML Application check box is selected by default as shown above When the XML application file is first loaded RapidPLUS compares the signature of the file against the signature of the corresponding RPD UDO file stored in the cache RAPIDPLUS APPLICATIONS IN XML 2 4 If the signatures are identical the application is opened from t
203. Sets on p 17 6 for details 3 Click the Properties button to open the Property Browser Property Browser x Custom Appearance BackColor Misc Year 2001 ValuelsNull 0 Value 29 05 2001 TitleFontColor BB oxooa00000 TitleFont Arial Show WerticalGrid 1 Show Title 1 ShowHorizontalGrid 1 ShowDays 1 ShowDateSelectors 1 MonthLength 2 Month 5 GridLinesColor E oxso000010 GridFontColor E Ox00a00000 GridFont GridCellEftect FirstDay DayLength A amdi mima C oxsoooo00f b vv b b y Yv ba f Click the right arrow to open the respective property s dialog box Several properties may open the same dialog box Click the down arrow to open a list of values for the respective property USING ACTIVEX CONTROLS 17 6 Change the values of the various properties according to your needs A right arrow indicates an additional dialog box A down arrow indicates a list of values Getting help on an ActiveX control If there is online help for the control clicking the Help button in its Properties dialog box accesses its context sensitive information You can also get context sensitive help on its functions in the Logic Palette as you would for any RapidPLUS object function Viewing and Creating Constant Sets An ActiveX control may have constant sets of predefined possible values for one or more of its properties or for function and or ev
204. The maximum size is 1 000 000 Return values RPD_SUCCESS No error RPD_ER CHANNEL NOT OPEN The channel is not open RPD_LARGE QUEUE SIZE The size set is larger than the maximum queue size Examples of Code Using rpd_mem dll In this example a channel named RapidPLUS is opened The data type Applink_PHONE a phone number is used in the sendData function NOTE The channel name must be the same name as in the RapidPLUS application res rpd_openChannel Rapid dataArrived acknowledged if res RPD_SUCCESS send data rpd_setMode RAPID cQueued res rpd_sendData Rapid Applink PHONE data size Using the dataArrived Callback Function In this example the following data types are used Data Type Description Applink_ PHONE A phone number Applink_DATE A date Applink_TIME A time APPLINK OBJECT 16 16 void dataArrived int channelld Get data int type char buf 1024 int size 1024 res rpd getData channelld type buf size if res SUCCESS switch type case Applink DATE funcl buf size break case Applink TIME func2 buf size break case Applink PHONE func3 buf size break Using Polling You can use polling in place of the callback function for retrieving data while true res rpd_getData channels i channellId type data size if res gt 0 the buffer is not empty and no error occurs func type data size Using Acti
205. The resource files are marked with an asterisk they cannot be removed from the package The referenced fonts are presented in the format Font lt font name gt lt font file gt Update Application Files m Folders and Files to be Packaged The default folder displayed depends Relative to Folder on the location of the C Rapid applics CD_Player Sort bi fF ld application s supporting amil files Font Arial Bold ARIALBD TTF Font Courier New Bold COURBD TTF Font Digital Regular DIG O TTF CDPLAYER RPD HELP UDO C Rapid objects rapS way Add gt gt Y Hides paths that are ales ET xf subfolders of the fea E relative folder Hide Path J Hide Application Files Select All lt Back Cangel Help Hides files that are automatically Selects all non application added to the package These files files in the right pane appear with an asterisk t See comment on p 28 5 2 Optional Add additional files to the package by selecting them in the left pane and clicking the Add gt gt button Remove files from the right pane using the Remove button BUILDING AN APPLICATION PACKAGE When selected display 28 7 The elements below the left pane are Data 1ds rar X the system fonts When 7 Show System Fonts Select All not selected display returns to the previous i Selects all files and folders in the left pane 3 To add system
206. There are two ways to increase or decrease indentation To increase indentation e Right click the line to open the popup menu and choose Increase Indent or e Adda gt at the beginning of the Edit line 7 10 WRITING LOGIC USING LOOPS AND BRANCHES To decrease the indentation e Right click the line to open the popup menu and choose Decrease Indent or e Delete a gt at the beginning of the Edit line NOTE The first and second options are available only when the result of the changes creates valid logic blocks Pasting Lines into a Block When a line is pasted into a block the pasted line adopts the indentation of the target For example if the pasted line contains two tabs but the activity above the paste site only contains one tab RapidPLUS will reset the pasted line s indentation to one tab BREAK CONTINUE IN FOR AND WHILE LOOPS You can manipulate the processing of For and While loops using Break and Continue statements A Break statement can be used to terminate a loop A Continue statement can be used to terminate the current cycle of a loop and continue with the next cycle When there are nested loops Break and Continue statements affect the innermost loop To add a Break statement e Atthe appropriate place in the loop choose Logic Break break is appended to the Logic Editor s edit line To add a Continue statement e At the appropriate place in the loop choose Logic Continue con
207. US and as a standalone JavaBean In addition two other class files must be placed inside the JavaBean object s JAR file com esim accessibility beans BeanContext and com esim util Light weightCollection Step 2 Supply a BeanContext Object to Query Status After the JavaBean object implements the BeanContextChild interface RapidPLUS will call the JavaBean object s setBeanContext method and supply it with a BeanContext object This object is used to query the JavaBean about its status whether the object is in design time or runtime by calling its isDesignTime method NOTE We recommend that you call the isDesignTime method from the paint method An example application CounterButton2 rpd is provided to demonstrate a JavaBean object that draws a default representation in the Object Layout It also includes comments about how to implement the BeanContextChild interface located in the Examples Objects JavaBeans BeanContext folder USING JAVABEANS IN RAPIDPLUS 19 14 IMPLEMENTING RECORDABLE EVENTS FOR JAVABEAN OBJECTS In both RapidPLUS and the Scenario Authoring Tool events also known as user actions performed with RapidPLUS objects can be recorded and replayed In RapidPLUS recorded events can be replayed in the Prototyper and in the Rapid Reviewer and can be added as use and test cases in the Document Manager In the Scenario Authoring Tool recorded events become an integral part of scenarios guided tours whi
208. Unknown can be manipulated through the getProperty and setProperty functions of the RapidActiveXHelper object See p 17 20 SUPPORTED ACTIVEX DATA TYPES New RapidPLUS Data Types The following properties have been added to RapidPLUS in order to support ActiveX objects that require them e Picture e Font e Date 17 11 NOTE These objects are only available as ActiveX properties in the Logic Editor and have no relation to the existing bitmap font and date objects in RapidPLUS Picture FUNCTION DESCRIPTION EXAMPLE Allows the assignment of one picture Image1 picture property to another Image2 picture loadFromFile Loads a picture from the specified Image1 picture lt string gt image file File types supported BMP loadFromrile and ICO c images mouse ico NOTE If you do not specify a path RapidPLUS searches in the RapidPLUS search paths as described in Defining a Search Path on p 1 14 saveToFile Saves the picture to the specified file If Imagel picture lt string gt you do not specify a path it saves to the saveTofFile current directory usually the c images mouse bmp RapidPLUS directory File type supported BMP clear Clears the picture Image1 picture clear width Returns the picture width in pixels Int1 Image1 picture width height Returns the picture height in pixels Int1 Image1 picture height USING ACTIVEX CONTROLS 17 12
209. User Manual Supplement User Manual Supplement O 2004 e SIM Ltd All rights reserved e SIM Ltd POB 45002 Jerusalem 91450 Israel Tel 972 2 5870770 Fax 972 2 5870773 Information in this manual is subject to change without notice and does not represent a commitment on the part of the vendor The software described in this manual is furnished under a license agreement and may be used or copied only in accordance with the terms of that agreement No part of this manual may be reproduced or transmitted in any form or by any means electronic or mechanical including photocopying and recording for any purpose without the express written permission of e SIM Ltd Microsoft Windows Windows NT Visio and ActiveX are either registered trademarks or trademarks of Microsoft Corporation in the United States and or other countries Microsoft Windows CE Access Excel and Internet Explorer are products of Microsoft Corporation Acrobat Reader is a registered trademark of Adobe Systems Incorporated Authorware is a registered trademark of Macromedia Inc ToolBook Il is a registered trademark of SumTotal Systems Inc Paint Shop Pro is a registered trademark of Jasc Corporation Inc Other product and company names mentioned in this manual may be trademarks or registered trademarks of their respective owners Written and produced by e SIM Ltd MAN Supp 8 0 Printed in Israel Contents About the RapidPLUS Documentati0N
210. Working with Colors You can control the background color of the graphic display and the colors of any graphic element displayed on it For a graphic display object the number of color choices available depends on the number of colors you selected in the Graphic Display dialog box When you want to use a specific color the color s index corresponds to its 12 16 GRAPHIC DISPLAYS index in the object s color palette By default the first color in the palette is black 1 and the last color is white 2 4 8 16 32 128 or 256 For a true color graphic display the color corresponds to the color s RGB value 0x0 to OxFFFFFF 0 to 16777215 The first color is black 0x0 0 and the last color is white xFFFFFF 16777215 Changing the Draw Color The default draw color for graphic displays is black This color can be changed during runtime using the setDrawColor function The draw color is used for e Displaying text characters drawText atx y e Showing the borders of empty shapes drawCircleAtcx cy radius drawEllipseAtcx cy horizRadius vertRadius drawRecAt width height e Drawing a pixel drawPixelAtx y e Drawing lines drawArcAtcx cy radius fromX fromY toX toY drawLineFromx y toX toY lineTox y Example A cell phone s LCD displays text and graphic elements in white LCD1 setDrawColor 4 where white is the fourth color in the graphic display s 4 color palette Reversing the Color of a Specified Are
211. XML Exported Interface Element The lt export gt element contains the definitions of exported elements functions properties events and messages This section generally appears in user objects UXO files User Object Interface lt export gt Element n lt export gt lt Event name lightsChanged gt Properties Events Messages Functions lt export gt Name lightsChanged Accept eS This element will also appear in applications RXD files that export interface elements to the Rapid Simulator ActiveX object Objects The lt private gt element contains all of the application s objects The order of the objects reflects their z order in the application In order to make the XML files as small and readable as possible RapidPLUS saves only the object attributes that differ from the default values For example a lamp s default blink period is 500 msec If the application maintains this default period RapidPLUS does not write it to the XML file If the blink period is changed to a new value the value is written in the next Save operation You can include all object attributes including default values in the XML file by changing a setting in the Configuration Management Options dialog box This change is especially useful if you plan to process the XML file with an external tool such as an external report generator To include all attributes 1 In the Application Manager choose Options Configuration
212. a The reverseFromx y width height function allows you to define a specific area of the graphic display that will be represented in a reverse color To determine which color to use for the reversed area the graphic display i Identifies the current RGB values of each pixel in the specified area ii Determines the reverse color for each pixel The reverse color RGB values are derived by subtracting each of the current RGB values from 255 iii For graphic displays checks the object s color palette for the closest color available For true color graphic displays uses the new RGB values For example a graphic display object has two colors in its palette black and red where black is the background color RGB values 0 0 0 With the reverseFromx y width height fanction you specify an area of pixels within which the colors are to be reversed The object determines that white RGB values 255 255 255 is the reverse of the black background DEFINING THE LOGIC 12 17 color However white is not present in the graphic display s color palette Thus the background of the reverse area is drawn in red Example A cell phone s LCD provides a visual cue when a user selects an option It does so by displaying the option name in reverse color Assume that the graphic display object has four colors in its palette and the string was originally written at the x y coordinates of 101 The logic for this function is LCD1 reverseFromx ly 1
213. a eek es oS eg 9 3 Warning Messages 2 4 3 2 44 mil O SPA SES ee ot ey a ed a 9 4 CHAPTER 10 NONGRAPHIC OBJECTS o o ooo 10 1 Adding Nongraphic Objects 6 oo oo eee 10 2 Managing Nongraphic Objects o ooo ee eee 10 4 Renaming a Nongraphic Object 2 0 0 0 0 2 ee eee ee ee eee 10 5 Editing a Nongraphic Object 2 2 aaa 10 5 vii viii CONTENTS Adding Notes to a Nongraphic Object 0 2 000000000000 10 5 Copying and Pasting Nongraphic Objects 2 0 0 2 0 00000000004 10 5 Duplicating a Nongraphic Object 2 0 0 000000 eee eee 10 6 Deleting a Nongraphic Object 0 0 0 0000 0c oo eee eee 10 7 Replacing a Nongraphic Object 2 0 0 000 cee ee eee 10 7 Data Objects ooo seek a epee o A eee eee hides 10 8 SEA Ae a Most a Salant IM e AE 10 8 NumMbe tise 2 453 2 54 49 445g a A Gabe dy 10 8 IEEE eek Gok e Ba Bee ah Oat th en ena AO dremel te 10 10 Random Nube e See ot LG Ek gs Se aa 10 11 HOMdGT eS hace Be 2 Soh ge hee ead See Ge Ss Sa SF eee 10 12 Aay fet 2 A A ee Ae Be Ee eee ees 10 14 Data Stores st bailando tate Ol a os Bt A Sot le Chee Sih ns Bt Mes 10 21 POMO a OD sie ae Sead a Bt eas 10 29 Advanced C Code Generation Options 0 0 200008 10 30 Time ODjeetss 5 naras egy ca Se oe AO Be ew ad a a pes 10 34 TAME BE Sle BOR Ee eS Oe BA Gee EE a ee aed bs 10 35 Stopwatches e Je NN 10 35 Dita si eo a ahd Ha te
214. aBean objects are supported in Java code generation For information refer to the Generating Web Simulations manual 20 1 OpenGL Object The OpenGL object interfaces with the OpenGL library and extensions in order to implement complex graphic objects in RapidPLUS applications OpenGL is a platform independent graphics library that supports the fast rendering of 2 D and 3 D graphics including the following features e Rendering of graphic primitives points lines polygons curves etc in 2 D or 3 D space framed filled or patterned e Incorporation of materials lighting fog reflections and shadows in order to enhance the realism of scenes e Drawing bitmap images including scaling rotation transparency and other effects e Mapping textures images on complex objects e Transformation of an object in 3 D space allowing animation effects such as rotating scaling and moving the scene OpenGL does not include functions for window management user interaction or file I O Each host environment in our case Microsoft Windows must implement some means of handing over to OpenGL the drawing control of a window or bitmap OPENGL OBJECT 20 2 OVERVIEW The following diagram illustrates how the OpenGL object works in the RapidPLUS environment OpenGL Object OpenGL Running Under Windows 5 Functions of the self OpenGL GLU WGL property Functions a y Function
215. ab To do so 1 Choose Edit User Object Properties or double click anywhere in the Object Layout work area but not on an object 2 Click the More button in the root object s parameter pane The User Object Properties dialog box opens at the Properties tab 3 Click the Messages tab The following illustration shows the various message components User Object Messages Untitled Properties Events Messages Functions Name Structure_Calls Accept Structure Structure_Calls String number Adds a union to the user object Adds a definition only structure to the user object Structure Adds a definition only structure to the selected union or as a field to the selected structure String CallFrom Existing Struct Integer Network_Type String CallFrom Y 7 Integer Network_Type Add Field Union Communications String Structure_Calls incomingCalls String number Integer Adds a string integer number String CallFrom or array field to the selected Integer Network_Type Number structure Structure outgoingCalls a Number RSSI_Value Structure_Calls myCall Array String number New Strict Adds a single instance structure Copy to the selected union Copies the selected union or definition only structure J Show Data Type Show Top Level Only Import M Pastes the union or definition only structure located in the paste buffer Delete W
216. ace e In the Application Manager choose View Find Replace Each tabbed page in the Find amp Replace dialog box Find Replace and Advanced presents a different set of operations USING FIND On the Find tabbed page set options to look for a specific string or substring in the application logic Access list of recent strings Project components list unavailable when Search in entire project is selected 2 JFind amp Replace TEL_MAIN Find Replace Advanced z Find Find What Close Search in entire project Stop TEL_MAIN D RAPID O Include Subtree Golo Make Comment Lee A Search in All Modes Start in Mode ftel_main A Include Subtree Remove Comment J Whole Word Only 2 Match Case Help User Object Contained In Mode list unavailable when Search in All Modes is selected USING FIND 8 3 The available search options are as follows OPTION Find What DESCRIPTION Enter the string or substring that you want to search for You can also choose a recent search string from the list Use an asterisk as a wild card to represent any group of characters It can be used before in the middle of or after the string NOTE Using a wild card disables the Whole Word Only option Example Suppose your application has three objects named Switch1A Switch2A and Switch3A To search for all the logic items containing
217. act interface the JavaBean will have This interface will also appear in the RapidPLUS logic If you are using commercial JavaBeans most likely they will contain BeanInfo classes to specify the exact interface of the bean in Java GUI design tools and this interface will also appear in RapidPLUS If you are developing your own JavaBeans you can use the BeanInfo class to control exactly which functions properties and events will appear in the RapidPLUS logic This gives you the same control you have when developing other RapidPLUS objects like RPX and user objects For more information on BeanInfo classes refer to the JavaBean specification from Sun Microsystems CHECKING THE RUNNING STATUS OF JAVABEAN OBJECTS 19 13 CHECKING THE RUNNING STATUS OF JAVABEAN OBJECTS JavaBean objects can be programmed to check their own running status that is whether they are currently in design time Object Layout or runtime Prototyper or LiveManuals This capability enables each JavaBean object to draw a default representation of itself in the Object Layout Step 1 Implement BeanContextChild Each JavaBean object must implement the BeanContextChild interface com esim accessibility beans BeanContext This interface is part of the LiveManuals Java classes and can also be found at lt Rapidxx folder gt 1java1jb Wrapperl We recommend that you place BeanContextChild class inside the JavaBean object s JAR file so that it will work in RapidPL
218. al parameters and logic Some nongraphic objects are present in all applications Because they do not need to be added to the application they are referenced only through the Logic Palette and not in the Object Layout These nongraphic objects are referred to as system objects Examples of system objects are SystemTime which holds the system s real time clock and the mouse object which makes the system mouse available to the logic This chapter presents e How to add nongraphic objects e How to manage nongraphic objects renaming editing copying deleting and replacing e The classes and types of nongraphic objects The objects are presented in the order in which they appear in the Object Palette NONGRAPHIC OBJECTS 10 2 ADDING NONGRAPHIC OBJECTS The Object Palette presents the following nongraphic class and object buttons 123 Data Constant Data Signal pres String sal Constant String E Event 7 Number Constant Number E Sound EN Integer Constant Integer Na Random Number Holder Constant Array 2 Constant Set f z N Array 33 Data Store Por Point 25 Communication Multimedi xey lt Q hcl ultimedia Rapid DDE Client Wave Audio i i sm ho Videodisk Rapid DDE Server Dig Vi nas Dig Video DAT ess DLL F Animation Scanner e Commlink Audio CD Il Overlay E Simulation Manager Sequencer Other Database A R atabase Access e VCR pen Applink
219. ame Arrow Employee_namel Cross Address Ibeam Address Icon Status NoEntry R_D_department NortheastS outh Array_of_addresses1 NorthS outh Array NorthwestS outr Array1 Size pe Employee_name Employee_namef x alafo ml DIN aje aj 3 Sample Logic Palette containing arrays of structures The array itself does not have functions however its elements have all the functions available to other structure fields Example of logic In the following example a string is assigned to the first element in an array of structures User object Structure array String field struct R_D_department Array_of_addresses1 Array1 1 Employee_name David Union Top level structure being held Runtime Errors The following actions in the RapidPLUS application will produce runtime errors e Reading the field of a structure when another structure is active e Sending an inactive structure e Assigning a structure to another structure that contains different fields USING THE USER OBJECT MESSAGE LOGIC 22 21 Examples of Usage Message Sent from a User Object to an Application A typical usage of a user object message interface might be a keypad user object with a union named keyPress that contains one structure named KeyIn The structure includes an integer field called ScanCode The internal logic of the user object would assign an appropriate value to the ScanCode field each time a
220. an import data from TXT CSV and RDS files by clicking the Import button Optional To create the data store in a holder select the Holder check box When selected the Advanced and Import buttons are disabled and the records cannot be edited This option is useful in projects that contain user objects that share the same data For details about holders see p 19 12 For C code generation To set values that are applicable for C code generation click the Advanced button For details see p 10 31 The next two illustrations show a data store with six records and three fields Fields view This view shows all the fields of one particular record It is your initial view when you open the Data Store dialog box Used to display a record s fields Data Store Data_Store1 m Record Number Number of Records E Goto 6 E Update a Fields Contents for Record 2 Columns are resizeable Age foo A CE AE Three fields that were added one number field and two string fields To display a specific record s fields In the Record Number box click the up down arrow or type a number 2 Click the Goto button DATA OBJECTS 10 23 Records view This view shows all of the records and their fields in a table By default each record is identified by its record number A blank Name column is available for assigning names to the records If you want to assign names the data store must be in
221. an be changed draw background grid single pixels and palette see Working with Colors on p 12 15 to Changing a Pixel s Color on p 12 19 Control the display Several functions control when elements are updated on the display and how graphic elements are displayed see pp 12 31 to 12 36 Clear the display Three functions are available for clearing the display see p 12 20 Define logic for buffers Many of the functions that determine the appearance of a graphic display during runtime can also determine the appearance of buffers In addition there are functions that determine buffer performance For details about buffers see Working with Buffers on pp 12 44 to 12 51 and Saving and Restoring Status on p 12 36 to 12 42 GRAPHIC DISPLAYS 12 4 ADDING AND DEFINING A GRAPHIC DISPLAY The values that you set in the graphic display s dialog boxes determine the initial appearance of the graphic display while the display s graphic content is manipulated using the functions available in the Logic Editor See Defining the Logic starting on p 12 15 To add a graphic display to the layout 1 Select the Display Objects class 2 Select either the True Color Graphic Display button or the Graphic Display button then click on the layout frame The graphic display is added at its default size 64 cells SIIB ZE The default graphic display is a matrix of 64 x 32 whit
222. an eliminate flickering in situations when changes are being made on a relatively restricted area of the graphic display For example you may have a series of primitive graphic elements being drawn near each other on the graphic display Or you may have different user objects that draw on different buffers In these situations it would be good practice to put the graphic display in updateOnRequest mode and call the update function after the series of draw operations Please refer to the following illustration On the other hand if your incremental changes are widely distributed over the graphic display the efficiency of updateOnRequest is seriously undermined and updatelmmediately may give better results The reason is that each time you call the update function RapidPLUS redraws the area within the smallest possible rectangular bounding box that encloses all the changes made since the last update If the changes are in opposite corners of the graphic display for example the redraw area is almost the entire graphic display In this case it would be better to work in DEFINING THE LOGIC 12 33 immediate update mode whereby RapidPLUS only redraws the small area that has changed as the result of each draw operation The filled circles are drawn by 3 separate calls to drawFilledCircle The dashed rectangles represent the area redrawn when calling the update function Probably better to use immediate update mode Good candidate
223. ance depends on the stand alone view options selected in Step 3 USING A RAPID SIMULATOR OBJECT 18 7 The illustration below shows a sample embedded RapidPLUS simulation RPD running in a Word document Microsoft Word Sample doc P Eile Edt view Insert Format Tools Table Window Help JOSE 6a o E Normal Times New Roman 10 B TU ELE Be at el Sample of a RapidPLUS simulation RPD running in a Word document in Embedded view Set these options only if you selected Stand alone view Borders check box If you select this check box the Reviewer window has a border frame and can be manipulated using the Reviewer s Control menu For details about the Reviewer window see Chapter 21 The Reviewer in the Rapid User Manual Initial display state Select one of the display options If you select Normal the Reviewer window is displayed at its actual size HOSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS 18 8 4 If your Windows environment uses 256 colors select the Color Palette type Foreground palette When selected the RapidPLUS simulation s original palette is used If Foreground palette causes flickering problems switch to Background palette Background palette When selected the system palette is used If the host document is a Microsoft Office program use Background palette Viewing the RapidPLUS Simulation To view the RapidPLUS simulation
224. and UXO files By default the schema file is located in the main RapidPLUS folder The file name convention is Rapid_XX XSD where the XX represents the schema version number Copies of the schema file can be kept locally in the XML application folder or in any other folder on the network or at a remote URL If you are using an external XML editor that recongnizes schema it will only look for the schema in the XML application folder To have RapidPLUS save the schema file in the XML application folders 1 In the Application Manager choose Options Configuration Management Options 2 In the dialog box under the XML Output group select the Save Schema with XML Files check box IMPORTANT The schema is a read only file and should never be edited Changing the schema may cause fatal errors in RapidPLUS and render your application unusable RapidPLUS can open applications using old schemas as long as it can locate the schema file When you next save the RXD or UXO file RapidPLUS automatically updates the application to the latest schema Every XML file can contain one reference to a schema file in its header When opening an RXD or UXO file RapidPLUS first looks for the schema in the main Rapid folder If it does not find the schema it looks for it according to the reference If you move the application or check it into a RAPIDPLUS APPLICATIONS IN XML 2 14 version control system you should manually copy the schema f
225. and do not participate directly in the application logic ADDING MESSAGES TO A USER OBJECT 22 5 Structure A structure is a collection of fields It can either be a child of a union or a child of another structure nested structure It must contain at least one field There are two types of structures A definition only structure whose purpose is to be reused This structure type is described in the previous section A single instance structure cannot be reused During runtime you can assign a structure to a structure as long as both structures have the same number of fields and the same sequence of field data types Field A field is a child of a structure Each field has a specific data type either String Integer Number Array Structure definition only or single instance The usual runtime functions can be used on each data type that is string functions on string fields integer functions on integer fields and so on ADDING MESSAGES TO A USER OBJECT In the User Object More dialog box Messages page you can Add and delete unions in the user object message interface Add edit and delete definition only structures for re use as union structures or structure fields Add edit and delete single instance structures as union structures Import structure definitions from a file USER OBJECTS WITH MESSAGES 22 6 To view messages Open the User Object Properties dialog box Messages t
226. ange that exceeds the object s radius during runtime RapidPLUS will truncate the deviation range values automatically Deviation Property If a three segment pointer is selected in the logic palette a unique deviation property becomes available This number property together with the range value set in the Object Layout determines the middle segment s position in relation to the object s rotation axis calculated as follows deviation property value deviation in pixels _ Xx object radius in pixels range value For example assuming range values of 10 0 to 10 0 and a radius of 50 pixels these activities have the following results in the Prototyper trisegment_ptr deviation 5 trisegment_ptr deviation 2 f f X gt 5 10 50 of the object radius or 25 2 10 20 of the object radius or 10 pixels to the right of the axis of rotation pixels to the left of the axis of rotation DLL OBJECT 26 21 DLL OBJECT There have been two improvements to the DLL object in the Communication class e The Function text box has been replaced by a list box Instead of having to type the function you select it from the list DLL Object DLL_Objectl x Function List of available functions rapidConfigurationg aqsv Returned Ty _DebuggerHookData CloseSignOn Parameters CloseStartupDialog DpenSignOn 0 3 4 Use Separate Process When selected the DLL functio
227. annelld Return values channellId No error the value of the channel s ID RPD ER ALREADY OPEN The channel is already open RPD_ER_ FULL TABLE Twenty channels are already open Closing a Channel e Use the rpd_closeChannel function Syntax long rpd_closeChannel int channelId Parameter channelID The channel s ID Return values RPD_SUCCESS No error RPD ER ALREADY CLOSE The channel is already closed RPD_ER CHANNEL NOT_OPEN A channel was not opened 16 12 APPLINK OBJECT Sending Data To send data to the Applink object e Use the rpd_sendData function Syntax long rpd_sendData int channelld int type const char data int size Parameters channelID The channel s ID type Data type data Data to be sent size Length of the data in bytes NOTE The maximum size for sending data is 32 000 bytes Return values RPD_SUCCESS No error RPD_ER CHANNEL NOT_OPEN The channel is not open RPD_ER_DATA LARGI 2d The sent data is too large for buffer RPD_ER_FULL QUEUE The queue is full Getting Data There are two functions that get data from the shared memory file rpd_getData and rpd_checkForData rpd_getData actually gets the data rpd_checkForData checks if data is located in the shared memory file To get data from the shared memory file e Use the rpd_getData function Syntax long rpd_getData int channelId int type char data int size USING RPD_MEM DLL IN AN
228. appears in the Object Layout and Prototyper however these colors do not actually change the background color You will not see this effect in the object s dialog box because the grid color in the Preview window is black You can change the grid color during runtime via the gridColor property See Changing the Grid Color on p 12 18 Selecting a Background Color The color of the graphic display provides the background color for the graphic elements displayed on it The default background color is white Its palette index value varies according to the palette in a 256 color palette it is 256 in a 16 color palette it is 16 in true color it is FFFFFF NOTE You can change the background color at runtime by using the function setBackgroundColor However the new color will be visible only when a function that uses background color such as drawText or clear is activated and then only for the area referenced by the function GRAPHIC DISPLAYS 12 8 To set the background color for a true color graphic display 2 ES 1 With the True Color Graphic Display dialog box open click the Select E button the standard Windows Color dialog box opens 2 Either select one of the Basic colors or define a Custom color in the extended dialog box 3 Click OK The color s hexidecimal color code is added to the Background color box together with a preview of the color The hexidecimal code is determined by the color s RGB values To s
229. arch Path dialog box opens SEARCH PATH FOR OBJECTS 2 1 15 Rapid Search Path x Search path Cancel Brome Cano e Help Either type in the search path or click Browse to select the folder You can define several search paths using the semi colon as a separator for example c 1my_objects d l objects or just browse to another folder to add it to the search path The search path is not saved with the application To keep the defined search path beyond the current session use one of the Save Settings options The search path is then saved in the RapidPLUS INI file NOTES When the Reviewer loads an application it does not read the Rapidxx ini file However the Reviewer does look for a RAPID_AUX_PATH system environment variable in which you can set a RapidPLUS search path On Windows NT4 systems for example you set environment variables via the System icon in the Control Panel The RapidPLUS search path feature can be especially useful for group development of an application All group members would define the same search path to the folder where the shared resources are located Beware of user objects with the same file name Let s assume that your application contains a user object instance based on the file C RapidPLUS Objects Display udo Let s also assume that for some reason there is a DISPLAY UDO with a different interface and or functionality located in your application folder When y
230. arrays two dimensional arrays ASCII object 10 42 attributeSetNormal 12 33 Authorware adding a Rapid Simulator ActiveX object 18 4 viewing a RapidPLUS simulation 18 8 automatic interface logic reverification in projects 1 4 automatic interface update in projects 1 4 automotive ActiveX controls 17 22 10 32 bitmap objects performance considerations 13 3 supported file formats 13 2 13 4 using in a graphic display 12 25 bitmaps importing 27 11 Borders property 18 34 breaking aloop 7 10 breakpoints adding and removing 4 5 to 4 6 setting in user objects 1 2 bringInFrontOf 21 3 bringToFront 21 3 buffers graphic display active buffer defined 12 45 setting and getting 12 46 clipping rectangle 12 48 defining 12 12 drawing mode 12 46 examples of usage animation 12 50 moving map 12 49 windowing 12 51 intermediate buffer 12 12 12 45 schematic illustration 12 45 using 12 45 See also graphic displays Cc cA property 20 8 20 12 Call Stack 4 24 to 4 27 active stack frame 4 27 menu 4 5 cGLU property 20 8 20 12 checkForData 16 5 Chinese language support 27 2 clearAreaAtx y width height 12 20 clearDisplay 12 20 clearDisplayUsingColor 12 20 clearFromRow fromColumn toRow toColumn 26 8 closing Inspector windows 4 30 cM property 20 8 20 12 COM libraries for ActiveX bridge 17 25 commlink objects 26 17 compacting files 1 9 projects 1 9 comparing applications See Differencing Tool Component Dependency Tree report 25 17
231. as possible on a single sheet while maintaining the same aspect ratio and orientation The smaller the percentage value the smaller the image and the faster the printout For a complex layout image the time difference may be substantial 3 In the standard Microsoft Windows Print dialog box click Print Object Tree Report This report is an ASCII text file that presents the hierarchy of the application s objects A typical report as viewed in the Report Viewer looks like this lol File Edit Help eala RAPID APPLICATION CDPLAYER 01 29 03 12 50 50 PM Objects Tree Report CD_Group gt power_Pb Flat Pushbutton gt pause_Pb Flat Pushbutton gt stop_Pb Flat Pushbutton gt play_Pb Flat Pushbutton gt display Pb Flat Pushbutton gt display Group Group l gt play_Lamp Square Lamp gt pause Lamp Square Lamp l gt stop_Lamp Square Lamp l gt remainLap Display Text Display l l gt time_Group Group l l gt seconds Display Text Display gt minutes Display Text Display gt power_Lamp Round Lamp gt noDisk_Label Label OBJECT REPORTS 25 7 To generate an Object Tree report 1 In the Object Layout select the object for which you want to generate a report If you want a report about all of the application s objects be sure that no object is selected in the layout area 2 In the Application Manager choose Reports Objects Tree the
232. ata Stores and Arrays coo po Vee ee bee as ee ee es et 26 4 Reading Unicode SHINES sat ae ea a i a ee 26 4 Sorting Data Stores and Arrays sssaaa ee ee 26 4 Two Dimensional Arrays Extended Functionality o 26 8 Usage EX amples eco ea a e Ai ade des amp 26 13 Changes to Assign and loadFromFile Functions o ooo ooo ooo 26 17 ECommlink Objecto a a a A a dado a 26 17 Input Output by Byte cios ak ek ae ewe o ee 26 17 Fhree Segment Pointer rini e AA CAS ae Sa ae 26 19 DLE Object sis alee a ww ene he ce eae ae SB ew ole a eke pe E 26 21 PtishbuttoniODjects ie ga eden hei gt BALA EN BO OA GEG Coe Wey Ge BOE A ee 26 22 Text Display ODject iis AA eS os 26 22 CHAPTER 27 ADDITIONAL RAPIDPLUS ENHANCEMENTS 27 1 Multiple Tool Enhancements 2 2 0 0 02 ee ee eee 27 6 Back and Forward Buttons Retracing Mode Selections 27 6 Undo Red nes oOo Boo A OR a Cae A eens GE NA ene ee 27 6 Application Manager si sac hea ee a Nee A ea 27 8 Changing RapidPLUS Fonts 0 o ooo o e 27 8 Saving Current Settings 2 iii ae Re ia ee AR es es da 27 9 Object Layout a aiea ake E A SL OS ng Ste 8 27 9 Modification to the Rules for Naming Objects ooo o ooo oo 27 9 Selecting Objects froma List 0 0 0 0 0 00 00 0000 0000048 27 10 Importing Bitmap Files 0 00 ear a ee ee ea ee ee ee 27 11 User Object Properties Dialog Box 1 ee ee ee 27 11 Using Con
233. ated in a lower version of RapidPLUS reverify the application s logic compact it then save it If the application contains user objects be sure to use the Reverify Logic All Compact All and Save All commands USING THE APPLICATION PROPERTIES DIALOG BOX 1 11 USING THE APPLICATION PROPERTIES DIALOG BOX This dialog box stores information that applies to RapidPLUS applications To use the Application Properties dialog box 1 Choose File Properties The Application Properties dialog box opens for the file RPD or UDO shown in the Components List Box Application CD Player example Creator Support Department Company A Comments Use for general application information Rex 1 0140101 11 30 13 AM sigal Rev 2 02 04 01 14 19 49 sigal Rev 3 05 13 01 08 51 44 AM natil Rev 4 05 13 01 08 52 03 AM natil Rev 5 06 04 01 09 06 37 PM Shimon Enter your comments Rex 6 06 04 01 09 07 46 PM Shimon Revision 28 A Log Select to automatically add comment each time the application is loaded Character set English y Sets the application s compilation code generation language and the encoding of the XML output file File Name CDPLAYER RPD Created 02 04 03 10 25 55 AM Modified 02 16 03 04 38 29 PM Accessed 02 17 03 09 26 41 AM Cancel Help 2 Use the top three boxes to enter information about the application Initially they display the name of the RapidPLUS application file as
234. ates and its size Pasting Bitmaps into the Object Editor When a bitmap created with a 256 color or less palette is pasted and the display setting is either True or High color a message box opens in which you can choose to preserve the pasted bitmap s palette 28 1 Application Packager The Application Packager is a distribution utility for packaging a RapidPLUS application and its supporting files Types of applications that can be packaged are e RPD single applications or projects main application and its user objects e UDO user objects e RVR and RDO read only applications and user objects that were generated to run in the Rapid Reviewer Supporting file types that are packaged include RAR RDS BMP WAV DLL and fonts The Application Packager collects all the files used by the RapidPLUS application and creates a self installing package file an EXE file The Application Packager makes it easy for you to distribute a RapidPLUS application with all the elements that you want to provide You can include the Rapid Reviewer in the package file so that when the package is installed on any system the application will run in the Rapid Reviewer You can also designate a program folder and shortcut for the RapidPLUS application as well as a Readme file When the end user installs the package file the Application Packager creates the program folder on the end user s system for easy access to the RapidPLUS applicatio
235. ation The functions of the constant properties cA cM and cGLU are mapped to OpenGL constants using C macros NOTE The functions that take bitmaps as arguments see Implementing Raster Images on p 20 10 are not currently supported for code generation The integrator will have to implement some initializing code such as creating and initializing a window and implementing some platform dependent functions such as redraw Graphic Object Stack Order The stack order of graphic objects including active primitive objects determines which objects appear on top of or behind other graphic objects in the application The first graphic object placed on the layout is at the bottom of the stack and any subsequent overlapping graphic objects are superimposed on top ofit The round dial was the first object placed in the work area The round lamp object was the last object placed in the work area Three overlapping graphic objects NOTE Stack order applies to graphic objects only Nongraphic objects have no stack order You can change the stack order of graphic objects and object groups in the RapidPLUS application both in the Object Layout and dynamically during runtime 21 1 GRAPHIC OBJECT STACK ORDER 21 2 CHANGING STACK ORDER IN THE OBJECT LAYOUT To change stack order 1 Select the object s or object group s to move in the stack order 2 Choose Layout Order to display the stack order optio
236. ation Manager click the list arrow E Rapid MAINAPP Jof x File View Reports Code Options Help Deala wl eg Es gt Dll MAINAPP RAAAPPLICS Access hierarchical list as shown on the next page 02 14 15 PM SWITCHING AMONG PROJECT COMPONENTS 1 3 To switch among project components 1 Click the Project Components list arrow 2 Select the desired user object from the Project Components list as shown below ojs aja up ke eje gt Dlie MAINAPP R APPLICS INTERNALSCELI The main application ABDATA AMAPPLICSMNTERNALAC EABDATA AMAPPLICSMNTERNALN ANIMATOR B APPLICS SINTERNALSCE CALL_SRY R APPLICSINTERNALSCE CALLHMI AMAPPLICSMNTERNALACE EDIT_BOX AMAPPLICSMNTERNALACE User objects in alphabetical and hierarchical order Full paths to the user object files While debugging an application RapidPLUS automatically switches user object views when e Stepping into an exported function called by the parent application e Hitting a breakpoint set in the user object NOTE The Prototyper window is always dedicated to the parent application regardless of which user object is currently active or how it became so either automatically during debugging or by manual switching Switching components while the Prototyper is running Project components cannot be edited while the Prototyper is running Any editing of a component automatically stops the Prototyper
237. ave application folder Load DBAccess dbase file AE object DLL DLL Rapidxx folder A 2 MODULE FILE TYPE SEARCH PATH JavaBean JAR Application folder and subfolders object Rapidxx Objects folder Rapidxx Applics folder Rapidxx folder a RapidPLUS search path defined by the user Multimedia WAV FLC etc uae Recorder RCD Save Rapidxx folder Load Rapidxx folder application folder Report TRL TRN etc Save Rapidxx folder Load Rapidxx Reports folder RPX object RPX Application folder and subfolders Rapidxx Objects folder Rapidxx1Applics folder Rapidxx folder a RapidPLUS search path defined by the user State RST Save Rapidxx folder Load Rapidxx folder application folder User object UDO UXO RDO Application folder and subfolders RXO Rapidxx Objects folder Rapidxx Applics folder Rapidxx folder a RapidPLUS search path defined by the user Index Index 1 NOTE All file names as well as RapidPLUS conditions events functions and properties are italicized non RapidPLUS events functions methods and properties are not italicized A AcceptExternalActions property 18 34 acknowledged callback function 16 15 acknowledged event 16 4 active stack frame 4 27 ActiveX bridge utility 17 24 to 17 28 ActiveX controls adding to Object Layout 17 2 automotive 17 22 creating constant sets 17 6 data types supported 17 9 to 17 10 distributing with application 17
238. ave the graphic display status to a predefined buffer see Defining Buffers on p 12 12 and then restore the status The graphic display status comprises the following settings e Writing mode normal reversed XOR e Update mode onRequest or immediately e Draw color e Background color e Font e Pen position NOTE A runtime error occurs and the function is not performed if you call any of the save or restore functions when no buffers have been defined DEFINING THE LOGIC 12 37 saveStatus Stores the status in the first buffer buffer1 Each time you call this function you overwrite any status information previously stored in this buffer Example GDO1 saveStatus restoreStatus Restores the graphic display status according to the settings in buffer1 When created at design time a buffer is initialized with the default status settings of the graphic display itself If you call this function on a buffer to which no status has been saved these initial status settings are applied Example GDO1 restoreStatus saveStatusin Saves the graphic display status in the specified buffer overwriting any previously stored status information in that buffer A runtime error occurs if you specify a buffer that does not exist Example GDO1 saveStatusIn BUFFERS_set Warning restoreStatusFrom Restores the graphic display status according to the settings in the specified buffer A runtime error occurs if you s
239. aveRecorderFile Saves the recording to the recorder file specified in the argument Syntax SaveRecorderFile lt file name gt Parameters file name Name of the recorder file RCD Return Value None SaveState Saves the state to the state file specified in the argument Syntax SaveStateFile lt file name as string gt Parameters file name Name of the state file RST Return Value Name SendAcknowledge The host document acknowledges i e returns to the RapidPLUS simulation a rerouted event identified by its eventID Syntax SendAcknowledge ID Parameters ID ID of the user action Return Value None HOSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS 18 44 SendDeny The host document denies i e does not return to the RapidPLUS simulation a rerouted event Syntax SendDeny Return Value None SetApplicationProperty Sets the value of an exported property in the simulation Syntax SetApplicationProperty lt property name gt lt value gt Parameters propertyName Name of the exported property value New value for the exported property a string Return Value None SimulateUserAction Sends an external user action to the RapidPLUS simulation using information supplied in the argument The argument string must contain three words Syntax SimulateUserAction lt objectName gt lt property name gt lt value gt Parameters objectName Object s name as it appears in
240. bar Add edit and view notes tor the selected Scroll through the note mode or object in the notes area 4 loj It has a transition to stop mode triggered by one of two events whichever occurs first Edit e D RAPID72_ENTSAPPLICS CD_PLAYERS CDPLAYER RPD z E mode has no activitles t 1 The event of the Stop button stop Pb being pressed or Ei Notes for Mode run 08 56 02 AM F Mode Tree CDPLAYER _ of x E 0 xj File Edit Tree Logic Help File Edit Layout Group Objects Options Help Diele xal 13 12 en ole AA rl 218 365 Cdplayer a l_e j prelectricPlusd ut electricPlugln powerl ff powerOn aj E prnoDisk diskin operate Las gt PLAY Display na PAUSE play paused E m sor display premain lap To add notes to a mode 1 In the Mode Tree click the selected mode The status bar below the notes area shows the type of mode exclusive or concurrent 2 Type your notes in the notes area You can adjust the size of the notes area by resizing the Application Manager window When typing use the Enter key to adjust the text to the size of the notes area To add notes to an object 1 In the Object Layout click the selected object The status bar below the notes area shows the type of object flat pushbutton square corners filled frame etc 2 Proceed as in step 2 above NOTE In nongraphic objects you can a
241. be made accessible also to other project components through the use of holders Example Imagine a mobile phone project where several components use the same array of data One component manages calls another manages messages a third manages the phone book and a fourth provides statistics All four USING MESSAGES AS DATA CONTAINERS components use the same list of names and phone numbers If you use a RapidPLUS array for this list the array must be duplicated in each component that uses it If you use a data container instead you define the list once in the message interface of a user object then make it accessible to other components by defining a holder for the data container in each component that uses the list In the RapidPLUS simulation where issues of memory usage are negligible the choice of one approach over the other is a matter of preference However in applications designed for code generation economical memory usage becomes a prime consideration and a data container rather than multiple RapidPLUS arrays should be used General Procedure for Defining a Data Container 1 Define a user object with a message interface Define the exact data structure required For code generation this user object should be flagged as a data container in the Code Generation Preferences dialog box Components tab NOTE When a user object is flagged for code generation as a data container code is generated only for the data in it
242. bitmap_height and to avoid any confusion you change the names of the button size properties from width and height to button_width and button_height respectively As a result all the logic that uses the button size properties becomes invalid RapidPLUS automatically updates all the interfaces of the button user object and lists all the errors involving the width and height properties in the Logic 1 5 1 6 MANAGING PROJECTS Error View You can now use project wide Find amp Replace to substitute button_width for width and button_height for height Changing the Definition of an Exported Function You have an application with many instances of UDO1 UDO This user object has one exported function called dialNumber that receives an integer argument The function is defined as follows dialNumber lt Integer phoneNumber gt You now decide that the phone number should accept characters as well as digits You therefore change the exported property dialNumber in UDO1 UDO as follows dialNumber lt string phoneNumber gt The logic is still valid because the string argument accepts integers so the application is automatically corrected when it is next opened If the change in the function affects its type for example you changed the argument type from a string to an integer or you added an argument to the function the change is automatically applied the next time the application is opened and all the lines that have be
243. bjects The rules for naming objects and modes have been slightly modified For convenience all of the rules are presented here e Object names must begin with either a letter or an underscore _ e Illegal characters for an object name are amp lt gt and space All other characters are legal If RapidPLUS detects an illegal character it will replace each illegal character with an underscore Q ADDITIONAL RAPIDPLUS ENHANCEMENTS 27 10 e Object names are case sensitive so you can have one object called Switch and another called switch e Objects can have the same name as long as they have different parents e The following words are reserved that is you cannot use them as names of objects action and begin break clear continue end entry exit has internal is mode not or resetValue self subroutine x y If these words are capitalized they can be used Selecting Objects from a List The Select Object dialog box has been expanded to display each object its type and its membership in a group if applicable This list displays all objects graphic nongraphic and user as well as hidden objects To select objects from a list 1 Choose Edit Select from List to open the Select Object dialog box Click the column headers to sort the objects alphabetically Select Object Click the column header to sqrt the objects alphabetically Object name Object type Membe
244. box The Application Packager supplies the rest of the information You can however change the default values as necessary BUILDING AN APPLICATION PACKAGE 28 3 Step 1 Setting Up the Application Packager 1 Open the Application Packager by running the file Packager exe located in the Rapidxx1Packager folder 2 In the Application Packager dialog box select the options as necessary Application Packager version 1 0 m Rapid Reviewer IV Include Rapid Reviewer Files Browse C Rapid Program Folder Name Rapid m Application Shortcut IV Use Rapid Reviewer Default Icon Browse Shortcut Name Rapid Application m Readme Include Readme File Browse Shortcut Name Readme DEFAULT OPTION DESCRIPTION SETTING Include Rapid Adds the Rapid Reviewer s files Selected using Reviewer Files including rapidrt exe In order to the Rapidxx include the Rapid Reviewer its path path must be given Program Folder When the package is installed on Rapid Name the end user s system the specifed program folder will be created which will be i The program folder will contain two listed under i P or three shortcuts one to the Start Programs application one to uninstall the application and one to the Readme file if included 28 4 APPLICATION PACKAGER DEFAULT OPTION DESCRIPTION SETTING Application Shortcut When the package is installed a shor
245. by the field s values in descending order and according to the priority set by the integer argument Two setAscendingPriority lt integer gt Sets the sort order ascending dimensional forColumn lt integer gt and sort priority an integer array argument for the specified column setDescendingPriority lt integer gt Sets the sort order forColumn lt integer gt descending and sort priority an integer argument for the specified column Thus for example the following two activities would first cause all records of data store DS1 to be sorted by ascending order of Age field values it would then cause any records that have the same Age value to be sorted by descending order of Employee field values DS1 Age setAscendingPriority 1 DS1 Employee setDescendingPriority 2 NOTES You will get a runtime error if the priority assigned is less than O zero or if two fields or columns have been assigned the same priority During runtime RapidPLUS sets the priorities by their ascending order Thus assigning priorities of 2 7 and 9 would have the same effect as assigning priorities of 1 2 and 3 2 To actually carry out the sort according to the priorities and orders set in Step 1 choose the sort function for a data store object or the sortByColumns function for a two dimensional array DATA STORES AND ARRAYS 26 7 NOTE There is no meaning to the sort or sortByColumns functions w
246. can compare the logic of user functions To switch to User Functions view e Click the User Functions tab Project Modes Object ser Functions Jintertace The following illustration shows the Differencing Tool in User Functions view See the Comparison table on p 3 5 for an explanation of the comparison icons and colors C RAPID WIDGETS SCROLLBARSRAPIDAP CARAPIDIAPPLICSASCROLLBARARAPIDAPPADEMO RPD Revision 52 23 07 03 10 19 18 Revision 51 16712702 15 18 29 Project Modes Objects User Functions Interface DEMO drawNumbers Y drawBar k tof total itame latal itame Int MODE MODE DESTINATION DESTINATION TRIGGER ACTION Browse Differences oe Hatches First Previous Next Last je First D First Previous Next Last Differences found 2 Number of differences Detailed Information panes COMPARING APPLICATIONS IN THE DIFFERENCING TOOL 3 16 COMPARING INTERFACES In the Interface view you can compare exported properties events messages and functions To switch to Interface view e Click the Interface tab Project Modes Objects User Functiond Itefoce The following illustration shows the Differencing Tool in Interface view The detailed information panes display the exported properties events messages and functions but not the details about them See the Comparison table on p 3 5 for an explanatio
247. cation is saved to XML format a corresponding RPD file is saved in the cache which is located in the application folder in a subfolder named RP_CACHE_ NOTE After an application has been saved and opened as XML the Save operation maintains the XML format To return to using the RPD format you must use the Save As operation Saving Applications and User Objects to XML To save an application to XML 1 Choose File Save As 2 In the Save As dialog box select Rapid XML Application RXD in the Save as type box 3 Type in a file name change the path if necessary and then click Save The RXD file is written to the specified folder and the RPD file is written in the cache If the application has user objects an XML file is created for each user object UXO extension and all of the UXO files are saved in a folder tree reflecting the user object hierarchy in the project The UDO files are written in the cache Also a file containing the project s code generation preferences is saved in the application folder CSX extension NOTE If you do a Save as XML operation to a folder other than the application folder you are prompted to save the UXO files in the new folder with the RXD file or to save them in the original application folder OPENING APPLICATIONS IN XML FORMAT 2 3 To save a user object to XML 1 Open the user object in RapidPLUS independent of a parent application 2 Choose File Save As 3 In the
248. ces and matches COMPARISON ICON COLOR MEANING Green Item appears in both applications and tl they match dh Yellow Item exists in this application but not in the other application Gray and yellow Placeholder item does not exist in this application but exists in the other application Red Item was not compared COMPARING APPLICATIONS IN THE DIFFERENCING TOOL COMPARISON ICON COLOR MEANING Black and red Ttem appears in both applications but i there are differences e In Project view the components and or resources are different e In Modes view the mode types and or logic are different e In Objects view the properties and or parameters are different e In User Functions view a function is exported in one application and is not exported in the other application e In Interface view the interface elements are different Black and red Items are identical but either ti i there are differences in their children ii one of the items does not have children or iii they have a different number of children i Black and red There are differences in the items and their children USING THE DIFFERENCING TOOL 3 7 Navigating Among Differences and Matches After the applications are compared the options in the Browse menu and the eight Browse buttons at the bottom of the Differencing Tool window are enabled You can use these options and buttons to navigate among th
249. ch are used with LiveManuals simulations in Web browsers JavaBean objects can be programmed so that events performed with them can be recorded just like other RapidPLUS objects The required code changes are explained in this section via an example JavaBean object called CounterButton This JavaBean object is based on the CounterButton bean from the Sun Bean Development Kit It comprises a simple button that has a counter displayed in the center of the button Clicking the button increments the counter and generates an event called an action in Java In our example we created a new JavaBean object CounterButton Recordable referred to in this document as the Bean object which extends the functionality of CounterButton including changes to make its click event recordable NOTE The CounterButtonRecordable JavaBean object cannot be used in production it is only provided for instructional purposes Step 1 Implement RapidAccessible The Bean object s class must implement the RapidAccessible interface com esim accessibility interfaces RapidAccessible This interface is part of the LiveManuals Java classes and can also be found at lt Rapidxx folder gt java jb Wrapper We recommend that you place RapidAccessible class inside the Bean object s JAR file so that it will work in RapidPLUS and as a standalone JavaBean IMPLEMENTING RECORDABLE EVENTS FOR JAVABEAN OBJECTS 19 15 The RapidAccessible in
250. chart to Visio makes it available for editing with all the Visio tools However the Visio drawing cannot be imported back into RapidPLUS This chapter presents e Views of a state chart in RapidPLUS and Visio e How to export logic data to Visio e How to modify the appearance of modes in exported state charts EXPORTING STATE CHARTS TO VISIO 24 2 OVERVIEW A state chart that has been exported to Microsoft Visio Visio 5 or higher may display only modes and external transitions or it may include related logic lines as well NOTE Internal transitions are not exported to Visio The following illustrations present three views of the same state chart F State Chart CDPLAYER File Edit View Tools Help olsi 841714 VE QlQ eta x2 electricPlugQut electricPlugln r State chart in RapidPLUS OVERVIEW 24 3 CDPLAYER s electricPlugOut electricPlugin DM Legend Coplayer 14 Il State chart without logic in Visio oe logic Ej CDPLAYER vysd Cdplayer BEA ACA COTA ATT A TA AA CTA IA Entry display_Group hide Entry noDisk_Label hide Entry Pushbutton1 pushOut electricPlug_Sw left make amp amp power_Pbisin ntry power_Lamp on xit power_Lampoff amp power_Pbis out E schemes Cdplayer Activity logic State chart with logic in Visio EXPORTING STATE CHARTS TO VISIO 24 4 cai Ctrl Shift S EXPORTING A STATE
251. ck Elements on p 25 31 _entryActivities _modeActivities _exitActivities IDREF to a method block object containing the entry activities mode activities exit activities of the mode see RPMethodBlock described in the section Method Block Elements on p 25 31 XML REPORTS 25 31 Logic Related Elements This section presents various method elements and some of their nested tags Method Block Elements A method block element contains a collection of compiled method elements that hold the actual logic Method block elements are TAG DESCRIPTION RPMethodBlock Generic method block found in entry mode exit activities of a mode RPDefault Default transition The collection of compiled Transition methods contains the actions of the transition In addition its last compiled method tag is the trigger of the transition RPHistory History transition Transition RPDeepHistory Deep history transition Transition RPInternal Internal transition Transition RPCompiledMethod Nested Element This nested element holds the actual logic of the application It does not have an ID of its own and it always appears as a nested tag of the RPMethodBlock and RPSubroutineHolder elements Most of its nested tags are used internally in RapidPLUS Tags that you should understand are TAG DESCRIPTION _methodFixed source ID of the source object containing the logic ID source code of this compiled method
252. ck box is selected the query is run automatically when you start the Prototyper Through the logic however you can change the entire SQL statement or its component clauses by assigning values to the dbSQL dbFilter and or dbSort properties You would then run the modified query by calling the runQuery function To change the entire SQL statement e Assign a string to the dbSQL property Assigning a value to the dbSQL property automatically sets both the dbFilter and dbSort properties to empty strings To change the query s filter e Assign a string to the dbFilter property This assignment automatically changes the WHERE clause in the dbSQL property To change the query s sort order e Assign a string to the dbSort property This assignment automatically changes the ORDER BY clause in the dbSQL property Setting Parameterized Values In the Advanced tab you build the SQL statement s WHERE clause by defining a condition operator and value for the selected field one field at a time This procedure is described in detail on p 15 7 If you enter a question mark as the value it becomes a parameterized value allowing you to set the value dynamically during runtime Before running the query you provide the value by calling the field s setParameter DATABASE ACCESS OBJECT 15 14 function You must call the setParameter function for each parameterized value in the WHERE clause in the order that they appear
253. ck the line The Logic Editor opens with the corresponding logic statement selected To find text in the Logger pane 1 Choose Edit Find or click Find A dialog box opens 2 Enter the text string and click OK The search starts at the currently selected line If the text string is not found when the end of the log is reached you are asked to confirm continuing the search from the beginning LOG USAGE EXAMPLES 4 23 3 Choose Edit Find next to find the following instance of the string LOG USAGE EXAMPLES The following examples illustrate situations in which the Logger can be very efficient in pinpointing the source of application problems Tracing a Bug in the Application Logic Flow Sometimes the precise execution flow of the logic is not obvious during application development which leads to unexpected results during runtime For example you may have an application in which there is a transition from ModeA to ModeB based on the trigger Pushbutton1 in amp Integer1 0 In addition Mode A has a mode activity Display1 contents 100 Integer1 During runtime a division by zero runtime error occurs at the transition from ModeA to ModeB This is puzzling since it seems that the transition to ModeB should take place as soon as Integer1 reaches zero leaving the mode before the mode activity is executed You could use the Logger to quickly analyze the problem In the Filters tabbed page of the Debug and Logging
254. ck to trigger the following actions GDO1 buffer setClipRectPosX 0 posY frame_int FRAME_HEIGHT forBuffer 1 frame_int changeBy 1 The same approach could be used to create an array of bitmaps to implement animation NOTE Although the above example illustrates the use of buffers in the graphic display there are more efficient ways to achieve animation effects See the Animator widget located in RapidPLUS s Widgets folder Windowing If an application uses a number of windows you can achieve a windowing effect by creating a buffer of an appropriate size for each window and setting the buffer s location on the graphic display at the appropriate position You can then draw bitmaps text or other graphic elements on each window in the background making the appropriate window buffer active as required by the application logic 13 1 Bitmap Image and Font Objects Bitmaps and images can be used to enhance the visual appeal of your simulations and make them more realistic In simulations that include graphic displays bitmaps and images together with text strings and font objects play an essential part they constitute the content to be presented on the graphic display While bitmaps can be used in simulations that do not include a graphic display the font object is relevant only where a graphic display is present Without a font object text strings cannot be displayed on the graphic display This chapter prese
255. come invalid as a result of the change are listed in the Logic Error View window Adding Arguments to a Function In your application you use the user object LAMPS UDO This user object has a function called setShape lt Integer gt which receives an integer argument You decide to change the function so that it will receive an additional argument for the color of the lamps Now the function is defined as setShape lt Integer gt color lt Integer gt As a result all calls to this function throughout the project become invalid When you open the main application all the interfaces of LAMPS UDO to its parent applications are automatically updated All logic errors resulting from the modifications in the function throughout the project appear in the Logic Error View window You still have to correct each logic line manually but all the errors from the entire project are grouped together EDITING PROJECT COMPONENTS 1 7 EDITING PROJECT COMPONENTS You can edit any component from the Project Components list To edit a project component 1 Click the Project Components list to open it 2 Select a component from the list All of the open RapidPLUS tools display the selected component When editing affects a component s interface to its parent application RapidPLUS will automatically update the interface as described in Opening a Project on p 1 4 The update process is launched in the following cases e When you select a
256. cribe and analyze a project s states It is commonly used for testing embedded systems RapidPLUS also uses the state matrix as a tool for analyzing transitions between modes Using the State Matrix command you can export logic data to Microsoft Excel 9 0 or higher and view the state matrix in Excel s workbook format XLS In Excel the RapidPLUS state matrix presents the mode tree as it appears in RapidPLUS that is the mode hierarchy is maintained Just like in RapidPLUS child modes are indented under their parents exclusive modes appear in black concurrent modes appear in blue Also when the RapidPLUS state matrix is first created in Excel it is automatically saved as an XLS file You can revise the file as necessary and save it for later use A RapidPLUS application s state matrix enables you to systematically check the application s modes triggers and transitions This chapter presents e An overview of the RapidPLUS state matrix e How to export logic data to Excel STATE MATRIX 23 2 OVERVIEW An exported state matrix looks like El Microsoft Excel APPLIC xIs File Edit View Insert Format Tools Data Window Help CEA eee fe ly E gt anal 10 B z u f JApplic Mode_1 x Mode_2_1 Mode_2 2 Mode_3 Mode_2 Mode 21 x Mode_2 2 Mode_1 Mode _2 2 Mode 2 1 Mode_1 Mode_3 In the illustration above the root mode was selected in RapidPLUS The following table describe
257. ct So that the substrings can then be displayed in the displayString and displayMessage modes each substring is written to an element of a one dimensional string array Thus for example upon entry to the parseString mode the appropriate font object function is called in order to set the numOfLines_int counter to the number of substrings in display_str entry Get the number of lines in the display string entry numOfLines_int arial_font countSubStrOf display_str toFitwidth DISP_WIDTH left ligned YES wordwW rap YES entry nitialize the array index entry arraylndex_int 1 GRAPHIC DISPLAYS 12 42 Then on an internal transition as long as the counter numOfLines_int is not zero the actions shown below are performed to write the substrings to the array JMiwrite one substring to the string array element parsedDisplayLines_arr arraylndex_int arial_font subStrOf display_str index arraylndex_int toFitwidth DISP_WIDTH left ligned YES wordw rap YES Increase the array element index by one arraylndex_int changeBy 1 Decrease the number of lines counter by one numOfLines_int changeBy 1 When numOfLines_int reaches 0 that is there are no more substrings to be written to the array the transition is made to the mode where the substrings are displayed Saving and Restoring a Graphic Display Area The ability to save and restore areas of the graphic display to a buffer that is temporary
258. ctions To open the User Object Properties dialog box 1 Choose Edit User Object Properties or double click anywhere in the Object Layout work area but not on an object ADDITIONAL RAPIDPLUS ENHANCEMENTS 27 12 2 Click the More button in the root object s parameter pane The following dialog box opens at the Properties tab Opens the Events page for adding and editing events Refer to pp 19 9 to 19 10 in the Rapid User Manual User Object Properties MyObject Opens the Functions page for viewing deleting or tagging user functions as exported See the illustration below Properties Events Messages Functions e Accept Add Property String Integer Number Point Constant Set Opens the Messages page for adding and editing messages See Chapter 22 User Objects with Messages for details The Properties page is for adding and editing properties in the user object interface Refer to pp 19 7 to 19 8 in the Rapid User Manual Copy Paste Opens a dialog box for defining the object s class button and or customized Help file Registration Help Close OBJECT LAYOUT Constant Set 27 13 To work with user functions e Click the Functions tab The following page is displayed Properties Events Messages Functions displayString lt String1 gt on lt Display1 assign sInteger lt Strin
259. cts Member Member Member object 1 object 2 object n So a Graphic Object with Children G N Child Child Child object 1 Jl object 2 object n ye AA ELEMENTS YOU CAN CUT COPY AND PASTE 6 3 User Object Interface Elements User object interface elements properties events unions and top level structures can be copied in the User Object Properties dialog box of the source application and pasted in the User Object Properties dialog box of the target application They are also copied indirectly when copying a logic line that references an interface element Logic Action Activity Function Line The most basic logic element that can be pasted into a target application is a single action or activity including an activity line in a user function The chart below illustrates the element s pasted into the target application Action Activity Function line Related Objects Logic or Related Interface Elements Example Copying and pasting the activity Display1 contents Integer2 Integer3 also pastes the display object and the two integer objects referenced by the logic 6 4 PASTING OPERATIONS User Function User functions can be copied and pasted directly via the User Object Properties dialog box or indirectly by copying and pasting a logic line that calls a user function In either case the entire user function is pasted as follows User
260. cts of your applications and projects All of the reports can be printed either directly from RapidPLUS or via the read only Report Viewer Many of the reports can be customized to present the specific amount of information you want to see Additionally reports containing XML code can be generated for an application and its user objects This chapter presents e An overview of the reports e How to work with reports in the Report Viewer e Reports about objects e Reports about modes e Report about user object interface e Reports about project components e Coverage test reports e XML reports and their API NOTE This chapter replaces Chapter 24 Generating Reports of the Rapid User Manual GENERATING REPORTS 25 2 OVERVIEW OF THE RAPIDPLUS REPORTS There are five main types of reportare They are accessed from the Reports menu in the Application Managers TYPE REPORT NAME DESCRIPTION Objects Object Layout Presents a snapshot of the application in the Object Layout Object Tree Presents the hierarchy of the application s objects Object Data Summarizes object information such as parent type parameters and properties Prototyper Layout Presents a snapshot of the application in the Prototyper Modes State Chart Plot Presents a snapshot of the application in the State Chart Mode Tree Presents a hierarchy of the application s modes Mode Data Summarizes mode informa
261. d For example the lower limit is set at 3 0 the upper limit is set at 15 0 and the value of the number object is currently 15 0 If the activity changeBy 1 2 produces the value 16 2 the actual value of the number object will be 4 2 Not selected The number object is accurate to six decimal places The maximum value of a number object is 1 0e37 The number dialog box also opens when you define a number property for an active primitive object or for a user property of a user object NONGRAPHIC OBJECTS 10 10 Integer 123 Integer The integer object is a variable that holds an integer The Integer dialog box opens when you add or edit a number object Integer Integer1 x Initial Value fi Cancel A Bounded Bound Lower Upper hoo op A Wrap Around Advanced Hexadecimal Value Ox1 A sample Integer dialog box OPTION Intial Value DESCRIPTION Intial value in the Prototyper Opens a dialog box for setting a data type for the object This value is applicable for C code generation For details see p 10 30 DEFAULT 0 0 Bounded integer When selected sets bounds to prevent RapidPLUS from assigning integers less than the lower bound or greater than the upper bound For example if the upper bound is set at 15 and the application logic assigns a value of 16 the actual value of the object will be 15 Not selected Wrap Around When s
262. d value in the specified column searching from the first specified row up to and including the last specified row Otherwise returns 0 index_int Array1 searchFor dialStr inColumn Const_Set NUMBER fromRow 1 toRow 6 26 12 OBJECT ENHANCEMENTS FUNCTION searchFor lt value gt inColumn lt integer gt fromRow lt integer gt DESCRIPTION Returns the row index if a match is found for the specified value in the specified column searching from the specified row to the last row Otherwise returns 0 EXAMPLE index_int Array1 searchFor dialStr inColumn Const_Set NUMBER fromRow 3 searchFor lt value gt inColumn lt integer gt toRow lt integer gt Returns the row index if a match is found for the specified value in the specified column searching from the first row up to and including the specified row Otherwise returns 0 index_int Array1 searchFor dialStr inColumn Const_Set NUMBER toRow 8 searchNext Continues the previous column index_int Array1 search operation in a forwards searchNext direction searchNext Continues the previous column index_int Array1 Backward search operation in a backwards searchNextBackward direction For more information please see the explanation for one dimensional arrays on p 26 2 setNumber Sets the number of columnstothe Array1 OfColumns lt integer gt specified value If the new size is larger than th
263. date 12 31 15 11 updateAll 12 31 updatelmmediately 12 31 to 12 32 updateOnRequest 12 31 updatePalette 12 9 12 19 to 12 20 updating changed user objects 1 18 updating interfaces See projects updating interfaces updating RapidPLUS ActiveX control 17 27 upgrading applications 1 10 user functions limit on number of objects 27 19 returning values 27 20 to 27 23 viewing values of arguments during runtime 27 23 User Object Interface report 25 15 to 25 16 user object messages adding a definition only structure field 22 11 adding fields 22 9 to 22 11 adding structures or unions 22 7 data containers 22 22 to 22 23 deleting fields structures or unions 22 13 editing fields structures or unions 22 12 example of usage 22 14 glossary 22 4 to 22 5 Index 13 importing structures 22 24 in the Logic Palette 22 15 memory allocation 22 13 overview 22 2 to 22 3 properties and functions 22 17 to 22 19 receiving from an application 22 21 renaming fields 22 12 reordering unions structures and fields 22 13 runtime errors 22 20 sending to an application 22 21 translating arrays pointers and warnings in message structures 22 28 to 22 30 user object properties constant sets 27 13 user objects creating exported properties 27 11 in projects 1 7 locating 1 16 renaming 1 8 replacing 1 7 search path 1 14 setting breakpoints 1 2 switching views 1 3 user functions 27 13 warning re UDO files with same name 1 15 UserActionFired event 18 28 18 30 18
264. de up of DATA OBJECTS 10 15 integers rather than to specific objects It can also generate copies of existing objects and delete generated objects in runtime Creating an Array When you add an array the following dialog box opens o DEN 7 Object z Cancel Value fo Dimensions E E Holder Data integer 5 Type Integer m Number of Elements 10 2 Edit Elements Advanced Import Hexadecimal Value 0x0 Help OPTION Dimensions DESCRIPTION Number of dimensions Range 1 7 Holder check box When selected creates the array in a holder This option is available for integer number and string arrays This option is useful in projects that contain user objects that share the same data When the Holder check box is selected the Edit Elements Advanced and Import buttons are disabled For details about holders see p 10 12 Data Type Integer number string or object Default Object When an object data type is selected you must select an application object or user object Clicking the arrow displays all of the applications and user objects in the application This object is the default value for all of the array s elements NONGRAPHIC OBJECTS 10 16 OPTION Default Value DESCRIPTION When an integer number or string data type is selected you can select a value for all of the array s elements If no value is sel
265. dentify the referenced mode VERIFICATION TEST 9 4 e Check Edit Opens the Logic Editor and selects in the Mode Tree and Ctrl E the State Chart the mode where the error was detected Alternatively double click the warning in the window to open the Logic Editor Use this option when you want to investigate the warning in more detail WARNING MESSAGES This section describes the warning messages that can appear in the Verification Test window The warnings are grouped according to their categories mode transition and object warnings The following state chart is used to explain some of the mode warnings Modes shown are exclusive NOTE Generated warnings are not necessarily indications of error RapidPLUS cannot always distinguish between an actual problem and an intentional feature of the application design LoadDefs E CiMemory WARNING MESSAGES 9 5 Modes UNREACHABLE MODES Looks at the application s modes and transition destinations and finds modes which cannot be reached Listed modes are not referenced by an indirect or direct transition destination NOTE This check does not test triggers Syntax lt mode gt lt mode gt Example WarmBoot LoadDefs ClrMemory MODES THAT CAN NOT BE EXITED Tests the modes and transition destinations in order to find any mode which once entered cannot be exited A mode is regarded as exitable if there is a transition from it
266. dialog box and divided into four tabbed pages It is used for creating exported properties events messages and functions Constant set Constant sets can be defined as p 27 13 properties user object properties Also when a constant set is duplicated it can be duplicated as a user object property Zoom capability Use the Zoom In button for a close up view of graphic objects and then zoom out again ADDITIONAL RAPIDPLUS ENHANCEMENTS 27 4 New in version 8 0 New in version 8 0 New in version 8 0 Logic Editor FEATURE Empty property for each object ENHANCEMENT REFERENCE Each object s functions conditions and events are located under an empty property that is designated by an ellipsis In previous versions the object property was named self Viewing columns You can zoom in and out of the four columns in the Logic Editor by double clicking the columns In previous versions there were toolbar buttons that controlled zooming Color coding You can use colors to define logic p 27 16 Local variables You can declare local variables p 27 16 Mode activities There are minor changes to how p 27 18 mode activities are implemented in the RapidPLUS state machine User functions Object Editor FEATURE Cursor Coordinates status box User functions can contain up to p 27 19 255 different object and or objects properties User functions can ret
267. display This transparent effect is illustrated below on a two color graphic display where the draw color is black and the display background color is white Note that the text s background pixels are drawn in black because the text s background color and the display background color are the same see the table above F If the XOR operation is repeated a second time on the same pixels the display returns to its original colors Repeated drawing operations in XOR mode alternate between the two sets of colors XOR mode can be used for moving an image over a display without deleting the original display 12 36 GRAPHIC DISPLAYS Example Assume that you want to move a text string across a display without disturbing graphic elements that already appear You could accomplish this effect with the following logic ENTRY ACTIVITIES INTERNAL ACTIONS on timer tick LCD1 attributeSetXOR LCD1 drawText Searching gt atx x_int y 5 it 1st time the action LCD1 drawText Searching cancels the activity v atx x_int y 5 Each time the first where x_int 0 x_int changeBy 1 action cancels the previous action l l P LCD1 drawText Searching Timer1 startRepeat T E a atx x_int y 5 Saving and Restoring Status The save and restore functions allow you to s
268. e Syntax RecorderPlayCase lt case number gt Parameters case number Number of the use test case the number that appears in the case header Return Value None RecorderRecord Instructs the Recorder to begin recording Syntax RecorderRecord Parameters None Return Value None PROPERTIES METHODS AND EVENTS 18 41 RecorderRewind Instructs the Recorder to rewind to the start Syntax RecorderRewind Parameters None Return Values None RecorderStep Instructs the Recorder to step i e play one event at a time Syntax RecorderStep Parameters None Return Value None RecorderStop Instructs the Recorder to stop any playing or recording operation Syntax RecorderStop Parameters None Return Value None HOSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS 18 42 RequestDataFromDDEObject Returns a data string from the RapidPLUS DDE object that is represented by Application Topic_Item string arguments Syntax RequestDataFromDDEObject lt application name gt lt topic name gt lt item name gt Parameters Application As defined for the DDE object in the topic item application Return Values Value of the DDE object as a string ResetState Resets the state Syntax Reset Parameters None Return Value None Resume Resumes un pauses the paused simulation Syntax Resume Parameters None Return Value None PROPERTIES METHODS AND EVENTS 18 43 S
269. e The 32 5 bpp 64 6 bpp 128 7 bpp and 256 8 bpp color palettes use RGB Red Green Blue values to determine their respective default colors To modify the graphic display s default color palette 1 In the Graphic Display dialog box click the Colors button The Graphic Display Colors dialog box shown below for a 32 color palette displays the default color settings for the selected palette size Graphic Display Colors f xi Edit Colors JM Sie o0 BU BO BU DO Mm ao Bo O0 i mimm L E Index of the selected color Palette index 1 Color R 0 G 0 B 0 RGB value of the selected color 2 Select the palette color you want to change and click Modify The standard Windows Color dialog box opens 3 Either select one of the Basic colors or define a Custom color in the extended dialog box NOTE You can change the palette colors at runtime by using the functions setPaletteIndex toRed green blue updatePalette and 12 10 GRAPHIC DISPLAYS resetPalette See Changing Palette Colors During Runtime on p 12 19 for details Color by number Each color displayed in the Graphic Display Colors dialog box has a palette index that is used by RapidPLUS to reference the color The colors are numbered from left to right top to bottom starting with 1 When you select a color its index and RGB value are shown at the bottom of the dialog box In the object s logic
270. e 1 Deny 2 Hold 0 gt Example Private Sub RapidSiml_UserActionFired ByVal objectName As String ByVal propertyName As String ByVal eventName As String ByVal time As Single ByVal id As Long response As Long The user did something If objectName Switch1 Then response 1 Acknowledge REROUTING USER ACTIONS 18 31 Else User did something other then changing switchi actionLbl Caption Wrong action you should turn the switch on response 2 Deny End If End Sub Using the SendAcknowledge and SendDeny Methods Some host applications do not let the user change the Response field In these applications use the SendAcknowledge and SendDeny methods Example Private Sub RapidSiml_UserActionFired ByVal objectName As String ByVal propertyName As String ByVal eventName As String ByVal time As Single ByVal id As Long response As Long If objectName Switch1 Then RapidSiml SendAcknowledge Id Acknowledge action identified by Id Else User did something other then changing switchi actionLbl Caption Wrong action you should turn the switch on RapidSiml SendDeny Deny last action End If End Sub HOSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS 18 32 Controlling the Rapid Recorder The simulation s Recorder can be displayed and manipulated within the host document during runtime For details about using the Recorder refer to Chapter 20 The Proptotyper in the Rapid User Manua
271. e differences and matches NOTE The differences and matches displayed depend on the items selected in the Filters dialog box see p 3 8 for details about setting the filters The four browse buttons are BROWSE BUTTON DESCRIPTION First Selects the first difference match Previous Selects the previous difference match Next Selects the next difference match Last Selects the last difference match Synchronizing the Selection You can synchronize the two panes so that when you select an item in one pane the corresponding item in the other pane is also selected If item selection is not synchronized when you select an item in one pane the corresponding item in the other pane is not selected To synchronize item selection e Choose Edit Synchronize Selection You can also right click in one of the panes to open the popup menu and choose Synchronize Selection COMPARING APPLICATIONS IN THE DIFFERENCING TOOL 3 8 Selecting Comparison Filters You can control the logic and objects that are compared by using the Filters dialog box The Differencing Tool always compares components and resources To select the filters 1 Choose Filters Open Filters Dialog or click the Open Filters button in the toolbar The Filters dialog box opens NE A LA A A A i A N A 2 Select the items you want the Differencing Tool to compare then click OK USING THE DIFFERENCING TOOL Open App Go To
272. e RapidPLUS application you will need to update the ActiveX control You can either generate a new one or if you are already using the control in a container application then you will want to overwrite the previous one To update the ActiveX control in a container application 1 Use the RapidPLUS bridge utility AppActiveXGen exe with the c and p options Be sure to use the same CLSID and ProgID as the previous version of the control see the previous section for information about these parameters Steps 2 5 apply to Microsoft Office container applications only 2 When you insert an ActiveX control into a Microsoft Office application the application automatically creates extender EXD files The EXD files cache the control information so that it takes less time to insert the control again After you update the ActiveX control you need to delete the EXD files and reinsert the control First exit all Microsoft Office applications 17 28 USING ACTIVEX CONTROLS Locate the Windows Temp folder by default C Windows Temp The folder should contain one or more subfolders for corresponding applications By default these folders are e Excel8 0 e Word8 0 e Ppt10 0 e Vbe Delete the control extender files RAPIDBRIDGEUTILELib exd and RAPIDBRIDGELib exd from the appropriate folders Open the application remove and reinsert the control New and updated EXD files will be created automatically 18 1 Hosting RapidP
273. e The logic used to display text images lines and shapes on a graphic display e The logic used to manipulate graphic displays during runtime e A Function Reference table GRAPHIC DISPLAYS 12 2 THE BASICS OF USING GRAPHIC DISPLAYS Graphic displays simulate display screens They can display text images and or shapes depending on the logic and supporting objects used Below is a brief description of how you define a graphic display to display text images and shapes Graphic displays and true color graphic displays are basically the same except that graphic displays support from 2 to 256 colors and true color graphic displays support 24 bit color Throughout this chapter instructions apply to both types of graphic displays Where additional differences exist they are mentioned The following table presents a summary of the steps involved in working with graphic displays The steps to be performed depend on what you want the object to display Page references lead you to detailed instructions STEP DESCRIPTION Add a graphic display 1 In the Object Layout add the graphic display and define its appearance to the work area see p 12 4 2 Define display size cell size cell color and grid size see p 12 6 to 12 7 3 Optional Define buffers for the display A buffer is a temporary storage area that can be used to hold and display graphic elements see p 12 12 Define the graphic display s If the graph
274. e cells Each cell measures 2 x 2 pixels and the lines grid separating the columns and rows are black and one pixel wide NOTE A project can contain multiple graphic displays although each component in a project should not contain more than one The Graphic Display Parameters Use the Graphic Display or True Color Graphic Display dialog boxes to define e The size of the object as a matrix of cells e The size of each cell in pixels e The width of the grid e The background color i e the color for the cells e The number of buffers and their sizes ADDING AND DEFINING A GRAPHIC DISPLAY Size of each display cell in pixels Size of the grid Space fi Screen prls in pixels 12 5 The dialog boxes for the graphic displays are shown below Each illustration points out the fields that are specific to the dialog box and some of the fields that they have in common Graphic Display dialog box Size of the graphic display in display cells Graphic display preview Graphic Display r Resolution Width Height j Display Display pxls _ Cancel m Pixel size Width Height Display pixel Screen pxls Redraw Opens a dialog box to modify Space Screen pxls r External palette Colors the selected color palette Read Advanced Number of buffers a a Peza k Write Opens a dialog Background color Help box to specify buffer
275. e drawn on top of each other To determine the reverse draw and background colors the graphic display i Identifies the current color settings ii Determines the opposite color based on the settings of the display device iii For graphic displays uses the closest color present on the object s color palette For true color graphic displays uses the new RGB values Example Appearance of String 1 when the draw color is black but the display is in reverse display mode The background color is also reversed DEFINING THE LOGIC 12 35 attributeSetXOR Use the attributeSetXOR function to perform a logical XOR exclusive or operation for each pixel This operation allows you to combine elements on the display and then return the display to its initial state When the graphic display is in XOR writing mode RapidPLUS performs a logical XOR operation for each graphic element pixel to be drawn on the display as follows If the current display pixel Current PP Then the overlay pixel is drawn in displa and overlay pixel are pixel Drawn First color in the palette by default pixel The same color black A new color which is the logical XOR of the two colors Different colors For graphic displays if this new color is not available in the palette then the closest equivalent color to it If the overlay pixel is black then it becomes transparent when drawn on the graphic
276. e first 256 characters is represented by two bytes which are one unit and cannot be separated The first byte is called the lead byte and the second byte is the character s index within the lead byte range Generating a Font Object By default font objects are generated during code generation To exclude a font object from code generation Select the Simulation Only option Changing a Font Object s Character Range To change a font object s character range NOTE The dialog box is the same for single and double byte fonts In single byte fonts there is only one range and the lead byte of 0x00 is a placeholder Clear the Use Entire Font check box the character range line is available Click the From and or To cells and edit their content 13 14 BITMAP IMAGE AND FONT OBJECTS To add a character range 1 Clear the Use Entire Font check box 2 Click the Insert range button a new character range is added to the list The new range duplicates the range that is selected when you click the Insert range button and is added to the list immediately under the selected line 3 Change the From and or To values in the added range To delete a character range 1 Clear the Use Entire Font check box 2 Select the character range you want to delete then click the Delete range button Multiple selection is available NOTE You must keep at least one range for each lead byte If you select all the ranges of a lead byte
277. e in the file When developers make changes in different sections of the application or component file there are no resulting conflicts In this case most version control systems allow an automatic merge For example if two developers added different objects to the same application the files can be merged without conflict There are cases however where developers make changes in the same element of an application or component resulting in a conflict during merge Following are examples of changes that result in merge conflicts e Both developers made changes to the same line of logic e One developer changed an object s properties and the other developer deleted the object e Two developers adding elements to the same array In each case of conflict someone must manually indicate which version to keep in the merged edition TIP Every time you save and reopen an application or component RapidPLUS increases the version number adding a line of code to the resulting XML file This change causes a conflict when merging application or component versions You can turn off the automatic version number feature in the File Properties dialog box Clear the Log check box Keep in mind that clearing the Log check box will disable project comparisons in the Differencing Tool but modes objects user functions and interface can still be compared For more information see Comparing Projects on p 3 11 RapidPLUS Applicatio
278. e information You can print or save the report as explained in Working with Reports in the Report Viewer on p 25 3 PROJECT COMPONENT REPORTS 25 17 PROJECT COMPONENT REPORTS RapidPLUS can generated four types of reports about a project s components the RPD file and each of its UDO files e Component Dependency Tree report e Component List report e Detailed Component List report e Target Graphic Displays report Instructions for creating these reports are presented below You can print or save the reports as explained in Working with Reports in the Report Viewer on p 25 3 Component Dependency Tree Report This report is an ASCII text file that presents the hierarchy of the project s components A typical report as viewed in the Report Viewer looks like this A User Object Dependency Tree report for MAINAPP pan 01 xj File Edit Help ARE RAPID User Object Dependency Tree report I User iT User D User A User N User mainapp APPLICATION object object object object object gt emb_audio 1 gt emb_battery I gt emb_camera 1 gt emb_net 1 gt emb_audio 1 is is is is is gt emb_rtc iD gt wdg_edit_box generated as generated as generated as generated as MAINAPP 02 10 03 05 06 34 PM interface only an empty task a data container a standalone application not generated gt srw_photoalbu
279. e listed for details about the search path see Search Path for Objects on p 1 14 NOTE Embedded bitmaps are not listed with the resources Lower section of the Differencing Tool window in Project view Properties Y Rev 114 21 05 03 09 57 43 PM NIR_4 Rev 11521 07703 09 17 53 renee wf Y Rev 114 21 05 03 09 57 43 PM NIR Rev 115 21 07 03 09 17 53 renee MODE When you select a component the detailed information panes list its revision information COMPARING MODES MODE In the Modes view you can see the comparison of destinations triggers actions activities notes and mode type i e exclusive or concurrent and default mode status To switch to Modes view e Click the Modes tab Project Modes obiects User Functions Interface COMPARING MODES Click the tabs to _ view the selected mode s destinations triggers actions and or notes 3 13 By default modes activities actions destinations triggers and mode type are compared To change the default setting use the Filters dialog box see p 3 8 for details about setting the filters The following illustrations show the Differencing Tool window in Modes view See the Comparison table on p 3 5 for an explanation of the comparison icons and colors Upper section of the Differencing Tool window in Modes view C RAPIDSAPPLICS XPRESS MAIN RPD C RAPID 72 APPLICS XPRESS MAIN RPD Revisi
280. e p 3 14 e User functions view see p 3 15 e Interface view see p 3 16 4 You can change the items compared using the Filters dialog box see p 3 8 for details 3 4 COMPARING APPLICATIONS IN THE DIFFERENCING TOOL al s Left Right 5 You can select an item then go to it in the currently open application see p 3 9 for details 6 You can copy items from the applications in the Differencing tool to the currently open application see p 3 10 for details 7 You can generate reports about the applications and application components see p 3 10 for details Selecting Applications The procedure for selecting applications for the left and right panes is identical To select an application 1 Choose File Select Left Application or Select Right Application Differencing Tool EH File Edit Filters Browse Report Help Select Left Application gt Browse Select Right Application gt 1 C RAPID APPLICS XPRESS MAIN RPD Exit Differencing 2 C RAPID72 applics Xpress MAIN RPD 3 C Rapid applics DiffTool2 RPD 4 C Rapid applics DifFTool1 RPD Poet Vartan inka PS 2 Choose Browse to locate an application or select from the list of previously opened applications You can also right click one of the panes to open the popup menu and choose Select Application Comparing the Applications Once you have selected the applications they are automatically compared Each time you select a different
281. e previous size the new columns are appended to the array and hold the initial value defined in the Object Layout If the new size is smaller than the previous size the array is truncated setNumberOfColumns 3 setNumberOf Rows lt integer gt Sets number of rows to the specified value See the comments above Array1 setNumberOfRows 10 a The parameter type depends on the array type string integer or number If it is an array of strings the value can also be a regular expression b The parameter type depends on the array type string integer or number If it is an array of strings the value can also be a regular expression TWO DIMENSIONAL ARRAYS EXTENDED FUNCTIONALITY 26 13 Usage Examples All of the examples in this section are based on the two dimensional integer array Array1 shown below Its default initial value is O NOTE Sections of tables that are of particular interest in the following examples are outlined with double lines Getting a Two Dimensional Array Array1 Array1 getArrayFromRow 2 fromColumn 5 toRow Array1 getNumberOfRows toColumn 6 The result is 1 2 1 25 26 2 35 36 3 45 46 Clearing a Section of the Array Array1 clearFromRow 2 fromColumn 5 toRow 3 toColumn 6 The result is Note the change OBJECT ENHANCEMENTS 26 14 Inserting Columns Rows Ar
282. e transition s destination mode then the Transition Conflicts dialog box opens Modes identified asa MEI x valid destination for the transition E Choose the desired mode for operate Cancel on operate When selected this dialog box opens for every transition conflict in the current paste operation When cleared RapidPLUS connects all broken 7 transitions to the first proposed destination mode A and you will not be prompted about further conflicts during this paste operation E ip Help NOTE The destination modes are listed according to their order in the target application s mode tree STORING OBJECTS You can create applications to store objects for reuse To store objects for reuse 1 Create an application and save it with a meaningful name such as MySwitchs rpd for switches MyArrays rpd for arrays and so on 2 Each time you create an object in a different application that you want to store copy it e For graphic objects use Edit Copy or click the Copy Object button e For nongraphic objects use the Copy button in the Nongraphic Objects dialog box 3 Open the objects application my lt object gt rpd and paste the object into it e For graphic objects use Edit Paste Object or click the Paste Object button e For nongraphic objects use Edit Paste Nongraphics or the Paste button in the Nongraphic Objects dialog box 7 1 Writing Logic Using Loops and Branch
283. easily identify and navigate affected logic the logic lines are displayed in the Logic Error View whenever an operation occurs that causes invalid logic You can also open the Logic Error View from the Application Manager To open the Logic Error View e Inthe Application Manager choose View Logic Error View The Logic Error View opens showing previous validity checks from the current session The following illustration shows an example of the Logic Error View window Invalid logic Valid logic Reverifies the logic Reverifies the logic Opens the Logic Editor at the for all the invalid lines for the selected line selected logic line same as in the window ra double clicking the line User Object Contained In Trigger off We amp Switch on is connected Entry Activity calibrate Lampi on Exit Activity calibrate Lamp1 off Trigger calibrate D standby Pushbuttor in Trigger standby D calibrate Pushbutton in 5 new item s found 5 total item s found VIEWING INVALID LOGIC 5 5 The columns of the Logic Error View are as follows COLUMN Logic Status no column title DESCRIPTION Shows status of the changed logic line as follows The logic line is invalid Invalid lines will remain commented out when the Logic Error View is closed af The logic line is valid This appears for valid logic lines that were pasted at the same time invalid logic lines were pasted and for logic lines that have been succe
284. ect is 4 Int1 Font1 countSubStrOf Str1 toFitWidth GDO1 getWidth leftAligned 1 wordWrap 1 To display the first substring you could use the following logic GDO1 drawText Font1 subStrOf Str1 index 1 toFitWidth GDO getWidth leftAligned 1 wordWrap 1 atx 0 y 0 and the result is 14 1 Touch Screen Object A touch screen is a display screen topped by a touch sensitive transparent panel The panel is composed of a matrix of cells that transmit information to the software A person using a touch screen relies on touching the screen with a finger or stylus rather than using a mouse or light pen Since RapidPLUS presents a simulation and not an actual touch screen the finger stylus interaction with the touch screen is imitated by the mouse This chapter presents e How to add and define a touch screen object in the Object Layout e How to define its logic e Touch screen object reference TOUCH SCREEN OBJECT 14 2 ADDING IN THE OBJECT LAYOUT To add a touch screen object to the Object Layout 1 The touch screen object is located in the Displays class Select it from either the Object Palette or the New Objects list 2 Use the Touch Screen dialog box to define e The size of the object as a matrix of cells e The size of each cell in screen pixels e The width of the lines that form the grid e The minimal delay between pressing and releasing the mouse button that constitutes a
285. ected the default value is used Default values number 0 0 integer 0 string empty e NOTE For an integer data type you can enter the value in decimal or hexadecimal format The equivalent value is displayed at the bottom of the dialog box Hexadecimal values are translated by RapidPLUS into signed long integers The permissible range is Ox00 to Ox7FFFFFFF or 2147483647 Number of Elements Number of elements in each dimension There is one stepper box for each dimension Range 1 999 for each dimension Edit Elements buttons Opens the Edit Elements dialog box for editing the individual array elements For details see the next section Advanced button Opens a dialog box for setting values that are applicable for C code generation The advanced dialog box is the same for number object and string arrays For details about string arrays see p 10 31 For details about integer arrays see p 10 33 Import button Opens the Open Import File dialog box for importing data from TXT CSV and RAR files For details see p 10 18 DATA OBJECTS 10 17 Editing an Array s Elements Initially all of the array s elements have the same value or hold the same object the one defined as the default value object in the Array dialog box You can edit the value of individual elements so that their initial values will be different To edit individual elements 1 Click the Edit Eleme
286. ed To change a non windowed control to a wndowed control e In the control s More dialog box select the Windowed option ActiveX Properties Microsoft_Forms_2_0 TextBox1 EA Windowed objects always appear on top of non windowed objects The behaviour of windowed objects may Cancel be somewhat different Windowed Help fel N ql Object Properties Constants SUPPORTED ACTIVEX DATA TYPES 17 9 NOTE Some ActiveX controls present themselves to the container as non windowed even though they are not Thus the windowing options will be available in the above dialog box but the selection has no effect during runtime You can test for this type of situation by placing the supposedly non windowed ActiveX control behind a RapidPLUS graphic object in the Object Layout and observing if it maintains that stack order during runtime SUPPORTED ACTIVEX DATA TYPES ActiveX controls use a set of custom types for properties function parameters and return values The following table summarizes the equivalent RapidPLUS data type for each ActiveX data type ACTIVEX TYPE RAPID TYPE COMMENTS Integers unsigned Integer integers currency Date Date See New RapidPLUS Data Types on pp 17 11 to 17 15 Float Number Boolean Integer where O false and 1 true String BSTR String Color RapidPLUS color Like the lineColor or fillColor properties Pointer to picture RapidPLUS See N
287. ed The text string appears with a white background for enhanced visibility The logic for this function is LCD1 setBackgroundColor 4 LCD1 drawText Standby atx 2 y 2 where white is the fourth color in the graphic display object s 4 color palette The other graphic display pixels retain the background color specified in the Graphic Display dialog box NOTE A font object must be specified in the logic for the text string to be displayed For details see Displaying Text on p 12 21 Changing the Grid Color Use the gridColor property to change the color of the grid lines that separate display pixels The color choices are listed as functions in the Logic Palette Example Use the following logic to change the grid color from black the default color to white LCD1 gridColor white NOTE The thickness of the grid lines is determined in the object s dialog box see p 12 6 DEFINING THE LOGIC 12 19 Changing a Pixel s Color To change the color of a single pixel on a graphic display use the drawPixel Atx y function The color that the single pixel will use is either black the default draw color or the color specified by the setDrawColor function Example A cell phone s LCD must give a visual indication that it is activated and ready to receive or transmit calls The visual cue is a two pixel high bar that scrolls across the top two rows of the display The logic for this operation is DEST
288. ed on e Constant values e g 2 1 5 abc e Constant integers constant numbers constant strings and constant sets e Relational opereators gt lt gt lt lt gt e Boolean operators and or e Arithmetic operators The immediate evaluation is not performed on e Constant arrays e Expressions with type mismatch e g no conversion from String to Integer e Functions other than relational functions e User functions WRITING LOGIC USING LOOPS AND BRANCHES 7 16 HOW LOOP AND BRANCH LOGIC IS ACCEPTED RapidPLUS logic is accepted when you click the Confirm or New Line button press Enter or move the focus to another line in the Logic Editor Warnings about block problems such as an else without a preceding if are issued only when e Saving the application Running the Prototyper e The logic is about to disappear from the screen such as when closing the Logic Editor changing the active mode or changing the transition for action blocks EXECUTION OF LOOPS AND BRANCHES RapidPLUS executes loops and branches differently from other logic The entire statement is executed as a single piece of logic While it is being executed no transitions are performed NOTE Graphics are updated after a loop or branch has been executed Execution of While Loops while lt Condition gt A While loop is executed as follows i RapidPLUS evaluates the While condit
289. efault setting for its device clipping rectangle Device clipping rectangle eal S a Buffer1 with a bitmap b Clipping rectangle c Buffer1 s clipping d The bitmap will be drawn on it set for Buffer1 rectangle positioned on drawn in the area in the intermediate buffer which Buffer1 s clipping no device clipping rectangle intersects with rectangle was set the device clipping rectangle The buffer and device clipping rectangle borders are for illustration purposes only they do not appear on the graphic display Buffer Usage Examples This section presents ideas of how you can use buffers to achieve various effects You can find these ideas implemented in the example applications that are located in the Examples folder Moving Map You could achieve the effect of a moving map by creating a buffer that contains a bitmap of the entire map You would then adjust the buffer s clipping rectangle to the size of the area of interest to be shown on the graphic display In the same way you would position the buffer s clipping rectangle on the graphic display in the location where you want the map segment to appear Note that the device clipping rectangle is set at its default size Refer to the following illustration 12 50 GRAPHIC DISPLAYS buffer1 GDO1 buffer setClipRectSizeWidth 15 height 10 forBuffer 1 INTERMEDIATE BUFFER GDO1 buffer setClipRectPositionOnGDOtox 15 y 15 forBuffer
290. eferences for the project is automatically created when you save an application to XML format You can edit this file to create multiple CSX files for a single application Doing so allows you to set code generation preferences outside of RapidPLUS The CSX file that will be used with the application must have the name lt application name gt csx EDITING AN XML FILE 2 11 EDITING AN XML FILE RapidPLUS requires that the XML documents be both well formed and valid A well formed XML document meets the basic rule of XML that all tags are balanced i e that all elements containing character data are contained between pairs of start and end tags A valid XML document contains an XML declaration at the top It conforms to a referenced schema and can be validated by a validating parser There are three types of editors that you can use to edit the XML files e Text editor treats the XML as text without understanding the XML structure or semantics e XML editor that does not recognize schema checks that the XML is well formed but will not validate the XML against the schema e XML editor that recognizes schema checks that the XML is well formed and valid If you edit an RXD or UXO file in an XML editor that recognizes schema the editor will look for the schema in the same folder as the file being edited Upon loading RXD and UXO files RapidPLUS notifies you about any syntax or semantic errors made during editing NOTE
291. eful when access to the specified property is not available in the ActiveX control itself Example 1 You have an application with twelve buttons of which only four can be concurrently displayed due to the limited size of the graphic display You use the two Automotive ActiveX controls ButtonContentList and ListManager to change the buttons objects as needed using the following logic Rapid ActiveXHelper setProperty_object ButtonContentList name ListManager value Rapid ActiveX Helper getProperty_Object ListManager name The above logic line is equivalent to the following Visual Basic statement ButtonContentList ListManager ListManager Object 17 21 17 22 USING ACTIVEX CONTROLS Example 2 You have an application that uses the Microsoft Office Chart 9 0 ActiveX control in an application One of the properties of this object is Interior Interior is an object type property with several properties none of which are accessible through the Office Chart control itself These nested properties can however be manipulated through the RapidPLUS ActiveX Helper object To get the value of the color property of Interior you use the following logic line Display1 contents Rapid ActiveXHelper getProperty_object Microsoft_Office_Chart_9_ 01 name Interior Color You can use the setProperty_object name value similarly to assign a value to a nested property NOTE Nested properties are not visible in the Lo
292. elected RapidPLUS wraps around to the lower bound when the value of the integer exceeds the upper bound For example the lower limit is set at 3 the upper limit is set at 15 and the value of the number object is currently 15 If the activity changeBy 1 produces the value 16 the actual value of the object will be 3 Not selected You can enter a value in decimal format or hexadecimal format for the initial or bounded values When you enter a value in decimal format the equivalent DATA OBJECTS 10 11 hexadecimal value is displayed and vice versa Even if you enter a value in hexadecimal format the value will appear in its equivalent decimal value the next time you open the dialog box Hexadecimal values are translated by RapidPLUS into signed long integers The permissible range is 0x00 to Ox7FFFFFEF or 2147483647 The integer dialog box also opens when you define an integer property for an active primitive object or for a user property of a user object Random Number The random number object is a read only number that is assigned a random value by RapidPLUS The random number object produces a number value with up to six decimal places It has all the functions of the number object except assign and changeBy because only RapidPLUS assigns the values You can set minimum and maximum values to a random number object in its dialog box Random Random_Number1 Ea Min E Max fi00 Lancet Help J
293. enerate an immediate response to the action Relevant only in reroute mode The legal values are 1 Acknowledge 2 Deny Return Value None WindowPosChanged Called when the user moves a stand alone simulation window Syntax for event handler in Visual Basic WindowPosChanged ByVal Left As Long ByVal Top As Long Parameters left The x coordinate of the new upper left corner top The y coordinate of the new upper left corner Return Value None WindowSizeChanged Called when the user resizes a stand alone simulation window Syntax for event handler in Visual Basic WindowSizeChanged ByVal Width As Long ByVal Height As Long Parameters width The new width in pixels height The new height in pixels Return Value None 19 1 Using JavaBeans in RapidPLUS JavaBeans component architecture developed by Sun Microsystems is an architecture for the Java environment JavaBeans also known as Beans are self contained re usable components that can be deployed in a network on any operating system In RapidPLUS you can incorporate JavaBeans as objects in your application Graphic JavaBeans can be used for user interface components or special effects to enhance the user experience Nongraphic JavaBeans can be used to implement complex application logic in Java RapidPLUS translates the JavaBean interface into RapidPLUS events properties and functions available in the Logic Editor This chapter presents
294. enerating Reports explains the various reports that can be generated for objects modes user object interface and project components It also describes XML reports that can be generated and the API for these reports e Chapter 26 Object Enhancements provides detailed descriptions of the new functionality that has been added to existing RapidPLUS objects such as holders arrays strings integers and DLLs e Chapter 27 Additional RapidPLUS Enhancements introduces new features and enhancements of existing features e Chapter 28 Application Packager describes this distribution utility which is used for packaging a RapidPLUS application and its supporting files e Appendix A RapidPLUS Search Paths lists the paths that RapidPLUS searches for files Conventions Used in This Manual The RapidPLUS documentation uses the following conventions e Choose File Save Application means to select the Save Application command from the File menu e Names of properties functions and events are italicized idReceived property checkForData function dataReceived event xxi xxii e File names are italicized main c e Complete phrases of RapidPLUS logic are presented in bold sans serif font amp Switch2 position3 is connected New in e In Chapter 27 Additional RapidPLUS Enhancements features that are new in version 8 0 are marked in the tables that appear at the beginning of the chapter
295. ens Duplicate Number1 x New Obiect Name Number 1 Cancel A as Constant Help eih Duplicating a number object example 11 3 CONSTANT OBJECTS 11 4 3 Assign a name to the new constant object and select the as Constant check box If the as Constant check box is not selected the new object is a number string integer or array object just like the original 4 Click OK the new object is added to the Constant Data class in the Nongraphic Objects dialog box Adding a Constant Set Object To add a constant set object i2 N 1 Click the Constant Set button and edit the name as desired 2 Click the More button to open the dialog box in which you define the constant integer items 3 Click the Add Item button to enable the area in which you provide names and values for the constant integer items as follows Type a name for the Specify an integer value item the item is added to the end of the list its value is the last item value 1 Otherwise the Add Item default value is O Adds another item to the set If Cancel Deletes the selected item Click to import data from h files Hexadecimal Value DxFFFEFFFFFE A maximum of 999 integer constants can be added to a constant set object NOTE If an item in the list is selected when you click Add Item the new item is added after the selected item If no item is selected the new item is added to the end of the list ADDIN
296. ent parameters To view a control s constant sets and create RapidPLUS equivalents e Click the Constants button in its More dialog box as shown on the previous page The following dialog box opens ACTIVEX CONTROL WINDOWING AND STACK ORDER Z ORDER 17 7 List of constant sets List of items and values in the selected constant set ActiveX Constants Constants fmDropEffect Default 0 0x0 fmAction Arrow 1 0x1 Create fmMode Cross 2 0x2 fmMousePointer IBeam 3 0x3 fmScrollB ars SizeNESW 6 0x6 fmScrollAction SizeNS 7 0x7 fmCycle SizeNWSE 8 0x8 fmZOrder Size WE 9 0x9 fmBorderStyle UpArrow 10 Oxa fmT extAlign fmAlignment fmBorders AppStarting 13 Oxd fmBackStyle Help 14 Oxe fmButtonStyle SizeAll 15 Oxf fmPicPosition Custom 99 0x63 fm VerticalScrollRarSide gt ddi Help HourGlass A description of the selected item set or constant Creates a RapidPLUS constant set if a description exists object for the selected constant set as shown below Use the constant set in the logic as follows 0 CheckBox1 MousePointer fmMousePointer Arrow ACTIVEX CONTROL WINDOWING AND STACK ORDER Z ORDER In the Object Layout you control the stack order of graphic ActiveX controls like any other graphic object for more details see Changing Stack Order in the Object Layout on p 21 2 During runtime however there is a difference in stack orde
297. entire user action string or parts of it To display the entire user action string e Use the following method Label1 Caption objectName propertyName eventName time id response The adds one space between each part Example In this example the following script is used to display each user action s object property and event Private Sub RapidSiml_UserActionFired ByVal objectName As String ByVal propertyName As String ByVal eventName As String ByVal time As Single ByVal id As Long response As Long actionLbl Caption objectName propertyName eventName actionLbl Caption RapidSiml LastUserActionObject propertyName eventName End Sub REROUTING USER ACTIONS 18 29 The result of this script is illustrated below Label object that displays the simulation s user actions Example of a host document that contains two ActiveX controls a Label and a Rapid Simulator REROUTING USER ACTIONS When the Rapid Simulator is in reroute mode the simulation sends all of the user actions it generates to the host document and waits for the host document to send a response If the host document acknowledges the user action the simulation responds to the user action as normal For example if the user action is to rotate a dial then the dial is rotated If the host document denies the user action the simulation does not respond to it
298. er containing the time stamp of the last user action that took place in the simulation HOSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS 18 36 NotifyOnApplicationPropertyChange If True notifies the Rapid Simulator each time an exported property value changes in the simulation That is every time an exported property s value changes the event handler for the ApplicationPropertyChanged event is triggered NotifyOnDDEObjectChange If True notifies the Rapid Simulator each time a DDE object s value changes in the simulation That is every time a DDE object s value changes the event handler for the DDEObjectDataChanged event is triggered OnTop Sets the Rapid Simulator window to always on top mode Palette For 256 color display only Determines the palette to be used by the simulation Foreground uses the simulation s original palette Background uses the system palette The Background palette should be used whenever the host program is a Microsoft Office program it should also be used if the Foreground palette causes flickering problems Values 0 Foreground 1 Background default RecorderControlsEnabled Enables the Recorder controls during runtime only Default value True RecorderVisible Shows or hides the Recorder during runtime only Default value False PROPERTIES METHODS AND EVENTS RoutingMode Determines how user actions are handled by the simulation Values 0 rmNormal 1 rmMoni
299. er object allocation User object interface A Property changes A Events A Function calls A Structures Selected items appear in the log pane and determine at what points the application pauses when using Step by Filter For example if you select Activities only then e The log includes entry exit and mode activities but no other logic e Step by Filter executes all intervening logic without pausing and then pauses at the next activity Thus if you are paused at the last exit activity of ModeA on a transition to ModeB clicking Step by Filter executes all actions if any related to the transition and then pauses at the first entry activity of ModeB Descriptions and examples of the different kinds of logic can be found in Managing Logs on p 4 21 User Object and Mode Options In the User Objects and Modes tabbed pages you can designate which user object interfaces and which application modes should be included for logging information and for stepping filters Keep in mind that the scope of the logic i e which types of logic statements to include is determined in the Filters tabbed page DEBUGGING APPLICATIONS 4 20 Selecting user objects General Filters User Objects Modes Select the user objects whose logic and interface will be included in the log Hierarchical presentation or stepped through using Step by filter of all user objects a W TEL_MAIN
300. eral instances of the same quantitative function only the last instance applies So of the two rotations only the last one applied and the image is flipped and then rotated 90 The color difference compared with the previous image is due to the same reason Non cumulative changes Predefined order manipulation In this mode too all manipulations are always applied to the original image but in a different order In this order the color inversion manipulation is performed after the red color changes producing different coloring compared with the previous image The different order does not affect the positioning of the image which is therefore the same as in the previous one IMAGE OBJECT 13 9 Using the setColorForRGB_Ranges function This function provides color control by allowing you to select the pixels to which the color change applies and set different RGB values for different pixel groups The pixels are selected if all three of their color component values fall within the specified range for each color component The color component ranges as well as the RGB values of the target color are defined in a nine element two dimensional array that the function uses as an argument The array must be in the following format Lower limit of R component Upper limit of R component Lower limit of G component Upper limit of G component Lower limit of B component Upper limit of B component Target R com
301. erty select the function setAscendingPriority forColumn or setDescendingPriority forColumn specifying a priority value of 1 and the column Then call the function sortByColumns DATA STORES AND ARRAYS 26 5 Example Let s assume that you have a five record data store object named Staff DS with two fields a string field called Employee and an integer field called Age Its initial values are as follows MIENTO The activity Staff_DS Employee sortAscending would sort the records as follows Name Employee Age 1 Alex 41 2 Andrea 41 3 Andy 25 4 Carl 32 5 Jane 54 For the same initial values the activity Staff_DS Age sortDescending would sort the records as follows Name Employee Age 1 Jane 54 2 Andrea 41 3 Alex 41 4 Carl 32 5 Andy 25 NOTE The order of records with the same field value such as Records 2 and 3 above is arbitrary 26 6 OBJECT ENHANCEMENTS To sort data store records or two dimensional arrays by multiple fields or columns 1 For each field column whose values that you wish to use as sort criteria set the sort priority and the sort order as follows OBJECT FUNCTION RESULT Data store setAscendingPriority lt integer gt Sorts the records by the field s field values in ascending order and according to the priority set by the integer argument setDescendingPriority lt integer gt Sorts the records
302. es In programming loops and branches are powerful control structures used to repeatedly or conditionally execute a series of instructions in a single cycle of the state machine Loop statements are used to execute a block i e a set of activities over and over again Branch statements are used to execute a block only when some condition is satisfied RapidPLUS uses the following logic constructs CONTROL STRUCTURE SYNTAX DESCRIPTION while loop while lt condition gt Repeats the block of activities while the lt Activity 1 gt condition is true lt Activity 2 gt for loop for lt int object gt from Repeats the block of activities for a set lt int gt to lt int gt step number of times lt int gt lt Activity 1 gt lt Activity 2 gt if else if lt condition gt Executes the block of activities if the branch lt Activity 1 gt condition is true lt Activity 2 gt If the condition is false and there is no else optional Else statement no activity is performed lt Activity z If the condition is false and there is an lt Activity 4 gt Else statement the second block of activities is performed 7 2 WRITING LOGIC USING LOOPS AND BRANCHES This chapter presents e Changes in the Logic Palette to accommodate loops and branches e How to build While loops e How to build For loops e How to build If else branches e An explanation of loop and branch logic execution NEW BUTTONS IN THE LOGIC
303. et the background color for a graphic display 1 In the Background color box enter the palette index of the desired color The available index numbers depend on the selection in the Number of colors box See the following section for details 2 Optional If you are unsure of a color s index click the Colors button to open a dialog box that displays the selected palette and corresponding index numbers Defining the Palette for a Graphic Display This section applies to graphic displays and not to true color graphic displays Selecting the Palette The graphic display can use from 2 to 256 colors You determine the number of colors by choosing the number of bits per pixel bpp from a minimum of one to a maximum of eight NOTE Code generation supports only color depths of 1 2 4 amp 8 bits per pixel To set the palette size e Select the size from the list in Number of colors ADDING AND DEFINING A GRAPHIC DISPLAY 12 9 Setting the Palette Colors There is a default palette for each palette size The default colors for the 2 4 8 and 16 color palettes are PALETTE SIZE DEFAULT COLORS 2 colors 1 bpp black white 4 colors 2 bpp black dark gray light gray white 8 colors 3 bpp black dark red dark green olive blue magenta cyan white 16 colors 4 bpp black dark red dark green olive dark blue purple teal light gray dark gray red green yellow blue magenta cyan whit
304. etProperty_object name 17 21 getRow 26 9 getWidth 12 21 Index 6 glDrawPixels 20 10 glFinish 20 11 glGetError 20 9 glLight 20 7 glTexImage 20 10 GLU 20 2 gluBuild1D 2DMipmaps 20 10 graphic display objects palettes 12 15 changing colors in runtime 12 19 color indexes 12 10 creating 12 10 defining 12 8 format for external palette 12 11 importing an external palette 12 11 See also graphic displays graphic displays adding in Object Layout 12 4 background color changing inruntime 12 17 selecting 12 7 basic information for using 12 2 to 12 3 clearing a rectangular area 12 20 connecting to an external DLL 12 13 coordinate measurements 12 15 defining display resolution 12 6 displaying images 12 25 to 12 26 displaying text 12 21 to 12 24 draw color 12 16 drawing circles 12 30 drawing ellipses 12 30 drawing modes attribute functions 12 33 examples of usage drawing transparent text 12 24 parsing multi line strings 12 40 to 12 42 saving and restoring 12 40 to 12 42 transparent color in bitmaps 12 26 floodfilling an enclosed area 12 31 getting the display height and width 12 21 grid changing color in runtime 12 18 changing the line color 12 7 eliminating 12 6 setting the line width 12 6 overview 12 1 pixels changin in runtime 12 19 setting the size 12 6 restoring area 12 38 status of 12 36 reverse color 12 16 saving area 12 38 status of 12 36 true color dialog box 12 5 updating mode setting 12 31 on request tip 12
305. eter Event Return Value For every event with a return value a new property is added to the ActiveX properties in the logic palette The property type such as integer or number depends on the return value type Its format is ev_ lt eventName gt _Return If you assign a value to this property before the event occurs the value is returned to the ActiveX control when the event is triggered NOTE Event return values are write only Thus for example it would not make sense to base a condition trigger on evaluating an event return value Verbs ActiveX verbs are custom design time commands that you can perform on the control such as open a properties dialog box The verb list is specific to each ActiveX control and a control may have no verbs at all When an ActiveX control has verbs to display RapidPLUS adds them as menu commands to the object s pop up menu RAPIDACTIVEXHELPER OBJECT The RapidActiveXHelper object is a nongraphic ActiveX object that expands the functionality of ActiveX controls in RapidPLUS It enables placement of ActiveX controls in focus as well as manipulation of their properties In addition the RapidActiveXHelper object makes it possible to manipulate nested properties The term nested properties refers to properties of properties Some ActiveX controls have properties which in turn have their own properties Nested properties are not accessible through the Activex control itself but they can be
306. ew RapidPLUS Data Types picture on pp 17 11 to 17 15 Pointer to font RapidPLUS font See New RapidPLUS Data Types on pp 17 11 to 17 15 USING ACTIVEX CONTROLS ACTIVEX TYPE Pointer RAPID TYPE Integer if pointer to integer other wise see details in Comments COMMENTS For properties to font or picture only For event parameters all types up to one level i e does not support a pointer to a pointer For functions not supported Character Character where character an element of a string Thus in the Logic Editor the assignment function for an element of the Text string property expects a Character argument as follows textbox1 Text 3 lt Character gt Variant Variant a system object that is added to an application when an ActiveX object is added The variant object enables RapidPLUS to assign string number integer or character values to variant properties For example ActiveX 1_param l lt variant gt param2 lt variant gt param3 lt variant gt can be written as ActiveX 1_paraml Variant byte 12 param2 Variant string world param3 Variant long 100 The variant object interacts with these data objects to enable the property to receive values directly therefore the logic can be written as ActiveX1_param1 12 param2 world param3 100 IDispatch IUnknown IDispatch is supported as a function argument Both IDispatch and I
307. example 8 14 error messages 8 10 Find tabbed page 8 2 to 8 4 icons replace results 8 10 opening 8 2 Replace tabbed page 8 8 to 8 11 search results 8 5 to 8 7 shortcut menu 8 6 to 8 7 undo and redo commands 8 8 wild cards in search string 8 3 floodFillAtx y 12 31 Follow Execution command Debugger and Logic Editor 4 9 to 4 10 4 18 font data type ActiveX 17 12 to 17 13 font data type JavaBean objects 19 8 font objects changing the font settings 13 11 creating a font gallery 13 12 defining the character range 13 13 Index 5 language scripts 13 12 overview 13 11 parsing multi line strings 12 23 13 14 using in a graphic display 12 21 fontHeight 12 24 fonts changing font for editable fields 27 9 changing Logic Editor Mode Tree font 27 8 restoring default RapidPLUS fonts 27 9 fontSet 12 21 fontStringWidth 12 24 For loops break continue 7 10 defining 7 6 to 7 8 execution of logic 7 17 indentation 7 9 loop counter 7 8 overview 7 5 G generating reports 25 1 generating code for data objects 10 30 for font objects 13 12 for JavaBean objects 19 20 for loops and branches 7 18 for user object messages 22 9 header file for constant objects 11 9 OpenGL objects 20 12 using local variables 27 17 GetApplicationProperty method 18 11 to 18 13 18 38 getArrayFromRow fromColumn toRow toColumn 26 8 getBookmark 15 10 getColumn 26 9 getCurrent 10 43 getData 16 5 getDisplayBuffer 12 47 getHeight 12 21 getNumberOfRows 26 9 g
308. f the search string click Replace All If you change your mind click the Undo or Redo button to change your recent activities These buttons in the dialog box function the same way as the Undo Redo buttons in other tools Example To change all blinking lamps to on you first perform a search for all instances of lamp On the Replace tabbed page type blink in the Replace What box and type on in the Replace With box Select Match Case and Whole Word Only The dialog box would appear similar to the following illustration USING REPLACE 8 9 New replace strings Find amp Replace MYAPP C Redo ove Lomment Entry Activity Calibrate Lamp1 blink Exit Activity Calibrate Lampl off Entry Activity Standby Lamp2 blink Exit Activity Standby Lamp2 off Entry Activity Operate Lamp3 blink Exit Activity Operate Lamp3 off Entry Activity Waring Lamp4 blink Exit Activity Warning Lamp4 off Logic lines found by an initial search for lamp Validating Logic RapidPLUS checks that the lines of logic created by the replacements are logically valid i e that they are both syntactically correct and executable within the context of your application s logic 8 10 FIND AND REPLACE Logic Status Icons The results of this logic validity check are given in the status column of the search results list The possible status icons are as follows STATUS ICON MEANING af The logic statement is
309. f you want all subsequent masters to contain these modifications To select a chart scheme other than the Default scheme 1 2 3 Open the Chart Options dialog box Tools Options In the Scheme list click the arrow and select a scheme Click OK To create a new chart scheme 1 2 Open the Chart Options dialog box Tools Options In the Scheme list click the arrow and select lt New gt then click Settings Microsft Visio opens to a new master named Default lt consecutive number gt The schemes vss stencil is also opened but is not in focus Modify the textual appearance of mode names as needed Although other elements can be modified they will not be applied to the charts The other elements apply to exported screen transition charts Save the new scheme To do so a Close the master b In the Update dialog box that opens click Yes EXPORTING A STATE CHART 24 7 c In the scheme vss stencil right click the new master named Default lt number gt and choose Master Properties d Edit the Master s name then click OK e Close schemes vss In the Save Changes dialog box click Yes By default the new master is saved in Visio 5 format You can choose a different Visio version The newly created scheme is added to the Scheme list in the Chart Options dialog box 25 1 Generating Reports RapidPLUS enables you to generate detailed text or graphic reports about various aspe
310. fferent versions of the same component can be compared using an external comparison tool including the comparison tool of the version control system e Developers can work in parallel on the same project component merging the changes when the work is done This section provides information about e Checking projects or components in and out of a version control system e Synchronizing component changes e Comparing application and component versions e Merging applications and components For information about the XML files see Chapter 2 RapidPLUS Applications in XML TEAM DEVELOPMENT AND VERSION CONTROL USING XML FILES 1 17 Checking In Out Projects or Components This section presents a process for using a version control system during RapidPLUS team development When setting up the project all project files should be checked into the version control system and should be made read only The project files comprise the main application file RXD the user object files UXO and the project settings file CSX Other files that should be checked in include the shared resources linked bitmaps array data loaded during runtime etc Also ActiveX and JavaBean objects should be checked in Developers should copy the entire release from a network folder to their local work folder Before working on a file the developer must check it out of the version control system to the work folder TIP If you open the main a
311. file The format of the script is lt escDef gt lt esc gt f lt esc gt r lt esc gt c where stars are any text lt escDef gt is the character subsequently used as the escape character in the rest of the script lt esc gt is the escape character as specified by lt escDef gt lt esc gt f is a placeholder for the file name lt esc gt r is the placeholder of the row number lt esc gt c is the placeholder of the column number and lt esc gt lt esc gt escapes the escape character The lt escDef gt character must be the first character of the script however the order of the other placeholders is insignificant EDITING AN XML FILE 2 13 For example if the default external editor is defined as Visual SlickEdit and there is an XML error in the file myApp rxd in line 4 column 45 the script SS Hgoto line r goto col c will result in the command line vs exe myApp goto line 4 Hgoto col 45 For other editors check the documentation for the correct command line switches 5 For an external editor that recognizes schema In the XML Output group make sure that the Save Schema With XML Files check box is selected If this check box is not selected the XML editor will not be able to find the schema file when the application file is loaded which will cause an error The Schema File The schema file is used by RapidPLUS and external tools to validate the syntax of the XML application files RXD
312. for update on request mode Setting the Drawing Mode Use the attribute functions attributeSetNormal attributeSetReverse attribute SetXOR to specify how the graphic display draws the following elements e Text characters e Empty and filled rectangles e Empty and filled circles e Empty and filled ellipses e Individual display pixels using the drawPixelAtx y function attributeSetNormal The attributeSetNormal function is the graphic display s default setting In this display setting graphic elements are displayed in the current drawing color and are drawn on top of each other if they are placed in the same area 12 34 GRAPHIC DISPLAYS Using the drawTextAtx y function String 1 is drawn on the graphic display Then String 2 is drawn on the graphic display using the same coordinates String 2 is drawn on top of String 1 NOTE White is used as a new background color for String 2 to better illustrate how String 2 blocks out String 1 attributeSetReverse Use the attributeSetReverse function to put the graphic display into reverse display mode In this mode graphic elements are displayed in the reverse color of the current draw color The reverse color is the complement to 255 of the current draw color RGB values If the current draw color is blue R 0 G 0 B 255 the reverse color will be yellow R 255 G 255 B 0 Graphic elements placed in the same area ar
313. for drawing text and graphics on the graphic display s intermediate buffer It can be the size of the entire graphic display which is the device clipping rectangle s default size or it can be set to a smaller size The device clipping rectangle determines how much of a graphic or text will appear on the graphic display In other words if an imported bitmap is larger than the device clipping rectangle only the portion of the bitmap that intersects with the clipping rectangle will be displayed The following illustrations show how the displayed area of a bitmap is determined a Intermediate buffer b Device clipping c How the bitmap appears when drawn with device clipping rectangle set on the rectangle at its default intermediate buffer on the intermediate size Imported bitmap buffer The device clipping rectangle borders are for illustration purposes only they do not appear on the graphic display NOTE The graphic display s clipping rectangle is referred to as the device clipping rectangle because its attributes are stored in the graphic display s device context which is an internal graphics device interface GDI structure The device context governs the display of text and graphics on the graphic display 12 47 12 48 GRAPHIC DISPLAYS Buffer Clipping Rectangles Every user defined buffer has a clipping rectangle which functions like a viewport This clipping rectangle determines the location and ex
314. formation about the BeanInfo class see p 19 12 LOGIC FOR JAVABEAN OBJECTS 19 11 Events JavaBean events define a listener interface and an event object class The listener interface includes one or more methods that are called when the event occurs Each method gets an event object as an argument The event object may contain additional properties that are part of the event JavaBean events are mapped to RapidPLUS events and appear in the Function Event column like other RapidPLUS events The arguments included in the event object are mapped to specialized properties of the JavaBean object They appear in the Properties column with the following syntax ev_ lt eventName gt _ lt propertyName gt Event properties are valid only after the event has occurred You get invalid values if you attempt to read an event property s value without its event having been triggered therefore they should be used only in the actions of a transition that triggers the event Example A JavaBean object has an event called Mouse It defines a listener interface called MouseListener which includes several methods such as void mouseClicked MouseEvent event and void mouseReleased MouseEvent event Each of these methods defines a different manifestation of the Mouse event One is called when the user clicks the mouse button the other is called when the user releases the mouse button In RapidPLUS these events will be events
315. g a Nongraphic Object To delete a nongraphic object 1 Select the object in the Nongraphic Objects list 2 Click the Delete button RapidPLUS asks you to confirm the delete operation 3 Click Yes If the object is used in the logic RapidPLUS warns you that deleting the object will delete the related logic You can continue or cancel the Delete operation Replacing a Nongraphic Object You can replace a nongraphic object with another object of the same type e g a stopwatch with another stopwatch This feature is especially useful if you have already built logic around the object that you want to replace To replace a nongraphic object 1 Select the object in the Nongraphic Objects list 2 Click the Replace button to open the Replace dialog box 3 Enter the name of an object of the same type that appears in the Nongraphic Objects list then click OK The replaced object is removed from the list NONGRAPHIC OBJECTS 10 8 DATA OBJECTS This class of nongraphic objects comprises objects that hold various kinds of data in a variable There are eight types of data objects string number integer random number holder array data store and point String abe String The string object is a variable that holds an alphanumeric text string If you use a String as part of an arithmetic procedure RapidPLUS automatically converts it into a number For example the character 3 is converted into the numeric value 3
316. g a Structure to a Union You can add two types of structures to a union e Definition only structures existing structures e Single instance structures new structures To add a definition only structure to a union 1 Select the union In the Fields group click Existing Struct the Add Structure dialog box opens Add Structure xi Select a structure from the list Displays a list of all definition only structures in the user object Cancel L Pointer If selected the Code Generator will expect a pointer to the field rather than the field itself NOTE Only relevant in the context of code 2 Select a structure from the list of definition only structures 22 8 USER OBJECTS WITH MESSAGES 3 The structure s default memory allocation method is the buffer method To use the pointer method select the Pointer check box For an explanation of these choices see Defining the Memory Allocation Method on p 22 13 NOTE The memory allocation method is only relevant if you are using RapidPLUS for code generation purposes Click OK to add the definition only structure to the selected union The default name is lt definition only structure name gt Structurex where x is an ordinal number NOTE The added structure s fields cannot be edited directly in the union You have to edit the original definition only structure directly and those changes are propagated automatically to all instances
317. g attributes e Element name a name used internally by RapidPLUS For example the element name for the application is RPApplication e Type a numerical identifier for the element type For example all bitmap objects have the same Type number e ID an identifier for each instance of an object mode and logic type For example each pushbutton will have a different ID e Ver the version number of the RapidPLUS database in which the application was saved Additional information is provided in nested elements as necessary e IDREF reference to another object using the referenced object s ID attribute In some cases the identifier will be listed as lt number gt To find the object you should look for an object with identifier id lt number gt An example of this is the tag _notesHandle which is described in the section Nested elements that apply to application object elements on p 25 29 e References to external binary or textual data The data is stored in files separate from the XML report file These files are placed in the same folder as the XML report The name of the file is usually contained in an SRC attribute to indicate the external reference The following sections provide details about various elements and tags used in XML reports for objects modes and logic As mentioned earlier much of the information in the generated XML reports pertains to internal structures in RapidPLUS and is therefore not desc
318. g box for selecting a user object type Type Y Show full pal 1 New Objects xl Objects Frame Square Comers Frame User Object Add User Object Rapid Object Available User Objects APPLETCONTEXT_MANAGER L HELP UDO Cancel SCENARIOPLAYER_MANAGER SCENARIOPLAYERUI_AGENT L adi aquere Comers Filed Frame SIMULATION AGENT DO Help ound Corners Frame E A Round Corners Filled Frame Help USER_OBJECT_TEMPLATE UD Dut Frame In Frame 2 If the selected user object object type is graphic you can select the Dynamic and or Drag amp Drop options in the Holder dialog box These options add dynamic and drag amp drop properties and functions in the Logic Palette 3 Ifa user object type was selected you can view edit the user object interface in the parent application by clicking the More button to display the user object s interface dialog box NOTE Holders without default objects can be used to share the parent application s objects including user objects among all of its children user objects without having to add instances of those objects to the user objects themselves All logic in the user objects is carried out on a holder that holds the object type At start up the parent application uses an exported function to pass the actual object instance to the user object holder For more information refer to the Methodology Guide Building Applications for Embedded Systems Using the Pr
319. g1 gt A Exported Toggles between designating the selected user function as exported or not exported Refer to Exporting User Defined Functions on p 18 10 in the Rapid User Manual List of user functions Copies the selected user function for pasting locally or in another application Copy Paste Delete Pastes the function in the paste buffer Deletes the selected user lu Show Data Type 7 function Using Constant Set Properties Constant sets can be defined as user object properties As exported properties the constant set items have the same functions as a constant integer They allow you to share constants between the user object and parent application Another advantageous use of constant sets as exported properties is that you can build a user object that contains only constant sets The constant set values can then be used by multiple user objects via a holder Adding Constant Set Properties To add a constant set property 1 Open the User Object Properties dialog box the Properties tab is displayed 2 Click the Constant Set property button ADDITIONAL RAPIDPLUS ENHANCEMENTS 27 14 3 In the Constant Set dialog box add the desired number of items For instructions about adding items see p 11 4 NOTE The constant set s items are not listed in the Properties list To see items select the constant set and click the Edit button Using Constant Set Properties in Logic Constant
320. ge is built Its files are e A self installing package file Setup exe e A text file PackagedFiles txt which contains a list of all the files that are included in the package the application its user objects and resources e A subfolder for special fonts used in the application if included e The Readme file if included e Various setup data and administrative files The default folder is Package_ lt application file name gt located in the application folder Installed Application This field presents the folder that will be added to the end user s system when setup exe is run The default folder name is C Rapid_Demo lt application name gt If the Rapid Reviewer was included in the package a subfolder named Reviewer will also be added See Distributing and Using a Packaged Application on p 28 11 for information about the destination folder BUILDING AN APPLICATION PACKAGE To change the destination folder s and or build the package 1 For either destination folder type a folder name or click the Browse button and select a different folder Destination Folders m Destination Folders Package This folder will contain all the files needed to install the packaged application Browse je Rapid applics CD_Player Package_CDPLAYER Installed Application This folder will contain the application and the optional Reviewer and readme files Browse
321. ge object and graphic multimedia objects The differences in behavior between non windowed and windowed OpenGL objects can be summarized as follows WINDOWED NON WINDOWED Stack order Can only be controlled relative Can only be controlled Z order to other windowed objects relative to other non during runtime windowed objects NOTE Any windowed object will always be in front of any non windowed object Transparency None of its colors can be made Like any graphic object transparent one of its colors can be made transparent Performance Depending on the platform may have enhanced performance IMPORTANT Some graphic card drivers especially old drivers do not properly support non windowed OpenGL If you experience problems using the non windowed mode try the windowed mode If this works try to install the latest driver for your graphic card Updating your Windows operating system with the latest service pack may also help Display Lists A display list encapsulates a set of OpenGL commands and their results which you can then invoke as a single routine by simply naming the display list Display lists optimize rendering by creating a library of complex objects each comprised of a number of OpenGL geometric and or image primitives The price however is heavier demands on memory space If you choose the Share display lists option for an OpenGL object then its display lists will be available to all other Ope
322. get User function in target write lt string gt at lt constant integer gt write lt string gt at lt constant integer gt Duplicate Interface Element A duplicate interface element is a property event union or definition only structure in the target application with the same name as the pasted interface element PASTING OPERATIONS 6 8 Duplicate Mode A duplicate mode is a child mode in the target application subtree with the same name as the pasted mode Example Source mode Target mode source pofi on pa Le If operate mode were pasted to off mode in the target application there would be no conflict operate Duplicate mode Transition Conflict A transition conflict occurs when RapidPLUS has to choose between several possible destinations that have the same name Example Source mode Target mode target off aa on ti selftest standby operate calibration off Multiple destination modes on A dialog box opens in which you indicate whether to reconnect the pasted mode s off gt on transition to operation on or to calibration on NOTE When a duplication or conflict is detected during the paste operation RapidPLUS displays an easy to use interface that alerts you to these conflicts and offers you several ways to handle their resolution For more details see Resolving Duplicate Element Conflicts on p 6 15 and Resolving Transition Conflicts on p
323. ght or Width The following two functions allow you to get a graphic display s height or width during runtime FUNCTION DESCRIPTION EXAMPLE getHeight Returns the height of the height_int GDO1 getHeight graphic display in display pixels getWidth Returns the width of the width_int GDO1 getWidth graphic display in display pixels Displaying Text For text to appear on the graphic display you must STEP DESCRIPTION 1 Add one or more font For details see Font Object on p 13 11 objects 2 Specify the font s that Use the graphic display s fontSet function to will be used specify the display s font 3 Specify the text that Use the graphic display s drawText atx y or will be displayed and drawTransparentText atx y functions to specify the position where the the text and to position it text will start Specifying a Font Using a Font Object Use the fontSet function to specify the font object whose characteristics will be applied to subsequent text strings drawn on the display A font object must be specified for text strings to appear in the graphic display Using the fontSet function with different font objects allows you to change the fonts and styles during runtime NOTE If a Microsoft Windows font defined in the font object is not found on a user s system during runtime RapidPLUS uses the closest matching font 12 22 GRAPHIC DISPLAYS available This substitution may produce
324. gic Palette In order to successfully manipulate nested properties through the ActiveX Helper object you must have a good working knowledge of the ActiveX control ACTIVEX CONTROLS FOR THE AUTOMOTIVE INDUSTRY RapidPLUS supports the Microsoft Windows CE for Automotive ActiveX controls Once installed on your computer these controls are listed among the available ActiveX objects ACTIVEX INCOMPATIBILITY 17 23 ACTIVEX INCOMPATIBILITY RapidPLUS as an ActiveX container conforms rigorously to Microsoft s Component Object Model COM conventions and requirements However you may come across ActiveX controls that are incompatible with RapidPLUS Symptoms of this incompatibility are displaying an error message when e Running the application in the Prototyper e Adding the control and it either does not appear or does not draw properly in the Object Layout e Clicking the Properties button in the object s More dialog box e Resizing or repositioning the object in the Object Layout To verify that the control is properly installed on your system try using it in other applications such as Microsoft Word In versions 5 6 6 of RapidPLUS each ActiveX control was identified by its control name which could be different between versions of the ActiveX control or in different languages This difference could cause a RapidPLUS application that was created on one system to fail to load on another system if the ActiveX on the sec
325. gistered 2 Add the ActiveX control to a container application as you would any other ActiveX control Registering RapidPLUS COM Libraries The RapidPLUS COM libraries RapidControl dll and RapidPLUSBridege dll both located in the Rapidxx folder are automatically registered during RapidPLUS installation If these components become unregistered for any reason you will need to register them again To register the RapidPLUS COM libraries e With the Windows tool regsvr32 exe use the following syntax at a command prompt regsvr32 path RapidControl dl1 path RapidPLUSBridge dll USING ACTIVEX CONTROLS 17 26 AppActiveXGen exe Command Line Options The complete command line syntax for AppActiveXGen exe is as follows AppActiveXGen exe path MyApp rpd ul e clsid p lt progid gt The path in the command cannot contain spaces and you can use a full path or a path that is relative to AppActiveXGen exe u Option Unregister This option is used to unregister a RapidPLUS ActiveX bridge control Example AppActiveXGen exe applics MyApp rpd u c CLSID Option This option specifies a class ID CLSID The CLSID is a globally unique identifier that enables the container to link to the embedded objects The CLSID is a 128 bit hexidecimal number enclosed in braces If left empty a new CLSID will be assigned automatically You can find the CLSID in the Windows Registry Editor at HKEY LOCAL MACHIN
326. h you can change e One font is used to display the modes in the Mode Tree the information in the Logic Palette and the application logic in the Logic Editor e The other font is used in all of the user editable fields To change the display font 1 Choose Options Fonts Change Font the Font dialog box opens 2 Select the desired font and style then click OK OBJECT LAYOUT 27 9 To change the edit font 1 Choose Options Fonts Change Edit Font the Font dialog box opens 2 Select the desired font and style then click OK To revert back to the default fonts e Choose Options Fonts Restore Default Fonts NOTE To save the fonts you set as the ones used each time you open RapidPLUS choose either Options Save Settings Now or Options Save Settings on Exit Saving Current Settings There are two Save Settings commands in the Options menu that save various system settings in the Rapidxx ini file These settings such as the RapidPLUS fonts the report editor tool tips enabled disabled and the RapidPLUS window sizes and locations become the system defaults To save system settings when RapidPLUS is exited e Choose Options Save Settings on Exit Settings are saved each time you exit RapidPLUS The saved settings become the system defaults the next time you open RapidPLUS To save system settings without exiting RapidPLUS e Choose Options Save Settings Now OBJECT LAYOUT Modification to the Rules for Naming O
327. he Debugger click the breakpoint buttons to set breakpoints at the selected mode s entry or exit e Inthe Mode Tree right click a mode name and choose Break on Entry Ctrl B or Break on Exit Ctrl K e In the Logic Editor click the gray selection button to the left of any logic line 3 Run the Prototyper It pauses automatically at a breakpoint The breakpoint button mode name and or logic line are highlighted 4 Use the Debugger stepping buttons to step through the application logic Additional options for debugging applications with the Debugger include e Making use of the Logger and the Call Stack panes e Opening Inspector windows to examine the contents of objects and the values of variables in the current state e Setting filters and other options in the Debug and Logging Options dialog box USING THE DEBUGGER TOOL el Ctrl G Ctrl Shift L 4 3 Opening the Debugger Toolbar With the Debugger toolbar you can control aspects of the Prototyper as well as the Logger and the Call Stack To open the Debugger e In the Application Manager choose View Debugger or click the Debugger button The Debugger toolbar opens Note that some buttons appear only when the Logger and Call Stack panes are showing alam o pm 9 Pesos NS IDA The toolbar buttons are described in the following table ITEM Ale Stepping buttons DESCRIPTION Used to run an application step by step e The first butto
328. he Filters dialog box 2 Choose Reports Left Application or Right Application The report opens in the Report Viewer To generate a differences report for one of the application s components 1 If necessary Modify the items selected in the Filters dialog box 2 Select an application component in either of the panes 3 Choose Reports Selected Application Component The report opens in the Report Viewer For details about using the Report Viewer see Working with Reports in the Report Viewer on p 25 3 COMPARING PROJECTS 3 11 COMPARING PROJECTS In the Project view you can see the comparison of project components and resources e g audio and graphic files You can also select individual components to be compared To compare projects e Click the Project tab riec Modes Objects User Functions Interface The comparison is based on each component s properties or more specifically their revision comments For a component comparison to be accurate the Log check box must be selected in each component s Application Properties dialog box This check box enables RapidPLUS to keep track of the component s revisions If this check box was not selected from the first time the component was created project comparisons will not be accurate however all the other comparisons modes objects etc will be accurate For details about the Log check box see Using the Application Properties Dialog Box on p
329. he RPD UDO file and the operation is complete If the signatures differ or there is no cache then the cache is deleted and RapidPLUS opens the application from the XML version The cache is also invalidated if there are errors when loading the XML file When the Use Cache When Opening XML Application check box is not selected the XML version is loaded Opening an XML Application File To open the application 1 Choose File Open 2 In the Open Application dialog box select the file and click Open CAUTION If errors are detected in the opening operation do not save the application Fix the errors and then reload When Errors are Detected in the Opening Operation When RapidPLUS detects errors while opening an RXD or UXO file the Logic Error View window opens displaying the XML errors There are three types of XML errors ERROR TYPE ICON DESCRIPTION Warning X Possible error that has no effect on the application behavior Error m Error that may affect the application behavior but the application can still be fully loaded Fatal error a Error that prevents the element it belongs to from being loaded The related object or logic will not be loaded and the application behavior will be affected OPENING APPLICATIONS IN XML FORMAT To correct an error 1 Select the line in the error list and click the Go To button or double click the line RapidPLUS opens the XML file in the default editor with the c
330. he Stop button will work All other Prototyper buttons as well as all RapidPLUS tools will not respond while the loop is being executed WRITING LOGIC USING LOOPS AND BRANCHES 7 18 CODE GENERATION Code that is generated for loops and branches uses the native construct of the target language thereby generating more efficient code The C code for If Else branches that use constant objects in their conditional statements can be optimized For details refer to the Generating Code for Embedded Systems manual 8 1 Find and Replace The Find and Replace feature enables you to search for and replace a string or substring in the application logic in triggers actions activities and user functions You can also search for logic references to a specific object or limit the search to specified logic categories This chapter presents e How to define a search string and set various search options e How to replace a string in all or some logic statements e How to focus a search on specified types of logic statements and or on statements that reference a specific object e Additional Find and Replace features e Usage examples NOTE This chapter replaces Chapter 14 Find and Replace of the Rapid User Manual FIND AND REPLACE To open the Find amp Replace dialog box do one of the following 8 e In the Logic Editor click the Find Replace button ds e Inthe Mode Tree or Logic Editor choose Edit Find Repl
331. he System group 15009 Arrow Cross IBeam Icon NoEntry NorthEast Southwe st S he t X North NorthWest size Start Up Wait South SouthEast SystemDate The SystemDate object contains the computer s real time date The format may be D M Y default or M D Y as specified in the Windows Control Panel The values of SystemDate can be assigned to the date object SystemTime The SystemTime object contains the computer s real time clock Either a 12 or 24 hour default clock is used as specified in the Windows Control Panel The values of SystemTime can be assigned to the time object 11 1 Constant Objects Constant objects are read only RapidPLUS data objects that is their size and values set in the Object Layout at design time cannot be changed by the logic during runtime There are five constant objects e Constant integer e Constant number e Constant string e Constant array e Constant set The primary use for constant objects is in the context of C code generation RapidPLUS CODE only Constant integers numbers strings and sets are generated as defines constant arrays are generated as consts By default they are generated in the application s h file but you can specify that they be generated in a separate h file in order to make them available to external applications This chapter presents e When to use constant objects e How to add constant objects in the Object Layout e How to du
332. he format dat i ae Ada gt tableName fieldName Remove Cancel Help Selected fields for the startup SQL query These fields can be renamed Available fields in the table The database shown above refers to a small Microsoft Access 97 database called Employees mdb that is on the RapidPLUS CD ROM Examples Objects DB This database is used as an example throughout the chapter It consists of the following tables and fields Departments Employees managerlD deptID employeelD managerName deptName employeeName anagerlD employeeRate phoneNumber date Tables and fields in the Employess mdb database Selecting Tables and Fields Database NOTE These instructions apply to databases other than Microsoft Excel databases See p 15 9 for instructions about working with Excel spreadsheets To select tables and fields for the startup SQL query 1 From the Table list select a table that the object will access 2 The Available Fields list displays all the fields of the selected table Choose the field or fields to be included in the application s startup query and click Add 3 Repeat Steps 1 and 2 for all tables and fields that you want to include in the startup query NOTE A database access object can only be linked to one database You cannot select tables and fields from two databases in a single database access object As you select tables and fields the object builds an SQL statement
333. hen selected only definition only structures Deletes the selected union structure or field and unions are displayed Opens a dialog box for importing a text file that contains structure definitions When selected data Opens a dialog box for editing the attributes of the selected structure attributes appear next to or field Unavailable if focus is on a definition only structure a union fields and union structures or a field that is part of a copied definition only structure ADDING MESSAGES TO A USER OBJECT 22 7 Adding Unions and Structures Adding Definition only Structures To add a definition only structure to the user object e Click Structure A structure is added to the user object with the default name Structurex where x is a number that increments with each structure added For details of how to add fields to the definition only structure see Adding Fields to a Structure on pp 22 9 to 22 12 To cause the definition only structure to generate as a union 1 Select the structure and click Edit the Substructure dialog box opens 2 Select the Generate as Union check box then click OK NOTE A definition only structure should be generated as a union only when the embedded system requires this type of message union To add a union to the user object e Click Union A union is added to the user object with the default name Unionx where x is a number that increments with each union added Addin
334. herefore should be avoided Syntax lt mode gt Internal Example On Internal 9 8 VERIFICATION TEST Objects OBJECTS NOT REFERENCED This check tests each object and issues a warning if an object is not referenced by any action activity or trigger Syntax lt object gt lt object gt Example Battery ind Idle lamp In the VER_TEST application his warning indicates that the objects Battery_ind and Idle_lamp are not referenced anywhere in the logic NOTE When performing the mode or object checks RapidPLUS occasionally discovers internal inconsistencies in the mode or object tree structure that may cause display problems In these cases RapidPLUS alerts you to the situation and requests permission to correct the problem which involves some restructuring of the tree 10 1 Nongraphic Objects Nongraphic objects are objects that do not have graphic representations on the layout but play important behind the scenes roles in a RapidPLUS application s behavior Examples of nongraphic objects are objects that measure time such as timers and stopwatches objects that hold data such as strings and integers and objects that produce sounds such as the sound object which generates a predefined sound and the WaveAudio object which plays WAV files The procedure for adding nongraphic objects to the Object Layout is the same for all of them however each object has its individu
335. hods such as DDE is that shared memory enables fast communication RapidPLUS provides a shared memory DLL rpd_mem dll which contains functions that open channels of communication between applications and manages the transfer of data In RapidPLUS rpd_mem dll is accessed through the Applink nongraphic object In an external application rpd_mem dll is accessed by calling its functions RAPID APPLICATION EXTERNAL APPLICATION a Applink object gt y rpd_mem dll DLL FUNCTIONS openChannel Neo gt sendData getData closeChannel etc i How data is exchanged via shared memory This chapter presents e How to define the Applink object so that it sends and receives data e How to use rpd_mem dll in an external application APPLINK OBJECT 16 2 g5 peo ADDING AN APPLINK OBJECT IN THE OBJECT LAYOUT To add an Applink object 1 The Applink object is located in the Communications class Select it from either the Object Palette or the New Objects list The Applink dialog box opens Click More to set the object s mode of data transmission E Queued Overwrite Cancel Queue Size 100 Mode of Transmission Queued vs Overwrite Data transmitted from either application is sent to rpd_mem dll In Queued mode all sent messages are stored in a queue in rpd_mem dll The messages are read in the order in which they en
336. ia File Import bitmap a primitive object edited in the Object Editor or a bitmap created in the Object Editor via File New Object BITMAP OBJECT 13 3 The Image Management and Clip options are OPTION Embed in Rapid format DESCRIPTION The default option The image is embedded in the application in a native RapidPLUS format Embed in original format The image is embedded in the application in its original format NOTE This option is useful for saving space in the application file If you import and embed a PNG image for example it is stored in the compact PNG format and not the BMP format normally used by RapidPLUS Link to file The image is external to the application and is loaded dynamically at runtime The image retains its name in the dialog box NOTES If distributing the application you must package the image file If you do not specify an image file path RapidPLUS searches in the usual directories see Appendix A A runtime error occurs if the file is not found Clip When not selected the image resizes with the object When selected if the object is made smaller the image is clipped at the opposite ends from its 0 0 coordinates NOTE To change an image from embedded to linked or from linked to embedded you must first re import it Performance considerations Linking an image to file may slow down an application s runtime performance An image that is embedded
337. ic Error View window PASTING ELEMENTS INTO AN APPLICATION l Ctrl V 6 13 Pasting Modes in the Mode Tree 1 In the source application cut or copy the desired mode s 2 Inthe target application select the mode you want to be the parent of the paste mode and choose Tree Paste or click Paste Mode To complete the paste operation RapidPLUS 1 Checks for a duplicate RapidPLUS checks that there is no other mode EXPLANATION child mode in the target subtree with the same name as the pasted mode If there is a duplicate mode the Paste Conflicts dialog box opens For details about using the dialog box see Resolving Duplicate Element Conflicts on p 6 15 Checks if there are duplicate objects and or user functions for related elements RapidPLUS checks that none of the objects or user functions related to the pasted mode has a conflict with objects or user functions currently in the target application If there is a conflict the Paste Conflicts Duplicate Elements Referenced by Pasted Logic dialog box opens For details about using the dialog box see Resolving Duplicate Element Conflicts on p 6 15 3 Tries to reconstruct outgoing external transitions if any If there is no mode in the target application with the same name as the transition s destination mode the transition is commented out in the Logic Editor see Step 6 below If there is one matching mode the
338. ic display will be used to display supporting objects text add one or more font objects see Font Object on p 13 11 If the graphic display will be used to display images add one or more bitmap image objects see Bitmap Object on p 13 2 and Image Object on p 13 4 Define logic to display For an image to appear on the display its name images and location on the display must be specified The drawBitmap atx y and drawBitmap atx y transparentColor functions are used with bitmap image objects to position images see Displaying Images on p 12 25 THE BASICS OF USING GRAPHIC DISPLAYS STEP Define logic to display text 12 3 DESCRIPTION For text to appear on the display two things must be specified the font s that will be used and the position where the text will start The fontSet function is used in conjunction with font objects to specify the display s font see Specifying a Font Using a Font Object on p 12 21 The drawText atx y and draw TransparentText atx y functions are used to position text see Displaying Text on p 12 21 Define logic to display shapes The following elements can be drawn on a display filled and empty rectangles filled and empty circles and ellipses lines and arcs The functions used to draw these elements are discussed on pp 12 26 to 12 31 Define logic to change display colors During runtime the following colors c
339. ic line and choose Unmark for Export or In the Mode Tree window In the Logic Editor window 1 Select the mode 1 Select the logic lines 2 Choose Tree Unmark for Export 2 Choose Edit Unmark for Export Marking and unmarking logic lines for export Marking a mode for export automatically marks all of its child modes as well all the logic lines of the marked modes except for triggers and actions of internal transitions will be exported to Excel To refine your mode marking you will have to unmark and re mark lower branches of the mode tree Note that the blue marked for export indicator is visible only in the Logic Editor window To control export at the level of individual logic lines use the Logic Editor window rather than the Mode Tree window Select the desired logic lines then mark or unmark them for export Note that marking or unmarking a logic line that is part of a logic block automatically applies to all the lines in the block 24 1 Exporting State Charts to Visio The State Chart tool provides a graphical view of an application s logical structure and flow It shows the application s mode hierarchy and the transitions from one mode to another State charts can be exported to Microsoft Visio Visio 5 or higher Each exported chart follows the UML conventions for state charts In addition to modes and transitions the application s logic can be included in the exported chart Exporting the state
340. icking the New Line button or pressing Enter The next logic line is selected and is automatically indented for the body of the If branch fi Pushbutton is in A sample If header To define an If block 1 Build an activity then accept it by either clicking the New Line button or pressing Enter The next line is selected and is indented exactly like the previous line 2 Continue adding activities until the While block is complete To end an If block Click the New Line button twice or press enter twice See Ways to end an activity block on p 7 5 Defining an If Else Branch An If else branch can be used in entry exit activities actions and user function activities To define an If else branch 1 Build the If header and block by performing the steps in Defining an If Branch above You do not need to end the block In the Logic Palette click the else button You can also type the keyword else in the edit line The indentation is decreased to align else with if else is appended to the Logic Editor s edit line Build the Else block WRITING LOGIC USING LOOPS AND BRANCHES 7 14 4 End the Else block by clicking the New Line button twice or pressing Enter twice entry Jif Integer gt 1 Timer1 start Lampl blink else Timerl stop made A sample if else branch Defining If Else If Nested Branches You use If else if branches when you
341. id Simulator each time an exported property s value changes That is every time an exported property s value changes the event handler for the ApplicationPropertyChanged event is called To choose automatic notification 1 Open the Rapid Simulator Properties dialog box CBT tab 2 Select the Notify on application property change check box ji Properties Select to automatically notify the Rapid Simulator object when an exported property s value changes GETTING DATA INITIATED BY THE RAPIDPLUS SIMULATION 18 17 Example of Getting Data Initiated by the RapidPLUS Simulation This example shows how to enable the host document to get data from a Rapid Simulator It is based on a Rapid Simulator that is embedded in a Word document Microsoft Word Sample doc F File Edit View Insert Format Tools Table Window Help Osa Ba gt 20 OB Normal gt Times New Roman 10 sl B ZU ARETES 1 gt tee ERE Re at us All of the simulation s logic is internal that is no exported properties or exported events were used The following mode activities were used to display the rotary potentiometer s value on the round dial indicator and text display Indicator1 reading Potentiometer1 value Display1 contents Potentiometer1 value The host document can display the RapidPLUS simulation in runtime but cannot read the indicator s value H
342. idPLUS If you are a designer of embedded systems you can ensure color matching with the target graphic display device Just set the palette of the graphics tool to match the colors of the graphic device in your embedded system then import this palette into the graphic display dialog box To import an external palette 1 In the Graphic Display dialog box click the Read button located in the External palette group the Select Palette dialog box opens 2 Select a palette file and click OK The default palette is replaced by the selected external palette NOTE The number of colors in the external palette determines the number of colors in the graphic display Therefore when you import an external palette the number of colors in the Graphic Display dialog box is automatically adjusted to match the number of colors in the imported palette Externally created palette files Externally created palettes must have the PAL file format and the color format must be RGB To write a palette file use the following example that shows a 16 color file Each color line lines 4 through 19 consists of three values R ed G reen and B lue respectively that together represent a single color The first two lines are the file header and version When used in RapidPLUS these two lines can be omitted When used in a graphics tool the first two lines must be compatible with that tool In the example the first two lines are compatible with a Pa
343. ies of the associated constant set object The supported functions for these read only properties are the same as for a constant integer object NOTE There are no functions for the self property of the constant set object Examples Assume that we have defined two constant objects e A simple constant integer object named MY_MESSAGE with a value of 3 e A constant set object named MESSAGE_TYPE with the following constant integer items CONSTANT NAME CONSTANT VALUE MESSAGE_FROM_TASK1 0 MESSAGE_FROM_TASK2 3 MESSAGE_FROM_TASK3 4 GENERATING CONSTANT OBJECTS 11 9 Also assume that we have defined a non constant RapidPLUS integer object named Count You could use the constant objects in conditions as follows Count MESSAGE_TYPE MESSAGE_FROM_TASK1 or Count MY_MESSAGE You could also use them to assign their value to another read write RapidPLUS object in actions or activities as shown below Count MESSAGE_TYPE MESSAGE_FROM_TASK3 Count MY_MESSAGE NOTE In the application logic you can use the Find and Replace utility to replace constant objects with variable objects of the same type and vice versa For detailed instructions about the Find and Replace utility refer to Chapter 8 Find and Replace GENERATING CONSTANT OBJECTS When you generate C code for your application the following definitions are generated from the constant objects define constant integer constant numbe
344. ike any other native RapidPLUS object To register ActiveX controls in the Object Palette 1 Choose Objects Register the Register dialog box opens ADDING OR REGISTERING ACTIVEX CONTROLS IN RAPIDPLUS List of installed ActiveX controls List of ActiveX controls already not yet registered in RapidPLUS registered or to be registered in RapidPLUS Register User External and ActiveX Objects Available Registered External Objects ADI RPX ADI2 RPX DBACCESS RPX DIAMTXT RPX External Objects ANIMATON RPX BARDIAL RPX COMMLINK RPX JOYSTICK APX Add gt gt Ht DYNAMENU RPX ENVOY RPX ActiveX Objects Acrobat Control for Active ActiveMovie Control Object OBJLIBMM RPx POINTER RPX SECDIAL RPX ActiveX Objects Calendar Control Microsoft Forms 2 0 CheckBox 2 In the Available list select the ActiveX control you want to register and click Add Repeat this step for all the ActiveX controls you want to register 3 Click OK the Object Palette is updated RapidPLUS adds the ActiveX objects class icon to the left column if it does not yet exist and the control s icon to the right column If a control does not have an icon of its own RapidPLUS uses a default icon Why doesn t an ActiveX control appear in the list If an ActiveX control name does not appear in the Add ActiveX or Register User External and ActiveX Objects dialog boxes then the control is not registered in the system registry To manually reg
345. ile to the application folder if it is not already located there e TIP To assist in your understanding of the RapidPLUS schema file see the annotated version RapidXML html which is located in the RapidxxX XML folder 3 1 Comparing Applications in the Differencing Tool The Differencing Tool is used to compare the objects modes user objects and exported interfaces of applications and the components of projects It is particularly useful for comparing two versions of the same application or project The ability to compare applications and projects is especially useful when several people work on them The Differencing Tool window is divided into two vertical panes one for each application project The applications are opened in read only view in a hierarchical tree format with more specific information presented below the tree This format enables you to easily compare the similarities and differences between the applications You can copy sections from either of the panes and then paste them into a RapidPLUS application You can also generate a Differences report about the comparison The Differencing Tool can stay open while you work on the currently active application although not in Always on Top mode This chapter presents e An explanation of the Differencing Tool e How to select applications projects for comparison e How to navigate among the differences and matches e What you see when you c
346. iles are RPD and UDO files that were generated to XML format This chapter presents e What happens during the automatic interface update and logic reverification e How to switch among project components e How to edit project components within the parent application e How to replace and rename user objects in a project e How to apply various operations to an entire project 1 2 MANAGING PROJECTS e How to use the Properties option to keep track of changes in the application e How to add notes to modes and objects e The RapidPLUS search path e How to implement team development and version control using XML application files RXD and UXO files SWITCHING AMONG PROJECT COMPONENTS The Project Components list in the Application Manager window shows all the applications in the project hierarchically The main application is first on the list Itis followed by all the user objects in alphabetical order If a user object contains other user objects they are listed alphabetically under it You can manually switch among the components of a project in order to e Edit the selected component e Set debug breakpoints e Open object inspectors e View the mode tree of the selected component when running the prototyper with the trace option enabled e Add linked items from any user object to the parent application s document layout in the Document Manager window To view the Project Components list e In the Applic
347. imulation descriptive name for the application designer logged in user name company name of the company comment link to the external file Commento via the SRC attribute The text of the comments is contained in the Commento file Application Object Elements In this section the first table presents the main element tags used for RapidPLUS objects The subsequent tables present nested tags that provide specific information about each object TAG DESCRIPTION RPTopPanel Tag for the root graphic object RPGraphicWrapper Generic tag for graphic objects that were developed as external objects RPX Examples of such graphic objects are the lamp indicator and switch objects RPNonGraphic Generic tag for nongraphic objects that were Wrapper developed as external objects RPX Examples of such nongraphic objects are the Applink object the Commilink object and all of the multimedia objects UDOGraphic Generic tags for user objects Wrapper UDONon GraphicWrapper RP lt object name gt Tag for primitive objects system objects and some nongraphic objects For example RPInFrame RPSystemTime and RPTimer XML REPORTS TAG RPBitmapObject RPImageObject 25 27 DESCRIPTION Tags for bitmap and image objects When the object s image file is embedded a corresponding graphic file is created using the object s name and is placed in the folder with the XML report A nested tag defaultImage SRC
348. in an array field The resulting array of structures can itself be used as a definition only structure Why place a structure in an array 1 Because doing so reduces the need to duplicate identical structures 2 If the application is generated to code the resulting code is simplified In the user object shown below there is a union that contains nine identical structures These structures contain information about the nine most frequent calls As you can see the building of this union required a lot of repetitive work User Object Messages roc_pref x Properties Events Messages Functions Name Structure Accept Union e CallList_Struct Structure allList Se s Add Field String Time g String String D g CallList_Struct Structure Integer String Phone_Num_String String Time_String NIUE String Date_String y rrr CallList_Struct Structure3 String Phone String Anay gL 4 Existing Struct New Struct Q Copy ie a Paste m Show Data Type Delete Show Top Level Only Import USING THE USER OBJECT MESSAGE LOGIC 22 15 When this union is generated to code the generated interface looks like typedef struct tROC_PREF_R11368 CallList ROC_PREF_R4395_CallList_ Struct cSF_R12594 Structurel ROC PREF R4395 CallList Struct cSF_R3727 Structure2 ROC PREF R4395 CallList Struct cSF_R11244 Structure3 ROC PREF R4395 CallList Struct cSF_R2377_S
349. in its original format must be converted to the native RapidPLUS format when the Prototyper is started Once converted however the bitmap performs just like a bitmap embedded in the native RapidPLUS format Performance is also affected by the file type JPEG files for example take longer to render than PNG files BITMAP IMAGE AND FONT OBJECTS 13 4 IMAGE OBJECT An image object is similar to a bitmap object with expanded manipulation options The image object supports the following features e A wide range of image formats BMP DIB PNG JPG ICO MSP PCX PSD e Importing during design time an image by specifying a file e Choice between image embedding and image linking e Image clipping e Choice of modes for processing runtime manipulations e Manipulation of the object during runtime including replacing the specified file repositioning resizing or clipping the object adjusting its RGB values flipping rotating inverting or mirroring it and adjusting brightness and contrast In the Object Palette the bitmap object is located in the Bitmap objects class A bitmap object s default size is 30 x 30 pixels Its dialog box is used to select and manage an image file Upper section of the Image dialog box Image Imagel x Name of the image Image file file to be loaded Selected by either typing the file name and path or browsing to the file Cancel Image management _ Browse to the desired file
350. in one mode and then use the event to trigger a transition in a concurrent mode The event object is the only nongraphic object that does not have an additional dialog box When you add an event the More button is disabled SIGNAL OBJECTS 10 39 cp Sound The sound object generates sound at a specified frequency either continuously or intermittently Sound Soundi x Frequency Hz fem Duration ms frooo Cancel L Modulated TA Period ms 500 Duty cycle 2 lso o Help OPTION DESCRIPTION DEFAULT Frequency Sets the object s frequency 500 Range 37 20 000 Hz Duration Sets the total time in milliseconds that 1000 msec the object is on Modulated When selected the sound is produced Not selected intermittently Period sets the length of the modulation cycle in milliseconds Duty cycle sets the percentage of the modulation cycle in which the sound is emitted Example If you have a duration of 1 000 ms a modulation period of 500 ms and a duty cycle of 50 the object sounds for 250 ms is silent for 250 ms then sounds for 250 ms then is silent for 250 ms after which time the object is inactive NOTE From RapidPLUS 6 0 on the sound object uses the computer s sound card not the internal computer speakers therefore sounds developed in earlier versions will sound differently NONGRAPHIC OBJECTS 10 40 KA 8 UserCursor The UserCursor object
351. in the definition only structure Calls will be automatically carried over to the nested structure myCall which has been added as a field to the structure outgoing Calls For example if you change the name of the string field number to myNumber in Calls the change is automatically propagated to the same field in myCall Note that when you select a field of a nested structure the Edit and Delete buttons become unavailable You cannot directly edit or delete a field of a nested structure You must always go back to the original definition only structure and make the changes there The changes are then propagated to all other instances of that definition only structure ADDING MESSAGES TO A USER OBJECT 22 13 Deleting a Field Structure or Union To delete a field structure or union e Select the item and click Delete You are asked to confirm the delete operation NOTE If you are deleting a definition only structure all instances of the item are deleted Changing the Order of Unions Structures and Fields Use Alt 4 up arrow or Alt down arrow to move the selected union structure or field up or down among its siblings in the list In other words you can change the field order within a structure the structure order within a union and the union order within the user object but you cannot for example move a field out of one structure and into another Thus if the focus
352. ing it Registering it and then adding it like any other object When you register a user object it is added to the Object Palette and New Objects dialog box Adding an ActiveX Control Adding an ActiveX control without registering it means that it is added to the application s layout but not to the Object Palette To add an ActiveX control 1 Choose Objects Add ActiveX A dialog box opens with a list of all ActiveX controls currently installed on your computer Select a control from the list and click OK If the control is graphic you place it on the work area as you would any RapidPLUS graphic object If the control is nongraphic it is added to the Nongraphic Objects dialog box NOTES RapidPLUS checks that the selected control is a valid ActiveX control before adding it to the layout For example it s possible that the control appears in the Windows registry but its executable file is no longer located in the expected path In such cases you are notified that the control is invalid and cannot be added Due to the design of the control itself a nongraphic control such as a timer might have a graphic representation in the Object Layout At runtime in the Prototyper however the control will not be visible Registering an ActiveX Control in RapidPLUS Registering an ActiveX control in RapidPLUS adds it to the Object Palette and New Objects dialog box Each time you open RapidPLUS the ActiveX control is available l
353. ing the data Syntax Keypad Calls_union OutgoingCall send USING THE USER OBJECT MESSAGE LOGIC 22 19 FUNCTION PROPERTY EVENT COMMENTS messageReceived This event is generated whenever the send function is called the user object sending to the application triggers the event in the application and vice versa Syntax in user object Keypad Calls_union OutgoingCall messageReceived Syntax in application Keypad_UDO Calls_union OutgoingCall messageReceived is active This condition is true under the following conditions is active TRUE is active FALSE a messageReceived deactivateAny event is triggered function is called or or value assignment to value assignment to structure field another structure field For Any Field of a Union Structure FUNCTION PROPERTY COMMENTS EVENT Any union All functions appropriate to the field or array element structure type with the following exceptions field Integer and number changeBy resetValue String append changeASCIIBy at clear deleteCharAt deleteFrom to insert at resetValue String field element clear USER OBJECTS WITH MESSAGES 22 20 Using Arrays of Structures in Logic The array of structures is nested under its structure in the Logic Palette EA Mode Activity Object Property Function hide Marketing_department show System ASCII Employees Keyboard Array Mouse Aray1 SystemCursor Employee_n
354. ink1 open Name_List NOTES If your application contains more than one Applink object each object s channel must have a unique name However if you are using Applink objects that will communicate with each other they can use the same channel name As stated above an application can contain two Applink objects that communicate with each other via one channel However if you try to open this application in a second RapidPLUS window while it is open in the first RapidPLUS window an error will occur in the second RapidPLUS To close a channel e Use the close function For example Applink1 close APPLINK OBJECT 16 4 Sending Data To send data to the external application e Use the sendData lt string gt id function where lt string gt is a RapidPLUS string any string object or property that accepts string values lt id gt is an integer that identifies the type of data being sent The integer value for this parameter is set by you and the person writing the outside application For example if you are sending data to include in an employee list parameters such as name address phone number you would assign ID numbers to each parameter such as name 1 address 2 phone number 3 In the examples above the ID for the name is 1 If you do not want to designate the data type use a zero for the id parameter For example sendData 07 09 91 id 0 Using Constant Set Objects
355. inputBufferEmpty returns FALSE if there is a byte in the input buffer To send a byte to the output buffer e Use the setOutputByte lt integer gt function as follows Commlink1 setOutputByte 75 The specified integer is sent to the output buffer NOTE There is no connection between this function and the functions that handle input by byte THREE SEGMENT POINTER e 26 19 THREE SEGMENT POINTER A three segment pointer type has been added to the user pointer object During runtime the middle segment of the pointer can be offset from the object s rotation axis In the Object Layout two range fields are added to the More dialog box when 3 segment is the selected pointer style Readings Seale Angles Start 0 00 Start e deg 7 ance End 100 00 End deg Redraw Initial 0 00 4 Show Center J Antialiasing Help p Appearance Offset 50 pxl Width 20 pxl Cross Size 6 pxl Ratio 50 During runtime the deviation property can be used to change the pointer s middle segment position independently of the other two segments The range values are used to calculate the mid segment s ratio of deviation in relation to the object s radius The permissible range values are left range object radius to O right range 0 to object radius LEFT RIGHT deviation range OBJECT ENHANCEMENTS 26 20 NOTE Although you are permitted to enter a r
356. int Shop Pro palette file JASC PAL Header 0100 Version 16 Number of colors 000 First color 128 0 0 0 128 0 128 128 0 0 0 128 12 11 12 12 GRAPHIC DISPLAYS 128 0 128 0 128 128 192 192 192 128 128 128 255 0 0 0 255 0 255 255 0 0 0 255 255 0 255 0 255 255 255 255 255 Last color Defining Buffers Buffers are temporary storage areas that store display elements The popup message in this sample graphic display is stored in a buffer Every graphic display has a main buffer the size of the graphic display itself This main buffer is called the intermediate buffer Each element to be displayed on the graphic display is first placed on the intermediate buffer The intermediate buffer is an inherent property of each graphic display and is not included in the number of buffers in the dialog box A zero 0 setting in the Number of buffers box means that there are no buffers other than the intermediate buffer To define additional buffers 1 Open the Graphic Display True Color Graphic Display dialog box 2 Inthe Number of Buffers box enter a number By default each additional buffer is a matrix of pixels of the same size as the graphic display To add edit and remove buffers 1 Click the Advanced button to open the object s Advanced dialog box CONNECTING AN EXTERNAL DLL TO A GRAPHIC DISPLAY 12 13 For the true color graphic display click the Buffers tab Both types of
357. int dialog box opens when you add or edit a point object Point Point1 x X Value 0 0 Y Value 0 0 Cancel ai Help The dialog box is used to assign or edit a point object s initial values It also opens when you define a point property for an active primitive object or a user property for a user defined object Example A dynamic circle Circle1 is located at 10 10 and the value of Point is 20 20 If you build the entry activity Circle1 position Point1 the circle will appear at 20 20 each time the application enters that mode NONGRAPHIC OBJECTS 10 30 Advanced C Code Generation Options Applies to RapidPLUS CODE only The sizes of string data store and one and two dimensional array objects can change during runtime You can specify the maximum sizes of these data objects as part of the application design The sizes are specified globally for all of these objects but these sizes can be changed for individual objects in their Advanced dialog boxes In the context of code generation RAM must be allocated for these generated objects at the startup of the embedded system Specifying their maximum sizes helps optimize these RAM allocations Also setting an integer object to be generated as a primitive data type can contribute to RAM optimization Global Size Definitions By default RapidPLUS assigns the following maximum default sizes e Strings 32 752 bytes equivalent to 16 376 character
358. inued in a backwards direction The flowchart on the following page illustrates how this function would work after a forward search within specified from to limits ONE DIMENSIONAL ARRAYS int_Arr 1 str_Arr searchFor Jim from 5 to str_Arr size Y Searches forward for Jim from array element 5 ind Jim by last element 2 Returns 0 ind Jim by element 5 yr Returns index of array element let s say 8 Y int_Arr 2 str_Arr searchNextBackward Y Searches backwards for Jim from array element 8 Returns 0 int_Arr 3 str_Arr searchNextBackward The result has to be negative since we already searched forward from 5 Y Searches backwards for Jim from last array element Note that calling the function a second time continues the backwards search without regard for any previously specified search limits OBJECT ENHANCEMENTS 26 4 DATA STORES AND ARRAYS Reading Unicode Strings The RapidPLUS file formats for arrays RAR and data stores RDS have been modified to allow the storage of Unicode strings Unicode strings are identified by the character L before the string such as L he 110 RapidPLUS translates these strings from Unicode into the Windows native character set If the translation fails an empty string is as
359. ion ii If the result is true the While block is performed iii If the result is false the loop is terminated iv Step a is repeated EXECUTION OF LOOPS AND BRANCHES 7 17 Execution of For Loops for lt Integer lt local counter name gt gt from lt start value gt to lt end value gt step lt integer gt for lt Integer lt local counter name gt gt from lt start value gt downTo lt end value gt step lt integer gt A For loop is executed as follows i RapidPLUS evaluates the start value ii RapidPLUS assigns the start value to the counter variable iii If the counter is greater than the end value the loop is terminated In downTo loops if counter is less than end value the loop is terminated iv The For block is executed v RapidPLUS increments the counter by step In downTo loops RapidPLUS decrements the counter by step vi Steps c d and e are repeated until the loop terminates NOTE The step start value and end value can be expressions If so the step and end values are re evaluated on each cycle Execution of If Else Branches if lt Condition gt else An If else branch is executed as follows i RapidPLUS evaluates the If condition ii If the result is true the If block is performed iii If the result is false the Else block is performed Running Loops in the Prototyper If the Debugger is not open and the logic contains a long or infinite loop only t
360. ion Property function called Rapid application Exported b New value e sent to Rapid o e i In the host document s programming language the SetApplication Property lt property name gt lt value gt method sets the exported property s value in the RapidPLUS simulation ii Through an internal mechanism the Rapid Simulator sends the value to the RapidPLUS application Procedure for Sending Data 1 Add an exported property or exported event to the RapidPLUS application For details about adding exported properties and events refer to Chapter 19 of the Rapid User Manual Adding User Properties p 19 6 Examples e An exported number integer or string property could hold the value that the host document will send HOSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS 18 20 e An exported event could be used to trigger a lamp on and off 2 In the host document add another ActiveX control whose value will be sent to the simulation Examples e A Scroll Bar control object could be used to control the value sent to the exported number property e A Button control object could be used to trigger an exported event 3 In the host document s programming language use methods and events to send data Examples e The SetApplicationProperty method could set the exported property s value RapidSiml SetApplicationProperty lt property na
361. ionBegin and empties the buffer e transactionRollback discards all changes made since the last call to transactionBegin and empties the buffer A runtime error occurs if you try to call transactionBegin if the previous transaction was not terminated by either transactionCommit or transactionRollback In the same way a runtime error occurs if you call either transactionCommit or transactionRollback without a matching transactionBegin function NOTE To confirm that your database supports transactions use the has transactions condition For detailed information on transaction procedures you should consult the documentation of your ODBC driver For example the Microsoft Access driver requires you to call transactionBegin before running the query In this case therefore you would have to clear the Query at startup check box in the Advanced tab and call transactionBegin before calling runQuery DEFINING THE LOGIC 15 13 Modifying Queries Dynamically There are two ways in which you can modify the SQL query statement dynamically e Modifying the dbSQL dbFilter and or dbSort properties e Setting parameterized values for the statement s WHERE clause Modifying the dbSQL dbFilter and or dbSort Properties The database access object s dbSQL property holds the SQL statement used to query the database The SQL statement at startup is the one that was built via the object s dialog box If the Query at startup che
362. ions Help xlejejo o Aa DRA 2 130 el rr aaa Integer lt Integer_Array_2D an rray gt D Expor Answers the maximum of a two dimensional array of positive integers declare lt Integer tempMax gt lt tempMax gt 0 for lt Integer i gt from 1 to lt anArray gt getNumberOfRows step 1 for lt Integer j gt from 1 to lt anArray gt getNumberOfColumns step 1 if lt anArray lt i gt lt p gt gt lt tempMax gt return lt tempMax gt The Prototyper is paused at the second breakpoint after several cycles In the Logic Palette notice that the user function arguments and local variables are listed in the Object column together with their current values Look at the first user function argument anArray This argument is a Rapid ADDITIONAL RAPIDPLUS ENHANCEMENTS 27 24 PLUS object and it can be inspected with an Inspector window To do so right click anArray and choose Inspect After the Inspector window is opened it will not necessarily show the value of the user function argument in successive calls to that function but rather it will keep showing the same object for which it was opened For information about Inspector windows see The Inspector Window on p 4 27 OBJECT EDITOR Cursor Coordinates Status Box The cursor coordinates status box displays information about shapes as they are drawn on an object Information displayed includes the shape s beginning and ending coordin
363. is no exported properties or exported events were used The following activities were used in On mode to power on the lamp and rotary potentiometer Entry activity Lamp1 on Mode activity Indicator1 reading Potentiometer1 value The host document can display the RapidPLUS simulation in runtime but cannot read the indicator s value or the lamp s state GETTING DATA INITIATED BY THE HOST DOCUMENT 18 13 Setup for getting data from the RapidPLUS simulation In the RapidPLUS application e In the Object Layout two exported properties are added a number property called DialReading and a string property called LampState e In the Logic Editor two activities are added Entry activity App LampState On Mode activity App DialReading Indicator1 reading In the Rapid Simulator By default the Notify on application property change check box is selected In the host document e Two Label control objects are added to the document that will display the values of LampState and DialReading e The following script is added in Visual Basic Private Sub ReadingLabell Click Called when user clicks on the Dial label Update label value ReadingLabell Caption RapidSiml GetApplicationProperty DialReading End Sub In the RapidPLUS simulation as the potentiometer value changes so does the dial reading In the host document each time the Dial label is clicked the Rapid Simulator
364. ister an ActiveX control in the system registry 1 From the Windows Start menu select Run 2 In the Open edit box type regsvr32 lt full path to the ActiveX file gt For example regsvr32 c ActiveX_controls myActiveX ocx You should get a message confirming successful registration If you get an error message there is a problem with the ActiveX control NOTE To unregister an ActiveX control type regsvr32 u lt full path gt To get a full description of regsvr32 switches type regsvr32 without any parameters 17 3 USING ACTIVEX CONTROLS 17 4 Distributing RapidPLUS Applications with ActiveX Controls If you are packaging your application for distribution do not forget to include all required control files usually OCX or DLL and instruct the end user to copy the file s anywhere in the RapidPLUS search path as explained in Defining a Search Path on p 1 14 The first time the application is opened in the Reviewer the ActiveX control s are automatically registered NOTES Just in case a problem arises with automatic registration of an ActiveX control you may also want to give the end user instructions on manual registration via the Windows regsvr32 utility as described in Why doesn t an ActiveX control appear in the list above RapidPLUS is tested on all the current Windows versions and RapidPLUS simulations can be moved from computer to computer without problem However third party ActiveX
365. ither Selected Application or Main Application and User Objects A subfolder for the application and each user object is added to the folder that contains the application Each new subfolder contains An XML file named lt application name gt xml e Files for images that are embedded in the application The names for these graphic files are based on the names of the bitmap image objects that hold the embedded images For example if an image object named Logo contains an embedded image file with a JPG format the generated file will be named Logo0 jpg e A file named Comment0O which contains the comments that appear in the Application Properties dialog box The graphic and Commento files are referenced in the XML code in tags that contain an attribute named SRC For example lt _defaultImage SRC Bitmap20 bmp TYPE bmp SIZE 41800 gt IMPORTANT Because the XML reports are generated from internal RapidPLUS code the information in the reports is likely to change from version to version of RapidPLUS GENERATING REPORTS 25 24 Understanding the XML Reports When XML code is generated from a RapidPLUS application an XML file is produced comprising a tree of nodes The top most node the root node is lt Rapid gt The first level of element nodes present high level information about the RapidPLUS application and its objects modes and logic Each of these elements contains the followin
366. ithout first setting priorities See the example below based on a data store object Example The diagram below shows how a five record data store object with three integer fields is sorted according to the following sequence of activities DS1 Fld1 setAscendingPriority 1 DS1 Fld3 setDescendingPriority 2 DS1 Fld2 setDescendingPriority 3 DS1 sort In other words 1 First priority is given to Fld1 so first all the records are sorted by ascending values of Fld1 The three records that have the value 3 are sorted randomly 2 Second priority is given to Fld3 thus the three records that have the same value for Fld1 are now sorted by descending values of Fld3 3 Third priority is given to Fld2 thus the two records that have the same value for Fld1 and Fld3 are now sorted by descending values of Fld2 Fld1 Fld2 Fld3 3 7 1 DS1 Fld1 setAscendingPriority 1 oO Fa 6 N N N SS a AN N N N 7 N w DS1 Fld2 2 setDescendingPriority 3 Ns NAAN a mi N N Su 1 A I N KN X A x 1 2 6 1 2 6 1 2 6 7 3 4 1 GA 2 7 3 2 7 4 A TA 14 Y 312 111 41 34 TIA AL ZZ 77 A 3 7 1 3 4 7 1 y 3 A 4 7 VSL DO LL 6 1 2 6 1 2 6 1 2 SA x Si DS1 Fld3 lt a A A setDescendingPriority 2 Sofas JON N e 26 8 OBJECT ENHANCEMENTS TWO DIMENSION
367. iveXGen exe 1 lt RapidPLUS Bridge Utility gt RapidPLUS RapidPLUS App1 Bridge App2 Bridge Class Class RapidPLUSBridge dll ActiveX Server Component e RapidPLUS Applications as ActiveX Controls RapidPLUS App3 Bridge Class RapidPLUS Reviewer Plug in COM Libraries RAPIDPLUS ACTIVEX BRIDGE UTILITY O The RapidPLUS bridge utility AppActiveXGen exe generates a registered bridge class RapidPLUS_ lt AppName gt _Bridge tlb in the same folder as the RapidPLUS application O The ActiveX server component RapidPLUSBridge dll is a registered ActiveX control registered during RapidPLUS installation This component uses the type information to expose the application functionality as an ActiveX control to the container application RapidPLUSBridge dll opens communication with the RapidPLUS Reviewer plug in for each instance of the ActiveX control Generating a RapidPLUS ActiveX Control To generate a RapidPLUS ActiveX control 1 Ata command prompt run AppActiveXGen exe located in the main Rapidxx folder using the following syntax AppActiveXGen exe pathlMyApp rpd c CLSID p ProgID NOTE Details about the class ID CLSID and programmatic identifier ProgID are in the following section AppActiveXGen exe Command Line Options A RapidPLUS application bridge class is generated and the ActiveX control is re
368. ject Layout 19 3 BeanInfo class 19 12 check running status 19 13 data types supported 19 7 debugging 19 18 distributing 19 20 events in RapidPLUS 19 11 implementing recordable events 19 14 Java code generation 19 20 methods in RapidPLUS 19 10 overview 19 1 properties in RapidPLUS 19 9 registering 19 4 search path 19 2 Index 7 K keyboard object 10 42 L language object 10 43 to 10 45 LastUserActionEvent property 18 35 LastUserActionId property 18 35 LastUserActionObject property 18 35 LastUserActionProperty property 18 35 LastUserActionTime property 18 35 leftAlign 26 22 Librarian 6 18 linking bitmap objects 13 3 LoadRecorderFile method 18 38 LoadState method 18 33 LoadStateFile method 18 38 local variables declaring 27 16 to 27 18 in For loops 7 8 viewing values during runtime 27 23 localization See multi lingual support Log check box in Application properties dialog box 1 12 1 19 3 11 log files working with 4 21 to 4 22 log pane See Debugger log pane Logger enabling and viewing 4 10 to 4 12 filter options 4 19 finding strings in 4 22 icons 4 13 to 4 16 jump to Logic Editor 4 22 log files 4 21 to 4 22 logging user objects and modes 4 19 to 4 21 menu 4 5 synchronizing logic execution log update 4 18 user object interface 4 15 logic find and replace 8 1 to 8 14 verification test 9 1 to 9 8 Index 8 Logic Editor breakpoints adding and removing 4 5 color coding 27 16 declaring local variables 27 16 e
369. jects Sort E Hierarchy Alphabet Filter Iype 2 If you want to include the object s child objects select the Subtree option If you do not want to include the object s child objects select the Object option If you want to generate a report about a different object type its name in the Object box If you want to generate a report about the entire project select the Selected application and its user objects option Select a Sort type 4 Click the Filter button to open the Report Output dialog box for selecting the types of objects and data to include in the report OBJECT REPORTS 25 9 Select which object types to include Select the information to display for each included object Report Output Include Display ox m 4 Graphic LA Parent LA Non Graphic A Type _ Cancel A User defined LA Notes _ System A Size and Position O Primitives A Colors Selected A Parameters Select Objects A Select this option and then click the Select Objects button The Select Objects dialog box opens in which you choose the objects to be included in the report NOTE In Object Data reports size limits are displayed for string and array objects Prototyper Layout Report This report is a printed snapshot of the application as it appears in the Prototyper To print a Prototyper Layout report 1 Run the application in the Prototy
370. jects group In any RapidPLUS application register the user object locate the user object in the objects folder Now you can add the user object to any application and use its exported functions to set the active font for any graphic display in the application Advanced Font Object Settings This section applies to RapidPLUS CODE only By default the font s entire range of characters is included in the font object There may be situations however when you would want to save resources by defining one or more ranges of characters for a font When a font is not being used in its entirety RapidPLUS defines a default substitute character to be used if a string contains a character that is not in the active font s defined range FONT OBJECT 13 13 In the Advanced dialog box you can Specify whether the font object is to be excluded from code generation Change the range of characters to be included in the font object Define the default character Single and double byte fonts The character range is the number of characters available in a font Each character is indexed in the font by ASCII values For example in most fonts the ASCII value for the character A is 65 Single byte fonts used mostly for Latin based languages are limited to 256 characters Double byte fonts are used in languages that require more than 256 characters such as Chinese Japanese and Korean In double byte fonts each character after th
371. k S HE black on red S HE black on red S Structure assigned Structure sent Structure received Structure deactivated Configuring Log Data DESCRIPTION AND EXAMPLES Structure related log entries Examples Union Structure calls outgoingCall assigned Recipient calls outgoingCall sent gt TEL_NET Sender calls outgoingCall received lt Network calls incomingCall deactivated For large and complex applications a complete log of all activities could be difficult to interpret and analyze You can configure the Logger to include more or less specific logic types modes and user objects while it logs the application execution The Debug and Logging Options dialog box can determine the extent and type of data to be logged To access the Debugger and Logger configuration options e Choose Options Open Options Dialog the Debug and Logging Options dialog box opens LOGGING APPLICATION EXECUTION 4 17 The dialog box has four tabbed pages TAB DESCRIPTION REFERENCE General Sets options for p 4 17 e Synchronizing logging with logic execution e Following logic execution in the Logic Editor e Debugging logic carried out after the application is stopped in the Prototyper Filters Selects the types of logic activities to p 4 19 be included in the log or as stepping destinations when stepping by filter User Objects Specifies which user object interfaces p 4 20 and p
372. l To display the Rapid Recorder during runtime e In the ActiveX Properties list set the RecorderVisible property to True To control the Rapid Recorder during runtime 1 In the ActiveX Properties list set the RecorderControlsEnabled property to True 2 Use the following functions FUNCTION RecorderRecord DESCRIPTION Instructs the Recorder to begin recording RecorderPlay Instructs the Recorder to play the recording RecorderStop Instructs the Recorder to stop the current play or record operation LoadRecorderFile Loads a recorder file RCD SaveRecorderFile Saves a recorder file RecorderCue Instructs the Recorder to play at fast speed RecorderRewind Instructs the Recorder to rewind the recording to the start RecorderStep Instructs the Recorder to step that is play one event at a time These functions are described in more detail in the Properties Methods and Events section that starts on p 18 34 REROUTING USER ACTIONS 18 33 Controlling the RapidPLUS Simulation s State You can save the current state of the simulation at any point while it is running For details about controlling the simulation s state refer to Chapter 20 The Proptotyper in the Rapid User Manual To save the simulation s state e Use the SaveState method To load a state file e Use the LoadState method The loaded state becomes the starting point each
373. l default 2 Minimized 3 Maximized 4 FullScreen Embedded Displays the simulation either in embedded view or stand alone view If True the simulation is embedded i e displayed within the Rapid Simulator When the application is larger than the simulation window scroll bars are added If False the simulation is in stand alone view i e displayed in a Reviewer window PROPERTIES METHODS AND EVENTS 18 35 EmbedIinHostApplication Determines whether the source application is embedded in the host document or linked to it If True the source file but not its supporting files are saved as part of the host document when the host document is saved NOTE To embed the RapidPLUS simulation s supporting files as well you must create a ZRP file If False the RapidPLUS simulation will be linked to the host document LastUserActionEvent Returns a string containing the name of the event that was involved in the last user action that took place in the simulation LastUserActionld Returns an integer containing the event ID of the last user action that took place in the simulation LastUserActionObject Returns a string containing the name of the object that was involved in the last user action that took place in the simulation LastUserActionProperty Returns a string containing the name of the property that was involved in the last user action that took place in the simulation LastUserActionTime Returns a float numb
374. l Size command or e The WindowHeight and WindowWidth properties described above HOSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS 18 10 OVERVIEW OF COMMUNICATION OPTIONS The following options are available to host documents OPTION Get data RapidPLUS SIMULATION Exported properties pass data to the Rapid Simulator HOST DOCUMENT Rapid Simulator properties and events pass data from the RapidPLUS simulation to the host document Send data Exported properties receive data from the Rapid Simulator Rapid Simulator functions pass data to the RapidPLUS simulation Send user actions The RapidPLUS simulation accepts external user actions The host document sends user actions to the RapidPLUS simulation Monitor user actions User actions flow both internally within the RapidPLUS simulation and externally to the host document The Rapid Simulator is set to Monitor mode The host document observes user actions taking place in the RapidPLUS simulation Control user actions User actions flow externally to the host document The RapidPLUS simulation waits for permission to perform them The Rapid Simulator is set to Reroute mode The host document either acknowledges or denies a user action NOTE Throughout this chapter scripting examples are presented in Visual Basic for Applications format HOW THE HOST DOCUMENT GETS DATA FROM THE SIMUL
375. l that appears in the file above the dumped contents Use this parameter to identify a specific output in the dump file For example in an application that contains a two color graphic display the activity GDO1 dump GDO ICON Adds this text to Dumpgdo txt partial view When the display is ES Dumpado txt Notepad it File Edit Search Help EDO ICON 1111111111111111111111111111111100000000 100000000000OOHOHOOOOOONOHONO0010000000G 1000090900000011000090000000000100090000 100000000000110010000000000000010000000G 1999990908110090109090909090090109090908 1099099911000010010090908000000100090908 100000110000111101000000000000010000000G 100011000611111100100000000000010000000G 19919099911111111101090908090000109090909 1991091111111111100190909000090109090909 1001101111111111110100000000000100000000 10011001111100000000000000011 00100000000 1000110111100000000000000001100100090000 1999110911119111111111111101190100090908 1999911911111111111191908090990109090909 1099911901111111111190100000000100090900 1999991101111111111090100000000109090908 100000110011111110001001000000010000000G 1009990118111110001090919000000100090908 19999901198011000099091901099000109090908 1999999911089011909199901090990109090909 19999999110011000090901110080000109090908 1000000001100000000011001000000100000000 1000000001100000001100110000000100000000 1 6666666061 166906116611 60600000001 GoGGG008 1 68666600611 66116611 600000060061 BaGG8008 10000000000111001100
376. lator ActiveX object 18 8 parsing multi line strings 13 14 pasting bitmaps into Object Editor 27 24 nongraphic objects 10 5 Index 9 pasting between applications actions activities function lines 6 3 conflicts pasted elements 6 16 conflicts pasted related elements 6 17 conflicts transitions 6 8 6 13 6 18 copying elements 6 2 to 6 6 6 9 cutting 6 1 duplicate interface elements 6 7 duplicate modes 6 8 6 13 duplicate objects 6 7 6 13 duplicate user functions 6 7 6 13 incoming transitions preserving 6 14 invalid logic 5 2 logic elements 6 11 to 6 12 Logic Error View 5 2 6 15 modes 6 6 6 13 6 15 multiple paste operations 6 9 objects 6 2 6 10 related elements 6 2 transitions 6 5 6 11 triggers 6 5 user functions 6 4 6 12 user object interface elements 6 3 6 10 verifying logic 6 12 path See search path Pause method 18 39 picture data type ActiveX 17 11 PNG images 13 10 point objects 10 29 pointer objects three segment pointer type 26 19 PokeDataToDDEObject method 18 39 printing reports 25 4 projects compacting 1 9 editing 1 7 examples of usage 1 5 to 1 6 find and replace 8 3 opening 1 4 renaming user objects 1 8 replacing user objects 1 7 reverifying logic 1 4 1 9 saving 1 9 Index 10 projects cont switching among components terminology 1 1 updating interfaces 1 4 verification test on 9 2 Prototyper See Debugger Prototyper Coverage Test 25 20 Prototyper Layout report 25 9 pullColumnsFrom
377. lay is the product of the number of cells i e display pixels multiplied by the size of each cell The size of the graphic display is also affected by the grid width the wider the grid lines the larger the graphic display To define the number of cells in the graphic display e In the Resolution group enter the desired width and height in cells To determine the size of each display cell e In the Pixel size group enter the desired width and height in pixels To define the grid line width e In the Space box enter the desired width in pixels To eliminate the grid lines from the display enter zero To change the color of grid lines see Changing the Grid Color on p 12 7 ADDING AND DEFINING A GRAPHIC DISPLAY 12 7 Graphic display size If you resize the graphic display in the Object Layout the number of cells i e the display resolution remains constant and only the size of the individual cells is affected At runtime any elements that exceed the size of the graphic display on which they are displayed are clipped Changing the Grid Color The grid color is the color of the lines that separate display pixels as set in the Space field The default color is black To define the grid color 1 Select the graphic display true color graphic display 2 Open the Colors Edit dialog box Edit Colors and change the line color NOTES Some colors assigned to grid lines affect the way the background color
378. ld pointer A pointer to a numeric type e g float p is translated as a numeric field pointer A pointer to a structure e g struct tStruct2 p is translated as a structure field allocated as a pointer If a structure contains a field pointer to the same structure type the field cannot be imported For example struct tStruct1 This field cannot be imported int a ae P struct tStructl p i Items That Generate Warnings Two dimensional arrays of type other than signed char is not supported e g unsigned char array1 10 10 A pointer to a pointer type is not supported e g long double arrayP A pointer field within a substructure allocated as a buffer cannot be processed An array of pointers field is not supported Union field definitions are ignored Only top level unions are translated Unions declared as fields of structure cannot be imported Non structure fields of a top level union are imported as fields of inline structure Non instantiated union definitions are imported as RPUnion objects Tag of union definitions plays the role of RPUnion name Any instance name following a union definition is ignored USER OBJECTS WITH MESSAGES 22 30 Items That Generate Error Messages Importing a text file that contains no structure definitions generates an error message similar to Import error O 23 1 State Matrix A state matrix is a tool used to systematically des
379. lication Execution on p 4 10 w Show Hide Panes button Used to show or hide the Logger and Call Stack panes See Using the Call Stack on p 4 24 k Help button Used to access context sensitive Help for toolbar buttons and menu commands Always on Top button Used to enable or disable Always on Top for the Debugger toolbar and panes If only the toolbar is displayed you can click the Show Panes button to show the Logger and the Call Stack panes Descriptions of the Logger and Call Stack elements can be found in this chapter Logging Application Execution on p 4 10 Using the Call Stack on p 4 24 USING THE DEBUGGER TOOL Breakpoint on entry paj D Breakpoint on exit 4 5 The Debugger menu bar becomes available when the panes are open Menu commands are also available when you right click the Debugger toolbar or status line Adding and Removing Breakpoints A breakpoint is a logic line mode entry or mode exit in an application that causes the application to pause in the Debugger Breakpoints enable you to observe the state of an application at specific stages You can set a breakpoint at any logic line i e destination trigger action activity or user function line or at the entry or exit point of any mode You can add or remove breakpoints at any time even while the Debugger is running To add or remove a breakpoint in a logic line 1 Select a logic li
380. lick on the union to reveal outgoingCalls its structures Communications incomingCalls Double click on the structure to myCall reveal its fields RSSI_value Property Function Communications incomingCalls outgoingCalls Double click on a structure field to number i reveal its fields number 1 callFrom callFrom networkType RSSI_value NOTES The union structure field hierarchy is shown through nesting Double clicking toggles between expanding and collapsing the union structure or structure field When building logic for the user object message it is important to remember that assigning a value to a structure field makes the structure active on the side calling the assignment activity and sending a structure makes it active on the receiving side While a structure is active trying to implement a read or send activity on another structure results in a runtime error This point is illustrated on p 22 3 NOTE When you assign a value to a field of an inactive structure RapidPLUS automatically deactivates the active structure and activates the structure involved in the assignment activity USING THE USER OBJECT MESSAGE LOGIC 22 17 Message Properties Functions Conditions and Events The tables below arranged by property summarize message functions conditions and events For the Union PROPERTY Any of the unions defined by the user FUNCTION EVENT
381. loop itself Therefore you must be careful when using a loop For example why is this While loop improper while Switch1 up is connected Because during execution of the loop the state of the switch can never change so either the loop is never executed not connected or is infinitely executed is connected Another example is while Timer1 is running 7 4 WRITING LOGIC USING LOOPS AND BRANCHES white Defining a While Loop A While loop can be used in entry activities exit activities actions and user function activities Defining a While Header To define a While header 1 In the Logic Palette click the While button You can also type the construct keyword while in the edit line e The following logic is appended to the Logic Editor s edit line while lt Condition gt e The Logic Palette is set to condition editing mode and prompts you to enter a condition 2 Enter the condition Accept the While header by either clicking the New Line button or pressing Enter If the header is valid a new line is opened below the header It is automatically indented for the body of the While loop entry while Integerl lt 9 gt A sample While header Defining a While Block A while block contains one or more activities Below is a sample While loop header block entry Integerl 1 entry while SelectedName lt gt PhoneBook Integer1 Name Integerl Integer 1 PhoneNumber
382. lso add notes about it To use the Nongraphic Objects dialog box 1 Sorts by type or alphabetically When sorted alphabetically you can Shift click or Ctri click to select multiple objects Choose Edit Nongraphics or double click the nongraphic objects icon the Nongraphic Objects dialog box opens Select an object from the list Its name appears in the Object Name box and the management buttons i e Edit Duplicate etc are enabled m Object Name Time Accept Communication Applink Applink1 Constant Data Constant Set Constant_Setl Data Array Array Number Numberl String Stringl Holders Holder Holderl MultiMedia Wave udio WaveAudiol Signal Sound Sound Time Sort Bo 44 Attach To Mode Make Transition Close Edit Duplicate f Copy H Paste Delete Replace Help Hint Attach To Mode button attaches the selected objec mode Make Transition button uses the selected object to make a transition from the selected mode The selected mode is Untitled A sample Nongraphic Objects dialog box Opens the selected object s dialog box Copies the selected object renames it and pastes it within the same application Copies the object to the internal paste buffer Pastes the copied object either in the same or a different application Replaces the selected object with an object of the same type NOTE S
383. lso add notes when you first create the object by clicking the Notes button in the nongraphic object dialog box These notes are then displayed in the notes area of the Application Manager window MANAGING PROJECTS 1 14 To edit notes 1 Select the mode object you want to edit Its notes are displayed in the notes area The status bar shows the text Notes for the mode object followed by its name 2 Edit the text in the notes area Adjust the size of the notes area and or use the scroll bar buttons to navigate in it SEARCH PATH FOR OBJECTS When loading applications or adding user objects UDO external objects RPX ActiveX objects OCX DLL or JavaBean objects JAR RapidPLUS looks in the following locations listed in order of priority e The application folder and all its subfolders e The RapidPLUS objects folder e The RapidPLUS applics folder e The RapidPLUS folder wherever Rapidxx exe is located In addition in the development environment the search is extended to include the user defined RapidPLUS search path and in the Rapid Reviewer the RAPID_AUX_PATH environment variable is used NOTE We recommend keeping all the project files in the application folder and its subfolders This will simplify moving the project to a different drive or a different computer Defining a Search Path To define the RapidPLUS search path 1 In the Application Manager select Options Search Path the Rapid Se
384. lso display errors while opening an XML formatted application RXD or UXO file You can use the tool to identify XML lines that are invalid and open the file in a text editor This chapter presents e How an application can come to have invalid logic e A detailed description of the Logic Error View window and its contents e How to reverify logic LOGIC ERROR VIEW 5 2 EXAMPLES OF INVALID LOGIC When certain editing operations render logic invalid the affected logic is commented out and the Logic Error View opens automatically Operations that can cause the Logic Error View to open are listed below Examples follow the table TOOL Mode Tree OPERATION Pasting modes that contain references to missing objects or missing modes Object Layout Editing graphic or nongraphic objects such as e Deleting objects referenced in the logic e Replacing objects that have logic references to properties that are missing from or invalid for the target object e Updating a user object that contains changes to referenced properties or functions Logic Editor Pasting logic that contains references to missing objects properties or user functions Application Manager File operations that may cause the Logic Error View to open e Opening an invalid RXD or UXO file e Reverifying logic through the File menu File Advanced Reverify Logic or Reverify Logic All EXAMPLES OF INVALID LOGIC 5 3 Exa
385. lt Black To change a color setting e Choose Options Syntax highlighting lt Item name gt lt Color setting gt Declaring Local Variables In programming a local variable is a variable used only within the routine or function in which it is defined In RapidPLUS a local variable is used similarly It is declared that is added in the Logic Editor for use within a block of logic lines and nowhere else Why use a local variable Because sometimes you only need to use a number or integer value once or just a few times within a block of logic and you don t want to create a number or an integer object in the Object Layout The local variable can have either a number or integer value Once declared it has all the functions appropriate for a constant number or an integer object LOGIC EDITOR 27 17 Declaring local variables provides a quick way of using variable values with out overloading the application with data objects In code generation using local variables rather than additional data objects creates more efficient code Where Local Variables are Used A local variable is used e As the loop counter in a For loop e Asa declared local variable e Asa user function argument Example of a local variable used as a loop counter in a For loop for lt Integer i gt from 1 to Array1 size step 1 Array1 Integer i initialize For details about For loops see Chapter 7 Writing Logic Using Loops and Branches Exa
386. m belongs as follows e For an activity or action shows the mode name e For a trigger shows the source mode name e Fora user function shows the user function name Text Destination type Lists the complete logic statement in which the search item is contained Example For triggers the syntax is shown as follows D talking amp answerStatus 1 Destination mode Trigger logic if not internal statement Working with Search Results The following options are available through buttons in the Find amp Replace dialog box or through the popup menu that appears after right clicking a line in the search results list Find Close Stop GoTo Make Comment Undo Comment Help PLE EE Button options Replace Replace All Delete Go To Make Comment Undo Comment Remove From List Copy to Clipboard Popup menu USING FIND 8 7 These options are described in the following table OPTION Close button DESCRIPTION Closes the Find amp Replace dialog box and saves the current search options as the default settings the next time you open the dialog box Stop button Interrupts the search in process Go To button and menu item Jumps to the corresponding trigger action activity or user function in the Logic Editor that is highlighted in the search results list Make Comment button and menu item Turns the selected search result lines into comments in the
387. me gt lt value gt e The TriggerApplicationEvent method could trigger the exported event RapidSiml TriggerApplicationEvent lt event name gt 4 In the RapidPLUS application add logic to read the data sent from the host document Examples e A mode activity could read the value of the exported property e The triggered event could have a resulting action Example of Sending Data This example shows how to enable the host document to send data to a RapidPLUS simulation It is based on a Rapid Simulator in a Word document where e The RapidPLUS application contains a lamp and a text display e The Rapid Simulator is in embedded view e The host document contains an On button an Off button and a scroll bar The example already contains the elements needed for the host document to send data to the RapidPLUS simulation SENDING DATA TO THE RAPIDPLUS SIMULATION The On button was clicked so the lamp is on The scroll bar and rr On Off buttons are ActiveX controls created in the host document ON g OFF The value of the scroll bar is displayed in the text display Setup for Sending Data to the RapidPLUS Simulation In the RapidPLUS application In the Object Layout e There is one exported property a number property called ScrollBarValue e There are two exported events lampOn and lampoff In the Logic Editor the following logic is added EE sendData gt i
388. media objects such as digital video In the Object Layout you control the stack order of graphic JavaBean objects like other graphic object for details see Changing Stack Order in the Object Layout on p 21 2 During runtime however there is a difference in stack order behavior between windowed and non windowed JavaBean objects Windowed JavaBean objects are always drawn on top of non windowed and windowed RapidPLUS graphic objects and non windowed JavaBean objects even if the non windowed object is a child of the windowed object You can however control the stack order among windowed JavaBean objects Non windowed JavaBean objects can be transparent semi transparent or non rectangular They maintain stack order among themselves like other RapidPLUS objects Windowed JavaBean objects may have slightly better graphics performance than non windowed JavaBean objects USING JAVABEANS IN RAPIDPLUS 19 6 LOGIC FOR JAVABEAN OBJECTS When you register or add a JavaBean object to RapidPLUS its properties methods and events are translated into RapidPLUS logic equivalents The following diagram summarizes the translation process JAVABEAN INTERFACE PROPERTIES Bound that is notify when the property changes RAPID OBJECT LOGIC PROPERTIES usable in condition triggers amp mode Nonbound activities not usable in condition triggers amp Indexed
389. mediately functions to control when changes are displayed on the graphic display Immediate Update Mode This is the default update mode during which changes caused by calling the various drawing functions are immediately implemented on the display Update on Request Mode After calling the updateOnRequest function changes caused by calling the various drawing functions are implemented on the display s intermediate buffer The changes are visible on the display itself only after explicitly calling one of the following three functions e update Draws any changes that have been made since the last time the update function was called e updateAll Redraws the entire intermediate buffer on the graphic display 12 32 GRAPHIC DISPLAYS updatelmmediately Resets the object back to its default mode and automatically updates the display Example You need to draw a hexagon on the graphic display an operation that involves drawing 6 separate lines but you don t want the user to see it drawn line by line LCD updateOnRequest LCD moveTox 5 y 5 LCD lineTox 10 y 5 LCD lineTox 15 y 10 LCD lineTox 10 y 15 LCD lineTox 5 y 15 LCD lineTox 0 y 10 LCD lineTox 5 y 5 LCD update The hexagon is drawn asa single continuous line instead of as a series of connecting lines NOTE Nothing is visible on the display until the update function is called When to use updateOnRequest and when not to The updateOnRequest mode c
390. ment variable of the system or user A subfolder Rapidxx rpd_mem contains a header file and link libraries for Visual C and Borland which enable you to link to the Applink object from C The tasks that the external application can perform are e Opening a channel of communication e Sending data to the Applink object e Receiving data from the Applink object e Closing the channel e Setting and getting the transmission mode queued or overwrite e Setting and getting the size of the queue Opening and Closing the Channel Before the external application can communicate with RapidPLUS a channel of communication must be opened The channel must have the same name in RapidPLUS and in the external application When the communication process has been completed you should call the closeChannel function NOTE Up to 20 channels can be opened Opening a Channel e Use the rpd_openChannel function When a channel is opened its transmission mode is Queued Syntax long rpd_openChannel const char channelName void dataArrived int void acknowledged int USING RPD_MEM DLL IN AN EXTERNAL APPLICATION 16 11 Parameters channelName Name of the channel must be the same name used by the Applink object dataArrived Address of the callback function dataArrived The syntax for dataArrived is void dataArrived int channelld acknowledged Address of the callback function acknowledged void acknowledged int ch
391. ments Use SQL clauses to determine which fields are to be retrieved from the specified database to establish filters for the data to be retrieved from the fields and to determine the field order in the retrieved record set This chapter presents e How to define database access objects e How to configure an SQL query e How to define logic for database objects including navigating among records changing records performing queries dynamically and sending non query SQL statements e How to handle errors ADDING IN THE OBJECT LAYOUT NOTE An ODBC v 2 0 or higher driver must be installed on your system to use this object in your application To add a database access object Do ES N 1 The database access object is located in the Communication class Select it from either the Object Palette or the New Objects list The DBAccess Object dialog box opens 2 To define the object click More DEFINING THE DATABASE ACCESS OBJECT The DBAccess dialog box has three tabs Selection Advanced and SQL Use the tabs as described in the following table TAB Selection DESCRIPTION Defines the database linked to the object and which table s and field s the object accesses within the selected database Advanced Defines e Whether or not the database is read only e The SQL filter WHERE and sort ORDER BY clauses e Whether or not the query type is dynamically linked SQL The definitions that you s
392. method 18 33 SaveStateFile method 18 43 saveStatusIn 12 37 saving log files 4 21 projects 1 9 reports 25 4 system settings 27 9 XML projects and applications 2 2 schema file 2 6 2 11 2 13 schemes for exported state charts 24 6 Index 11 search path 1 14 defining 1 14 Rapid default search paths A 1 RAPID_AUX_PATH variable 1 15 schema file 2 13 warning re UDO files with same name 1 15 searchFor 26 8 searchFor from to 26 2 searchFor inColumn 26 11 searchFor inColumn fromRow 26 11 searchFor inColumn fromRow toRow 26 11 searchFor inColumn toRow 26 12 searching backwards in arrays 26 2 See also Find and Replace dialog box searchNext 26 12 searchNextBackward 26 2 26 12 selecting objects from the object list 27 10 send 22 18 SendAcknowledge method 18 31 18 43 SendDeny method 18 31 18 44 sendToBack 21 3 sendToBackOf 21 3 set 10 43 SetApplicationProperty method 18 19 to 18 20 18 22 18 44 setAscendingPriority 26 6 setAscendingPriority forColumn 26 6 setBackgroundColor 12 17 setDescendingPriority 26 6 setDescendingPriority forColumn 26 6 setDisplayBuffer 12 46 setFocus_object 17 21 setLoginTimeout 15 15 setNumberOfColumns 26 12 setNumberOfRows 26 12 setPaletteIndex toRed green blue 12 9 12 20 setProperty_object name value 17 21 to 17 22 setQueryTimeout 15 15 signal objects 10 38 to 10 41 SimulateUserAction method 18 23 to 18 24 18 44 Simulator Document Manager 27 5 Index 12 single byte
393. method is written to get the current value from Rapid Simulator For example in Visual Basic RapidSiml GetApplicationProperty lt exported property name gt ii Through an internal mechanism the Rapid Simulator requests the value of the named exported property from the RapidPLUS application iii Through the same internal mechanism the RapidPLUS simulation returns the value of the exported property The value is always a string iv The exported property s value is returned to the host document which can then use the value HOSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS 18 12 Procedure for Getting Data Initiated by the Host Document 1 Add an exported property to the RapidPLUS simulation For details about adding an exported property refer to Chapter 19 of the Rapid User Manual Adding User Properties p 19 6 For example an exported number property could hold the value that the host document will get 2 Inthe host document s programming language use a method GetApplicationProperty to get the current value of the exported property For example RapidSiml1 GetApplicationProperty lt property name gt Example of Getting Data Initiated by the Host Document The following example shows how to enable the host document to get data from a Rapid Simulator ActiveX object It is based on a Rapid Simulator that is embedded in a Word document All of the simulation s logic is internal that
394. ml SimulateUserAction Switchi up make When clicked the switch moves to the Up position Example of a host document that contains two ActiveX controls a Button and a Rapid Simulator SETTING THE RAPID SIMULATOR S ROUTING MODE The Rapid Simulator s routing mode determines how user actions are handled by the simulation As in the Simulation Manager object the three modes are ROUTING MODE DESCRIPTION Normal User actions flow internally in the simulation without any link to the host program SETTING THE RAPID SIMULATOR S ROUTING MODE 18 25 ROUTING MODE DESCRIPTION Monitor User actions flow both internally within the simulation and externally to the host program via an internal mechanism see p 18 26 for details about Monitor mode Reroute User actions generated in the simulation flow to the host program via an internal mechanism and the simulation waits for the host to send a response If the host acknowledges the user action RapidPLUS responds to the user action as it would normally If the program denies the user action RapidPLUS does not respond to it and sends the next user action in the queue if more than one user action occurred see p 18 29 for details about Reroute mode Setting the Routing Mode The routing mode can be set during design time in the Rapid Simulator Properties dialog box or at runtime via the host document s script Using the Rapid Simulator Properties Dialog B
395. mple of a declared local variable declare lt Integer sum gt lt Number average gt lt sum gt 0 for lt Integer i gt from 1 to Array1 size Step 1 lt sum gt lt sum gt Array1 lt i gt lt average gt lt sum gt Array size Next activity Example of a local variable used as a user function argument myFunc lt myUDO k gt length lt Integer len gt lampArray lt Round_Lamp_Array2D my LampArray gt myHolder hold lt k gt myLength lt len gt for lt Integer i gt from 1 to lt myLampArray gt size step 1 lt myLampArray gt lt i gt lt i gt blink User function arguments can be of most RapidPLUS types including arrays and holders of known types These arguments can be automatically generated using the Functions Add Arguments Generate Arguments commands For details about user function arguments refer to Chapter 18 User Defined Functions in the Rapid User Manual ADDITIONAL RAPIDPLUS ENHANCEMENTS 27 18 Declaring a Local Variable Local variables can be declared in entry activities exit activities actions and user functions More than one local variable can be declared in a logic block Local variables are assigned default names In each block the first local variable is assigned the default letter i Subsequent default names are j k 1 etc The default value of local variables is zero Example The following logic line declares three local variables declare l
396. mples In the Mode Tree you pasted a mode with an outgoing external transition to mode on and there is no such mode in the target application The Logic Error View opens and in the Logic Editor the trigger logic is commented out and the missing destination mode looks as follows Vos IO Condition Missing mode a Power_sw down make In the Object Layout you replaced a 4 position rotary switch with a 3 position rotary switch The target application included the following condition trigger amp Switch1 position4 is connected After the paste operation the trigger is invalid The Logic Error View opens and the following appears in the Logic Editor Switch1 position4 Missing Property is connected Special comment mark Explanatory comment inside two backslashes and two curly brackets three asterisks In the Logic Editor you paste the following activity Display1 drawText hello atx 0 y 0 In the Paste Conflicts Duplicate Elements Referenced by Pasted Logic dialog box see p 6 17 you choose to keep the source application s Display1 which is a text display not a graphic display Since the pasted logic is invalid if applied to a text display the Logic Error View opens and the pasted activity is commented out 11 in the Logic Editor LOGIC ERROR VIEW 5 4 VIEWING INVALID LOGIC It is up to you to make the required changes to the application in order to fix invalid logic To
397. n gt srv_setings gt srv_skin gt emb_audio 1 gt srv_photoalbum gt emb_rtc iD Pe Saar S GENERATING REPORTS 25 18 The components in each level are listed alphabetically by file name To generate a Component Dependency Tree report e Choose Reports Components Component Dependencies tree the Report Viewer opens displaying the component tree Component List Report This report titled the User Object Instance Tree report is an ASCII text file that presents a list of the project s components A typical report as viewed in the Report Viewer looks like this W User Object Instance Tree report for MAINAPP NM Ioj xj File Edt jep 5 9 8 RAPID APPLICATION MAINAPP oz 10 03 05 31 23 PM User Object Instance Tree report User object is generated as interface only User object is generated as an empty task User object is generated as a data container User object is generated as a standalone application User object is not generated object is a holder gt EMB_AUDIO EMB_AUDIO I gt EMB_BATTERY EMB_BATTERY I gt EMB_CAMERA EMB CAMERA I gt EMB_NET EMB_NET I gt EMB_RTC EMB_RTC D gt EMB_SIM EMB_SIM gt EMB_SIM_TABS EMB_SIM_TABS LS MERO CUONe oR TWO WN WUN CUNNSR Tee WNS The components are listed by name followed by the file name in parentheses and code generation type To generate a Component Dependency Tree report e In the Application Ma
398. n This chapter presents e Instructions for using the Application Packager e Instructions for distributing and using a packaged application APPLICATION PACKAGER 28 2 BUILDING AN APPLICATION PACKAGE A packaged application contains all of the files necessary for running a RapidPLUS application on an end user s system The packaging process is simple and a series of dialog boxes will guide you through the process of building an application package DIALOG BOX Application Packager USED TO Add the Rapid Reviewer to the package required when the end user does not have RapidPLUS or the Rapid Reviewer installed Name the package s program folder Add a shortcut for the application Add a Readme file to the package Files and Folders for Packaging Select the RapidPLUS application to be packaged Most of the resource files used by the application are automatically added to the package Add additional files and fonts to the package Destination Folders Select the Package destination folder This folder will contain all of the package files As soon as the package is built this folder will be created on your system Select the Installed Application destination folder This folder will be added to the end user s system when the package is installed It is not added to your system The only input that is always required of you is to select the RapidPLUS application to be packaged in the second dialog
399. n as reference only Radius Example The following logic statement draws a filled circle with a 20 pixel radius that has its center point at the graphic display s 30 55 coordinate LCD1 drawFilledCircleAtcx 30 cy 55 radius 20 To draw an empty or filled ellipse e Use the drawEllipseAtcx cy horizRadius vertRadius or drawFilledEllipseAtcx cy horizRadius vertRadius function specifying the ellipse s center point and sizes Vertical radius Horizontal Radius Center point shown as reference only Current draw color Example The following logic statement draws an empty ellipse with a 15 pixel horizontal radius and a 10 pixel vertical radius that has its center point at 15 15 LCD1 draweEllipseAtcx 15 cy 15 horizRadius 15 vertRadius 10 DEFINING THE LOGIC 12 31 Floodfilling an Enclosed Area Use the floodFillAtx y function to fill an enclosed area with the current draw color By default the draw color is black For details about changing this color see Changing the Draw Color on p 12 16 The color of the point specified by the function s arguments becomes the reference color In the area enclosed by pixels of a color other than the reference color all the reference color pixels are set to the current draw color Example LCD1 floodFillAtx 10 y 10 Before After NOTE C code is not generated for this function Setting the Update Mode Use the updateOnRequest and updatelm
400. n call is performed in a separate process e A check box Use Separate Process enables the DLL function call to be performed in a separate process Performing the DLL function call in a separate process prevents crashes due to incorrect information input in this dialog box However it may affect RapidPLUS performance the first time the DLL is called NOTE Some DLLs must use the same process as RapidPLUS in order to run properly Recommendation Select this check box when you build a new DLL object After you have tested the object and seen that all the information was entered correctly you may want to clear the check box NOTE By default this check box is selected However for applications created prior to version 6 0 that contain DLL objects the default is not selected OBJECT ENHANCEMENTS 26 22 PUSHBUTTON OBJECT A new event longPress simulates an extended press on a pushbutton It is triggered once when a pushbutton is pressed and held during the defined period The default long press period is 2 seconds The long press period is set in the Pushbutton dialog box TEXT DISPLAY OBJECT Alignment functionality was added to enable changing a text display s alignment during design time and runtime To set text alignment during design time 1 Open the Text Display dialog box 2 In the Align group select either Left or Right Left alignment is the default type NOTE The Align group replaces the En
401. n e sa A A AS OS Se eg SE es 2 13 CHAPTER 3 COMPARING APPLICATIONS IN THE DIFFERENCING TOOL iodo pa a AA a A we TS 3 1 Using the Differencing Tool e o 3 2 Structure of the Window 2 it GD Rees 3 2 The Basics of Using the Differencing Tool o o ooo o 3 3 Selecting Applications 2 A A 3 4 Comparing the Applications o ooo o e e 3 4 Selecting Comparison Filters o ooo o e e ee 3 8 Going to an Item Selected in the Differencing Tool 0 0 3 9 Copying Items in the Differencing Tool 0 0 0 000000 3 10 Generating Differences Reports ooo ooo ee eee 3 10 Comparing Projects ii Site eld oe it PE cee tid A A 2 Me Bed See 3 11 Comparing Modest be ee 8 ae Add 3 12 Comparing Objects 5 50 sere bk en oS Go ee eae elas ke oa taa 3 14 Comparing User Functions 2 iea hn a a a E a E 3 15 Comparing Interfaces eanes e a 3 16 CHAPTER 4 DEBUGGING APPLICATIONS o o oo ooo ooo 4 1 Using the Debugger Tool 2 o 4 2 Opening the Debugger Toolbar o oooooo oo e 4 3 Adding and Removing Breakpoints o ooo e 4 5 Stepping into Applicati0OS o 4 6 Controlling the Application 0 0 0 0 o e e o 4 7 Onscreen Notifications ii a iaa dee 4 8 Synchronizing the Logic Editor and the Debugger
402. n executes the next logic line stepping into a user function if relevant e The second button executes the next logic line executing a user function as one block if relevant This button also has special functionality when used with the call stack See Activating a Stack Frame on p 4 27 e The third button executes application logic and then pauses at the next logic line that matches the logging filters See Controlling the Application on p 4 7 gan Prototyper control buttons Used to stop start and pause resume the application running in the Prototyper See Controlling the Application on p 4 7 RY Inspect button Used to examine the status of an object See The Inspector Window on p 4 27 4 4 DEBUGGING APPLICATIONS m Status line DESCRIPTION Displays application status messages See Onscreen Notifications on p 4 8 E Breakpoint buttons Used to set entry and exit breakpoints on a selected mode See Adding and Removing Breakpoints on p 4 5 E4 Clear button Used to erase the Logger This button appears when the Logger pane is showing See Managing Logs on p 4 21 Ea Find button Used to find strings in the Logger This button appears when the Logger pane is showing See Managing Logs on p 4 21 R Enable Disable Logging button Used to enable or disable logging See Logging App
403. n of the comparison icons and colors C RAPIDSAPPLICS XPRESS MAIN RPD C RAPID 72 APPLICS XPRESS MAIN RPD Revision 117 23 07 03 07 40 03 Revision 114 21 05 03 20 00 06 Project Modes Objects User Functions Interface e de MAIN MAIN E i NonGraphics NonGraphics fH System H System Hl Data H Data E ii Time E Time Y PowerUp_Tmr Y Powerlp_Tmr Y Backlight_Tmr Backlight_Tmr Gi BatteryTimer E Y Signal E Y Signal wf Framet Fia Framat oh Parameters Properties Events Messages Functions ries E io Veoe 101 Detailed Information panes 4 1 Debugging Applications The RapidPLUS Debugger tool helps you to identify and isolate errors in an application With the Debugger you can see the inner workings of the application by checking the value of variable or the contents of objects The Debugger takes control of the application as it runs in the Prototyper pausing at designated breakpoints You can use the Debugger to examine step by step execution of logic commands and how it affects the application The Debugger includes two utilities with which you can closely follow application execution the Logger and the Call Stack The Logger displays the flow of the application as it runs in the Prototyper including information on user object interface execution The Call Stack displays a sequence of stack frames leading up
404. n the Mode Tree select the mode for which you want to generate a report or you can type a mode name in the dialog box 2 In the Application Manager choose Reports Modes Data the Mode Data Report dialog box opens 25 14 GENERATING REPORTS Mode Data Report CDPLAYER x Mode E a Subtree Include _Cancel A User Functions A Actions LA Activities A Parent A Transitions A Type _ Help A Triggers LA Notes Sort E Hierarchy 7 Alphabet If you want to include information about the mode s descendants select the Subtree option If you want to generate a report about the selected mode only select the Mode option By default all of the logic information is included in the report i e all of the logic types in the Include group are selected To exclude logic information from the report clear the unnecessary check boxes in the Include group Keep in mind that some logic types are dependent on other logic types for example actions cannot be included without triggers Select a Sort type Click OK the Report Viewer opens displaying the selected mode s data information You can print or save the report as explained in Working with Reports in the Report Viewer on p 25 3 USER OBJECT INTERFACE REPORTS 25 15 USER OBJECT INTERFACE REPORTS This report is an ASCII text file that summarizes information about an application s or project s interface with its user objects A typical repo
405. n to specify the value dynamically during runtime For more information see Setting Parameterized Values on p 15 13 DEFINING THE LOGIC 15 9 Working with Microsoft Excel Spreadsheets If you are working with Excel spreadsheets you should use the following procedure 1 In the DBAccess dialog box Advanced tab open the database see p 15 3 for information about accessing databases 2 Add the relevant fields to the Selected Fields list 3 Make sure the Query at startup check box is not selected 4 The query must be written manually In the Logic Editor add the following logic lt Database object name gt dbSQL SELECT L1 L2 FROM lt sheet name gt lt Database object name gt runQuery DEFINING THE LOGIC Navigating Among the Records The database access object has a number of functions that allow you to navigate easily among the records in the query result table Moving to Records To move to the beginning or end of the query result table e Use the moveFirst or moveLast function To move to a specific record e Use the moveTo lt integer gt function specifying the record in the integer argument A runtime error occurs if the function attempts to move to a record that does not exist 15 10 DATABASE ACCESS OBJECT Scrolling to Records To scroll backward or forward one record at a time e Use the moveNext or movePrev function If you are on the last record and call moveNext or
406. nGL objects in the application that have the same window status windowed or non windowed ADDING AN OPENGL OBJECT TO THE OBJECT LAYOUT NOTE If an OpenGL object shares its display lists then the display lists of the other OpenGL objects in the application are available to it as well even ifthey do not explicitly share their display lists However objects that do not share their display lists have no access to each other s display lists In the following illustration for example OpenGL2 and OpenGL3 would have no knowledge of each other s display lists OpenGL2 Not shared Display lists OpenGL1 Shared About Your OpenGL and GLU DLLs To view information about the OpenGL and GLU DLLs currently installed on your system Display lists e Click the About button in the object s More dialog box Editing Colors Each OpenGL object has a fill and a background color In the Object Layout the fill color determines the color of the OpenGL object s label while the rest OpenGL3 Not shared of the object s bounding box is painted in the background color During runtime the fill and background colors are the object s default colors which are changed by calling one of the OpenGL color functions You can change the object s fill and background colors in the Color Editor You can also set one of the colors or any other color as transparent
407. nager choose Reports Components Component List the Report Viewer opens displaying the components PROJECT COMPONENT REPORTS 25 19 Detailed Component List Report This report expands the Component List report by listing holders to user objects For details about the Component List report see the previous section Target Graphic Displays Report This report is an ASCII text file that presents the graphic displays that are used in the various project components The components are listed as they appear in the Detailed Component List report A typical report as viewed in the Report Viewer looks like this W Detailed Target Graphic Displays for MAINTEST File Edit Help 9 8 RAPID APPLICATION MAINTEST 17 02 04 Detailed Target Craphic Displays 09 54 36 MAINTEST GDO gt EMB_GSRV EMB_GSRV I l gt RPD_CONSTANTS RPD_CONSTANTS H GDO l gt SIM_AUDIO SIM_AUDIO N l gt TRACE TRACE I gt HMI_CALL HMI CALL i GDO gt HMI_IDLE HMI_IDLE GDO gt HMI_MENU HMI_MENU GDO gt MINES MINES GDO l gt UDD_MINES UDD_MINES D gt HMI_PBOOK HMI_PBOOK GDO The components are listed by name followed by the file name in parentheses the code generation type and the name of the graphic display that is used by the component To generate a Target Graphic Displays report In the Application Manager choose Reports Components Target Graphic
408. namic graphic objects also have the orderPosition property It is used to specify the dynamic object s precise stack order in relation to the other objects in the application This property supports every integer function Example A group of dynamic objects are stacked in the following order Object Object 2 z Object 3 Object 4 The following logic is used to change the stack order of Object1 and Object3 Object1 orderPosition Object2 orderPosition 1 Object3 orderPosition Object4 orderPosition 1 The result is Object1 Object3 Object4 Object1 and Object3 change positions in the stack order so that they are superimposed on top of the objects specified in the logic Another way to use the stack order functions would be to use a condition trigger that reads the stack order of two objects and then changes the order if the condition is met For example TRIGGER FUNCTION Object1 orderPosition lt Object1 orderPosition Object2 orderPosition 1 Object2 orderPosition About Groups If a dynamic object is part of a group its stack order can only be changed within that group A runtime error occurs if you try to assign an orderPosition value that is less than one or greater than the number of objects in the group 22 1 User Objects with Messages In earlier versions of RapidPLUS user objects participated in the parent application logic through exported properties events and f
409. ncheS ooo ee 7 12 Defining an If Branch 2 26 bie a ca ooo crasas 7 12 Defining an If Else Branch e renia ee ee eee 7 13 Defining If Else If Nested BranchesS o ooo ee 7 14 Defining If Else Branches That Use Constant Objects 7 15 How Loop and Branch Logic Is Accepted o o oo oo ooo o o 7 16 Execution of Loops and BrancheS o oo e e 7 16 Execution of While LO0PS o o o e 7 16 Execution of For LOOPS iia a a ee ee ele Se a la 7 17 Execution of If Else Branches o ooo ooo oe e 7 17 Running Loops in the Prototyper o oo ooo o e 7 17 Code GENOMA A AA EE A ea 7 18 CHAPTER 8 FIND AND REPLACE o eee 8 1 Using FIDA rinda di e Ros ab SE OA GE EME a Wee BS ae 8 2 Displaying Search Results 2 2 ee eee 8 5 Working with Search Results 2 2 ee ee ee 8 6 Usmo Replace sof ensue sneha e oes Be A ates ue Bd op Real les ale cago fas Ge Shas 8 8 Replacing a Strings 2 s cscs hoe toate hard a eae oe OE A A DEY ee 8 8 Validating Logics vi Seta a ae BA E et aed Ae ee De Stas 8 9 Using Filters Advanced Options 2 0 0 0 2 eee eee 8 11 Find and Replace Examples 1 0 e 8 12 CHAPTER 9 VERIEICATUON TEST i oso se 24 eo PE Se ES Ae a 9 1 Running the Verification Test 2 a 9 2 Examiningl 0 g1C Errors uu aie a A We HS ide
410. ndable the mode activity Mcrosoft_Forms_2_0_TextBox1 CurLine Int1 is valid the mode activity Int1 Microsoft_Forms_2_0_TextBox1 CurLine changed however causes the following error message to appear Rapid Compiler Error Eg AN CurLine is a non bindable property It can not be used in a mode activity unless the activity changes its value Functions ActiveX methods that use the following types in their parameters become the functions of the object s self property in RapidPLUS Integer Number String Color Variant converted to a string A method that uses a pointer to an integer as a parameter for example will not appear in the Functions column of the logic palette when the object s self property is selected NOTE For a complete list of ActiveX types that are supported by RapidPLUS see Supported ActiveX Data Types on pp 17 9 to 17 15 HOW ACTIVEX INTERFACES ARE CONVERTED TO RAPID L Events The ActiveX control events become RapidPLUS object events When a control event is triggered the control calls a function that in turn triggers the RapidPLUS event Unlike RapidPLUS events however ActiveX control events can also have parameters and a return value These are handled as described below Event Parameters An example of event parameters would be a Click event that has two integer parameters named X and Y These parameters are assigned the mouse position coordinates whenever
411. ne button twice or press enter twice see Ways to end an activity block on p 7 5 for other ways to end the block Using Loop Counters in Logic Once a For loop has been created its loop counter i j etc becomes a local variable in the Logic Palette The local variable is visible only when the focus is within the block of the For loop Local variable from the For loop E Logic Palette Activity Property Function Untitled Bitmap Imagel Communication Applink1 Cuntam The local variable has all the functions appropriate for a constant integer object plus the assign operator UNDERSTANDING INDENTATION IN LOOPS AND BRANCHES 7 9 UNDERSTANDING INDENTATION IN LOOPS AND BRANCHES Each line in a block is indented under its header If you create the header first RapidPLUS will automatically indent the next line when you open a new line below it When a line is indented e The edit line contains a right angle bracket gt for each indent The edit line shown below contains two indents x x gt Integerl 8 e The Line Selector for each activity in a block contains a right angle bracket for each indent and the text is indented accordingly ESE Lampl blink gt gt Display1 contents blink Changing the Indent Width The default indent width is 4 spaces You can change the width in the Indentation Width dialog box Options Indent Width Increasing Decreasing Indentation
412. ne in the Logic Editor 2 Click the gray selection button to the left of the logic line You can also choose Breakpoint from the Debug menu or popup menu Once set the selection button appears green when the Debugger is closed and red when the Debugger is open To add or remove a breakpoint in the Mode Tree 1 Select a mode in the Mode Tree 2 To set a breakpoint at the mode entry click the Breakpoint on entry button in the Debugger toolbar You can also choose Break on Entry from the Mode Tree s Tree menu or from the mode s popup menu To set a breakpoint at the mode exit click the Breakpoint on exit button in the Debugger toolbar You can also choose Break on Exit from the Mode Tree s Tree menu or from the mode s popup menu DEBUGGING APPLICATIONS 4 6 Once set a breakpoint appears by the mode in the Mode Tree The breakpoint appears green when the Debugger is closed and red when the Debugger is open ES Mode Tree CDPLAYER Al ES File Edit Tree Logic Help nlem 4 6 o 0 3 re E Cdplayer PelecticPlug0 ut Breakpoint on entry electricPlugln powerD ff powerOn proDisk diskIn ID Breakpoint on exit To remove all breakpoints simultaneously e In the Debugger choose Breakpoints Clear all breakpoints or in the Logic Editor choose Debug Remove all breakpoints Breakpoints are removed from the Logic Editor and the Mode Tree STEPPING INTO APPLICATIONS With the Debugger you can monitor
413. ng gt string Arial bold sizeGet Returns the font size in points Number ActiveX1 font sizeGet sizeSet Sets the font size in points ActiveX 1 font sizeSet lt number gt 7 5 strikethroughGet Returns 1 if the font attribute is Int1 ActiveX1 font strikethrough 0 if not strikethroughGet strikethroughSet Sets the font attribute to strikethrough ActiveX1 font lt integer gt 1 or not strikethrough 0 strikethroughSet 1 underlineGet Returns 1 if the font attribute is Int ActiveX 1 font underline 0 if not underlineGet underlineSet Sets the font attribute to underline 1 ActiveX1 font lt integer gt or not underline 0 underlineSet ActiveX2 font underlineGet weightGet Returns the font weight usually 400 Int1 ActiveX1 font for non bold or 700 for bold weightGet weightSet Sets the font weight as above ActiveX 1 Font lt integer gt weightSet 700 USING ACTIVEX CONTROLS Date FUNCTION DESCRIPTION EXAMPLE Assigns the values of one date property MonthView1 date to another date property MonthView2 date asFloat Returns the date as an encoded float daysPassed value This function is useful for MonthView1 date calculating the number of days between 25Float two days MonthView2 date i asFloat asString Returns the current date and time asa Display1 contents fixed length string in the format Sun MonthView date Sep 16 01 03 52 1998 asString dayGet Retu
414. ng panes that contain Tabs for selecting hierarchical trees comparison views USING THE DIFFERENCING TOOL 3 3 Lower section of the Differencing Tool window Modes tab These tabs correspond to the selected comparison view project modes objects etc Use them to view information in the detailed information panes Detailed information panes Destinations Triggers Actions Activities Notes Type MODE Untitled MODE Untitled DESTINATION DESTINATION TRIGGER lt gt TRIGGER ACTION ACTION Browse Differences Browse Matches First Previous Next Last First Previous Next Last Differences found Y Information about the mode selected in the detailed information pane enabled only in Modes view The Basics of Using the Differencing Tool The basic steps for using the Differencing Tool are 1 Select an application for each pane RapidPLUS automatically compares them The differences and matches are displayed in the upper panes see p 3 5 for an explanation of the icons and colors used in the upper pane 2 Use the Browse buttons at the bottom of the window to navigate among the differences and matches see p 3 7 for details 3 Click the Project Modes Objects User Functions Interface tabs to focus on different elements of the applications For an explanation of the Differencing window in e Project view see p 3 11 e Modes view see p 3 12 e Objects view se
415. ngs Localized text is appropriately displayed in the active language regardless of the computer s language settings it requires only a font with a script that matches the respective language Localization is currently available only for the graphic display object RapidPLUS s localization support relies on the multi lingual support of the operating system It is fully available for Unicode operating systems Windows 2000 and Windows NT but is limited to a single double byte language for double byte operating systems such as Windows 98 In applications that feature localization avoid the use of literals You should also bear in mind that localization affects string manipulation functions The language object has several functions that allow you to set and get the active language FUNCTION DESCRIPTION getCurrent Returns the code page number of the current language as an integer set lt Integer gt Sets the code page of the current language In the parameter use the name of the respective language as listed in the Functions column of the Logic Palette or the number of the code page 10 44 NONGRAPHIC OBJECTS FUNCTION DESCRIPTION The code page number of the respective language as follows Arabic 1256 Baltic 1257 Cyrillic 1251 EasternEuropean 1250 Greek 1253 Hebrew 1255 Japanese 932 Korean 949 SimplifiedChinese 936 TraditionalChinese 950 Turkish 1254 Western 1252 The language name is a
416. nication is achieved by specifying an external DLL file in the graphic display s Advanced dialog box and by implementing certain functions in the external DLL To connect a graphic display to an external DLL 1 Open the graphic display true color graphic display dialog box and click the Advanced button For the true color graphic display in the Advanced dialog box click the External Display tab GRAPHIC DISPLAYS 12 14 Connect external DLL Connect external DLL to the display External DLL name ExternalGDO DLL Browse 2 Select the Connect external DLL to the display check box then click the Browse button to select the appropriate DLL file To enable the external DLL to receive output from a graphic display The DLL should implement the following API functions displayOpened This function is called when the Prototyper starts for each graphic display that is connected to the external DLL Syntax BOOL displayOpened int uniqueID const char name BITMAPINFO info void bits Parameters uniquelD Identifier for the graphic display It is guaranteed to be unique for all graphic displays in the current session a session is defined as the period between starting and stopping the Prototyper name Name of the graphic display in the application info BITMAPINFO structure that holds the graphic display s definitions size color depth etc bits Pointer to the contents of the graphic display
417. nly have one of them 19 9 USING JAVABEANS IN RAPIDPLUS 19 10 Functions JavaBean public methods appear as functions of RapidPLUS JavaBean objects provided that their argument types including return values are supported by RapidPLUS see p 19 7 for a list of supported types Building Descriptive Functions Sometimes when a JavaBean method is mapped to RapidPLUS it loses descriptive information For example the method public void drawCircle int centerX int centerY int radius may appear in RapidPLUS as Bean1 drawCircle_int lt Integer gt int lt Integer gt int lt Integer gt This function is not descriptive and does not indicate the meaning of each parameter It would be better if the function would appear like Bean1 drawCircle_centerX lt Integer gt centerY lt Integer gt radius lt Integer gt There are two ways to get descriptive functions e Compile the Java class with debug information RapidPLUS will take the descriptive argument names directly from the Java class If you are using JDK just run javac with the g flag If you are exporting from IBM Visual Age for Java make sure you check include debug attributes in classes Other tools have different ways of doing this but it s usually enabled by default e Write a BeanInfo class for the JavaBean with method descriptors for each method however this way is not recommended if all you want is descriptive method names For in
418. ns and choose one OPTION Bring to Front DESCRIPTION Places the selected object s in front of all the other objects Send to Back Places the selected object s behind all the other objects Bring Forward Moves the selected object s forward one level Send Backward Moves the selected object s back one level Bring in Front of Places the selected object s in front of the object specified in the Order Objects dialog box see Bringing In Front Of or Sending To Back Of on p 21 2 Send to Back of About Groups Places the selected object s behind the object specified in the Order Object dialog box see Bringing In Front Of or Sending To Back Of below If you select an object group changing the stack order moves all the objects in the group The objects within the group do not change their stack order If an object is part of an object group its stack order can only be changed within the object group That is the change in the stack order affects only the appearance of the objects within the group Bringing In Front Of or Sending To Back Of Choosing either Bring in Front of or Send to Back of opens the Order Object dialog box In this dialog box you specify the object that the selected objects will move in front of or in back of To bring object s in front of or send to the back of another object 1 Select the object s whose stack order you want to change CH
419. ns in XML RapidPLUS applications can be saved to XML format in addition to the standard binary RapidPLUS format RPD and UDO The XML format offers many development benefits e Group development the XML format can be used by configuration management tools for check in check out of projects comparing versions and merging versions for details see Team Development And Version Control Using XML Flles on p 1 16 e Use of external tools to edit project components XML based or text based editors can be used for editing object properties and application structure e Integration of third party tools with project files external tools can be used for tasks such as generating reports and documents Also RapidPLUS application files can be created and modified by external tools e Readable text files XML application files are readable as text files without the need to open them in RapidPLUS e Ability to fix corrupted applications CAUTION Applications saved to XML format cannot be packaged by the Application Packager and cannot run in the Rapid Reviewer This chapter presents e How to save a RapidPLUS application to XML How to open a project in XML format e The XML output files 2 1 RAPIDPLUS APPLICATIONS IN XML e How to edit the XML application files e The RapidPLUS schema file SAVING APPLICATIONS TO XML FORMAT The native format for all RapidPLUS applications is the binary RPD format Whenever an appli
420. nt defines the application name and the applied schema The lt import gt element lists external components used by the module The lt class gt element names the RPD or UDO file The lt extends gt element is reserved for use in future RapidPLUS versions WORKING WITH THE XML OUTPUT 2 7 Example Application Files Document Information lt module xmlns xsi http www w3 org 2001 I tRaFFIC RxD XMLSchema instance TRAFFIC RPD xsi noNamespaceSchemaLocation Rapid20030803 xsd gt lt import lib OBJLIB RPX type rpx gt lt class name traffic gt lt extends gt UDO lt extends gt Metadata Element of the Class Element The lt metadata gt element contains information from the Application Properties dialog box Application Properties lt metadata gt Element ida lt String name appName gt Traffic lt String gt Application Traffic lt String name creator gt renee lt String gt A e SS lt String name company gt e SIM Ltd lt String gt lt Integer name revision gt 2 lt Integer gt Company Je SIM Lid lt Integer name countryCode gt 1 lt Integer gt lt boolean name logEnabled gt false lt boolean gt lt String name comment gt Comments lt String gt 4 lt metadata gt Revision 2 J Log Character set English Ss File Name traffic RXD Created 04 11 04 09 57 25 AM Modified 04 15 04 11 05 37 AM Accessed 04 15 04 12 53 32 PM RAPIDPLUS APPLICATIONS IN
421. ntains the following information LOGIC LOCATION DESCRIPTION AND EXAMPLE Activity The mode name and the type of activity entry mode or exit Example Mode quickSort Entry activity Trigger evaluation Transition source and destination modes and the trigger logic Examples e Default transition standby gt operate Trigger Pb_operate in e Internal transition Mode quickSort Trigger Pb1 in Actions in a transition Transition source and destination modes and the trigger logic Examples e Default transition standby gt operate Actions for trigger Pb_operate in e Internal transition Mode quickSort Actions for trigger Pb1 in Subroutine call The full name of the subroutine user function including the values of the arguments The argument values are in the same format for local variable values in the logic palette Example drawString Hello atX 3 y 5 with GDO Graphic_Display gdo1 THE INSPECTOR WINDOW 4 27 Activating a Stack Frame By default the most recent stack frame is active Double clicking a row in the Call Stack makes it active For any active stack frame the following applies e The corresponding logic line is highlighted in the Logic Editor e The values of local variables for that frame appear in the Logic Palette s Object list e The Step Over button will stop at the next line which is either in the active frame or a less recent stack frame Thi
422. ntheses Records for animals elements and field names txt Notepad File Edit Format Help Age number Animal string Gender string The TXT file 15 cat F contains element 3 cat M values and field 25 dog M names and types 4 dog F in parentheses 1 cat M The elements are separated by tabs Data Store Data_Storel Record Number Number of Records The CSV or TXT file imported into a data store u 6 Update Notice that the Name column is empty The field names and types appearing in the first row became the data store s fields In the data store above the record name column is empty because this column was not defined in either the CSV or TXT file 10 28 NONGRAPHIC OBJECTS Example of element record names and field names imported from CSV and TXT files El Records for animals elements field and record names csy C D This workbook Age number Animal string Gender string contains element values Fluffy 1 5 cat F field names and types Tiger 3 cat M and record names Fido 2 5 dog M Cookie 4 dog F Notice that cell A1 is Mozart 1 cat M empty This empty cell Cinnamon 2 5 dog F informs RapidPLUS that the values listed in Id 4 gt bih Records for animals elements f 14 E Column A will be the A record names in the Records for animals elements field and record names txt Notepad File Edit Format Help TheTXT
423. nts e How to define bitmap image and font objects in the Object Layout e How to use bitmap image and font objects in the Logic Editor BITMAP IMAGE AND FONT OBJECTS 13 2 BITMAP OBJECT aj Name of the image file to be loaded Selected by either typing the file name and path or browsing to the file Opens the object s Properties dialog box E The bitmap object supports the following features e A wide range of image formats BMP DIB PNG JPG ICO MSP PCX PSD e Importing during design time an image by specifying a file e Choice between image embedding and image linking e Image clipping In the Object Palette the bitmap object is located in the Bitmap objects class A bitmap object s default size is 30 x 30 pixels Its dialog box is used to select and manage an image file lt Embedded in Rapid format gt Cancel Image management _ Browse to the desired file Help E Embed in Rapid format Embed in its original format Link to file L Clip Advanced gt PE Relevant for C code generation only Opens a dialog box where you choose whether to generate code for the object The bitmap object will automatically resize to accommodate the image up to the size of the Object Layout NOTE You can also open this dialog box for any named bitmap object in the Object Layout that is a bitmap pasted via the Clipboard Edit Paste Bitmap a bitmap imported v
424. nts button The Edit Elements dialog box opens displaying the array s elements in a table The following illustration shows a partial view of a two dimensional array A stepper box appears for each dimention Edit Elements Element Coordinates A ME The coordinates displayed correspond with the position of the element that is selected in the table The column are numbered according to the number of elements in the last dimension The rows are numbered according to the number of elements in the next to last dimension in this case the first dimension since there are only two dimensions The columns are resizeable 2 Select an element by clicking it in the table or setting it in the Element Coordinates stepper boxes When you select an element in an object array a list presents all application obects of the same type as the default object You can move among the elements using the Ctrl arrow keys 3 For an integer number or string element overtype the element s value For an object element either select an application element from the list or type its name 4 Repeat steps 2 3 for each value you want to change 10 18 NONGRAPHIC OBJECTS Making an Object Array An alternate way to create and populate an object array is through the command Objects Make Object Array To make an object array 1 Select compatible objects on the layout that you want to include in the array 2 Choose Objects Make Object
425. o be displayed below or next to a text string that is already displayed Example You want to display the following text one word at a time DEFINING THE LOGIC 12 25 The logic activities to create this display are LCD drawText Welcome atx 1 y 1 LCD drawText from atx LCD fontStringWidth Welcome 4 y 1 LCD drawText Emultek atx 1 y LCD fontHeight Displaying Images For images to appear on the graphic display you must STEP DESCRIPTION 1 Add one or more For details see Bitmap Object on p 13 2 bitmap image objects and Image Object on p 13 4 2 Specify the bitmap Use the graphic display s drawBitmap atx y or that will be displayed drawBitmap atx y transparentColor functions and its position to specify the object and its position The x y coordinates describe the bitmap s upper left corner As with text strings a bitmap object that exceeds the graphic display s size is clipped Each color used in the bitmap is translated by the graphic display to the closest available color in the object s color palette see Defining the Palette for a Graphic Display on p 12 8 The result is that the bitmap is not displayed in the color depth in which it was drawn It uses the available colors defined in the graphic display s palette Example A cell phone s LCD shows a message icon when there is a message waiting The logic for this is LCD1 drawBitmap Bitmap atx 10 y
426. o oooo o ee ee 1 13 iv CONTENTS Search Pathifor Objects ta is e BE ae all A LL ee a A da 1 14 Defininga Search Path 2 32s ee ba eee eee cia a ee eee 1 14 Locating a UserObject 2 wee eee ok Bae o eS Oe ee ees 1 16 Team Development And Version Control Using XML FlleS 1 16 Checking In Out Projects or Components 00000000004 1 17 Synchronizing Component Changes 0 0 ooo eee eee 1 18 Comparing Application and Component Versions 008 1 18 Merging Applications and Components 0 0 2 0 0200000008 1 19 CHAPTER 2 RAPIDPLUS APPLICATIONS IN XML 2 1 Saving Applications to XML ForMat eee 2 2 Saving Applications and User Objects to XML o ooooo ooo ooo 2 2 Designating XML as the Default Application Format 2 3 Opening Applications in XML Format o o e eee ee 2 3 Opening an XML Application File 2 2 0 eee ee ee eee 2 4 When Errors are Detected in the Opening Operation 2 4 Working With the XML Output 2 0 0 0 0 00 0 0 02000008 2 6 RXD UXO File Structure lt 4 64 66 694 6h ove eA Ree eee EVE He Ow eR 2 6 The CSXA Settings Fille eco aah Sete dc Pas he nrc Wald gee bela awe dee 2 10 Editing an XML file vie Sse Be BEE o ane ee tee te a ee ee 2 11 Changing the Default XML Editor o ooo e 2 12 The Schema Fe
427. ode to be notified about user actions Monitor Select Reroute to be able to control acknowledge or deny user actions Reroute Select to allow Rapid application to accept simulated user actions from the hast application IV Accept external actions Select this check box so the simulation can accept external actions from the host document 2 Select the Accept external actions check box NOTE The Rapid Simulator can accept external actions in any of the routing modes see Setting the Routing Mode on p 18 25 for details about the modes Modifying the Host Document to Send External Actions The host document sends an external action to the simulation via an ActiveX control object that uses the SimulateUserAction method The method s syntax in Visual Basic is RapidSiml SimulateUserAction lt objectName gt lt propertyName gt lt eventName gt where lt objectName gt is the name of the object to which the action is sent e g Switch1 Lamp1 lt propertyName gt is the object s property e g up blinkPeriod If none then enter self lt eventName gt is the event e g make If the event is the assignment of a value such as 8 5 only the value 8 5 is included in the argument HOSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS 18 24 Example A Button object is added in the host document then the following method is added OnButton1_Click RapidSi
428. of structures field s memory allocation method to pointer type 1 2 e eo Click Advanced the Default Structure dialog box opens Select the Pointer check box then click OK NOTE To learn when to use an array of structures field see p 22 14 ADDING MESSAGES TO A USER OBJECT 22 11 Definition only Structure Field Existing Structure Besides adding a definition only structure to a union you can also add it as a field of a single instance structure a nested structure In the illustration below the definition only structure Calls has been added as a field named myCall to the single instance structure outgoingCalls Structure Structure_Calls String number String CallFrom Integer Network_Type Union Communications Structure_Calls incomingCalls String number String CallFrom Integer Network_Type Structure outgoingCalls Number RSSI_Yalue Structure_Calls myCall The fields of the nested structure are indented String number to show the hierarchy These fields cannot be String CallFrom edited directly as explained in Editing Fields Integer Network_Type and Changing Names on p 22 12 To add a definition only structure field 1 Select a single instance structure then click Existing Struct in the Add Field group the Add Structure dialog box opens as shown on p 22 7 2 Choose a definition only structure and if you want the memory allocation method to be
429. ollowing instructions explain how to connect a mode to its logic They include an example which is taken from the XML report for CDPLAYER RPD After the instructions is a chart that illustrates the three steps below NOTE These steps may vary depending on which type of information you want to find To connect a mode to its logic 1 Locate the mode s element in the XML report This element RP lt type gt Mode will have nested elements presenting the mode s transitions and activities HINT There are various ways to locate a mode One way is to search for it using its name in RapidPLUS for example powerOn 2 From one of the mode element s nested transition or activity elements copy the IDREF and search for it in the XML report The search will take you to an RPMethodBlock element Example The powerOn RPXorMode element has an entry activity whose code looks like lt entryActivities IDREF id1299 gt A search for id1299 leads to lt RPMethodBlock type 42 ID id1299 ver 168 gt 3 The RPMethodBlock element has a nested element named RPCompiledMethod which in turn has a nested element named _methodFixed sourcelD Copy the IDREF in _methodFixed sourcelD and search for it in the XML report The search will take you to an RPSource element whose text element contains the source logic text Example The methodFixed sourcelDis lt _methodFixed sourceID gt 1671 lt _methodFixed sourceID gt 25 33 GENERATING RE
430. omatically replaced by references to the substitute user object The original user object is removed from the project Renaming a User Object You can also use the Replace User Object dialog box to rename a user object Renaming a user object is a special case of replacement where RapidPLUS first duplicates the original user object with the new name then uses the duplicate to replace the original user object As in a standard replace operation all references to the original user object are automatically replaced with references to the new name and the original user object is removed from the project To rename a user object 1 Choose File Advanced Replace User Object the Replace User Object dialog box opens COMPACTING FILES 2 Select the user object you want to rename 3 Type the new name in the With user object box Make sure that a user object with this name does not already exist 4 Click OK RapidPLUS notifies you that it was unable to locate the specified user object and that it will duplicate the original user object with the new name then use the duplicate to replace the original 5 Click Yes to continue The user object gets the new name COMPACTING FILES When you delete an object from a RapidPLUS application RPD or UDO file the space that it occupied in the file remains empty As you subsequently add objects to the application RapidPLUS utilizes this empty space for the new objects To eliminate emp
431. ompare projects modes objects user functions and interfaces COMPARING APPLICATIONS IN THE DIFFERENCING TOOL 3 2 USING THE DIFFERENCING TOOL To open the Differencing Tool e In the Application Manager choose View Differencing Tool or click the Differencing Tool button Its window opens in Project view i e the Project tab is selected with the focus on the left pane The application that is currently open in RapidPLUS is displayed in both panes To close the Differencing Tool e In the Differencing Tool choose File Exit Differencing Structure of the Window The window comprises e An upper section that contains a global view of the applications e A lower section that contains more detailed information Each of these sections is resizable Upper section of the Differencing Tool window Project tab Names of the opened applications including paths and revision numbers Differencing Tool File Edit Filters Browse Report Help ala C RAPID 75 APPLICS XPRESS MAIN RPD Revision 115 21 07 03 07 18 31 C RAPID75 APPLICS XPRESS MAIN RPD Revision 115 21 07 03 07 18 31 Project Modes Objects User Functions Interface lt E MAIN MAIN Application Components Application Components E MAIN E MAIN KEYPAD KEYPAD E MAIN_MENU E MAIN_MENU KEYPAD KEYPAD Resources E Resources button_click waw button_click wav lt 4 gt e Differenci
432. on 16 8 Using RPD_MEM DLL in an External Application o o 16 10 Opening and Closing the Channel o o ooooooo 000000 16 10 Sending Data hnne got a i A Lo A 16 12 Getting Datars ria a EA AA i 16 12 Setting and Getting the Transmission Mode o ooo ooo o o 16 14 Setting and Getting the Size of the Queue o o o ooo ooo 16 14 Examples of Code 22 200 0620 creta a ia a win wees ees 16 15 CHAPTER 17 USING ACTIVEX CONTROLS o o oooooo ooo 17 1 Adding or Registering ActiveX Controls in RapidPLUS 17 2 Adding an ActiveX Control 2 ee ee 17 2 Registering an ActiveX Control in RapidPLUS o o 17 2 Distributing RapidPLUS Applications with ActiveX ControlS 17 4 ActiveX Controls in the Object Layout o ooooo ooo ooo o 17 4 Changing Parameters ini a Gon Wa ee ee Sie awe Sab Le Oo 17 4 Viewing and Creating Constant Sets 2 0 ooo o e 17 6 ActiveX Control Windowing and Stack Order Z Order o o o oo ooo oo 17 7 Changing Non Windowed Objects to Windowed o o o oo ooo 00000008 17 8 Supported ActiveX Data Types ee 17 9 New RapidPLUS Data Types 2 0 0 0 0 0 0 0 2b 17 11 xi xii CONTENTS How ActiveX Interfaces are Converted to RapidPLUS Logic 17 15 PrOPErtES 21 eee ee soe Bes ale eh ees 17 17 FUNCU
433. on 118 23 07 03 07 40 03 Revision 114 21 05 03 20 00 06 Phone C Y PowerDff D lj PowerOn f USER_MODES C signalStrengthindication C SimulationPanel C Call_Indication C Battery C X dh 1 avall on zi T ieee 29 Project Modes Objects User Functions Interface Phone C PowerDOff D E PowerOn m USER_MODES C H signalStrengthindication C SimulationPanel C Call_Indication C xk 0 4 LevelOK D Lower section of the Differencing Tool window in Modes view Detailed Information panes Destinations Triggers Actions Activi es Notes Type miam REE MODE Level0K D 4 gt P MODE lt does not exist gt LevelOK D DESTINATION LevelLow DESTINATION TRIGGER amp BatteryT imer count gt 500 TRIGGER ACTION ACTION Browse Differences Browse Matches First Previous Next Last First Previous Next Last Differences found 9 Number of differences Selected mode s name and its first destination and trigger COMPARING APPLICATIONS IN THE DIFFERENCING TOOL 3 14 COMPARING OBJECTS Click the tabs to _ view the selected object s properties parameters and or notes In the Objects view you can see the comparison of graphic nongraphic ActiveX JavaBean and or user objects
434. on italic 0 Bean1 font italicSet 0 lt integer gt nameGet Returns the font name as a string Str1 Bean1 font nameGet nameSet Sets the font name to the specified string Bean1 font nameSet lt string gt Arial bold sizeGet Returns the font size in points Number Bean1 font sizeGet sizeSet Sets the font size in points Bean1 font sizeSet 7 5 lt number gt These functions are not supported for Java code generation Properties JavaBean properties appear as properties of RapidPLUS JavaBean objects provided that their property type is one that is supported by RapidPLUS see p 19 7 for a list of supported types JavaBean properties can be Bound they notify RapidPLUS when their value has changed This type of property can be used in condition triggers and mode activities Or Nonbound changes to their values are not broadcast to RapidPLUS This type of property can not be used in condition triggers and mode activities Indexed an array like property that uses indexes to retrieve a specific value Indexed properties do not appear in the Logic Palette in the Property column they are converted to a pair of RapidPLUS functions lt propertyName gt Get_index lt integer gt Returns the value in the specified index lt propertyName gt Set_index lt integer gt value lt value gt Writes the specified value in the specified index Some properties have both of these functions some properties o
435. ond system had a different control name From version 7 0 RapidPLUS identifies each ActiveX control by its class ID which is the same ID for all operating systems languages and versions of the ActiveX control Old applications can be fixed by opening them on the system in which they were originally created and in the current version of RapidPLUS then saving all the application files 17 24 USING ACTIVEX CONTROLS RAPIDPLUS ACTIVEX BRIDGE UTILITY The ActiveX bridge utility wraps a RapidPLUS application as a unique ActiveX control The application s exported properties and events become ActiveX interface properties and events You can insert the ActiveX control e g in Microsoft Office applications and you can program the control e g through Visual Basic Visual C and MATLAB To generate a registered RapidPLUS ActiveX control you will use the supplied bridge utility AppActiveXGen exe with the RapidPLUS application RPD format only This utility generates an application bridge class that describes the properties and events in a type library TLB file The bridge class together with an ActiveX server component RapidPLUSBridge dll exposes the application functionality to the container application and opens communication with the RapidPLUS Reviewer plug in The relationship between these parts is shown in the following diagram RapidPLUS RapidPLUS RapidPLUS App1 App2 App3 AppAct
436. one so that the left most column is the first column and the upper most row is the first row All horizontal grid lines except for the top border are included within the row immediately above them The top border is included in the top row All vertical grid lines except for the left border are included within the column immediately to their left The left border is included in the first column The relationship between grid lines and cell area is illustrated in the following graphic The top left cell includes the grid lines that make up all of its four borders All the cells in the top row except for the leftmost cell include the grid lines that make up their top right and bottom borders All the cells in the leftmost column except for the top cell include the grid lines that make up their left bottom and right borders All the other cells include the grid lines that make up their left and bottom borders only 15 1 Database Access Object The database access object is used for linking the RapidPLUS application to any database that uses the ODBC Open Database Connectivity driver version 2 0 or higher Once linked to a database the data is available through the object to the RapidPLUS application The data can be used in any RapidPLUS logic and the database can be updated from the RapidPLUS application The database access object also allows you to build and run SQL Structured Query Language query state
437. one dimensional array that has the values of the specified column Array2 Array1 getColumn 3 where Array2 is a 1D array of the same type as Arrayl getNumber Returns the current number of See Usage Examples on OfColumns columns pp 26 13 to 26 16 getNumber Returns the current number of amp Array1 getNumberOfRows OfRows TOWS lt 5 getRow lt integer gt Returns a one dimensional array that has values of the specified TOW Array2 Array1 getRow 3 where Array2 is a 1D array of the same type as Array1 insertColumns lt integer gt copiesOf lt 1D array gt atColumn lt integer gt Inserts the specified number of columns each a copy of the specified one dimensional array at the specified column If the specified column index is greater than the current number of columns then the inserted columns are appended to the array See Usage Examples on pp 26 13 to 26 16 insertRows lt integer gt copiesOf lt 1D array gt atRow lt integer gt Inserts the specified number of rows each a copy of the specified one dimensional array at the specified row If the specified row index is greater than the current number of rows then the inserted rows are appended to the array See Usage Examples on pp 26 13 to 26 16 as related to inserting columns 26 10 lt value gt fromRow lt integer gt fromColumn lt integer gt toRow lt in
438. operties of an Empty Holder In the logic you can clear the holder of its held object and access its properties Example A user object const udo contains an exported constant set property called Colors In the parent application there is a holder object Holder1 Holder1 s default object is const udo NONGRAPHIC OBJECTS 10 14 The following logic can be executed without causing runtime errors Holder1 clear Integer1 Holder1 Colors Red Pl Array The array object is a multi dimensional matrix that can contain the following types of data e Integer Number e String e Objects The array is useful when a value is determined by multiple variables such as an array of temperatures indexed by latitude longitude and altitude The illustration below uses a 3 dimensional array to schematically represent the structure of a multi dimensional array object For obvious reasons however the geometrical representation of multi dimensional arrays breaks down after the third dimension Array of Objects An array of objects is an array that contains a specified type of graphic object i e active objects active primitive objects and groups or a user object For example you can create an array of lamps or an array of user objects each of which contains a specialized lamp An array of objects allows you to carry out identical logic on a series of different objects of the same type by referring to array indexes ma
439. opertyChanged property is True Return Value None PROPERTIES METHODS AND EVENTS 18 47 DDEObjectChanged Notifies the Rapid Simulator about a change in a simulation s DDE object Syntax in Visual Basic DDEObjectChanged ByVal application As String ByVal topic As String ByVal item As String ByVal data As Variant Parameters application As defined for the DDE object in the topic item application data Current value of the item as a variant converted to a string in some host programs Return Value None UserActionFired Notifies the Rapid Simulator about a user action that took place in the simulation Syntax for event handler in Visual Basic UserActionFired ByVal objectName As String ByVal propertyName As String ByVal eventName As String ByVal time As Single ByVal id As Long response As Long Parameters objectName string Object s name as it appears in the application propertyName Name of the object s property that was affected string by the user action e g up eventName string Name of the event e g make time float Time stamp the time elapsed in seconds since the simulation started running ID integer Action ID can be used by the sendAcknowledge method to acknowledge the action HOSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS 18 48 response Placeholder for the response flag to be set by integer the host when the event handler is called to g
440. ops and Branches on p 7 9 Defining a For Loop A For loop can be used in entry activities exit activities actions and user function activities Defining a For Header The syntax of a For header is Loop counter this integer is a The loop increments local variable defined when the the loop counter by For loop is created this integer value for lt Integer lt local counter name gt gt from lt start value gt to lt end value gt step lt integer gt The loop is performed as long as the loop counter is within this range NOTE The start value end value and step can be expressions The Loop counter s initial value is the start value The Loop counter automatically increments by the step value after each cycle of the loop until it reaches the end value When the start value is greater than the end value a backward loop should be created In this case the syntax includes the keyword downTo for lt Integer lt local counter name gt gt from lt start value gt downTo lt end value gt step lt integer gt The loop is performed as long as the loop counter is within this range WORKING WITH FOR LOOPS 7 7 To define a For header 1 In the Logic Palette click the For button The following logic is appended to the Logic Editor s edit line xixi for lt Integer i gt from MAGAM to lt Integer gt step 1 The loop counter is assigned a default name The counter name for the o
441. or Active Modes and Current Logic Lines If the Mode Tree window is open then the current mode i e the mode of the logic line currently being executed is highlighted in yellow In addition a yellow arrow by a mode indicates that the mode is about to be entered or exited A red arrow by the mode indicates that a breakpoint has been set on that mode s entry exit See Adding and Removing Breakpoints on p 4 5 If the Logic Editor display is synchronized with the execution see the following section then the next logic line to be executed is highlighted in yellow When the Debugger pauses at a breakpoint that was set in the Mode Tree or with a Breakpoint button then the first activity for the mode is selected in the Logic Editor but not highlighted Synchronizing the Logic Editor and the Debugger In the Logic Editor and the Debugger there are two options to control synchronization between these tools e Follow Execution When this option is selected each time the Debugger pauses an application the Logic Editor highlights the logic line to be executed next e Synchronize When this option is selected the Logic Editor highlights the logic line that is to be executed next 4 10 DEBUGGING APPLICATIONS Follow Execution vs Synchronize You may be wondering why you would need to synchronize the Logic Editor and Debugger if you have Follow Execution enabled The Synchronize command is useful when you have been br
442. or from one of its ancestors or reachable descendants to a destination that is outside the mode s own subtree Syntax lt mode gt lt mode gt blocking exit from lt parent mode gt as well Example LoadDefs blocking exit from Idle as well ClrMemory blocking exit from Idle as well Month blocking exit from Idle as well Year blocking exit from Idle as well In the VER_TEST state chart once the modes listed above are entered they cannot be exited Only the mode Day the default child of SetState has a transition external to the Idle subtree NOTES Since TestBattery the default child of Idle has a valid transition to SetState whose default child Day is exitable it is not considered a mode which cannot be exited If a child mode can not be exited the warning takes note of the fact that the exit from the child s parent is also blocked VERIFICATION TEST Transitions TRANSITIONS WITH NO TRIGGER Tests all the transitions triggers and issues a warning for any transition that has no trigger i e the transition can never take place Syntax lt source mode gt to lt destination mode gt lt transition type gt Example Off to On D On to Off D In the VER_TEST application the warning indicates that no triggers have been defined for the transitions between the Off and On modes Although they show in the state chart they cannot take place AMBIGUOUS T
443. ou load the application RapidPLUS looks first in the application directory finds a DISPLAY UDO and looks no further Your user object instance is now based on a different user object file than intended If the interfaces of the two display udo files are not identical RapidPLUS will automatically perform the interface update and logic reverification process Therefore be careful about where you locate your user object files and about giving them unique names 1 16 MANAGING PROJECTS Locating a User Object When loading an application RapidPLUS may be unable to locate a user object in any of the search paths described in the preceding section Defining a Search Path In this case a dialog box opens that prompts you to locate the user object file NOTE The new path is not saved You will have to locate the user object file each time you open the application TEAM DEVELOPMENT AND VERSION CONTROL USING XML FILES RapidPLUS can store its components in binary format files RPD and UDO or in XML format files RXD and UXO Using the XML format has advantages when working with version control tools because it is a text format which enables comparison merging and editing of the files outside of RapidPLUS The benefits of developing RapidPLUS projects in XML format are e External tools become available to the project thereby providing greater possiblities and flexibility for team development and version control e Di
444. owsing to other modes in the Logic Editor while the Debugger is paused You can then choose Debug Synchronize to immediately resynchronize the Logic Editor and the Debugger LOGGING APPLICATION EXECUTION The Logger is a debugging utility used to follow the flow of an application as it runs in the prototyper With the Logger you can record and present descriptions of logic execution You can enable logging at any time even while the application is already running in the Prototyper While logging an application you can open the Logger pane in order to view the log as it is being created or close the pane and let the log run in the background You can also suspend and continue logging while the application continues to run Enabling and Viewing the Log You can enable or disable logging and open or close the Logger pane at any time even while the application is running To control logging 1 Click the Enable Disable logging button in the Debugger or the Prototyper toolbar Alternatively choose Logging Enable logging from the Debugger menu 2 Click the Enable Disable logging button to suspend logging and click again to continue An ellipsis in each column of the Logger pane marks the point where logging was suspended and then continued When logging is enabled a log is created even if the Debugger is closed or the Logger pane is not showing LOGGING APPLICATION EXECUTION 4 11 To view the Logger pane 1 In the
445. ox 1 Open the dialog box CBT tab Application View CBT m Routing Mode Select Normal mode to ignore user actions Select Monitor mode to be notified about user actions Monitor Select Reroute to be able to control acknowledge or deny user actions C Reroute 2 Select a routing mode NOTE In Microsoft Office programs the routing mode can also be set in the ActiveX Properties list HOSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS 18 26 Using the Host Document s Programming Language e Use the following code lt RapidSim gt RoutingMode rm lt Mode gt or lt RapidSim gt RoutingMode lt Value gt where value is 0 Normal 1 Monitor 2 Reroute For example RapidSiml RoutingMode rmMonitor MONITORING USER ACTIONS IN THE RAPIDPLUS SIMULATION The host document can observe user actions taking place in the simulation when the Rapid Simulator is in monitor mode In monitor mode user actions flow both internally within the simulation and externally to the host application Monitor mode is especially useful in computer based training CBT An instructor can monitor a student s actions Getting User Actions from the Simulation When the Rapid Simulator is in monitor mode it automatically receives each user action that is generated in the simulation In other words when an object is clicked in the simulation the Rapid Simulator receives information that includes which object
446. packaged has changed See Editing a Package on p 28 10 for more information The Available Folders and Files pane left pane presents the contents of the application folder Files and Folders for Packaging m RapidPLUS Application to be Packaged CDPLAYER RPD C Rapid applics CD_Player Available Folders and Files n The default folder Browse displayed depends A Es on the location of the application s supporting files C Rapid applics CD_Player Docs Sort by Name v Remave t The default folder depends on the location of the supporting files The application folder is selected when all supporting files are located in the application folder or a subfolder Also if a supporting file is located in a different drive the application folder is selected In the above example that folder would be C Rapid applics CD_Player When a supporting file is located in the same drive as the application but in a higher folder the highest folder that the application and supporting file have in common is selected in the above example that folder would be either C C Rapid or C Rapid applics depending on where the supporting files are located 28 5 28 6 APPLICATION PACKAGER All resource files that are used by the application are automatically added to the Folders and Files to be Packaged pane right pane The only exceptions are files that are loaded in runtime
447. pasted element Element from the source application that conflicts with an element in the target application Paste Conflicts Duplicate Elements This application already contains a mode named operate Cancel Help ua Choose the desired operation Replace the APPLICATION element with the PASTED one Keep both Keep both elements Skip Skip ie do not paste the duplicate element The duplicate element in the target application is replaced by the pasted element No paste operation takes place When selected this dialog box appears for each conflict in the current paste operation When cleared the selected operation is repeated for all the subsequent paste conflicts RESOLVING DUPLICATE ELEMENT CONFLICTS 6 17 Resolving Conflicts for Pasted Related Elements As described in Elements You Can Cut Copy and Paste on pp 6 2 to 6 6 there are numerous cases where pasting one element such as an activity brings with it other related elements such as an object referenced by the activity When a duplicate element exists in the target application for a pasted related element a dialog box opens in which you resolve the conflict The duplicate element is used in the pasted logic instead of the related element Related element from the source application identified as in conflict with an element in the target application Paste Conflicts Duplicate Elements Referenced by Pas
448. pe in the following format lt Type gt Array The available types are IntegerArray NumberArray and StringArray The other cells in the first row remain empty e Ifthe wookbook contains element values only the file will be imported as a string array 10 20 NONGRAPHIC OBJECTS Example In this example a CSV file is created in Excel and imported into an array Ej Number array example cs NumberArray The CSV file in 45 100 5 Microsoft Excel 425 120 3 This workbook 16 8 132 4 contains the array 15 5 127 type and element values Array Arrayl Dimensions 2 Default Hold Object z After the CSV file m Ho a has been imported Type Number Value foo the array now contains a two dimensional aS 2 number array 4 2 i Number of Elements Hexadecimal Value iy Element Coordinates E i E Pess Jero Formatting Data in a Text Editor TXT files The Edit Elements dialog box presents the values from the CSV file as numbers The data must be be separated by tabs and should be arranged as follows lt Type gt Array data_11 tab data_12 tab data_13 data_21 tab data_22 tab data_23 data_31 tab data_32 tab data_33 lt carriage return gt If the first line does not include the array type the array will be imported as a string array If the last line is not blank data from the last line of text might not be read DATA OBJECTS 10 21
449. pecify a buffer that does not exist Example GDO1 restoreStatusFrom 3 GRAPHIC DISPLAYS 12 38 Saving and Restoring Area The saveArea and restoreArea functions allow you to save a rectangular area on the graphic display to a buffer and then restore the saved image to the graphic display These functions are particularly useful for achieving a windowing effect such as overlaying a message window on top of the main graphic display NOTE A runtime error occurs and the function is not performed if you call any of the save or restore functions when no buffers have been defined saveAreaAtx y width height Saves the specified rectangular area to the first buffer buffer1 Example GDO1 saveAreaAtx 0 y 0 width 60 height 5 restoreArea Restores the image saved by the last call to saveAreaAtx y width height using the same x y coordinates When created at design time a buffer s restoreArea dimensions and location are initialized at O zero Thus if you call this function on a buffer to which no area has been saved nothing happens Example GDO1 restoreArea DEFINING THE LOGIC 12 39 restoreAreaAtx y Restores the image saved by the last call to saveAreaAtx y width height using the same x y coordinates When created at design time a buffer s restoreArea dimensions and location are initialized at O zero Thus if you call this function on a buffer to which no area has been saved nothing hap
450. pecify in the Selection and Advanced tabs are the basis for the SQL query statement that RapidPLUS sends when the application starts The SQL tab displays the SQL statement Selected table from the database DBAccess_Object1 Ea Accessing a Database There are various ways of accessing data sources depending on your system s driver operating system and the database type Microsoft Access Excel Oracle etc you want to access For specific information refer to the ODBC documentation In the DBAccess dialog box Selection tab and Advanced tab there are two buttons for accessing data sources BUTTON DESCRIPTION ODBC Dialog Used to select an ODBC driver description and then a data source file This method may include a file path which must be present on the system DSN Used to select a data source name NOTE The selected file or DSN must be present on the system when editing and when running the application in the Prototyper or Reviewer Below is an example of a database object that contains a database Selection Advanced SQL Select data source JE RAPID45 Db employee ODBC Dialog DSN Table departments hd Available Fields Selected Fields deptlD deptName Selected database path and file name employees employeeName Selected field fullname i Selected field s full managerlD employeeRate employeelD name in the database phoneNumber deptlD in t
451. pens Example GDO1 restoreAreaAtx 10 y 10 saveAreaAtx y width height in Saves the specified rectangular area to the buffer specified by the in argument A runtime error occurs if you specify a buffer that does not exist Example GDO1 saveAreaAtx 0 y 0 width 60 height 5 in 2 restoreAreaFrom Restores the image saved in the specified buffer at the coordinates specified when the area was saved Example GDO1 restoreAreaFrom 2 restoreAreaAtx y from Restores the image saved in the buffer specified by the from parameter at the specified x y coordinates Example GDO1 restoreAreaAtx 0 y 0 from 2 GRAPHIC DISPLAYS 12 40 SaveArea and RestoreArea Usage Example Pop Up Overlay This section presents an example of how you would use save and restore functions as well as font object string parsing functions in order to overlay a pop up message on a graphic display as illustrated below Power Message Power Message Initial message on the Pop up message overlaid on the graphic display graphic display NOTE If you installed the example applications this application popup rpd is located in the Examples Graphic_Display_Object Popup_Message folder Otherwise you can find it in the same location on the RapidPLUS CD ROM Overview The key objects involved in the example application are Two string objects display_str the display string with an initial value of Please set the system
452. per You can either pause the Prototyper or continue to the next step which automatically pauses the Prototyper 2 In the Application Manager choose Reports Objects Prototyper Layout the following dialog box opens Prototyper Layout CDPLAYER x Percent of Page Size og Cancel Help 25 10 GENERATING REPORTS 3 Either accept or change the Percent of Page Size value then click OK The default size is 100 which means that the image will be scaled to print as large as possible on a single sheet while maintaining the same aspect ratio and orientation The smaller the percentage value the smaller the image and the faster the printout For a complex layout image the time difference may be substantial In the standard Microsoft Windows Print dialog box that opens click Print MODE REPORTS RapidPLUS can generated three types of reports about an application s modes State Chart Plot Mode Tree report Mode Data report Instructions for creating these reports are presented below State Chart Plot This report is a printout of the selected mode with or without its descendants The printout displays the modes in a nested chart format similar to how they appear in the State Chart To generate a State Chart Plot 1 In the State Chart or Mode Tree select the mode for which you want to generate a plot or you can type a mode name in the dialog box In the Application Manager choose Reports Modes
453. perty lt property name gt Parameters propertyName Name of the exported property a string Return Value The value of the property a string LoadRecorderFile Loads the recorder file specified in the argument Syntax loadRecorderFile lt file name gt Parameters file name Name of the recorder file RCD Return Value None LoadState Loads the state file specified in the argument Syntax LoadStateFile lt file name gt Parameters file name Name of the state file RST Return Value None PROPERTIES METHODS AND EVENTS 18 39 Pause Pauses the simulation Syntax Pause Parameters None Return Value None PokeDataToDDEObject Sends the data string value to the RapidPLUS DDE object that is represented by Application Topic Item string arguments Syntax PokeDataToDDEObject lt application name gt lt topic name gt lt item name gt lt value as string gt Parameters Application As defined for the DDE object in the topic item application value Value of the data string Return Value None RecorderCue Instructs the Recorder to play at fast speed Syntax RecorderCue Parameters None Return Value None HOSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS 18 40 RecorderPlay Instructs the Recorder to play the recording Syntax RecorderPlay Parameters None Return Value None RecorderPlayCase Instructs the Recorder to play a use test case from the loaded fil
454. pidPLUS 3 Verifies the application logic EXPLANATION RapidPLUS checks that e Any application logic that references changed object s is still valid Example You paste the activity Frame1 bringToFront The target application has a filled frame of the same name and you choose in Step 1 to replace the application object However the Framel in the target application was dynamic and there is application logic based on its fillColor property Since the pasted Framel is not dynamic the application logic based on the fillColor property is no longer executable and is commented out in the Logic Editor e The pasted logic and its related logic elements are executable by the application Example You paste the activity Switch1 position4 connect The target application has a rotary switch of the same name and you choose in Step 1 to keep the application object However the Switch1 in the target application does not have a position4 property Thus the pasted logic is not executable and is commented out in the Logic Editor 4 If there is invalid logic or you are pasting a user function Displays the Logic Error View window An entry relating to the pasted user function appears in the Logic Error View window with its status indicating whether or not the pasted function s logic is valid in the target application See Chapter 5 Logic Error View for details about invalid logic and working with the Log
455. pidPLUS OpenGL object implements buffer swapping through the redraw function NOTE The redraw function also implicitly calls the glFinish function causing any unexecuted OpenGL commands to be executed The redraw function has to be called in order to make image changes visible in the application Drawing Text The function glCallLists_n type lists is used to write text Its lists argument supports only unsigned bytes represented as a RapidPLUS string Thus the arguments n normally used to specify the size of the display list array and type normally used to specify the data type of the array stored by lists are set internally and their values are ignored during runtime Example Create 96 display lists each one a character bitmap in the specified font starting with character 32 and ending with character 128 The ID of the first display list is 2000 OpenGL1 wglUseFontBitmaps name Times New Roman first 32 count 96 listBase 2000 Set the base display list ID OpenGL1 glListBase base 2000 32 Call a series of display lists based upon the specified string OpenGL1 glCallLists_n O type 0 lists e SIM Ltd 20 11 OPENGL OBJECT 20 12 CODE GENERATION The OpenGL object is fully supported for C code generation for target platforms with OpenGL support except for the WGL functions see Implementing Raster Images on p 20 10 An OpenGL context is created for each OpenGL object in the applic
456. ple In this example the JVM is instructed to listen for Debugger connections using TCP IP in port 25000 RPJavaManager JVMArgument1 Xdebug JVMArgument2 Xnoagent JVMArgument3 Xrunjdwp transport dt_socket server y suspend n address 25000 After opening an application containing JavaBean objects you can attach to the JVM running inside RapidPLUS using any Java tool that supports remote debugging Unfortunately most commercial Java tools support this only in their enterprise edition but you can use free tools such as NetBeans http www netbeans org DISTRIBUTING APPLICATIONS WITH JAVABEAN OBJECTS If you are packaging your application for running in the Rapid Reviewer do not forget to include each JavaBean object s JAR file and instruct the end user to copy the file s anywhere in the RapidPLUS search path as explained on p 19 2 When the end user runs the application in the Reviewer RapidPLUS will search for the appropriate Java Virtual Machine JRE or JDK version If the end user s system doesn t have this version installed RapidPLUS will search for a suitable JRE or JDK installation If RapidPLUS cannot find a suitable installation the application will not run see p 19 19 for more information When you distribute JavaBeans that you developed you can compile the Java classes without debug information and put the compiled classes in the JAR file in order to save space CODE GENERATION Jav
457. plicate constant objects e How to use constant objects in the Logic Editor e How to generate constant objects for RapidPLUS CODE only 11 2 CONSTANT OBJECTS a lo USING CONSTANT OBJECTS Constant objects are defined in the Object Layout For all constant objects other than constant sets their values cannot be changed by the logic during runtime Constant integer constant number and constant string objects are used the same way that you would use any integer number or string object in RapidPLUS Constant array objects behave like any array object in RapidPLUS In the constant set object you define a set of integer constants like a C enum specifier In the Logic Palette each constant in the set appears as a read only integer property of the object The values of these integer properties cannot be changed by the logic during runtime The main advantages of constant objects are in the context of C code generation for RapidPLUS CODE only In the context of simulation only you could use constant objects whenever you require an integer number or string value that is not subject to change during runtime By using a constant object you can give this literal value a meaningful name thereby enhancing the readability of the application logic ADDING CONSTANT OBJECTS In the Object Palette all of the constant data objects can be found in the Constant Data class To add a constant integer number or string object 1
458. plication If You can also choose Debug Step Into or press F7 the highlighted logic line is a call to a user function Step Over executes the entire user function and then stops at the next logic line m Step to the first or next logic line in the application If al Step Over This button has special functionality when used with the active frame in the call stack See Activating a Stack Frame on p 4 27 You can also choose Debug Step Over or press F8 Fee Step to the first or next logic line in the application that matches the logic items selected in either the Filters menu or the Debug and Logging Options dialog box Filters tab See Filter Options on p 4 19 for details Step by Filter You can also choose Debug Step by Filter If the application requires user input in order to continue the application will remain idle with the status message Prototyper Running after you ve resumed the Debugger You must provide the required input for your DEBUGGING APPLICATIONS 4 8 application to continue e g click a pushbutton or change a switch position Onscreen Notifications As you run an application with the Debugger the application s status is reflected through one or more of the following notifications e Status messages are displayed in the status line and the Debugger window s title bar e The current mode in the Mode Tree is highlighted e The logic line which is
459. ponent value Target G component value Target B component value Example A cellular phone displays an image whose background color changes for incoming calls The logic to simulate the color change would be similar to The original image Imagel setColorForRGB_Ranges Array1 Array1 During runtime the pale gray background color changes to pale yellow The change affects only the pixels with RGB values 192 192 192 13 10 BITMAP IMAGE AND FONT OBJECTS Imagel setColorForRGB_Ranges Array2 EK N During runtime the pale gray and the dark gray change to pale yellow The change affects all pixels with RGB values in the ranges 128 192 128 192 128 192 par VININ ojana O0 mn jr 2 4 5 128 e e 2 You can achieve a different color effect by adding another column to the array and defining different target colors for the two shades of gray Using Transparent or Semi Transparent PNG Images When a PNG image file is loaded into an image object its alpha channel is used to make the image transparent or semi transparent in the Object Layout and Prototyper Use of the alpha channel enables the PNG image to be blended with any objects placed under it and with the application background If an image object has a transparent color defined in its Colors Edit dialog box this transparent definition will take precedence over the alpha channel value An image object s
460. port sn x ci a eee PE A 25 5 Object Tree Report eins n Rd ROA E ate ge Se a ew 25 6 Object Data RepOrE r aa nyia a ri A pence ae lar andes eases da 25 7 Prototyper Layout Report o o ooo eee 25 9 ModeRepoOrtS iii a A A Gui Bld AA abo des de 25 10 State Chart Plot AS Ge ee A Se aE 25 10 Mode Tree Report oone pa ro e Se a Eta 25 12 Mode Data Report fiers ce whale a a Re ii ii 25 13 User Object Interface Reports 2 ooo oo e 25 15 Project Component Reports e 25 17 Component Dependency Tree Report 2 0 oo coco o 25 17 Component List Reportss ia A Gate pa Seed GS 25 18 Detailed Component List Report o ooo 0000000005 25 19 Target Graphic Displays Report o ooooo oo o oo 25 19 Coverage Test Reports iy aiea es BE EN GP DA LE bee Ga 25 20 XML Report Sk AS ee ee BE Ee Ge eA E 25 22 Generating an XML Report sasaaa ee eee 25 23 Understanding the XML Reports ooo o o ee 25 24 RapidPLUS Object Elements and Their Nested Tags o o o 25 25 Mode Elements and Their Nested Tags 2 2 2 0 0 0 0 020 0000 25 30 Logic Related Elements 0 0 0 eee ee ee ee eee 25 31 Following the Path from a Mode to Its Logic 2 2 2 eee eee 25 33 CHAPTER 26 OBJECT ENHANCEMENTS o ooo ooo 26 1 One Dimensional Arrays 1 ssssese eccerre reece 26 2 Searching Backwards 1 e 26 2 D
461. pplication D RAPIDIAPPLICSWER_TEST RPD UNREACHABLE MODES there is no transition to the mode and it is not a default child wWarmB oot LoadDets ChMemory MODES THAT CAN NOT BE EXITED there is no transition out of the subtree LoadDefs blocking exit from Idle as well ChMemory blocking exit from Idle as well Month blocking exit from Idle as well Year blocking exit from Idle as well TRANSITIONS WITH NO TRIGGER Off to On D On to Off D AMBIGUOUS TRANSITIONS same trigger simultaneously activates more than one transition Trigger Pb_power in Day to Month D Day to On D PROBLEMATIC TRANSITIONS FROM PARENT TO CHILD transitions from parent to child o On to Selftest D PROBLEMATIC INTERNAL TRANSITIONS Condition only internal transitions that may waste On Internal OBJECTS NOT REFERENCED logic does not reference objects Battery_ind dle_lamp EXAMINING LOGIC ERRORS You can use the warnings in the Verification Test window to locate errors in the Mode Tree and Logic Editor It is up to you to make required changes To examine errors 1 Select the warning in the window that you want to examine 2 Use the Check menu commands or toolbar buttons as follows EE e Check Select Selects in the Mode Tree and the State Chart the mode Ctrl L where the error was detected Use this option if you just want to i
462. pplication or a user object and receive unexplained errors in the Logic Error View window they may be the result of changes in a related user object Try checking out the relevant files again When work is completed developers should check in their components If two or more developers have worked on the same component they should merge their version with the latest checked in version RECOMMENDATION After making all necessary changes each developer should compare the changed version to the checked in version to see the changes When developers are working on components where the changes interact such as user object interface it is important that they coordinate their releases Otherwise RapidPLUS may find logic errors when opening a component affected by another developer s changes TIP If you make a change in a user object that causes logic errors in other user objects e g renaming an object that is referenced elsewhere you should verify the logic of the related user objects save them and check them in The project manager who is responsible for the version build should use a script to check out all released files to a network folder and make the version The project manager should perform all the manual activities to complete the build such as integrating the output of the external tools into the RapidPLUS files to produce a complete working version When all necessary files have been checked in and merged into a
463. processor instructions e g define the file must be preprocessed to redefine them otherwise those definitions cannot be imported If the file contains illegal C definitions the result may be unpredictable but will not damage a RapidPLUS application IMPORTING STRUCTURES FROM A FILE 22 25 a N Translated text which contains a list of lISource text file struct tDate structures and fields that will be added to the int year Rapid application unsigned char month ll unsigned char day b fore translation my Date Structure tDate is replaced with struct tDate year Integer signed int typedef struct tDate myDate month Integer unsigned char day Integer unsigned char struct tPersonNode End Structure tAddressNode int index street String buffer string size 32 char name 64 streetNum Integer signed int appartNum Integer signed int struct tAddressNode city String buffer string size 32 char street 32 TRANSLATION country String buffer string size 32 int streetNum End int appartNum Structure tPersonNode char city 32 index Integer signed int char country 32 name String buffer string size 64 address address Structure tAddressNode birthDate Structure tDate myDate birthDate workStartDate Structure tDate myDate workStartDate End Structure tBadStruct ulongField lt undefined gt RP_ULONG struct tBadStruct ushor
464. r constant string constant set const constant array By default only one C header file is generated for the entire application You can generate a separate file for the constant object define and enum definitions by selecting the Separate file for define option in the General tab of the Code Generation Preferences dialog box as explained in the Generating Code for Embedded Systems manual NOTES At code generation the const definitions are always placed in the application s source file When generating code for the constant set object the Code Generator checks for uniqueness of its property names among all the RapidPLUS object names If the Code Generator finds a name conflict it changes the enum item name from itemName to enumName_itemName 12 1 Graphic Displays Graphic display objects simulate display screens of devices such as televisions cell phones or digital watches The graphic display is comprised of a matrix of pixels that change color according to the functions used in the object s logic This sample graphic display presents text and an image There are two types of graphic displays e Graphic displays which support up to 256 colors e True color graphic displays which support over 16 million colors This chapter presents e A brief summary of the steps necessary for defining a graphic display e How to add and define a graphic display e The logic used to change colors during runtime
465. r 1 po m Century 1990 vs 90 Separator 2 Al i Upper Case Separator 3 po Example pago Initial Value J Current Date Custom Date DMY 04 09 7 2003 4 OPTION DESCRIPTION Format Sets the format in which the date is displayed in the application either day month year month day year or year month day Day Name Determines whether to include the day s name and if so in which format Month Name Sets the format for the month Day Leading Zero When selected adds a zero before single digit days e g 04 Century When selected displays the year with four digits e g March 1 2004 appears as Mar 1 2004 Upper Case When selected all letters appear in uppercase e g MAR 1 04 TIME OBJECTS 10 37 OPTION DESCRIPTION Separators Sets the characters that separate the day name day month and year e g Sun 16 4 04 The first separator is not available when the Day Name option is set to None Initial Value Sets the date to either the current system date or to a manually selected date Time The time object allows you to set a time and display it in an application Format E 12 Hou fam mE Pm Cancel Unlimite PM Leading Zero i Show Seconds Separator i Example 10 29 AM m Initial Value IE i Current Time Custom Time 10 29 OPTION DESCRIPTION Format Sets the format in which the time is displayed in the
466. r 2 and the Data Type integer number or string This step is optional because if you don t perform it RapidPLUS will import the file and overwrite the default settings in the dialog box DATA OBJECTS 10 19 2 Click the Import button 3 The Open Import File dialog box opens Select a file and click Open NOTE The Data Type in both the imported file and the array must match otherwise RapidPLUS will ask you if you want to replace the current array with the imported one The imported values are added to the array NOTE During runtime the loadFromFile function can be used to import data from TXT CSV and RAR files Formatting Data in Microsoft Excel CSV files When you create a Microsoft Excel workbook that will be imported into an array be sure to save the workbook in the CSV comma delimited format NOTE If your system s default language uses a delimiter other than a comma you must manually change the system s default delimiter To do so open the Regional Options dialog box from the Control Panel Click the Numbers tab and change the List Separator selection to a comma The imported file can contain data for the elements only in which case the array will be a string array or data for the elements and array type number integer and or string Keep these points in mind when creating a CSV file e To designate the array type the first cell in the workbook A1 must present the array ty
467. r Bp OT Sieh Sage Goh ee A 10 36 A EG EE VR lie BO Se et et Bg AE SE Se OA 10 37 TimerTick External Object 2 0 2 ee eee 10 38 Signal Objects ci oe oS Sa A E Bee Pa ot eh Sete 10 38 EVERT a ar A AA E AA A EE A abe A el TS TA andes ergs ak Ae Be 10 38 SOUT Cri ai A Si Cotas uote ce oad atest Soe ae 10 39 USELCUTSOR cio Fl eee ie le Eo Renee EIA SD Ee 10 40 Messagen eed ides gen AS AA A SGT Ae te A ee 10 40 System Objects cios as ER ed bw Pe ae See ee 10 42 ASC ind id a a Ge ons Gh cen Li oi 10 42 Keyboard a as e cin Sets ear thee Sa ey Ge a aces A ta ci 10 42 LANGUAGE ica ges eae aa A aR Ey em Sale ora eet ee 10 43 Mouse 5 4 3 308 Gong a she sob A Sa he e al ed a We ae ene ee 10 45 StateMachiMe s s 2 aS wer ieee ee a ea A ae Re Ss Ae a Pee 10 45 SysteMCursors css ar A ae ae ae Tey bw AE A 10 46 SystemDate mi toca 00S 4 oes bee oe fee eet hea bakes eh ci 10 46 System TINS it east A ae atte ge eR nico 10 46 CHAPTER 11 CONSTANT OBJECTS o o 11 1 Using Constant Objects accu bs acd ea A OS ee a 11 2 Adding Constant Objects 2 6 ee eee 11 2 Using the Duplicate Operation to Add a Constant Object 11 3 Adding a Constant Set Object 2 2 ee eee 11 4 Importing Data to a Constant Set ObjeCt o o o oooooo ooo o 11 5 Duplicating Constant Objects 2 eee 11 6 Duplicating Constant Integer Number String and Array Objects 11 7 Duplicating Constant Set Objects
468. r according to the host program s procedures for adding an ActiveX control The object will look similar to oO O a la Rapid Simulator h Selecting the RapidPLUS Application to Be Simulated You select the RapidPLUS application in the Rapid Simulator s Properties dialog box The RapidPLUS application can be in any of the following file formats RPD RVR UDO RDO or ZRP zipped application It can also be the URL of a zipped application To select a RapidPLUS application 1 Open the Rapid Simulator Properties dialog box according to the program s procedures Please refer to the following table 18 4 HOSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS In Microsoft Office programs You reach it from the ActiveX Properties list Properties e Click here RapidSim1 RapidSim p pe then Alphabetic categoria click here Name RapidSim1 AcceptExternalActions True False False 1 dmNormal True True 130 5 145 5 True INotifyOnApplicationPr True INotifyOnDDEObjectCt False lOnTop False Placement 2 PrintObject True RecorderControlsOn False Recorder Visible False In Macromedia Authorware You reach it from the ActiveX Control Properties Borders True DisplayMode 1 Embedded True EmbedinHost pplication False LastUserActionE vent Cancel Click here dialog box LastUser ctonid 842150451 LastUserActionObject LastUserActionProper
469. r behavior between windowed and non windowed ActiveX controls The stack order of non windowed controls that is controls that run directly in the client s window in our case the Prototyper can be controlled exactly like that of any other graphic object as explained on p 21 2 Windowed controls that is controls that run in their own window are always drawn on top of non windowed RapidPLUS graphic objects and non windowed ActiveX controls even if the non windowed object is a child of 17 8 USING ACTIVEX CONTROLS These options are onl z z enabled if the contro EA Obiect Creation is non windowed by definition the windowed control You can however control the stack order among windowed objects Windowed Activex Illustration of the stack order behavior of windowed objects IN OBJECT LAYOUT DURING RUNTIME NOTE All RapidPLUS graphic objects are non windowed except for the text window message and graphic multimedia objects such as digital video Changing Non Windowed Objects to Windowed In addition to the impact on stack order a control s window status windowed vs non windowed can affect other aspects of its runtime behavior Example The Microsoft Office Textbox control is by definition a non windowed object When run in the RapidPLUS Prototyper selected text is not highlighted on a reversed background If you change the control to a windowed object the selected text is properly highlight
470. r of group e BlinkSpe vitch E ch Cancel Text Display Help Group Round Dial Round Lamp Group2 2 Select the objects all objects are selectable Colors used in the list are COLOR DESIGNATES Black Graphic objects user objects groups that are not in edit mode members of groups that are in edit mode OBJECT LAYOUT 27 11 COLOR DESIGNATES Blue Nongraphic objects Gray Groups that are in edit mode members of groups that are not in edit mode NOTE If you select a gray group member RapidPLUS places the group in edit mode NOTE When a hidden object is selected its location on the object layout is indicated by a frame The selection itself does not change the object s hidden state To show the selected object use Layout ShowObject Importing Bitmap Files Multiple selection is available in the Import Bitmap File dialog box File Import Bitmaps RapidPLUS assigns the original file name to each bitmap object created by the import When the original file name is not a valid RapidPLUS name it is replaced by the generic name Bitmap followed by a consecutive number Bitmap1 Bitmap etc If an existing bitmap object has the same name as a file selected for import a consecutive number is added to it User Object Properties Dialog Box This dialog box has been expanded and divided into four tabbed pages It is used for creating exported properties events messages and fun
471. ration Preferences dialog box If the initial string exceeds the length limit a warning will prompt you to either truncate the initial text or increase the limit Size Definitions for Individual Array Objects You can set the maximum size of a one or two dimensional array in its Advanced dialog box To change the default maximum size of a one or two dimensional array 1 In the Array dialog box click the Advanced button 2 Type in the maximum size of elements Typing a zero will cause the object to use the global size set in the Code Generation Preferences dialog box If the initial string exceeds the length limit a warning will prompt you to either truncate the initial text or increase the limit If the array is a string array you can also type in a maximum length that applies to all the array s elements If the array is an integer array you can set the data type for its elements as described in the following section DATA OBJECTS 10 33 Element Data Types for Individual Integer Arrays In the integer array s Advanced dialog box you can decrease the size of the C code that is generated for each element by selecting a primitive data type long 32 bit short 16 bit or char 8 bit By default the elements are generated with a set structure for a Rapid integer described below in the Definitions for Individual Integer Objects section Using Integer Arrays with Primitive Element Types in the Logic Integer arrays
472. ray1 insertColumns 2 copiesOf Array2 atColumn 3 If Array2 is 5 7 then the result is 14 15 16 17 24 0 0 27 34 0 0 37 44 45 46 47 Empty cells hold default initial values If Array2 is 1 2 3 4 5 6 then the result is 14 15 16 17 24 0 0 27 3 31 32 34 0 0 37 4 41 42 44 45 46 47 5 0 0 0 0 0 0 I Rows were added to accommodate 6 0 0 0 0 0 0 the larger array Array1 insertRows 2 copiesOf Array2 at 20 TWO DIMENSIONAL ARRAYS EXTENDED FUNCTIONALITY If Array2 is 1 2 3 4 5 6 then the result is 3 31 32 33 34 35 36 37 Overwriting with Another Array Array1 overwriteWith Array2 atRow 3 atColumn 4 If Array2 is 1 2 1 5 6 2 7 8 3 9 10 then the result is 1 2 3 4 5 6 7 1 11 12 13 14 15 16 17 2 21 22 23 27 3 31 32 33 37 4 41 42 43 47 5 0 0 0 0 Row added to accommodate the overwriting array Empty cells hold the default initial value 26 15 OBJECT ENHANCEMENTS 26 16 Pulling Pushing Columns Rows The examples here are based on a two dimensional string array with the following contents and an initial value of AOS ones fuera 2 cao eras W 4 os fe fs 6 Dos 7815156 O After Array1 pullRowsFrom 3
473. re definition If the definition doesn t have a tag name the structure type is named tNoname_N where N is a counter of currently translated inline structures Inline structure translated as separate definition Properties Events Messages Functions Accept Example of inline structures Y tNoname_1 struct tStructl int a struct int x int y coord struct tStruct2 Structure tNoname_1 TRANSLATION struct tTag1 float x char name Htagl Translated field of inline structure type Arrays A one dimensional signed char array e g char field1 32 is translated as a string allocated as a buffer field rather than as an integer array of char data type An unsigned char array is interpreted as an integer array A two dimensional signed char array is interpreted as a one dimensional RapidPLUS string array For example signed char array2 10 32 is interpreted as a string array of 10 strings containing 32 characters each An array of structures field is translated only when it is explicitly defined as an array field as struct tStruct2 starr 20 An array of structures that contains an array of structures field cannot be imported IMPORTING STRUCTURES FROM A FILE 22 29 Pointers A pointer of signed char type e g char p is translated as an integer pointer field having data type char An unsigned char pointer is translated as an integer fie
474. rea Mouse The mouse object provides two services e It makes the system mouse position and events available to the logic e It assigns cursors either system see below or custom see UserCursor on p 10 40 to graphic objects and switch positions The assigned cursor appears during runtime when the mouse is located over the object or position StateMachine The StateMachine object makes public an aspect of the RapidPLUS state machine The state machine responds to events by dynamically calculating the next appropriate state and then deactivating and activating the modes required to bring the system into this state The StateMachine object has one condition has events This condition checks whether or not there are events located in either of two internal queues the User generated event queue or the Logic generated event queue See the Code Generation Preferences dialog box for more information about these queues This condition is useful for synchronizing calls of user object exported functions Sometimes an exported function call switches on a sequence of logical operations transitions inside the user object While this sequence is being performed the has events condition is true When the event queues are empty the has events condition becomes false NONGRAPHIC OBJECTS 10 46 SystemCursors RapidPLUS provides twelve predefined cursors which appear in the Objects list of the Logic Palette as a subset of t
475. rencing Tool cont exiting 3 2 filters 3 8 going to items 3 9 navigating among differences and matches 3 7 opening 3 2 selecting applications 3 4 selecting comparison filters 3 8 window structure 3 2 DisplayMode property 18 34 DLL object 26 21 Document Manager Simulator 27 5 DOORS 27 2 double byte fonts for language localization 10 43 using with the font object 13 12 drawArcAtcx cy radius fromX fromY toX toY 12 28 drawBitmap atx y transparentColor example of usage 12 26 drawCircleAtcx cy radius 12 30 drawEllipseAtcx cy horizRadius vertRadius 12 30 drawFilledCircleAtcx cy radius 12 30 drawFilledEllipseAtcx cy horizRadius vertRadius 12 30 drawFilledRecAt width height 12 26 drawPixelAtx y 12 19 drawRecAtx y width height 12 26 drawText atx y 12 22 drawTransparentText atx y 12 23 to 12 24 example of usage 12 24 dump 12 43 duplicate interface element defined 6 7 duplicate mode conflict when pasting 6 13 defined 6 8 duplicate object conflict when pasting 6 13 defined 6 7 duplicate user function conflict when pasting 6 13 defined 6 7 duplicating constant objects 11 7 constant set as a user object property 27 15 nongraphic objects 10 6 E edit 15 11 editing invalid logic 5 2 to 5 7 nongraphic objects 10 5 package PAK files 28 10 projects 1 7 XML applications 2 11 to 2 13 Embedded property 18 34 embedding bitmap objects 13 3 EmbedInHostApplication property 18 35 error messages database access objects 15
476. ribed here XML REPORTS 25 25 RapidPLUS Object Elements and Their Nested Tags This section presents important tags for the application and its objects RPApplication Element This element tag contains generic information about the application Its nested tags include TAG _name DESCRIPTION Name of the application _objectTree ID of the root object see RPTopPanel on p 25 26 _logicTree ID of the root mode see RPRootMode on p 25 30 RPDatabaseDescriptor Element This element tag contains additional information about the application such as properties from the Application Properties dialog box libraries that the application requires and information related to C code generation Its nested tags include TAG count DESCRIPTION Number of libraries that the application requires For each required library there are several nested tags that describe the library including _name name ofa required library This name uniquely identifies the library and allows RapidPLUS to find it This tag is interpreted differently according to lib type _instanceCount number of instances of objects from this library in the application lib type type of library The types are J JavaBean object R RPX object U user object and X ActiveX object 25 26 GENERATING REPORTS TAG _info DESCRIPTION Information from the Application Properties dialog box including s
477. rification Test window you can run the verification test set options and view logic warnings To run a verification test 1 In the Application Manager choose View Verification Test 2 In the Verification Test window choose Options Options Set the options you require see description below and click OK Verification Options x A Project wide Subtree Name Cdplayer Cancel AN A Objects Help E lb LA Transitions OPTION DESCRIPTION Project wide Select to test the whole application parent application and user objects When selected the Subtree Name box becomes disabled Subtree Name If not running a project wide test select the topmost mode in the Mode Tree or type the mode name The test will run only on that mode s subtree Mode Transitions Select categories to be included in the Objects verification test In the Verification Test window choose Check Check or click the Start Test button When all selected categories have been checked the logic warnings if any appear in the Verification Test window For a project wide verification test results are listed in the order of the components in the Project Components list Each component section is preceded by the component name and full file path EXAMINING LOGIC ERRORS 9 3 The following illustration is a sample of a verification test erification Test VER_TEST from V ER_TEST Check Options Help eje re A
478. rns the day of the month as an Int1 MonthView date integer dayGet daySet Sets the day of month to the specified MonthView date daySet lt integer gt integer 9 hourGet Returns the hour of the day as an Int1 MonthView date integer hourGet hourSet Sets the hour of the day to the specified MonthView date lt string gt integer hourSet 14 is Valid Returns 1 if the property contains a amp MonthView date valid date and time Otherwise returns _ isValid O minuteGet Returns the minutes of the hour as an minutesDisp1 contents integer MonthView date minuteGet minuteSet Sets the minutes of the hour to the MonthView date lt integer gt specified integer minuteSet 45 monthGet Returns the month of the year as an amp MonthView date integer monthGet gt 6 monthSet Sets the month of the year to the MonthView date lt integer gt specified integer monthSet 6 HOW ACTIVEX INTERFACES ARE CONVERTED TO RAPID L FUNCTION DESCRIPTION EXAMPLE now Sets the date and time to the current MonthView date now date and time secondGet Returns the seconds of the minute asan Intl MonthView date integer secondGet secondSet Sets the second of the minute to the MonthView date lt integer gt specified integer secondSet MonthView2 date secondGet yearGet Returns the year as a 4 digit integer amp MonthView date yearGet 1998 yearSet Sets the year to the specified integer MonthView date lt integer gt yearSet 2000
479. rt as viewed in the Report Viewer looks like this W User Object Interface report for TEL_MAIN File Edit Heb ARE RAPID APPLICATION TEL_MAIN 02 02 03 01 03 38 PM User Object Interface report l tel_main Properties Properties Name character Type String Parameters Text nil String size limit Default 128 Events l sendKey_in 2 shortClear_key_in 3 longClear_key_in 4 numKey_in Messages Name keyPad Type Union Properties l Name numKey Type Structure Properties l Name scanCode Type String Parameters Length Default 128 Pointer No GENERATING REPORTS 25 16 To generate a User Object Interface report 1 In the Application Manager choose Reports Interface the User Object Interface Report dialog box opens User Object Interface Report Eg Include A Properties fA Events F Internal functions A External functions A Messages Cancel Emos m Report scope E Selected application Selected application and its user objects 2 By default all of the interface elements are included in the report i e all of the elements in the Include group are selected To exclude information from the report clear the unnecessary check boxes in the Include group 3 Under Report scope select whether the report is for the current application only or for the application and its components 4 Click OK the Report Viewer opens displaying the interfac
480. rt button 3 In the Open Import File dialog box select a file and click Open NOTE The number of fields and field types in both the imported file and the data store must match otherwise RapidPLUS will ask you if you want to replace the current data store with the imported one The imported values are added to the data store 4 Optional If the imported data did not include record names add them in the Name column Formatting Data in Microsoft Excel CSV files When you create a Microsoft Excel workbook that will be imported into a data store be sure to save the workbook in the CSV comma delimited format NOTE If your system s default language uses a delimiter other than a comma you must manually change the system s default delimiter To do so open the Regional Options dialog box from the Control Panel Click the Numbers tab and change the List Separator selection to a comma The imported file can contain data for the element values only or data for element values field names and or record names See the Usage Examples on p 10 27 10 28 to learn how to enter data in Excel workbooks Here are points to keep in mind when creating a CSV file e When you give names to data store fields you must follow the conventions for naming RapidPLUS objects see Modification to the Rules for Naming Objects on p 27 9 If you do not follow these conventions the file cannot be imported e Field names must specify
481. s can be especially helpful to step over recursive functions THE INSPECTOR WINDOW Sometimes when an application is running in the Prototyper you will want to know the current status of graphic and nongraphic objects RapidPLUS provides this information in Inspector windows An Inspector is a stand alone window that displays status information about an object while the Prototyper is running A separate window opens for each object and any number of Inspector windows can be opened An Inspector is a debugging utility which can be accessed with or without the Debugger DEBUGGING APPLICATIONS 4 28 Typical Inspector windows looks like these two windows Refresh button to enable continuous updating of values a Round Lamp x a en po a uo CON View a list of objects that were previously opened in Inspector windows List of the object s parameters and properties and their values Click a property s button to open an Inspector window for the object TT property El Round Lamp x la fx_Lamp blinkPeric y Opening Inspector Windows When the Prototyper is running Inspector windows can be opened from the Debugger the Logic Editor and the Logic Palette Also once an Inspector window is opened you can view other application objects in it To open the Inspector window from the Debugger The Prototyper must be started a 1 Choose Inspect Inspect or click the Inspect button the Rapid Inspect
482. s for double byte and Unicode The maximum length also applies to string elements of string type arrays string fields in data stores and string fields in message structures e Arrays 65 535 elements e Data stores 65 535 records You can change these defaults in the Code Generation Preferences dialog box To specify global maximum sizes 1 Open the Code Generation Preferences dialog box by choosing Code Generator Code Generation Preferences in the Application Manager 2 Select the Data Sizes tab and set the sizes as necessary Each new string array and data store that you add to the application automatically uses these global sizes However you can override the default maximum length or size for a specific object via its Advanced dialog box Also previously added objects retain their specific sizes in their Advanced dialog boxes Example If you had already defined a string object with an initial value of Hello World and you then change the default string length to 10 that is less than DATA OBJECTS the length of the string s initial value the string object s dialog box will hold the maximum string length of 11 Size Definitions for Individual String Objects You can set the maximum size of a string object in its Advanced dialog box To change the maximum length of a string object 1 In the String dialog box click the Advanced button The Advanced dialog box opens Advanced String1 x Maxim
483. s interface to the parent application are removed from the interface and replaced by new same type same name objects i e properties events and functions e Functions with the same name in both the user object and its interface to the parent application but with different argument types are modified so that the argument types in the interface match those in the user object e Messages unions are processed recursively down to their fields The fields receive the same treatment as exported properties e New exported properties and functions that do not exist in the user object s interface to the parent application are added to the interface Automatic Interface Logic Reverification An application needs logic reverification when an update involves the removal or change of properties or functions Invalid logic is displayed in the Logic Error View where you can double click any line to open it in the Logic Editor In the Logic Error View window the lines of invalid logic are grouped by user objects and the user objects are listed alphabetically OPENING A PROJECT Missing or Defective User Objects A project that is missing one or more user objects or contains a defective graphic user object can be opened When it is first opened the Logic Error View opens notifying you that the user object is missing A missing graphic user object appears as a crossed out rectangle in the Object Layout This rectangle will also appear in
484. s message interface You should therefore not develop any logic inside the user object since all such logic will be deleted from the generated code Nor should you use message functions or events send deactivateAny anyMessageReceived messageReceived is active since message logic is also deleted when code is generated for a data container 2 Allocate an instance of the user object where you can pass it to all the components that need it the main application is a good choice 3 In every component that needs to access the data container define a A holder without default for the data container user object b An exported init function that will allow the main application to initialize the holder 4 In the main application add a call to the init function of each component that uses the data container with the data container instance as a parameter 22 23 USER OBJECTS WITH MESSAGES 22 24 IMPORTING STRUCTURES FROM A FILE Structures can be imported from text files usually h files However before importing them the files must contain certain structure definitions that RapidPLUS can translate into user object structures The illustration on the next page shows e A text file that contains the appropriate structure definitions e The text as translated by RapidPLUS e The resulting structure in a user object e A message about a structure that could not be imported NOTE If the source text file contains pre
485. s of special OpenGL GLU WGL constant properties Constants Ys GLU is an OpenGL extension WGL is a Microsoft extension that provides a higher level that allows OpenGL to run interface to complex tasks under Windows The OpenGL such as perspective setting object supports the WGL texture mapping and drawing functions that allow you to use complex objects Windows fonts to write text with OpenGL The OpenGL library and its extensions GLU and WGL contain more than 450 functions of which approximately 100 are supported by the OpenGL object Most of the unsupported functions are simply overlapped functions i e similar functions that take different types of arguments The OpenGL object may support only one version thus simplifying the interface without sacrificing functionality For example of the functions glVertex2f glVertex2i and glVertex2s the OpenGL object only supports glVerex2f Other unsupported functions take arguments such as void or bit arrays data types which RapidPLUS does not support Purpose of This Chapter This chapter explains how to define and use an OpenGL object in a RapidPLUS application It assumes that you are already familiar with the OpenGL library and its extensions For information on specific functions and routines please refer to your OpenGL documentation ADDING AN OPENGL OBJECT TO THE OBJECT LAYOUT 20 3 ADDING AN OPENGL OBJECT TO THE OBJECT LAY
486. s rectangular representation Return value The DLL should return TRUE if it wants notifications about the display displayContentsChanged This function is called whenever RapidPLUS updates an area in the graphic display It will be called once at startup with the entire display area in the RECT argument Afterwards it will be called only for changed areas DEFINING THE LOGIC 12 15 Syntax void displayContentsChanged int uniqueID RECT area void bits Parameters uniquelD Unique identifier for the graphic display area RECT structure that holds the size and position of the changed area bits Pointer to the graphic display bits This parameter points to the entire graphic display not only to the changed area displayClosed This function is called when the Prototyper is stopped or when the graphic display is destroyed for dynamic objects Syntax void displayClosed int uniquelD DEFINING THE LOGIC The values that you set in the dialog boxes determine the initial appearance of the graphic display The functions available through the object s logic allow you to dynamically change and control its graphic elements that is text strings bitmaps or shapes NOTE For every function that uses atx y for graphic display coordinates the x coordinate is the number of pixels from the left and the y coordinate is the number of pixels from the top The upper left graphic pixel is coordinate x 0 y 0
487. s the rows and columns COLUMN DESCRIPTION A The cells under Column A present the selected mode and its child modes in a tree format like they are presented in the Mode Tree e Child modes are indented under their parents e Exclusive modes appear in black concurrent modes appear in blue e The mode tree can be collapsed and expanded B and C Used internally D Denotes which modes are default modes E and on The column labels present the application s events and conditions The cells present the transition destinations that occur when the events and conditions are triggered NOTE Internal transitions are not exported to Excel EXPORTING LOGIC DATA 23 3 EXPORTING LOGIC DATA An exported state matrix can present different amounts of logic information The amount of logic presented is defined in the Export to Excel dialog box To export logic data to Excel 1 Open the application in the Mode Tree or State Chart 2 Select the mode whose data you want to export The selected mode and its child modes will be exported 3 In the Mode Tree choose Tree State Matrix Ctrl Shift P PE In the State Chart choose Tools State Matrix The Export to Excel dialog box opens Export to Excel x m Export Logic E Marked Exports mode and extemal transitions for selected mode and its child modes triggers for marked logic lines All Exports mode external transitions and triggers for selected
488. selected synchronizing the log may interfere slightly with the application s performance By default this option is selected Follow execution Selecting this option highlights the line of logic about to be executed in the Debugger when the Prototyper is paused by a breakpoint after a step or by clicking the Pause button The line of logic in the Logic Editor will be highlighted in yellow This option applies to the Debugger and does not affect the log It is the same as the Follow Execution command discussed on pp 4 9 4 10 By default this option is selected Debug application termination Some logic lines such as the root mode s exit activities are performed only after you stop the Prototyper Selecting this option enables you to beak at or step through application logic that is performed only after stopping the Prototyper By default this option is not selected LOGGING APPLICATION EXECUTION 4 19 Filter Options The Filters tabbed page presents options for the log and for stepping by filter General Filters User Objects Modes Select the items to be included in the log or stepped through using Step by filter A Activities J Mode entry exit NOTE You can also set A Transitions A User input these options directly in A Conditions _ Mouse movements the Debugger s Filters A Actions A Internal events menu without opening this dialog box J User functions A Runtime errors A Dynamic us
489. shared memory Add_to_Employee_List mode z Destinations from Add_to_Employee_List File Edit View Logic Functions Debug Help aja Add_to_Employee_List y Omamma fl h2 Defaut Receive y Destinations _ amp Employee_List counter Phone_Number Applink_List_PhoneNumber data 4 Applink_List_PhoneNumber checkForData 4 ia m 4 xi entry counter changeBy 1 gt entry Employee_List counter Phone_Number Applink_List_PhoneNumber data mode i When Add_to_Employee_List mode becomes active the entry activities are executed the value of Counter is incremented by 1 The data contained in the data property is assigned to a field in the data store object ii Once the data is stored the contents of Applink_List_PhoneNumber data is equivalent to the contents of Employee_List s selected field The event amp Employee_List counter Phone_Number Applink_List_PhoneNumber data is used to trigger a transition back to Receive mode iii The action Applink_List_PhoneNumber checkForData checks for additional data in the shared memory APPLINK OBJECT 16 10 USING RPD_MEM DLL IN AN EXTERNAL APPLICATION The file rpd_mem dll is located in the Rapidxx folder For the external application to access it either the external application must be located in the Rapidxx folder rpd_mem dll must be moved to the Windows system32 folder or rpd_mem dll must be located in the PATH environ
490. signed instead NOTE It is possible to edit Unicode strings into a non Unicode file using a code editor such as Codewright Sorting Data Stores and Arrays You can sort the records of a data store object or the elements of a one or two dimensional array according to the following criteria Single field sort Ascending or descending order of a specified field for a data store object or ascending or descending order of array elements for a one dimensional array Multiple field sort for data store objects and two dimensional arrays only By multiple fields or columns according to priorities set at runtime each field or column can be sorted by ascending or descending order Thus for example you could initially sort the records in ascending order by the values of field_x priority 1 if a number of records have the same value for field_x you could then sort those records in descending order by the values of field_y priority 2 To carry out a simple sort of a data store or a one or two dimensional array Data store In the Properties pane of the Logic Palette choose the field by which you want to sort the data store and then select the function sortAscending for an ascending sort or sortDescending for a descending sort One dimensional array For the array s self property select the function sortAscending for an ascending sort or sortDescending for a descending sort Two dimensional array For the array s self prop
491. sition s destination When pasting the transition in the target RapidPLUS attempts to reconnect to the referenced destination mode z i 1 1 1 1 1 1 1 If RapidPLUS finds a single mode in the target that matches the referenced destination mode then the paste operation takes place without further intervention on your part If however there are several modes in the target application that match the referenced destination mode you are prompted to 6 5 6 6 PASTING OPERATIONS resolve the conflict as described in Step 2 in Pasting Logic in the Logic Editor on p 6 11 NOTE If the transition is internal the paste operation is always straight forward since RapidPLUS does not have to check for a destination in the target application Mode As illustrated below pasting a mode pastes its activities and their related objects It also pastes its transitions and their related elements as described in the Transition chart on p 6 5 Mode TRANSITIONS ACTIVITIES Activity 1 Transition 1 Related Objects Logic or Related Interface Elements Transition n Activity 1 Related Objects Logic or Related Interface Elements Mode with Children Subtree When copying a mode that has children that is when copying a subtree each mode is pasted into the target application with its related elements as shown in the Mode chart above In
492. sizes as well as C code generation Creates an external palette settings Loads an external palette Number of colors 2 colors 1 bit M The number of colors in the palette Palette index of the background color True Color Graphic Display dialog box True Color Graphic Display g x Resolution Width Height o Display 64 2 Display pls Ga ance Pixel size Width Height E Z Redraws the Display pixel 2 2 Screen puls preview for Redraw current settings Number of buffers fo Background color FF FEREG Opens a dialog box to specify buffer sizes a bitmap format DLL andtrue color mapping and connection to an external Number of buffers By default there are no buffers display DLL Select Hexidecimal color code RGB and preview of the background color Opens a dialog box to select the RGB color value GRAPHIC DISPLAYS 12 6 Setting the Size and Grid The following illustrations show the relationship between screen pixels display cells and display resolution The display resolution is Settings in Graphic a matrix of display cells Display More dialog box 3 w Resolution of Width Height ae 2 Display B Display pxis Pixel size Width Height Display pixel e 2 Screen pxis Each display cell is a Space fi Screen pauls matrix of pixels The size of the graphic disp
493. splays modes and external transitions only No logic lines are exported even when they are marked EXPORTING A STATE CHART 24 5 NOTE Only logic lines that are associated with the displayed modes are exported As in the RapidPLUS state chart transition numbering replaces transition logic when the Number Transitions check box is selected in the Chart Options dialog box Tools Options State Chart tab 5 Click OK to export the chart to Visio Visio opens displaying the state chart and the RapidPLUS Visio stencil EsimStd vss this stencil is used by RapidPLUS to build the charts in Visio The new Visio drawing is automatically saved in the folder where the application is located To mark logic lines for export to Visio e Right click the mode or logic line and choose Mark for Export or In the Mode Tree window In the Logic Editor window 1 Select the mode 1 Select the logic lines 2 Choose Tree Mark for Export 2 Choose Edit Mark for Export In the Logic Editor window the selector buttons of logic lines marked for export are colored blue Logic lines marked for export to Visio are saved with the application NOTE If a logic line is marked both as a breakpoint and for export to Visio the breakpoint green takes precedence over the export to Visio blue However the logic line will still be exported to Visio To clear marked logic lines e Right click the mode or logic line and choose Unmark for Export or In
494. ssfully reverified The logic line has been edited since the window opened and what appears in the Logic Error View may not reflect the current logic line A logic line shown in this state cannot be reverified in the Logic Error View Ay The logic line contains syntax that appears to be acceptable but may actually produce unexpected results or runtime errors Examples include a block heading that is not followed by an indented logic block a user function that references more than 255 objects or properties or a constant array that is assigned a non constant parameter A This is a warning that the line in the XML file may contain an error that has no effect on the application behavior HA The line in the XML file contains an error that may affect the application behavior but the application can still be fully loaded A The line in the XML file contains a fatal error that prevents the element it belongs to from being loaded The related object or logic will not be loaded and the application behavior will be affected NOTE The XML related icons appear while opening an RXD or UXO file For more information about files in XML format see Chapter 2 RapidPLUS Applications in XML User Object Lists the user object where the item is located blank if located in the parent application Type Lists the type of logic action trigger activity user function or XML text in which the item appears 5 6 LOGIC ERROR
495. stant Set Properties o ooooo o o o e ee ee 27 13 xvii xviii CONTENTS Logic Editor a il PA at ae A La Sone daa 27 16 Color Coding in the Logic Editor 2 0 2 0 ooo o 27 16 Declaring Local Variables 2 0 ee ee eee 27 16 Execution of Mode Activities o o ooo ee eee 27 18 User Functions Limit on Number of ObjectS o oo o 27 19 User Functions Returning Specified Values o ooo ooooo o 27 20 Viewing Values of Local Variables and User Function Arguments 27 23 Object Editor ees a A A a Oe A a ee 27 24 Cursor Coordinates Status Box o o ooo ooo o e 27 24 Pasting Bitmaps into the Object Editor o o oooo o o 27 24 CHAPTER 28 APPLICATION PACKAGER o o o oo 28 1 Building an Application Package o ooo o e 28 2 Step 1 Setting Up the Application Packager o ooo 0000 28 3 Step 2 Selecting the Application and Files to Package 28 4 Step 3 Selecting Destination Folders Building the Package 28 8 Editing a Package cuci nedeca di a a a eee Shee ee as 28 10 Editing a PAK File in the Application Packager 000 28 10 Editing a PAK File Without Opening the Application Packager 28 10 Distributing and Using a Packaged Application ooo ooo o 28 11 APPENDIX A RAPIDPLUS SEARCH P
496. t Integer i gt lt Integer j gt lt Number k gt To declare a local variable 1 In the Logic Editor select an empty logic line 2 Choose Logic Declare local variable Integer or Number The following logic is appended declare lt Integer i gt Or declare lt Number i gt You can change the local variable name Using Local Variable Functions Once a local variable has been declared it has all the functions appropriate for a constant integer or a number object To see the functions of a local variable in the Logic Palette a logic line that is included in the local variable block must be selected in the Logic Editor All local variables appear under the class Local variables 25 Logic Palette Activity Object Property Function Local variables Untitled a Bitmap Imagel a Communication Applink1 abs Cuntam nan Execution of Mode Activities The sequence in which the RapidPLUS state machine executes mode activities is somewhat different in version 5 0 and higher and could possibly cause LOGIC EDITOR 27 19 differences in application behavior for applications converted from previous versions In order to explain in what sequence the RapidPLUS state machine executes mode activities we will assume an application where the modes shown below are active concurrently and the activities indicated are mode activities Model Integer1 Integer2 2 Mode2 Disp contents String
497. t _indexTable IDREF id2129 gt lt _indexTable IDREF id1661 gt lt _indexTable IDREF id1652 gt lt _indexTable IDREF id1653 gt lt _indexTable IDREF id103 gt lt _indexTable IDREF id20 gt lt _indexTable IDREF id19 gt lt _indexTable IDREF id1669 gt lt indexTable IDREF id2099 gt lt _objectTree IDREF id3 gt lt _logicTree IDREF id4 gt lt _palette gt lt _name gt lt CDATA CDPLAYER gt lt _name gt lt _SystemTimerFTIndex gt 1 lt _SystemTimerFTIndex gt As you can see in the sample report the XML code contains very detailed information about the RapidPLUS application Some of the information is easily discernible and some is not because it applies to internal structures that are used by RapidPLUS XML REPORTS 25 23 Generating an XML Report Before you generate an XML report you may want to change the language that will be used for encoding the report By default the application s language setting is used To select a language for the XML encoding 1 In the Application Manager open the Application Properties dialog box by choosing File Properties 2 In the Character Set box select a language This language will be used for the encoding of the XML report file To generate an XML report 1 In the Application Manager make sure that the application for which you want to generate XML code is in focus 2 From the Reports XML menu choose e
498. t database errors can occur when accessing databases via an ODBC driver The types of errors are specific to the database being accessed Whenever a database error occurs the ODBC error message is assigned to the dbErrorMessage property and the dbError event is generated Two specific database errors are login and query errors that is unsuccessful attempts to connect to and query a database Use the setLoginTimeout and setQueryTimeout functions to specify a timeout period after which these errors are returned by the ODBC driver The default is 15 seconds Runtime errors are generated when the RapidPLUS logic is incorrect For example you call transactionRollback without having called transactionBegin or you try to assign a value to a field without having called the edit function NOTE Most database errors do not result in runtime errors so they can go unnoticed To avoid this situation you can either open an Inspector window on the database access object and look at the dbErrorMessage property or catch the dbError event in your logic NOTE With the navigation functions moveFirst moveLast moveNext movePrev moveBy and moveTo a runtime error occurs if you try to move beyond the beginning or the end of the record set 16 1 Applink Object The Applink object enables RapidPLUS applications to communicate with external applications via shared memory The advantage of using Applink objects over other communication met
499. t file can be imported 3 Select a file and click Open RapidPLUS translates the imported structures into the proper RapidPLUS format If RapidPLUS detects problems in a text file that contains structure definitions a message box opens notifying you that there are translation problems To view these items click Yes in the message box your system s text editor opens and displays a list of items that cannot be imported warnings and errors IMPORTING STRUCTURES FROM A FILE 22 27 The following illustration shows a sample error list Hal herr Structure tIntStruct gt gt gt Multi dimensional array cannot be a field of Rapid Structure int ppintl gt gt gt Multi dimensional array cannot be a field of Rapid Structure char ppcharl Sample of an error list If there are no translation problems the structure definitions contained in the imported file are imported into the application as definition only structures However if RapidPLUS detects an imported structure with the same name as an existing user object property or structure the Paste Conflicts Duplicate Elements dialog box opens If you choose Replace all references to the existing structure or property will be replaced including in the logic USER OBJECTS WITH MESSAGES 22 28 How RapidPLUS Handles Various Items during Translation A structure defined within another structure as a field type is translated as a separate structu
500. tField lt undefined gt RP_USHORT boolField lt unsupported gt bool RP_ULONG ulongField RP_USHORT ushortField bool boolField End AAA ADDING _ DEFINITIONS User Object Message Properties Events Messages Functions Name Errors occured tBadStruct Accept eN Aproblem occurred while importing structures i A report has been written to the file C Rapid codegen Struct h err Do you want to see it now Structure tDate nteger year int nteger month unsigned char unsigned char essNode null terminated q eetNum int nteger appartNum int String city Stru null terminated String try null terminated Structure tPersonNode nteger index int String name null terminated tAddressNode address buffer tDate birthDate buffer This definition of an empty structure leads to the above warning when the Messages box is closed tDate y Date Structure tBadStruct buffer USER OBJECTS WITH MESSAGES 22 26 Importing a Structure To import a structure 1 Open the User Object Properties dialog box Messages tab 2 Click the Import button New Struct Copy Paste Lsrowowetee Le L Show Top Level Only Import Click here Registration Help The Import structure definitions dialog box opens Although the default file extension is h any tex
501. ta from an External Application The second example mirrors the first that is it contains similar objects but this time they are used for receiving data rather than sending it In the Object Layout The application contains the following objects to facilitate receiving data e One Applink object Applink_List_PhoneNumber set to queued mode e A data store object Employee_List that contains several fields employee name phone number mailing address and E mail address e An integer object Counter used to increment the data store fields Its initial value is O In the Mode Tree There are four modes Open Receive Add_to_Employee_List and Close In the Logic Editor Open and Close modes As in the first example these modes open and close the channel Receive mode In Receive mode RapidPLUS waits for the external application to send data E Receive Receive gt Add_to_Employee_List File Edit View Logic Functions Debug Help AJS reos EHC a ne Applink_List_PhoneN umber dataReceived CAA Applink_List_PhoneNumber dataReceived Applink_List_PhoneNumber getD ata i When data is sent to RapidPLUS the dataReceived event is generated The data is also stored in the Applink object s data property This event is used to trigger a transition to Add_to_Employee_List mode LOGIC EXAMPLES 16 9 ii The getData function is used in an action to retrieve the data from
502. tand the following terms The illustration below shows a typical messages list and illustrates the hierarchy among the various message parts A re usable definition only structure comprising three fields Grayed because it will not appear in the Logic Palette Structure Structure_Calls String number String CallFrom Integer Network_Type Union Communications A union comprising two structures Structure_Calls incomingCalls String number String CallFrom Integer Network_Type A copy of the definition only structure as one of the union structures Cannot be edited directly other than its name Structure outgoingCalls A structure comprising two fields Number RSSI_Value _ Structure_Calls myCall A field of a structure String number oH A copy of the definition only structure String CallFrom as a structure field Cannot be edited Integer Network_Type directly Union A union is a collection of one or more structures During runtime only one of its structures can be active at a time Definition Only Structure A definition only structure is a collection of fields that exists solely for the purpose of being reused either as a union structure or as a structure field It must contain at least one field Changes that you make to a definition only structure are automatically propagated to its copies Definition only structures do not appear in the Logic Palette
503. tangle as a border e Use the drawRecAtx y width height function The border is one display pixel thick and its color is the current draw color by default black The pixels inside the rectangular frame are transparent that is any graphic elements underneath are visible To draw a filled rectangle e Use the drawFilledRecAt width height function The entire rectangle border and fill are drawn using the current draw color by default black DEFINING THE LOGIC 12 27 Examples The following examples use the two different drawRec functions with black as the draw color and the text Hello displayed at coordinates 101 LCD fontSet Font1 LCD drawRecAtx 0 y 0 width LCD fontStringWidth Hello 2 height LCD fontHeight 2 LCD drawText Hello atx 1 y 1 LCD fontSet Font1 LCD drawFilledRecAtx 0 y 0 width LCD fontStringWidth Hello 2 height LCD fontHeight 2 Drawing Lines Lines are drawn in the graphic display s draw color by default black There are two methods for drawing lines on a graphic display The first is to draw a line segment by defining the coordinates of its start and end points This method uses the drawLineFromx y toX toY function For example to draw a diagonal line the logic would look similar to this LCD drawLineFromx 5 y 5 toX 15 toY 15 NOTE The drawn line includes the specified start and end point pixels 12 28 GRAPHIC DISPLAY
504. task responds by storing the outgoing telephone number in a temporary Redial buffer your logic might look something like Transition internal Trigger Calls Calls_union Call_Struct messageReceived Actions Redial_array 1 Calls Calls_union Call_Struct PhoneNumber Using the anyMessageReceived Event to Handle Exceptions NOTE This usage example is only relevant in the code generation context Each time that a structure is sent the messageReceived event is triggered automatically for the equivalent structure on the receiving side and the anyMessageReceived event is triggered for the union as illustrated below userObj Union1 structure_x messageReceived userObj Union1 anyMessageReceived structure_x send User object myObj Union1 structure_x messageReceived structure_x send myObj Union1 Parent application anyMessageReceived When designing a RapidPLUS application for code generation purposes the user object represents a module of the underlying embedded system while the parent application represents the embedded RapidPLUS task USING MESSAGES AS DATA CONTAINERS User objects with a message interface can be utilized as data containers A data container is a user object whose purpose is to hold data that can be shared among various project components Unlike RapidPLUS data objects that are available only within their parent user object data held in the message interface of user objects can
505. tcut is created in the program folder to the application using the specified icon and name Use Rapid If the Use Rapid Reviewer Default El Reviewer Default Icon check box is not selected you Icon must specify another file otherwise Rapid Reviewer the Application Packager cannot continue Shortcut Name If the Shortcut Name field is left Rapid blank lt file name gt Application Application will be used Readme Adds the specified Readme file Not selected required field 3 Click Next to the package Formats supported are HTML DOC WRI and TXT When these formats are used the Readme file opens in the appropriate program for example an HTML file opens in the system s default Web browser Additional formats are opened in Microsoft Notepad Step 2 Selecting the Application and Files to Package 1 In the Files and Folders for Packaging dialog box click Browse to select the application RPD RVR UDO or RDO Files and Folders for Packaging Click here RapidPLUS Application to be Packaged Browse BUILDING AN APPLICATION PACKAGE The application and its path are displayed and the other fields and options are enabled Files and Folders for Packaging RapidPLUS Application to be Packaged CDPLAYER RPD Update Application Files C Rapid applics CD_Player Notice the Update Application Files button This button is useful when an application that has already been
506. ted e A search path specified by the user in the Define Search Path dialog box Application Manager Options Search Path RapidPLUS searches in the application folder and its subfolders only when the JavaBean is being added not when it is being registered INTEGRATING JAVABEAN OBJECTS INTO RAPIDPLUS 19 3 Adding a JavaBean to RapidPLUS Adding a JavaBean without registering it means that it is added to the application s layout frame but not to the Object Palette To add a JavaBean 1 Choose Objects Add JavaBean Object A dialog box opens listing all the JavaBeans found Add JavaBean Object x Available List of valid JavaBeans EGAR found in the search AudioPlayer path _ CalciDisplayBean Cancel DisplayBean FingerBean _ Help GrowingT ext Help HyperlinkedLabel ImageEnhancer Molecule Molecule Pepper Name of the selected ProgressB ar y JavaBean SI TEO Bean AudioPlayer class A E pda a file Wh lected th Eg at contains the path of the JAR fle File C RAPID7O APPLICS BEANS AUDIOPLAY selected JavaBean is displayed NA E K A sample Add JavaBean Object dialog box 2 Select a JavaBean object from the list and click OK If the object is graphic you place it on the layout frame as you would place any RapidPLUS graphic object If the object is nongraphic it is added to the Nongraphic Objects dialog box Sometimes a graphic JavaBean object will appear as an empty rectangle beca
507. ted Logic This application already contains an object named Lampl Cancel al Help Choose the desired operation Use the PASTED element in the application logic Keep original Lise the APPLICATION element in the pasted logic The duplicate element in the target application is replaced by the related pasted element The related pasted element is added to the target application without replacing the duplicate element A numeric suffix is added to the name of the related pasted element Keep both Keep both elements separate references il When selected this dialog box appears for each conflict in the current paste operation When cleared the selected operation is repeated for all subsequent paste conflicts Example You copied and pasted the activity Lamp1 off and there is a duplicate Lamp1 in the target application Selected Operation RESULT The duplicate Lamp1 is replaced in the Object Replace Layout by the Lamp1 pasted as a related element The duplicate Lamp1 is now the Lamp1 used in the pasted activity Keep original Lamp1_1 is added to the Object Layout and Keep both dada the pasted activity is Lamp1_1 off Hii 6 18 PASTING OPERATIONS RESOLVING TRANSITION CONFLICTS When pasting one or more modes RapidPLUS attempts to reconstruct their outgoing external transitions if any If the mode tree in the target application contains more than one mode that matches th
508. teger gt toColumn lt integer gt of the specified value encountered in the specified range of elements OBJECT ENHANCEMENTS FUNCTION DESCRIPTION EXAMPLE instancesOf Returns the number of instances Array1 instancesOf dialStr fromRow 2 fromColumn 3 toRow Array1 getNumberOfRows toColumn Array1 getNumberOfColumns gt 0 overwriteWith lt 1D_array gt atColumn lt integer gt Overwrites the values of the specified column with the values of the specified array The array size increases as necessary to accommodate the overwriting array any empty cells created hold the calling array s default initial value See Usage Examples on pp 26 13 to 26 16 overwriteWith lt 1D_array gt atRow lt integer gt Overwrites the values of the specified row with the values of the specified array See the comment above about changes to the array size as a result of overwriting Array1 overwriteWith Array2 atRow 5 where Array2 is a 1D array of the same type as Arrayl overwriteWith lt 2D_array gt atRow lt integer gt atColumn lt integer gt Overwrites the values of this array with the values of the specified array starting from the specified element identified by row and column See the comment above about changes to the array size as a result of overwriting See Usage Examples on pp 26 13 to 26 16 TWO DIMENSIONAL ARRAYS EXTENDED FUNCTIONALITY
509. tent of the image transferred to the intermediate buffer By default a buffer s clipping rectangle is the same size as the buffer A user defined buffer s clipping rectangle is by default overlaid on the intermediate buffer at the intermediate buffer s O O coordinate Thus if you do not change the clipping rectangle s size or location the entire buffer bitmap is copied starting at the upper left corner of the intermediate buffer as shown in the following illustration Intermediate buffer buffer1 Buffer1 s default clipping rectangle overlaid on the intermediate buffer Default positioning of a buffer s clipping rectangle on a graphic display You do not have to use the default settings of the clipping rectangle There may be situations in which you want to copy only part of a buffer bitmap to the intermediate buffer and or you want to place the buffer bitmap at a specific location on the intermediate buffer The following illustrations show a a drawing on Bufferl whose upper left corner is at x 40 y 20 b a clipping rectangle that is much smaller than the buffer and is located at x 62 y 20 and c the relocation of the clipping rectangle on the intermediate buffer a x 100 y 0 Notice that a part of the clipping rectangle is outside the intermediate buffer WORKING WITH BUFFERS 12 49 The fourth illustration shows how much of the bitmap is drawn on the intermediate buffer which has a non d
510. tered the queue that is first in first out The default mode is Queued In Overwrite mode there is no queue each message is sent directly to rpd_mem dll and the next message sent overwrites the previous message In this mode a data element can be overwritten before it is read The Queue size range is 0 1 000 000 The default size is 100 You can also change the transmission mode in the logic using the setQueuedMode and setOverwriteMode functions USING THE APPLINK OBJECT 16 3 USING THE APPLINK OBJECT The main tasks you will want to accomplish using the Applink object are e Sending data to the external application e Receiving data from the external application Before you can do either of these tasks you must open a channel of communication between RapidPLUS and the external application NOTE The memory sharing DLL rpd_mem dll can contain up to 20 channels Opening and Closing a Channel Before RapidPLUS can communicate with another application a channel of communication must be opened The channel must have the same name in RapidPLUS and in the external application Each Applink object can open one channel at a time When you have finished transferring data you should close the channel To open a channel e Use the open lt channelName gt function lt channelName gt is the name that the external program will also use to open the channel from its side For example Applink1 open channel1 Appl
511. terface defines three methods METHOD DESCRIPTION addRoutableValue Adds removes listeners for recordable events Listener A recorder like the Scenario Authoring Tool usually adds a listener to a JavaBean and the JavaBean notifies it whenever the user triggers a recordable event in the JavaBean so that it can record it removeRoutableValue Listener injectRoutableValue Plays back an event It is typically called from the Scenario Player applet These methods are used in the following steps Step 2 Use the Helper Class RapidRoutingSupport A class file called RapidRoutingSupport com esim helpers RapidRouting Support helps implement recordable events in the Bean object This class should be packed together with the Bean object s JAR file It s small 2 1 Add a RapidRoutingSupport member variable to Bean class recordable events support protected RapidRoutingSupport routingSupport 2 2 Implement addRoutableValueListener and remove RoutableValueListener Implement addRoutableValueListener and removeRoutableValueListener These methods are usually implemented the same way in every JavaBean object using the RapidRoutingSupport class Add a listener that allows notification of value changes that can be recorded or routed via the extension services param listener java beans VetoableChangeListener public void addRoutableValueListener VetoableChangeListener listener if routingSupport n
512. ters appear in a list as in the following example a JFind amp Replace TEL_MAIN Find Replace Advanced Find FidWhat on E Close A Search in entire project T Stop TEL_MAIN DARAPIDIAPPLIC Y ll Include Subtree GoTo A Search in All Modes Make Comment Start in Mode ftel_main A Include Subtree Undo Commen A Whole Word Only J Match Case Help User Object Type Contained In Text Trigger outgoingCall D talking amp answerStatus 1 1 means the Answer button was pressec TEL_ICON User function iconOn icons_Array lt lcon_idx gt on TEL_NET Entry Activity talking talking_Lamp on TEL_UTIL Trigger tel_util internal onOff_Sw on make 6 item s found Logic lines that cannot be changed through the Find amp Replace dialog box such as block headers and user function names appear in the search results list but they are disabled The syntax of the search results is summarized below COLUMN DESCRIPTION Logic Status Shows status of replacement request no title a Do See Validating Logic on p 8 9 for details User Object Lists the user object where the search item has been located blank if located in the parent application Type Lists the logic type action trigger activity or user function in which the string appears FIND AND REPLACE 8 6 COLUMN Contained In DESCRIPTION Lists the mode or user function to which the found ite
513. the Logic Editor To save the log showing in the Logger pane 1 Choose File Save As 2 Browse to the folder in which you want to save your log and click Save By default the file name is lt application_name gt RPL but you can rename the file You can also select to save the file as ASCII text TXT from the File Type list or by choosing File Save As Text 4 22 DEBUGGING APPLICATIONS Ctrl C Ctrl F The two formats differ in the following way e Binary RPL files can be reopened in the log pane e ASCII text TXT file can be opened in any text editor To open a log file in the Debugger 1 Choose File Open log file 2 Browse to a log file with the RPL extension and click Open To print a log file 1 Choose File Print A read only preview of the log appears as well as the standard Microsoft Windows Print dialog box 2 Select a printer and paper orientation you may want to set it for landscape orientation and click OK To clear the log pane e Choose Edit Clear or click Clear The log pane remains open but all the log entries are deleted If you have not saved the log to file it can no longer be retrieved NAVIGATING WITH THE LOGGER You can go directly from a log entry to the equivalent logic statement in the Logic Editor You can also perform a text search within the Logger pane To go to the logic statement in the Logic Editor 1 Select the line in the Logger 1 Choose Edit Goto or double cli
514. the Recorder such as clicking pushbuttons and flipping switches Example Sw1 up make Internal events ra Internal event Event generated internally by the logic such as timer tick events or applink object s dataReceived event Example Applink1 dataReceived Runtime errors Runtime error mn Logic line and cause of fatal or non fatal runtime error Example lamp_Array Integer1 blink lamp_Array Index out of bounds LOGGING APPLICATION EXECUTION ICON LOGIC TYPE Dynamic user object allocation a Dynamic allocation a Dynamic allocation 4 15 DESCRIPTION AND EXAMPLES Indication that an instance of an object defined in a holder was allocated during runtime or deleted during runtime Examples 1 MyUDO_Holder_classDefault was allocated 1 MyUDO_Holder_classDefault was deleted Logic Related to User Object Interfaces The following information can be displayed for the interfaces of user objects ICON LOGIC TYPE Property changes ef Property changed DESCRIPTION AND EXAMPLES An exported property has been changed Example PBS scanCode Function calls ns Function call zl An exported function has been called Example Icons iconOn 2 calling iconOn Events ra Object event An exported event has been triggered Example PBS pb1_in triggered 4 16 DEBUGGING APPLICATIONS ICON LOGIC TYPE Structures S red on black S red on blac
515. the application propertyName Name of the object s property that was affected by the user action e g up self if none eventName Name of the event e g make Return Value None PROPERTIES METHODS AND EVENTS 18 45 Start Starts the simulation Syntax Start Parameters None Return Value None Stop Stops the simulation Syntax Stop Parameters None Return Value None TriggerApplicationEvent Triggers an exported event in the simulation Syntax TriggerApplicationEvent lt eventName gt Parameters eventName Name of the exported event Return Value None HOSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS 18 46 Events ApplicationEventTriggered Notifies the Rapid Simulator when an exported event in the simulation is triggered Syntax for event handler in Visual Basic ApplicationEventTriggered ByVal eventName As String Parameters eventName Name of the exported event a string Return Value None ApplicationPropertyChanged Notifies the Rapid Simulator when the value of an exported property in the simulation changes Syntax for event handler in Visual Basic ApplicationPropertyChanged ByVal propertyName As String ByVal value As Variant Parameters propertyName Name of the exported property a string value Value of the exported property as a variant converted to a string in some host programs Remarks The notification occurs only if the NotifyOnApplicationPr
516. the following tables USING JAVABEANS IN RAPIDPLUS 19 8 Image FUNCTION DESCRIPTION EXAMPLE Allows the assignment of one image Bean1 image property to another Image2 image loadFromFile Loads an image from the specified file Bean1 image lt string gt loadFromFile NOTE If you do not specify a path c images mouse ico RapidPLUS searches in the RapidPLUS search path as described on p 19 2 clear Clears the image Bean1 image clear width Returns the image width in pixels Int1 Bean1 image width height Returns the image height in pixels Int1 Bean1 image height These functions are not supported for Java code generation Instead of using the loadFromFile function to load an image you can assign a bitmap object to the image property as described on the previous page Font FUNCTION DESCRIPTION EXAMPLE Assigns the attributes of one font Bean1 font property to another font property Bean2 font Returns TRUE if the font properties have amp Bean1 font the same properties Bean2 font boldGet Returns 1 if the bold attribute is set O if Int1 Bean1 font not boldGet boldSet Sets the font to bold 1 or non bold 0 Bean1 font boldSet 1 lt integer gt italicGet Returns 1 if the italic attribute is set 0 if amp Bean1 font italicGet not 1 LOGIC FOR JAVABEAN OBJECTS FUNCTION DESCRIPTION EXAMPLE italicSet Sets the font to italic 1 or n
517. the logic using the edited logic icon 4 and not necessarily the logic line s validity status Actions That Cannot Be Undone The following actions cannot be undone and clear the undo stack e Changing top panel properties events messages and functions i e changes in the top panel s More dialog box 27 8 ADDITIONAL RAPIDPLUS ENHANCEMENTS e Changing pipe object properties that are set in the More dialog box e Replacing user objects through the Advanced menu command File Advanced Replace User Object e Compacting files choose File Advanced Compact or Compact All e Updating JavaBean objects e Saving the application no warning appears Actions that cannot be undone provide a warning that the undo stack will be cleared You can disable this warning by selecting the check box in the window The warning will be enabled the next time you start RapidPLUS Setting the Levels of Undo The undo stack is by default unlimited but you can set a limit to the number of undo levels To set a limit for the undo levels 1 In the Application Manager choose Options Undo Levels 2 In the Number of Undo Levels dialog box select Limit 3 Set the maximum number of undo levels to allow and click OK When the limit is reached the earliest action will be dropped from the undo stack and the most recent action will be added APPLICATION MANAGER Changing RapidPLUS Fonts RapidPLUS uses two system fonts both of whic
518. the name of any of these objects type Switch A in the Find What box Project Search Search in When selected searches through the entire project entire project i e the parent application and all its user objects When cleared searches through the component selected in the box Include Subtree When selected extends the search to components nested in the selected component Mode Search Search in When selected searches through all modes in the All Modes selected component When cleared searches through the mode selected in the box Include Subtree When selected extends the search to modes nested in the selected mode FIND AND REPLACE 8 4 OPTION DESCRIPTION Whole Word Only When selected the search for matching strings that are enclosed by nonalphanumeric characters such as a space comma colon or an ampersand Example For the search string is lamp and the Whole Word Only option selected the search results list has the following characteristics e Does not show matches such as lamp1 on or Redlamp blink e Does show matches such as lamp blinkPeriod 300 and amp lamp is on Match Case When selected the search is case sensitive To apply search filters see Using Filters Advanced Options on p 8 11 USING FIND 8 5 Displaying Search Results Press the Find button to begin the search When the search is complete all the logic lines that match the search parame
519. tinue is appended to the Logic Editor s edit line BREAK CONTINUE IN FOR AND WHILE LOOPS 7 11 The following user function illustrates the use of Break and Continue statements lu Logic Editor Edit Activity Function File Edit View Logic Functions Debug Options Help PAGS Eee sa 9 AI find_SubString in y ES ES declare lt Integeri gt lt Integerk gt lt IntegermatchCounte gt Integer find_SubString lt String sub gt in lt String str gt Expe declare lt Integer i gt er k gt lt Integer m lt matchCounter gt 0 lt k gt 1 while lt i gt lt lt str gt length lt i gt lt i gt 1 Rapid string starts from 1 if lt str gt lt i gt lt gt lt sub gt lt k gt lt matchCounter gt 0 lt k gt 1 continue lt matchCounten lt matchCounter gt 1 if lt matchCounter lt sub gt length Mall characters are found break lt k gt lt k gt 1 if lt matchCounter gt 0 Retum start location return lt i gt lt matchCounter gt else return 1 EEbkerekeberreEEERE MUA WRITING LOGIC USING LOOPS AND BRANCHES 7 12 WORKING WITH IF ELSE BRANCHES If else branches are used to execute blocks of activities that are dependent on one or more conditions being true There are three main types of branches BRANCH SYNTAX DESCRIPTION if if Integer1 1 Executes a block of activities if the PowerSwitch on condition is true Lamp1 on Tf the condition is false none of
520. tion such as parent type transitions and activities Interface User Object Interface Summarizes information about an application s or project s user object interface such as exported functions and messages Components Component Presents a hierarchical tree of the project s Dependency Tree user objects Component List Presents a list of the project s user objects Detailed Component Similar to the Component List report List except that it also lists holders Target Graphic Presents a list of the graphic displays that Displays are used in the project components WORKING WITH REPORTS IN THE REPORT VIEWER 25 3 TYPE REPORT NAME DESCRIPTION Coverage Test Coverage Test Presents a list of modes transitions triggers user functions or objects that are not referenced in coverage test data that is collected from the Prototyper XML Selected Application An XML file that presents XML code for the application Application and Same as above except for the entire User Objects project WORKING WITH REPORTS IN THE REPORT VIEWER This section applies to the following reports e Object Tree report e Object Data report e Mode Tree report e Mode Data report e User Object Interface report e Component Dependency Tree report e Component List report e Detailed Component List report e Coverage Test report All of these reports are generated to the read only Report Viewer from which you can save and or
521. to 5 After Array1 pullColumnsFrom 2 to 3 the array looks as follows the array is now a fi Games f usar ener faea Esa forze Zo zas aoe es Elio zones bos rro foo resis After Array1 pushRowsFrom 3 to 6 After Array1 pushColumnsFrom 2 to 3 the array is now the array is now 2 Foe flares fusan Epere Jueza Ee Ejea forzas e 6 Bob 336 9565 6 Bo 336 9565 COMMLINK OBJECT 26 17 Changes to Assign and loadFromFile Functions It is now permissible to assign a two dimensional array to an array of a different size The array on the left side takes on the size of the array on the right side Thus for example in the logic Array1 Array2 Array1 takes on the size of Array2 even if their sizes differ Similarly if you use the loadFromFile function to load array data from a file the calling array s size changes as necessary to fit the size of the data in the file Thus for example in the logic Array1 loadFromFile backup rar Array1 takes on the size of the data in backup rar even if the size of its original data was different NOTE You cannot assign a three or more dimensional array to a two dimensional array COMMLINK OBJECT General Information If a user sends the same string over and over the commlink object will generate the dataArrived event only once because it does not detect a change in the property
522. to do the action Undoing and Redoing Actions In most cases the Undo feature is accessed the same way as it is in many other Microsoft Windows based applications and performs as expected The same is true for redoing actions that have been undone MULTIPLE TOOL ENHANCEMENTS EJ Ctrl Z Ctrl Y 27 7 To undo the last action do one of the following e Inthe Application Manager press Ctrl Z Press Ctrl Y to redo the last undone action e Click the Undo button or choose Edit Undo from any of the following tools e Mode Tree e Logic Editor e Function Editor e Object Layout e State Chart e Logic Error View e In the Find and Replace dialog box click the Replace tab After replacing an instance of a string the Undo button becomes available and functions as in other editing tools NOTE Choosing Edit Undo shows a description of the specific action For example the Edit menu may show Undo Insert Lamp1 Clicking the Undo or Redo button or choosing Edit Undo or Edit Redo activates the relevant tool s window Example Deleting an Object You deleted an object from the Object Layout and commented out or deleted referenced logic Clicking the Undo button from any of the tools will do the following e Activate the Object Layout e Return the deleted object to its place e Return the object s referenced logic to its normal state NOTE Results in the Logic Error View may reflect a change in
523. to replace the string power with Power in all places where it appears as part of text display contents This example assumes that all text display names in your application include the substring disp 1 DD Un bu In the Find tabbed page set the following e Find What power e Search entire project selected e Match Case selected e Whole Word Only selected In the Advanced tabbed page set the following e Type all selected except Trigger e Object Name disp e Object Property because you have used a wild card you cannot specify a property If you were to select a particular display object in Object Name then you could select the contents property here Click the Find button When the search is complete click the Replace tab In the Replace With box type in Power If the search because of the Object Name wild card found logic lines that are not of interest a Ctrl click to select those lines b Right click anywhere and choose Remove From List from the popup menu Click Replace All 8 13 FIND AND REPLACE 8 14 Example 3 Going to an Activity Scenario You have a large application During runtime many of its modes are active simultaneously A text display named Display1 clears during runtime and this is undesirable 1 In the Find tabbed page set the following e Find What blank e Search entire project selected 2 In the Advanced tabbed page set the following e Type select Action and Acti
524. to the current logic statement The Debugger Logger and Call Stack help you find which points in the logic or which object values are causing unexpected or undesirable results This chapter presents e How to control an application with the Debugger e How to log the execution of an applications and read the Logger pane e How to manage and navigate Logger files e Logger usage examples e How to use the Call Stack e How to inspect the contents of objects NOTE This chapter replaces Chapter 15 Debugger of the Rapid User Manual DEBUGGING APPLICATIONS USING THE DEBUGGER TOOL With the Debugger you can control the Prototyper in a way that enables you to closely inspect those parts of an application s logic that are of particular interest A common way to do this would be to set breakpoints at mode entries or exits or at specific logic lines Once set you run the Prototyper via the Debugger and the Debugger pauses the Prototyper automatically when it encounters a breakpoint You can also manually pause the Prototyper at any time during execution Once the Prototyper is paused you can use the Debugger controls to execute the application s logic step by step While you are stepping through logic with the Debugger you can observe which logic line is about to be executed in the Logic Editor The basic steps for using the Debugger 1 Open the Debugger 2 Set breakpoints by one of the following methods e In t
525. to the end user The following instructions are for the end user To use the packaged application 1 Extract the compressed setup files to a temporary folder on your local hard disk 2 Run the Setup exe file 3 In the Select Destination Folder dialog box either accept the default destination folder Rapid_Demo lt name of application gt or browse to another folder then click Next to begin installation 4 Ifthe application contains special fonts a dialog box will open asking whether or not to install the fonts Click Yes to install the fonts 5 When the installation process is completed a final dialog box opens If a Readme file was included in the package you will be prompted to view it 6 A window will open displaying shortcuts to the application to uninstall the application and to the Readme file if a Readme file was packaged Double click the application shortcut to run it in the Rapid Reviewer A 1 RapidPLUS Search Paths RapidPLUS looks for files in the following locations and in the order specified kkk If no drive is specified RapidPLUS looks for the file relative to the application folder MODULE FILE TYPE SEARCH PATH Active X OCX DLL Application folder and subfolders Rapidxx Objects folder Rapidxx Applics folder Rapidxx folder a RapidPLUS search path defined by the user Array RAR Save application folder Load Bitmap BMP JPG etc rik object Data store RDS S
526. tor 2 rmReroute Source Designates the RapidPLUS source file or the URL that is loaded into the Rapid Simulator The RapidPLUS application can be in any of the following file formats RPD RVR UDO RDO or ZRP zipped application It can also be the URL of a zipped application WindowLeft Returns an integer value that is the x position of the Rapid Simulator window s upper left corner This property can be used during runtime to change the position of a stand alone window WindowHeight Returns an integer value that is the height of the Rapid Simulator window This property can be used during runtime to change the size of a stand alone window WindowTop Returns an integer value that is the y position of the Rapid Simulator window s upper left corner This property can be used during runtime to change the position of a stand alone window WindowWidth Returns an integer value that is the width of the Rapid Simulator window This property can be used during runtime to change the size of a stand alone window 18 37 HOSTING RAPIDPLUS SIMULATIONS IN WINDOWS PROGRAMS 18 38 Methods The methods are used to send various commands to the RapidPLUS simulation or to change the characteristics of the Rapid Simulator during runtime These methods are available in the host applications programming language GetApplicationProperty Gets the current value of an exported property in the simulation Syntax GetApplicationPro
527. tors are described under Conditions on the DEFINING THE DATABASE ACCESS OBJECT 15 7 Query Type To define the query type Choose among the following options Query Result Link to the Type Database Scrolling Dynaset Dynamically linked You can change the Bidirectional data the changes are only visible the next time the record is accessed Snapshot Not dynamically linked You can change Bidirectional the data the changes are visible when you rerun the SQL query Forward only Not dynamically linked no changes Forward only allowed to the data Condition To set a filter for the selected field Choose an SQL operator from the Condition list and enter a value in the Value edit box as follows if you use A record will be included in the this operator query result if the field s value is IS NULL IS NOT Null not null A value is null if it is missing unknown NULL or not relevant lt lt lt gt gt gt Less than less than or equal to not equal to equal to greater than or greater than or equal to the integer or number value specified in the Value box NOTE You can use the logical operators AND OR and NOT to create compound conditions For example the SQL clause WHERE employees employeeRate gt 5 1 AND employees employeeRate lt 8 7 retrieves those records where the employeeRate field of the employees table is between 5 1 and 8 7 inclusive 15 8 DATABASE
528. tructure4 ROC PREF R4395 CallList Struct cSF_R9894 Structure5 ROC PREF R4395 CallList Struct cSF_R1027 Structure6 ROC PREF R4395 CallList Struct cSF_R8544 Structure ROC PREF R4395 CallList Struct cSF_R16061 Structures ROC PREF R4395 CallList Struct cSF_R7194 Structure9_ ROC_PREF_R11368 CallList By using an array of structures the generated interface could be reduced to typedef struct tROC_PREF_R11368 CallList ROC_PREF_R4395 CallList Struct cSF_R12594 Structurel 9 ROC_PREF_R11368 CallList and the repetitive work involved in building the union could be avoided USING THE USER OBJECT MESSAGE LOGIC The user object message has conditions events and functions that facilitate the sending of structures from the parent application to the user object and vice versa NOTE In the context of code generation the interface between the parent application and the user object simulates the interface between an embedded system module represented by the user object and the embedded RapidPLUS application represented by the parent application When you add a user object to an application a message s unions appear as properties of the user object in the Logic Palette See the following illustration USER OBJECTS WITH MESSAGES 22 16 E Logic Palette Activity Obiect Property Function self 2a deactivateAny Data Unions appear as properties of the Inteaerl user object Double c
529. try group Logic for setting entry type is still available in the Logic Editor To change text alignment during runtime 1 For left alignment use the leftAlign function 2 For right alignment use the rightAlign function NOTE Using the object s sizing handles only resizes its bounding box and not the font 27 1 Additional RapidPLUS Enhancements This chapter presents new features and enhancements of existing features that have been implemented since version 4 0 and are not described in other chapters of this manual The following tables present a brief description of each enhancement Detailed descriptions and procedures are presented after the tables ADDITIONAL RAPIDPLUS ENHANCEMENTS 27 2 New in version 8 0 New in version 8 0 Multiple Tool Enhancements FEATURE ENHANCEMENT REFERENCE Back and Forward You can navigate among mode p 27 6 buttons and user object selections that you made in the Mode Tree State Chart and Logic Editor Multilevel global Undo Redo commands available p 27 6 undo and redo Application Manager FEATURE Application name length across tools and user objects ENHANCEMENT REFERENCE Application names are no longer limited to 8 characters However if an application name contains double byte characters it should be limited to 8 bytes Changing RapidPLUS You can change RapidPLUS s p 27 8 fonts system fonts Saving current You can save various
530. ty LastUserActionT ime 4 316021E 08 Baa NotifyOn pplicationPropert True xl Click here In ToolBook You reach it from the ActiveX Control Properties dialog box Name Taye ID 84 Bounds Behavior Web Position Size Page units Page units Left 1005 Width 5550 Top 1200 Height 3480 USING A RAPID SIMULATOR OBJECT 2 18 5 In the Rapid Simulator s Properties dialog box enter the path and file name of a RapidPLUS simulation You can open a RapidPLUS application in any of the following file formats RPD RVR UDO RDO or ZRP zipped application It can also be the URL of a zipped application Type in the path and Click here to browse to a file name of a Or RapidPLUS application RapidPLUS application Application View cer Set path for Rapid simulation or URL for zipped simulation zrp Source IAEA AAA Browse Select to embed source file in host document file I Embed in host document When selected the source file Path name of selected simulation 2 polaco D Rapid6 CBT md11 Md11 1pd document If you want to embed the RapidPLUS simulation in the host document select the Embed in host document check box When selected the source file but not its supporting files will be saved as part of the host document when the host document is saved NOTES If you want the RapidPLUS simulation s supporting files to be embedded as well you must create a ZRP file
531. ty spaces in the application file e Choose File Advanced Compact in the Application Manager Any difference in file size will be seen the next time that you save the file NOTE You must activate this command each time you want to compact ENTIRE PROJECT VS SINGLE COMPONENT OPERATIONS The Save Compact and Reverify Logic options have been supplemented by the complementary options Save All Compact All and Reverify Logic All With the new options you can save compact and reverify logic for the entire project These options also offer an easy way to upgrade RapidPLUS applications created in earlier versions 1 9 1 10 MANAGING PROJECTS The Save Compact and Reverify Logic commands apply only to the currently selected project component the file shown in the Project Components box If the currently selected component is not in edit mode the three options are unavailable NOTE The three single file operations do not apply to sub components that are nested in the selected component Reverifying Logic for an Entire Project To reverify the logic of an entire project e Choose File Advanced Reverify Logic All Compacting an Entire Project To compact the entire project e Choose File Advanced Compact All Saving an Entire Project To save the entire project e Choose File Save All or click the Save All button Upgrading Applications Created in a Lower Version When you open an application that was cre
532. ty which uses indexes to retrieve a specific value Every indexed property is converted to a pair of RapidPLUS functions lt propertyName gt Get_index lt integer gt Returns the value in the specified index lt propertyName gt Set_index lt integer gt value lt value gt Writes the specified value in the specified index Other than the indexed properties all ActiveX control properties of a type supported by RapidPLUS become object properties that appear in the logic palette s Properties column when you select the ActiveX object For a complete list of ActiveX data types that are supported by RapidPLUS see Supported ActiveX Data Types on pp 17 9 to 17 15 Bindable vs nonbindable properties in condition only triggers and mode activities Although all properties are available in the Logic Palette for inclusion in condition only triggers you should only use bindable properties If you include a nonbindable property in a condition only trigger you get the following error message Rapid Compiler Error Ea A CurLine is a non bindable property It can not be used in a condition only transition 17 18 USING ACTIVEX CONTROLS Nonbindable properties are available for inclusion in mode activities but should only be used to have their value changed by the activity and not to assign their value to a data object Thus assuming that Microsoft Forms 2 0 TextBox is an ActiveX control and its CurLine property is nonbi
533. uickSort quickSort lt ary gt p lt p gt r lt q gt QUICKSORT quickSort Array Array1 p 41 44 quickSort quickSort lt ary gt p lt p gt r lt q gt QUICKSORT quickSort Array Array1 p 1r 44 quickSort quickSort lt ary gt p lt p 1 r QUICKSORT quickSort Array Array1 p 1r 74 quickSort quickSort lt ary gt p lt p gt r lt g gt QUICKSORT quickSort Array Array1 p 1 1 100 quickSort quickSort lt ary gt p lt p gt r lt q gt QUICKSORT Mode quickSort Trigger Actions Pushbutton in quickSort quickSort Array p 11 Array The top row is the most recent stack frame and contains the logic line where the Debugger has paused Each row of the Call Stack provides the following information COLUMN DESCRIPTION Active stack frame Indicates the active frame in the stack icon Context The component parent application or user object that contains the calling logic Location Logic position of the calling function including e Entry mode or exit activity e Trigger evaluation e Action in a transition e Subroutine call See Examining the Logic Location below Line Logic line that contains the calling logic DEBUGGING APPLICATIONS 4 26 To show or hide columns 1 With the Call Stack pane open choose View Call Stack 2 Select columns you want to show and clear the mark by columns to hide Examining the Logic Location The Location column of the Call Stack pane co
534. ull routingSupport new RapidRoutingSupport this routingSupport addRoutableValueListener listener 19 16 USING JAVABEANS IN RAPIDPLUS Remove a listener that allows notification of value changes that can be recorded or routed via the extension services param listener java beans VetoableChangeListener public void removeRoutableValueListener VetoableChangeListener listener if routingSupport null return routingSupport removeRoutableValueListener listener Now whenever the user triggers a recordable event in the Bean object the Bean object should notify the Recorder about it so that the event will be recorded Step 3 Implement Event Recording A recordable event consists of a textual description string and zero or more numeric arguments The RapidRoutingSupport class provides several routeEvent methods that allow you to pass events to the recorder with or without arguments The recorder can prevent the event from happening by throwing a Property VetoException This exception is caught by the RapidRoutingSupport object and causes the routeEvent method to return FALSE In the Bean object s code you should check the result of routeEvent and if it returned FALSE the Bean object must not fire the event or change its state in any way resulting from the event In the case of the CounterButton JavaBean object this object fires the action event and increments its counter
535. um string length E bytes Cancel Type in the maximum string length in bytes Typing a zero will cause the object to use the global size set in the Code Generation Preferences dialog box If the initial string exceeds the maximum length a warning will prompt you to either truncate the initial text or increase the limit to accommodate the text The maximum length of string objects also applies to string elements of string type arrays string fields in data stores and string fields in message structures Size Definitions for Individual Data Store Objects You can set the maximum size of a data store object and or each of its string fields in its Advanced dialog box To change the maximum size of a data store object 1 In the Data Store dialog box click the Advanced button The Advanced dialog box opens 10 31 10 32 NONGRAPHIC OBJECTS Advanced Data_Storel x Maximum datastore size E records Cancel 2 Type in the maximum number of records Typing a zero will cause the object to use the global size set in the Code Generation Preferences dialog box If the initial record size exceeds the size limit a warning will prompt you to either truncate the data store or increase the limit To change the maximum length of a string field 1 In the Add Edit Field dialog box click the Advanced button 2 Type in the maximum length in bytes Typing a zero will cause the object to use the global size set in the Code Gene
536. unctions NOTE If you have never created a user object we suggest that you read Chapter 19 User Defined Objects in the Rapid User Manual In version 4 5 and higher the user object interface can also include exported messages An exported message is basically data that is transferred between a parent application and its user object through an event However a message is more than the data being transferred It involves a specific framework that must be created in order to send the data First a union must be created Each union contains one or more structures which in turn contain fields A structure s fields can be of the following data types string integer number array or another nested structure From either the parent application or the user object you can assign data to a structure s fields and send the structure to the other side where its data can be read and processed as required To perform an operation on a structure it must be active Because the structures are in a union only one of them can be active at a time This chapter presents e How a user object message works e Terms basic to the user object message e General changes to the user object More dialog box e Building and editing a user object message USER OBJECTS WITH MESSAGES 22 2 e Using the user object message logic e Importing a structure from a header file NOTE The design of messages in RapidPLUS is based on
537. uously added to the Logger NOTE You should correct this situation by adding an event such as a timer tick to the trigger in which case the trigger is only evaluated when the event takes place USING THE CALL STACK The Call Stack displays a sequence of stack frames leading up to the current logic statement The Call Stack is displayed while the Debugger is paused at a point that logic is executed The Debugger pauses at a breakpoint by a Stepping button at a runtime error or by clicking the Pause button Viewing the Call Stack To view the Call Stack 1 In the Debugger click the Show Hide Panes button 2 Click the Call Stack tab to see stack frame data The Call Stack pane remains inactive until the Debugger is paused and displays a status message e lt application is stopped gt when the Prototyper is stopped e lt application is running gt when the Prototyper is running USING THE CALL STACK Active stack frame icon 4 25 e lt call stack is unavailable gt when the Prototyper is paused at a point where no logic is executed e g while exiting a mode or evaluating a trigger The following illustration shows a sample Call Stack pane while stepping through an application Ed quickSort Stepped At Sub File Edit Yiew Debug Logging Inspect Breakpoints Filters Options A ol b gt 00 quickSort p r declare lt Integer q gt YG PE Call Stack Loager _ Resizable columns Context Location q
538. urn values p 27 20 You can navigate to a user function s definition by right clicking it in the Logic Palette and choosing the Go to definition in Function Editor command ENHANCEMENT REFERENCE Displays information about shapes p 27 24 as they are drawn on an object Pasting a bitmap into the Object Editor You can preserve high color and p 27 24 true color palettes 27 5 Prototyper FEATURE ENHANCEMENT REFERENCE Coverage Test You can generate reports listing Coverage Test version 6 TE modes transitions triggers user Reports on functions or objects that are not p 25 20 referenced in data collected from the Prototyper Internet Packager ENHANCEMENT The Internet Packager iPack exe and the Document Manager s Simulator preserve folder hierarchy That is when an application is packaged the Packager retains the folder and subfolder locations so that when the packaged application is launched the files are extracted to the appropriate folder and subfolders Librarian In versions prior to 6 0 the only way to use the same object in more than one application was to store objects in object libraries Now that objects can be copied and pasted among applications object libraries have become obsolete Therefore all object library functions were removed in version 6 0 If you have existing object libraries RLD we advise that you use version 5 0 to add the objects to an application file
539. ursor at the line containing the error The default editor is an internal text editor If you edit the file directly in the default editor RapidPLUS detects the change and prompts you to reload the file If you prefer to use an editor other than the default text editor make the necessary changes in the RXD or UXO file and then reopen it in RapidPLUS For details about changing the default editor see Changing the Default XML Editor on p 2 12 Reverify the changes IMPORTANT Syntax errors in the XML file can cause logic errors in RapidPLUS For example if the element name OBJECT is accidentally edited to OBJEC in a given instance the object will be removed from the application logic that referenced the object will become invalid and a fatal error warning will appear in the Logic Error View In this case fixing the XML error externally will restore the object in RapidPLUS and correct related logic errors To reverify changes made externally in the XML code 1 2 Reload the changed RXD UXO file Once you have closed the Logic Error View you must reload the XML file to see the list of XML related errors Examples of XML Errors RapidPLUS cannot locate the schema By default the schema is located in the main Rapidxx folder RapidPLUS searches in this folder and the application file s folder An XML syntax error causes a fatal error View the line in the Logic Error View for a description of the error
540. use it cannot draw itself while in design mode During runtime it will appear appropriately 19 4 USING JAVABEANS IN RAPIDPLUS Registering a JavaBean in RapidPLUS Registering a JavaBean in RapidPLUS adds it to the Object Palette and New Objects dialog box To register JavaBeans 1 Choose Objects Register the Register dialog box opens 2 In the Available list scroll down to the JavaBean Objects section and select the JAR file you want to register then click Add All the JavaBeans within this JAR file are registered Repeat this step for all the JAR files you want to register 3 Click OK the Object Palette is updated RapidPLUS adds the JavaBean objects class icon to the left column if it does not yet exist and the specific icon to the right column If a JavaBean does not have an icon of its own RapidPLUS uses a default icon The JavaBean object is also added to the list in the New Objects dialog box 4 Optional If you want the JavaBean object to be a permanent part of the Object Palette and New Objects dialog box save your settings using either Options Save Settings Now or Save Settings on Exit in the Application Manager the registration will be saved in the Rapidxx ini file Windowed vs Non Windowed JavaBean Objects A windowed JavaBean object also known as a heavyweight component runs in its own window A non windowed JavaBean object also known as a lightweight component runs in the RapidPLU
541. ust like the number object entering bounds prevents RapidPLUS from assigning numbers less than the minimum value or greater than the maximum value These values cannot be changed in the Logic Editor When you start the Prototyper RapidPLUS generates a random number The next function is used to generate a new random number The number remains constant until the next function is performed NOTE Do not expect to get the same random number value after you save an application because the value changes when you load the application NONGRAPHIC OBJECTS 10 12 Holder Holder objects hold other objects They are useful in applications containing several objects of the same type that use the same logic Instead of writing logic for each object you can write the logic once for the holder and then instruct the holder to hold each object in turn Holders can also dynamically generate and delete objects in runtime A holder possesses the properties and functions of the object being held as well as its own functions Holders are useful in projects for holding instances of user objects so that a user object does not need to be nested in each application user object that requires its functionality The objects that can be held are active objects active primitive objects groups user objects and nongraphic objects except for data objects system objects properties and copies of other holders In addition object types can be held that
542. utermost For loop is i The subsequent default counter names for nested loops are j K l You can change the loop counter name as desired You are prompted to enter a starting integer and an ending integer Enter the starting integer value or expression and press Tab enter the ending integer NOTE The starting integer s value should be less than the ending integer s value The default step increment value is 1 change it if necessary NOTE The step s value must be positive Accept the For header by either clicking the New Line button or pressing Enter If the header is valid a new line is opened below the header It is automatically indented for the body of the For loop entry for lt Integer i gt from 1 to 5 step 1 gt A sample For header To define a backwards For header _ In the Logic Palette click the ForDownTo button Perform steps 2 4 above NOTE The step s value must be positive The starting integer s value should be greater than the ending integer s value 7 8 WRITING LOGIC USING LOOPS AND BRANCHES Defining a For Block To define a For block The focus should be on the line under the header 1 Build an activity then accept it by either clicking the New Line button or pressing Enter The next line is selected and is indented exactly like the previous line 2 Continue adding activities until the For block is complete To end a block e Click the New Li
543. valid after the replacement 4 The logic statement would be invalid after the replacement the replacement is not carried out and an error message appears see below The logic statement is a block header or user function name and cannot be changed through the Find and Replace dialog box Error Messages If a line were to become invalid after the replacement then in addition to getting a red x at that line a message such as the following appears Information x A Invalid logic in Entry Activity i display _Group off Replacement was not made In this example the string hide was replaced with the string off The resulting action display_Group off is not logically valid When an error such as this occurs the replacement is not carried out USING FILTERS ADVANCED OPTIONS 8 11 If there had been more than one logic statement to replace the error message would be as follows Please Confirm C Y Invalid logic in Entry Activity wy display _Group off Cancel replacement operation Replacement was not made Continue replace operation Continue replacement operation for other logic statements USING FILTERS ADVANCED OPTIONS On the Advanced tabbed page set options to focus the search on logic types or objects of interest Logic types Find Replace Advanced Type Search Only Among References To A Trigger Object Name JelectricPlug_Sw A Action A
544. veX Controls ActiveX is Microsoft s brand name for its technologies that allow software components to interact with each other on Windows operating systems regardless of the language in which they were built ActiveX technologies are based on Microsoft s Component Object Model COM that is a group of conventions and supporting libraries that facilitates interaction between different software modules in a consistent object oriented way ActiveX controls are reusable components that incorporate ActiveX technology Once added to a program they appear to be a normal part of the program Some familiar ActiveX controls are user interface components such as buttons scroll bars check boxes and list boxes In RapidPLUS you can incorporate any ActiveX control installed on your computer as an object in your application RapidPLUS translates the control s COM based interface into RapidPLUS events properties and functions available in the Logic Editor This chapter describes how you add or register an ActiveX control in the Object Layout and how you determine its runtime behavior NOTE In order to use an ActiveX control effectively in RapidPLUS it is important that you be thoroughly familiar with its specific interface elements 17 1 17 2 USING ACTIVEX CONTROLS ADDING OR REGISTERING ACTIVEX CONTROLS IN RAPIDPLUS There are two ways to add an ActiveX control to an application Adding it straight from a file without register
545. verage Test the Report Viewer opens displaying the coverage test results Restart the Prototyper to continue collecting data for the next coverage test Each time you stop the Prototyper you can choose Reports Coverage Test to generate a new coverage test and displays the results in a new Report Viewer To stop collecting data for coverage tests choose Controls Coverage Test or click the Coverage Test button 25 21 25 22 GENERATING REPORTS XML REPORTS RapidPLUS can generate XML code for an application with or without its user objects The main purpose of XML reports is to allow automatic conversion of RPD UDO files to formats used by other tools so that RapidPLUS applications can be imported into these other tools NOTE XML reports will be supported through RapidPLUS version 8 The capability to save RapidPLUS applications in XML will render the XML reports feature unnecessary The XML code is viewed from a Web browser or an XML editor A typical report looks like this Address e C RAPID72 applics CD_Player CDPLAYER CDPLAYER xml lt xml version 1 0 encoding ISO 8859 1 gt lt Automatically generated from an ObjectFile file lt Rapid gt lt RPApplication type 25 ID id5 ver 168 gt lt _indexTableSize gt 40 lt _indexTableSize gt lt _indexTable gt lt _indexTable IDREF id12 gt lt _indexTable IDREF id2152 gt lt _indexTable gt lt _indexTable IDREF id1276 gt l
546. vity only e Object Name select Display1 from the list e Object Property select contents from the list Click Find 4 Scrolling through the search results list you notice that the cause of the problem is a mode activity that should be an entry activity 5 Select the line and click Go To 6 In the Logic Editor change the activity from mode to entry 9 1 Verification Test With the Verification Test tool you can perform a basic check on an application s logic design The verification test checks for the following potentially problematic areas e Modes that cannot be reached or exited e Transitions without triggers to missing destination modes and certain condition only transitions e Objects that are not referenced in the logic At the end of the test a list of detected logic problems is displayed and you can then debug them one by one You can run the verification test on a mode subtree or on the whole application CAUTION The verification test is not exhaustive and may miss potential problem areas particularly in a complex application This chapter presents e How to run a verification test e How to use the verification test to locate errors e Descriptions and examples of warning messages NOTE This section replaces the section Verification Test on pp 12 38 to 12 42 of the Rapid User Manual VERIFICATION TEST 9 2 vee vm Ctrl K RUNNING THE VERIFICATION TEST In the Ve
547. w 15 1 query types 15 7 effect on viewing runtime changes 15 12 read only 15 10 runtime errors 15 9 15 15 selecting tables and fields for query 15 4 sending non query SQL statement 15 14 SQL statement building in Object Layout 15 5 15 7 to 15 8 changing dynamically 15 13 viewing 15 5 Index 3 transactions 15 12 dataReceived event 16 5 date data type ActiveX 17 14 date objects 10 36 dbError event 15 15 dbErrorMessage property 15 15 dbFilter property 15 13 dbSort property 15 13 dbSQL property 15 13 DDE Rapid Simulator ActiveX object 18 33 DDEObjectChanged event 18 47 deactivateAny 22 17 Debug and Logging Options dialog box 4 16 to 4 21 Debugger adding and removing breakpoints 4 5 to 4 6 configuration options 4 16 to 4 21 debugging application termination 4 18 Follow Execution command 4 9 to 4 10 4 18 general procedure 4 2 menu 4 5 opening 4 3 status messages 4 8 stepped execution 4 7 4 19 to 4 21 stepping into user objects 1 3 Synchronize command 4 9 to 4 10 toolbar 4 3 to 4 5 See also Call Stack Inspector windows Logger debugging using Find and Replace example 8 14 delete 15 11 deleting nongraphic objects 10 7 Detailed Component List report 25 19 Differences reports 3 10 Differencing Tool comparing applications 3 4 comparing interfaces 3 16 comparing modes 3 12 comparing objects 3 14 comparing projects 3 11 comparing user functions 3 15 comparison icons and colors 3 5 copying items 3 10 Index 4 Diffe
548. w RapidPLUS completes a paste operation e How paste conflicts are solved if duplicate objects or modes are found in the target application e Using Copy and Paste operations to retrieve stored objects PASTING OPERATIONS ELEMENTS YOU CAN CUT COPY AND PASTE In order to properly understand cutting copying and pasting between applications you must understand what is actually brought over from the source application to the target For example when you cut copy and then paste an entry activity you are also bringing in the RapidPLUS object referenced by the logic We call this referenced object a related element of the copied logic This section outlines the RapidPLUS elements that can be moved from a source application to a target including a description of the related elements that they bring with them Objects The most basic paste element is a single object either graphic or nongraphic When you cut or copy a group of graphic objects all individual group members are included in the paste as related elements When you cut or copy a graphic object that has children all of its children are brought with it regardless of the status of the Select Children option in the Options menu However deleting an object via Edit Delete or the Delete key does not delete the object s children if Options Select Children is not selected Objects that can be pasted Vs Object Graphic or nongraphic XM A Group of Graphic Obje
549. xecution of mode activities 27 18 Follow Execution command 4 9 to 4 10 4 18 Synchronize command 4 9 to 4 10 in XML elements 2 10 zoom in out of columns 27 4 Logic Error View 5 1 to 5 7 pasting between applications 6 12 6 15 reverifying logic 5 6 when opening projects 1 4 window description 5 4 to 5 6 XML errors 2 4 to 2 5 longPress event 26 22 M making object arrays 10 18 message objects 10 40 to 10 41 messageReceived event 22 19 messages See user object messages Microsoft Office programs adding a Rapid Simulator ActiveX object 18 4 exporting logic to Excel 23 1 exporting state charts to Visio 24 1 viewing a Rapid Simulator ActiveX object 18 8 Microsoft Windows CE for Automotive ActiveX controls 17 22 missing destination mode 5 3 mode activities 27 18 Mode Data report 25 13 to 25 14 Mode Tree breakpoints adding and removing 4 5 to 4 6 debugging status 4 9 logic verification test 9 2 to 9 3 9 5 to 9 6 in XML elements 2 10 Mode Tree report 25 12 modes pasting between applications 6 13 to 6 15 rules for naming 27 9 mouse object 10 45 moveBy 15 10 moveFirst 15 9 moveLast 15 9 moveNext 15 10 movePrev 15 10 moveTo 15 9 moveToBookmark 15 10 multi lingual support 10 43 to 10 45 13 12 N naming applications 27 2 objects and modes 27 9 user objects 1 8 no return button See user functions nongraphic objects 10 1 to 10 46 adding 10 2 copying and pasting 10 5 deleting 10 7 duplicating 10
550. ystem objects e g SystemTime and mouse do not appear in the list because you cannot edit them MANAGING NONGRAPHIC OBJECTS 10 5 Renaming a Nongraphic Object An object s name is used to identify it in the Object Layout and Logic Editor By default the name consists of the object type and a sequential number To rename an object 1 Select the object in the Nongraphic Objects list Its name appears in the Object Name box 2 Modify the name in the Object Name box then click Accept For rules about naming objects see p 27 9 Editing a Nongraphic Object To edit a nongraphic object 1 Select the object in the Nongraphic Objects list 2 Click the Edit button or double click the object the object s dialog box opens 3 Make the necessary changes then click OK Adding Notes to a Nongraphic Object All notes about objects and modes are added in the Application Manager To add notes to a nongraphic object 1 Select the object in the Nongraphic Objects list 2 Add text to the notes area of the Application Manager window Copying and Pasting Nongraphic Objects The Copy and Paste buttons are used to copy and paste nongraphic objects within the same application or between applications To copy and paste a nongraphic object 1 Select the object in the Nongraphic Objects list 2 Click the Copy button the object is copied to RapidPLUS s internal paste buffer not to the Clipboard NONGRAPHIC OBJECTS 10 6

Download Pdf Manuals

image

Related Search

Related Contents

携帯電話の迷惑メール設定の変更方法(PDF:162KB)  MANUAL DO USUÁRIO  Rexel Pockets for Business Cards  VALVULA AC-3    BIT User Manual  cobalt site management manual  User Manual LED12.BB-12/24- 350  PMI diag - Les anciens sites web de la DGE  

Copyright © All rights reserved.
Failed to retrieve file