Difference between revisions of "OtfScreenMapping"

From emotive
Jump to navigation Jump to search
Line 4: Line 4:
  
 
==Screen Mapping==
 
==Screen Mapping==
In principal the Screen Mapping bounds the properties of controls found in a form of an .NET assembly (*.dll or *.exe) to OTX [[ScreenSignature|Screen Signature Parameters]] via [[OtfDataBinding|Data Binding]]. In opposite to the [[OtfGenericScreen|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.
+
In principal the Screen Mapping bounds the properties of controls found in a form of an [http://msdn.microsoft.com/en-us/library/8bxxy49h(v=vs.110).aspx Windows Forms] Binary (.NET assembly *.dll or *.exe) to OTX [[ScreenSignature|Screen Signature Parameters]] via [[OtfDataBinding|Data Binding]]. In opposite to the [[OtfGenericScreen|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.
  
===Windows Forms===
+
To apply the screen mapping, the following steps have to be performed:
 +
# Create Windows Forms Binary
 +
# Create a Screen Mapping file via the Screen Mapping Editor
 +
# 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 [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 [[ScreenSignature|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.
 
For the Screen Mapping the user have to create an executable application (*.exe) or 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 [[ScreenSignature|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.
  
===Screen Mapping Editor===
+
===Create mapping file via Screen Mapping Editor===
[[File:PrjSettings_ScreenMapping.png|500px|thumb|The "HMI" page allows for managing the screen mapping files]]
 
 
[[File:ScreenMappingEditor1.png|500px|thumb|The "Screen Mapping Editor" dialog box and the "Signature/Screen-Mapping" dialog box]]
 
[[File:ScreenMappingEditor1.png|500px|thumb|The "Screen Mapping Editor" dialog box and the "Signature/Screen-Mapping" dialog box]]
  
 
+
To create a Screen Mapping file, please proceed as follows:
In this page, you can create the screen mapping files to bind the screen signatures to GUI controls of external applications.
+
# Open [[OtfProjectSettings#HMI_settings|Project Settings "HMI" tab]]
 
 
To create a screen mapping file, please proceed as follows:
 
 
# Click on the "'''New'''" button.  
 
# Click on the "'''New'''" button.  
 
# In the "'''1. Step*'''" section, click "'''Add*'''" button.
 
# In the "'''1. Step*'''" section, click "'''Add*'''" button.
# Select a screen signature in the "'''1. Step**'''" section and select the application in the "'''2. Step**'''" section.  
+
# Select a screen signature in the "'''1. Step**'''" section and select the [http://msdn.microsoft.com/en-us/library/8bxxy49h(v=vs.110).aspx Windows Forms] Binary (.NET assembly *.dll or *.exe) in the "'''2. Step**'''" section.  
# If there is no application has been added before, click "'''Add'''" button in the "'''2. Step**'''" section, find and select an application and click "'''Open'''" button.  
+
# 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.  
 
# If the loaded application is a WPF form, you have to select "'''WPF Window'''" in the "'''Screen Type'''" drop-down list.  
 
# If the loaded application is a WPF form, you have to select "'''WPF Window'''" in the "'''Screen Type'''" drop-down list.  
 
# Click "'''OK**'''" button.  
 
# Click "'''OK**'''" button.  
Line 28: Line 30:
 
# Click "'''OK*'''" button.
 
# Click "'''OK*'''" button.
 
# Enter the name for the new screen mapping file and click "'''OK'''" button.
 
# Enter the name for the new screen mapping file and click "'''OK'''" button.
# To use the screen mapping file, please select it in the [[#RuntimeEnv_Pg|"Runtime Environment" page]] above or in the "Runtime Environment" tab of the [[OtfMenuBar|Ribbon]].
 
:('''<big>*</big>''' implies that it belongs to the "'''Screen Mapping Editor'''" dialog box, '''<big>**</big>''' implies that it belongs to the "'''Signature/Screen-Mapping'''" dialog box)
 
  
 
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 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.
 
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 [[OtfProjectSettings#Runtime_Environment_settings|"Runtime Environment" page of project settings]] or in the "Runtime Environment" tab of the [[OtfMenuBar|Ribbon]].
  
 
===Data Bound Component===
 
===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
 +
* at the first level of the Control
 +
* of a [[Simple_Data_Type|simple data type]]
 +
 +
If this is not the case, the '''DataBoundComponent''' should be used.
 +
 +
{{Important|The '''DataBoundComponent''' is located in the ''Emotive.Otf.Runtime'' assembly. Before the component can be used a [http://msdn.microsoft.com/en-us/library/hh708954.aspx 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 [[ScreenSignature|Screen Signature Parameters]] via [[OtfDataBinding|Data Binding]]. The property contains the value and the event notifies about changes in OTX.

Revision as of 19:35, 1 December 2014

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.

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.