Stateflow    

Using the Search Button and View Area

This topic contains the following subtopics:

Click Search to initiate a single-search operation. If an object match is made, its text fields are displayed in the Viewer pane in the middle of the Search & Replace dialog. If the object is graphical (state, transition, junction, chart), the matched object is displayed in a Portal pane below the Viewer pane.

A Breakdown of the View Area

The view area of the Search & Replace dialog box displays found text and its containing object, if viewable. In the preceding example, taken from the Sensor Fuel Detection demo model, a search for the word "speed" finds the Description field for the state Speed_Sensor_Mode. The resulting view area display consists of the following parts:

Icon.   Displays an icon appropriate to the object containing the found text. These icons are identical to the icons used in the Stateflow Explorer and are displayed in Explorer Main Window.

Full Path Name of Containing Object.   This area displays the full path name for the object containing the found text in the following format:

where p1 through pn denote the object's parent states.

To display the object, click the mouse once on the full path name of the object. If the object is a graphical member of a Stateflow chart, it is displayed in the Stateflow chart editor. Otherwise, it is displayed as a member of its Stateflow chart in the Stateflow Explorer.

Viewer.   This area displays the found text as a highlighted part of all search-qualified text fields for the owner object. If other occurrences exist in these fields, they too are highlighted, but in lighter shades.

To invoke the Properties dialog box for the owner object, double-click anywhere in the view area.

Portal.   This area contains a graphic display of the object containing the matching text. The object containing the found text is highlighted in blue (default).

To display the highlighted object in the Stateflow chart editor window, double-click anywhere in the portal.

The Search Order

If you specify an entire machine as your search scope in the Search in field, the Search & Replace tool starts searching at the beginning of the first chart of the model, regardless of the Stateflow chart displayed in the Stateflow chart editor when you begin your search. After searching the first chart, the Search & Replace tool continues searching each chart in model order until all charts for the model have been searched.

If you specify a Stateflow chart as your search scope, the Search & Replace tool begins searching at the beginning of the chart. The Search & Replace tool continues searching the chart until all the chart's objects have been searched.

The search order taken in searching an individual chart for matching text is equivalent to a depth-first search of the Stateflow Explorer. Starting at the highest level of the chart, the Explorer hierarchy is traversed downward from parent to child until an object with no child is encountered. At this point, the hierarchy is traversed upward through objects already searched until an unsearched sibling is found and the process is repeated.

Additional Display Options

Right-click anywhere in the Search & Replace dialog to display a menu with the following selections.

Selection
Result
Show Portal
A toggle switch that hides or displays the portal.
Edit
Displays the object with the matching text in the Stateflow chart editor; applies to states, junctions, transitions, and charts.
Explore
Displays the object with the matching text in the Stateflow Explorer. Applies to states, data, events, machines, charts, and targets.
Properties
Displays the Properties dialog box for the object with the matching text.

If the portal is not visible, you can select the Show Portal option to display it. You can also simply click-drag the border between the viewer and the portal (the cursor turns to a vertical double arrow), which resides just above the bottom boundary of the Search & Replace dialog. Moving this border allows you to exchange area between the portal and the viewer. If you click-drag the border with the left mouse button, the graphic display resizes after you reposition the border. If you click-drag the border with the right mouse button, the graphic display continuously resizes as you move the border.


  Specify the Search Scope Specifying the Replacement Text