Monday, April 16, 2012

Using ScaleForResolution=0

Avoid screen resolution problems when moving InTouch applications between computers

If you're using classic InTouch, you've no doubt encountered the problem when editing an application on your development system that was created in a different video resolution. Common these days might be a target application for a screen size of 1280x1024 and a development system running on your wide-screen laptop at 1920x1080.  Nice laptop, by the way.

You always had to be careful when jumping between resolutions, but when you also change aspect ratios to a wide-screen, it's even more difficult.
There are two simple solutions.  One is to switch to using Managed InTouch applications and edit using the ArchestrA IDE. When opening InTouch WindowMaker, and prompted to change resolutions, you can just click 'No', and it lets you edit in the application's native resolution.

The other solution, for classic InTouch users, is to add the line:
ScaleForResolution=0



to the INTOUCH.INI file in your application's folder:
 




When you open the application, you will still be prompted to convert the resolution. Go ahead and click 'Yes'.  It will go through the conversion process,but it will not rescale your graphics. So a 100x100 pixel rectangle in the original application will still be a100x100 pixel rectangle after conversion.
Once you're done editing, you're going to copy your modified application to the original target computer, which had the 1280x1024 resolution in our example.  The modified application will show up in your Application Manager as having your edited 1920x1080 resolution, but don't worry.

Open your InTouch Application Manager and select Tools /Node Properties, then click on the Resolution tab. Select 'Allow WindowViewer to Dynamically Change Resolution', and then select 'Convert to screen video resolution':


When you open the application on your target computer in WindowViewer, it will convert the resolution back to 1280x1024.  But again, no rescaling will take place, so your application looks great.
One more note, you must always be aware of fonts.  If the original application used a font that was installed on one of the computers, but does not exist on the other computer, Windows will 'guess' as a font. And it usually guesses poorly. It's best to confirm that the same fonts already exist.

How do I create a new application on my wide-screen laptop that will be target for a different resolution target computer?
Sorry, no way around it. You must create your original application in that target application resolution. Then you can change your monitor back to your preferred resolution.

------

Update:  Starting with InTouch version 10.5 (part of System Platform 2012), you can set a checkbox in WindowMaker to perform this same thing. In WindowMaker, select Special / Configure / WindowMaker.  Check the box 'Lock Window Size'.


Tuesday, April 3, 2012

Getting Started with Remote Apps

Remote Apps is a new feature of Windows Server 2008 and onwards.  It uses the same technology as Remote Desktop, but displays only specified applications instead of an entire desktop. From the workstation perspective the app appears to be running locally; in reality it is running on the server. 

InTouch is a good candidate to run as a remote app because you often want more secure access by your HMI applications.
Accessing InTouch using Remote Apps is easy.  You can open a web browser and navigate, or you can embed a link on your desktop. Double-click on the link and it opens your InTouch application, just as if it were a local application.

The rest of this article focuses on how to setup Remote Apps.  If you have experience setting up a terminal server this will be trivial.  If you don’t, it still shouldn’t be too bad.

Client Setup
RDP version 6.1 or above is required on the client computer.  The required version of RDP ships with Windows XP SP3, Windows Vista SP1, Windows 7, Windows Server 2008, and Windows Server 2008 R2.  If need on another OS the required RDP version can likely be installed, even a Mac or a Tablet.

There are three options for setting up the clients.  All clients can be setup the same way or mixed and matched.
Option 1 - RDP File
The server can be used to create a *.rdp file with all the correct info.  The rdp file is put in a convenient location like the desktop where the user double clicks it to launch the app (such as InTouch).
Option 2- MSI File
The server can generate an msi file.  On the client machine the msi file is executed in order to install a shortcut in the start menu.
Option 3- Website
The server can host a website with links to launch apps like InTouch.  The big benefit of this is that zero client configurations are required.  An example link might be: https://RemoteAppsDemo/RDWeb/.  A user would then have to sign in to launch an app like InTouch.

Server Setup
Remote Apps is included with both Windows Server 2008 and Windows Server 2008 R2.
Given the choice to enable remote apps when adding the remote desktop services role(old name: terminal services role).
Installing Remote Apps
On Windows Server 2008 R2 (similar process for 2008) goto Server Manager add the roles “Remote Desktop Session Host” and “Remote Desktop Web Access”. 
Configuring Remote Apps
Goto Server Manager->Roles->Remote Desktop Services->RemoteApp Manager.  Here is where all the configuration will be done for Remote Apps. 
First thing to do is check for any warnings that looks significant.  One that will need to be addressed is “The TS Web Access Computers group is empty”.  The link “Learn more” can be clicked on for details on what this is and how to resolve it (resolution is easy).
The second step is to pick applications to enable as remote apps.  This is done by clicking “Add RemoteApp Programs” in the Actions pane on the far right.  The process of picking apps is simple.  A likely setup would be just WindowViewer, which would launch a specific InTouch project.  Another option might be to give them access to the InTouch Application Manager so they can pick which InTouch project to launch.