fwDeviceComment 9.2.0
unDeviceComment.ctl File Reference

LIBRARY: unDeviceComment.ctl

Author
Dr. Marc Bengulescu (BE-ICS-FD)
const uint UN_DEVICE_COMMENT_NO_PERMISSION = 0u
 
const uint UN_DEVICE_COMMENT_CAN_ADD = 1u
 
const uint UN_DEVICE_COMMENT_CAN_DEACTIVATE_ALL = 2u
 
const uint UN_DEVICE_COMMENT_CAN_DELETE_ALL = 4u
 
const uint UN_DEVICE_COMMENT_CAN_CONFIGURE_RIGHTS = 8u
 
const uint UN_DEVICE_COMMENT_TIMESTAMP_INDEX = 1
 
const uint UN_DEVICE_COMMENT_USER_INDEX = 2
 
const uint UN_DEVICE_COMMENT_COMMENT_INDEX = 3
 
const uint UN_DEVICE_COMMENT_EXTENSION_INDEX = 4
 
const uint UN_DEVICE_COMMENT_SYSTEM_INDEX = 5
 
const uint UN_DEVICE_COMMENT_HOST_INDEX = 6
 
const uint UN_DEVICE_COMMENT_ACTIVE_STATE_INDEX = 7
 
const string UN_DEVICE_COMMENT_TIME_FORMAT = "%Y.%m.%d %H:%M:%S"
 
const string UN_DEVICE_COMMENT_POSTINSTALL_FLAG = "FWDC_POSTINST"
 
const string UN_DEVICE_COMMENT_DEVICELOG = ".statusInformation.deviceLog"
 
const string UN_DEVICE_COMMENT_GLOBAL_SETTINGS = "_unDeviceComment"
 
const string UN_DEVICE_COMMENT_ACCESS_CONTROL = ".accessControl"
 
const string UN_DEVICE_COMMENT_ADD_PRIVILEGES = ".commentAddPrivileges"
 
const string UN_DEVICE_COMMENT_DELETE_ALL_PRIVILEGES = ".commentDeleteAllPrivileges"
 
const string UN_DEVICE_COMMENT_DEACTIVATE_ALL_PRIVILEGES = ".commentDeactivateAllPrivileges"
 
const string UN_DEVICE_COMMENT_CONFIGURE_RIGHTS_PRIVILEGES = ".commentConfigureRightsPrivileges"
 
const string UN_DEVICE_COMMENT_NO_ERROR = 0
 
const string UN_DEVICE_COMMENT_CANNOT_DPGET_ERROR = -1
 
const string UN_DEVICE_COMMENT_CANNOT_DPSET_ERROR = -2
 
const string UN_DEVICE_COMMENT_INEXISTENT_DP_ERROR = -3
 
const string UN_DEVICE_COMMENT_INEXISTENT_ERROR = -4
 
const string UN_DEVICE_COMMENT_DELIMITER = "~"
 
const string UN_DEVICE_COMMENT_CHANGE_CALLBACK = "unDeviceComment_commentChangedCB"
 
const uint UN_DEVICE_COMMENT_COMMENT_SEARCH_TIMEOUT = 180
 
global int gUnDeviceComment_searchCountdownTimer
 
global string gUnDeviceComment_searchMessage
 
void unDeviceComment_init ()
 
void unDeviceComment_filterStartCB ()
 
void unDeviceComment_filterEndCB ()
 
void unDeviceComment_commentSearchTimeoutThread (int iTimeout)
 
string unDeviceComment_stripDeviceLogSuffix (string sDPE)
 
void unDeviceComment_commentChangedCB (dyn_string dsDPList)
 
void unDeviceComment_doubleClick (dyn_string line)
 
void unDeviceComment_rightClick (dyn_string dsRow)
 
void unDeviceComment_populateTable (unsigned max, const dyn_string dpList=makeDynString(), bool bClearTable=true)
 
dyn_string unDeviceComment_initialiseDpList ()
 
string unDeviceFilter_setGroupQueryFunction (string sys, string queryFrom, string queryWhere)
 
bool unDeviceComment_import (const string filename)
 
bool unDeviceComment_export (const string filename)
 
string escape (string text)
 
dyn_string unDeviceComment_decodeCommentString (string s)
 
string unDeviceComment_encodeCommentArray (dyn_string r)
 
bool unDeviceComment_hasCommentAddPermission (bit32 b32CommentPermissions)
 
bool unDeviceComment_hasCommentDeactivateAllPermission (bit32 b32CommentPermissions)
 
bool unDeviceComment_hasCommentDeleteAllPermission (bit32 b32CommentPermissions)
 
bool unDeviceComment_hasConfigureCommentRightsPermission (bit32 b32CommentPermissions)
 
void unDeviceComment_storeAllCommentsRightsInDP (dyn_string dsAddCommentPermissions, dyn_string dsDeleteAllCommentsPermissions, dyn_string dsDeactivateAllCommentsPermissions, dyn_string dsConfigureCommentRightsPermissions, dyn_string &exceptionInfo, string sSystemName="")
 
void unDeviceComment_storeCommentsAccessRightsInDP (string sDPName, dyn_string dsCommentPermissions, dyn_string &exceptionInfo)
 
 unDeviceComment_retreiveCommentsAccessRightsFromDP (string sDPName, dyn_string &dsCommentPermissions, dyn_string &exceptionInfo)
 
bool unDeviceComment_parseCommentsAccessRights (dyn_string dsCommentPermissions, dyn_string &exceptionInfo)
 
void unDeviceComment_getAllCommentAccessRights (dyn_string &dsAddCommentPermissions, dyn_string &dsDeleteAllCommentsPermissions, dyn_string &dsDeactivateAllCommentsPermissions, dyn_string &dsConfigureCommentRightsPermissions, dyn_string &exceptionInfo, string sSystemName="")
 
void unDeviceComment_initCommentAccessRights (dyn_string &exceptionInfo)
 
void unDeviceComment_getCommentPermissions (bit32 &b32CommentPermissions, dyn_string &exceptionInfo)
 
void unDeviceComment_accessControlSetup (string sUserChangedCB, string sPermissionsChangedCB)
 
bool unDeviceComment_isNotAuthorOfComment (string sAuthor)
 
int unDeviceComment_retreiveCommentsFromDP (string sDPName, dyn_string &dsDeviceComments)
 
int unDeviceComment_storeCommentsInDP (string sDPName, dyn_string dsDeviceComments)
 
bool unDeviceComment_hasActiveComments (dyn_string dsStoredComments)
 
string unDeviceComment_getFullUserName (string sUserName="")
 
string unDeviceComment_getPreparedComment (dyn_string dsCommentSections)
 
int unDeviceComment_processCommentsInDP (string sDeviceDPE, dyn_string dsSelectedDeviceComments, string sOperation)
 

Detailed Description

(c) Copyright CERN 2005. All rights not expressly granted are reserved. iceco.nosp@m.ntro.nosp@m.ls.su.nosp@m.ppor.nosp@m.t@cer.nosp@m.n.ch

SPDX-License-Identifier: LGPL-3.0-only JCOP Copyright (C) CERN 2018 All rights reserved

Function Documentation

◆ unDeviceComment_filterStartCB()

void unDeviceComment_filterStartCB ( )
Reviewed:
2018-06-22 Callback

◆ unDeviceComment_filterEndCB()

void unDeviceComment_filterEndCB ( )
Reviewed:
2018-06-22 Callback

◆ unDeviceComment_commentSearchTimeoutThread()

void unDeviceComment_commentSearchTimeoutThread ( int  iTimeout)

This function counts down for a specified number of seconds, then sets a flag to indicate that the timeout has expired

Reviewed:
2018-06-22 Thread

◆ unDeviceComment_stripDeviceLogSuffix()

string unDeviceComment_stripDeviceLogSuffix ( string  sDPE)

Strip UN_DEVICE_COMMENT_DEVICELOG from a DPE

◆ unDeviceComment_commentChangedCB()

void unDeviceComment_commentChangedCB ( dyn_string  dsDPList)

Handles the change of a DP, after the user has double clicked on a row The name of this function should be stored in the UN_DEVICE_COMMENT_CHANGE_CALLBACK constant

◆ unDeviceComment_doubleClick()

void unDeviceComment_doubleClick ( dyn_string  line)

Processes the double-click event of a comment (i.e. table row)

Reviewed:
2018-06-22 Callback

◆ unDeviceComment_initialiseDpList()

dyn_string unDeviceComment_initialiseDpList ( )
Reviewed:
2018-06-22 EvalScript

◆ unDeviceFilter_setGroupQueryFunction()

string unDeviceFilter_setGroupQueryFunction ( string  sys,
string  queryFrom,
string  queryWhere 
)
Reviewed:
2018-06-22 EvalScript

◆ unDeviceComment_import()

bool unDeviceComment_import ( const string  filename)
Reviewed:
2018-06-22 EvalScript

◆ unDeviceComment_export()

bool unDeviceComment_export ( const string  filename)
Reviewed:
2018-06-22 EvalScript

◆ unDeviceComment_getPreparedComment()

string unDeviceComment_getPreparedComment ( dyn_string  dsCommentSections)

Getter: Creates the representation of one comment necessary to be stored in the datapoint.

Constraints
None
Usage
Private to the panel
WinCC managers
VISION
Parameters
dsCommentSectionsdyn_string, INPUT, the individual components of one comment
Returns
string, one prepared comment

◆ unDeviceComment_processCommentsInDP()

int unDeviceComment_processCommentsInDP ( string  sDeviceDPE,
dyn_string  dsSelectedDeviceComments,
string  sOperation 
)

Process, i.e. (de)activate or delete, a list of comments for a device

Parameters
sDeviceDPEthe DP of the device with ot without UN_DEVICE_COMMENT_DEVICELOG suffix
dsSelectedDeviceCommentsthe list of comments to be processed for this device
sOperationthe operation to be performed on the comment list: ( activate | deactivate | delete )
Returns
iResult the result of the operation (zero if success)