43429members
217967posts

[Imported] Dynamically changing font size and columns widths for embedded alarm lists

Highlighted
Sisko

[Imported] Dynamically changing font size and columns widths for embedded alarm lists

>>Message imported from previous forum - Category:ClearSCADA Software<<
User: florian, originally posted: 2018-10-24 20:43:31 Id:201
This is a re-posting from the obsoleted (October 2018) "Schneider Electric Telemetry & SCADA" forum.

---------------------

**_AFK:_**
**_We have a mimic with an embedded alarm list. The fonts on the list, as well as the column sizes are configured for optimal viewing using WebX for most of our users. However, we have a power user with a much larger screen that runs ViewX. When they load the mimic, everything is too small. Is there a way in script or otherwise to dynamically change font size and column widths depending on if the script detects ViewX or a WebX session?_**

-------------------------

AWoodland:
Font size can be set using animations on the list object and so if you put something like:

REGISTRY('ListSize',9)

In the Font.Height animation when someone displays the mimic by default it will be shown with a size of 9, however if someone modifies the setting for that Windows user on a specific workstation and say put 12, the font size will be 12.

That's the simple setup, you can provide some buttons to dynamically increase the number using some script if you like depening on how flexible you want it to be.

The columns widths will increase as to meet the new font size.

Does that help?

(Update: The underlying setting is stored in HKCU\\Software\\Schneider Electric\\ClearSCADA\\ViewX/Mimics if you want to play, on older versions will be in Control Microsystems key)

------------------------

**_AFK:_**
**_Hi Adam, thanks for the quick reply. Your solution sounds good, however I cant find the 'ListSize' variable in the registry location you specify (see attachment). Can you please clarify that it should be there (or somewhere else)?_**

**_Also, im assuming this setting will have a different effect to simply changing the Font.Height animation property (as this does not really work as want it to, it doesnt really change the column sizes effectively)._**

**_I would be ideal if we could programatically change the column sizes on the embedded alarm list, but if not possible we will try the work around._**

-------------------------------

AWoodland:
Hi,

The variable name can be whatever you want it to be, if it doesn't exist it will be created with the value of the second parameter. This means that when a client first loads the relevant list the value of 9 is written to the registry and used as the size, the next time they display the list the variable will already be there and the value currently stored against it is used (which is why you can increase it on the special client and other clients are unaffected). There is more information on the REGISTRY function in the help.

The animation is the same as changing the font size via the Properties dialogue, they are a 1-to-1 match in functionality. This is pretty much the same for all animations, animations just provide some way to dynamically change those settings in the Properties dialogue.

There's no specific way to change the width of a column, the only way would be with some trickery. You could try casting the column's data type to another data type which is larger (i.e. int to long) and that can increase the width but by a fixed amount, sorting might break with this though. Alternatively you could alias the column name and add some spaces on the end. Neither are nice solutions though.

-------------------------

**_AFK:_**
**_Thanks Adam, yeah changing the column size is really what we are after. Basically the mimic in question (with the embedded alarm list) was designed to fit most standard PC screen sizes via WebX. With this new large screened ViewX client the columns are all squashed together and it doesnt look great._**

**_The column names in an embedded alarm list are fixed as far as Im aware (ie im not using SQL or anything to generate the list, its just the standard embedded alarm list object from the toolbox). Does this mean your suggested work arounds wont work? (or if so, can you explain further how to cast the columns datatype or alias the column?)_**

**_Thanks again_**

-----------------------

AWoodland:
You can alias columns with your own name using the AS keyword, for example:


_SELECT_
_FullName AS "Fullname a"_
_FROM_
_CDBOBJECT_

This forum software might mess with the formatting but basically there are a lot of spaces (but no new lines) between the Fullname and the a. The a is there because the spaces get trimmed, perhaps a non-breaking space or an _ will work better. Have a play and see.

There is help on the SQL CAST is in the help, basically CAST(Property AS Datatype). It's generally more useful for converting strings to numbers for sorting.

--------------------

**_AFK:_**

**_yep, understand you can alias columns in SQL statements, but the embedded alarm list object is not something I can control the SQL of. Its dragged in from the toolbox of objects and is configured in other ways (for example the 'alarm columns' settings in the context menu of the root node. So I dont think this can be done as you say, for what we are doing anyway._**

-------------------------

geoffpatton:
I would just have two copies of the list and set one up for the ViewX user and then display it when they are logged on or if a WebX is head is not detected, otherwise hide it. As I recall the registry changes apply to the system so there would be a conflict between WebX and ViewX users changing the registry. Anyway it is a lot easier to hide a list then do all that registry editing.

-------------------------------

AWoodland:
Damnit, sorry, missed the alarm bit and just read embedded list.

Geoff's suggestion will also work. The Registry settings will affect anyone on that client, and whilst it's largely irrelevant I'd argue that the REGISTRY setting is simpler than code to work out if you're on ViewX or WebX, but whatever is best for you 🙂

--------------------------------

geoffpatton:
Well I had the registry changes I applied on the server's ViewX get applied to the WebX sessions.
The display code based on the Head is simple enough if you are familiar with controlling the properties of objects on the Mimics. For those that are not here is what I would have done in vbscript.

Head 0 is the WebX Head
New Layer is the name of the layer that the Alarm list is on
Alrm_1 is the name of the Alarm list for the Webx users
Alrm_2 is the Name of the Alarm List to Show/Hide for the ViewX user.
If all ViewX users are to use Alrm_2 then remove everything for sCurrentUser.

_Option Explicit_
_Function Mimic_Load_

_Dim sCurrentUser_
_sCurrentUser = Server.UserName_
_If App.Head = 0 and sCurrentUser = "John Doe" Then_
_Mimic.Layers("New Layer").Item("Alrm_1").Visible = 1_
_Mimic.Layers("New Layer").Item("Alrm_2").Visible = 0_
_Else_
_Mimic.Layers("New Layer").Item("Alrm_1").Visible = 0_
_Mimic.Layers("New Layer").Item("Alrm_2").Visible = 1_
_End If_
_End Function_

-------------------------------

rwallace:
Sorry to re-awaken this very old topic, but it seems the most relevant that I can find by searching the forums.

A customer wants to increase the font size of the Alarm List in WebX (original). I'm unable to find a way to do this, and CS Support couldn't think of anything either.

Doing it in ViewX is easy (File-Options-List), but this doesn't seem to apply to WebX, and the only config option in the Server Configuration seems to be the background colour of the alarm banner/list in WebX. As the Alarm List is embedded inside the ActiveX control, I don't think that changes to any of the CSS/XSL files will have any effect...

If anybody has any ideas, I'd appreciate the input!

Thanks,

Richard