Visionic online property BeforeClick

We have introduced two new properties for any shape on Visionic online. These are called “Before click” and “Before parameter”.

Simply put, you can instruct Visionic to show you MessageBox with Ok/Cancel buttons and give user a chance to abort the action. This is usual security when having buttons that execute macros: it is usual / recommended to ask the user’s confirmation before excuting the action.

The “BeforeClick” can have these values:

  • DoNothing – no warning message

  • PresentWithYesNo – presents message box with Yes/No Ok/Cancel buttons

  • PresentAndAbort – The action will be aborted (not executed) for users who are not administrators of the project

  • ExecCustomCode – executes JavaScript code (JS code is in “Before parameter”). If function returns True, the action is continued; otherwise the action is aborted.

Happy coding!

SNG Station – new Visionic online example

SNG Station Example Project

The SNG Station project is a new Visionic online project for a typical SNG vehicle. The monitoring and controlling system includes:

1.      SNG encoder / modulator

2.      Upconverter

3.      Software-based redundant HPA subsystem

4.      EIRP display

The project can be viewed from:

Or you can chose it as a project template when creating a new project.

Points of interest

The EIRP display is configured to show the output power, in dBW, depending on the switch position. The EIRP display is bound to the following Javascript expression:

function e() { 

var swPos = (+jsVisApp.SwitchPosition(“SW1”)); 

var power = 0.0; 

if (swPos == 1) {   

power = (+jsVisApp.Value(“AMP1”)); 

} else if (swPos == 2) {   

power = (+jsVisApp.Value(“AMP2”)); 

} else {   

power = 0.0; 


if (power <= 0.0)   

return 0.0; 


return 10 * (Math.log(power) / Math.log(10.0));



The JavaScript object jsVisApp is defined for use in JavaScript extensions. It uses functions from the Silverlight client in the browser and it is automatically included in the Visionic client HTML page. The definition of the jsVisApp is as follows (you cannot change this definition; it is for information purposes only):

var jsVisApp = {

    VisionicApp: document.getElementById(“slRuntimeObject”),

    Shape: function (shapeName) {

        return SLPlugin.Content.VisApp.Document.ActivePage.FindFirstShape(shapeName);


    ShapeText: function (shapeName) {

        return this.Shape(shapeName).FPUserText;


    SwitchPosition: function (swName) { return this.Shape(swName).GetPropValue(‘Position’, 0); },

    Value: function (shapeName, lineNum) {

        if ((lineNum == ‘undefined’) || (lineNum == null))

            lineNum = 0;

        var text = this.ShapeText(shapeName);

        if ((text == null) || (text == ))

            return 0.0;

        try {

            var pattern = /:([\S]+)/mg;

            var match = text.match(pattern);

            return (match[lineNum]).substr(1);

        } catch (e) {


        return 0.0;



The function Value(ShapeName, LineNum) returns the text line of the shape. The parameter LineNum is the line number of the text : 0 for the first line and so on.

Changing power

On the user interface you will find two hyperlink buttons: + power and –power. These buttons call IncHpaPower and DecHpaPower macors respecteviley. These macros increase or decrease the power of whatever HPA is currently connected to the antenna output.

Visionic online new upload

The newest beta version you will easily spot by using Bureau Blue SL theme. Beside this minor tweak, there are other features in this release.

The first one is adding PageWidth and PageHeight properties to a page. These properties are used to measure / dimension the size of the dialog if the page is called as a device dialog page.

The second property that we added to the page is PageBackground. The PageBackground can be either a solid color, gradient or linear brush or image brush (not yet ironed out that one!). This gives more rich user experience and better presentation of the projects.

Finally the runtime has been updated (on the web site only!) to color code all wires and paths. The paths are now color-coded and we plan to add click-to-highlight-the-path functionality.

Visionic online tutorial

Today we just made our first Visionic online tutorial!

The tutorial contains step-by-step instructions on how to build your first Visionic online system.

It has a lot of pages (screenshots) and it covers the design phase on the Internet.

We consider this to be a start for  further Visionic tutorials and help.

You can find the tutorial here