Visual NCES Editor Manual
Manual Version 1.1.0
22. October. 2007
Presented by:
Visual NCES Editor (ViEd) is a Java-based graphical editor designed for developing Net Condition/Event Systems (NCES) models. The developed NCES models are stored in XML files which maximize the transferability and cross-platform capability of the designs. Note: Some screenshots in this manual were taken using previous versions of ViEd. While some toolbar or menu items may be missing in those screenshots, the location of items has not changed.
Main features:
· Transferable file format
· Intuitive graphical interface
· Tab view
· Hierarchical model view
· Precise entity selection
· Instant change reflection
· Easy entity identification
A trial version of the ViEd is provided as a single zip archive file. Installation of ViEd only requires extracting the archive file, which can be unzipped to any destination folder, but the folder structure must be preserved. The following diagram shows the default folder structure inside the archive file:
Figure 2‑1 Default Structure of The ViEd Folder After Un-Zipping
The src folder contains example files and standard library (in full version); the xmlSchema holds a local copy of the XML Schema used to validate the NCES models; the changelog.txt logs the update history; the ViEd Manual.htm and folder ViEd Manual_files contain the manual for the ViEd in HTML format and the Visual NCES Editor.exe is the executable file. After unzipping files, ViEd is ready to run by simply double-clicking the executable file.
ViEd was developed in Java 1.6 under Windows XP with SP2. ViEd should be able to run in any Windows systems as long as the OS supports Java 1.6. Other OS (such as Linux or Mac OS) are not currently supported.
ViEd has been developed by the BlockDesign – the group of students of the University of Auckland, New Zealand, supervised and managed by Dr. Valeriy Vyatkin (contact: v.vyatkin@auckland.ac.nz).
Main developers: Cheng Pang and David Gommans.
The current trial version of ViEd is provided for free individual use for research purposes without any warranty, responsibility and support.
All rights reserved. © BlockDesign, 2007
When ViEd is started, it displays a Splash Screen similar to the one below showing the current build version:
Figure 4‑1 ViEd 1.0.0 Splash Screen
After all necessary files are loaded, the Splash Screen will close automatically and switch to the following interface:
Figure 4‑2 Initial Interface of ViEd
Note: depends on your screen’s resolution, you may need to adjust the Panels’ position.
The ViEd User Interface is made up of the following components:
· Toolbar
· Sidebar
· Panels
The following diagram illustrates the aforementioned interface components after a new file has been created:
Figure 4-3 Components on ViEd User Interface
The Main Menu is located at the top of the ViEd application window, which accommodates various commands and options. One can also access many of the Main Menu commands and options from the Toolbar.
The Menus are:
· File
· Edit
· View
· Options
· Help
To describe pathways through the Menu system, the ‘|’ character is used to indicate a selection on the next level of the Menu system. For example, File | Open means the command can be accessed by selecting File from the Main Menu and then Open from the Submenu.
Shortcut keys shown as (key sequence) allow direct access to the command. For instance, File | Open (Ctrl + O) means the command can also be accessed by pressing the Control and O keys simultaneously.
The File Menu enables you to work with the stored NCES model (.xml files) as a whole.
The available options are as follows:
Manage XML files
· New
· Open
· Save
· Save As…
Closing windows and
exiting:
· Close
· Exit
As indicated below, unusable functions are greyed out:
Figure 4-4 File Menu
New [File | New (Ctrl
+ N)]
Create a new blank NCES model. Multiple new files can be created and displayed in different tabs as shown below:
Figure 4-5 Create Multiple New Files
Open [File | Open
(Ctrl + O)]
Open a created NCES model XML file. When the Open menu item is clicked a File Choose Dialog will be displayed from which the target XML file can be chosen as shown below:
Figure STYLEREF 4-6 Open an XML File
Note: when open a composite module, if ViVe cannot locate any sub-modules inside it, a File Not Found dialog will prompt out as shown below:
Figure 4-7 File Not Found dialog
If you click Yes, a Open File dialog similar to REF _Ref175493613 \h Figure 4‑6 will appear and you can select the missing files. If you click No, then ViVe will open the composite module as usual except that all the missing modules are not displayed.
Save [File | Save
(Ctrl + S)]
Save the current NCES model as an XML file. If it is a new model, ViEd will ask for a name. If no specific name is provided, ViEd will use the default name “New” instead. There is no need to type in the .xml extension. If the current file has been created before, the ViEd will save the current design back to existing file.
The Save menu item will not be usable until a new file has been created or an existing file has been opened. If a file has previously been saved and no change has made since then, clicking the Save menu item will not actually save the current file again.
Figure 4-8 Save a New File
Note: when save a composite module, you must save all modules inside the src folder, otherwise next time when you reopen that composite module, you must manually locate the sub-modules inside it.
Save As [File |
Save as (Ctrl + Shift + S)]
Save the current NCES model under a new name. There is no need to type in the .xml extension. If the current NCES model is new, ViEd will ask for a new name.
Save the current NCES model in a format compatible to the TNCES Editor. If the current NCES model is new, ViEd will ask for a new name.
Close [File | Close (Ctrl + W)]
Close the current NCES model. The current active tab in the Visualization Panel will be closed. If the current file has been saved previously, a confirmation dialog as shown below will prompt out:
Figure 4-9 Close Unsaved File
Close All [File | Close All (Ctrl + Shift + W)]
Close all opened/created NCES models. A confirmation dialog will prompt out for every unsaved file.
Exit [File | Exit
(Ctrl + Q)]
Exits the ViEd application. All tabs in the Visualization Panel will be closed and confirmation dialog will prompt out for every unsaved file.
The Edit Menu provides commands to edit a NCES model.
The available options are as follows:
· Undo
·
Redo
· Cut
· Copy
· Paste
· Delete
Initially, when no NCES entity is selected all these menu items are disabled as indicated below:
Figure 4-10 Editor Menu
Undo the last action performed. The undo history will currently store up to 100 changes.
Redo the last action that was undone. If another action is performed when redo actions are available, those redo actions will be lost.
Cut [Edit | Cut (Ctrl
+ X)]
Cut the currently selected NCES entity or group of entities.
Copy [Edit | Copy (Ctrl + C)]
Copy the currently selected NCES entity or group of entities.
Paste [Edit | Paste (Ctrl + V)]
Paste the previously cut/copy NCES entity or group of entities to the target location.
Delete [Edit | Delete (Delete)]
Delete the selected NCES entity or group of entities.
Select All [Edit | Select All (Ctrl + A)]
Select all entities in the Visualization Panel.
Align horizontally [Edit | Align
horizontally (Ctrl + H)]
Horizontally align the selected NCES entities in the Visualization Panel, such as places, transitions, model instances, and their combinations. This command is enabled when multiple entities are selected.
Figure 4‑11 Align Horizontally: (a) Select Entities, and (b) After Alignment
Align vertically [Edit | Align vertically
(Ctrl + J)]
Vertically align the selected NCES entities in the Visualization Panel, such as places, transitions, model instances, and their combinations. This command is enabled when multiple entities are selected.
Figure 4‑12 Align Vertically: (A) Select Entities, and (B) After Alignment
The View Menu contains commands to zoom in/out the Visualization Panel. By default, the Visualization Panel displays the NCES models using the default dimensions. The Zoom tools provide functions to enlarge or reduce the zooming factor of the Visualization Panel.
The available options are as follows:
·
View All
· Zoom In
· Zoom Out
The items in this menu are enabled once a new model has been created or loaded from disk, as illustrated below:
Figure 4‑1 13 View Menu
Resets the zoom and moves the sketch to the centre of the Visualization Panel.
Adjusts the zoom and pans the sketch so all of the current NCES model’s entities are visible in the Visualization Panel.
Zoom In [View | Zoom In (Ctrl + Plus)]
Increase the magnification of the current NCES model’s view.
Zoom Normal [View | Zoom Normal (Ctrl + Equal)]
Reset the zooming factor of the Visualization Panel to the default value.
Zoom Out [View | Zoom Out (Ctrl + Minus)]
Decrease the magnification of the current NCES model’s view.
Focus the Visualization Panel on the next entity in the selected group.
Focus the Visualization Panel on the previous entity in the selected group.
Some properties of ViEd can be
changed by selecting the corresponding items in the Options menu. When an
option is selected or toggled, a small tick icon will be displayed next to the toggled option
as shown in 4‑14 (B).
The available options are:
· Colors
Initially, when click the Options menu the following options will appear as shown in Figure 4‑14 (A):
Figure 4‑14 Options Menu: (a) Default Options, and (b) Toggled Options
Show all comments [Options | Show all comments (Ctrl + I)]
Toggle all the comments on the NCES entities, such as places, transitions, and model instances. By default, this option is switched off. The comments will be displayed in grey rectangle boxes as shown below:
Figure 4‑15 Toggle All Comments
Show page borders [Options | Show page borders (Ctrl + K)]
Toggle the left-hand-side and right-hand-size borders of the current NCES model. The borders are indicated by two vertical lines in grey as illustrated below:
Figure 4‑16 Toggle Page Borders
Lock page borders [Options | Lock page borders (Ctrl + L)]
Lock the positions of the page borders so that the page size is fixed.
Hide all entity IDs, as illustrated below.
Figure 4-17 Hide
entity IDs: (A) IDs visible, and (B) IDs hidden
Always save compatible [Options | Always save
compatible]
By toggling this option, the current NCES model will be saved in a compatible format that the TNCES editor will recognize regardless of which save command (Save, Save as, or Save Compatibility) is used. This is handy when developing models that can be recognized by both ViEd and TNCES editor.
Display the colour options dialog. (See section 4.6 for more information) This allows the user to specify colours used to draw the model.
Display the preferences dialog. (See section 4.7 for more information) This dialog is used to set ViEd preferences.
The Help menu contains useful information about ViEd, such as the manual and contact details.
The Help menu contains two items:
· Help
· About
Figure 4‑18 Help Menu
Help [Help | Help (F1)]
Display this ViEd manual as a HTML file.
About [Help | About]
Displays application information, version number, copyright information, and contact details as illustrated below:
Figure 4‑19 About Dialog
The Toolbar provides the quick access to the most frequently used Menu commands and settings. There are a number of icons on the Toolbar as explained below:
· New
(Ctrl + N): Creates a new NCES model.
· Open
(Ctrl + O): Open an existing NCES model.
· Save
(Ctrl + S): Save the current NCES model.
· Save as (Ctrl + Shift + S):
Save the current NCES model with a different name.
· Cut (Ctrl
+ X): Cuts the selected entities and stores them in the clipboard.
· Copy
(Ctrl + C): Copies the selected elements to the clipboard.
· Paste (Ctrl + V): Pastes any elements stored in the clipboard.
· Undo
(Ctrl + Z): Undo the last
action.
· Redo
(Ctrl + Y): Save Redo the last action.
· Zoom In
(Ctrl + Plus): Enlarge the zooming factor of current view in the Visualization
Panel.
· Zoom
Normal (Ctrl + Equal): Reset the zooming factor to the default value.
· Zoom
Out (Ctrl + Minus): Reduce the zooming factor of current view in the
Visualization Panel.
· Show all comments (Ctrl + I):
Toggle all the comments.
· Show page borders (Ctrl + K): Toggle the page borders.
· Lock
page borders (Ctrl + L): Lock
the locations of the page borders.
· Delete (Delete): Deletes the currently
selected entities.
The Sidebar is fixed to the top-left of the ViEd application window and contains the tools that operate on the workspace in the Visualization panel. The selected tool determines what ViEd does when click and drag the mouse on the workspace. For example, when the “Place” tool is selected, a click on the workspace will create an NCES place entity, but when the “Transition” tool is selected, a transition entity will be created. By default, the “Select Mode” is selected. Short cut: press the “Esc” key to switch back to the “Select Mode”.
The available tools are:
·
Select
Tool: Select, move, and transform NCES entities in the Visualization Panel
by clicking and dragging. To select an element and all connected arcs, simply
double-click the element. To achieve this action with a module instance, hold
Ctrl while double-clicking.
·
Pan
Tool: Pan around the workspace in the Visualization Panel by clicking and
dragging.
·
Place Tool: Create an NCES place at the
current cursor’s location. ViEd will automatically assign the appropriate ID to
the created places. When a place is created, it will have two names: the user
defined name which is defaulted to [p + place ID], and the symbolic name. For
example, as shown in
, the blue p1 is the default user defined
place name, and the green p1 is the symbolic
name which cannot be changed.
·
Transition
Tool: Create an NCES transition at the current cursor’s location. ViEd will
automatically assign the appropriate ID to the created transitions. Similar to
place, the transition
has a default user defined name t1 and a symbolic name t1. Moreover, the V symbol indicates that the
transition is in OR mode. In contrast, transition
represents a transition in AND mode.
·
Arc
Tool: Create an arc connecting two NCES entities. There are three different
types of arcs: event arc, condition arc, and flow arc. The type of created arc
depends on the types of the two connected entities. For example, a condition
arc will be created automatically when connecting a condition input to a
transition. The labels for the different arc types are listed below:
o
Flow arc:
o Event arc:
o
Condition arc:
o
Invalid or unconnected arc:
o
Inhibition arc: (not supported in the current NCES formalism)
·
Event
Tool: Create an event port on one of the two page borders. There are two
different types of event ports: event input and event output. When create an
event port at the left-hand-side page border, the event port will become an
event input; whereas create an event port at right-hand-size page border, the
event port will become an event output. ViEd will maintain the correct ID for
each created event port. Similar to places and transitions, event ports also
have user defined names and symbolic names. The naming convention of event
ports’ symbolic names are:
o
Event input: ei + [Event Input ID], such as
o
Event output: eo + [Event Output ID], such as
·
Condition
Tool: Create a condition port on one of the two page borders. Similar to
, depending on which border side the
condition port is created, there condition port can be either condition input
or condition output. ViEd will maintain the correct ID for each created
condition port. The convention for naming condition ports’ symbolic names are:
o
Condition Input: ci + [Condition Input ID], such as
o
Condition Output: co + [Condition Output ID], such as
·
Instantiation Tool: Instantiate
an instance of an existing NCES model type. When this icon is selected a module
selection dialog (see section 4.8) dialog will
prompt out for selecting the target NCES model type to be instantiated. If no
types have been loaded since starting ViEd (either by instantiation, or by
loading a composite type) an [Open file] dialog will be displayed
automatically. Once a valid NCES model type is selected, the cursor will change
to the Precision Select icon (usually a cross similar to
). By clicking on the desired
position in the Visualization panel, the selected NCES model type will be
instantiated. After a model type is instantiated, ViEd will assign it a default
name; however, it is highly recommended that the default name is renamed to a
meaningful one. The naming convention for the default name is: New + [Model
Type Name] + [Instance ID]. For example, NewE_AND1
means the first instance of model type E_AND.
Note: the current NCES formalism
does not support the mixture of basic entities, such as places and transitions,
and model instances. Therefore, if you instantiate a model type in a basic NCES
module all the basic entities will lost without giving a warning. To undo this
action select [Edit | Undo] or press Ctrl + Z.
Panels are sub-windows within
ViEd’s main application window that let you control various options and
settings of the NCES model being developed. Each Panel has an Expand [
] and a Contract [
] button. The Expand button maximizes the
corresponding Panel’s size, whereas the Contract button minimizes the current
Panel’s size. There are six panels in ViEd as follows:
Changes made in one Panel will be automatically reflected in all related Panels. For instance, adding a new event input in the Visualization Panel will simultaneously add a new event input in the Interface Panel.
The Visualization Panel is the
main engineering area, which displays the content of NCES models in different
tabs. In order to standardize the design approach and facilitate the
development process, both basic and composite NCES models share the same tab
view in the Visualization Panel. The text displayed in each tab is the model
name, and the icon next to the model name is used to close
the tab.
By double clicking on a model instance inside a composite NCES model will display its content in a new tab and the focus will switch to the new tab automatically.
You can press the Ctrl or Shift key and drag the mouse to select multiple NCES entities in the Visualization Panel. When entities are selected you can press the Delete key to delete them.
Note: the delete operation cannot be undone.
You can use various tools in the Sidebar to create places, transitions, and so on in the Visualization Panel. Any change made in the Visualization Panel will immediately be reflected to all the other Panels, and vice versa.
Figure 4‑20 Context Menu in Visualization Panel
When right-clicking on empty area or any NCES entity inside the Visualization Panel, a context menu will appear as shown above. The context menu is an alternative way to select the commands in the Main Menu and Toolbar.
Some items in the context menu are enabled depending on the entities that are currently selected:
· One or more entities are selected:
o Delete
·
Two or
more entities are selected:
o Align Horizontally
o Align Vertically
· One arc is selected:
o Add arc bend
o Remove arc bend
o Re-align arc
· One module instance is selected:
o Change module type
o Copy interface
Some items are only available in the context menu.
Add arc bend [Context Menu | Add arc bend (Ctrl + B)]
Add a corner point to the currently selected arc.
Remove arc bend [Context Menu | Remove arc bend (Ctrl + G)]
Remove a corner point from the currently selected arc.
Re-align arc [Context Menu | Re-align arc (Ctrl + T)]
Re-align the currently selected arc. If the arc consists of three points (i.e. the arc has a shape similar to an ‘L’) the arc orientation will be inverted.
Change module type [Context Menu | Change module type (Ctrl + M)]
Change the type of the currently selected module instance. When selected, the Module instance dialog (see section 5.8) will be displayed and the user will be able to choose a new type for that instance.
Copy interface [Context Menu | Copy interface]
Copies the interface elements (event and condition inputs and outputs) of the currently selected module instance to the clipboard. These entities can then be pasted into another model.
The Outline Panel displays the components in the current NCES model in a sorted hierarchical tree structure. Depending on the type of current NCES model, the Outline Panel will display one of two trees: Basic Tree or Composite Tree.
· Basic Tree View
The Basic Tree lists all the components within a basic NCES model as illustrated below:
Figure 4‑21 Basic Tree View
The text “New” besides indicates the name of current NCES model. All
the NCES components are sorted and listed in under the corresponding branch in
the tree. Clicking on the entity’s name in the Outline Panel will select the
corresponding component in the Visualization Panel. The branches of the Basic
Tree can be expanded or collapsed by clicking the respective
and
next to the branch’s name. When a branch is
empty no
or
will appear besides it.
The available branches in a Basic Tree are listed below:
o Places: list all the places in current basic
NCES model. Places are sorted according to their creation order (the internal
Num
attribute in the XML file).
o
Transitions: list all the transitions in
current basic NCES mode. Transitions are also sorted according to their
creation order.
o Arcs: list various arcs of current NCES model.
Flow arcs are represented as
;
event arcs are indicated by
;
and condition arcs are
shown as . The label
p1 -> t1 indicates a flow arc
connects place P1 and transition T1.
o
Inputs: list all the input ports in the NCES
model. An event input is indentified by the
icon, whereas condition input is
represented by .
o
Outputs: list all the output ports in current
NCES model. An event output is represented as
and a condition output is show as
.
· Composite Tree View
The Composite Tree lists all the entities within a composite NCES model as shown below:
Figure 4‑22 Composite Tree View
Unlike Basic Tree, Composite Tree does not contains places and transitions as current NCES formalism does not allow mixture of basic entities and model instances. Instead, the Composite Tree only lists all the model instances inside the model and their connections with each other and the external ports.
The available branches in a Composite Tree are listed below:
o Instances: list all the model instances inside
current model. The label “
NewEIWoW1
[EIWoW]” indicates a model instance
called NewEIWoW1 of type EIWoW. The model instances are also sorted by creation order.
o
Arcs: similar to Basic Tree, except that ports
of a model instance are labelled as “Model Instance name”. “Port name”.
o
Inputs: same as Basic Tree.
o
Outputs: same as Composite Tree.
The Property Panel displays
various property of the currently selected NCES entity or group of entities.
According to the type of selected entity, the Property Panel will display the respective
property fields. The drop box on the top of the Property Panel lists all the
selected entities’ names, which allows you to switch among different entity’s
properties. This is extremely useful when you want to precisely select a
certain entity in a very large model. The button beneath the Property Panel is used to
commit the changes made in the Property Panel and update other Panels.
Moreover, each field in the Property Panel has some error-checking mechanism,
which prevents invalid values to be committed. For example, the Marking field
in the Place view as shown in REF
_Ref174786107 \h Figure 4‑23 can only contain integers. If you entered a letter in the
Marking field and pressed the
button, no action will be performed until you
specify a valid value.
Hint: after changing the
properties, pressing the cartridge return key is a shortcut to press the button.
Note: any invisible character or invalid XML character in the [Comments] fields will be automatically deleted when parsing the NCES model.
There are six different views of the Property Panel:
o Model Type View:
Figure 4‑23 Properties of Current Model
The Model Type View is the default view displayed in the Property Panel. It allows you to specify the name of current model and its comments. You can always switch back to the Model Type View by clicking the empty area inside the Visualization Panel and the text in the Type field will be automatically highlighted.
o Place View:
Figure 4‑24 Properties of Place
The Place view provides direct
access to various properties of a place entity, such as the name, marking,
capacity, clock, and comments.
o Transition View:
Figure 4‑25 Properties of Transition
The Transition view allows you to modify the name, inscription, event mode, switch mode, sychroset, and comment of a transition. When a transition is created, it is default in Spontaneous OR mode.
o Arc View:
Figure 4‑26 Properties of Arc: (A) Flow Arc, and (b) Event arc
The Arc view specifies the properties, such as capacity, time/permeability interval, type, and geometry properties of the selected arc.
The capacity property only allows values greater than zero, any invalid value will be automatically converted to 1.
The time/permeability property field is only usable when the selected arc is of type flow arc. Moreover, to specify the value -2 is used to represent the infinity ∞.
If the selected arc is an event arc, then its type cannot be altered. In contrast, if a flow arc or condition arc is selected its type can be change to Flow Arc, Condition Arc, or Inhibition Arc by choosing the corresponding item in the drop box next to Type.
Note: The ViEd 1.0.0 only supports straight arc segments. The other Geometry modes are not implemented yet.
o Model Instance View:
Figure 4‑27 Properties of Model Instance
In the Model Instance view, you can change the name, and comments of a selected model instance. The first comment block is the comment for the selected model instance, whereas the second comment block (Type Comments) is for the model type.
o Port View:
Figure 4‑28 Properties of Port
When a port entity is selected, for example an event input, the Property Panel will display the port’s name and the comments for it.
The Interface Panel is not an editable area. It only shows the interface of current NCES model and will be automatically updated when changes made in other related Panels.
Figure 4‑28 Model Interfaces: (A) Default Interface, and (B) Interface with Ports
As illustrated in the above figure, REF _Ref174821752 \h Figure 4‑28 (A) shows the default interface when a new NCES model is created. The interface consists of two names: the top Instance Name in yellow and the bottom Type Name in green. When ports are added to the model, only their user defined names will be displayed on the interface as illustrated in REF _Ref174821752 \h Figure 4‑28 (B).
The XML Panel displays the XML
file of the current NCES model. After pressing the update button immediately above the XML Panel, any change
made in the XML Panel will be reflected in all the other Panels. Similarly, the
XML Panel will also automatically reflect changes made in other Panels. If no
change made to the XML file, then the update button
is unusable.
Note: The current version of ViEd
uses a local XML Schema file to validate the XML files. The validation process
is only performed when the XML file is opened or saved. Moreover, depending on
the path of the current working directory of ViEd, the XML Schema file’s
location appeared in the XML Panel may not be the same. However, ViEd will
always use the XML Schema stored in \xmlSchema\NCESModuleNetworkExtended.xsd.
The Console Panel displays the internal information of ViEd, such as parsing input XML file, and any error message occurred. The Console Panel’s content can be cleared by press the [Clear] button on the Status Bar.
Hint: When the Console Panel’s content changed, an asterisk sign (*) will appear next to the word “Console”.
The Status Bar is at the bottom of the ViEd application window and is used to display messages of various operations. For instance, messages about whether the current file has been changed or not. The Clear button at the right hand side of the Status Bar is used to clear the messages displayed in the Console Panel, which is only usable when the Console Panel is active.
Figure 4‑30 Status Bar
The colour options dialog allows the user to specify the colours
used to draw the entities contained within and NCES model. It is accessed from
the [Options] menu, and these options are common to all models in ViEd.
Figure 4-31 Colour
options dialog
Each color option is displayed as a row in the main table with its
name in the left column, and the color in the right column. Each item’s name
describes the usage of that colour (e.g. The Flow arc (Connected) option
specifies the colour of a connected flow arc). To change the colour of an
entity feature simply click on the corresponding item in the Colours column.
This will display the colour selection dialog, as illustrated below.
Figure 4-32 Colour
selection dialog
This is the standard Java colour selection dialog. To pick a
colour simply choose a swatch, or use the HSB or RGB tabs to enter the colour
values manually, then click [OK].
To close the dialog, click the [Close] button. Any changes are
automatically applied.
To restore the colours to their default values click the
[Defaults] button and click [Yes] when asked to confirm.
Figure 4-33 Confirm
reset colours
Colour schemes can be saved to disk using [Scheme | Save] and
loaded using [Scheme | Load]. Colour schemes are stored in *.scheme files and
the scheme file that is loaded at start-up can be specified using the Preferences
Dialog (see section 5.7).
The
preferences dialog is used to set persistent ViEd preferences. Each preference
is displayed as an item in the table, with the preference name on the left, and
the value in the right column. To edit a preference value, simply double-click
on the item in the ‘Value’ column. To save the value press enter or click
outside the edit box. Items that are numeric or boolean (true or false) will
only accept valid values.
Figure 4-34
Preferences dialog
Changes
are applied automatically and saved when the program exits normally.
The module
selection dialog allows the user to select a type for a module instance. This
dialog is displayed when the user clicks on the [ Instantiation Tool (Ctrl +
Space)] in the side bar, or invokes the [Change module type (Ctrl + M)] command
from the context menu.
Figure 4-35 Module
selection dialog
On the left hand side is a list of loaded module types. This
list is common to all modules that have been opened in ViEd. It shows all
previously loaded types and any types referenced in composite models. To choose
a type, simply click on its name in the Loaded Modules list. When a type is
selected its interface is displayed in the Interface Panel on the right hand
side. To open a type not shown in the list click [Browse]. This will display an
[Open file] dialog which allows the user to choose a file to load. When loading
a composite type, the sub-types may not be displayed immediately but will
appear in the loaded modules list as they are resolved.
To
confirm the type selection click [OK] or press the Enter key, and to cancel the
selection click [Cancel] or press the Escape key.
This chapter presents worked examples of how you can use ViEd to create NCES models and exposes the techniques of using various commands mentioned in the early chapters. This chapter is broken into step-by-step tutorial that will take you through the process of creating a basic NCES model and then a composite model. The final model can be later verified in the Visual Verifier.
This section guides you to create your first NCES model. After starting the Visual NCES Editor application, simply follow the steps below
Step 1. Create
a new NCES model
Select File | New or click
the icon to create a new NCES model. This will
bring a new tab in the Visualization Panel. You should get something like:
Figure 5‑1 Create New NCES Model
Step 2. Define
the model’s interface
After creating a new NCES model, we need to define the model’s interface such as model name, event and condition ports. We first position our cursor inside the Visualization Panel and click the left button. This will bring us the Model Type View in the Property Panel as shown below:
Figure 5-2 Define Model Interface
The Property Panel shall
display the default type name of current model, which is called “New”, and a
text field for entering comments about this model. Let’s call our new model: MyFirstBasicModel, and enter text “This is my first basic NCES model” to
the comment field. Then press the button underneath the Property Panel to commit
the changes. You should get something like:
Figure 5‑3 Defined Model Interface
Next, we will add event and input ports and some NCES entities to our model.
Step 3. Define
the model’s content
Now we are ready to start designing our model. First, we want to add one event input and one condition output to our model, so that is can somehow communicate with other models. To achieve this we need to do the following things:
1. Select the
Event Tool in the Sidebar.
2. Position the cursor to the left page border inside the Visualization Panel and click the left button. [Hint: you can turn the option Options | Show page borders on, so that the page border will always visible.] An event input called ei1 will be created. Remember, depending on which page border you click the ViEd will intelligently decide the type of port, which in this case is an event input.
3. Select the newly created event input ei1. The symbol of ei1 should be highlighted in red and the Property Panel should display its properties. Now we can change the default name ei1 to some meaningful name, for example, START. Press the update button underneath the Property Panel you should get something like:
Figure 5‑4 Add an Event Input
Notice that the Interface Panel, XML Panel, and Outline Panel are also updated at the same time.
4.
In a similar way, we can easily create a condition output. Simply repeat
the last two steps but this time we need to select the Condition Tool and click at the right page border. We will
rename the condition output to ENABLED
and commit the change.
Next we can add some other NCES entities, such as places transitions into our design:
1.
Select the Place Tool in the Sidebar, position the cursor inside the
Visualization Panel and click the left mouse button. Then, a place called p1
will be created at the cursor’s position. Similar to port, we can select p1 and
modify its properties in the Property Panel. In this case, we will make the
initial marking of p1 to 1.
2. To add a transition, select the Transition Tool in the Sidebar and repeat the procedure mentioned above. At last, you can create something like:
Figure 5‑5 Add Places and Transitions
3. The places and transitions are not properly aligned. To align the places vertically we first select both of them by dragging the mouse or holding Ctrl and clicking on them. Then, we right click on the highlighted box which will bring us the context menu as shown below:
Figure 5‑6 Align Places Vertically
Now we can select the Align horizontally command and the two places will be aligned automatically. We can repeat the same process to the two transitions but this time we want to align them horizontally. The resultant model should look like:
Figure 5‑7 Alignment Result
4.
Finally, we need to connect the places, transitions, and ports. To add
an arc, we need first to select the Arc Tool in the Sidebar and move the cursor to the
source entity of the arc. Click the left button of the mouse to create a grey
arc. Move the cursor to the destination entity of the arc and click the right
button to release the arc. If the arc turns into blue, it means the arc has
been created successfully. If it remains grey, then perhaps you missed the
destination entity. In this case, switch
to the Select Mode
in the Sidebar; select the arc and move its
arrow head to the current position and the ViEd will automatically connect it.
Alternatively, you can simply delete the arc and redraw a new one.
Figure 5‑8 Straight Arc
Sometimes, we may want to make polygonal arcs with one or more intermediate points. This can be achieved by simply click the left mouse button at the point you want the arc to bend when drawing an arc. The following figure shows an arc t2->p1 with one intermediate point:
Figure 5‑9 Polygonal Arcs
At last, we can connect the event input START to t1 and p2 to condition output ENABLED as connecting places and transitions. Arc type is determined automatically according to the context, i.e. the type of source and destination entities. In a case of ambiguity, for example an arc from a place to a transition can be either a flow arc or a condition arc; the type is assigned by default as flow arc. However, you can easily change it in the Arc View of the Property Panel. The final design of our first basic NCES model should look like:
Figure 5‑10 Final Basic Model
Step 4. Save
the created NCES model
When everything is done,
we can save our first model by clicking the button or selecting File | Save, or using the
shortcut Ctrl + S. The first time you save a model, a Save File dialog will
appear ask you for the model name as:
Figure 5‑11 Save NCES Model
Note: If you are going to use models created by ViEd in TNCES editor you must ensure that the model type name is identical to the file name you saved.
You can solely model the target system by creating a large basic NCES model. However, this will make the overall design unmanageable and unwieldy. Instead, composite NCES models are networks of other models, which can also be composite. Composite models modularize the design and can precisely reflect the target system’s real structure or layout.
This section demonstrates you the basic steps to create a composite model type.
Step 1. Create
a new NCES model
A composite NCES model is created in the same way as basic NCES model. In this case, we create a model called MyFirstCompositeModel.
Step 2. Instantiate
model types
To make a composite model,
we need to instantiate other model types. We will reuse our first basic NCES
model created before. However, composite model also can contain instances of
other composite model types. To instantiate a model type, we first select the
Instantiation Tool in the Sidebar. Then we mouse the cursor to
the Visualization Panel and click the left button to bring the Open File dialog
to choose the target model type as shown below:
Figure 5‑12 Instantiate a Model Type
After we chose the
MyFirstBasicModel.xml file, the cursor will change to the Precision Select icon
(e.g. ) and we can left
click at the place we want to put our instance. We will instantiate two
instances of model type MyFirstBasicModel. The result should look like:
Figure 5‑13 Instantiation Result
Same as places and transitions, model instances can also be aligned in the same way.
Step 3. Connect
the model instances
Same as connecting basic NCES entities in basic NCES model, model instances in a composite model are connected by using the Arc Tool. In this example, as we did not create any input/output so we cannot connect our model instances. Usually, a composite model without any input/output is called autonomous. In most cases, you need to create autonomous composite models to perform testing operations.
Step 4. Save
the final model
Composite models are also saved in the same way as basic NCES model. However, in order to distribute the composite model, you must also include all the sub-models inside the same folder you want to distribute. Otherwise, when open the composite, ViEd will complain that some files cannot be found in the current working directory and ask whether you would like to manually locate the missing files:
Figure 5‑14 File Not Found Dialog
This section demonstrates how to use ViEd to create an NCES model of a real system: the controller of a cylinder.
Figure 5‑15 Cylinder with Two End-Position Sensors and Two Control Signals
The example cylinder system is primitive but sufficient to illustrate the basic steps of modelling a real system.
· After extracting the archive, why the ViEd cannot run?
ViEd is developed with JDK 1.6. Therefore, in order to run ViEd you must install JRE 1.6 or above.
· Does ViEd can be run in Linux?
Although ViEd is developed in Java, it currently has not been ported to Linux.
· Why my ViEd freezes for no reason?
This may be caused by various reasons. In general, whenever a runtime error occurs, an error.log file will be created inside the ViEd folder which lists all the error messages.
· Workarounds for the known bugs and issues are listed in the Known Bugs and Issues section.
· No warning message prompt out when instantiate a model type in a basic NCES module. The content of the basic NCES module just simply disappears. This can be undone by invoking the Undo command (Ctrl + Z).
· When reopen a composite NCES model, all the internal arc connections screw up. The connections are still correct however just the graphical rendering does not work properly. By slightly moving the instances, the arc connections will be re-connected.