Difference between revisions of "OtfScreenMapping"

From emotive
Jump to navigation Jump to search
Line 62: Line 62:
  
 
To apply the screen mapping, the following steps have to be performed:
 
To apply the screen mapping, the following steps have to be performed:
# Create Windows Forms Binary
+
# Create Windows Forms Library
# Create a Screen Mapping file via the Screen Mapping Editor
+
# Create a Screen Mapping file from Assembly via the Assembly Screen Mapping Editor.
 
# Select the Screen Mapping file in the runtime settings of the project
 
# Select the Screen Mapping file in the runtime settings of the project
 +
===Create Windows Forms Library===
 +
For the Screen Mapping the user have to create an assembly (*.dll) with one or more [http://msdn.microsoft.com/en-us/library/8bxxy49h(v=vs.110).aspx Windows Forms]. This job can be done graphically with the [http://msdn.microsoft.com/en-us/library/e06hs424%28v=vs.110%29.aspx Windows Forms Designer] of [http://www.visualstudio.com/ Microsoft Visual Studio] or with free [http://www.icsharpcode.net/opensource/sd/tour/090/formsdesigner.asp Forms Designer] of [http://www.icsharpcode.net SharpDevelop]. All [http://msdn.microsoft.com/en-us/library/ettb6e2a(v=vs.110).aspx controls] found in that form can be bound to [[Core.Signatures.ScreenSignatures|Screen Signature Parameters]] via the Screen Mapping Editor, see below. The form can contain arbitrary program logic or can be just a form with controls and without internal logic.
 +
===Create a Screen Mapping file from Assembly via the Assembly Screen Mapping Editor===
 +
[[File:Screen Assembly Mapping Editor 1.png|400px|thumb|Image 1 :The "Assembly Screen Mapping Editor" dialog box]]
 +
[[File:Assembly Screen Mapping 2.png|400px|thumb|Image 2: The "Assembly Screen Mapping Editor after drag" dialog box]]
 +
 +
To add Assembly Screen Mapping file, please proceed as follows:
 +
# Open [[OtfProjectSettings#HMI_settings|Project Settings "HMI" tab]]
 +
# Click into "'''New Assembly Screen Mapping'''" button
 +
# A screen Assembly Screen Mapping Editor appear : In Screen have two Part
 +
## Part 1 Select NameSpace of App-ID : This is [[Core.Signatures.ScreenSignatures|Screen Signature]] that system load from assembly (*.dll) in project current.
 +
## Part 2 Select OTX Document, click "Assign" button and select methods: This is [[Core.Signatures.ScreenSignatures|Screen Signature]] avaiable in project current.
 +
# To screen mapping, please select OTX Document in Part 2 next choises [[Core.Signatures.ScreenSignatures|Screen Signature]] to need Mapping (You can multi choise) in Part 1 then select into '''Arrow''' to drag and is will add [[Core.Signatures.ScreenSignatures|Screen Signature]] into project current and when you want remove click into button "'''X'''" . See "'''image 2'''" below.
 +
# Implement mapping parameter between [[Core.Signatures.ScreenSignatures|Screen Signature]] Project and [[Core.Signatures.ScreenSignatures|Screen Signature]] Assembly. You just choise in Combobox to mapping. Each elements name and type will be mapped to the related OTX name and datatype.
 +
# After completing, Click "'''OK*'''" button.
 +
# Enter the name for the new screen mapping file and click "'''OK'''" button.
 +
 +
To edit a Assembly screen mapping file, select the screen mapping file and click the "'''Edit'''" button or just double-click on the screen mapping file.
 +
 +
To delete a screen mapping file, select the screen mapping file and click the "'''Delete'''" button.

Revision as of 06:34, 15 July 2016

Introduction

The HMI extension (Human Machine Interface) provides access for interacting with the user through the display of graphical screens. To achieve this goal, there are two ways to operate with screens:

  1. Basic Screen - A set of basic dialogs providing by the operating systems
  2. Custom Screens - Customizable screens that allow arbitrary flexibility

Custom screens only define an interface to a screen. The screen itself is externally created. The layout and functionality of this screen is not defined in the OTX. The interface to the screen is the OTX Screen Signature. A Screen Signature defines all IN-, OUT- and INOUT-Parameters of a screen. The OTX Runtime have to map the Screen Signature Parameters to the proper screen controls. The OTF supports two kinds of Custom Screens:

  1. Generic Screen
  2. Screen Mapping

Screen Mapping

In principal the Screen Mapping bounds the properties of controls found in a form of an Windows Forms Binary (.NET assembly *.dll or *.exe) to OTX Screen Signature Parameters via Data Binding. In opposite to the Generic Screen, which is completely generic, easy to use but limited, the Screen Mapping is not limited related to the layout or the used controls.

To apply the screen mapping, the following steps have to be performed:

  1. Create Windows Forms Binary
  2. Create a Screen Mapping file via the Screen Mapping Editor
  3. Select the Screen Mapping file in the runtime settings of the project

Create Windows Forms Binary

For the Screen Mapping the user have to create an executable application (*.exe) or an assembly (*.dll) with one or more Windows Forms. This job can be done graphically with the Windows Forms Designer of Microsoft Visual Studio or with free Forms Designer of SharpDevelop. All controls found in that form can be bound to Screen Signature Parameters via the Screen Mapping Editor, see below. The form can contain arbitrary program logic or can be just a form with controls and without internal logic.

Create mapping file via Screen Mapping Editor

The "Screen Mapping Editor" dialog box and the "Signature/Screen-Mapping" dialog box

To create a Screen Mapping file, please proceed as follows:

  1. Open Project Settings "HMI" tab
  2. Click on the "New" button.
  3. In the "1. Step*" section, click "Add*" button.
  4. Select a screen signature in the "1. Step**" section and select the Windows Forms Binary (.NET assembly *.dll or *.exe) in the "2. Step**" section.
  5. If there is no binary has been added before, click "Add" button in the "2. Step**" section, find and select an binary (*.dll or *.exe) and click "Open" button.
  6. If the loaded application is a WPF form, you have to select "WPF Window" in the "Screen Type" drop-down list.
  7. Click "OK**" button.
  8. After that, click "Add*" button in the "Step 2*" section.
  9. In the new row, click on the drop-down list in the first cell and select a screen parameter.
  10. Continue to select a value for the application control, the property and the event.
  11. Click "OK*" button.
  12. Enter the name for the new screen mapping file and click "OK" button.

To edit a screen mapping file, select the screen mapping file and click the "Edit" button or just double-click on the screen mapping file.

To delete a screen mapping file, select the screen mapping file and click the "Delete" button.

Select the mapping file in project settings

To use the screen mapping file, please select it in the "Runtime Environment" page of project settings or in the "Runtime Environment" tab of the Ribbon.

Data Bound Component

Via the Screen Mapping Editor only simple Controls can be managed. Simple means, that the property which should be bound, should be

If this is not the case, the DataBoundComponent should be used. The DataBoundComponent is a Windows Forms Control from emotive, which can inserted into any form and can be used as a transmitter of arbitrary data types between the OTX-Runtime and the Windows Forms application.

Exclamation.png Important: The DataBoundComponent is located in the Emotive.Otf.Runtime assembly. Before the component can be used a reference to that assembly shall be added to project.

The DataBoundComponent supports a property

public object Data (get/set) 

and an event

public event EventHandler DataChanged

Both can be bound to OTX Screen Signature Parameters via Data Binding. The property contains the value and the event notifies about changes in OTX.

Assembly Screen Mapping

In principal the Assembly Screen Mapping bounds the properties of controls found in a form of an Windows Forms Library(.NET assembly *.dll or *.exe) to OTX Screen Signature Parameters via Data Binding. A Screen Signature can be created by the reflection of such assembly.

To apply the screen mapping, the following steps have to be performed:

  1. Create Windows Forms Library
  2. Create a Screen Mapping file from Assembly via the Assembly Screen Mapping Editor.
  3. Select the Screen Mapping file in the runtime settings of the project

Create Windows Forms Library

For the Screen Mapping the user have to create an assembly (*.dll) with one or more Windows Forms. This job can be done graphically with the Windows Forms Designer of Microsoft Visual Studio or with free Forms Designer of SharpDevelop. All controls found in that form can be bound to Screen Signature Parameters via the Screen Mapping Editor, see below. The form can contain arbitrary program logic or can be just a form with controls and without internal logic.

Create a Screen Mapping file from Assembly via the Assembly Screen Mapping Editor

Image 1 :The "Assembly Screen Mapping Editor" dialog box
Image 2: The "Assembly Screen Mapping Editor after drag" dialog box

To add Assembly Screen Mapping file, please proceed as follows:

  1. Open Project Settings "HMI" tab
  2. Click into "New Assembly Screen Mapping" button
  3. A screen Assembly Screen Mapping Editor appear : In Screen have two Part
    1. Part 1 Select NameSpace of App-ID : This is Screen Signature that system load from assembly (*.dll) in project current.
    2. Part 2 Select OTX Document, click "Assign" button and select methods: This is Screen Signature avaiable in project current.
  4. To screen mapping, please select OTX Document in Part 2 next choises Screen Signature to need Mapping (You can multi choise) in Part 1 then select into Arrow to drag and is will add Screen Signature into project current and when you want remove click into button "X" . See "image 2" below.
  5. Implement mapping parameter between Screen Signature Project and Screen Signature Assembly. You just choise in Combobox to mapping. Each elements name and type will be mapped to the related OTX name and datatype.
  6. After completing, Click "OK*" button.
  7. Enter the name for the new screen mapping file and click "OK" button.

To edit a Assembly screen mapping file, select the screen mapping file and click the "Edit" button or just double-click on the screen mapping file.

To delete a screen mapping file, select the screen mapping file and click the "Delete" button.