Background Colour Alarm Lines

Hi, 

unfortunately, the background color of an alarm line is only behind the alarm text and not over the complete with of a row.

This does not look good and it is furthermore error-prone by displacing a row.

 

Does anybody know, if it is possible to get an alarm line completely filled with the background color while using a proportional font?

(Using a true type font as described in TN000028999 (TN6822) is not an option)

The alarm list currently looks like:

Alarm List - Current Situation

Preferred Option 01: Background Color over complete width

Alarm List - Option 1

Preferred Option 02: Background Color over complete width (column separators excluded)

Thanks.

Parents
  • Hi Stephan,

    We did not code this as a first class option into the Situational Awareness Workspace alarm pages. But, it can be done if you are prepared to do some work. Some customers have implemented this as they find the state/priority icon not visible enough.

    There are two ways you can go:

    1. Modify the include projects directly. This means you will need to keep an eye on monthly updates and manually merge changes when they come. This is infrequent, so the risk is low. We typically don't recommened that because we replace it with monthly updates / new versions. But, if you know that is going to happen, you can accommodate it.

    2. Duplicate the genie and code required. This sometimes can be a bit of rabbit hole, and you end up duplicating way more then you wanted. For this post, I chose 1 because it is quick to illustrate and test.

    What we are going to do is modify the existing "alternate row" genie which is currently responsible for drawing the white/lightgrey rows on your alarm / list pages. We are going to add priority based colouring to it.

    What you need to do is:

    1. Open the genielist.row from the : sa_controls library of the sa_controls project.

    2. You will see a white rectangle on the page. Open its properties, and go to the Fill animation

    3. Change indexes 4,5,6 and 7 to be the colours you want for your alarm priority background in priority order. e.g. lightred for 1, light yellow for 2 etc. Unfortunately there is no fill expression animation which allows you to get the RGB colour values directly from the alarm priority definition.

    4. Save this genie and update pages. This genie is replicated many times as part of the x10, x40 list iew genies.

    5. Open the file "Arrayview.ci" from the SA_Controls project.

    6. Find the function "_ArrayView_Row_ColorIndex" and replace it with this:

    INT FUNCTION _ArrayView_Row_ColorIndex(INT hArrayAn, INT nRowOffset, INT nRow)
    	INT nIndex = 0;
    	INT bDrawHeader = ArrayGetIntByAn(hArrayAn, ARRAY_INFORMATION_COLUMN, ARRAY_INFORMATION_ROW, ARRAY_ZINDEX_ARRAY_DRAWHEADER);
    	INT nHeaderOff = 0;
    	INT nSelected = 0;
    	
    	IF (bDrawHeader) THEN
    		nHeaderOff = 1;
    	ELSE
    		nRow = nRow + 1
    	END
    	
    	IF (ArrayGetStringByAn(hArrayAn,1, ARRAY_INFORMATION_COLUMN, ARRAY_ZINDEX_COLUMN_VALUE) = "PriorityAndState") THEN
    		nSelected = ArrayGetStringByAn(hArrayAn, ARRAY_INFORMATION_COLUMN, nRowOffset + nRow, ARRAY_ZINDEX_ROW_SELECTED);
    		IF (nSelected) THEN
    			nIndex = 3;
    		ELSE
    		
    			SELECT CASE ArrayGetIntByAn(hArrayAN,  1, nRowOffset + nRow, ARRAY_ZINDEX_COLUMN_VALUE)
    			CASE 1
    				nIndex = 4;
    			CASE 2
    				nIndex = 5;
    			CASE 3
    				nIndex = 6;
    			CASE 4
    				nIndex = 7;
    			CASE ELSE
    				IF (((nRowOffset + nRow) MOD 2) = 1) THEN
    					// Even row
    					nIndex = 1;
    				ELSE
    					// Odd row
    					nIndex = 2;
    				END		
    			END SELECT
    		END
    	ELSE
    		IF (((nRowOffset + nRow) MOD 2) = 1) THEN
    			// Even row
    			nIndex = 1;
    		ELSE
    			// Odd row
    			nIndex = 2;
    		END		
    	END
    	
    	RETURN nIndex;
    END

    7. Compile and Run.

    You will now see that for any list that has the PriorityAndState coloumn in position 1, then you will get the background colour set for the alarms.

    The code is basically just getting the priority value out of the first column and then using that to choose the colour in the fill animation.

    bradley

  • Hi Bradley,

    thanks for your reply and your proposal forward. I will try it out.

    It would be great to have this functionality available in the Include projects to avoid these workarounds in the future.

    I was wondering whether it is possible to use the DspText (or an alternative draw rectangle) function to extend the alarm lines. The total width should be available, also the positions of the column separators... Event the cell font of an alarm row is available using the "_LibTable_GetCellFont" function (_Internal_Table.ci, Library_Controls project).

    Stephan

  • Hi Stephan,

    Those functions are associated with the SxW template based objects rather than the Workspace (SA) templates and objects.

    I couldn't say for sure if that was possible, but probably wouldn't be as efficient as the technique I used above. The modifications above get you your preferred option 01.

    bradley

Reply Children
No Data