Add Trend Tag to existing/previous trend view [Citect Scada 2018 SA]

Hi,

The Default Info_Trend page, will upon click on the marked button show the tag in a new Process Analyst window. 

I would like to make similar button that will add the Equipment Trend tag to the existing/previous trend view that the user had open. 

Appreciate any suggestions how to assign such an button, what functions would I need to set up etc. ?

Thanks,

Rune

Parents
  • Hi Rune,

    The short answer is, you will first be duplicating the SA_Include\TrendPage.ci file and making your own customisations. You may also have to duplicate InfoTrend Page as well. The reason for this, is the goodies you need are protected by PRIVATE functions.

    You used the term "existing/previous" trend view. I assume you are using the standard workspace design that we provide as part of the Situational Awareness Starter Project?
    I also assume you really just mean the trend display you had previously visited and you have navigated away from?

    If so, you may have realised that it is currently "persisting" what you had selected when you navigate away from the page, and restoring it when you re-enter the page. This handled by the functions _TrendPage_PersistSave and _TrendPage_PersistLoad.
    By playing with the InfoTrend (your screen shot) you may have noticed that the persistance data is cleared. In essence preventing an "additive" display.
    The persistence feature is using PAV files, so to do what you want, you would need a way to Load, and then Add. To simulate this go to TrendPage_ShowForEquipment in SA_Include\TrendPage.ci and then:
    1. Comment out the _TrendPage_PersistClear line
    2. Comment out the line TrendPage_PA_CommandExecuted(oProcessAnalyst, l_sRemoveAllPens);
    Now every time you add trends via the InfoZone, they will be combined with whatever you were last viewing on the trend page.

    OK, so that will allow you to add trends to existing page from the InfoZone. By playing with that for a bit you will run into two problems:

    Problem 1: What if the trends are already there? Obviously you don't want to add them multiple times, so you will need to skip those. You can do that by creating yourself a function that enunmerates the pen collection of the Trend and Alarm Pane and removes any corresponding entries from the hTraces array. This would yield an hTraces array with just new traces.

    Problem 2: How many is too many? This Trend Page has been designed to limit the number to 16 traces. We set that soft limit just because the PA only has 16 unique colours. As we have now removed the 'clearing' code it means the TrendPage_ShowForEquipment can exceed the design. So, I would advise in your customers to respect the l_nMaxActiveTraces local variable and provide a warning to the operator that not all traces could be added if it is exceeded etc.

    Problem 3: What if you want both the old (clear) and your new behaviour (don't clear)?
    That just comes down to your target user experience. If you want the InfoZone to be able to have two modes, then you will need to duplicate the InfoTrend_<res> pages from SA_Include into your project, and then customize them with new buttons etc that call a function with a parameter to trigger the old / new behaviours. Don't forget to modify the InformationZone \ @(TREND) menu item to point at your new InfoTrend page. Omit the resolution part if you are supporting HD and UHD in your system as the workspace will auto-adjust.
    If instead, you want to do something like a right click menu on the selected equipment on a mimic (e.g. Add to Trend) then that is a matter of building up an array of trends to add and passing it to your customised TrendPage_ShowForEquipment function.

    I hope that helps,

    bradley
Reply
  • Hi Rune,

    The short answer is, you will first be duplicating the SA_Include\TrendPage.ci file and making your own customisations. You may also have to duplicate InfoTrend Page as well. The reason for this, is the goodies you need are protected by PRIVATE functions.

    You used the term "existing/previous" trend view. I assume you are using the standard workspace design that we provide as part of the Situational Awareness Starter Project?
    I also assume you really just mean the trend display you had previously visited and you have navigated away from?

    If so, you may have realised that it is currently "persisting" what you had selected when you navigate away from the page, and restoring it when you re-enter the page. This handled by the functions _TrendPage_PersistSave and _TrendPage_PersistLoad.
    By playing with the InfoTrend (your screen shot) you may have noticed that the persistance data is cleared. In essence preventing an "additive" display.
    The persistence feature is using PAV files, so to do what you want, you would need a way to Load, and then Add. To simulate this go to TrendPage_ShowForEquipment in SA_Include\TrendPage.ci and then:
    1. Comment out the _TrendPage_PersistClear line
    2. Comment out the line TrendPage_PA_CommandExecuted(oProcessAnalyst, l_sRemoveAllPens);
    Now every time you add trends via the InfoZone, they will be combined with whatever you were last viewing on the trend page.

    OK, so that will allow you to add trends to existing page from the InfoZone. By playing with that for a bit you will run into two problems:

    Problem 1: What if the trends are already there? Obviously you don't want to add them multiple times, so you will need to skip those. You can do that by creating yourself a function that enunmerates the pen collection of the Trend and Alarm Pane and removes any corresponding entries from the hTraces array. This would yield an hTraces array with just new traces.

    Problem 2: How many is too many? This Trend Page has been designed to limit the number to 16 traces. We set that soft limit just because the PA only has 16 unique colours. As we have now removed the 'clearing' code it means the TrendPage_ShowForEquipment can exceed the design. So, I would advise in your customers to respect the l_nMaxActiveTraces local variable and provide a warning to the operator that not all traces could be added if it is exceeded etc.

    Problem 3: What if you want both the old (clear) and your new behaviour (don't clear)?
    That just comes down to your target user experience. If you want the InfoZone to be able to have two modes, then you will need to duplicate the InfoTrend_<res> pages from SA_Include into your project, and then customize them with new buttons etc that call a function with a parameter to trigger the old / new behaviours. Don't forget to modify the InformationZone \ @(TREND) menu item to point at your new InfoTrend page. Omit the resolution part if you are supporting HD and UHD in your system as the workspace will auto-adjust.
    If instead, you want to do something like a right click menu on the selected equipment on a mimic (e.g. Add to Trend) then that is a matter of building up an array of trends to add and passing it to your customised TrendPage_ShowForEquipment function.

    I hope that helps,

    bradley
Children
No Data