Www.ilogix.com © I-Logix 1999-2004 Rhapsody C++ V5.0.1 17/01/2004 E1-1 Exercise 3 : Dishwasher.

Slides:



Advertisements
Similar presentations
Introduction to Eclipse. Start Eclipse Click and then click Eclipse from the menu: Or open a shell and type eclipse after the prompt.
Advertisements

Essential Rhapsody in C++
Using Macros and Visual Basic for Applications (VBA) with Excel
Tutorial 8: Developing an Excel Application
© 2002 ComputerPREP, Inc. All rights reserved. Excel 2000: Customizing Excel and Using Macros.
Tutorial 12: Enhancing Excel with Visual Basic for Applications
Getting Started: Ansoft HFSS 8.0
Fireworks MX. 2 Lesson 1a—Create Slices & Hotspots n Fireworks allows you to add animation (behaviors) already written in ___________. n However, users.
1 Appendix A: Writing and Submitting SAS ® Programs A.1 Writing and Submitting SAS Programs.
The Rhapsody in C++ Tool Training "Essential" © I-Logix v2.3 25/9/2000 Bas-1 Essential Rhapsody in C++ Section 2 Basic Level.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
© I-Logix Rhapsody C++ V /01/2004 E1-1 Exercise 2 : Count Down.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Exploring Office Grauer and Barber 1 Creating More Powerful Applications: Introduction to VBA(Wk9)
The Rhapsody in C++ Tool Training "Essential" © I-Logix v2.3 25/9/2000 Adv-1 Essential Rhapsody in C++ Section 4 Advanced Level Modified.
Rhapsody in C++ Tool Training "Essential" © I-Logix v3.0 1/29/2001 Adv-1 Section 4 Advanced Level Concurrency.
Customizing Word Microsoft Office Word 2007 Illustrated Complete.
Copyright 2007, Paradigm Publishing Inc. POWERPOINT 2007 CHAPTER 1 BACKNEXTEND 1-1 LINKS TO OBJECTIVES Create Presentation Open, Save, Run, Print, Close,Delete.
Rhapsody in C++ Tool Training "Essential" © I-Logix v3.0 1/29/2001 Int-1 Section 3 Intermediate Inherited Sensor.
Macros Tutorial Week 20. Objectives By the end of this tutorial you should understand how to: Create macros Assign macros to events Associate macros with.
PowerPoint Tutorial 1: Creating a Presentation
The Rhapsody in C++ Tool Training "Essential" © I-Logix v2.3 25/9/2000 Int-1 Essential Rhapsody in C++ Section 3 Intermediate Level.
Rhapsody in C++ Tool Training "Essential" © I-Logix v3.0 1/29/2001 Adv-1 Section 4 Advanced Level Multiplicity.
Fundamentals of Programming in Visual Basic 3.1 Visual basic Objects Visual Basic programs display a Windows style screen (called a form) with boxes into.
ExitTOC Run & Route Directions 2003 Editing Run and Route Directions Edulog.nt v9.2 Use the buttons to navigate the training package First PagePreviousNextLast.
COMPREHENSIVE Windows Tutorial 2 Organizing Your Files.
Access Tutorial 10 Automating Tasks with Macros
Digital Image Processing Lecture3: Introduction to MATLAB.
Business Optix Library Service – Workflow
1 ENG236: ENG236: C++ Programming Environment (2) Rocky K. C. Chang THE HONG KONG POLYTECHNIC UNIVERSITY.
One to One instructions Installing and configuring samba on Ubuntu Linux to enable Linux to share files and documents with Windows XP.
Smith’s Aerospace © P. Bailey & K. Vander Linden, 2005 Architecture: Component and Deployment Diagrams Patrick Bailey Keith Vander Linden Calvin College.
XP Tutorial 5 Buttons, Behaviors, and Sounds. XP New Perspectives on Macromedia Flash MX Buttons Interactive means that the user has some level.
Introduction to Graphical User Interfaces. Objectives * Students should understand what a procedural program is. * Students should understand what an.
1 I-Logix Professional Services Specialist Rhapsody IDF (Interrupt Driven Framework) CPU External Code RTOS OXF Framework Rhapsody Generated.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 22 Macros.
1 Pertemuan 03 Using Layers and Symbols Matakuliah: U0344 / DESKTOP 1 Tahun: 2006.
Introduction to VBA MGMI Aug What is VBA? VBA = Visual Basic for Application Excel’s powerful built-in programming language An event-driven.
Chapter 11: Introduction to the Visual Basic Environment Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University.
Mentor Tools tutorial Bold Browser Design Manager Design Architect Library Components Quicksim Creating and Compiling the VHDL Model.
Mail merge I: Use mail merge for mass mailings Perform a complete mail merge Now you’ll walk through the process of performing a mail merge by using the.
Alice 2.0 Introductory Concepts and Techniques Project 1 Exploring Alice and Object-Oriented Programming.
Session Objectives • Login to PeopleSoft Test Framework(PTF)
Active-HDL Interfaces Debugging C Code Course 10.
Lesson 11: Looking at Files and Folders what a file or folder is on the computer how to recognize a file or folder on the desktop how to recognize the.
Rhapsody V4.2 "Specialist" Tool Training © I-Logix /08/20031 Specialist Rhapsody Getting Rhapsody In C generated code to run.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 8 Debugging, Creating Executable Files, and Distributing a Windows Application.
Sequence Diagrams And Collaboration Diagrams HungNM.
Programmable Logic Training Course HDL Editor
Chapter Three The UNIX Editors.
Fall 2003Sylnovie Merchant, Ph.D. ACCESS Tutorial Note: The purpose of this tutorial is to provide an introduction to some of the functions of ACCESS in.
Microsoft Word Level 1 Michael Carco. Word Level 1 Agenda  Word Basics  Navigating in a Document  Inserting and Modifying Text  Creating and Modifying.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 4 Slide 1 Slide 1 What we'll cover here l Using the debugger: Starting the debugger Setting.
Statechart Diagrams. Creating a Statechart Diagram A Statechart diagram shows the life cycle of a single object, from the time that it is created until.
M. D. Slaughter1 Microsoft Office PowerPoint 2003 Tutorial Lai 687 Instructional Design M. D. Slaughter.
Video in Macromedia Flash (Optional) – Lesson 121 Video in Macromedia Flash (Optional) Lesson 12.
Creating and Editing a Web Page
THE C PROGRAMMING ENVIRONMENT. Four parts of C environment  Main menu  Editor status line and edit window  Compiler message window  “Hot Keys” quick.
© I-Logix Rhapsody C++ V /01/2004E1-1 “Essential” Tool Training Basic Rhapsody Basic Rhapsody Rhapsody in C++ V /01/04.
Creating and Editing a Web Page Using Inline Styles
MICROSOFT WORD PRESENTATION. Word Processing  Software that is designed for the entry, editing, and printing of documents.  Windows Version = Microsoft.
Active-HDL Server Farm Course 11. All materials updated on: September 30, 2004 Outline 1.Introduction 2.Advantages 3.Requirements 4.Installation 5.Architecture.
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
Chapter 2: The Visual Studio.NET Development Environment Visual Basic.NET Programming: From Problem Analysis to Program Design.
Rhapsody 2003년 3월 12일 배대호.
Perform a complete mail merge Lesson 14 By the end of this lesson you will be able to complete the following: Use the Mail Merge Wizard to perform a basic.
An Introduction to Computers and Visual Basic
An Introduction to Computers and Visual Basic
Essential Rhapsody in C++
Presentation transcript:

© I-Logix Rhapsody C++ V /01/2004 E1-1 Exercise 3 : Dishwasher

© I-Logix Rhapsody C++ V /01/2004 E1-2 Exercise 3 : Dishwasher

© I-Logix Rhapsody C++ V /01/2004 E1-3 Dishwasher  Create a new project “Dishwasher”, make sure that it is created in its own folder.  Draw a single class Dishwasher

© I-Logix Rhapsody C++ V /01/2004 E1-4 Attributes  Add the following attributes all of which are of type int and with initial value of 0

© I-Logix Rhapsody C++ V /01/2004 E1-5 Operations  Add the following operations, with appropriate return types and implementations:

© I-Logix Rhapsody C++ V /01/2004 E1-6 Types  In the implementation for the operation isInNeedOfService() we used a constant called MAX_CYCLES.  Select the Default package, right-click and select “Add New -> Type”  Enter MAX_CYCLES as name and declaration: const int %s = 3; %s is a shortcut for the name of the type

© I-Logix Rhapsody C++ V /01/2004 E1-7 Creating a Component  As in the previous exercise, rename the DefaultComponent to Test and the DefaultConfig to Debug  Select “Animation” and create an initial instance of Dishwasher

© I-Logix Rhapsody C++ V /01/2004 E1-8 Save / Generate / Make  Before adding a statechart, let’s make sure that we haven’t made any errors by doing a build.  Save Generate / Make

© I-Logix Rhapsody C++ V /01/2004 E1-9 Creating a Statechart  Add a Statechart to the Dishwasher class  We are going to be drawing a complex diagram, it is highly recommended to maximise the Statechart window and close all other windows.  Draw a single state as large as possible called active

© I-Logix Rhapsody C++ V /01/2004 E1-10 Creating Concurrent States  Use the and-line icon to create concurrent states To draw the AND line, either: click and drag the line or click to start the line then double-click to end it Draw this line first This box with “active”inside will appear when the and-lines are drawn Note the only way to move an AND-line, is to delete it and redraw it. Concurrent States

© I-Logix Rhapsody C++ V /01/2004 E1-11 Naming the Concurrent States  Name the concurrent states using the icon to running, service and mode.

© I-Logix Rhapsody C++ V /01/2004 E1-12 Adding Nested States  Add the following states: To change the size of an outer state, without the inner states changing, hold down the “Alt” key when changing the size

© I-Logix Rhapsody C++ V /01/2004 E1-13 Adding History and Diagram Connectors  Add a History connector to the on state  Add two identical Diagram connectors named DONE

© I-Logix Rhapsody C++ V /01/2004 E1-14 Adding Default Transitions  Add the following four default transitions

© I-Logix Rhapsody C++ V /01/2004 E1-15 Adding the Transitions  Add the following transitions and actions

© I-Logix Rhapsody C++ V /01/2004 E1-16 Action on Entry  Finally in the normal state, add an “Action on entry” to set cycles=0; Once an action has been set, the symbol “>” is shown.

© I-Logix Rhapsody C++ V /01/2004 E1-17 Start Behavior  צור/י configuration הנקראת trace עם Instrumentation מסוג Tracer.  מה מתבצע ב- Start Behavior?  מכאן ולהבא תשתמש/' ב configuration הנקראת debug

© I-Logix Rhapsody C++ V /01/2004 E1-18 Save / Generate / Make / Run  Save / Generate / Make / Run  Do “Go step” to create a Dishwasher instance  הסביר/י את ההודעות ב Call Stack. לחצ/י על “Go Step” כמה פעמים עד ש “Executable Idle” מופיע ב- “Output Window”. הסביר/י את ההודעות ב Call Stack If there is no instance created, then it is probable that an initial instance of Dishwasher was not selected in the configuration.

© I-Logix Rhapsody C++ V /01/2004 E1-19 Animated Statechart  Check that there are three concurrent animated states 1 2 3

© I-Logix Rhapsody C++ V /01/2004 E1-20 Injecting Events  The Dishwasher is in an idle state waiting for some events  Generate the event evStart by right-clicking anywhere on the animated statechart and selecting “Generate Event”  The event evStart should appear in the event queue Events can also be generated via the Command prompt or via the Event Generator

© I-Logix Rhapsody C++ V /01/2004 E1-21 Design Level Debugging  Do “Go” and watch the animation  Does your Dishwasher work as expected?  What happens if you open the door when it’s on, does it remember what state it was in?  Why does the Dishwasher become faulty after four cycles?  Can you get the Dishwasher back to the normal state? עד כאן תרגיל 3!

© I-Logix Rhapsody C++ V /01/2004 E1-22 Intense / Quick  Modify the setup operation so that the timings are different in the quick and intense modes.  Save / Generate / Make / Run  It should now be quicker to get the Dishwasher into the “faulty” state. IS_IN is a macro that tests to see if the object is in a particular state.

© I-Logix Rhapsody C++ V /01/2004 E1-23 Extended Exercise  Using the IS_IN macro and a guard, prevent the Dishwasher from being started if it is faulty.

© I-Logix Rhapsody C++ V /01/2004 E1-24 Breakpoints  Setting breakpoints can be done in a similar way to injecting events by right-clicking on a state in the animated statechart Breakpoints can be added/removed via the breakpoint icon on the animation toolbar.

© I-Logix Rhapsody C++ V /01/2004 E1-25 Using the Simulated Time Model השכלה כללית בלבד  At the moment, we are using the System tick for all our timeouts and so a timeout of 1000ms takes 1000ms, which means that all simulations can be long.  There is an alternative time model that we can use that is the “Simulated” time model. When we use this, all the timeouts are executed in the appropriate order, but rather than waiting, the shortest timeout immediately times out. This means that we can test models such as this one much quicker.  Make a copy of the Debug configuration, rename it to Sim and set the “Time Model” to Simulated

© I-Logix Rhapsody C++ V /01/2004 E1-26 The Command Prompt  Events and breakpoints can also be generated through the command prompt  For example, we could inject the evStart by typing “Dishwasher->GEN(evStart)” in the command window  More useful perhaps is that we can use the command window to invoke scripts GEN is a macro that will create the event before sending it to the object. GEN(evStart) ≈ gen( new evStart )

© I-Logix Rhapsody C++ V /01/2004 E1-27 Creating a Test Script  One way of testing our Dishwasher is by running a script  We can create this script inside Rhapsody in the following way:  In the Test Component, select “Add New File”  Name the file TestScript.cfg

© I-Logix Rhapsody C++ V /01/2004 E1-28 TestScript.cfg  Set the Path to “..\..”  Set the File Type to “Other” The script we’re about to create, will be contained inside the model and will now be generated every time that code is generated

© I-Logix Rhapsody C++ V /01/2004 E1-29 Script Contents  Select “Add text”, enter “script contents” as the name  And then press to start the text editor

© I-Logix Rhapsody C++ V /01/2004 E1-30 The Script  Enter the following: Don’t leave any blank lines or any leading spaces! This script logs everything that happens including timing information to a file called TestScript.log For more information on the scripting language, search for example “timestamp” in the user reference manual

© I-Logix Rhapsody C++ V /01/2004 E1-31 Running the Script  Save / Generate / Make / Run  Use the command prompt to run the script  Once the script has run and terminated, stop the animation  The script should have created a file called TestScript.log, we can edit this file from within Rhapsody by adding another file called TestScript.log of type Other and Path..\.. If the script is called “OMAnimator.cfg” then on starting the animation, the script will be automatically run. This script must be located in the project directory.

© I-Logix Rhapsody C++ V /01/2004 E1-32 Reading TestScript.log  Select the TestScript.log file in the browser, right-click and select “Edit File” Elapsed Time