fixes and stuff
4
.gitignore
vendored
@ -3,3 +3,7 @@
|
||||
**/thumbnail.png
|
||||
com.inductiveautomation.perspective/session-props/props.json
|
||||
conversion-report.txt
|
||||
CNO8_SCADA/
|
||||
MTN6_SCADA/
|
||||
SAT9_SCADA/
|
||||
SCADA_PERSPECTIVE_PARENT_PROJECT/
|
||||
@ -0,0 +1,879 @@
|
||||
import com.amazonaws.services.s3.AmazonS3ClientBuilder as AmazonS3ClientBuilder
|
||||
import com.amazonaws.services.s3.model.GeneratePresignedUrlRequest as GeneratePresignedUrlRequest
|
||||
import com.amazonaws.HttpMethod as HttpMethod
|
||||
|
||||
import boto3
|
||||
from botocore.client import BaseClient
|
||||
from botocore.exceptions import ClientError
|
||||
import json
|
||||
from pprint import pformat
|
||||
from urllib2_aws4auth import aws_urlopen, Request
|
||||
from urllib2 import HTTPError
|
||||
from urllib import urlencode
|
||||
from helper.helper import sanitize_tree
|
||||
from loggerConfig import getLogger
|
||||
|
||||
REGION_NAME = 'us-east-1'
|
||||
LOGGER = getLogger('S3Manager', 'debug')
|
||||
|
||||
def getPresignedURL(self, objectKey):
|
||||
"""
|
||||
Generates a uri to retrieve images from an S3 bucket.
|
||||
Bucket names are globally unique so different regions
|
||||
must use a prefix for the bucket name.
|
||||
Region and prefix are stored as custom session variables.
|
||||
|
||||
Args:
|
||||
self: Refrence to the object calling the function.
|
||||
param2: key to the s3 object returned.
|
||||
|
||||
Returns:
|
||||
s3 Url to display the image in S3.
|
||||
|
||||
Raises:
|
||||
KeyError: None.
|
||||
"""
|
||||
|
||||
|
||||
bucket_names = {"eu":"ignition-image-repo", "na":"ignition-image-repo-na",
|
||||
"jp":"jp-ignition-image-repo"}
|
||||
|
||||
# aws = system.tag.readBlocking("Configuration/aws")[0].value
|
||||
# aws = system.util.jsonDecode(aws)
|
||||
# clientRegion = aws.get("region")
|
||||
# prefix = aws.get("prefix")
|
||||
clientRegion = self.session.custom.aws.region
|
||||
prefix = self.session.custom.aws.prefix
|
||||
|
||||
|
||||
bucketName = bucket_names.get(prefix, "ignition-image-repo")
|
||||
|
||||
s3Client = AmazonS3ClientBuilder.standard().withRegion(clientRegion).build();
|
||||
generatePresignedUrlRequest = GeneratePresignedUrlRequest(bucketName, objectKey).withMethod(HttpMethod.GET);
|
||||
url = s3Client.generatePresignedUrl(generatePresignedUrlRequest);
|
||||
|
||||
return url
|
||||
|
||||
S3_REPO_BUCKET_NAME = 'ignition-image-repo-na'
|
||||
S3_SOURCE_BUCKET_NAME = 'ignition-image-source-na'
|
||||
# api stage config
|
||||
API_STAGES = ['beta', 'prod']
|
||||
API_REGIONS = ['na', 'eu']
|
||||
STAGE_CONFIG = {
|
||||
'beta': {
|
||||
'na': {
|
||||
'region': 'us-east-1',
|
||||
'lambda_name': 'RMESDScadaS3ManagementFlaskLambda-beta',
|
||||
'endpoint': 'https://us-east-1.beta.scada-s3-management.scada.eurme.amazon.dev/',
|
||||
'repo_bucket': 'ignition-image-repo-na',
|
||||
'source_bucket': 'ignition-image-source-na',
|
||||
's3_region': 'us-east-1',
|
||||
'account_id': '006306898152',
|
||||
'api_call_role': 'arn:aws:iam::604741092380:role/RMESDScadaS3ManagementAPIcallRole-beta-us-east-1'
|
||||
},
|
||||
'eu': {
|
||||
'region': 'eu-west-2',
|
||||
'lambda_name': 'RMESDScadaS3ManagementFlaskLambda-beta',
|
||||
'endpoint': 'https://eu-west-2.beta.scada-s3-management.scada.eurme.amazon.dev/',
|
||||
'repo_bucket': 'ignition-image-repo',
|
||||
'source_bucket': 'ignition-image-source',
|
||||
's3_region': 'eu-west-1',
|
||||
'account_id': '006306898152',
|
||||
'api_call_role': 'arn:aws:iam::604741092380:role/RMESDScadaS3ManagementAPIcallRole-beta-eu-west-2'
|
||||
}
|
||||
},
|
||||
'prod': {
|
||||
'na': {
|
||||
'region': 'us-east-2',
|
||||
'lambda_name': 'RMESDScadaS3ManagementFlaskLambda-prod',
|
||||
'endpoint': 'https://us-east-2.scada-s3-management.scada.eurme.amazon.dev/',
|
||||
'repo_bucket': 'ignition-image-repo-na',
|
||||
'source_bucket': 'ignition-image-source-na',
|
||||
's3_region': 'us-east-1',
|
||||
'account_id': '006306898152',
|
||||
'api_call_role': 'arn:aws:iam::609617486056:role/RMESDScadaS3ManagementAPIcallRole-prod-us-east-2'
|
||||
},
|
||||
'eu': {
|
||||
'region': 'eu-west-1',
|
||||
'lambda_name': 'RMESDScadaS3ManagementFlaskLambda-prod',
|
||||
'endpoint': 'https://eu-west-1.scada-s3-management.scada.eurme.amazon.dev/',
|
||||
'repo_bucket': 'ignition-image-repo',
|
||||
'source_bucket': 'ignition-image-source',
|
||||
's3_region': 'eu-west-1',
|
||||
'account_id': '006306898152',
|
||||
'api_call_role': 'arn:aws:iam::609617486056:role/RMESDScadaS3ManagementAPIcallRole-prod-eu-west-1'
|
||||
}
|
||||
}
|
||||
}
|
||||
OPERATION_MAP = {
|
||||
'download': {
|
||||
'method': 'GET',
|
||||
'reqd_args': ['bucket', 'obj_key']
|
||||
},
|
||||
'get_presigned_url': {
|
||||
'method': 'GET',
|
||||
'reqd_args': ['bucket', 'obj_key']
|
||||
},
|
||||
'list_objects': {
|
||||
'method': 'GET',
|
||||
'reqd_args': ['bucket']
|
||||
},
|
||||
'list_object_versions': {
|
||||
'method': 'GET',
|
||||
'reqd_args': ['bucket']
|
||||
},
|
||||
'list_object_delete_markers': {
|
||||
'method': 'GET',
|
||||
'reqd_args': ['bucket']
|
||||
},
|
||||
'delete': {
|
||||
'method': 'DELETE',
|
||||
'reqd_args': ['bucket', 'obj_key']
|
||||
},
|
||||
'upload': {
|
||||
'method': 'PUT',
|
||||
'reqd_args': ['bucket', 'obj_key', 'obj_data']
|
||||
},
|
||||
'add_new_site': {
|
||||
'method': 'PUT',
|
||||
'reqd_args': ['site', 'bucket']
|
||||
},
|
||||
'copy_single': {
|
||||
'method': 'POST',
|
||||
'reqd_args': ['source_bucket', 'dest_bucket', 'source_key', 'dest_key']
|
||||
},
|
||||
'fetch_site_list': {
|
||||
'method': 'GET',
|
||||
'reqd_args': ['bucket']
|
||||
},
|
||||
'fetch_object_list_by_site_and_bucket': {
|
||||
'method': 'GET',
|
||||
'reqd_args': ['site', 'bucket']
|
||||
},
|
||||
'fetch_upload_url': {
|
||||
'method': 'PUT',
|
||||
'reqd_args': ['bucket', 'obj_key', 'region', 'content_type']
|
||||
},
|
||||
'query_audit_table': {
|
||||
'method': 'POST',
|
||||
'reqd_args': []
|
||||
}
|
||||
}
|
||||
|
||||
class S3Manager(object):
|
||||
"""
|
||||
This class contains convenience methods for working with S3 objects from Ignition python 2.7
|
||||
"""
|
||||
|
||||
def __init__(self, api_stage='prod', api_region_name='na', username='', profile_name=None):
|
||||
"""
|
||||
Instantiates an S3 Class.
|
||||
|
||||
:param api_stage: str; (default='prod') api target stage (and default S3 folder)
|
||||
:param api_region_name: str; (default='na') api target region (and account)
|
||||
:param username: str; ignition session username (from `session.props.auth.user.userName`)
|
||||
:return: None
|
||||
"""
|
||||
self._logger = LOGGER
|
||||
# sanitize api stage and region values
|
||||
if api_stage not in API_STAGES:
|
||||
self._logger.info("`api_stage` must be one of: %s, received: %s" % (API_STAGES, api_stage))
|
||||
api_stage = 'prod'
|
||||
if api_region_name not in API_REGIONS:
|
||||
self._logger.info("`api_region_name` must be one of: %s, received: %s" % (API_REGIONS, api_region_name))
|
||||
api_region_name = 'na'
|
||||
self._api_stage = api_stage
|
||||
self._api_region_name = api_region_name
|
||||
# grab stage config for this instance from global object
|
||||
self._stage_config = STAGE_CONFIG.get(api_stage, STAGE_CONFIG['prod']).get(api_region_name, STAGE_CONFIG['prod']['na'])
|
||||
d = self._stage_config
|
||||
self._api_region = d.get('region', 'us-east-2')
|
||||
self._s3_region = d.get('s3_region', 'us-east-1')
|
||||
self._repo_bucket = d.get('repo_bucket', 'ignition-image-repo-na')
|
||||
self._source_bucket = d.get('source_bucket', 'ignition-image-source-na')
|
||||
self._lambda_name = d.get('lambda_name', 'RMESDScadaS3ManagementFlaskLambda-prod')
|
||||
self._account_id = d.get('account_id', '006306898152')
|
||||
self._endpoint = d.get('endpoint', 'https://us-east-2.scada-s3-management.scada.eurme.amazon.dev/')
|
||||
self._service = 'execute-api'
|
||||
if profile_name:
|
||||
self._creds = boto3.Session(profile_name=profile_name).get_credentials()
|
||||
# Define an opener method. The opener will apply AWS Sigv4 signing to requests
|
||||
self._opener = aws_urlopen(
|
||||
self._creds.access_key,
|
||||
self._creds.secret_key,
|
||||
self._api_region,
|
||||
self._service,
|
||||
session_token=self._creds.token,
|
||||
verify=False
|
||||
)
|
||||
else:
|
||||
# DEVNOTE: As the API has been segregated from the AWS account for the dev server, assume a dedicated role here
|
||||
sts_client = boto3.Session().client('sts')
|
||||
role_arn = d.get('api_call_role', None)
|
||||
if role_arn:
|
||||
response = sts_client.assume_role(RoleArn=role_arn, RoleSessionName='ignition-s3-mgmt-client')
|
||||
creds = response['Credentials']
|
||||
# Define an opener method. The opener will apply AWS Sigv4 signing to requests
|
||||
self._opener = aws_urlopen(
|
||||
creds['AccessKeyId'],
|
||||
creds['SecretAccessKey'],
|
||||
self._api_region,
|
||||
self._service,
|
||||
session_token=creds['SessionToken'],
|
||||
verify=False
|
||||
)
|
||||
else:
|
||||
# use native boto3 creds if 'api_call_role' not defined in STAGE_CONFIG
|
||||
self._creds = boto3.Session(profile_name=profile_name).get_credentials()
|
||||
self._opener = aws_urlopen(
|
||||
self._creds.access_key,
|
||||
self._creds.secret_key,
|
||||
self._api_region,
|
||||
self._service,
|
||||
session_token=self._creds.token,
|
||||
verify=False
|
||||
)
|
||||
self._headers = {'Content-type': 'application/json', 'X-Remote-User': username}
|
||||
|
||||
def _send(self, operation='download', params={}, print_resp=False, **kwargs):
|
||||
"""
|
||||
private method to compile and send the request to api endpoint
|
||||
|
||||
:param operation: str; api endpoint method for request (See `OPERATION_MAP` for options)
|
||||
:param params: dict; dictionary of parameters to pass to request (See `OPERATION_MAP` for reqd args)
|
||||
:param print_resp: bool; if True, the associated logger will receive a print statement of the raw response, pprint.format'd
|
||||
:return resp: dict; response object from api
|
||||
"""
|
||||
l = self._logger
|
||||
if operation not in OPERATION_MAP.keys():
|
||||
msg = 'operation "%s" is not a valid S3Manager operation! Options: %s' % (operation, list(OPERATION_MAP.keys()))
|
||||
l.error(msg)
|
||||
raise InvalidOperationS3Manager(msg)
|
||||
op_config = OPERATION_MAP[operation]
|
||||
method = op_config['method']
|
||||
reqd_args = op_config['reqd_args']
|
||||
missing_args = [x for x in reqd_args if x not in params.keys()]
|
||||
if len(missing_args):
|
||||
msg = 'The following required args were not provided in params for "%s" operation: %s' % (operation, missing_args)
|
||||
l.error(msg)
|
||||
raise InvalidParametersS3Manager(msg)
|
||||
if method in ('GET', 'DELETE'):
|
||||
querystring = '?%s' % urlencode(params)
|
||||
payload = None
|
||||
url = self._endpoint + operation + querystring
|
||||
else:
|
||||
try:
|
||||
payload = json.dumps(params)
|
||||
l.debug('payload for %s operation successfully serialized' % operation)
|
||||
except:
|
||||
payload = urlencode(params)
|
||||
l.debug('payload for %s operation not serialized using json.dumps(), instead used urlencode()' % operation)
|
||||
url = self._endpoint + operation
|
||||
# Create a request object
|
||||
req = Request(url=url, method=method, headers=self._headers, data=payload)
|
||||
# open the request and process the read
|
||||
try:
|
||||
# use self._opener to sign and send the prepared request
|
||||
resp = self._opener(req)
|
||||
data = json.loads(resp.read())
|
||||
if print_resp:
|
||||
l.info('Response data: %s' % pformat(sanitize_tree(data)))
|
||||
return data
|
||||
except HTTPError, e:
|
||||
try:
|
||||
body = json.loads(e.fp.read())
|
||||
e_msg = body.get('message', e.reason)
|
||||
msg = 'Error sending S3Manager request: %s. Message: %s' % (str(e), e_msg)
|
||||
l.error(msg)
|
||||
raise HTTPErrorS3Manager(e.code, e_msg)
|
||||
except AttributeError, e2:
|
||||
# failed to extract reason or code from urllib2.HTTPError for some reason
|
||||
import traceback
|
||||
msg = 'Failed to extract reason and/or error code from urllib2.HTTPError. Trace: %s' % traceback.format_exc()
|
||||
l.error(msg)
|
||||
msg = 'Error sending S3Manager request: %s' % (str(e))
|
||||
l.error(msg)# raise HTTPErrorS3Manager(e.code, msg)
|
||||
raise HTTPErrorS3Manager(400, msg)
|
||||
|
||||
def upload(self, obj_data, obj_key, bucket=None, content_type='', region=None, **kwargs):
|
||||
"""
|
||||
Method to upload a JSON object to S3. Converts S3 to a compressed binary parquet file, then writes
|
||||
the file to S3.
|
||||
|
||||
:param obj_data: JSON data object to upload to S3
|
||||
:param obj_key: Path and object name of the object to create in S3
|
||||
:param bucket: S3 bucket to write data to.
|
||||
:param content_type: str; 'application/json' for json files, 'image/svg+xml' for svg files
|
||||
:param region: AWS region that hosts the target S3 bucket.
|
||||
:return: Boto3 `put_object` response
|
||||
"""
|
||||
l = self._logger
|
||||
if not bucket:
|
||||
# if no bucket provided, use repo bucket name from stage config
|
||||
bucket = self._repo_bucket
|
||||
if not region:
|
||||
# if no region provided, use region name from stage config
|
||||
region = self._s3_region
|
||||
l.info('Uploading %s dataset to bucket %s' % (obj_key, bucket))
|
||||
l.debug('++ Storing data file in S3')
|
||||
operation = 'upload'
|
||||
# check the suffix of obj_key and auto-populate content_type accordingly
|
||||
if obj_key.endswith('json'):
|
||||
content_type = 'application/json'
|
||||
elif obj_key.endswith('svg'):
|
||||
content_type = 'image/svg+xml'
|
||||
elif obj_key.endswith('drawio'):
|
||||
content_type = 'binary/octet-stream'
|
||||
try:
|
||||
if isinstance(obj_data, dict):
|
||||
# serialize the object to a JSON string
|
||||
obj_data = json.dumps(obj_data)
|
||||
msg = '++ Uploading. Successfully serialized (json dump) object data for %s' % obj_key
|
||||
l.debug(msg)
|
||||
else:
|
||||
msg = 'Uploading. Type of incoming object data: %s' % type(obj_data)
|
||||
l.debug(msg)
|
||||
except:
|
||||
import traceback
|
||||
msg = '++ Uploading. Error trying to serialize (json dump) object data: %s' % traceback.format_exc()
|
||||
l.error(msg)
|
||||
return msg
|
||||
# params = {
|
||||
# 'bucket': bucket,
|
||||
# 'obj_key': obj_key,
|
||||
# 'obj_data': obj_data,
|
||||
# 'content_type': content_type,
|
||||
# 'region': region
|
||||
# }
|
||||
# try:
|
||||
# resp = self._send(operation, params, print_resp=kwargs.get('print_resp', False))
|
||||
# l.debug('** Uploading Complete. Successfully uploaded %s' % obj_key)
|
||||
# return resp
|
||||
# except HTTPErrorS3Manager, e:
|
||||
# return {'code': e.code, 'message': e.message}
|
||||
# DEVNOTE: As there is a 10mb limitation on payload size to API gateway calls, going to use the
|
||||
# `fetch_upload_url` method to get a presigned upload link and upload via system.net.httpPut
|
||||
# so the above code will be commented out to use the below code
|
||||
params = {
|
||||
'bucket': bucket,
|
||||
'obj_key': obj_key,
|
||||
'region': region,
|
||||
'content_type': content_type
|
||||
}
|
||||
try:
|
||||
upload_url = self.fetch_upload_url(**params)
|
||||
l.debug('** Fetching Upload URL Complete for object key: %s' % obj_key)
|
||||
except HTTPErrorS3Manager, e:
|
||||
return {'code': e.code, 'message': e.message}
|
||||
try:
|
||||
# DEVNOTE: Test code below to upload to pre-signed S3 PUT url using urllib2_aws4auth module
|
||||
# Create a request object using urllib2_aws4auth.Request and aws_urlopen methods
|
||||
# see if this is limited like with the upload call to API gateway.
|
||||
# system.net.httpPut call below is not limited
|
||||
# Results: what works with `system.net.httpPut` fails with `urllib2_aws4auth` module (returns 400: BadRequest)
|
||||
# if the file is > ~ 75 kb
|
||||
# req = Request(url=upload_url, method='PUT', headers=self._headers, data=obj_data)
|
||||
# resp = self._opener(req).read()
|
||||
# msg = '** Successfully uploaded %s to %s bucket!\nResponse: %s' % (obj_key, bucket, pformat(resp))
|
||||
resp = system.net.httpPut(upload_url, putData=obj_data, contentType=content_type)
|
||||
msg = '** Successfully uploaded %s to %s bucket!' % (obj_key, bucket)
|
||||
l.debug(msg)
|
||||
return {'code': 200, 'message': msg}
|
||||
except Exception, e:
|
||||
msg = '++ Error uploading %s to %s bucket: %s' % (obj_key, bucket, str(e))
|
||||
l.error(msg)
|
||||
return {'code': 400, 'message': msg}
|
||||
|
||||
def fetch_upload_url(self, obj_key, bucket=None, region=None, expiration=3600, content_type="image/svg+xml", **kwargs):
|
||||
"""
|
||||
Retrieves a pre-signed URL for the obj key and bucket and the `put_object` client method.
|
||||
Caller then uses pre-signed URL to upload the file to S3 directly.
|
||||
|
||||
:param obj_key: Path and object name of the object to create in S3
|
||||
:param bucket: S3 bucket to write data to.
|
||||
:param region: AWS region that hosts the target S3 bucket.
|
||||
:param expiration: int; number of seconds until the link expires (default = 3600, 1 hour)
|
||||
:param content_type: str; the content-type of the object (default = 'image/svg+xml')
|
||||
:return: str; presigned URL as string.
|
||||
"""
|
||||
l = self._logger
|
||||
if not bucket:
|
||||
# if no bucket provided, use repo bucket name from stage config
|
||||
bucket = self._repo_bucket
|
||||
if not region:
|
||||
# if no region provided, use region name from stage config
|
||||
region = self._s3_region
|
||||
l.info('Fetching upload pre-signed URL for %s object in %s bucket' % (obj_key, bucket))
|
||||
operation = 'fetch_upload_url'
|
||||
params = {
|
||||
'bucket': bucket,
|
||||
'obj_key': obj_key,
|
||||
'expiration': expiration,
|
||||
'region': region,
|
||||
'content_type': content_type
|
||||
}
|
||||
try:
|
||||
resp = self._send(operation, params, print_resp=kwargs.get('print_resp', False))
|
||||
l.debug('** Fetching Upload URL Completed for %s' % obj_key)
|
||||
return resp
|
||||
except HTTPErrorS3Manager, e:
|
||||
return {'code': e.code, 'message': e.message}
|
||||
|
||||
def add_new_site(self, site=None, bucket='both', **kwargs):
|
||||
"""
|
||||
Adds a new site folder to either repo, source, or both buckets
|
||||
|
||||
:param site: str; name of site/WHID. Must be 4 chars in format of "ABC1"
|
||||
:param bucket: str; name of the bucket (S3_REPO_BUCKET_NAME, S3_SOURCE_BUCKET_NAME, or 'both') to add site folder to
|
||||
if = 'both', then site folder will be added to both buckets
|
||||
:return: dict; {'message': str} summarizing the folder add operation
|
||||
"""
|
||||
l = self._logger
|
||||
l.info('Adding site %s folder' % (site))
|
||||
operation = 'add_new_site'
|
||||
params = {'site': site, 'bucket': bucket}
|
||||
try:
|
||||
resp = self._send(operation, params, print_resp=kwargs.get('print_resp', False))
|
||||
l.debug('** Adding Site Complete. Successfully added %s to %s bucket(s)' % (site, bucket))
|
||||
return resp
|
||||
except HTTPErrorS3Manager, e:
|
||||
return {'code': e.code, 'message': e.message}
|
||||
|
||||
def download(self, obj_key, bucket=None, region=None):
|
||||
"""
|
||||
Downloads a JSON object from S3. File is received as a compressed binary Parquet file
|
||||
:param obj_key: Path and object name of the data stored in S3
|
||||
:param bucket: Bucket the target object is stored in.
|
||||
:param region: AWS Region of the target bucket.
|
||||
:return: JSON data object generated from the Parquet file stored in S3
|
||||
"""
|
||||
l = self._logger
|
||||
if not bucket:
|
||||
# if no bucket provided, use repo bucket name from stage config
|
||||
bucket = self._repo_bucket
|
||||
if not region:
|
||||
# if no region provided, use region name from stage config
|
||||
region = self._s3_region
|
||||
# - Only used for logging; extract dates and data source from the object key
|
||||
obj_key_parts = obj_key.split('/')
|
||||
l.info('-- Downloading %s object from bucket %s' % (obj_key, bucket))
|
||||
operation = 'download'
|
||||
params = {
|
||||
'bucket': bucket,
|
||||
'obj_key': obj_key,
|
||||
'region': region
|
||||
}
|
||||
try:
|
||||
resp = self._send(operation, params)
|
||||
return resp
|
||||
except HTTPErrorS3Manager, e:
|
||||
return {'code': e.code, 'message': e.message}
|
||||
|
||||
def get_presigned_url(self, bucket=None, obj_key='', client_method='get_object', expiration=3600, region=None, content_type="text/plain"):
|
||||
"""
|
||||
Generate a presigned URL to object from S3.
|
||||
Used primarily for retreiving image objects in Ignition
|
||||
|
||||
:param obj_key: str; uri of object to fetch
|
||||
:param bucket_: str; bucket name where object resides
|
||||
:param client_method: str; (default = 'get_object')
|
||||
:param expiration: int; number of seconds until the link expires (default = 3600, 1 hour)
|
||||
:param content_type: str; the content-type of the object (default = 'text/plain')
|
||||
:return: str; presigned URL as string. If no client_method or error, returns None.
|
||||
"""
|
||||
l = self._logger
|
||||
if not bucket:
|
||||
# if no bucket provided, use repo bucket name from stage config
|
||||
bucket = self._repo_bucket
|
||||
if not region:
|
||||
# if no region provided, use region name from stage config
|
||||
region = self._s3_region
|
||||
if not content_type:
|
||||
msg = 'content_type cannot be null!'
|
||||
l.error(msg)
|
||||
raise InvalidParametersS3Manager(msg)
|
||||
l.info('Fetching pre-signed url for %s from bucket %s' % (obj_key, bucket))
|
||||
operation = 'get_presigned_url'
|
||||
params = {
|
||||
'bucket': bucket,
|
||||
'obj_key': obj_key,
|
||||
'client_method': client_method,
|
||||
'expiration': expiration,
|
||||
'content_type': content_type
|
||||
}
|
||||
try:
|
||||
resp = self._send(operation, params)
|
||||
return resp
|
||||
except HTTPErrorS3Manager, e:
|
||||
return {'code': e.code, 'message': e.message}
|
||||
|
||||
def delete(self, obj_key, bucket=None, region=None):
|
||||
"""
|
||||
Deletes a JSON object from S3. File is flagged for deletion in the S3 bucket
|
||||
:param obj_key: Path and object name of the data stored in S3
|
||||
:param bucket: Bucket the target object is stored in.
|
||||
:param region: AWS Region of the target bucket.
|
||||
:return: Boto3 `delete_object` response
|
||||
"""
|
||||
l = self._logger
|
||||
if not bucket:
|
||||
# if no bucket provided, use repo bucket name from stage config
|
||||
bucket = self._repo_bucket
|
||||
if not region:
|
||||
# if no region provided, use region name from stage config
|
||||
region = self._s3_region
|
||||
l.info('Deleting %s object from bucket %s' % (obj_key, bucket))
|
||||
operation = 'delete'
|
||||
params = {
|
||||
'bucket': bucket,
|
||||
'obj_key': obj_key,
|
||||
'region': region
|
||||
}
|
||||
try:
|
||||
resp = self._send(operation, params)
|
||||
l.debug('** Complete. Successfully deleted %s' % obj_key)
|
||||
return resp
|
||||
except HTTPErrorS3Manager, e:
|
||||
return {'code': e.code, 'message': e.message}
|
||||
|
||||
def list_objects(self, bucket=None, prefix='', start_after='', region=None):
|
||||
"""
|
||||
Fetches a list of objects within a specified bucket, prefix, and starting point
|
||||
|
||||
:param bucket: str; Bucket target object is located
|
||||
:param prefix: str; Limits the response to keys that begin with the specified prefix
|
||||
:param start_after: str; StartAfter is where you want Amazon S3 to start listing from.
|
||||
Amazon S3 starts listing after this specified key. StartAfter can be any key in the bucket.
|
||||
:param region: Region of the target S3 Bucket
|
||||
:return: Boto3 `list_objects_v2.Contents` response. This consists of the following keys per object returned:
|
||||
{
|
||||
'ETag': str; unique id,
|
||||
'Key': str; path to object in bucket,
|
||||
'LastModified': datetime.datetime(); time object last modified,
|
||||
'Size': int; size in bytes of the object,
|
||||
'StorageClass': str; type of storage used on the object
|
||||
}
|
||||
"""
|
||||
l = self._logger
|
||||
if not bucket:
|
||||
# if no bucket provided, use repo bucket name from stage config
|
||||
bucket = self._repo_bucket
|
||||
if not region:
|
||||
# if no region provided, use region name from stage config
|
||||
region = self._s3_region
|
||||
l.info('Fetching list of objects from bucket %s' % bucket)
|
||||
operation = 'list_objects'
|
||||
params = {
|
||||
'bucket': bucket,
|
||||
'prefix': prefix,
|
||||
'start_after': start_after,
|
||||
'region': region
|
||||
}
|
||||
try:
|
||||
resp = self._send(operation, params)
|
||||
return resp
|
||||
except HTTPErrorS3Manager, e:
|
||||
return {'code': e.code, 'message': e.message}
|
||||
|
||||
def list_object_versions(self, bucket=None, prefix='', region=None):
|
||||
"""
|
||||
Fetches a list of object versions within a specified bucket, prefix, and starting point
|
||||
|
||||
:param bucket: str; Bucket target object is located
|
||||
:param prefix: str; Limits the response to keys that begin with the specified prefix
|
||||
:param region: Region of the target S3 Bucket
|
||||
:return: Boto3 `list_object_versions.Versions` response. This consists of the following keys per object returned:
|
||||
{
|
||||
'ETag': str; unique id,
|
||||
'IsLatest': bool; only true for the current version,
|
||||
'Key': str; path to object in bucket,
|
||||
'LastModified': datetime.datetime(); time object last modified,
|
||||
'Owner': {'DisplayName': str; name of owner/group, 'ID': str;,}
|
||||
'Size': int; size in bytes of the object,
|
||||
'StorageClass': str; type of storage used on the object,
|
||||
'VersionId': str; ID of object version
|
||||
}
|
||||
"""
|
||||
l = self._logger
|
||||
if not bucket:
|
||||
# if no bucket provided, use repo bucket name from stage config
|
||||
bucket = self._repo_bucket
|
||||
if not region:
|
||||
# if no region provided, use region name from stage config
|
||||
region = self._s3_region
|
||||
l.info('Fetching list of object versions from bucket %s' % bucket)
|
||||
operation = 'list_object_versions'
|
||||
params = {
|
||||
'bucket': bucket,
|
||||
'prefix': prefix,
|
||||
'region': region
|
||||
}
|
||||
try:
|
||||
resp = self._send(operation, params)
|
||||
return resp
|
||||
except HTTPErrorS3Manager, e:
|
||||
return {'code': e.code, 'message': e.message}
|
||||
|
||||
def list_object_delete_markers(self, bucket=None, prefix='', region=None):
|
||||
"""
|
||||
Fetches a list of object delete markers within a specified bucket, prefix, and starting point
|
||||
|
||||
:param bucket: str; Bucket target object is located
|
||||
:param prefix: str; Limits the response to keys that begin with the specified prefix
|
||||
:param region: Region of the target S3 Bucket
|
||||
:return: Boto3 `list_object_versions.DeleteMarkers` response. This consists of the following keys per object returned:
|
||||
{
|
||||
'IsLatest': bool; only true for the current version,
|
||||
'Key': str; path to object in bucket,
|
||||
'LastModified': datetime.datetime(); time object last modified,
|
||||
'Owner': {'DisplayName': str; name of owner/group, 'ID': str;,}
|
||||
'VersionId': str; ID of object version
|
||||
}
|
||||
"""
|
||||
l = self._logger
|
||||
if not bucket:
|
||||
# if no bucket provided, use repo bucket name from stage config
|
||||
bucket = self._repo_bucket
|
||||
if not region:
|
||||
# if no region provided, use region name from stage config
|
||||
region = self._s3_region
|
||||
l.info('Fetching list of object delete markers from bucket %s' % bucket)
|
||||
operation = 'list_object_delete_markers'
|
||||
params = {
|
||||
'bucket': bucket,
|
||||
'prefix': prefix,
|
||||
'region': region
|
||||
}
|
||||
try:
|
||||
resp = self._send(operation, params)
|
||||
return resp
|
||||
except HTTPErrorS3Manager, e:
|
||||
return {'code': e.code, 'message': e.message}
|
||||
|
||||
def copy_single(self, source_bucket=None, dest_bucket=None, source_key='', dest_key='', region=None):
|
||||
"""
|
||||
Method to copy a single object from source bucket|key to destination bucket|key.
|
||||
|
||||
:param source_bucket: str; Source bucket name to copy from
|
||||
:param dest_bucket: str; Destination bucket name to copy to
|
||||
:param source_key: str; Source object key name to copy
|
||||
:param dest_key: str; Destination object key name to copy to
|
||||
:param region: Region of the target S3 Bucket
|
||||
:return: null or ClientError; returns null if successfully copied
|
||||
"""
|
||||
l = self._logger
|
||||
if not source_bucket:
|
||||
# if no source bucket provided, use repo bucket name from stage config
|
||||
source_bucket = self._repo_bucket
|
||||
if not dest_bucket:
|
||||
# if no destination bucket provided, use repo bucket name from stage config
|
||||
dest_bucket = self._repo_bucket
|
||||
if not region:
|
||||
# if no region provided, use region name from stage config
|
||||
region = self._s3_region
|
||||
l.info('Copying %s object from bucket %s to object %s in bucket %s' % (source_key, source_bucket, dest_key, dest_bucket))
|
||||
l.debug('++ Copying data in S3')
|
||||
operation = 'copy_single'
|
||||
params = {
|
||||
'source_bucket': source_bucket,
|
||||
'dest_bucket': dest_bucket,
|
||||
'source_key': source_key,
|
||||
'dest_key': dest_key,
|
||||
'region': region
|
||||
}
|
||||
try:
|
||||
resp = self._send(operation, params)
|
||||
l.debug('** Complete. Successfully copied object %s from bucket %s to object %s in bucket %s' %
|
||||
(source_key, source_bucket, dest_key, dest_bucket))
|
||||
return resp
|
||||
except HTTPErrorS3Manager, e:
|
||||
return {'code': e.code, 'message': e.message}
|
||||
|
||||
def fetch_site_list(self, bucket=None):
|
||||
"""
|
||||
This method will compile a list of all sites configured in the requested S3 bucket
|
||||
|
||||
:param bucket: str; the S3 bucket to fetch sites from. (Default = S3_REPO_BUCKET_NAME)
|
||||
:return: list; array of whids present in the S3 bucket
|
||||
"""
|
||||
l = self._logger
|
||||
if not bucket:
|
||||
# if no bucket provided, use repo bucket name from stage config
|
||||
bucket = self._repo_bucket
|
||||
l.info('Requesting site list for bucket: %s' % bucket)
|
||||
operation = 'fetch_site_list'
|
||||
params = {
|
||||
'bucket': bucket
|
||||
}
|
||||
try:
|
||||
resp = self._send(operation, params)
|
||||
l.debug('** Complete. Successfully returned %d sites for bucket %s' % (len(resp), bucket))
|
||||
return resp
|
||||
except HTTPErrorS3Manager, e:
|
||||
return {'code': e.code, 'message': e.message}
|
||||
|
||||
def fetch_object_list_by_site_and_bucket(self, site='', bucket=None):
|
||||
"""
|
||||
This function fetches the list of file objects
|
||||
from the S3 folder specified by the bucket and site args supplied.
|
||||
|
||||
:param site: str; whid name of the site to fetch from
|
||||
:param bucket: str; name of the bucket where the files reside
|
||||
:return: Dict[str, Any]; {'instance_configs': Dict[str,Any], 'flow_views': List[str]}
|
||||
"""
|
||||
l = self._logger
|
||||
if not bucket:
|
||||
# if no bucket provided, use repo bucket name from stage config
|
||||
bucket = self._repo_bucket
|
||||
l.info('Requesting object list for site %s in bucket: %s' % (site, bucket))
|
||||
operation = 'fetch_object_list_by_site_and_bucket'
|
||||
params = {
|
||||
'site': site,
|
||||
'bucket': bucket
|
||||
}
|
||||
try:
|
||||
resp = self._send(operation, params)
|
||||
l.debug('** Complete. Successfully returned object list for site %s on bucket %s' % (site, bucket))
|
||||
return resp
|
||||
except HTTPErrorS3Manager, e:
|
||||
return {'code': e.code, 'message': e.message}
|
||||
|
||||
def query_audit_table(self, start_time = None, end_time = None, operation = None, copy_option = None,
|
||||
destination_bucket = None, destination_view = None, destination_object_key = None,
|
||||
destination_site = None, destination_stage = None, destination_version_id = None,
|
||||
error_message = None, error_occurred = None, expires = None,
|
||||
source_bucket = None, source_view = None, source_object_key = None, source_site = None,
|
||||
source_stage = None, source_version_id = None, timestamp = None, username = None,
|
||||
return_items_only = True, **kwargs):
|
||||
"""
|
||||
Query/scan the audit table and return records matching the supplied parameters
|
||||
|
||||
:param start_time: Optional[Union[str,datetime]]; if provided, will define the beginning of the
|
||||
time range to filter on the `timestamp` column. `timestamp` column is a string in the format
|
||||
"%Y-%m-%d %H:%M:%S"
|
||||
:param end_time: Optional[Union[str,datetime]]; if provided, will define the beginning of the
|
||||
time range to filter on the `timestamp` column. `timestamp` column is a string in the format
|
||||
"%Y-%m-%d %H:%M:%S"
|
||||
:param operation: Optional[Union[str,List,Dict]]; match on operation column
|
||||
:param copy_option: Optional[Union[str,List,Dict]]; match on copy_option column ('svg', 'json', 'both')
|
||||
:param destination_bucket: Optional[Union[str,List,Dict]]; match on destination_bucket column
|
||||
:param destination_view: Optional[Union[str,List,Dict]]; match on destination_view column
|
||||
:param destination_object_key: Optional[Union[str,List,Dict]]; match on destination_object_key column
|
||||
:param destination_site: Optional[Union[str,List,Dict]]; match on destination_site column
|
||||
:param destination_stage: Optional[Union[str,List,Dict]]; match on destination_stage column
|
||||
:param destination_version_id: Optional[Union[str,List,Dict]]; match on destination_version_id column
|
||||
:param error_message: Optional[Union[str,List,Dict]]; match on error_message column
|
||||
:param error_occurred: Optional[Union[bool,List,Dict]]; match on error_error_occurred column
|
||||
:param expires: Optional[Union[str,List,Dict]]; match/filter on expires column
|
||||
:param source_bucket: Optional[Union[str,List,Dict]]; match on source_bucket column
|
||||
:param source_view: Optional[Union[str,List,Dict]]; match on source_view column
|
||||
:param source_object_key: Optional[Union[str,List,Dict]]; match on source_object_key column
|
||||
:param source_site: Optional[Union[str,List,Dict]]; match on source_site column
|
||||
:param source_stage: Optional[Union[str,List,Dict]]; match on source_stage column
|
||||
:param source_version_id: Optional[Union[str,List,Dict]]; match on source_version_id column
|
||||
:param timestamp: Optional[Union[str,List,Dict]]; match/filter on timestamp column
|
||||
(overridden by `start_time` and `end_time` args)
|
||||
:param username: Optional[Union[str,List,Dict]]; match on username column
|
||||
:param return_items_only: bool; if true, strip the `Items` from boto3 response,
|
||||
if false, return the entire response object
|
||||
:returns: List[Dict[str,Any]]; array of items that match the scan filters supplied
|
||||
"""
|
||||
l = self._logger
|
||||
# build params to send to Lambda using `locals()`. I know it's frowned upon but I'm not trying to type all that!!
|
||||
params = {k:v for k,v in locals().items() if k not in ('self', 'l', 'kwargs') and v not in (None, '')}
|
||||
# override `operation` arg for pass to `_send` method, as the value to query is already packed in `params`
|
||||
operation = 'query_audit_table'
|
||||
try:
|
||||
resp = self._send(operation, params)
|
||||
l.debug('** Complete. Successfully queried audit table using supplied query params')
|
||||
return resp
|
||||
except HTTPErrorS3Manager, e:
|
||||
return {'code': e.code, 'message': e.message}
|
||||
|
||||
def check_user_site_permissions(self, whid = None, obj_key = None):
|
||||
"""
|
||||
Check if a given username has permissions to the site folder in the flow-view S3 bucket
|
||||
|
||||
:param whid: str; warehouse id/site name to check
|
||||
:param obj_key: str; [OPTIONAL] if provided, will check user permissions to the object key, rather than the whid
|
||||
:return: Dict[str,Any]; {
|
||||
'code': int; 200 if the user has permissions, 403 if Forbidden to access
|
||||
'message': str; explanation to display, if needed. Will include necessary group memberships missing if Forbidden
|
||||
}
|
||||
"""
|
||||
l = self._logger
|
||||
operation = 'check_user_site_permissions'
|
||||
params = {'whid': whid, 'obj_key': obj_key}
|
||||
try:
|
||||
resp = self._send(operation, params)
|
||||
l.debug('** Complete. Successfully checked user site permissions on backend')
|
||||
return resp
|
||||
except HTTPErrorS3Manager, e:
|
||||
return {'code': e.code, 'message': e.message}
|
||||
|
||||
def fetch_user_site_permissions_and_area_list(self, username = None, stage_name = 'beta'):
|
||||
"""
|
||||
Fetch the sites for which the user has flow-view write permissions for the given stage.
|
||||
Also fetches the list of "area" names that flow-views can be created for
|
||||
|
||||
:param username: str; user alias/id to fetch sites for
|
||||
:param stage_name: str; stage folder of flow-view resources to check permissions on
|
||||
:return: Dict[str,Any]; response object including a list of sites and area names.
|
||||
{
|
||||
"code": int; 200 if successful call, 4** if user not found,
|
||||
"sites": List[str]; List of site names,
|
||||
"areas": List[str]; List of valid flow-view area names
|
||||
}
|
||||
"""
|
||||
l = self._logger
|
||||
operation = 'fetch_user_site_permissions_and_area_list'
|
||||
params = {'username': username, 'stage_name': stage_name}
|
||||
try:
|
||||
resp = self._send(operation, params)
|
||||
l.debug('** Complete. Successfully fetched user site permissions and area list')
|
||||
return resp
|
||||
except HTTPErrorS3Manager, e:
|
||||
return {'code': e.code, 'message': e.message}
|
||||
|
||||
def fetch_master_area_list(self):
|
||||
"""
|
||||
Download a master list of valid flow-view area names, stored in S3
|
||||
|
||||
:return: List[str]; returns list of area names
|
||||
"""
|
||||
l = self._logger
|
||||
operation = 'fetch_master_area_list'
|
||||
params = {}
|
||||
try:
|
||||
resp = self._send(operation, params)
|
||||
l.debug('** Complete. Successfully fetched master area list')
|
||||
return resp
|
||||
except HTTPErrorS3Manager, e:
|
||||
return {'code': e.code, 'message': e.message}
|
||||
|
||||
class InvalidOperationS3Manager(Exception):
|
||||
"""
|
||||
Invalid operation requested for S3Manager class
|
||||
"""
|
||||
def __init__(self, code=400, msg='Invalid operation requested for S3Manager class'):
|
||||
self.code = code
|
||||
self.message = msg
|
||||
|
||||
|
||||
class InvalidParametersS3Manager(Exception):
|
||||
"""
|
||||
Invalid parameters for S3Manager operation
|
||||
"""
|
||||
def __init__(self, code=400, msg='Invalid parameters for S3Manager operation'):
|
||||
self.code = code
|
||||
self.message = msg
|
||||
|
||||
|
||||
class HTTPErrorS3Manager(Exception):
|
||||
"""
|
||||
HTTP Error for S3Manager Request
|
||||
"""
|
||||
def __init__(self, code=500, msg='HTTP Error Encountered Sending S3Manager Request'):
|
||||
self.code = code
|
||||
self.message = msg
|
||||
|
||||
|
After Width: | Height: | Size: 6.8 KiB |
@ -1,254 +0,0 @@
|
||||
{
|
||||
"custom": {},
|
||||
"params": {
|
||||
"ASdata": "value",
|
||||
"Browser": "Amazon",
|
||||
"Color": 10,
|
||||
"DeviceType": "AirCompressor",
|
||||
"FolderPath": "AirCompressor/",
|
||||
"Vendor": "AS",
|
||||
"Visibility": true,
|
||||
"tagPath": "AirCompressor"
|
||||
},
|
||||
"propConfig": {
|
||||
"params.ASdata": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Browser": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Color": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"Browser": "{view.params.Browser}",
|
||||
"FolderPath": "{view.params.FolderPath}",
|
||||
"tagPath": "{view.params.tagPath}"
|
||||
},
|
||||
"tagPath": "[{Browser}]{FolderPath}{tagPath}/HMI/Color"
|
||||
},
|
||||
"type": "tag"
|
||||
},
|
||||
"paramDirection": "output",
|
||||
"persistent": true
|
||||
},
|
||||
"params.DeviceType": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.FolderPath": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Font-size": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Text": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Vendor": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Visibility": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagPath": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 30,
|
||||
"width": 30
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Compressor"
|
||||
},
|
||||
"position": {
|
||||
"basis": "100%"
|
||||
},
|
||||
"propConfig": {
|
||||
"props.style.backgroundColor": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.Color"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "#000000",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "#808080"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "#FF8C00"
|
||||
},
|
||||
{
|
||||
"input": 5,
|
||||
"output": "#D900D9"
|
||||
},
|
||||
{
|
||||
"input": 6,
|
||||
"output": "#0000FF"
|
||||
},
|
||||
{
|
||||
"input": 7,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 8,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 9,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 10,
|
||||
"output": "#00D900"
|
||||
},
|
||||
{
|
||||
"input": 11,
|
||||
"output": "#87CEFA"
|
||||
},
|
||||
{
|
||||
"input": 12,
|
||||
"output": "#CCFFCC"
|
||||
},
|
||||
{
|
||||
"input": 13,
|
||||
"output": "#D3D3D3"
|
||||
},
|
||||
{
|
||||
"input": 14,
|
||||
"output": "#AC5F00"
|
||||
},
|
||||
{
|
||||
"input": 100,
|
||||
"output": "#FFFFFF"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if ({view.params.tagPath} \u003d {session.custom.Search},\r\n\"table/SearchTaghighlight\", \"table/highlight\")"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": 2,
|
||||
"color": "#000000",
|
||||
"cursor": "pointer"
|
||||
}
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
}
|
||||
],
|
||||
"events": {
|
||||
"dom": {
|
||||
"onClick": {
|
||||
"config": {
|
||||
"draggable": false,
|
||||
"id": "information",
|
||||
"modal": false,
|
||||
"overlayDismiss": false,
|
||||
"resizable": false,
|
||||
"showCloseIcon": false,
|
||||
"type": "open",
|
||||
"viewParams": {
|
||||
"ASdata": "{view.params.ASdata}",
|
||||
"Browser": "{view.params.Browser}",
|
||||
"DeviceType": "{view.params.DeviceType}",
|
||||
"FolderPath": "{view.params.FolderPath}",
|
||||
"Vendor": "{view.params.Vendor}",
|
||||
"tagPath": "{view.params.tagPath}"
|
||||
},
|
||||
"viewPath": "Windows/Information/Information",
|
||||
"viewportBound": false
|
||||
},
|
||||
"scope": "C",
|
||||
"type": "popup"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "root",
|
||||
"tooltip": {
|
||||
"enabled": true,
|
||||
"style": {
|
||||
"backgroundColor": "#2B2B2BBF",
|
||||
"color": "#FFFFFF",
|
||||
"fontSize": 12,
|
||||
"textAlign": "left",
|
||||
"white-space": "pre"
|
||||
}
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.tooltip.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "replace({view.params.tagPath}, \"_\", \"-\") +\r\n\"\\nStatus: \" + \r\ncase (tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Color\"),\r\n1 ,\"Low Air Pressure\",\r\n2 ,\"Faulted\",\r\n10 ,\"Running\",\r\n13 ,\"Off\",\r\n14 ,\"Maintenance Mode\",\r\n\"not response\")"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"meta.visible": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{session.custom.show.Compressor} || {view.params.Visibility}"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"direction": "column",
|
||||
"justify": "center",
|
||||
"style": {
|
||||
"classes": "table/highlight",
|
||||
"transform": "translate3d(0,0,0)"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
{
|
||||
"custom": {},
|
||||
"params": {
|
||||
"text": "value"
|
||||
},
|
||||
"propConfig": {
|
||||
"params.text": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 30,
|
||||
"width": 210
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label"
|
||||
},
|
||||
"position": {
|
||||
"basis": "209px",
|
||||
"grow": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{view.params.text}"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"classes": "Text/CenterAlign_with_Padding"
|
||||
}
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"props": {
|
||||
"alignItems": "center",
|
||||
"justify": "center",
|
||||
"style": {
|
||||
"overflow": "hidden"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,552 @@
|
||||
{
|
||||
"custom": {
|
||||
"color": "#C2C2C2",
|
||||
"priority": "No Active Alarms",
|
||||
"state": "Closed"
|
||||
},
|
||||
"params": {
|
||||
"demoColor": -1,
|
||||
"tagProps": [
|
||||
"/system/mcm01/test",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value"
|
||||
]
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.color": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Color"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "if(\r\n {view.params.demoColor} \u003e\u003d 0,\r\n {view.params.demoColor},\r\n coalesce({value}, 0)\r\n)\r\n",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"fallback": "#000000",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "#C2C2C2"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "#FFA500"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "#0008FF"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "#00FF00"
|
||||
},
|
||||
{
|
||||
"input": 5,
|
||||
"output": "#FFF700"
|
||||
},
|
||||
{
|
||||
"input": 6,
|
||||
"output": "#87CEEB"
|
||||
},
|
||||
{
|
||||
"input": 7,
|
||||
"output": "#90EE90"
|
||||
},
|
||||
{
|
||||
"input": 8,
|
||||
"output": "#964B00"
|
||||
},
|
||||
{
|
||||
"input": 9,
|
||||
"output": "#FFFFFF"
|
||||
},
|
||||
{
|
||||
"input": 10,
|
||||
"output": "#000000"
|
||||
},
|
||||
{
|
||||
"input": 11,
|
||||
"output": "#8B0000"
|
||||
},
|
||||
{
|
||||
"input": 12,
|
||||
"output": "#808080"
|
||||
},
|
||||
{
|
||||
"input": 13,
|
||||
"output": "#8B8000"
|
||||
},
|
||||
{
|
||||
"input": 14,
|
||||
"output": "#006400"
|
||||
},
|
||||
{
|
||||
"input": 15,
|
||||
"output": "#FFFFC5"
|
||||
},
|
||||
{
|
||||
"input": 16,
|
||||
"output": "#00008B"
|
||||
},
|
||||
{
|
||||
"input": 17,
|
||||
"output": "#FF7276"
|
||||
},
|
||||
{
|
||||
"input": 18,
|
||||
"output": "#556B2F"
|
||||
},
|
||||
{
|
||||
"input": 19,
|
||||
"output": "#B43434"
|
||||
},
|
||||
{
|
||||
"input": 20,
|
||||
"output": "#4682B4"
|
||||
},
|
||||
{
|
||||
"input": 21,
|
||||
"output": "#FFD700"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.priority": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Priority"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value},0)",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"fallback": null,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "No Active Alarms"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "High"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "Medium"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "Low"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "Diagnostic"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.state": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/State"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value},0)",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"fallback": "Unknown",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "Closed"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "Actuated"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "Communication Faulted"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "Conveyor Running In Maintenance Mode"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "Disabled"
|
||||
},
|
||||
{
|
||||
"input": 5,
|
||||
"output": "Disconnected"
|
||||
},
|
||||
{
|
||||
"input": 6,
|
||||
"output": "Stopped"
|
||||
},
|
||||
{
|
||||
"input": 7,
|
||||
"output": "Enabled Not Running"
|
||||
},
|
||||
{
|
||||
"input": 8,
|
||||
"output": "Encoder Fault"
|
||||
},
|
||||
{
|
||||
"input": 9,
|
||||
"output": "Energy Management"
|
||||
},
|
||||
{
|
||||
"input": 10,
|
||||
"output": "ESTOP Was Actuated"
|
||||
},
|
||||
{
|
||||
"input": 11,
|
||||
"output": "EStopped"
|
||||
},
|
||||
{
|
||||
"input": 12,
|
||||
"output": "EStopped Locally"
|
||||
},
|
||||
{
|
||||
"input": 13,
|
||||
"output": "Extended Faulted"
|
||||
},
|
||||
{
|
||||
"input": 14,
|
||||
"output": "Full"
|
||||
},
|
||||
{
|
||||
"input": 15,
|
||||
"output": "Gaylord Start Pressed"
|
||||
},
|
||||
{
|
||||
"input": 16,
|
||||
"output": "Jam Fault"
|
||||
},
|
||||
{
|
||||
"input": 17,
|
||||
"output": "Jammed"
|
||||
},
|
||||
{
|
||||
"input": 18,
|
||||
"output": "Loading Allowed"
|
||||
},
|
||||
{
|
||||
"input": 19,
|
||||
"output": "Loading Not Allowed"
|
||||
},
|
||||
{
|
||||
"input": 20,
|
||||
"output": "Low Air Pressure Fault Was Present"
|
||||
},
|
||||
{
|
||||
"input": 21,
|
||||
"output": "Maintenance Mode"
|
||||
},
|
||||
{
|
||||
"input": 22,
|
||||
"output": "Conveyor Stopped In Maintenance Mode"
|
||||
},
|
||||
{
|
||||
"input": 23,
|
||||
"output": "Motor Faulted"
|
||||
},
|
||||
{
|
||||
"input": 24,
|
||||
"output": "Motor Was Faulted"
|
||||
},
|
||||
{
|
||||
"input": 25,
|
||||
"output": "Normal"
|
||||
},
|
||||
{
|
||||
"input": 26,
|
||||
"output": "Off Inactive"
|
||||
},
|
||||
{
|
||||
"input": 27,
|
||||
"output": "Open"
|
||||
},
|
||||
{
|
||||
"input": 28,
|
||||
"output": "PLC Ready To Run"
|
||||
},
|
||||
{
|
||||
"input": 29,
|
||||
"output": "Package Release Pressed"
|
||||
},
|
||||
{
|
||||
"input": 30,
|
||||
"output": "Power Branch Was Faulted"
|
||||
},
|
||||
{
|
||||
"input": 31,
|
||||
"output": "Pressed"
|
||||
},
|
||||
{
|
||||
"input": 32,
|
||||
"output": "Ready To Receive"
|
||||
},
|
||||
{
|
||||
"input": 33,
|
||||
"output": "Running"
|
||||
},
|
||||
{
|
||||
"input": 34,
|
||||
"output": "Started"
|
||||
},
|
||||
{
|
||||
"input": 35,
|
||||
"output": "Stopped"
|
||||
},
|
||||
{
|
||||
"input": 36,
|
||||
"output": "System Started"
|
||||
},
|
||||
{
|
||||
"input": 37,
|
||||
"output": "Unknown"
|
||||
},
|
||||
{
|
||||
"input": 38,
|
||||
"output": "VFD Fault"
|
||||
},
|
||||
{
|
||||
"input": 39,
|
||||
"output": "Conveyor Running In Power Saving Mode"
|
||||
},
|
||||
{
|
||||
"input": 40,
|
||||
"output": "Conveyor Jogging In Maintenance Mode"
|
||||
},
|
||||
{
|
||||
"input": 41,
|
||||
"output": "VFD Reset Required"
|
||||
},
|
||||
{
|
||||
"input": 42,
|
||||
"output": "Jam Reset Push Button Pressed"
|
||||
},
|
||||
{
|
||||
"input": 43,
|
||||
"output": "Start Push Button Pressed"
|
||||
},
|
||||
{
|
||||
"input": 44,
|
||||
"output": "Stop Push Button Pressed"
|
||||
},
|
||||
{
|
||||
"input": 45,
|
||||
"output": "No Container"
|
||||
},
|
||||
{
|
||||
"input": 46,
|
||||
"output": "Ready To Be Enabled"
|
||||
},
|
||||
{
|
||||
"input": 47,
|
||||
"output": "Half Full"
|
||||
},
|
||||
{
|
||||
"input": 48,
|
||||
"output": "Enabled"
|
||||
},
|
||||
{
|
||||
"input": 49,
|
||||
"output": "Tipper Faulted"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"params.demoColor": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagProps": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 25,
|
||||
"width": 25
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "PX"
|
||||
},
|
||||
"position": {
|
||||
"height": 1,
|
||||
"width": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.elements[1].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.color"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"id": "defs1",
|
||||
"name": "defs1",
|
||||
"type": "defs"
|
||||
},
|
||||
{
|
||||
"fill": {},
|
||||
"height": "47.417244",
|
||||
"id": "beaconSquare",
|
||||
"name": "beaconSquare",
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": "2.36887"
|
||||
},
|
||||
"type": "rect",
|
||||
"width": "47.337795",
|
||||
"x": "1.450278",
|
||||
"y": "1.3708278"
|
||||
},
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"id": "tspan3",
|
||||
"name": "tspan3",
|
||||
"stroke": {
|
||||
"width": "1.15193"
|
||||
},
|
||||
"text": "PX",
|
||||
"type": "tspan",
|
||||
"x": "24.958401",
|
||||
"y": "31.781378"
|
||||
}
|
||||
],
|
||||
"fill": {
|
||||
"paint": "#000"
|
||||
},
|
||||
"fontSize": "24.7347px",
|
||||
"id": "beaconLabel",
|
||||
"name": "beaconLabel",
|
||||
"stroke": {
|
||||
"width": "1.15193"
|
||||
},
|
||||
"textAnchor": "middle",
|
||||
"type": "text",
|
||||
"x": "24.958401",
|
||||
"y": 33.781378
|
||||
}
|
||||
],
|
||||
"viewBox": "0 0 50 50"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
}
|
||||
],
|
||||
"events": {
|
||||
"dom": {
|
||||
"onClick": {
|
||||
"config": {
|
||||
"script": "\t#create tags lists for the device\n\tprops \u003d self.view.params.tagProps\n\ttags_table_dataset \u003d autStand.devices.getAllTags(self, props[0])\n\tsystem.perspective.openDock(\u0027Docked-East-Device\u0027,params\u003d{\u0027tagProps\u0027:props, \"tags\":tags_table_dataset})"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "root",
|
||||
"tooltip": {
|
||||
"enabled": true
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.tooltip.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if(\n {view.custom.state} !\u003d \"Closed\",\n \"Source Id: \" + {view.params.tagProps[0]} + \", Priority: \" + {view.custom.priority} + \", State: \" + {view.custom.state},\n \"Device Disconnected\"\n)\n"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"meta.visible": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.alarm_filter.show_px"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"mode": "percent",
|
||||
"style": {
|
||||
"cursor": "pointer",
|
||||
"userSelect": "None"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 36 KiB |
@ -0,0 +1,20 @@
|
||||
def navigate_to_additional_view(self):
|
||||
"""
|
||||
This function is used to navigate to a page from a navigation button.
|
||||
This function can be used on any button that has a property called "self.custom.page_id"
|
||||
which is the target page for the button.
|
||||
Args:
|
||||
self: Refrence to the object that is invoking this function.
|
||||
|
||||
Returns:
|
||||
This is a description of what is returned.
|
||||
|
||||
Raises:
|
||||
KeyError: Raises an exception.
|
||||
"""
|
||||
|
||||
page_id = self.custom.page_id
|
||||
plc = page_id.split("-")[0]
|
||||
url_to_navigate = "/DetailedView/%s/%s" % (page_id, plc)
|
||||
system.perspective.navigate(page = url_to_navigate)
|
||||
|
||||
@ -0,0 +1,66 @@
|
||||
#from logging import raiseExceptions
|
||||
|
||||
|
||||
class GetStatus():
|
||||
|
||||
def __init__(self, whid, alarm_data):
|
||||
self.alarm_data = alarm_data
|
||||
self.priority_dict = {}
|
||||
self.id_to_status = {}
|
||||
self.tag_provider = "[%s_SCADA_TAG_PROVIDER]" % (whid)
|
||||
self.logger = system.util.getLogger("%s-Update-Visualisation" % (whid))
|
||||
|
||||
def convert_priority(self, priority):
|
||||
#The alarm priority is converted into a status
|
||||
#This is based on the highest active alarm priority
|
||||
if str(priority) == "0":
|
||||
return 4
|
||||
elif str(priority) == "1":
|
||||
return 3
|
||||
elif str(priority) == "2":
|
||||
return 2
|
||||
elif str(priority) == "3" or priority == "4":
|
||||
return 1
|
||||
else:
|
||||
return 6
|
||||
|
||||
def check_priority(self, alarm_id, priority):
|
||||
#We check to see if the current priority is greater
|
||||
#than the current priority in the priority_dict. This is
|
||||
#because the status is based on the active alarm. With the
|
||||
#highest priority.
|
||||
controller_id = alarm_id.split("/")[0]
|
||||
if self.priority_dict.get(controller_id) is None:
|
||||
self.priority_dict[controller_id] = {}
|
||||
self.priority_dict[controller_id][alarm_id] = self.convert_priority(priority)
|
||||
|
||||
elif self.priority_dict[controller_id].get(alarm_id) is None:
|
||||
self.priority_dict[controller_id][alarm_id] = self.convert_priority(priority)
|
||||
|
||||
elif self.priority_dict[controller_id].get(alarm_id) < priority:
|
||||
self.priority_dict[controller_id][alarm_id] = (
|
||||
self.convert_priority
|
||||
(priority)
|
||||
)
|
||||
|
||||
def run_status(self):
|
||||
for i in self.alarm_data:
|
||||
alarm_id = i
|
||||
priority = self.alarm_data.get(i, {}).get("priority")
|
||||
if priority != None:
|
||||
self.check_priority(alarm_id, priority)
|
||||
|
||||
def update_tags(self):
|
||||
device_paths = []
|
||||
status_values = []
|
||||
if isinstance(self.priority_dict, dict):
|
||||
for i in self.priority_dict:
|
||||
device_path = "%sTags/%s/IdToStatus/json" % (self.tag_provider, i)
|
||||
device_paths.append(device_path)
|
||||
status_json = self.priority_dict.get(i)
|
||||
status_values.append(system.util.jsonEncode(status_json, 4))
|
||||
self.logger.info("device paths " + str(device_paths))
|
||||
else:
|
||||
raise TypeError("Not a python dictionary")
|
||||
system.tag.writeAsync(device_paths, status_values)
|
||||
|
||||
@ -0,0 +1,584 @@
|
||||
{
|
||||
"custom": {
|
||||
"color": "#C2C2C2",
|
||||
"priority": "No Active Alarms",
|
||||
"state": "Closed"
|
||||
},
|
||||
"params": {
|
||||
"demoColor": -1,
|
||||
"tagProps": [
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value"
|
||||
]
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.color": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Color"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "if(\r\n {view.params.demoColor} \u003e\u003d 0,\r\n {view.params.demoColor},\r\n coalesce({value}, 0)\r\n)\r\n",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"fallback": "#000000",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "#C2C2C2"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "#FFA500"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "#0008FF"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "#00FF00"
|
||||
},
|
||||
{
|
||||
"input": 5,
|
||||
"output": "#FFF700"
|
||||
},
|
||||
{
|
||||
"input": 6,
|
||||
"output": "#87CEEB"
|
||||
},
|
||||
{
|
||||
"input": 7,
|
||||
"output": "#90EE90"
|
||||
},
|
||||
{
|
||||
"input": 8,
|
||||
"output": "#964B00"
|
||||
},
|
||||
{
|
||||
"input": 9,
|
||||
"output": "#FFFFFF"
|
||||
},
|
||||
{
|
||||
"input": 10,
|
||||
"output": "#000000"
|
||||
},
|
||||
{
|
||||
"input": 11,
|
||||
"output": "#8B0000"
|
||||
},
|
||||
{
|
||||
"input": 12,
|
||||
"output": "#808080"
|
||||
},
|
||||
{
|
||||
"input": 13,
|
||||
"output": "#8B8000"
|
||||
},
|
||||
{
|
||||
"input": 14,
|
||||
"output": "#006400"
|
||||
},
|
||||
{
|
||||
"input": 15,
|
||||
"output": "#FFFFC5"
|
||||
},
|
||||
{
|
||||
"input": 16,
|
||||
"output": "#00008B"
|
||||
},
|
||||
{
|
||||
"input": 17,
|
||||
"output": "#FF7276"
|
||||
},
|
||||
{
|
||||
"input": 18,
|
||||
"output": "#556B2F"
|
||||
},
|
||||
{
|
||||
"input": 19,
|
||||
"output": "#B43434"
|
||||
},
|
||||
{
|
||||
"input": 20,
|
||||
"output": "#4682B4"
|
||||
},
|
||||
{
|
||||
"input": 21,
|
||||
"output": "#FFD700"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.priority": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Priority"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value},0)",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"fallback": null,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "No Active Alarms"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "High"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "Medium"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "Low"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "Diagnostic"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.state": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/State"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value},0)",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"fallback": "Unknown",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "Closed"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "Actuated"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "Communication Faulted"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "Conveyor Running In Maintenance Mode"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "Disabled"
|
||||
},
|
||||
{
|
||||
"input": 5,
|
||||
"output": "Disconnected"
|
||||
},
|
||||
{
|
||||
"input": 6,
|
||||
"output": "Stopped"
|
||||
},
|
||||
{
|
||||
"input": 7,
|
||||
"output": "Enabled Not Running"
|
||||
},
|
||||
{
|
||||
"input": 8,
|
||||
"output": "Encoder Fault"
|
||||
},
|
||||
{
|
||||
"input": 9,
|
||||
"output": "Energy Management"
|
||||
},
|
||||
{
|
||||
"input": 10,
|
||||
"output": "ESTOP Was Actuated"
|
||||
},
|
||||
{
|
||||
"input": 11,
|
||||
"output": "EStopped"
|
||||
},
|
||||
{
|
||||
"input": 12,
|
||||
"output": "EStopped Locally"
|
||||
},
|
||||
{
|
||||
"input": 13,
|
||||
"output": "Extended Faulted"
|
||||
},
|
||||
{
|
||||
"input": 14,
|
||||
"output": "Full"
|
||||
},
|
||||
{
|
||||
"input": 15,
|
||||
"output": "Gaylord Start Pressed"
|
||||
},
|
||||
{
|
||||
"input": 16,
|
||||
"output": "Jam Fault"
|
||||
},
|
||||
{
|
||||
"input": 17,
|
||||
"output": "Jammed"
|
||||
},
|
||||
{
|
||||
"input": 18,
|
||||
"output": "Loading Allowed"
|
||||
},
|
||||
{
|
||||
"input": 19,
|
||||
"output": "Loading Not Allowed"
|
||||
},
|
||||
{
|
||||
"input": 20,
|
||||
"output": "Low Air Pressure Fault Was Present"
|
||||
},
|
||||
{
|
||||
"input": 21,
|
||||
"output": "Maintenance Mode"
|
||||
},
|
||||
{
|
||||
"input": 22,
|
||||
"output": "Conveyor Stopped In Maintenance Mode"
|
||||
},
|
||||
{
|
||||
"input": 23,
|
||||
"output": "Motor Faulted"
|
||||
},
|
||||
{
|
||||
"input": 24,
|
||||
"output": "Motor Was Faulted"
|
||||
},
|
||||
{
|
||||
"input": 25,
|
||||
"output": "Normal"
|
||||
},
|
||||
{
|
||||
"input": 26,
|
||||
"output": "Off Inactive"
|
||||
},
|
||||
{
|
||||
"input": 27,
|
||||
"output": "Open"
|
||||
},
|
||||
{
|
||||
"input": 28,
|
||||
"output": "PLC Ready To Run"
|
||||
},
|
||||
{
|
||||
"input": 29,
|
||||
"output": "Package Release Pressed"
|
||||
},
|
||||
{
|
||||
"input": 30,
|
||||
"output": "Power Branch Was Faulted"
|
||||
},
|
||||
{
|
||||
"input": 31,
|
||||
"output": "Pressed"
|
||||
},
|
||||
{
|
||||
"input": 32,
|
||||
"output": "Ready To Receive"
|
||||
},
|
||||
{
|
||||
"input": 33,
|
||||
"output": "Running"
|
||||
},
|
||||
{
|
||||
"input": 34,
|
||||
"output": "Started"
|
||||
},
|
||||
{
|
||||
"input": 35,
|
||||
"output": "Stopped"
|
||||
},
|
||||
{
|
||||
"input": 36,
|
||||
"output": "System Started"
|
||||
},
|
||||
{
|
||||
"input": 37,
|
||||
"output": "Unknown"
|
||||
},
|
||||
{
|
||||
"input": 38,
|
||||
"output": "VFD Fault"
|
||||
},
|
||||
{
|
||||
"input": 39,
|
||||
"output": "Conveyor Running In Power Saving Mode"
|
||||
},
|
||||
{
|
||||
"input": 40,
|
||||
"output": "Conveyor Jogging In Maintenance Mode"
|
||||
},
|
||||
{
|
||||
"input": 41,
|
||||
"output": "VFD Reset Required"
|
||||
},
|
||||
{
|
||||
"input": 42,
|
||||
"output": "Jam Reset Push Button Pressed"
|
||||
},
|
||||
{
|
||||
"input": 43,
|
||||
"output": "Start Push Button Pressed"
|
||||
},
|
||||
{
|
||||
"input": 44,
|
||||
"output": "Stop Push Button Pressed"
|
||||
},
|
||||
{
|
||||
"input": 45,
|
||||
"output": "No Container"
|
||||
},
|
||||
{
|
||||
"input": 46,
|
||||
"output": "Ready To Be Enabled"
|
||||
},
|
||||
{
|
||||
"input": 47,
|
||||
"output": "Half Full"
|
||||
},
|
||||
{
|
||||
"input": 48,
|
||||
"output": "Enabled"
|
||||
},
|
||||
{
|
||||
"input": 49,
|
||||
"output": "Tipper Faulted"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"params.demoColor": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagProps": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 50,
|
||||
"width": 80
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "MCM"
|
||||
},
|
||||
"position": {
|
||||
"height": 1,
|
||||
"width": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.elements[0].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.color"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"fill": {},
|
||||
"height": 50,
|
||||
"id": "beaconSquare",
|
||||
"name": "beaconSquare",
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": "2.36887"
|
||||
},
|
||||
"type": "rect",
|
||||
"width": 80,
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"id": "tspan1",
|
||||
"name": "tspan1",
|
||||
"stroke": {
|
||||
"width": "0.895573"
|
||||
},
|
||||
"text": "MCM",
|
||||
"type": "tspan",
|
||||
"x": 40,
|
||||
"y": 33
|
||||
}
|
||||
],
|
||||
"fill": {
|
||||
"paint": "#000"
|
||||
},
|
||||
"fontSize": "20px",
|
||||
"id": "beaconLabel",
|
||||
"name": "beaconLabel",
|
||||
"stroke": {
|
||||
"width": "0.895573"
|
||||
},
|
||||
"textAnchor": "middle",
|
||||
"type": "text",
|
||||
"x": 25,
|
||||
"y": 15
|
||||
}
|
||||
],
|
||||
"preserveAspectRatio": "none",
|
||||
"viewBox": "0 0 80 50"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
}
|
||||
],
|
||||
"events": {
|
||||
"dom": {
|
||||
"onClick": {
|
||||
"config": {
|
||||
"script": "\t#create tags lists for the device\n\tprops \u003d self.view.params.tagProps\n\ttags_table_dataset \u003d autStand.devices.getAllTags(self, props[0])\n\tsystem.perspective.openDock(\u0027Docked-East-Device\u0027,params\u003d{\u0027tagProps\u0027:props, \"tags\":tags_table_dataset})"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "root",
|
||||
"tooltip": {
|
||||
"enabled": true,
|
||||
"location": "top-left",
|
||||
"style": {}
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.tooltip.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{view.custom.priority}"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "Alarms-Styles/NoAlarm",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 1,
|
||||
"output": "Alarms-Styles/Diagnostic"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "Alarms-Styles/Low"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "Alarms-Styles/Medium"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "Alarms-Styles/High"
|
||||
}
|
||||
],
|
||||
"outputType": "style-list",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"meta.tooltip.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if(\n {view.custom.state} !\u003d \"Closed\",\n \"Source Id: \" + {view.params.tagProps[0]} + \", Priority: \" + {view.custom.priority} + \", State: \" + {view.custom.state},\n \"Device Disconnected\"\n)\n"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"meta.visible": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.alarm_filter.show_dpm_mcm"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"mode": "percent",
|
||||
"style": {
|
||||
"cursor": "pointer",
|
||||
"userSelect": "None"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,442 @@
|
||||
{
|
||||
"custom": {
|
||||
"alarm_message": null,
|
||||
"disconnected": false,
|
||||
"plc": "value",
|
||||
"priority": 0,
|
||||
"priority_string": "No active alarms",
|
||||
"searchId": "PLC01",
|
||||
"state": 0
|
||||
},
|
||||
"params": {
|
||||
"forceFaultStatus": null,
|
||||
"tagProps": [
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value"
|
||||
]
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.disconnected": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "!isGood({value})",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.plc": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.tagProps[0]"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "split({value}, \"/\")[0]",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.priority": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": 0,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 3,
|
||||
"output": 1
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": 1
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": 1
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.priority_string": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "Unknown",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "No active alarms"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "High"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "High"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "High"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.searchId": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.searchId"
|
||||
},
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.state": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"fallback": null,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 1,
|
||||
"output": 1
|
||||
},
|
||||
{
|
||||
"input": 0,
|
||||
"output": 0
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": 2
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": 3
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"params.forceFaultStatus": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagProps": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 25,
|
||||
"width": 25
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "JR_Button"
|
||||
},
|
||||
"position": {
|
||||
"height": 1,
|
||||
"width": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.elements[0].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.disconnected"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "#585858",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": true,
|
||||
"output": "#000000"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.elements[1].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "#000000",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "#D5D5D5"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "#FFFFFF"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "#47FF47"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "#FFFF47"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if({session.custom.colours.colour_impaired} \u003d True,\r\n{view.custom.state} + 100,\r\n{view.custom.state})"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 101,
|
||||
"output": "State-Styles/State101"
|
||||
},
|
||||
{
|
||||
"input": 102,
|
||||
"output": "State-Styles/State102"
|
||||
},
|
||||
{
|
||||
"input": 103,
|
||||
"output": "State-Styles/State103"
|
||||
},
|
||||
{
|
||||
"input": 104,
|
||||
"output": "State-Styles/State104"
|
||||
},
|
||||
{
|
||||
"input": 105,
|
||||
"output": "State-Styles/State105"
|
||||
},
|
||||
{
|
||||
"input": 106,
|
||||
"output": "State-Styles/State106"
|
||||
},
|
||||
{
|
||||
"input": 201,
|
||||
"output": "State-Styles/State201"
|
||||
},
|
||||
{
|
||||
"input": 202,
|
||||
"output": "State-Styles/State202"
|
||||
},
|
||||
{
|
||||
"input": 203,
|
||||
"output": "State-Styles/State203"
|
||||
},
|
||||
{
|
||||
"input": 204,
|
||||
"output": "State-Styles/State204"
|
||||
},
|
||||
{
|
||||
"input": 205,
|
||||
"output": "State-Styles/State205"
|
||||
}
|
||||
],
|
||||
"outputType": "style-list",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"d": "M 0,0 H 20 V 20 H 0 Z",
|
||||
"fill": {},
|
||||
"name": "path",
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": "1.5"
|
||||
},
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "m 17,10.5 a 7,7 0 0 1 -7,7 7,7 0 0 1 -7,-7 7,7 0 0 1 7,-7 7,7 0 0 1 7,7 z",
|
||||
"fill": {},
|
||||
"name": "path",
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": "1"
|
||||
},
|
||||
"type": "path"
|
||||
}
|
||||
],
|
||||
"style": {},
|
||||
"viewBox": "0 0 20 20"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
}
|
||||
],
|
||||
"events": {
|
||||
"dom": {
|
||||
"onClick": {
|
||||
"config": {
|
||||
"script": "\tsystem.perspective.openDock(\u0027Docked-East-JR\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
},
|
||||
"onMouseEnter": {
|
||||
"config": {
|
||||
"script": "\tfrom time import sleep\n\t\n\talarm \u003d []\n\tmessage \u003d None\n\t\n\tsleep(0.5)\n\t\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "root",
|
||||
"tooltip": {
|
||||
"enabled": true,
|
||||
"style": {}
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.tooltip.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{view.custom.priority}"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "Alarms-Styles/NoAlarm",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 1,
|
||||
"output": "Alarms-Styles/High"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "Alarms-Styles/Low"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "Alarms-Styles/Medium"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "Alarms-Styles/High"
|
||||
}
|
||||
],
|
||||
"outputType": "style-list",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"meta.tooltip.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if(\n {view.custom.disconnected} \u003d false,\n \"Source Id: \" + {view.params.tagProps[0]} + \", Priority: \" + {view.custom.priority_string},\n \"Device Disconnected\"\n)\n"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"meta.visible": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.alarm_filter.show_buttons"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"mode": "percent",
|
||||
"style": {
|
||||
"cursor": "pointer"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,588 @@
|
||||
{
|
||||
"custom": {
|
||||
"color": "#C2C2C2",
|
||||
"priority": "No Active Alarms",
|
||||
"state": "Closed"
|
||||
},
|
||||
"params": {
|
||||
"demoColor": -1,
|
||||
"tagProps": [
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value"
|
||||
]
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.color": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Color"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "if(\r\n {view.params.demoColor} \u003e\u003d 0,\r\n {view.params.demoColor},\r\n coalesce({value}, 0)\r\n)\r\n",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"fallback": "#000000",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "#C2C2C2"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "#FFA500"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "#0008FF"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "#00FF00"
|
||||
},
|
||||
{
|
||||
"input": 5,
|
||||
"output": "#FFF700"
|
||||
},
|
||||
{
|
||||
"input": 6,
|
||||
"output": "#87CEEB"
|
||||
},
|
||||
{
|
||||
"input": 7,
|
||||
"output": "#90EE90"
|
||||
},
|
||||
{
|
||||
"input": 8,
|
||||
"output": "#964B00"
|
||||
},
|
||||
{
|
||||
"input": 9,
|
||||
"output": "#FFFFFF"
|
||||
},
|
||||
{
|
||||
"input": 10,
|
||||
"output": "#000000"
|
||||
},
|
||||
{
|
||||
"input": 11,
|
||||
"output": "#8B0000"
|
||||
},
|
||||
{
|
||||
"input": 12,
|
||||
"output": "#808080"
|
||||
},
|
||||
{
|
||||
"input": 13,
|
||||
"output": "#8B8000"
|
||||
},
|
||||
{
|
||||
"input": 14,
|
||||
"output": "#006400"
|
||||
},
|
||||
{
|
||||
"input": 15,
|
||||
"output": "#FFFFC5"
|
||||
},
|
||||
{
|
||||
"input": 16,
|
||||
"output": "#00008B"
|
||||
},
|
||||
{
|
||||
"input": 17,
|
||||
"output": "#FF7276"
|
||||
},
|
||||
{
|
||||
"input": 18,
|
||||
"output": "#556B2F"
|
||||
},
|
||||
{
|
||||
"input": 19,
|
||||
"output": "#B43434"
|
||||
},
|
||||
{
|
||||
"input": 20,
|
||||
"output": "#4682B4"
|
||||
},
|
||||
{
|
||||
"input": 21,
|
||||
"output": "#FFD700"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.priority": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Priority"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value},0)",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"fallback": null,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "No Active Alarms"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "High"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "Medium"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "Low"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "Diagnostic"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.state": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/State"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value},0)",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"fallback": "Unknown",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "Closed"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "Actuated"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "Communication Faulted"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "Conveyor Running In Maintenance Mode"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "Disabled"
|
||||
},
|
||||
{
|
||||
"input": 5,
|
||||
"output": "Disconnected"
|
||||
},
|
||||
{
|
||||
"input": 6,
|
||||
"output": "Stopped"
|
||||
},
|
||||
{
|
||||
"input": 7,
|
||||
"output": "Enabled Not Running"
|
||||
},
|
||||
{
|
||||
"input": 8,
|
||||
"output": "Encoder Fault"
|
||||
},
|
||||
{
|
||||
"input": 9,
|
||||
"output": "Energy Management"
|
||||
},
|
||||
{
|
||||
"input": 10,
|
||||
"output": "ESTOP Was Actuated"
|
||||
},
|
||||
{
|
||||
"input": 11,
|
||||
"output": "EStopped"
|
||||
},
|
||||
{
|
||||
"input": 12,
|
||||
"output": "EStopped Locally"
|
||||
},
|
||||
{
|
||||
"input": 13,
|
||||
"output": "Extended Faulted"
|
||||
},
|
||||
{
|
||||
"input": 14,
|
||||
"output": "Full"
|
||||
},
|
||||
{
|
||||
"input": 15,
|
||||
"output": "Gaylord Start Pressed"
|
||||
},
|
||||
{
|
||||
"input": 16,
|
||||
"output": "Jam Fault"
|
||||
},
|
||||
{
|
||||
"input": 17,
|
||||
"output": "Jammed"
|
||||
},
|
||||
{
|
||||
"input": 18,
|
||||
"output": "Loading Allowed"
|
||||
},
|
||||
{
|
||||
"input": 19,
|
||||
"output": "Loading Not Allowed"
|
||||
},
|
||||
{
|
||||
"input": 20,
|
||||
"output": "Low Air Pressure Fault Was Present"
|
||||
},
|
||||
{
|
||||
"input": 21,
|
||||
"output": "Maintenance Mode"
|
||||
},
|
||||
{
|
||||
"input": 22,
|
||||
"output": "Conveyor Stopped In Maintenance Mode"
|
||||
},
|
||||
{
|
||||
"input": 23,
|
||||
"output": "Motor Faulted"
|
||||
},
|
||||
{
|
||||
"input": 24,
|
||||
"output": "Motor Was Faulted"
|
||||
},
|
||||
{
|
||||
"input": 25,
|
||||
"output": "Normal"
|
||||
},
|
||||
{
|
||||
"input": 26,
|
||||
"output": "Off Inactive"
|
||||
},
|
||||
{
|
||||
"input": 27,
|
||||
"output": "Open"
|
||||
},
|
||||
{
|
||||
"input": 28,
|
||||
"output": "PLC Ready To Run"
|
||||
},
|
||||
{
|
||||
"input": 29,
|
||||
"output": "Package Release Pressed"
|
||||
},
|
||||
{
|
||||
"input": 30,
|
||||
"output": "Power Branch Was Faulted"
|
||||
},
|
||||
{
|
||||
"input": 31,
|
||||
"output": "Pressed"
|
||||
},
|
||||
{
|
||||
"input": 32,
|
||||
"output": "Ready To Receive"
|
||||
},
|
||||
{
|
||||
"input": 33,
|
||||
"output": "Running"
|
||||
},
|
||||
{
|
||||
"input": 34,
|
||||
"output": "Started"
|
||||
},
|
||||
{
|
||||
"input": 35,
|
||||
"output": "Stopped"
|
||||
},
|
||||
{
|
||||
"input": 36,
|
||||
"output": "System Started"
|
||||
},
|
||||
{
|
||||
"input": 37,
|
||||
"output": "Unknown"
|
||||
},
|
||||
{
|
||||
"input": 38,
|
||||
"output": "VFD Fault"
|
||||
},
|
||||
{
|
||||
"input": 39,
|
||||
"output": "Conveyor Running In Power Saving Mode"
|
||||
},
|
||||
{
|
||||
"input": 40,
|
||||
"output": "Conveyor Jogging In Maintenance Mode"
|
||||
},
|
||||
{
|
||||
"input": 41,
|
||||
"output": "VFD Reset Required"
|
||||
},
|
||||
{
|
||||
"input": 42,
|
||||
"output": "Jam Reset Push Button Pressed"
|
||||
},
|
||||
{
|
||||
"input": 43,
|
||||
"output": "Start Push Button Pressed"
|
||||
},
|
||||
{
|
||||
"input": 44,
|
||||
"output": "Stop Push Button Pressed"
|
||||
},
|
||||
{
|
||||
"input": 45,
|
||||
"output": "No Container"
|
||||
},
|
||||
{
|
||||
"input": 46,
|
||||
"output": "Ready To Be Enabled"
|
||||
},
|
||||
{
|
||||
"input": 47,
|
||||
"output": "Half Full"
|
||||
},
|
||||
{
|
||||
"input": 48,
|
||||
"output": "Enabled"
|
||||
},
|
||||
{
|
||||
"input": 49,
|
||||
"output": "Tipper Faulted"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"params.demoColor": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagProps": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 40,
|
||||
"width": 40
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "MCM"
|
||||
},
|
||||
"position": {
|
||||
"height": 1,
|
||||
"width": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.elements[1].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.color"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"id": "defs1",
|
||||
"name": "defs1",
|
||||
"type": "defs"
|
||||
},
|
||||
{
|
||||
"fill": {},
|
||||
"height": "47.417244",
|
||||
"id": "beaconSquare",
|
||||
"name": "beaconSquare",
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": "2.36887"
|
||||
},
|
||||
"type": "rect",
|
||||
"width": "47.337795",
|
||||
"x": "1.450278",
|
||||
"y": "1.3708278"
|
||||
},
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"id": "tspan1",
|
||||
"name": "tspan1",
|
||||
"stroke": {
|
||||
"width": "0.895573"
|
||||
},
|
||||
"text": "MCM",
|
||||
"type": "tspan",
|
||||
"x": "24.985008",
|
||||
"y": "29.648235"
|
||||
}
|
||||
],
|
||||
"fill": {
|
||||
"paint": "#000"
|
||||
},
|
||||
"fontSize": "16.1203px",
|
||||
"id": "beaconLabel",
|
||||
"name": "beaconLabel",
|
||||
"stroke": {
|
||||
"width": "0.895573"
|
||||
},
|
||||
"textAnchor": "middle",
|
||||
"type": "text",
|
||||
"x": "24.985008",
|
||||
"y": "29.648235"
|
||||
}
|
||||
],
|
||||
"viewBox": "0 0 50 50"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
}
|
||||
],
|
||||
"events": {
|
||||
"dom": {
|
||||
"onClick": {
|
||||
"config": {
|
||||
"script": "\t#create tags lists for the device\n\tprops \u003d self.view.params.tagProps\n\ttags_table_dataset \u003d autStand.devices.getAllTags(self, props[0])\n\tsystem.perspective.openDock(\u0027Docked-East-Device\u0027,params\u003d{\u0027tagProps\u0027:props, \"tags\":tags_table_dataset})"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "root",
|
||||
"tooltip": {
|
||||
"enabled": true,
|
||||
"location": "top-left",
|
||||
"style": {}
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.tooltip.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{view.custom.priority}"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "Alarms-Styles/NoAlarm",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 1,
|
||||
"output": "Alarms-Styles/Diagnostic"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "Alarms-Styles/Low"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "Alarms-Styles/Medium"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "Alarms-Styles/High"
|
||||
}
|
||||
],
|
||||
"outputType": "style-list",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"meta.tooltip.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if(\n {view.custom.state} !\u003d \"Closed\",\n \"Source Id: \" + {view.params.tagProps[0]} + \", Priority: \" + {view.custom.priority} + \", State: \" + {view.custom.state},\n \"Device Disconnected\"\n)\n"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"meta.visible": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.alarm_filter.show_dpm_mcm"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"mode": "percent",
|
||||
"style": {
|
||||
"cursor": "pointer",
|
||||
"userSelect": "None"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 58 KiB |
|
After Width: | Height: | Size: 194 KiB |
@ -1,55 +0,0 @@
|
||||
{
|
||||
"custom": {},
|
||||
"params": {},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 1820,
|
||||
"width": 1386
|
||||
},
|
||||
"loading": {
|
||||
"mode": "blocking"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "EmbeddedView"
|
||||
},
|
||||
"position": {
|
||||
"height": 1668,
|
||||
"rotate": {},
|
||||
"width": 1401
|
||||
},
|
||||
"propConfig": {
|
||||
"position.rotate.angle": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.RotateText"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"path": "Windows/Graphics/Default_Overview"
|
||||
},
|
||||
"type": "ia.display.view"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"position": {
|
||||
"x": 0,
|
||||
"y": 0
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"backgroundColor": "#FFFFFF",
|
||||
"overflow": "visible"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 22 KiB |
@ -0,0 +1,732 @@
|
||||
{
|
||||
"custom": {
|
||||
"FillColour": "value",
|
||||
"alarm_message": null,
|
||||
"covert_mode": true,
|
||||
"disconnected": false,
|
||||
"display_icon": true,
|
||||
"error": false,
|
||||
"isMatch": 0,
|
||||
"plc": "value",
|
||||
"priority": 0,
|
||||
"priority_string": "No active alarms",
|
||||
"running": false,
|
||||
"running_status": 0,
|
||||
"searchId": "PLC01",
|
||||
"show_error": false,
|
||||
"show_running": true,
|
||||
"state": 5,
|
||||
"state_string": "Unknown"
|
||||
},
|
||||
"params": {
|
||||
"forceFaultStatus": null,
|
||||
"forceRunningStatus": null,
|
||||
"tagProps": [
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value"
|
||||
]
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.FillColour": {
|
||||
"persistent": true
|
||||
},
|
||||
"custom.alarm_message": {
|
||||
"persistent": true
|
||||
},
|
||||
"custom.covert_mode": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "case(\t{value},\r\n\t\t0, {session.custom.alarm_filter.show_running},\r\n\t\t1, True,\r\n\t\t2, True,\r\n\t\t3, {session.custom.alarm_filter.show_low_alarm} || {session.custom.alarm_filter.show_running},\r\n\t\t4, {session.custom.alarm_filter.show_diagnostic} || {session.custom.alarm_filter.show_running},\r\n\t\t5, {session.custom.alarm_filter.show_running},\r\n\t\tFalse)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.disconnected": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"fc": "{session.custom.fc}",
|
||||
"plc": "{view.custom.plc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{plc}/DCN"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "if(isNull({value}), False, {value})",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.display_icon": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{this.custom.covert_mode}//||{this.custom.isMatch}\u003e0"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.error": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "0 \u003c {value} \u0026\u0026 {value} \u003c 5",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.isMatch": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if({view.params.tagProps[0]}\u003d\"value\",0,\nif({this.custom.searchId}\u003d{view.params.tagProps[0]},100,0))"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.plc": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.tagProps[0]"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "split({value}, \"/\")[0]",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.priority": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": 0,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 1,
|
||||
"output": 4
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": 3
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": 2
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": 1
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.priority_string": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "case({view.custom.state},\r\n1, \"High\",\r\n2, \"Medium\",\r\n3, \"Low\",\r\n4, \"Diagnostic\",\r\n5, \"No active alarms\",\r\n\"Unknown\")"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.running": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{view.custom.running_status} \u003d 3"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.running_status": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value},{view.params.forceRunningStatus},0)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.searchId": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.searchId"
|
||||
},
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.show_error": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "case(\t{value},\r\n\t\t1, True,\r\n\t\t2, True,\r\n\t\t3, {session.custom.alarm_filter.show_low_alarm},\r\n\t\t4, {session.custom.alarm_filter.show_diagnostic},\r\n\t\tFalse)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.show_running": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "case(\t{value},\r\n\t\t1, False,\r\n\t\t2, False,\r\n\t\t{session.custom.alarm_filter.show_running}\r\n\t\t)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.state": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/ALARMST"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"fallback": null,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 4,
|
||||
"output": 1
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": 2
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": 3
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": 4
|
||||
},
|
||||
{
|
||||
"input": 0,
|
||||
"output": 5
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.state_string": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "case({view.custom.running_status},\r\n1, \"Faulted\",\r\n2, \"Stopped\",\r\n3, \"Running\",\r\n\"Unknown\")"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"params.forceFaultStatus": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.forceRunningStatus": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagProps": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 100,
|
||||
"width": 100
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Spiral"
|
||||
},
|
||||
"position": {
|
||||
"height": 0.005,
|
||||
"width": 0.005,
|
||||
"x": 0.0225,
|
||||
"y": 0.0277
|
||||
},
|
||||
"props": {
|
||||
"params": {
|
||||
"tagProps": [
|
||||
"",
|
||||
"",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value"
|
||||
]
|
||||
},
|
||||
"path": "Symbol-Views/Equipment-Views/Spiral"
|
||||
},
|
||||
"type": "ia.display.view"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "Spiral_Symbol"
|
||||
},
|
||||
"position": {
|
||||
"height": 1,
|
||||
"width": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.elements[1].elements[0].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "case({value},\r\n0,{session.custom.colours.state0},\r\n1,{session.custom.colours.state1},\r\n2,{session.custom.colours.state2},\r\n3,{session.custom.colours.state3},\r\n4,{session.custom.colours.state4},\r\n5,if({view.custom.running},{session.custom.colours.state5},{session.custom.colours.state0}),\r\n6,{session.custom.colours.state6},\r\n{session.custom.colours.fallback}\r\n)",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"expression": "if({view.custom.display_icon}\u0026\u0026 {view.custom.isMatch}\u003d0,{value},{value}+\u002700\u0027)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if({session.custom.colours.colour_impaired} \u003d True \u0026\u0026 {view.custom.isMatch} \u003e 0,\r\n{view.custom.state} + 100 + {view.custom.isMatch},\r\n{view.custom.state} + {view.custom.isMatch})"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 101,
|
||||
"output": "State-Styles/State101"
|
||||
},
|
||||
{
|
||||
"input": 102,
|
||||
"output": "State-Styles/State102"
|
||||
},
|
||||
{
|
||||
"input": 103,
|
||||
"output": "State-Styles/State103"
|
||||
},
|
||||
{
|
||||
"input": 104,
|
||||
"output": "State-Styles/State104"
|
||||
},
|
||||
{
|
||||
"input": 105,
|
||||
"output": "State-Styles/State105"
|
||||
},
|
||||
{
|
||||
"input": 106,
|
||||
"output": "State-Styles/State106"
|
||||
},
|
||||
{
|
||||
"input": 201,
|
||||
"output": "State-Styles/State201"
|
||||
},
|
||||
{
|
||||
"input": 202,
|
||||
"output": "State-Styles/State202"
|
||||
},
|
||||
{
|
||||
"input": 203,
|
||||
"output": "State-Styles/State203"
|
||||
},
|
||||
{
|
||||
"input": 204,
|
||||
"output": "State-Styles/State204"
|
||||
},
|
||||
{
|
||||
"input": 205,
|
||||
"output": "State-Styles/State205"
|
||||
}
|
||||
],
|
||||
"outputType": "style-list",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"id": "defs2",
|
||||
"name": "defs2",
|
||||
"type": "defs"
|
||||
},
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"cx": "6.6145835",
|
||||
"cy": "6.6145835",
|
||||
"fill": {},
|
||||
"id": "path234",
|
||||
"name": "path234",
|
||||
"r": "6.303678",
|
||||
"stroke": {
|
||||
"dasharray": "none",
|
||||
"paint": "#000000",
|
||||
"width": "0.23"
|
||||
},
|
||||
"type": "circle"
|
||||
},
|
||||
{
|
||||
"cx": "6.6145835",
|
||||
"cy": "6.6145835",
|
||||
"fill": {
|
||||
"paint": "transparent"
|
||||
},
|
||||
"id": "path234-7",
|
||||
"name": "path234-7",
|
||||
"r": "3.313657",
|
||||
"stroke": {
|
||||
"dasharray": "none",
|
||||
"paint": "#000000",
|
||||
"width": "0.221"
|
||||
},
|
||||
"type": "circle"
|
||||
},
|
||||
{
|
||||
"d": "M 6.6188113,9.8749524 6.6103553,3.3542142",
|
||||
"fill": {
|
||||
"paint": "transparent"
|
||||
},
|
||||
"id": "path3429",
|
||||
"name": "path3429",
|
||||
"stroke": {
|
||||
"dasharray": "none",
|
||||
"paint": "#000000",
|
||||
"width": "0.218"
|
||||
},
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "M 4.978764,9.47052 8.23181,3.819167",
|
||||
"fill": {
|
||||
"paint": "transparent"
|
||||
},
|
||||
"id": "path3429-8",
|
||||
"name": "path3429-8",
|
||||
"stroke": {
|
||||
"dasharray": "none",
|
||||
"paint": "#000000",
|
||||
"width": "0.218"
|
||||
},
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "M 3.818909,8.2200703 9.461806,4.9523781",
|
||||
"fill": {
|
||||
"paint": "transparent"
|
||||
},
|
||||
"id": "path3429-8-2",
|
||||
"name": "path3429-8-2",
|
||||
"stroke": {
|
||||
"dasharray": "none",
|
||||
"paint": "#000000",
|
||||
"width": "0.218"
|
||||
},
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "M 3.3168328,6.6175189 9.837571,6.6090589",
|
||||
"fill": {
|
||||
"paint": "transparent"
|
||||
},
|
||||
"id": "path3429-8-2-6",
|
||||
"name": "path3429-8-2-6",
|
||||
"stroke": {
|
||||
"dasharray": "none",
|
||||
"paint": "#000000",
|
||||
"width": "0.218"
|
||||
},
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "M 3.7180036,4.9712623 6.8282074,6.7528116",
|
||||
"fill": {
|
||||
"paint": "transparent"
|
||||
},
|
||||
"id": "path3429-8-2-6-5",
|
||||
"name": "path3429-8-2-6-5",
|
||||
"stroke": {
|
||||
"dasharray": "none",
|
||||
"paint": "#000000",
|
||||
"width": "0.219869"
|
||||
},
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "M 4.9523763,3.7647768 8.2200718,9.4076712",
|
||||
"fill": {
|
||||
"paint": "transparent"
|
||||
},
|
||||
"id": "path3429-8-2-6-5-5",
|
||||
"name": "path3429-8-2-6-5-5",
|
||||
"stroke": {
|
||||
"dasharray": "none",
|
||||
"paint": "#000000",
|
||||
"width": "0.218"
|
||||
},
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"cx": "6.6145835",
|
||||
"cy": "6.6145835",
|
||||
"fill": {
|
||||
"opacity": "1",
|
||||
"paint": "#fefefe"
|
||||
},
|
||||
"id": "path234-7-0",
|
||||
"name": "path234-7-0",
|
||||
"r": "0.26523831",
|
||||
"stroke": {
|
||||
"dasharray": "none",
|
||||
"paint": "#000000",
|
||||
"width": "0.218"
|
||||
},
|
||||
"type": "circle"
|
||||
}
|
||||
],
|
||||
"id": "layer1",
|
||||
"name": "layer1",
|
||||
"type": "group"
|
||||
}
|
||||
],
|
||||
"style": {},
|
||||
"viewBox": "0 0 13.229166 13.229167"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
}
|
||||
],
|
||||
"events": {
|
||||
"dom": {
|
||||
"onClick": {
|
||||
"config": {
|
||||
"script": "\tsystem.perspective.openDock(\u0027Docked-East\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
},
|
||||
"onDoubleClick": {
|
||||
"config": {
|
||||
"script": "\ttagProps \u003d self.view.params.tagProps\n\tsystem.perspective.openPopup(\"StatusPopUP\", \"PopUp-Views/Controller-Equipment/Information\", params \u003d{\"tagProps\":tagProps})\n\t"
|
||||
},
|
||||
"enabled": false,
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
},
|
||||
"onMouseEnter": {
|
||||
"config": {
|
||||
"script": "\tfrom time import sleep\n\t\n\talarm \u003d []\n\tmessage \u003d None\n\t\n\tsleep(0.5)\n\t\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "root",
|
||||
"tooltip": {
|
||||
"enabled": true,
|
||||
"location": "top-left",
|
||||
"style": {}
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.tooltip.style.backgroundColor": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "case({value},\r\n0,{session.custom.colours.state0},\r\n1,{session.custom.colours.state1},\r\n2,{session.custom.colours.state2},\r\n3,{session.custom.colours.state3},\r\n4,{session.custom.colours.state4},\r\n5,{session.custom.colours.state5},\r\n6,{session.custom.colours.state6},\r\n{session.custom.colours.fallback}\r\n)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"meta.tooltip.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{view.custom.priority}"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "Alarms-Styles/NoAlarm",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 1,
|
||||
"output": "Alarms-Styles/Diagnostic"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "Alarms-Styles/Low"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "Alarms-Styles/Medium"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "Alarms-Styles/High"
|
||||
}
|
||||
],
|
||||
"outputType": "style-list",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"meta.tooltip.style.color": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "if({session.custom.colours.colour_impaired},\r\n\t\u0027#000000\u0027,\r\n\tcase(\t{value},\r\n\t\t\t1,\u0027#FFFFFF\u0027,\r\n\t\t\t2,\u0027#000000\u0027,\r\n\t\t\t3,\u0027#000000\u0027,\r\n\t\t\t4,\u0027#FFFFFF\u0027,\r\n\t\t\t5,\u0027#FFFFFF\u0027,\r\n\t\t\t\u0027#000000\u0027)\r\n\t)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"meta.tooltip.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if({view.custom.disconnected} \u003d False,\n\tif(isNull({view.custom.alarm_message}),\n\t\"Source Id: \" + {view.params.tagProps[0]} +\n\t\", Priority: \" + {view.custom.priority_string} +\n\t\", State: \" + {view.custom.state_string},\n\t\"Source Id: \" + {view.params.tagProps[0]} +\n\t\", Alarm: \" + {view.custom.alarm_message} +\n\t\", Priority: \" + {view.custom.priority_string} +\n\t\", State: \" + {view.custom.state_string}),\n\"Source Id: \" +{view.params.tagProps[0]} + \", Priority: Unknown, State: Unknown\")"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"props.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.disconnected"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "Disconnects/Device-Connected",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": true,
|
||||
"output": "Disconnects/Device-Disconnected"
|
||||
},
|
||||
{
|
||||
"input": false,
|
||||
"output": "Disconnects/Device-Connected"
|
||||
}
|
||||
],
|
||||
"outputType": "style-list",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"aspectRatio": "1:1",
|
||||
"mode": "percent",
|
||||
"style": {
|
||||
"cursor": "pointer"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 847 B |
@ -1,36 +0,0 @@
|
||||
{
|
||||
"base": {
|
||||
"style": {
|
||||
"backgroundImage": "linear-gradient(180deg, rgba(245,245,245,1) 0%, rgba(235,235,235,1) 70%, rgba(208,208,208,1) 100%);",
|
||||
"borderColor": "#555",
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": "2px",
|
||||
"color": "#000",
|
||||
"textTransform": "uppercase"
|
||||
}
|
||||
},
|
||||
"variants": [
|
||||
{
|
||||
"pseudo": "hover",
|
||||
"style": {
|
||||
"backgroundImage": "linear-gradient(0deg, rgba(245,245,245,1) 0%, rgba(235,235,235,1) 70%, rgba(208,208,208,1) 100%);",
|
||||
"borderColor": "#000",
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": "2px",
|
||||
"color": "#000",
|
||||
"cursor": "pointer"
|
||||
}
|
||||
},
|
||||
{
|
||||
"pseudo": "disabled",
|
||||
"style": {
|
||||
"backgroundImage": "linear-gradient(180deg, rgba(208,208,208,1) 0%, rgba(208,208,208,1) 100%);",
|
||||
"borderColor": "#555",
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": "2px",
|
||||
"color": "#555555",
|
||||
"cursor": "not-allowed"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -1,211 +0,0 @@
|
||||
{
|
||||
"custom": {},
|
||||
"params": {
|
||||
"ASdata": "value",
|
||||
"Browser": "value",
|
||||
"Color": 10,
|
||||
"DeviceType": "value",
|
||||
"FolderPath": "value",
|
||||
"Vendor": "value",
|
||||
"Visibility": true,
|
||||
"tagPath": "value"
|
||||
},
|
||||
"propConfig": {
|
||||
"params.ASdata": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Browser": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Color": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.DeviceType": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.FolderPath": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Vendor": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Visibility": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagPath": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 60,
|
||||
"width": 30
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Barcode reader"
|
||||
},
|
||||
"position": {
|
||||
"basis": "100%"
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.visible": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{session.custom.show.Scanners} || {view.params.Visibility}"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"props.elements[0].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.Color"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "#000000",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "#808080"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "#FF8C00"
|
||||
},
|
||||
{
|
||||
"input": 5,
|
||||
"output": "#D900D9"
|
||||
},
|
||||
{
|
||||
"input": 6,
|
||||
"output": "#0000FF"
|
||||
},
|
||||
{
|
||||
"input": 7,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 8,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 9,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 10,
|
||||
"output": "#00D900"
|
||||
},
|
||||
{
|
||||
"input": 11,
|
||||
"output": "#87CEFA"
|
||||
},
|
||||
{
|
||||
"input": 12,
|
||||
"output": "#CCFFCC"
|
||||
},
|
||||
{
|
||||
"input": 13,
|
||||
"output": "#D3D3D3"
|
||||
},
|
||||
{
|
||||
"input": 14,
|
||||
"output": "#AC5F00"
|
||||
},
|
||||
{
|
||||
"input": 100,
|
||||
"output": "#FFFFFF"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if ({view.params.tagPath} \u003d {session.custom.Search},\r\n\"table/SearchTaghighlight\", \"table/highlight\")"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"d": "M.63,31.2A28.16,28.16,0,0,1,7.74,9.59,26.91,26.91,0,0,1,27.54.5a26.93,26.93,0,0,1,19.9,9.07,28.18,28.18,0,0,1,7.11,21.72L44.42,64,27.6,118.31Z",
|
||||
"name": "path",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "M27.6,1A26.39,26.39,0,0,1,47.07,9.91a27.62,27.62,0,0,1,7,21.23L40.83,73.89,27.6,116.62,1.14,31.14a27.64,27.64,0,0,1,7-21.21A26.4,26.4,0,0,1,27.54,1h.06m0-1h-.06C11.75,0-1.61,14.52.16,31.34L27.6,120,55.05,31.34C56.81,14.49,43.41,0,27.6,0Z",
|
||||
"name": "path",
|
||||
"type": "path"
|
||||
}
|
||||
],
|
||||
"fill": {},
|
||||
"name": "group",
|
||||
"type": "group"
|
||||
}
|
||||
],
|
||||
"preserveAspectRatio": "none",
|
||||
"style": {},
|
||||
"viewBox": "0 0 55.2 120"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root",
|
||||
"tooltip": {
|
||||
"style": {
|
||||
"backgroundColor": "#2B2B2BBF",
|
||||
"color": "#FFFFFF",
|
||||
"fontSize": 12,
|
||||
"textAlign": "left",
|
||||
"white-space": "pre"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"direction": "column",
|
||||
"justify": "center",
|
||||
"style": {
|
||||
"classes": "table/highlight",
|
||||
"cursor": "pointer"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
}
|
||||
@ -1,237 +0,0 @@
|
||||
{
|
||||
"custom": {},
|
||||
"params": {
|
||||
"ASdata": "value",
|
||||
"Browser": "value",
|
||||
"Color": 1,
|
||||
"DeviceType": "value",
|
||||
"FolderPath": "value",
|
||||
"Vendor": "value",
|
||||
"Visibility": null,
|
||||
"tagPath": "value"
|
||||
},
|
||||
"propConfig": {
|
||||
"params.ASdata": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Browser": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Color": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.DeviceType": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.FolderPath": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Vendor": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Visibility": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagPath": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 8,
|
||||
"width": 128
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Estop_pullcord"
|
||||
},
|
||||
"position": {
|
||||
"basis": "100%"
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.visible": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{session.custom.show.Estops}|| {view.params.Visibility}"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"props.elements[0].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.Color"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "#000000",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "#808080"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "#FF8C00"
|
||||
},
|
||||
{
|
||||
"input": 5,
|
||||
"output": "#D900D9"
|
||||
},
|
||||
{
|
||||
"input": 6,
|
||||
"output": "#0000FF"
|
||||
},
|
||||
{
|
||||
"input": 7,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 8,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 9,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 10,
|
||||
"output": "#00D900"
|
||||
},
|
||||
{
|
||||
"input": 11,
|
||||
"output": "#87CEFA"
|
||||
},
|
||||
{
|
||||
"input": 12,
|
||||
"output": "#CCFFCC"
|
||||
},
|
||||
{
|
||||
"input": 13,
|
||||
"output": "#D3D3D3"
|
||||
},
|
||||
{
|
||||
"input": 14,
|
||||
"output": "#AC5F00"
|
||||
},
|
||||
{
|
||||
"input": 100,
|
||||
"output": "#FFFFFF"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if ({view.params.tagPath} \u003d {session.custom.Search},\r\n\"table/SearchTaghighlight\", \"table/highlight\")"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"fill": {},
|
||||
"height": "4",
|
||||
"name": "rect",
|
||||
"type": "rect",
|
||||
"width": "100"
|
||||
}
|
||||
],
|
||||
"preserveAspectRatio": "none",
|
||||
"style": {
|
||||
"cursor": "pointer"
|
||||
},
|
||||
"viewBox": "0 0 100 4"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
}
|
||||
],
|
||||
"events": {
|
||||
"dom": {
|
||||
"onClick": {
|
||||
"config": {
|
||||
"draggable": false,
|
||||
"id": "information",
|
||||
"modal": false,
|
||||
"overlayDismiss": false,
|
||||
"resizable": false,
|
||||
"showCloseIcon": false,
|
||||
"type": "open",
|
||||
"viewParams": {
|
||||
"ASdata": "{view.params.ASdata}",
|
||||
"Browser": "{view.params.Browser}",
|
||||
"DeviceType": "{view.params.DeviceType}",
|
||||
"FolderPath": "{view.params.FolderPath}",
|
||||
"Vendor": "{view.params.Vendor}",
|
||||
"tagPath": "{view.params.tagPath}"
|
||||
},
|
||||
"viewPath": "Windows/Information/Information",
|
||||
"viewportBound": false
|
||||
},
|
||||
"scope": "C",
|
||||
"type": "popup"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "root",
|
||||
"tooltip": {
|
||||
"enabled": true,
|
||||
"style": {
|
||||
"backgroundColor": "#2B2B2BBF",
|
||||
"color": "#FFFFFF",
|
||||
"fontSize": 12,
|
||||
"textAlign": "left",
|
||||
"white-space": "pre"
|
||||
}
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.tooltip.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "replace({view.params.tagPath}, \"_\", \"-\") +\r\n\"\\nStatus: \" + \r\ncase (tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Color\"),\r\n2 ,\"E-Stop Activated\",\r\n10 ,\"Clear\",\r\n\"not response\")"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"direction": "column",
|
||||
"justify": "center"
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 494 B |
@ -0,0 +1,656 @@
|
||||
{
|
||||
"custom": {
|
||||
"FillColour": "value",
|
||||
"alarm_message": null,
|
||||
"covert_mode": true,
|
||||
"disconnected": false,
|
||||
"display_icon": true,
|
||||
"error": false,
|
||||
"isMatch": 0,
|
||||
"plc": "value",
|
||||
"priority": 0,
|
||||
"priority_string": "No active alarms",
|
||||
"running": false,
|
||||
"running_status": 0,
|
||||
"searchId": "value",
|
||||
"show_error": false,
|
||||
"show_running": true,
|
||||
"state": 5,
|
||||
"state_string": "Unknown"
|
||||
},
|
||||
"params": {
|
||||
"forceFaultStatus": null,
|
||||
"forceRunningStatus": null,
|
||||
"tagProps": [
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value"
|
||||
]
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.FillColour": {
|
||||
"persistent": true
|
||||
},
|
||||
"custom.alarm_message": {
|
||||
"persistent": true
|
||||
},
|
||||
"custom.covert_mode": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "case(\t{value},\r\n\t\t0, {session.custom.alarm_filter.show_running},\r\n\t\t1, True,\r\n\t\t2, True,\r\n\t\t3, {session.custom.alarm_filter.show_low_alarm} || {session.custom.alarm_filter.show_running},\r\n\t\t4, {session.custom.alarm_filter.show_diagnostic} || {session.custom.alarm_filter.show_running},\r\n\t\t5, {session.custom.alarm_filter.show_running},\r\n\t\tFalse)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.disconnected": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"fc": "{session.custom.fc}",
|
||||
"plc": "{view.custom.plc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{plc}/DCN"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "if(isNull({value}), False, {value})",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.display_icon": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{this.custom.covert_mode}//||{this.custom.isMatch}\u003e0"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.error": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "0 \u003c {value} \u0026\u0026 {value} \u003c 5",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.isMatch": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if({view.params.tagProps[0]}\u003d\"value\",0,\nif({this.custom.searchId}\u003d{view.params.tagProps[0]},100,0))"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.plc": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.tagProps[0]"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "split({value}, \"/\")[0]",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.priority": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": 0,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 1,
|
||||
"output": 4
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": 3
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": 2
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": 1
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.priority_string": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "case({view.custom.state},\r\n1, \"High\",\r\n2, \"Medium\",\r\n3, \"Low\",\r\n4, \"Diagnostic\",\r\n5, \"No active alarms\",\r\n\"Unknown\")"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.running": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{view.custom.running_status} \u003d 3"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.running_status": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value},{view.params.forceRunningStatus},0)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.searchId": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.searchId"
|
||||
},
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.show_error": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "case(\t{value},\r\n\t\t1, True,\r\n\t\t2, True,\r\n\t\t3, {session.custom.alarm_filter.show_low_alarm},\r\n\t\t4, {session.custom.alarm_filter.show_diagnostic},\r\n\t\tFalse)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.show_running": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "case(\t{value},\r\n\t\t1, False,\r\n\t\t2, False,\r\n\t\t{session.custom.alarm_filter.show_running}\r\n\t\t)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.state": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/ALARMST"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"fallback": null,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 4,
|
||||
"output": 1
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": 2
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": 3
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": 4
|
||||
},
|
||||
{
|
||||
"input": 0,
|
||||
"output": 5
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.state_string": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "case({view.custom.running_status},\r\n1, \"Faulted\",\r\n2, \"Stopped\",\r\n3, \"Running\",\r\n\"Unknown\")"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"params.forceFaultStatus": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.forceRunningStatus": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagProps": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 100,
|
||||
"width": 100
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "PPI"
|
||||
},
|
||||
"position": {
|
||||
"height": 1,
|
||||
"width": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.elements[1].elements[0].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "case({value},\r\n0,{session.custom.colours.state0},\r\n1,{session.custom.colours.state1},\r\n2,{session.custom.colours.state2},\r\n3,{session.custom.colours.state3},\r\n4,{session.custom.colours.state4},\r\n5,{session.custom.colours.state5},\r\n6,{session.custom.colours.state6},\r\n{session.custom.colours.fallback}\r\n)",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"expression": "if({view.custom.display_icon}\u0026\u0026 {view.custom.isMatch}\u003d0,{value},{value}+\u002700\u0027)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if({session.custom.colours.colour_impaired} \u003d True \u0026\u0026 {view.custom.isMatch} \u003e 0,\r\n{view.custom.state} + 100 + {view.custom.isMatch},\r\n{view.custom.state} + {view.custom.isMatch})"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 101,
|
||||
"output": "State-Styles/State101"
|
||||
},
|
||||
{
|
||||
"input": 102,
|
||||
"output": "State-Styles/State102"
|
||||
},
|
||||
{
|
||||
"input": 103,
|
||||
"output": "State-Styles/State103"
|
||||
},
|
||||
{
|
||||
"input": 104,
|
||||
"output": "State-Styles/State104"
|
||||
},
|
||||
{
|
||||
"input": 105,
|
||||
"output": "State-Styles/State105"
|
||||
},
|
||||
{
|
||||
"input": 106,
|
||||
"output": "State-Styles/State106"
|
||||
},
|
||||
{
|
||||
"input": 201,
|
||||
"output": "State-Styles/State201"
|
||||
},
|
||||
{
|
||||
"input": 202,
|
||||
"output": "State-Styles/State202"
|
||||
},
|
||||
{
|
||||
"input": 203,
|
||||
"output": "State-Styles/State203"
|
||||
},
|
||||
{
|
||||
"input": 204,
|
||||
"output": "State-Styles/State204"
|
||||
},
|
||||
{
|
||||
"input": 205,
|
||||
"output": "State-Styles/State205"
|
||||
}
|
||||
],
|
||||
"outputType": "style-list",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"id": "defs1",
|
||||
"name": "defs1",
|
||||
"type": "defs"
|
||||
},
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"cx": "6.6145835",
|
||||
"cy": "6.6145835",
|
||||
"fill": {},
|
||||
"id": "path1",
|
||||
"name": "path1",
|
||||
"r": "6.019948",
|
||||
"stroke": {
|
||||
"dasharray": "none",
|
||||
"paint": "#000000",
|
||||
"width": "0.264583"
|
||||
},
|
||||
"type": "circle"
|
||||
},
|
||||
{
|
||||
"d": "m 2.1166666,8.5242134 h 3.175",
|
||||
"fill": {
|
||||
"paint": "transparent"
|
||||
},
|
||||
"id": "path2",
|
||||
"name": "path2",
|
||||
"stroke": {
|
||||
"dasharray": "none",
|
||||
"paint": "#000000",
|
||||
"width": "0.264583"
|
||||
},
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "M 7.9374999,8.5242134 H 11.112492",
|
||||
"fill": {
|
||||
"paint": "transparent"
|
||||
},
|
||||
"id": "path3",
|
||||
"name": "path3",
|
||||
"stroke": {
|
||||
"dasharray": "none",
|
||||
"paint": "#000000",
|
||||
"width": "0.264583"
|
||||
},
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "M 5.1593748,4.183724 V 8.4170573",
|
||||
"fill": {
|
||||
"paint": "transparent"
|
||||
},
|
||||
"id": "path5",
|
||||
"name": "path5",
|
||||
"stroke": {
|
||||
"dasharray": "none",
|
||||
"paint": "#000000",
|
||||
"width": "0.264583"
|
||||
},
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "m 8.2020833,4.1405926 h -3.175",
|
||||
"fill": {
|
||||
"paint": "transparent"
|
||||
},
|
||||
"id": "path6",
|
||||
"name": "path6",
|
||||
"stroke": {
|
||||
"dasharray": "none",
|
||||
"paint": "#000000",
|
||||
"width": "0.264583"
|
||||
},
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "M 8.0697914,4.183724 V 8.4170573",
|
||||
"fill": {
|
||||
"paint": "transparent"
|
||||
},
|
||||
"id": "path7",
|
||||
"name": "path7",
|
||||
"stroke": {
|
||||
"dasharray": "none",
|
||||
"paint": "#000000",
|
||||
"width": "0.264583"
|
||||
},
|
||||
"type": "path"
|
||||
}
|
||||
],
|
||||
"id": "layer1",
|
||||
"name": "layer1",
|
||||
"type": "group"
|
||||
}
|
||||
],
|
||||
"style": {},
|
||||
"viewBox": "0 0 13.229166 13.229167"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
}
|
||||
],
|
||||
"events": {
|
||||
"dom": {
|
||||
"onClick": {
|
||||
"config": {
|
||||
"script": "\tsystem.perspective.openDock(\u0027Docked-East\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
},
|
||||
"onDoubleClick": {
|
||||
"config": {
|
||||
"script": "\ttagProps \u003d self.view.params.tagProps\n\tsystem.perspective.openPopup(\"StatusPopUP\", \"PopUp-Views/Controller-Equipment/Information\", params \u003d{\"tagProps\":tagProps})\n\t"
|
||||
},
|
||||
"enabled": false,
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
},
|
||||
"onMouseEnter": {
|
||||
"config": {
|
||||
"script": "\tfrom time import sleep\n\t\n\talarm \u003d []\n\tmessage \u003d None\n\t\n\tsleep(0.5)\n\t\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "root",
|
||||
"tooltip": {
|
||||
"enabled": true,
|
||||
"location": "top-left",
|
||||
"style": {}
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.tooltip.style.backgroundColor": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "case({value},\r\n0,{session.custom.colours.state0},\r\n1,{session.custom.colours.state1},\r\n2,{session.custom.colours.state2},\r\n3,{session.custom.colours.state3},\r\n4,{session.custom.colours.state4},\r\n5,{session.custom.colours.state5},\r\n6,{session.custom.colours.state6},\r\n{session.custom.colours.fallback}\r\n)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"meta.tooltip.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{view.custom.priority}"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "Alarms-Styles/NoAlarm",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 1,
|
||||
"output": "Alarms-Styles/Diagnostic"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "Alarms-Styles/Low"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "Alarms-Styles/Medium"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "Alarms-Styles/High"
|
||||
}
|
||||
],
|
||||
"outputType": "style-list",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"meta.tooltip.style.color": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "if({session.custom.colours.colour_impaired},\r\n\t\u0027#000000\u0027,\r\n\tcase(\t{value},\r\n\t\t\t1,\u0027#FFFFFF\u0027,\r\n\t\t\t2,\u0027#000000\u0027,\r\n\t\t\t3,\u0027#000000\u0027,\r\n\t\t\t4,\u0027#FFFFFF\u0027,\r\n\t\t\t5,\u0027#FFFFFF\u0027,\r\n\t\t\t\u0027#000000\u0027)\r\n\t)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"meta.tooltip.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if({view.custom.disconnected} \u003d False,\n\tif(isNull({view.custom.alarm_message}),\n\t\"Source Id: \" + {view.params.tagProps[0]} +\n\t\", Priority: \" + {view.custom.priority_string} +\n\t\", State: \" + {view.custom.state_string},\n\t\"Source Id: \" + {view.params.tagProps[0]} +\n\t\", Alarm: \" + {view.custom.alarm_message} +\n\t\", Priority: \" + {view.custom.priority_string} +\n\t\", State: \" + {view.custom.state_string}),\n\"Source Id: \" +{view.params.tagProps[0]} + \", Priority: Unknown, State: Unknown\")"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"props.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.disconnected"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "Disconnects/Device-Connected",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": true,
|
||||
"output": "Disconnects/Device-Disconnected"
|
||||
},
|
||||
{
|
||||
"input": false,
|
||||
"output": "Disconnects/Device-Connected"
|
||||
}
|
||||
],
|
||||
"outputType": "style-list",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"aspectRatio": "1:1",
|
||||
"mode": "percent",
|
||||
"style": {
|
||||
"cursor": "pointer"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,773 @@
|
||||
{
|
||||
"custom": {
|
||||
"api_region_name": "na",
|
||||
"bucket_options": [
|
||||
{
|
||||
"label": "Image Files",
|
||||
"value": "na-ignition-image-repo"
|
||||
},
|
||||
{
|
||||
"label": "Source Files",
|
||||
"value": "na-ignition-image-source"
|
||||
}
|
||||
],
|
||||
"default_query_params": {
|
||||
"bucket": null,
|
||||
"object_key": null,
|
||||
"site": null,
|
||||
"view": null
|
||||
},
|
||||
"destination_view_suffix": null,
|
||||
"object_key": null,
|
||||
"stage_config": {
|
||||
"account_id": "925510716640",
|
||||
"endpoint": "https://scada-s3-management.narme-scada.rme.amazon.dev/",
|
||||
"lambda_name": "RMESDScadaS3ManagementFlaskLambda-prod",
|
||||
"region": "us-east-2",
|
||||
"repo_bucket": "na-ignition-image-repo",
|
||||
"s3_region": "us-east-1",
|
||||
"source_bucket": "na-ignition-image-source"
|
||||
},
|
||||
"view_options_by_site_and_bucket": [],
|
||||
"view_suffix": null,
|
||||
"whid_options": []
|
||||
},
|
||||
"params": {
|
||||
"query_params": {
|
||||
"bucket": null,
|
||||
"object_key": null,
|
||||
"site": null,
|
||||
"view": null
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.api_region_name": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.aws.prefix"
|
||||
},
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.bucket_options": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.stage_config"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"code": "\treturn [{\u0027value\u0027: value.repo_bucket, \u0027label\u0027: \u0027Image Files\u0027},\n\t\t\t{\u0027value\u0027: value.source_bucket, \u0027label\u0027: \u0027Source Files\u0027}]",
|
||||
"type": "script"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.default_query_params": {
|
||||
"persistent": true
|
||||
},
|
||||
"custom.object_key": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.query_params"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"code": "\tstage_config \u003d self.custom.stage_config\n\tbucket \u003d self.params.query_params.bucket\n\tsite \u003d self.params.query_params.site\n\tview \u003d self.params.query_params.view\n\tif bucket and site and view:\n\t\tif bucket \u003d\u003d stage_config.repo_bucket:\n\t\t\tsuffix \u003d \u0027.svg\u0027\n\t\t\tsubfolder \u003d \u0027images\u0027\n\t\telse:\n\t\t\tsuffix \u003d \u0027.drawio\u0027\n\t\t\tsubfolder \u003d \u0027source\u0027\n\t\treturn \"SCADA/%s/%s/%s%s\" % (site, subfolder, view, suffix)\n\telse:\n\t\treturn None\n",
|
||||
"type": "script"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"onChange": {
|
||||
"enabled": null,
|
||||
"script": "\td \u003d self.params.query_params\n\tif getattr(currentValue, \u0027value\u0027, None):\n\t\tself.params.query_params.object_key \u003d currentValue.value\n\t"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.stage_config": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{view.custom.api_region_name}"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"code": "\treturn AWS.s3.STAGE_CONFIG[\u0027prod\u0027][value]",
|
||||
"type": "script"
|
||||
}
|
||||
],
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.view_options_by_site_and_bucket": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{view.params.query_params.site}+{view.params.query_params.bucket}"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"code": "\tbucket \u003d self.params.query_params.bucket\n\tsite \u003d self.params.query_params.site\n\tif bucket and site:\n\t\tfrom AWS.s3 import S3Manager\n\t\tfrom helper.helper import sanitize_tree\n\t\tfrom pprint import pformat\n\t\t\n\t\tapi_stage \u003d \u0027prod\u0027\n\t\tusername \u003d self.session.props.auth.user.userName\n\t\tapi_region_name \u003d self.view.custom.api_region_name\n\t\t\n\t\ts3m \u003d S3Manager(api_stage, api_region_name, username)\n\t\tsuffix \u003d self.custom.view_suffix\n\t\tfiles \u003d sanitize_tree(s3m.fetch_object_list_by_site_and_bucket(site, bucket))\n\t\treturn [{\u0027value\u0027: x[\u0027Filename\u0027].replace(suffix,\u0027\u0027), \n\t\t\t\t\u0027label\u0027: x[\u0027Filename\u0027].replace(suffix,\u0027\u0027)} for x in files]\n\treturn []",
|
||||
"type": "script"
|
||||
}
|
||||
],
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.view_suffix": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.query_params.bucket"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"code": "\tif value:\n\t\tstage_config \u003d self.custom.stage_config\n\t\tif value \u003d\u003d stage_config.get(\u0027repo_bucket\u0027, None):\n\t\t\treturn \".svg\"\n\t\tif value \u003d\u003d stage_config.get(\"source_bucket\", None):\n\t\t\treturn \".drawio\"\n\treturn value",
|
||||
"type": "script"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.whid_options": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.query_params.bucket"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"code": "\tif value:\n\t\tfrom AWS.s3 import S3Manager\n\t\t\n\t\tapi_stage \u003d \u0027prod\u0027\n\t\tusername \u003d self.session.props.auth.user.userName\n\t\tapi_region_name \u003d self.custom.api_region_name\n\t\t\n\t\ts3m \u003d S3Manager(\u0027prod\u0027, api_region_name, username)\n\t\t\n\t\treturn [{\u0027value\u0027: x, \u0027label\u0027: x} for x in s3m.fetch_site_list(value)]\n\treturn []",
|
||||
"type": "script"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"params.query_params": {
|
||||
"onChange": {
|
||||
"enabled": null,
|
||||
"script": "\tif not missedEvents and origin in (\u0027Binding\u0027, \u0027Script\u0027, \u0027BindingWriteback\u0027):\n\t\tpayload \u003d currentValue.value\n\t\tsystem.perspective.sendMessage(\u0027list_versions_query_params_changed\u0027, payload, scope\u003d\u0027session\u0027)\n\t\t"
|
||||
},
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 600
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label"
|
||||
},
|
||||
"position": {
|
||||
"shrink": 0
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"borderStyle": "none",
|
||||
"classes": "Framework/Card/Title_transparent"
|
||||
},
|
||||
"text": "Select Query Params"
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
},
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"events": {
|
||||
"component": {
|
||||
"onActionPerformed": {
|
||||
"config": {
|
||||
"script": "\t# reset query params to default values \n\t# (stored in `view.custom.default_query_params`)\n\tself.view.params.query_params \u003d self.view.custom.default_query_params"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "Clear Button",
|
||||
"tooltip": {
|
||||
"enabled": true,
|
||||
"location": "bottom-right",
|
||||
"text": "Clear Selections"
|
||||
}
|
||||
},
|
||||
"position": {
|
||||
"shrink": 0
|
||||
},
|
||||
"props": {
|
||||
"image": {
|
||||
"icon": {
|
||||
"path": "material/clear_all"
|
||||
}
|
||||
},
|
||||
"primary": false,
|
||||
"style": {
|
||||
"classes": "Input/Button/Secondary_minimal"
|
||||
},
|
||||
"text": ""
|
||||
},
|
||||
"type": "ia.input.button"
|
||||
},
|
||||
{
|
||||
"events": {
|
||||
"component": {
|
||||
"onActionPerformed": {
|
||||
"config": {
|
||||
"script": "\t# refresh version table query via message handler\n\tsystem.perspective.sendMessage(\u0027refresh_version_table_data\u0027, scope\u003d\u0027session\u0027)\n\t"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "Refresh Button",
|
||||
"tooltip": {
|
||||
"enabled": true,
|
||||
"location": "bottom-right",
|
||||
"text": "Refresh Data"
|
||||
}
|
||||
},
|
||||
"position": {
|
||||
"shrink": 0
|
||||
},
|
||||
"propConfig": {
|
||||
"props.enabled": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "!isNull({view.params.query_params.bucket})\r\n\u0026\u0026!isNull({view.params.query_params.site})\r\n\u0026\u0026!isNull({view.params.query_params.view})\r\n\u0026\u0026!isNull({view.params.query_params.object_key})"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"image": {
|
||||
"icon": {
|
||||
"path": "material/refresh"
|
||||
}
|
||||
},
|
||||
"primary": false,
|
||||
"style": {
|
||||
"classes": "Input/Button/Secondary_minimal"
|
||||
},
|
||||
"text": ""
|
||||
},
|
||||
"type": "ia.input.button"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer"
|
||||
},
|
||||
"position": {
|
||||
"grow": 1
|
||||
},
|
||||
"props": {
|
||||
"justify": "flex-end"
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer Header"
|
||||
},
|
||||
"position": {
|
||||
"shrink": 0
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"classes": "Framework/Card/Title_transparent",
|
||||
"marginBottom": "2px"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
},
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label"
|
||||
},
|
||||
"position": {
|
||||
"basis": "125px",
|
||||
"shrink": 0
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"classes": "Framework/Card/Label",
|
||||
"textAlign": "right"
|
||||
},
|
||||
"text": "Bucket"
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "Dropdown"
|
||||
},
|
||||
"position": {
|
||||
"basis": "540px",
|
||||
"grow": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.options": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.bucket_options"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.value": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"bidirectional": true,
|
||||
"path": "view.params.query_params.bucket"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"dropdownOptionStyle": {
|
||||
"overflowWrap": "break-word",
|
||||
"whiteSpace": "normal"
|
||||
},
|
||||
"showClearIcon": true
|
||||
},
|
||||
"type": "ia.input.dropdown"
|
||||
},
|
||||
{
|
||||
"events": {
|
||||
"component": {
|
||||
"onActionPerformed": {
|
||||
"config": {
|
||||
"script": "\tself.view.params.query_params.bucket \u003d None\n\t"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "Clear Button"
|
||||
},
|
||||
"position": {
|
||||
"shrink": 0
|
||||
},
|
||||
"propConfig": {
|
||||
"props.enabled": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "!isNull({view.params.query_params.bucket})\r\n\u0026\u0026{view.params.query_params.bucket}!\u003d\u0027\u0027"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"image": {
|
||||
"icon": {
|
||||
"path": "material/clear"
|
||||
}
|
||||
},
|
||||
"primary": false,
|
||||
"style": {
|
||||
"classes": "Input/Button/Secondary_minimal"
|
||||
},
|
||||
"text": ""
|
||||
},
|
||||
"type": "ia.input.button"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "Bucket"
|
||||
},
|
||||
"position": {
|
||||
"basis": "100%",
|
||||
"grow": 1
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"overflow": "hidden"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer_1"
|
||||
},
|
||||
"position": {
|
||||
"shrink": 0
|
||||
},
|
||||
"props": {
|
||||
"justify": "center"
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
},
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label"
|
||||
},
|
||||
"position": {
|
||||
"basis": "125px",
|
||||
"shrink": 0
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"classes": "Framework/Card/Label",
|
||||
"textAlign": "right"
|
||||
},
|
||||
"text": "Site"
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "Dropdown"
|
||||
},
|
||||
"position": {
|
||||
"basis": "540px",
|
||||
"grow": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.enabled": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "!isNull({view.params.query_params.bucket})\r\n\u0026\u0026len({view.params.query_params.bucket})\u003e0"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"props.options": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.whid_options"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.value": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"bidirectional": true,
|
||||
"path": "view.params.query_params.site"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"dropdownOptionStyle": {
|
||||
"overflowWrap": "break-word",
|
||||
"whiteSpace": "normal"
|
||||
},
|
||||
"showClearIcon": true
|
||||
},
|
||||
"type": "ia.input.dropdown"
|
||||
},
|
||||
{
|
||||
"events": {
|
||||
"component": {
|
||||
"onActionPerformed": {
|
||||
"config": {
|
||||
"script": "\tself.view.params.query_params.site \u003d None\n\t"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "Clear Button"
|
||||
},
|
||||
"position": {
|
||||
"shrink": 0
|
||||
},
|
||||
"propConfig": {
|
||||
"props.enabled": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "!isNull({view.params.query_params.site})\r\n\u0026\u0026{view.params.query_params.site}!\u003d\u0027\u0027"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"image": {
|
||||
"icon": {
|
||||
"path": "material/clear"
|
||||
}
|
||||
},
|
||||
"primary": false,
|
||||
"style": {
|
||||
"classes": "Input/Button/Secondary_minimal"
|
||||
},
|
||||
"text": ""
|
||||
},
|
||||
"type": "ia.input.button"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "Site"
|
||||
},
|
||||
"position": {
|
||||
"basis": "100%",
|
||||
"grow": 1
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"overflow": "hidden"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer_2"
|
||||
},
|
||||
"position": {
|
||||
"shrink": 0
|
||||
},
|
||||
"props": {
|
||||
"justify": "center"
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
},
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label"
|
||||
},
|
||||
"position": {
|
||||
"basis": "125px",
|
||||
"shrink": 0
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"classes": "Framework/Card/Label",
|
||||
"textAlign": "right"
|
||||
},
|
||||
"text": "View"
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "Dropdown"
|
||||
},
|
||||
"position": {
|
||||
"basis": "540px",
|
||||
"grow": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.enabled": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "!isNull({view.params.query_params.bucket})\r\n\u0026\u0026len({view.params.query_params.bucket})\u003e0\r\n\u0026\u0026!isNull({view.params.query_params.site})\r\n\u0026\u0026len({view.params.query_params.site})\u003e0"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"props.options": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.view_options_by_site_and_bucket"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.value": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"bidirectional": true,
|
||||
"path": "view.params.query_params.view"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"dropdownOptionStyle": {
|
||||
"overflowWrap": "break-word",
|
||||
"whiteSpace": "normal"
|
||||
},
|
||||
"showClearIcon": true
|
||||
},
|
||||
"type": "ia.input.dropdown"
|
||||
},
|
||||
{
|
||||
"events": {
|
||||
"component": {
|
||||
"onActionPerformed": {
|
||||
"config": {
|
||||
"script": "\tself.view.params.query_params.view \u003d None\n\t"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "Clear Button"
|
||||
},
|
||||
"position": {
|
||||
"shrink": 0
|
||||
},
|
||||
"propConfig": {
|
||||
"props.enabled": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "!isNull({view.params.query_params.view})\r\n\u0026\u0026{view.params.query_params.view}!\u003d\u0027\u0027"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"image": {
|
||||
"icon": {
|
||||
"path": "material/clear"
|
||||
}
|
||||
},
|
||||
"primary": false,
|
||||
"style": {
|
||||
"classes": "Input/Button/Secondary_minimal"
|
||||
},
|
||||
"text": ""
|
||||
},
|
||||
"type": "ia.input.button"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "View"
|
||||
},
|
||||
"position": {
|
||||
"basis": "100%",
|
||||
"grow": 1
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"overflow": "hidden"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer_3"
|
||||
},
|
||||
"position": {
|
||||
"shrink": 0
|
||||
},
|
||||
"props": {
|
||||
"justify": "center"
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
},
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label"
|
||||
},
|
||||
"position": {
|
||||
"basis": "125px",
|
||||
"shrink": 0
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"classes": "Framework/Card/Label",
|
||||
"textAlign": "right"
|
||||
},
|
||||
"text": "Object Key"
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label_0"
|
||||
},
|
||||
"position": {
|
||||
"grow": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.query_params.object_key"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"classes": "Framework/Card/Value",
|
||||
"textAlign": "left"
|
||||
}
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "Object Key"
|
||||
},
|
||||
"position": {
|
||||
"basis": "100%",
|
||||
"grow": 1
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"overflow": "hidden"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer_4"
|
||||
},
|
||||
"position": {
|
||||
"shrink": 0
|
||||
},
|
||||
"props": {
|
||||
"justify": "center"
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"props": {
|
||||
"direction": "column"
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,96 @@
|
||||
# These scripts are use to download data from the igniton project into any file type.
|
||||
|
||||
|
||||
def download_file(filename, data , converter):
|
||||
"""
|
||||
This script will download data from ignition perspective to the users computer.
|
||||
|
||||
Args:
|
||||
filename: The name of the file to be downloaded .
|
||||
data: The data to be downloaded. May be a string, a byte[], or an InputStream. Strings will be written in UTF-8 encoding.
|
||||
converter: This is a function that is used to convert the ignition data into the required format for the file.
|
||||
If not conversion is required then pass a function that just returns original data.
|
||||
|
||||
Returns:
|
||||
None.
|
||||
|
||||
Raises:
|
||||
ValueError: Raises an Value erorr if no data or converter is provided.
|
||||
"""
|
||||
if not data:
|
||||
raise ValueError("No data provided. Data is required to perform download ")
|
||||
|
||||
if not converter:
|
||||
raise ValueError("Please provide a data converter to transform the data")
|
||||
|
||||
_data = converter(data)
|
||||
system.perspective.download(filename, _data)
|
||||
|
||||
def device_data_converter(data):
|
||||
"""
|
||||
This script converts a list of dicts to a dataset, it uses the first dict to set the column headers in the dataset.
|
||||
|
||||
Args:
|
||||
|
||||
data: List of dictionaries.
|
||||
|
||||
Returns:
|
||||
Ignition Data Set
|
||||
|
||||
Raises:
|
||||
None
|
||||
"""
|
||||
dataset = []
|
||||
for index,row in enumerate(data):
|
||||
if index == 0:
|
||||
header = row.keys()
|
||||
row = []
|
||||
for i in header:
|
||||
value = data[index][i]
|
||||
row.append(value)
|
||||
dataset.append(row)
|
||||
|
||||
convert_data = system.dataset.toDataSet(header, dataset)
|
||||
return system.dataset.toCSV(convert_data)
|
||||
|
||||
def detailed_views_converter(data):
|
||||
"""
|
||||
This script converts a list of dicts to a dataset, it uses the first dict to set the column headers in the dataset.
|
||||
|
||||
Args:
|
||||
|
||||
data: List of dictionaries.
|
||||
|
||||
Returns:
|
||||
Ignition Data Set
|
||||
|
||||
Raises:
|
||||
None
|
||||
"""
|
||||
dataset = []
|
||||
for index,row in enumerate(data):
|
||||
if index == 0:
|
||||
header = row.keys()
|
||||
row = []
|
||||
for i in header:
|
||||
if i == "Devices":
|
||||
value = array_to_string(data[index][i])
|
||||
else:
|
||||
value = data[index][i]
|
||||
row.append(value)
|
||||
dataset.append(row)
|
||||
|
||||
convert_data = system.dataset.toDataSet(header, dataset)
|
||||
return system.dataset.toCSV(convert_data)
|
||||
|
||||
def array_to_string(array , deliminator="#"):
|
||||
converted = ""
|
||||
if len(array) == 1:
|
||||
return array[0]
|
||||
for i , value in enumerate(array):
|
||||
converted += value
|
||||
if not i == len(array)-1:
|
||||
converted += deliminator
|
||||
|
||||
|
||||
return converted
|
||||
@ -1,609 +0,0 @@
|
||||
{
|
||||
"custom": {},
|
||||
"params": {
|
||||
"ASdata": "value",
|
||||
"Browser": "Amazon",
|
||||
"Color": 2,
|
||||
"DeviceType": "value",
|
||||
"FolderPath": "Conveyor/",
|
||||
"Variant_Curve_Conv": 90,
|
||||
"Vendor": "value",
|
||||
"Vis_border": true,
|
||||
"tagPath": "NCL1_1A"
|
||||
},
|
||||
"propConfig": {
|
||||
"params.ASdata": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Browser": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Color": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.DeviceType": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.FolderPath": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Variant_Curve_Conv": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Vendor": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Vis_border": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagPath": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 50,
|
||||
"width": 50
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "conveyor curve"
|
||||
},
|
||||
"position": {
|
||||
"basis": "100%"
|
||||
},
|
||||
"propConfig": {
|
||||
"position.display": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if ({view.params.Variant_Curve_Conv} \u003d 90, true, false)"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"props.elements[0].elements[0].style.visibility": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.Vis_border"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": null,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": true,
|
||||
"output": "visible"
|
||||
},
|
||||
{
|
||||
"input": false,
|
||||
"output": "hidden"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.elements[0].elements[1].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.Color"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "#000000",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "#808080"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "#FF8C00"
|
||||
},
|
||||
{
|
||||
"input": 5,
|
||||
"output": "#D900D9"
|
||||
},
|
||||
{
|
||||
"input": 6,
|
||||
"output": "#0000FF"
|
||||
},
|
||||
{
|
||||
"input": 7,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 8,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 9,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 10,
|
||||
"output": "#00D900"
|
||||
},
|
||||
{
|
||||
"input": 11,
|
||||
"output": "#87CEFA"
|
||||
},
|
||||
{
|
||||
"input": 12,
|
||||
"output": "#CCFFCC"
|
||||
},
|
||||
{
|
||||
"input": 13,
|
||||
"output": "#D3D3D3"
|
||||
},
|
||||
{
|
||||
"input": 14,
|
||||
"output": "#AC5F00"
|
||||
},
|
||||
{
|
||||
"input": 100,
|
||||
"output": "#FFFFFF"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if ({view.params.tagPath} \u003d {session.custom.Search},\r\n\"table/SearchTaghighlight\", \"\")"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"d": "M83.5,83.5A83.6,83.6,0,0,1,.5.5h47a36.55,36.55,0,0,0,36,36Z",
|
||||
"fill": {
|
||||
"paint": "#DCDCDC"
|
||||
},
|
||||
"name": "path",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "M47,1A37.06,37.06,0,0,0,83,37V83A83.08,83.08,0,0,1,1,1H47m1-1H0A84.09,84.09,0,0,0,84,84V36A36,36,0,0,1,48,0Z",
|
||||
"fill": {
|
||||
"paint": "#808080"
|
||||
},
|
||||
"name": "path",
|
||||
"type": "path"
|
||||
}
|
||||
],
|
||||
"name": "group",
|
||||
"style": {},
|
||||
"type": "group"
|
||||
},
|
||||
{
|
||||
"d": "M84,40V80A80,80,0,0,1,4,0H44A40,40,0,0,0,84,40Z",
|
||||
"fill": {},
|
||||
"name": "path",
|
||||
"type": "path"
|
||||
}
|
||||
],
|
||||
"name": "group",
|
||||
"type": "group"
|
||||
}
|
||||
],
|
||||
"preserveAspectRatio": "none",
|
||||
"style": {},
|
||||
"viewBox": "0 0 84 84"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "Conveyor_45_part"
|
||||
},
|
||||
"propConfig": {
|
||||
"position.display": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if ({view.params.Variant_Curve_Conv} \u003d 45, true, false)"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"props.elements[0].elements[0].style.visibility": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.Vis_border"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": null,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": true,
|
||||
"output": "visible"
|
||||
},
|
||||
{
|
||||
"input": false,
|
||||
"output": "hidden"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.elements[0].elements[1].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.Color"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "#000000",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "#808080"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "#FF8C00"
|
||||
},
|
||||
{
|
||||
"input": 5,
|
||||
"output": "#D900D9"
|
||||
},
|
||||
{
|
||||
"input": 6,
|
||||
"output": "#0000FF"
|
||||
},
|
||||
{
|
||||
"input": 7,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 8,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 9,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 10,
|
||||
"output": "#00D900"
|
||||
},
|
||||
{
|
||||
"input": 11,
|
||||
"output": "#87CEFA"
|
||||
},
|
||||
{
|
||||
"input": 12,
|
||||
"output": "#CCFFCC"
|
||||
},
|
||||
{
|
||||
"input": 13,
|
||||
"output": "#D3D3D3"
|
||||
},
|
||||
{
|
||||
"input": 14,
|
||||
"output": "#AC5F00"
|
||||
},
|
||||
{
|
||||
"input": 100,
|
||||
"output": "#FFFFFF"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if ({view.params.tagPath} \u003d {session.custom.Search},\r\n\"table/SearchTaghighlight\", \"\")"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"d": "M24.59,58.7a83.9,83.9,0,0,1-12.91-17A83.38,83.38,0,0,1,3.33,21.61,84.13,84.13,0,0,1,.5.5h47a36.58,36.58,0,0,0,1.24,9,36.37,36.37,0,0,0,3.65,8.8,36.39,36.39,0,0,0,5.44,7.21Z",
|
||||
"fill": {
|
||||
"paint": "#DCDCDC"
|
||||
},
|
||||
"name": "path",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "M47,1a37.12,37.12,0,0,0,1.25,8.58A36.93,36.93,0,0,0,52,18.5a37.85,37.85,0,0,0,5.18,7L24.59,58A83.13,83.13,0,0,1,12.12,41.5a82.16,82.16,0,0,1-8.3-20A82.88,82.88,0,0,1,1,1H47m1-1H0A84.41,84.41,0,0,0,2.85,21.74,83.57,83.57,0,0,0,11.25,42,84.26,84.26,0,0,0,24.59,59.41l34-33.95A35.79,35.79,0,0,1,52.82,18a35.78,35.78,0,0,1-3.6-8.68A36.18,36.18,0,0,1,48,0Z",
|
||||
"fill": {
|
||||
"paint": "#808080"
|
||||
},
|
||||
"name": "path",
|
||||
"type": "path"
|
||||
}
|
||||
],
|
||||
"name": "group",
|
||||
"style": {},
|
||||
"type": "group"
|
||||
},
|
||||
{
|
||||
"d": "M49.36,20a39.62,39.62,0,0,1-4-9.65A40.13,40.13,0,0,1,44,0H4A79.9,79.9,0,0,0,6.72,20.71a79.14,79.14,0,0,0,8,19.29A79.72,79.72,0,0,0,27.42,56.58L55.71,28.29A39.84,39.84,0,0,1,49.36,20Z",
|
||||
"fill": {},
|
||||
"name": "path",
|
||||
"type": "path"
|
||||
}
|
||||
],
|
||||
"name": "group",
|
||||
"type": "group"
|
||||
}
|
||||
],
|
||||
"preserveAspectRatio": "none",
|
||||
"style": {},
|
||||
"viewBox": "0 0 58.54 59.41"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "Conveyor_30_part"
|
||||
},
|
||||
"propConfig": {
|
||||
"position.display": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if ({view.params.Variant_Curve_Conv} \u003d 30, true, false)"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"props.elements[0].elements[0].style.visibility": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.Vis_border"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": null,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": true,
|
||||
"output": "visible"
|
||||
},
|
||||
{
|
||||
"input": false,
|
||||
"output": "hidden"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.elements[0].elements[1].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.Color"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "#000000",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "#808080"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "#FF8C00"
|
||||
},
|
||||
{
|
||||
"input": 5,
|
||||
"output": "#D900D9"
|
||||
},
|
||||
{
|
||||
"input": 6,
|
||||
"output": "#0000FF"
|
||||
},
|
||||
{
|
||||
"input": 7,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 8,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 9,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 10,
|
||||
"output": "#00D900"
|
||||
},
|
||||
{
|
||||
"input": 11,
|
||||
"output": "#87CEFA"
|
||||
},
|
||||
{
|
||||
"input": 12,
|
||||
"output": "#CCFFCC"
|
||||
},
|
||||
{
|
||||
"input": 13,
|
||||
"output": "#D3D3D3"
|
||||
},
|
||||
{
|
||||
"input": 14,
|
||||
"output": "#AC5F00"
|
||||
},
|
||||
{
|
||||
"input": 100,
|
||||
"output": "#FFFFFF"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if ({view.params.tagPath} \u003d {session.custom.Search},\r\n\"table/SearchTaghighlight\", \"\")"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"d": "M11.43,41.32a83.36,83.36,0,0,1-8.1-19.71A84.13,84.13,0,0,1,.5.5h47a36.58,36.58,0,0,0,1.24,9,36.33,36.33,0,0,0,3.4,8.36Z",
|
||||
"fill": {
|
||||
"paint": "#DCDCDC"
|
||||
},
|
||||
"name": "path",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "M47,1a37.12,37.12,0,0,0,1.25,8.58,36.93,36.93,0,0,0,3.2,8l-39.84,23a82.58,82.58,0,0,1-7.8-19.16A82.88,82.88,0,0,1,1,1H47m1-1H0A84.41,84.41,0,0,0,2.85,21.74,83.4,83.4,0,0,0,11.25,42L52.82,18a35.78,35.78,0,0,1-3.6-8.68A36.18,36.18,0,0,1,48,0Z",
|
||||
"fill": {
|
||||
"paint": "#808080"
|
||||
},
|
||||
"name": "path",
|
||||
"type": "path"
|
||||
}
|
||||
],
|
||||
"name": "group",
|
||||
"style": {},
|
||||
"type": "group"
|
||||
},
|
||||
{
|
||||
"d": "M45.36,10.35A40.13,40.13,0,0,1,44,0H4A79.9,79.9,0,0,0,6.72,20.71a79.14,79.14,0,0,0,8,19.29L49.36,20A39.62,39.62,0,0,1,45.36,10.35Z",
|
||||
"fill": {},
|
||||
"name": "path",
|
||||
"type": "path"
|
||||
}
|
||||
],
|
||||
"name": "group",
|
||||
"type": "group"
|
||||
}
|
||||
],
|
||||
"preserveAspectRatio": "none",
|
||||
"style": {},
|
||||
"viewBox": "0 0 52.82 42"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root",
|
||||
"tooltip": {
|
||||
"style": {
|
||||
"backgroundColor": "#2B2B2BBF",
|
||||
"color": "#FFFFFF",
|
||||
"fontSize": 12,
|
||||
"textAlign": "left",
|
||||
"white-space": "pre"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"alignContent": "center",
|
||||
"direction": "column",
|
||||
"justify": "center",
|
||||
"style": {
|
||||
"overflow": "visible",
|
||||
"transform": "translate3d(0,0,0)"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 10 KiB |
|
After Width: | Height: | Size: 7.3 KiB |
@ -0,0 +1,537 @@
|
||||
{
|
||||
"custom": {
|
||||
"alarm_message": null,
|
||||
"covert_mode": true,
|
||||
"disconnected": false,
|
||||
"display_icon": true,
|
||||
"error": false,
|
||||
"isMatch": 0,
|
||||
"plc": "value",
|
||||
"priority": 0,
|
||||
"priority_string": "No active alarms",
|
||||
"running_status": 0,
|
||||
"searchId": "value",
|
||||
"state": 5,
|
||||
"state_string": "Unknown"
|
||||
},
|
||||
"params": {
|
||||
"directionLeft": false,
|
||||
"forceFaultStatus": null,
|
||||
"forceRunningStatus": null,
|
||||
"tagProps": [
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value"
|
||||
]
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.alarm_message": {
|
||||
"persistent": true
|
||||
},
|
||||
"custom.covert_mode": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "case(\t{value},\r\n\t\t0, {session.custom.alarm_filter.show_running},\r\n\t\t1, True,\r\n\t\t2, True,\r\n\t\t3, {session.custom.alarm_filter.show_low_alarm},\r\n\t\t4, {session.custom.alarm_filter.show_diagnostic},\r\n\t\t5, {session.custom.alarm_filter.show_running},\r\n\t\tFalse)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.disconnected": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"fc": "{session.custom.fc}",
|
||||
"plc": "{view.custom.plc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{plc}/DCN"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "if(isNull({value}), False, {value})",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.display_icon": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{this.custom.covert_mode}//||{this.custom.isMatch}\u003e0"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.error": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "0 \u003c {value} \u0026\u0026 {value} \u003c 5",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.isMatch": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if({view.params.tagProps[0]}\u003d\"value\",0,\nif({this.custom.searchId}\u003d{view.params.tagProps[0]},100,0))\n\n"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.plc": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.tagProps[0]"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "split({value}, \"/\")[0]",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.priority": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": 0,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 1,
|
||||
"output": 4
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": 3
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": 2
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": 1
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.priority_string": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "case({view.custom.state},\r\n1, \"High\",\r\n2, \"Medium\",\r\n3, \"Low\",\r\n4, \"Diagnostic\",\r\n5, \"No active alarms\",\r\n\"Unknown\")"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.running_status": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value},{view.params.forceRunningStatus},0)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.searchId": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.searchId"
|
||||
},
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.state": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/ALARMST"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"fallback": null,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 4,
|
||||
"output": 1
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": 2
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": 3
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": 4
|
||||
},
|
||||
{
|
||||
"input": 0,
|
||||
"output": 5
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.state_string": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "case({view.custom.running_status},\r\n1, \"Faulted\",\r\n2, \"Stopped\",\r\n3, \"Running\",\r\n\"Unknown\")"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"params.directionLeft": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.forceFaultStatus": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.forceRunningStatus": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagProps": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 100,
|
||||
"width": 100
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "ARSAW"
|
||||
},
|
||||
"position": {
|
||||
"height": 1,
|
||||
"width": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.elements[0].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "if({session.custom.colours}[\"state\"+{value}] \u003d null, \r\n{session.custom.colours}[\"Fallback\"],\r\n{session.custom.colours}[\"state\"+{value}])",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"expression": "if({view.custom.display_icon}\u0026\u0026 {view.custom.isMatch}\u003d0,{value},{value}+\u002700\u0027)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if({session.custom.colours.colour_impaired} \u003d True \u0026\u0026 {view.custom.isMatch} \u003e 0,\r\n{view.custom.state} + 100 + {view.custom.isMatch},\r\n{view.custom.state} + {view.custom.isMatch})"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 101,
|
||||
"output": "State-Styles/State101"
|
||||
},
|
||||
{
|
||||
"input": 102,
|
||||
"output": "State-Styles/State102"
|
||||
},
|
||||
{
|
||||
"input": 103,
|
||||
"output": "State-Styles/State103"
|
||||
},
|
||||
{
|
||||
"input": 104,
|
||||
"output": "State-Styles/State104"
|
||||
},
|
||||
{
|
||||
"input": 105,
|
||||
"output": "State-Styles/State105"
|
||||
},
|
||||
{
|
||||
"input": 106,
|
||||
"output": "State-Styles/State106"
|
||||
},
|
||||
{
|
||||
"input": 201,
|
||||
"output": "State-Styles/State201"
|
||||
},
|
||||
{
|
||||
"input": 202,
|
||||
"output": "State-Styles/State202"
|
||||
},
|
||||
{
|
||||
"input": 203,
|
||||
"output": "State-Styles/State203"
|
||||
},
|
||||
{
|
||||
"input": 204,
|
||||
"output": "State-Styles/State204"
|
||||
},
|
||||
{
|
||||
"input": 205,
|
||||
"output": "State-Styles/State205"
|
||||
}
|
||||
],
|
||||
"outputType": "style-list",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"d": "m 25,50.5 a 25,25 0 0 1 -25,-25 25,25 0 0 1 25,-25 25,25 0 0 1 25,25 25,25 0 0 1 -25,25 z",
|
||||
"fill": {},
|
||||
"name": "Circle",
|
||||
"stroke": {
|
||||
"paint": "#000000",
|
||||
"width": 1
|
||||
},
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "M 8.3000002,34.740002 H 31.04 v 4.26 H 8.3000002 Z M 26.77,12 h 4.260001 V 34.74 H 26.77 Z M 16.110001,12 H 24.64 v 17.049999 h -8.529999 z m 17.059997,0 h 8.53 v 17.049999 h -8.53 z",
|
||||
"fill": {
|
||||
"paint": "#000000"
|
||||
},
|
||||
"name": "ARSAW",
|
||||
"type": "path"
|
||||
}
|
||||
],
|
||||
"style": {},
|
||||
"viewBox": "-0.5 -0.5 51 52"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
}
|
||||
],
|
||||
"events": {
|
||||
"dom": {
|
||||
"onClick": {
|
||||
"config": {
|
||||
"script": "\tsystem.perspective.openDock(\u0027Docked-East\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
},
|
||||
"onDoubleClick": {
|
||||
"config": {
|
||||
"script": "\ttagProps \u003d self.view.params.tagProps\n\tsystem.perspective.openPopup(\"StatusPopUP\", \"PopUp-Views/Controller-Equipment/Information\", params \u003d{\"tagProps\":tagProps})\n\t"
|
||||
},
|
||||
"enabled": false,
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
},
|
||||
"onMouseEnter": {
|
||||
"config": {
|
||||
"script": "\tfrom time import sleep\n\t\n\talarm \u003d []\n\tmessage \u003d None\n\t\n\tsleep(0.5)\n\t\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "root",
|
||||
"tooltip": {
|
||||
"enabled": true,
|
||||
"location": "top-left",
|
||||
"style": {}
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.tooltip.style.backgroundColor": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "case({value},\r\n0,{session.custom.colours.state0},\r\n1,{session.custom.colours.state1},\r\n2,{session.custom.colours.state2},\r\n3,{session.custom.colours.state3},\r\n4,{session.custom.colours.state4},\r\n5,{session.custom.colours.state5},\r\n6,{session.custom.colours.state6},\r\n{session.custom.colours.fallback}\r\n)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"meta.tooltip.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{view.custom.priority}"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "Alarms-Styles/NoAlarm",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 1,
|
||||
"output": "Alarms-Styles/Diagnostic"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "Alarms-Styles/Low"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "Alarms-Styles/Medium"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "Alarms-Styles/High"
|
||||
}
|
||||
],
|
||||
"outputType": "style-list",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"meta.tooltip.style.color": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "if({session.custom.colours.colour_impaired},\r\n\t\u0027#000000\u0027,\r\n\tcase(\t{value},\r\n\t\t\t1,\u0027#FFFFFF\u0027,\r\n\t\t\t2,\u0027#000000\u0027,\r\n\t\t\t3,\u0027#000000\u0027,\r\n\t\t\t4,\u0027#FFFFFF\u0027,\r\n\t\t\t5,\u0027#FFFFFF\u0027,\r\n\t\t\t\u0027#000000\u0027)\r\n\t)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"meta.tooltip.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if({view.custom.disconnected} \u003d False,\n\tif(isNull({view.custom.alarm_message}),\n\t\"Source Id: \" + {view.params.tagProps[0]} +\n\t\", Priority: \" + {view.custom.priority_string} +\n\t\", State: \" + {view.custom.state_string},\n\t\"Source Id: \" + {view.params.tagProps[0]} +\n\t\", Alarm: \" + {view.custom.alarm_message} +\n\t\", Priority: \" + {view.custom.priority_string} +\n\t\", State: \" + {view.custom.state_string}),\n\"Source Id: \" +{view.params.tagProps[0]} + \", Priority: Unknown, State: Unknown\")"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"props.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.disconnected"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "Disconnects/Device-Connected",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": true,
|
||||
"output": "Disconnects/Device-Disconnected"
|
||||
},
|
||||
{
|
||||
"input": false,
|
||||
"output": "Disconnects/Device-Connected"
|
||||
}
|
||||
],
|
||||
"outputType": "style-list",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"aspectRatio": "1:1",
|
||||
"mode": "percent",
|
||||
"style": {
|
||||
"cursor": "pointer"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
{
|
||||
"custom": {},
|
||||
"params": {
|
||||
"text": "value"
|
||||
},
|
||||
"propConfig": {
|
||||
"params.text": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 30,
|
||||
"width": 210
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label"
|
||||
},
|
||||
"position": {
|
||||
"basis": "209px",
|
||||
"grow": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{view.params.text}"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"classes": "Text/LeftAlign_with_Padding"
|
||||
}
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"props": {
|
||||
"alignItems": "center",
|
||||
"justify": "center",
|
||||
"style": {
|
||||
"overflow": "hidden"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 1.7 KiB |
@ -0,0 +1,171 @@
|
||||
{
|
||||
"custom": {
|
||||
"filter_list": [
|
||||
{
|
||||
"color": "#8B008B",
|
||||
"filter_id": 5,
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
},
|
||||
"text": "CP30"
|
||||
},
|
||||
{
|
||||
"color": "#8B008B",
|
||||
"filter_id": 3,
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
},
|
||||
"text": "CP71"
|
||||
},
|
||||
{
|
||||
"color": "#8B008B",
|
||||
"filter_id": 4,
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": ""
|
||||
},
|
||||
"text": "CP72"
|
||||
}
|
||||
]
|
||||
},
|
||||
"params": {
|
||||
"filters": [
|
||||
{
|
||||
"color": "#8B008B",
|
||||
"column": "controller",
|
||||
"group": 0,
|
||||
"id": 3,
|
||||
"text": "CP71"
|
||||
},
|
||||
{
|
||||
"color": "#8B008B",
|
||||
"column": "controller",
|
||||
"group": 0,
|
||||
"id": 4,
|
||||
"text": "CP72"
|
||||
},
|
||||
{
|
||||
"color": "#8B008B",
|
||||
"column": "controller",
|
||||
"group": 0,
|
||||
"id": 5,
|
||||
"text": "CP30"
|
||||
}
|
||||
],
|
||||
"group_name": "value"
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.filter_list": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.filters"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"code": "\tinstances \u003d []\n\tfor filter in value:\n\t\tinstance \u003d {\"instanceStyle\": {\n\t\t \t\t\t\"classes\": \"\"},\n\t\t \t\t\t \"instancePosition\": {}}\n\t \tinstance[\u0027text\u0027] \u003d filter.text\n\t \tinstance[\u0027color\u0027] \u003d filter.color\n\t \tinstance[\u0027filter_id\u0027] \u003d filter.id\n\t \tinstances.append(instance)\n\t\n\treturn sorted(instances, key\u003dlambda d: d[\u0027text\u0027])",
|
||||
"type": "script"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"params.filters": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.group_name": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 178,
|
||||
"width": 214
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Title"
|
||||
},
|
||||
"position": {
|
||||
"basis": "32px"
|
||||
},
|
||||
"propConfig": {
|
||||
"props.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "UPPER({view.params.group_name})"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"borderBottomStyle": "solid",
|
||||
"borderBottomWidth": 1,
|
||||
"classes": "Title/Text",
|
||||
"fontSize": 13,
|
||||
"marginLeft": "10%",
|
||||
"marginRight": "10%",
|
||||
"textAlign": "center"
|
||||
}
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "Filters"
|
||||
},
|
||||
"position": {
|
||||
"basis": "138px",
|
||||
"shrink": 0
|
||||
},
|
||||
"propConfig": {
|
||||
"props.instances": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.filters"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"code": "\treturn sorted(value, key\u003dlambda d: d[\u0027text\u0027])",
|
||||
"type": "script"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"alignContent": "flex-start",
|
||||
"direction": "column",
|
||||
"path": "Objects/PowerTable/FilterMenuItem",
|
||||
"style": {
|
||||
"marginBottom": 5,
|
||||
"marginLeft": "12%",
|
||||
"marginRight": "12%"
|
||||
},
|
||||
"useDefaultViewWidth": false
|
||||
},
|
||||
"type": "ia.display.flex-repeater"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"props": {
|
||||
"direction": "column",
|
||||
"style": {
|
||||
"overflow": "visible"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
{
|
||||
"custom": {},
|
||||
"params": {
|
||||
"color": "#00FF00"
|
||||
},
|
||||
"propConfig": {
|
||||
"params.color": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 20,
|
||||
"width": 20
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"events": {
|
||||
"dom": {
|
||||
"onClick": {
|
||||
"config": {
|
||||
"script": "\tcolor \u003d self.view.params.color\n\tsystem.perspective.sendMessage(messageType\u003d\"color-clicked\", payload\u003d{\"color\":color})"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "Label"
|
||||
},
|
||||
"position": {
|
||||
"basis": "20px",
|
||||
"grow": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.style.backgroundColor": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.color"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"cursor": "pointer"
|
||||
}
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"props": {
|
||||
"direction": "column"
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
}
|
||||
|
After Width: | Height: | Size: 41 KiB |
@ -0,0 +1,11 @@
|
||||
import sys
|
||||
|
||||
def error_handler(whid, logger_name):
|
||||
logger_name = "%s-%s" % (whid, logger_name)
|
||||
logger = system.util.getLogger(logger_name)
|
||||
provider = "[%s_SCADA_TAG_PROVIDER]" % (whid)
|
||||
exc_type, exc_obj, tb = sys.exc_info()
|
||||
lineno = tb.tb_lineno
|
||||
logger.error("Error: %s, %s, %s" % (lineno, exc_type, exc_obj))
|
||||
system.tag.writeBlocking([provider + "System/wbsckt_running"], [0])
|
||||
|
||||
@ -1,267 +0,0 @@
|
||||
{
|
||||
"custom": {},
|
||||
"params": {
|
||||
"ASdata": "value",
|
||||
"Browser": "Amazon",
|
||||
"Color": 10,
|
||||
"DeviceType": "value",
|
||||
"FolderPath": "value",
|
||||
"Vendor": "value",
|
||||
"Visibility": true,
|
||||
"tagPath": "value"
|
||||
},
|
||||
"propConfig": {
|
||||
"params.ASdata": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Browser": {
|
||||
"paramDirection": "output",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Color": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if (tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Alarm/FLT_Disconnect\") \u0026\u0026 tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Alarm/FLT_Motor\"),\r\n 2,\r\n if (tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Alarm/FLT_Motor\") \u0026\u0026 tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Alarm/FLT_Disconnect\") \u003dfalse,\r\n 3,\r\n if (tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Alarm/FLT_Disconnect\") \u0026\u0026 tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Alarm/FLT_Motor\")\u003dfalse,\r\n 0,\r\n 10)))"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"paramDirection": "output",
|
||||
"persistent": true
|
||||
},
|
||||
"params.DeviceType": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.FolderPath": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Vendor": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Visibility": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagPath": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 25,
|
||||
"width": 25
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "VFD"
|
||||
},
|
||||
"position": {
|
||||
"basis": "100%"
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.visible": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{session.custom.show.VFDs} || {view.params.Visibility}"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"props.elements[0].elements[1].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.Color"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "#000000",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "#808080"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "#FF8C00"
|
||||
},
|
||||
{
|
||||
"input": 5,
|
||||
"output": "#D900D9"
|
||||
},
|
||||
{
|
||||
"input": 6,
|
||||
"output": "#0000FF"
|
||||
},
|
||||
{
|
||||
"input": 7,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 8,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 9,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 10,
|
||||
"output": "#00D900"
|
||||
},
|
||||
{
|
||||
"input": 11,
|
||||
"output": "#87CEFA"
|
||||
},
|
||||
{
|
||||
"input": 12,
|
||||
"output": "#CCFFCC"
|
||||
},
|
||||
{
|
||||
"input": 13,
|
||||
"output": "#D3D3D3"
|
||||
},
|
||||
{
|
||||
"input": 14,
|
||||
"output": "#AC5F00"
|
||||
},
|
||||
{
|
||||
"input": 100,
|
||||
"output": "#FFFFFF"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
},
|
||||
{
|
||||
"expression": "if({view.params.Color} \u003d 3, // TODO: Bind fire alarm tags here\r\n if(getSecond(now()) % 2 \u003d 1,\r\n \u0027#FF0000\u0027,\r\n \u0027#00D900\u0027\r\n ),\r\nif({view.params.Color} \u003d 2, // TODO: Bind fire alarm tags here\r\n if(getSecond(now()) % 2 \u003d 1,\r\n \u0027#FF0000\u0027,\r\n \u0027#808080\u0027\r\n ),\r\n\t{value}\r\n))",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if ({view.params.tagPath} \u003d {session.custom.Search},\r\n\"table/SearchTaghighlight\", \"table/highlight\")"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"props.style.transform": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "\"rotate(\" + {session.custom.RotateText} + \"deg)\""
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"d": "M15.14,15.14a50,50,0,0,0,0,70.72L85.86,15.14A50,50,0,0,0,15.14,15.14Z",
|
||||
"name": "path",
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "M85.86,85.86a50,50,0,0,0,0-70.72L15.14,85.86A50,50,0,0,0,85.86,85.86Z",
|
||||
"fill": {},
|
||||
"name": "path",
|
||||
"type": "path"
|
||||
}
|
||||
],
|
||||
"name": "group",
|
||||
"type": "group"
|
||||
}
|
||||
],
|
||||
"preserveAspectRatio": "none",
|
||||
"style": {},
|
||||
"viewBox": "0 0 101 101"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
}
|
||||
],
|
||||
"events": {
|
||||
"dom": {
|
||||
"onClick": {
|
||||
"config": {
|
||||
"draggable": false,
|
||||
"id": "information",
|
||||
"modal": false,
|
||||
"overlayDismiss": false,
|
||||
"resizable": false,
|
||||
"showCloseIcon": false,
|
||||
"type": "open",
|
||||
"viewParams": {
|
||||
"ASdata": "{view.params.ASdata}",
|
||||
"Browser": "{view.params.Browser}",
|
||||
"DeviceType": "{view.params.DeviceType}",
|
||||
"FolderPath": "{view.params.FolderPath}",
|
||||
"Vendor": "{view.params.Vendor}",
|
||||
"tagPath": "{view.params.tagPath}"
|
||||
},
|
||||
"viewPath": "Windows/Information/Information",
|
||||
"viewportBound": false
|
||||
},
|
||||
"scope": "C",
|
||||
"type": "popup"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "root",
|
||||
"tooltip": {
|
||||
"enabled": true,
|
||||
"style": {
|
||||
"backgroundColor": "#2B2B2BBF",
|
||||
"color": "#FFFFFF",
|
||||
"fontSize": 12,
|
||||
"textAlign": "left",
|
||||
"white-space": "pre"
|
||||
}
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.tooltip.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "replace({view.params.tagPath}, \"_\", \"-\")+\r\n\"\\nStatus: \"+ \r\nif ({view.params.ASdata} \u003d \"VFD\",\r\n\t(if (tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Alarm/FLT_Disconnect\") \u0026\u0026 \r\n\t\ttag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Alarm/FLT_Motor\"),\r\n\t \"Faulted/Disconnect\",\r\n\t if(tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Alarm/FLT_Motor\"),\r\n\t \t\"Faulted/OK\",\r\n\t if (tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Alarm/FLT_Disconnect\"),\r\n\t \t\"Disconnect\",\r\n\t \"OK\")))),\r\n\r\n\t\"nor response\")"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"direction": "column",
|
||||
"justify": "center",
|
||||
"style": {
|
||||
"cursor": "pointer",
|
||||
"transform": "translate3d(0,0,0)"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,604 @@
|
||||
{
|
||||
"custom": {
|
||||
"FillColour": "value",
|
||||
"alarm_message": null,
|
||||
"covert_mode": true,
|
||||
"disconnected": false,
|
||||
"display_icon": true,
|
||||
"error": false,
|
||||
"isMatch": 0,
|
||||
"plc": "value",
|
||||
"priority": 0,
|
||||
"priority_string": "No active alarms",
|
||||
"running": false,
|
||||
"running_status": 0,
|
||||
"searchId": "value",
|
||||
"show_error": false,
|
||||
"show_running": true,
|
||||
"state": 5,
|
||||
"state_string": "Unknown"
|
||||
},
|
||||
"params": {
|
||||
"forceFaultStatus": null,
|
||||
"forceRunningStatus": null,
|
||||
"tagProps": [
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value"
|
||||
]
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.FillColour": {
|
||||
"persistent": true
|
||||
},
|
||||
"custom.alarm_message": {
|
||||
"persistent": true
|
||||
},
|
||||
"custom.covert_mode": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "case(\t{value},\r\n\t\t0, {session.custom.alarm_filter.show_running},\r\n\t\t1, True,\r\n\t\t2, True,\r\n\t\t3, {session.custom.alarm_filter.show_low_alarm} || {session.custom.alarm_filter.show_running},\r\n\t\t4, {session.custom.alarm_filter.show_diagnostic} || {session.custom.alarm_filter.show_running},\r\n\t\t5, {session.custom.alarm_filter.show_running},\r\n\t\tFalse)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.disconnected": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"fc": "{session.custom.fc}",
|
||||
"plc": "{view.custom.plc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{plc}/DCN"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "if(isNull({value}), False, {value})",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.display_icon": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{this.custom.covert_mode}//||{this.custom.isMatch}\u003e0"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.error": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "0 \u003c {value} \u0026\u0026 {value} \u003c 5",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.isMatch": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if({view.params.tagProps[0]}\u003d\"value\",0,\nif({this.custom.searchId}\u003d{view.params.tagProps[0]},100,0))"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.plc": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.tagProps[0]"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "split({value}, \"/\")[0]",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.priority": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": 0,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 1,
|
||||
"output": 4
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": 3
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": 2
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": 1
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.priority_string": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "case({view.custom.state},\r\n1, \"High\",\r\n2, \"Medium\",\r\n3, \"Low\",\r\n4, \"Diagnostic\",\r\n5, \"No active alarms\",\r\n\"Unknown\")"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.running": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{view.custom.running_status} \u003d 3"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.running_status": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/STATE"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value},{view.params.forceRunningStatus},0)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.searchId": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.searchId"
|
||||
},
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.show_error": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "case(\t{value},\r\n\t\t1, True,\r\n\t\t2, True,\r\n\t\t3, {session.custom.alarm_filter.show_low_alarm},\r\n\t\t4, {session.custom.alarm_filter.show_diagnostic},\r\n\t\tFalse)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.show_running": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "case(\t{value},\r\n\t\t1, False,\r\n\t\t2, False,\r\n\t\t{session.custom.alarm_filter.show_running}\r\n\t\t)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.state": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "indirect",
|
||||
"references": {
|
||||
"0": "{view.params.tagProps[0]}",
|
||||
"fc": "{session.custom.fc}"
|
||||
},
|
||||
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/ALARMST"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"fallback": null,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 4,
|
||||
"output": 1
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": 2
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": 3
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": 4
|
||||
},
|
||||
{
|
||||
"input": 0,
|
||||
"output": 5
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.state_string": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "case({view.custom.running_status},\r\n1, \"Faulted\",\r\n2, \"Stopped\",\r\n3, \"Running\",\r\n\"Unknown\")"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"params.forceFaultStatus": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.forceRunningStatus": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagProps": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 100,
|
||||
"width": 100
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Photocell (Lift)"
|
||||
},
|
||||
"position": {
|
||||
"height": 1,
|
||||
"width": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.elements[1].elements[0].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "case({value},\r\n0,{session.custom.colours.state0},\r\n1,{session.custom.colours.state1},\r\n2,{session.custom.colours.state2},\r\n3,{session.custom.colours.state3},\r\n4,{session.custom.colours.state4},\r\n5,{session.custom.colours.state5},\r\n6,{session.custom.colours.state6},\r\n{session.custom.colours.fallback}\r\n)",
|
||||
"type": "expression"
|
||||
},
|
||||
{
|
||||
"expression": "if({view.custom.display_icon}\u0026\u0026 {view.custom.isMatch}\u003d0,{value},{value}+\u002700\u0027)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if({session.custom.colours.colour_impaired} \u003d True \u0026\u0026 {view.custom.isMatch} \u003e 0,\r\n{view.custom.state} + 100 + {view.custom.isMatch},\r\n{view.custom.state} + {view.custom.isMatch})"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 101,
|
||||
"output": "State-Styles/State101"
|
||||
},
|
||||
{
|
||||
"input": 102,
|
||||
"output": "State-Styles/State102"
|
||||
},
|
||||
{
|
||||
"input": 103,
|
||||
"output": "State-Styles/State103"
|
||||
},
|
||||
{
|
||||
"input": 104,
|
||||
"output": "State-Styles/State104"
|
||||
},
|
||||
{
|
||||
"input": 105,
|
||||
"output": "State-Styles/State105"
|
||||
},
|
||||
{
|
||||
"input": 106,
|
||||
"output": "State-Styles/State106"
|
||||
},
|
||||
{
|
||||
"input": 202,
|
||||
"output": "State-Styles/State201"
|
||||
},
|
||||
{
|
||||
"input": 201,
|
||||
"output": "State-Styles/State202"
|
||||
},
|
||||
{
|
||||
"input": 203,
|
||||
"output": "State-Styles/State203"
|
||||
},
|
||||
{
|
||||
"input": 204,
|
||||
"output": "State-Styles/State204"
|
||||
},
|
||||
{
|
||||
"input": 205,
|
||||
"output": "State-Styles/State205"
|
||||
}
|
||||
],
|
||||
"outputType": "style-list",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"id": "defs1",
|
||||
"name": "defs1",
|
||||
"type": "defs"
|
||||
},
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"cx": "6.6145835",
|
||||
"cy": "6.6145835",
|
||||
"fill": {},
|
||||
"id": "path1",
|
||||
"name": "path1",
|
||||
"r": "6.0761814",
|
||||
"stroke": {
|
||||
"dasharray": "none",
|
||||
"paint": "#000000",
|
||||
"width": "0.264583"
|
||||
},
|
||||
"type": "circle"
|
||||
},
|
||||
{
|
||||
"cx": "6.6145835",
|
||||
"cy": "6.6145835",
|
||||
"fill": {
|
||||
"opacity": "1",
|
||||
"paint": "#000000"
|
||||
},
|
||||
"id": "path2",
|
||||
"name": "path2",
|
||||
"rx": "0.5251264",
|
||||
"ry": "0.52512622",
|
||||
"stroke": {
|
||||
"dasharray": "none",
|
||||
"paint": "#000000",
|
||||
"width": "0.272664"
|
||||
},
|
||||
"type": "ellipse"
|
||||
}
|
||||
],
|
||||
"id": "layer1",
|
||||
"name": "layer1",
|
||||
"type": "group"
|
||||
}
|
||||
],
|
||||
"style": {},
|
||||
"viewBox": "0 0 13.229166 13.229167"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
}
|
||||
],
|
||||
"events": {
|
||||
"dom": {
|
||||
"onClick": {
|
||||
"config": {
|
||||
"script": "\tsystem.perspective.openDock(\u0027Docked-East\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps})"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
},
|
||||
"onDoubleClick": {
|
||||
"config": {
|
||||
"script": "\ttagProps \u003d self.view.params.tagProps\n\tsystem.perspective.openPopup(\"StatusPopUP\", \"PopUp-Views/Controller-Equipment/Information\", params \u003d{\"tagProps\":tagProps})\n\t"
|
||||
},
|
||||
"enabled": false,
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
},
|
||||
"onMouseEnter": {
|
||||
"config": {
|
||||
"script": "\tfrom time import sleep\n\t\n\talarm \u003d []\n\tmessage \u003d None\n\t\n\tsleep(0.5)\n\t\n\tif system.tag.exists(\"System/aws_data\"):\n\t\tif self.view.params.tagProps[0] !\u003d \"\":\n\t\t\ttags_to_read \u003d system.tag.readBlocking(\"System/aws_data\")\n\t\t\tdecode_alarm_data \u003d system.util.jsonDecode(tags_to_read[0].value)\n\t\t\talarm \u003d [decode_alarm_data[i] for i in decode_alarm_data\n\t\t\t\t\tif decode_alarm_data[i][\u0027sourceId\u0027].startswith(self.view.params.tagProps[0])]\n\t\tif alarm:\n\t\t\talarm \u003d sorted(alarm, key \u003d lambda t:t[\u0027timestamp\u0027], reverse\u003dTrue)\n\t\t\tmessage \u003d max(alarm, key \u003d lambda p:p[\u0027priority\u0027]).get(\u0027message\u0027)\n\t\t\tif len(alarm) \u003e 1:\n\t\t\t\tmessage +\u003d \" (+\" + str(len(alarm)-1) + \")\"\n\tself.view.custom.alarm_message \u003d message"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "root",
|
||||
"tooltip": {
|
||||
"enabled": true,
|
||||
"location": "top-left",
|
||||
"style": {}
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.tooltip.style.backgroundColor": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "case({value},\r\n0,{session.custom.colours.state0},\r\n1,{session.custom.colours.state1},\r\n2,{session.custom.colours.state2},\r\n3,{session.custom.colours.state3},\r\n4,{session.custom.colours.state4},\r\n5,{session.custom.colours.state5},\r\n6,{session.custom.colours.state6},\r\n{session.custom.colours.fallback}\r\n)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"meta.tooltip.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{view.custom.priority}"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "Alarms-Styles/NoAlarm",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 1,
|
||||
"output": "Alarms-Styles/Diagnostic"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "Alarms-Styles/Low"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "Alarms-Styles/Medium"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "Alarms-Styles/High"
|
||||
}
|
||||
],
|
||||
"outputType": "style-list",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"meta.tooltip.style.color": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.state"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"expression": "if({session.custom.colours.colour_impaired},\r\n\t\u0027#000000\u0027,\r\n\tcase(\t{value},\r\n\t\t\t1,\u0027#FFFFFF\u0027,\r\n\t\t\t2,\u0027#000000\u0027,\r\n\t\t\t3,\u0027#000000\u0027,\r\n\t\t\t4,\u0027#FFFFFF\u0027,\r\n\t\t\t5,\u0027#FFFFFF\u0027,\r\n\t\t\t\u0027#000000\u0027)\r\n\t)",
|
||||
"type": "expression"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"meta.tooltip.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if({view.custom.disconnected} \u003d False,\n\tif(isNull({view.custom.alarm_message}),\n\t\"Source Id: \" + {view.params.tagProps[0]} +\n\t\", Priority: \" + {view.custom.priority_string} +\n\t\", State: \" + {view.custom.state_string},\n\t\"Source Id: \" + {view.params.tagProps[0]} +\n\t\", Alarm: \" + {view.custom.alarm_message} +\n\t\", Priority: \" + {view.custom.priority_string} +\n\t\", State: \" + {view.custom.state_string}),\n\"Source Id: \" +{view.params.tagProps[0]} + \", Priority: Unknown, State: Unknown\")"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"props.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.disconnected"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "Disconnects/Device-Connected",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": true,
|
||||
"output": "Disconnects/Device-Disconnected"
|
||||
},
|
||||
{
|
||||
"input": false,
|
||||
"output": "Disconnects/Device-Connected"
|
||||
}
|
||||
],
|
||||
"outputType": "style-list",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"aspectRatio": "1:1",
|
||||
"mode": "percent",
|
||||
"style": {
|
||||
"cursor": "pointer"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
import json
|
||||
|
||||
class SendMessage():
|
||||
|
||||
def __init__(self, whid):
|
||||
self.whid = whid
|
||||
tag_path = "[%s_SCADA_TAG_PROVIDER]System/wbsckt_messages_send" % (whid)
|
||||
tags_to_read = system.tag.readBlocking([tag_path])
|
||||
self.messages_to_send = system.util.jsonDecode(tags_to_read[0].value)
|
||||
system.tag.writeBlocking([tag_path],[system.util.jsonEncode({})])
|
||||
self.message_list = {}
|
||||
|
||||
def build_message_list(self):
|
||||
if self.messages_to_send:
|
||||
self.message_list = json.dumps(self.messages_to_send)
|
||||
else:
|
||||
self.message_list = None
|
||||
|
||||
|
||||
|
||||
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1,34 @@
|
||||
def show_alarm_from_docked_window(self,event):
|
||||
#Get the alarm properties from the alarm object.
|
||||
"""
|
||||
Displays the currently active alarm from the south docked alarm table in the detailed view.
|
||||
If the alarm is on a different page to the current page the function will navigate the user
|
||||
to the correct page and show the alarm.
|
||||
|
||||
Args:
|
||||
self: Refrence to the object thats invoking this function.
|
||||
event: Refrence to the event that is invoking this function.
|
||||
|
||||
Returns:
|
||||
The fucntion doses not return any values.
|
||||
|
||||
Raises:
|
||||
KeyError: None
|
||||
"""
|
||||
|
||||
|
||||
alarm_id = event.value.get("AlarmId")
|
||||
tags_to_read = system.tag.readBlocking(["System/ActiveAlarms"])
|
||||
active_alarms = system.util.jsonDecode(tags_to_read[0].value)
|
||||
UDT = active_alarms.get(alarm_id,{}).get("UDT_tag")
|
||||
plc = UDT.split("_")[0]
|
||||
name = active_alarms.get(alarm_id,{}).get("Name")
|
||||
page_id = active_alarms.get(alarm_id,{}).get("PageId","None")
|
||||
display_path = active_alarms.get(alarm_id,{}).get("DisplayPath")
|
||||
|
||||
#Set the session custom variables to highlight the selected alarm.
|
||||
self.session.custom.searchId = UDT
|
||||
self.session.custom.deviceSearchId = display_path
|
||||
|
||||
url_to_navigate = "/DetailedView/%s/%s" % (page_id, plc)
|
||||
system.perspective.navigate(page = url_to_navigate)
|
||||
@ -0,0 +1,431 @@
|
||||
{
|
||||
"custom": {
|
||||
"box_shadow": "0px 2px 4px rgba(0, 0, 40, 0.15)",
|
||||
"expanded": true,
|
||||
"show_content": true
|
||||
},
|
||||
"events": {
|
||||
"system": {
|
||||
"onStartup": {
|
||||
"config": {
|
||||
"script": "\tself.custom.expanded \u003d self.params.open_expanded\n\t"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"anchor_position": null,
|
||||
"content_shown": true,
|
||||
"open_expanded": true,
|
||||
"params": {},
|
||||
"path": "Objects/Templates/S3/Management/file",
|
||||
"show_box_shadow_on_expanded": true,
|
||||
"title": "Card Title",
|
||||
"useDefaultHeight": false,
|
||||
"useDefaultWidth": false
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.box_shadow": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if(\r\n\t{view.params.show_box_shadow_on_expanded}\u0026\u0026{view.custom.expanded},\r\n\t\u00270px 2px 4px rgba(0, 0, 40, 0.15)\u0027,\r\n\t\u0027\u0027\r\n)"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"persistent": true
|
||||
},
|
||||
"custom.expanded": {
|
||||
"persistent": true
|
||||
},
|
||||
"custom.show_content": {
|
||||
"persistent": true
|
||||
},
|
||||
"params.address": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.anchor_position": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.content_shown": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.show_content"
|
||||
},
|
||||
"type": "property"
|
||||
},
|
||||
"paramDirection": "output",
|
||||
"persistent": true
|
||||
},
|
||||
"params.open_expanded": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.params": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.path": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.show_box_shadow_on_expanded": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.system": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.title": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.useDefaultHeight": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.useDefaultWidth": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 600,
|
||||
"width": 500
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"events": {
|
||||
"component": {
|
||||
"onActionPerformed": {
|
||||
"config": {
|
||||
"script": "\t# toggle \u0027show_content\u0027 view custom prop\n\tself.view.custom.show_content \u003d not self.view.custom.show_content"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "Button"
|
||||
},
|
||||
"position": {
|
||||
"shrink": 0
|
||||
},
|
||||
"propConfig": {
|
||||
"props.image.icon.path": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if({view.custom.show_content},\"material/chevron_left\",\"material/chevron_right\")"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"image": {
|
||||
"icon": {}
|
||||
},
|
||||
"primary": false,
|
||||
"style": {
|
||||
"borderStyle": "none",
|
||||
"classes": "Input/Button/Secondary_minimal"
|
||||
},
|
||||
"text": ""
|
||||
},
|
||||
"type": "ia.input.button"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer Anchor Left"
|
||||
},
|
||||
"position": {
|
||||
"shrink": 0
|
||||
},
|
||||
"propConfig": {
|
||||
"position.display": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{view.params.anchor_position}\u003d\u0027left\u0027"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"direction": "column",
|
||||
"style": {
|
||||
"classes": "Framework/Card/Title_transparent",
|
||||
"margin": "0px",
|
||||
"padding": "0px"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
},
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label"
|
||||
},
|
||||
"position": {
|
||||
"grow": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.title"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"classes": "Framework/Card/Title_transparent"
|
||||
}
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
},
|
||||
{
|
||||
"events": {
|
||||
"component": {
|
||||
"onActionPerformed": {
|
||||
"config": {
|
||||
"script": "\tself.view.custom.expanded \u003d not self.view.custom.expanded"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "Button"
|
||||
},
|
||||
"propConfig": {
|
||||
"props.image.icon.path": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if({view.custom.expanded}, \u0027material/expand_less\u0027, \u0027material/expand_more\u0027)"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"image": {
|
||||
"icon": {}
|
||||
},
|
||||
"primary": false,
|
||||
"style": {
|
||||
"classes": "Input/Button/Secondary_minimal"
|
||||
},
|
||||
"text": ""
|
||||
},
|
||||
"type": "ia.input.button"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer"
|
||||
},
|
||||
"position": {
|
||||
"basis": "24px",
|
||||
"shrink": 0
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "EmbeddedView"
|
||||
},
|
||||
"position": {
|
||||
"shrink": 0
|
||||
},
|
||||
"propConfig": {
|
||||
"position.display": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.expanded"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.params": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.params"
|
||||
},
|
||||
"overlayOptOut": true,
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.path": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.path"
|
||||
},
|
||||
"overlayOptOut": true,
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.useDefaultViewHeight": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.useDefaultHeight"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.useDefaultViewWidth": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.useDefaultWidth"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"classes": "Framework/Card/Embedded_transparent"
|
||||
}
|
||||
},
|
||||
"type": "ia.display.view"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer"
|
||||
},
|
||||
"position": {
|
||||
"basis": "100%",
|
||||
"grow": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"position.display": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.show_content"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"direction": "column",
|
||||
"style": {
|
||||
"overflow": "hidden"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
},
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"events": {
|
||||
"component": {
|
||||
"onActionPerformed": {
|
||||
"config": {
|
||||
"script": "\t# toggle \u0027show_content\u0027 view custom prop\n\tself.view.custom.show_content \u003d not self.view.custom.show_content"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "Button"
|
||||
},
|
||||
"position": {
|
||||
"shrink": 0
|
||||
},
|
||||
"propConfig": {
|
||||
"props.image.icon.path": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if({view.custom.show_content},\"material/chevron_right\",\"material/chevron_left\")"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"image": {
|
||||
"icon": {}
|
||||
},
|
||||
"primary": false,
|
||||
"style": {
|
||||
"borderStyle": "none"
|
||||
},
|
||||
"text": ""
|
||||
},
|
||||
"type": "ia.input.button"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer Anchor Right"
|
||||
},
|
||||
"position": {
|
||||
"shrink": 0
|
||||
},
|
||||
"propConfig": {
|
||||
"position.display": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{view.params.anchor_position}\u003d\u0027right\u0027"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"direction": "column",
|
||||
"style": {
|
||||
"classes": "Framework/Card/Title_transparent",
|
||||
"margin": "0px",
|
||||
"padding": "0px"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"propConfig": {
|
||||
"props.justify": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if({view.params.anchor_position}\u003d\u0027right\u0027,\u0027flex-end\u0027,\u0027flex-start\u0027)"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"props.style.boxShadow": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.box_shadow"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"classes": "Framework/Card/Card_transparent"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
}
|
||||
@ -1,226 +0,0 @@
|
||||
{
|
||||
"custom": {
|
||||
"Color": 6
|
||||
},
|
||||
"params": {
|
||||
"Color": 6,
|
||||
"Vis_border": true,
|
||||
"tagPath": "NCL1_1A"
|
||||
},
|
||||
"propConfig": {
|
||||
"params.Color": {
|
||||
"paramDirection": "inout"
|
||||
},
|
||||
"params.Vis_border": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagPath": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 18,
|
||||
"width": 41
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Conveyor_part1"
|
||||
},
|
||||
"position": {
|
||||
"basis": "18px"
|
||||
},
|
||||
"propConfig": {
|
||||
"props.elements[0].elements[0].style.visibility": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.Vis_border"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": null,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": true,
|
||||
"output": "visible"
|
||||
},
|
||||
{
|
||||
"input": false,
|
||||
"output": "hidden"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.elements[0].elements[1].style.visibility": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.Vis_border"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": null,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": true,
|
||||
"output": "visible"
|
||||
},
|
||||
{
|
||||
"input": false,
|
||||
"output": "hidden"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.elements[0].elements[2].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.Color"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "#000000",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "#808080"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "#FF8C00"
|
||||
},
|
||||
{
|
||||
"input": 5,
|
||||
"output": "#D900D9"
|
||||
},
|
||||
{
|
||||
"input": 6,
|
||||
"output": "#0000FF"
|
||||
},
|
||||
{
|
||||
"input": 7,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 8,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 9,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 10,
|
||||
"output": "#00D900"
|
||||
},
|
||||
{
|
||||
"input": 11,
|
||||
"output": "#87CEFA"
|
||||
},
|
||||
{
|
||||
"input": 12,
|
||||
"output": "#CCFFCC"
|
||||
},
|
||||
{
|
||||
"input": 13,
|
||||
"output": "#D3D3D3"
|
||||
},
|
||||
{
|
||||
"input": 14,
|
||||
"output": "#AC5F00"
|
||||
},
|
||||
{
|
||||
"input": 100,
|
||||
"output": "#FFFFFF"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"d": "M2.85,21.74A84.41,84.41,0,0,1,0,0H48a36.24,36.24,0,0,0,1.22,9.32Z",
|
||||
"fill": {
|
||||
"paint": "#808080"
|
||||
},
|
||||
"name": "path",
|
||||
"style": {},
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "M3.82,21.48A83.28,83.28,0,0,1,1,0H47a36.89,36.89,0,0,0,1.26,9.58Z",
|
||||
"fill": {
|
||||
"paint": "#DCDCDC"
|
||||
},
|
||||
"name": "path",
|
||||
"style": {},
|
||||
"type": "path"
|
||||
},
|
||||
{
|
||||
"d": "M44,0H4A79.9,79.9,0,0,0,6.72,20.71L45.36,10.35A40.13,40.13,0,0,1,44,0Z",
|
||||
"fill": {},
|
||||
"name": "path",
|
||||
"type": "path"
|
||||
}
|
||||
],
|
||||
"name": "group",
|
||||
"type": "group"
|
||||
}
|
||||
],
|
||||
"preserveAspectRatio": "none",
|
||||
"viewBox": "0 0 49.22 21.74"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"props": {
|
||||
"alignContent": "center",
|
||||
"direction": "column",
|
||||
"justify": "center",
|
||||
"style": {
|
||||
"overflow": "visible"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,118 @@
|
||||
from urllib2_aws4auth import aws_urlopen, Request
|
||||
from urllib2 import HTTPError
|
||||
from urllib import urlencode
|
||||
import json
|
||||
import system
|
||||
import boto3
|
||||
from pprint import pformat
|
||||
|
||||
REGION ='us-west-2'
|
||||
|
||||
|
||||
def openSession():
|
||||
CREDS = boto3.Session().get_credentials()
|
||||
AWS_ACCESS_KEY_ID = CREDS.access_key
|
||||
AWS_SECRET_ACCESS_KEY = CREDS.secret_key
|
||||
TOKEN = CREDS.token
|
||||
CREDSRETURN = {'AccessKeyId':AWS_ACCESS_KEY_ID,
|
||||
'SecretAccessKey':AWS_SECRET_ACCESS_KEY,
|
||||
'SessionToken':TOKEN}
|
||||
# OPENER = aws_urlopen(
|
||||
# AWS_ACCESS_KEY_ID,
|
||||
# AWS_SECRET_ACCESS_KEY,
|
||||
# REGION,
|
||||
# SERVICE,
|
||||
# session_token=TOKEN,
|
||||
# verify=False)
|
||||
# return OPENER
|
||||
|
||||
return CREDSRETURN
|
||||
|
||||
|
||||
def DynamoReader():
|
||||
import json
|
||||
from pprint import pformat
|
||||
import boto3
|
||||
from datetime import datetime
|
||||
from decimal import Decimal
|
||||
import time
|
||||
|
||||
LOGGER = system.util.getLogger('notify_to_dynamodb_log')
|
||||
|
||||
# Get STAGE variable
|
||||
roleArn = 'arn:aws:iam::533266954132:role/ignition_to_aws_scada_notify'
|
||||
STAGE = 'beta'
|
||||
# Make sure STAGE is valid. no gamma stage configured
|
||||
if STAGE not in ['alpha', 'beta', 'gamma', 'prod']:
|
||||
STAGE = 'beta'
|
||||
if STAGE == 'gamma':
|
||||
STAGE = 'beta'
|
||||
|
||||
STAGE_CONFIG = {
|
||||
'alpha':{
|
||||
'region' : 'us-west-2',
|
||||
'roleArn' : roleArn,
|
||||
'tableName' : 'NotificationsEntries'
|
||||
},
|
||||
'beta': {
|
||||
'region':'us-west-2',
|
||||
'roleArn': roleArn,
|
||||
'tableName' : 'NotificationsEntries'
|
||||
|
||||
},
|
||||
'prod': {
|
||||
'region':'us-west-2',
|
||||
'roleArn': roleArn,
|
||||
'tableName' : 'NotificationsEntries'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
# create sts session to get credentials from EC2
|
||||
sts_client = boto3.client('sts')
|
||||
region_name = STAGE_CONFIG.get(STAGE, 'alpha').get('region', 'us-west-2')
|
||||
|
||||
assume_role_response = sts_client.assume_role(
|
||||
RoleArn = STAGE_CONFIG.get(STAGE, 'beta').get('roleArn', roleArn),
|
||||
RoleSessionName = 'AssumeRole'
|
||||
)
|
||||
|
||||
temp_credentials = assume_role_response['Credentials']
|
||||
|
||||
# create session using the temp creds
|
||||
b3_session = boto3.Session(
|
||||
aws_access_key_id = temp_credentials['AccessKeyId'],
|
||||
aws_secret_access_key = temp_credentials['SecretAccessKey'],
|
||||
aws_session_token = temp_credentials['SessionToken'],
|
||||
region_name = 'us-west-2',
|
||||
)
|
||||
|
||||
# create a dynamodb session
|
||||
dynamodb = b3_session.resource('dynamodb')
|
||||
table = dynamodb.Table(STAGE_CONFIG.get(STAGE, 'beta').get('tableName', 'NotificationsEntries'))
|
||||
# response = client.scan(
|
||||
# TableName='string',
|
||||
# IndexName='string',
|
||||
# AttributesToGet=[
|
||||
# 'string',
|
||||
# ],
|
||||
# Limit=123,
|
||||
|
||||
# write data directly to dynamodb table
|
||||
try:
|
||||
response = table.scan()
|
||||
# response = table.scan(ProjectionExpression="PrimaryKey, publish, expire, title")
|
||||
# TableName='NotificationsEntries',
|
||||
# IndexName='publish',
|
||||
## ProjectionExpression =['publish', 'expire', 'title'],
|
||||
# Limit=123)
|
||||
# system.perspective.print(response)
|
||||
system.perspective.print('Read from NotificationsEntries DynamoDB Table Successful')
|
||||
except Exception as e:
|
||||
system.perspective.print('Read from NotificationsEntries DynamoDB Table NOT Successful')
|
||||
system.perspective.print(str(e))
|
||||
LOGGER.error(str(e))
|
||||
|
||||
|
||||
return response
|
||||
|
||||
|
After Width: | Height: | Size: 231 B |
@ -0,0 +1,151 @@
|
||||
{
|
||||
"custom": {},
|
||||
"params": {
|
||||
"address": "test",
|
||||
"params": {},
|
||||
"path": "",
|
||||
"system": {},
|
||||
"title": "Card Title",
|
||||
"useDefaultHeight": false,
|
||||
"useDefaultWidth": false
|
||||
},
|
||||
"propConfig": {
|
||||
"params.address": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.params": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.path": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.system": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.title": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.useDefaultHeight": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.useDefaultWidth": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 339,
|
||||
"width": 369
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label"
|
||||
},
|
||||
"position": {
|
||||
"basis": "20px",
|
||||
"shrink": 0
|
||||
},
|
||||
"propConfig": {
|
||||
"props.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.title"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"classes": "Framework/Card/Title"
|
||||
}
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "EmbeddedView"
|
||||
},
|
||||
"position": {
|
||||
"shrink": 0
|
||||
},
|
||||
"propConfig": {
|
||||
"props.params": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.params"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.params.address": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.address"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.params.system": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.system"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.path": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.path"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.useDefaultViewHeight": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.useDefaultHeight"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.useDefaultViewWidth": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.useDefaultWidth"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"classes": "Framework/Card/Embedded"
|
||||
}
|
||||
},
|
||||
"type": "ia.display.view"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"props": {
|
||||
"direction": "column",
|
||||
"style": {
|
||||
"classes": "Framework/Card/Card"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 58 KiB |
@ -0,0 +1,54 @@
|
||||
import time
|
||||
|
||||
def close_websckt():
|
||||
"""
|
||||
This function disconnects the web socket and exits any loops.
|
||||
Should be called when a project is saved or modified to stop
|
||||
multiple threads running.
|
||||
|
||||
Args:
|
||||
None
|
||||
|
||||
Returns:
|
||||
N/A
|
||||
|
||||
Raises:
|
||||
N/A
|
||||
"""
|
||||
|
||||
fc = system.tag.readBlocking(["Configuration/FC"])
|
||||
fc_value = fc[0].value
|
||||
tag_provider = "[%s_SCADA_TAG_PROVIDER]" % (fc_value)
|
||||
system.tag.writeBlocking([tag_provider + "System/close_socket"],[0])
|
||||
running = system.util.getGlobals().get(fc_value, {}).get("wbsckt_running", 0)
|
||||
if running:
|
||||
system.util.getGlobals()[fc_value]["wbsckt_running"] = False
|
||||
system.tag.writeBlocking(tag_provider + "System/wbsckt_running", [0])
|
||||
time.sleep(2)
|
||||
system.tag.writeBlocking([tag_provider + "System/close_socket"],[1])
|
||||
logger = system.util.getLogger("%s-WebSocket-Restart" % (fc))
|
||||
logger.info("Web-Socket closed due to restart, AWS.wbsckt_abort.close_websckt()")
|
||||
|
||||
def check_web_socket():
|
||||
"""
|
||||
This function checks to see if the "System/close_socket" tag is active
|
||||
(boolean on) or inactive (boolean off). If the tag is active the web
|
||||
socket will run, if it is inactive then the web socket will stop running.
|
||||
This function is called from the main web socket gateway event.
|
||||
Used to exit the web socket gateway event.
|
||||
|
||||
Args:
|
||||
None
|
||||
|
||||
Returns:
|
||||
True or False
|
||||
|
||||
Raises:
|
||||
N/A
|
||||
"""
|
||||
request_to_close = system.tag.readBlocking(["System/close_socket"])
|
||||
request_to_close_val = request_to_close[0].value
|
||||
if not request_to_close_val:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
@ -0,0 +1,92 @@
|
||||
{
|
||||
"custom": {},
|
||||
"params": {
|
||||
"enabled": true,
|
||||
"placeholder": "",
|
||||
"target_message_handler": null,
|
||||
"val": ""
|
||||
},
|
||||
"propConfig": {
|
||||
"params.enabled": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.placeholder": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.target_message_handler": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.val": {
|
||||
"onChange": {
|
||||
"enabled": null,
|
||||
"script": "\tval \u003d currentValue.value\n\tif val:\n\t\tif self.params.target_message_handler:\n\t\t\tsystem.perspective.sendMessage(\n\t\t\t\tself.params.target_message_handler,\n\t\t\t\t{\u0027value\u0027: val},\n\t\t\t\tscope\u003d\u0027session\u0027\n\t\t\t)\n"
|
||||
},
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 32,
|
||||
"width": 200
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Field Number"
|
||||
},
|
||||
"position": {
|
||||
"basis": "172px",
|
||||
"grow": 1,
|
||||
"shrink": 0
|
||||
},
|
||||
"propConfig": {
|
||||
"props.enabled": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.enabled"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.placeholder": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.placeholder"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.val"
|
||||
},
|
||||
"overlayOptOut": true,
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"margin": "2px",
|
||||
"marginRight": "26px"
|
||||
}
|
||||
},
|
||||
"type": "ia.input.text-field"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"props": {
|
||||
"justify": "center"
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
}
|
||||
@ -1,261 +0,0 @@
|
||||
{
|
||||
"custom": {},
|
||||
"params": {
|
||||
"ASdata": "value",
|
||||
"Browser": "value",
|
||||
"Color": 1,
|
||||
"DeviceType": "value",
|
||||
"FolderPath": "value",
|
||||
"Font-size": 14,
|
||||
"Text": "EIP",
|
||||
"Vendor": "value",
|
||||
"Visibility": true,
|
||||
"tagPath": "value"
|
||||
},
|
||||
"propConfig": {
|
||||
"params.ASdata": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Browser": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Color": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.DeviceType": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.FolderPath": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Font-size": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Text": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Vendor": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Visibility": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagPath": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 30,
|
||||
"width": 60
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "EIP"
|
||||
},
|
||||
"position": {
|
||||
"basis": "100%"
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.visible": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{session.custom.show.EIPs} || {view.params.Visibility}"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"props.style.backgroundColor": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.Color"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "#000000",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "#808080"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "#FF8C00"
|
||||
},
|
||||
{
|
||||
"input": 5,
|
||||
"output": "#D900D9"
|
||||
},
|
||||
{
|
||||
"input": 6,
|
||||
"output": "#0000FF"
|
||||
},
|
||||
{
|
||||
"input": 7,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 8,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 9,
|
||||
"output": "#FFFF00"
|
||||
},
|
||||
{
|
||||
"input": 10,
|
||||
"output": "#00D900"
|
||||
},
|
||||
{
|
||||
"input": 11,
|
||||
"output": "#87CEFA"
|
||||
},
|
||||
{
|
||||
"input": 12,
|
||||
"output": "#CCFFCC"
|
||||
},
|
||||
{
|
||||
"input": 13,
|
||||
"output": "#D3D3D3"
|
||||
},
|
||||
{
|
||||
"input": 14,
|
||||
"output": "#AC5F00"
|
||||
},
|
||||
{
|
||||
"input": 100,
|
||||
"output": "#FFFFFF"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if ({view.params.tagPath} \u003d {session.custom.Search},\r\n\"table/SearchTaghighlight\", \"table/highlight\")"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"props.style.fontSize": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.Font-size"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.Text"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": 2,
|
||||
"color": "#000000",
|
||||
"cursor": "pointer",
|
||||
"fontFamily": "Arial",
|
||||
"fontWeight": "bold",
|
||||
"textAlign": "center"
|
||||
}
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
}
|
||||
],
|
||||
"events": {
|
||||
"dom": {
|
||||
"onClick": {
|
||||
"config": {
|
||||
"draggable": false,
|
||||
"id": "information",
|
||||
"modal": false,
|
||||
"overlayDismiss": false,
|
||||
"resizable": false,
|
||||
"showCloseIcon": false,
|
||||
"type": "open",
|
||||
"viewParams": {
|
||||
"ASdata": "{view.params.ASdata}",
|
||||
"Browser": "{view.params.Browser}",
|
||||
"DeviceType": "{view.params.DeviceType}",
|
||||
"FolderPath": "{view.params.FolderPath}",
|
||||
"Vendor": "{view.params.Vendor}",
|
||||
"tagPath": "{view.params.tagPath}"
|
||||
},
|
||||
"viewPath": "Windows/Information/Information",
|
||||
"viewportBound": false
|
||||
},
|
||||
"scope": "C",
|
||||
"type": "popup"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "root",
|
||||
"tooltip": {
|
||||
"enabled": true,
|
||||
"style": {
|
||||
"backgroundColor": "#2B2B2BBF",
|
||||
"color": "#FFFFFF",
|
||||
"fontSize": 12,
|
||||
"textAlign": "left",
|
||||
"white-space": "pre"
|
||||
}
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.tooltip.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "replace({view.params.tagPath}, \"_\", \"-\") +\r\n\"\\nStatus: \" + \r\ncase (tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Color\"),\r\n2 ,\"Faulted\",\r\n10 ,\"OK\",\r\n\"not response\")"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"direction": "column",
|
||||
"justify": "center",
|
||||
"style": {
|
||||
"classes": "table/highlight"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,211 @@
|
||||
import java.net.http.WebSocketHandshakeException
|
||||
from java.net.http import HttpClient;
|
||||
from java.net.http import WebSocket;
|
||||
from java.net import URI
|
||||
from java.lang import Thread
|
||||
import uuid
|
||||
import json
|
||||
import time
|
||||
|
||||
#Check for a http client stored in the globals.
|
||||
whid = system.tag.readBlocking(["Configuration/FC"])[0].value
|
||||
client = system.util.getGlobals().get(whid, {}).get("http_client", None)
|
||||
#Store the http client as a global variable to be reused on project saves.
|
||||
if not client:
|
||||
client = HttpClient.newHttpClient()
|
||||
system.util.getGlobals()[whid]["http_client"] = client
|
||||
|
||||
class Listener(WebSocket.Listener):
|
||||
"""
|
||||
Creates a Listener for receiving web socket messages.
|
||||
The mehtods in this class are standard Java methods
|
||||
that have been overidden to include additional functionality. onOpen,
|
||||
onText, onClose and onError are called by the class whenthe web socket
|
||||
is opened, when the web socket receives data,
|
||||
when the web socket is closed, when the web socket encounters an error,
|
||||
respectively. Messages are sent from the web socket by calling the sendText
|
||||
method on the Listener object.
|
||||
|
||||
Args:
|
||||
whid: Warehouse id for the tag provider (string).
|
||||
message_handler: A message handler object which parses
|
||||
the messages received from the onText
|
||||
method (class)
|
||||
|
||||
Returns:
|
||||
Listener object.
|
||||
|
||||
Raises:
|
||||
Error handling is performed by the onError method.
|
||||
This method can be overidden with additional logic
|
||||
for handling errors detected by the Listener object.
|
||||
"""
|
||||
def __init__(self, whid, message_handler):
|
||||
self.whid = whid
|
||||
self.alarms = {}
|
||||
self.tag_provider = "[%s_SCADA_TAG_PROVIDER]" % (self.whid)
|
||||
self.logger = system.util.getLogger("%s-Web-Socket-Listener" % (self.whid))
|
||||
self.message = ""
|
||||
self.message_handler = message_handler
|
||||
|
||||
def onOpen(self, websocket):
|
||||
#Generate uuid to help track the connection in aws.
|
||||
uid = uuid.uuid4()
|
||||
on_open_subscribe = json.dumps({"action": "subscribe",
|
||||
"parameters": {"siteId": self.whid,
|
||||
"clientName": str(uid)}}
|
||||
)
|
||||
websocket.sendText(on_open_subscribe, True)
|
||||
logger = system.util.getLogger("Web-Socket-OnOpen")
|
||||
self.logger.info("message sent =" + str(on_open_subscribe))
|
||||
websocket.request(1)
|
||||
|
||||
def onText(self, websocket, data, last):
|
||||
self.message += str(data)
|
||||
if not last:
|
||||
websocket.request(1)
|
||||
else:
|
||||
json_message = json.loads(self.message)
|
||||
self.message = ""
|
||||
self.message_handler.handle_message(json_message)
|
||||
websocket.request(1)
|
||||
|
||||
def onClose(self, websocket, error):
|
||||
self.logger.info("Onclose method " + str(error))
|
||||
|
||||
def onError(self, websocket, error):
|
||||
self.logger.error("OnError method " + str(error))
|
||||
|
||||
|
||||
def web_socket_main(whid, provider, region, message_handler, secret_name):
|
||||
"""
|
||||
Main function for running a web socket. This function can
|
||||
be called in an asynchronous thread and should only exit
|
||||
when the socket has been closed or an error is encountered.
|
||||
The function will create a web socket object and run in a
|
||||
while loop to keep the socket connection open.
|
||||
It will exit if an error is encounterd, the socket is manually
|
||||
closed from the tag provider or the socket is closed.
|
||||
|
||||
Args:
|
||||
whid: Warehouse id for the tag provider (string).
|
||||
provider: Tag provider that the web socket will use to write messages to/from (string).
|
||||
region: The AWS region of the api endpoint. Usally the same region as the EC2
|
||||
running the web socket (string).
|
||||
message_handler: message handler object used for parsing of the web socket messages (class).
|
||||
secret_name : name of the secret to be passed into the web socket. This will retreive the api endpoint for AWS.
|
||||
|
||||
Returns:
|
||||
N/A.
|
||||
Raises:
|
||||
Secrets manager error
|
||||
web socket error
|
||||
"""
|
||||
thread_name = str(Thread.getId(Thread.currentThread()))
|
||||
system.tag.writeAsync([provider + "system/thread_id"],[thread_name])
|
||||
system.util.getGlobals()[whid]["wbsckt_running"] = True
|
||||
system.tag.writeAsync([provider + "System/wbsckt_running"],[1])
|
||||
logger_name = "%s-web-socket-main" % (whid)
|
||||
logger = system.util.getLogger(logger_name)
|
||||
timer_end = None
|
||||
timer_started = False
|
||||
"""The heartbeat is initalised with the current time on first connect
|
||||
Each time a new heartbeat is recieved in AWS.message_types
|
||||
the current time is written to the tag wbsckt_heartbeat_interval.
|
||||
The websocket checks that a heartbeat has been recieved at least every 120 secs.
|
||||
If a heartbeat is not recieved within the 120 sec duration the connection is closed and the loop will exit.
|
||||
"""
|
||||
AWS.heartbeat.get_heartbeat(provider)
|
||||
tags_to_read = system.tag.readBlocking([provider + "System/wbsckt_heartbeat_interval"])
|
||||
wbsckt_heartbeat_interval = tags_to_read[0].value
|
||||
#Return api endpoint from secrets manager.
|
||||
API_ID, STAGE, ACC_ID, FUNC_URL = AWS.secrets_manager.get_secret(whid, secret_name)
|
||||
|
||||
try:
|
||||
credentials = AWS.credentials.assume_role(profile_name = "default", region = region, arn = ACC_ID, api_id = API_ID, stage = STAGE)
|
||||
except:
|
||||
AWS.errors.error_handler(whid, "AWS.credentials.assume_role")
|
||||
return
|
||||
|
||||
logger.info("Building URL ....")
|
||||
url, headers = AWS.build_url.make_websocket_connection(API_ID, region, STAGE, credentials)
|
||||
listener = AWS.web_socket.Listener(whid, message_handler)
|
||||
# client = HttpClient.newHttpClient()
|
||||
#set the client as global (stored in the system global variables).
|
||||
global client
|
||||
uri = URI.create(url)
|
||||
logger.info(str(uri))
|
||||
logger.info("Building web-socket object ....")
|
||||
wsBuilder = client.newWebSocketBuilder()
|
||||
wsBuilder.header("Authorization", headers["Authorization"])
|
||||
wsBuilder.header("X-Amz-Date", headers["X-Amz-Date"])
|
||||
wsBuilder.header("X-Amz-Security-Token", headers["X-Amz-Security-Token"])
|
||||
|
||||
try:
|
||||
wsObj = wsBuilder.buildAsync(uri, listener)
|
||||
except:
|
||||
AWS.errors.error_handler(whid, "Build web socket")
|
||||
return
|
||||
|
||||
web_socket = wsObj.get()
|
||||
logger.info("Web socket object built, starting while loop ....")
|
||||
running = 1
|
||||
|
||||
while True:
|
||||
time.sleep(0.1)
|
||||
if running == 1:
|
||||
logger.info("While loop running ....")
|
||||
running = 0
|
||||
|
||||
if AWS.heartbeat.check_heartbeat(provider, 70):
|
||||
web_socket.sendClose(web_socket.NORMAL_CLOSURE, "Missing heartbeat")
|
||||
logger.warn("socket closed , missing heartbeat")
|
||||
web_socket.abort()
|
||||
text_val = web_socket.sendText(str({"action":"abort"}), True)
|
||||
break
|
||||
|
||||
check_socket_closed_in_loop = AWS.wbsckt_abort.check_web_socket()
|
||||
if check_socket_closed_in_loop:
|
||||
web_socket.sendClose(web_socket.NORMAL_CLOSURE, "")
|
||||
logger.info("socket close initiated")
|
||||
# web_socket.abort()
|
||||
text_val = web_socket.sendText(str({"action":"abort"}), True)
|
||||
break
|
||||
|
||||
if not timer_started:
|
||||
timer_start = system.date.now()
|
||||
timer_started = True
|
||||
|
||||
timer_end = system.date.now()
|
||||
time_diff = system.date.secondsBetween(timer_start, timer_end)
|
||||
if time_diff >= wbsckt_heartbeat_interval:
|
||||
send_heartbeat = True
|
||||
timer_started = False
|
||||
|
||||
if web_socket.isOutputClosed():
|
||||
logger.info("Websocket output closed")
|
||||
break
|
||||
|
||||
if web_socket.isInputClosed():
|
||||
logger.info("Websocket input closed")
|
||||
break
|
||||
|
||||
this_thread = system.tag.readBlocking(provider + "System/thread_id")[0].value
|
||||
if this_thread != thread_name:
|
||||
logger.warn("thread_id does not match current thread_id")
|
||||
break
|
||||
|
||||
tags_to_read = system.tag.readBlocking(["System/wbsckt_messages_send"])
|
||||
messages = system.util.jsonDecode(tags_to_read[0].value)
|
||||
message_list = messages.get("message_list")
|
||||
if message_list:
|
||||
for i in message_list:
|
||||
message_string = str(i)
|
||||
formatted_string = message_string.replace("u'","'")
|
||||
json_string = formatted_string.replace("'","\"")
|
||||
web_socket.sendText(str(json_string), True)
|
||||
logger.info("Message sent: " + str(json_string))
|
||||
system.tag.writeAsync(["System/wbsckt_messages_send"], "{}")
|
||||
system.util.getGlobals()[whid]["wbsckt_running"] = False
|
||||
web_socket.abort()
|
||||
system.tag.writeBlocking([provider + "System/wbsckt_running"], [0])
|
||||
@ -0,0 +1,141 @@
|
||||
{
|
||||
"custom": {},
|
||||
"params": {
|
||||
"tagProps": [
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value"
|
||||
]
|
||||
},
|
||||
"propConfig": {
|
||||
"params.tagProps": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 41,
|
||||
"width": 83
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"events": {
|
||||
"component": {
|
||||
"onActionPerformed": {
|
||||
"config": {
|
||||
"script": "\tif self.view.params.tagProps[0] is not True:\n\t\tnavigation.additional_view.navigate_to_additional_view(self)\n\telse:\n\t\tnavigation.navigate_to_page.detailed_view(self, self.view.params.tagProps[2],self.view.params.tagProps[2], self.view.params.tagProps[3])"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "Button"
|
||||
},
|
||||
"position": {
|
||||
"basis": "41px"
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.page_id": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.tagProps[2]"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"custom.status": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "direct",
|
||||
"tagPath": "Configuration/DetailedViews.value"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"code": "\t\n\tjson_decode \u003d system.util.jsonDecode(value)\n\tpage_id \u003d self.custom.page_id\n\tpage_status \u003d json_decode.get(\"AdditionalPages\",{}).get(page_id,5)\n\treturn page_status",
|
||||
"type": "script"
|
||||
}
|
||||
],
|
||||
"type": "tag"
|
||||
}
|
||||
},
|
||||
"props.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{this.custom.status}"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 1,
|
||||
"output": "State-Styles/Background-Fill/State1"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "State-Styles/Background-Fill/State2"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "State-Styles/Background-Fill/State3"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "State-Styles/Background-Fill/State4"
|
||||
},
|
||||
{
|
||||
"input": 5,
|
||||
"output": "Buttons/Clear-Background"
|
||||
},
|
||||
{
|
||||
"input": 6,
|
||||
"output": "State-Styles/Background-Fill/State6"
|
||||
},
|
||||
{
|
||||
"input": 0,
|
||||
"output": "State-Styles/Background-Fill/State0"
|
||||
}
|
||||
],
|
||||
"outputType": "style-list",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"image": {
|
||||
"icon": {
|
||||
"path": "material/navigation"
|
||||
}
|
||||
},
|
||||
"style": {},
|
||||
"text": ""
|
||||
},
|
||||
"type": "ia.input.button"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"props": {
|
||||
"direction": "column"
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 307 B |
@ -1,323 +0,0 @@
|
||||
{
|
||||
"custom": {},
|
||||
"params": {
|
||||
"Control": {
|
||||
"StartLT": {
|
||||
"StartLT1": false,
|
||||
"StartLT10": false,
|
||||
"StartLT2": false,
|
||||
"StartLT3": false,
|
||||
"StartLT4": false,
|
||||
"StartLT5": false,
|
||||
"StartLT6": false,
|
||||
"StartLT7": false,
|
||||
"StartLT8": false,
|
||||
"StartLT9": false
|
||||
},
|
||||
"StartPB": {
|
||||
"Start1": true,
|
||||
"Start10": true,
|
||||
"Start2": true,
|
||||
"Start3": true,
|
||||
"Start4": true,
|
||||
"Start5": true,
|
||||
"Start6": true,
|
||||
"Start7": true,
|
||||
"Start8": true,
|
||||
"Start9": true
|
||||
},
|
||||
"StopLT": {
|
||||
"StopLT1": false,
|
||||
"StopLT10": false,
|
||||
"StopLT2": false,
|
||||
"StopLT3": false,
|
||||
"StopLT4": false,
|
||||
"StopLT5": false,
|
||||
"StopLT6": false,
|
||||
"StopLT7": false,
|
||||
"StopLT8": false,
|
||||
"StopLT9": false
|
||||
},
|
||||
"StopPB": {
|
||||
"Stop1": false,
|
||||
"Stop10": false,
|
||||
"Stop2": false,
|
||||
"Stop3": false,
|
||||
"Stop4": false,
|
||||
"Stop5": false,
|
||||
"Stop6": false,
|
||||
"Stop7": false,
|
||||
"Stop8": false,
|
||||
"Stop9": false
|
||||
}
|
||||
},
|
||||
"Coordinate": {
|
||||
"Scale": 2,
|
||||
"x": "",
|
||||
"y": ""
|
||||
},
|
||||
"fontSize": "14px",
|
||||
"label": ""
|
||||
},
|
||||
"propConfig": {
|
||||
"params.Control": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Coordinate": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.fontSize": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.label": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 60,
|
||||
"width": 370
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"events": {
|
||||
"dom": {
|
||||
"onClick": {
|
||||
"config": {
|
||||
"script": "\tself.session.custom.transition \u003d 1\n\tself.session.custom.zoom \u003d self.view.params.Coordinate.Scale\n\tself.session.custom.zoomto \u003d 1\n\tself.session.custom.scale_x \u003d self.view.params.Coordinate.x\n\tself.session.custom.scale_y \u003d self.view.params.Coordinate.y"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "Border",
|
||||
"tooltip": {
|
||||
"enabled": true,
|
||||
"style": {
|
||||
"backgroundColor": "#2B2B2BBF",
|
||||
"color": "#FFFFFF",
|
||||
"fontSize": 14,
|
||||
"textAlign": "left",
|
||||
"white-space": "pre"
|
||||
},
|
||||
"text": "To zoom in to the \nchosen area, you \nneed to click on the \nname of the area."
|
||||
}
|
||||
},
|
||||
"position": {
|
||||
"height": 1,
|
||||
"width": 1
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"backgroundColor": "#D5D5D5",
|
||||
"borderColor": "#808080",
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": 4
|
||||
}
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label",
|
||||
"tooltip": {
|
||||
"style": {
|
||||
"backgroundColor": "#2B2B2BBF",
|
||||
"color": "#FFFFFF",
|
||||
"fontSize": 14,
|
||||
"textAlign": "left",
|
||||
"white-space": "pre"
|
||||
}
|
||||
}
|
||||
},
|
||||
"position": {
|
||||
"height": 0.6665,
|
||||
"width": 0.6972,
|
||||
"x": 0.0293,
|
||||
"y": 0.1667
|
||||
},
|
||||
"propConfig": {
|
||||
"props.style.fontSize": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.fontSize"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "// Check if label is Good and isn\u0027t just whitespace characters:\r\nif(isGood({view.params.label}) \u0026\u0026 len(trim({view.params.label})) \u003e 0,\r\n\t// Label is readable:\r\n\t{view.params.label},\r\n\t// Unknown / not configured label:\r\n\t\"Unknown\"\r\n)"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"backgroundColor": "#AAAAAA",
|
||||
"borderColor": "#808080",
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": 4,
|
||||
"fontFamily": "Arial",
|
||||
"fontWeight": "bold",
|
||||
"pointer-events": "none",
|
||||
"textAlign": "center",
|
||||
"textTransform": "uppercase",
|
||||
"user-select": "none",
|
||||
"will-change": "transform"
|
||||
}
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
},
|
||||
{
|
||||
"events": {
|
||||
"component": {
|
||||
"onActionPerformed": {
|
||||
"config": {
|
||||
"script": "\tself.view.params.Control.StartPB.Start1 \u003d 1\n\tself.view.params.Control.StartPB.Start2 \u003d 1\n\tself.view.params.Control.StartPB.Start3 \u003d 1\n\tself.view.params.Control.StartPB.Start4 \u003d 1\n\tself.view.params.Control.StartPB.Start5 \u003d 1\n\tself.view.params.Control.StartPB.Start6 \u003d 1\n\tself.view.params.Control.StartPB.Start7 \u003d 1\n\tself.view.params.Control.StartPB.Start8 \u003d 1\n\tself.view.params.Control.StartPB.Start9 \u003d 1\n\tself.view.params.Control.StartPB.Start10 \u003d 1"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "StartPB",
|
||||
"tooltip": {
|
||||
"enabled": true,
|
||||
"style": {
|
||||
"backgroundColor": "#2B2B2BBF",
|
||||
"color": "#FFFFFF",
|
||||
"fontSize": 12,
|
||||
"textAlign": "left",
|
||||
"white-space": "pre"
|
||||
},
|
||||
"text": "START SYSTEM"
|
||||
}
|
||||
},
|
||||
"position": {
|
||||
"height": 0.6667,
|
||||
"width": 0.1081,
|
||||
"x": 0.7403,
|
||||
"y": 0.1667
|
||||
},
|
||||
"propConfig": {
|
||||
"props.image.source": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if ({view.params.Control.StartLT.StartLT1} || {view.params.Control.StartLT.StartLT2} || {view.params.Control.StartLT.StartLT3} || {view.params.Control.StartLT.StartLT4} || {view.params.Control.StartLT.StartLT5}\r\n || {view.params.Control.StartLT.StartLT6} || {view.params.Control.StartLT.StartLT7} || {view.params.Control.StartLT.StartLT8} || {view.params.Control.StartLT.StartLT9} || {view.params.Control.StartLT.StartLT10},\r\n\"/system/images/MyIcon/Start-green64x64.png\",\r\n\"/system/images/MyIcon/Start-grey64x64.png\")"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"image": {
|
||||
"height": "100%",
|
||||
"width": "100%"
|
||||
},
|
||||
"style": {
|
||||
"backgroundColor": "#00000000",
|
||||
"borderColor": "#00000000"
|
||||
},
|
||||
"text": ""
|
||||
},
|
||||
"type": "ia.input.button"
|
||||
},
|
||||
{
|
||||
"events": {
|
||||
"component": {
|
||||
"onActionPerformed": {
|
||||
"config": {
|
||||
"script": "\tself.view.params.Control.StopPB.Stop1 \u003d 1\n\tself.view.params.Control.StopPB.Stop2 \u003d 1\n\tself.view.params.Control.StopPB.Stop3 \u003d 1\n\tself.view.params.Control.StopPB.Stop4 \u003d 1\n\tself.view.params.Control.StopPB.Stop5 \u003d 1\n\tself.view.params.Control.StopPB.Stop6 \u003d 1\n\tself.view.params.Control.StopPB.Stop7 \u003d 1\n\tself.view.params.Control.StopPB.Stop8 \u003d 1\n\tself.view.params.Control.StopPB.Stop9 \u003d 1\n\tself.view.params.Control.StopPB.Stop10 \u003d 1"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "StopPB",
|
||||
"tooltip": {
|
||||
"enabled": true,
|
||||
"style": {
|
||||
"backgroundColor": "#2B2B2BBF",
|
||||
"color": "#FFFFFF",
|
||||
"fontSize": 12,
|
||||
"textAlign": "left",
|
||||
"white-space": "pre"
|
||||
},
|
||||
"text": "STOP SYSTEM"
|
||||
}
|
||||
},
|
||||
"position": {
|
||||
"height": 0.6667,
|
||||
"width": 0.1081,
|
||||
"x": 0.8619,
|
||||
"y": 0.1667
|
||||
},
|
||||
"propConfig": {
|
||||
"props.image.source": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if ({view.params.Control.StopLT.StopLT1} || {view.params.Control.StopLT.StopLT2} || {view.params.Control.StopLT.StopLT3} || {view.params.Control.StopLT.StopLT4} || {view.params.Control.StopLT.StopLT5}\r\n || {view.params.Control.StopLT.StopLT6} || {view.params.Control.StopLT.StopLT7} || {view.params.Control.StopLT.StopLT8} || {view.params.Control.StopLT.StopLT9} || {view.params.Control.StopLT.StopLT10},\r\n\"/system/images/MyIcon/Stop-red64x64.png\",\r\n\"/system/images/MyIcon/Stop-grey64x64.png\")"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"image": {
|
||||
"height": "100%",
|
||||
"width": "100%"
|
||||
},
|
||||
"style": {
|
||||
"backgroundColor": "#00000000",
|
||||
"borderColor": "#00000000"
|
||||
},
|
||||
"text": ""
|
||||
},
|
||||
"type": "ia.input.button"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root",
|
||||
"tooltip": {
|
||||
"style": {
|
||||
"backgroundColor": "#2B2B2BBF",
|
||||
"color": "#FFFFFF",
|
||||
"fontSize": 14,
|
||||
"textAlign": "left",
|
||||
"white-space": "pre"
|
||||
}
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"props.style.transform": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if ({session.custom.RotateText} \u003d 180,\r\n\"translate3d(0,0,0) rotate(180deg)\",\r\n\"translate3d(0,0,0) rotate(0deg)\")"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"mode": "percent",
|
||||
"style": {
|
||||
"cursor": "pointer"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.coord"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,296 @@
|
||||
{
|
||||
"custom": {
|
||||
"activityLogger": {
|
||||
"alt_pageid": "card_view",
|
||||
"start_time": {
|
||||
"$": [
|
||||
"ts",
|
||||
192,
|
||||
1754319546004
|
||||
],
|
||||
"$ts": 1754319545822
|
||||
}
|
||||
}
|
||||
},
|
||||
"events": {
|
||||
"system": {
|
||||
"onShutdown": {
|
||||
"config": {
|
||||
"script": "\tactivityLog.logger.callLogger(self, \u0027page\u0027)\n\tactivityLog.productMetrics.callLogger(self, \u0027page\u0027)"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
},
|
||||
"onStartup": {
|
||||
"config": {
|
||||
"script": "\tself.custom.activityLogger.start_time \u003d system.date.now()"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
}
|
||||
},
|
||||
"params": {
|
||||
"page_name": "Home"
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.activityLogger": {
|
||||
"persistent": true
|
||||
},
|
||||
"custom.activityLogger.pageid": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "{page.props.path}"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"code": "\tif value \u003d\u003d\u0027/\u0027 or value \u003d\u003d \u0027\u0027 or value \u003d\u003d None:\n\t\treturn self.custom.activityLogger.alt_pageid.lower()\n\telse:\n\t\treturn value[1:].lower()",
|
||||
"type": "script"
|
||||
}
|
||||
],
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"params.page_name": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 1080,
|
||||
"width": 1920
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "FlexRepeater"
|
||||
},
|
||||
"position": {
|
||||
"basis": "1080px"
|
||||
},
|
||||
"props": {
|
||||
"alignContent": "flex-start",
|
||||
"alignItems": "flex-start",
|
||||
"elementPosition": {
|
||||
"grow": 0,
|
||||
"shrink": 0
|
||||
},
|
||||
"instances": [
|
||||
{
|
||||
"Counts": {
|
||||
"Diag": 0,
|
||||
"High": 0,
|
||||
"Low": 0,
|
||||
"Medium": 0
|
||||
},
|
||||
"area": "Bulk Inbound",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": "",
|
||||
"margin": "5px"
|
||||
},
|
||||
"subarea": "",
|
||||
"tagProps": [
|
||||
"MCM05",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Counts": {
|
||||
"Diag": 0,
|
||||
"High": 0,
|
||||
"Low": 0,
|
||||
"Medium": 0
|
||||
},
|
||||
"area": "Fluid Inbound",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": "",
|
||||
"margin": "5px"
|
||||
},
|
||||
"subarea": "",
|
||||
"tagProps": [
|
||||
"MCM04",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Counts": {
|
||||
"Diag": 0,
|
||||
"High": 0,
|
||||
"Low": 0,
|
||||
"Medium": 0
|
||||
},
|
||||
"area": "Fluid Inbound",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": "",
|
||||
"margin": "5px"
|
||||
},
|
||||
"subarea": "",
|
||||
"tagProps": [
|
||||
"MCM03",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Counts": {
|
||||
"Diag": 0,
|
||||
"High": 0,
|
||||
"Low": 0,
|
||||
"Medium": 0
|
||||
},
|
||||
"area": "Sorter Destination and Chutes",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": "",
|
||||
"margin": "5px"
|
||||
},
|
||||
"subarea": "",
|
||||
"tagProps": [
|
||||
"MCM02",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value"
|
||||
]
|
||||
},
|
||||
{
|
||||
"Counts": {
|
||||
"Diag": 0,
|
||||
"High": 0,
|
||||
"Low": 0,
|
||||
"Medium": 0
|
||||
},
|
||||
"area": "Sorter Destination, Chutes and Bypass",
|
||||
"instancePosition": {},
|
||||
"instanceStyle": {
|
||||
"classes": "",
|
||||
"margin": "5px"
|
||||
},
|
||||
"subarea": "",
|
||||
"tagProps": [
|
||||
"MCM01",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value",
|
||||
"value"
|
||||
]
|
||||
}
|
||||
],
|
||||
"path": "Symbol-Views/Controller-Views/ControllerStatus",
|
||||
"style": {
|
||||
"overflow": "visible"
|
||||
},
|
||||
"wrap": "wrap"
|
||||
},
|
||||
"type": "ia.display.flex-repeater"
|
||||
}
|
||||
],
|
||||
"custom": {
|
||||
"Devices": [
|
||||
[
|
||||
"MCM01",
|
||||
"Bulk Inbound"
|
||||
],
|
||||
[
|
||||
"MCM02",
|
||||
"Fluid Inbound"
|
||||
],
|
||||
[
|
||||
"MCM03",
|
||||
"Fluid Inbound"
|
||||
],
|
||||
[
|
||||
"MCM05",
|
||||
"Sorter Destination and Chutes"
|
||||
],
|
||||
[
|
||||
"MCM04",
|
||||
"Sorter Destination, Chutes and Bypass"
|
||||
]
|
||||
],
|
||||
"count": "value",
|
||||
"delay": 2000,
|
||||
"run_update": true
|
||||
},
|
||||
"events": {
|
||||
"system": {
|
||||
"onStartup": [
|
||||
{
|
||||
"config": {
|
||||
"script": "\tVisualisation.home_page.create_home_page(self)"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
},
|
||||
{
|
||||
"config": {
|
||||
"script": "\twhid \u003d self.session.custom.fc\n\tsession_id \u003d self.session.props.id\n\tpage_id \u003d self.view.params.page_name\n\tCommands.analytics.send_page_details(whid, session_id, page_id)"
|
||||
},
|
||||
"scope": "G",
|
||||
"type": "script"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"propConfig": {
|
||||
"custom.update": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "now({this.custom.delay})"
|
||||
},
|
||||
"type": "expr"
|
||||
},
|
||||
"onChange": {
|
||||
"enabled": null,
|
||||
"script": "\n if (self.session.custom.fc \u003d\u003d \u0027\u0027) or (self.session.custom.fc is None):\n \tself.getChild(\"FlexRepeater\").props.instances \u003d []\n \treturn\n \n if self.custom.run_update:\n \tVisualisation.home_page.update_home_status(self)\n# system_tags \u003d system.tag.readBlocking([\"Configuration/FC\", \"System/ActiveAlarms\"])\n# tag_provider \u003d \"[%s_SCADA_TAG_PROVIDER]\" % (system_tags[0].value)\n# status_decoded \u003d system.util.jsonDecode(self.session.custom.id_to_state)\n# if status_decoded:\n#\t values \u003d []\n#\t devices \u003d self.custom.Devices\n#\t for i in devices:\n#\t \tvalue \u003d status_decoded.get(i)\n#\t \tif value \u003d\u003d None:\n#\t \t\tvalues.append(5)\n#\t \telse:\n#\t \t\tvalues.append(value)\n#\t zipped_list \u003d zip(values, devices)\n#\t devices_sorted \u003d [y for x,y in sorted(zipped_list)]\n#\t for i,j in enumerate(devices_sorted):\n#\t try:\n#\t \tself.getChild(\"FlexRepeater\").props.instances[i].tagProps[0] \u003d j\n#\t except:\n#\t \tsystem.perspective.print(i)"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"direction": "column"
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,101 @@
|
||||
import datetime
|
||||
import hashlib
|
||||
import hmac
|
||||
|
||||
import boto3
|
||||
|
||||
try:
|
||||
from urllib.parse import quote_plus
|
||||
except ImportError:
|
||||
from urllib import quote_plus
|
||||
|
||||
|
||||
def sign(key, msg):
|
||||
return hmac.new(key, msg.encode("utf-8"), hashlib.sha256).digest()
|
||||
|
||||
|
||||
def getSignatureKey(key, dateStamp, regionName, serviceName):
|
||||
kDate = sign(("AWS4" + key).encode("utf-8"), dateStamp)
|
||||
kRegion = sign(kDate, regionName)
|
||||
kService = sign(kRegion, serviceName)
|
||||
kSigning = sign(kService, "aws4_request")
|
||||
return kSigning
|
||||
|
||||
|
||||
def build_querystring(access_key, session_key, algorithm, amz_date, credential_scope):
|
||||
query_strings = {
|
||||
"X-Amz-Algorithm": algorithm,
|
||||
"X-Amz-Credential": quote_plus(access_key + "/" + credential_scope),
|
||||
"X-Amz-Date": amz_date,
|
||||
#"X-Amz-Security-Token": quote_plus(session_key),
|
||||
"X-Amz-SignedHeaders": "host",
|
||||
}
|
||||
keys = list(query_strings.keys())
|
||||
keys.sort()
|
||||
query = []
|
||||
for key in keys:
|
||||
query.append("{}={}".format(key, query_strings[key]))
|
||||
|
||||
canonical_query_string = "&".join(
|
||||
query
|
||||
#["{}={}".format(key, value) for key, value in query_strings.items()]
|
||||
)
|
||||
return canonical_query_string
|
||||
|
||||
|
||||
def make_websocket_connection(api_id, region, stage, credentials):
|
||||
method = "GET"
|
||||
service = "execute-api"
|
||||
host = "{}.{}.{}.amazonaws.com".format(api_id, service, region)
|
||||
canonical_uri = "/{}".format(stage)
|
||||
access_key = credentials["AccessKey"]
|
||||
secret_key = credentials["SecretKey"]
|
||||
session_key = credentials["SessionKey"]
|
||||
now = datetime.datetime.utcnow()
|
||||
|
||||
amz_date = now.strftime("%Y%m%dT%H%M%SZ")
|
||||
datestamp = now.strftime("%Y%m%d")
|
||||
canonical_headers = "host:" + host + "\n"
|
||||
signed_headers = "host"
|
||||
algorithm = "AWS4-HMAC-SHA256"
|
||||
credential_scope = "/".join([datestamp, region, service, "aws4_request"])
|
||||
|
||||
canonical_querystring = build_querystring(
|
||||
access_key, session_key, algorithm, amz_date, credential_scope
|
||||
)
|
||||
payload_hash = hashlib.sha256(("").encode("utf-8")).hexdigest()
|
||||
canonical_request = "\n".join(
|
||||
[
|
||||
method,
|
||||
canonical_uri,
|
||||
"",
|
||||
#canonical_querystring,
|
||||
canonical_headers,
|
||||
signed_headers,
|
||||
payload_hash,
|
||||
]
|
||||
)
|
||||
string_to_sign = "\n".join(
|
||||
[
|
||||
algorithm,
|
||||
amz_date,
|
||||
credential_scope,
|
||||
hashlib.sha256(canonical_request.encode("utf-8")).hexdigest(),
|
||||
]
|
||||
)
|
||||
signing_key = getSignatureKey(secret_key, datestamp, region, service)
|
||||
signature = hmac.new(
|
||||
signing_key, string_to_sign.encode("utf-8"), hashlib.sha256
|
||||
).hexdigest()
|
||||
canonical_querystring += "&X-Amz-Signature=" + signature
|
||||
request_url = "wss://{}/{}".format(host, stage)
|
||||
auth_header = algorithm + " Credential=" + access_key + "/" + credential_scope + ", SignedHeaders=" + signed_headers + ", Signature=" + signature
|
||||
#print('-H "Authorization":"' + auth_header +'" -H "X-Amz-Date":"' + amz_date + '" -H "X-Amz-Security-Token":"' + session_key + '" ')
|
||||
request_headers = {
|
||||
"Authorization":auth_header,
|
||||
"X-Amz-Date": amz_date,
|
||||
"X-Amz-Security-Token": session_key
|
||||
}
|
||||
return request_url, request_headers
|
||||
|
||||
|
||||
@ -0,0 +1,44 @@
|
||||
def get_state_table(active_states):
|
||||
faulted = []
|
||||
stopped = []
|
||||
running = []
|
||||
style_class = {}
|
||||
state_lookup = {1:"Faulted", 2:"Stopped", 3:"Running"}
|
||||
for i in active_states:
|
||||
source_id = i
|
||||
time_stamp = active_states[i].get("timestamp","Unknown")
|
||||
time_stamp_converted = alarms.alarm_tables.get_timestamp(time_stamp)
|
||||
state = active_states[i].get("state","Unknown")
|
||||
if time_stamp !=("Unknown"):
|
||||
duration = alarms.alarm_tables.convert(int(time_stamp))
|
||||
else:
|
||||
duration = 0
|
||||
state_list = []
|
||||
if state == 3:
|
||||
state_list = running
|
||||
style_class = {"classes":"State-Styles/State5"}
|
||||
state = state_lookup.get(state, 6)
|
||||
elif state == 2:
|
||||
state_list = stopped
|
||||
style_class = {"classes":"State-Styles/State2"}
|
||||
state = state_lookup.get(state, 6)
|
||||
elif state == 1:
|
||||
state_list = faulted
|
||||
style_class = {"classes":"State-Styles/State1"}
|
||||
state = state_lookup.get(state, 6)
|
||||
else:
|
||||
pass
|
||||
|
||||
state_row = row_builder.build_row_with_view(SourceId = source_id,
|
||||
TimeStamp = time_stamp_converted,
|
||||
Duration = duration,
|
||||
State = state,
|
||||
StyleClass = style_class )
|
||||
state_list.append(state_row)
|
||||
|
||||
return faulted + stopped + running
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -0,0 +1,55 @@
|
||||
{
|
||||
"custom": {},
|
||||
"params": {},
|
||||
"props": {},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label"
|
||||
},
|
||||
"position": {
|
||||
"basis": "32px"
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"fontFamily": "Arial",
|
||||
"fontSize": 22,
|
||||
"fontWeight": "bold",
|
||||
"textAlign": "center"
|
||||
},
|
||||
"text": "TEMPERATURE"
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
},
|
||||
{
|
||||
"meta": {
|
||||
"name": "Table"
|
||||
},
|
||||
"position": {
|
||||
"basis": "400px"
|
||||
},
|
||||
"propConfig": {
|
||||
"props.data": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"fallbackDelay": 2.5,
|
||||
"mode": "direct",
|
||||
"tagPath": "[IEC_SCADA_TAG_PROVIDER]Temperature/temperature_monitoring"
|
||||
},
|
||||
"type": "tag"
|
||||
}
|
||||
}
|
||||
},
|
||||
"type": "ia.display.table"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"props": {
|
||||
"direction": "column"
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
}
|
||||
|
Before Width: | Height: | Size: 402 B |
@ -0,0 +1,710 @@
|
||||
{
|
||||
"custom": {
|
||||
"font_size": ".57vmax"
|
||||
},
|
||||
"params": {},
|
||||
"propConfig": {
|
||||
"custom.font_size": {
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 149,
|
||||
"width": 423
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label"
|
||||
},
|
||||
"position": {
|
||||
"basis": "160px"
|
||||
},
|
||||
"propConfig": {
|
||||
"props.textStyle.fontSize": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.font_size"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"text": "Color Legend",
|
||||
"textStyle": {
|
||||
"paddingLeft": 5
|
||||
}
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer_4"
|
||||
},
|
||||
"position": {
|
||||
"basis": "35px",
|
||||
"grow": 1
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"backgroundColor": "#3B3B3B",
|
||||
"borderColor": "#CAC3C3",
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": 1,
|
||||
"overflow": "hidden",
|
||||
"paddingLeft": 5
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
},
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label"
|
||||
},
|
||||
"position": {
|
||||
"basis": "148px",
|
||||
"grow": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.textStyle.fontSize": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.font_size"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"text": "MHE Stopped"
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer",
|
||||
"tooltip": {
|
||||
"enabled": true,
|
||||
"sustain": 1500,
|
||||
"text": "MHE is stopped (State2)"
|
||||
}
|
||||
},
|
||||
"position": {
|
||||
"basis": "200px",
|
||||
"grow": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.style.backgroundColor": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.colours.state0"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"borderBottomLeftRadius": 4,
|
||||
"borderBottomRightRadius": 4,
|
||||
"borderTopLeftRadius": 4,
|
||||
"borderTopRightRadius": 4,
|
||||
"marginBottom": 0,
|
||||
"marginLeft": 10,
|
||||
"marginRight": 5,
|
||||
"marginTop": 1,
|
||||
"overflow": "hidden",
|
||||
"paddingLeft": 10
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
},
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label"
|
||||
},
|
||||
"position": {
|
||||
"basis": "148px",
|
||||
"grow": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.textStyle.fontSize": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.font_size"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"text": "MHE Running"
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer_0",
|
||||
"tooltip": {
|
||||
"enabled": true,
|
||||
"sustain": 1500,
|
||||
"text": "MHE is running (State3)"
|
||||
}
|
||||
},
|
||||
"position": {
|
||||
"basis": "200px",
|
||||
"grow": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.style.backgroundColor": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.colours.state5"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"borderBottomLeftRadius": 4,
|
||||
"borderBottomRightRadius": 4,
|
||||
"borderTopLeftRadius": 4,
|
||||
"borderTopRightRadius": 4,
|
||||
"marginBottom": 0,
|
||||
"marginLeft": 5,
|
||||
"marginRight": 10,
|
||||
"marginTop": 1,
|
||||
"overflow": "hidden",
|
||||
"paddingLeft": 10
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer"
|
||||
},
|
||||
"position": {
|
||||
"basis": "45px",
|
||||
"grow": 1
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"backgroundColor": "#3B3B3B",
|
||||
"borderColor": "#CAC3C3",
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": 1,
|
||||
"overflow": "hidden"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
},
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label"
|
||||
},
|
||||
"position": {
|
||||
"basis": "148px",
|
||||
"grow": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.textStyle.fontSize": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.font_size"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"text": "Healthy"
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer"
|
||||
},
|
||||
"position": {
|
||||
"basis": "200px",
|
||||
"grow": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.style.backgroundColor": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.colours.state5"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"borderBottomLeftRadius": 4,
|
||||
"borderBottomRightRadius": 4,
|
||||
"borderTopLeftRadius": 4,
|
||||
"borderTopRightRadius": 4,
|
||||
"marginBottom": 0,
|
||||
"marginLeft": 10,
|
||||
"marginRight": 5,
|
||||
"marginTop": 1,
|
||||
"overflow": "hidden",
|
||||
"paddingLeft": 10
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
},
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label"
|
||||
},
|
||||
"position": {
|
||||
"basis": "148px",
|
||||
"grow": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.textStyle.fontSize": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.font_size"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"text": "Diagnostic"
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer_0",
|
||||
"tooltip": {
|
||||
"enabled": true,
|
||||
"sustain": 1500,
|
||||
"text": "Diagnostic Information"
|
||||
}
|
||||
},
|
||||
"position": {
|
||||
"basis": "200px",
|
||||
"grow": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.style.backgroundColor": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.colours.state4"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"borderBottomLeftRadius": 4,
|
||||
"borderBottomRightRadius": 4,
|
||||
"borderTopLeftRadius": 4,
|
||||
"borderTopRightRadius": 4,
|
||||
"marginBottom": 0,
|
||||
"marginLeft": 5,
|
||||
"marginRight": 10,
|
||||
"marginTop": 1,
|
||||
"overflow": "hidden",
|
||||
"paddingLeft": 10
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer_0",
|
||||
"tooltip": {
|
||||
"enabled": true,
|
||||
"sustain": 1500,
|
||||
"text": "Healthy, no active alarms"
|
||||
}
|
||||
},
|
||||
"position": {
|
||||
"basis": "45px",
|
||||
"grow": 1
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"backgroundColor": "#3B3B3B",
|
||||
"borderColor": "#CAC3C3",
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": 1,
|
||||
"overflow": "hidden"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
},
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label"
|
||||
},
|
||||
"position": {
|
||||
"basis": "148px",
|
||||
"grow": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.textStyle.fontSize": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.font_size"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"text": "Low",
|
||||
"textStyle": {
|
||||
"color": "#000000"
|
||||
}
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer",
|
||||
"tooltip": {
|
||||
"enabled": true,
|
||||
"sustain": 1500,
|
||||
"text": "Running at reduced capacity"
|
||||
}
|
||||
},
|
||||
"position": {
|
||||
"basis": "200px",
|
||||
"grow": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.style.backgroundColor": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.colours.state3"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"borderBottomLeftRadius": 4,
|
||||
"borderBottomRightRadius": 4,
|
||||
"borderTopLeftRadius": 4,
|
||||
"borderTopRightRadius": 4,
|
||||
"marginBottom": 0,
|
||||
"marginLeft": 10,
|
||||
"marginRight": 5,
|
||||
"marginTop": 1,
|
||||
"overflow": "hidden",
|
||||
"paddingLeft": 10
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
},
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label"
|
||||
},
|
||||
"position": {
|
||||
"basis": "148px",
|
||||
"grow": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.textStyle.fontSize": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.font_size"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"text": "Medium"
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer_0",
|
||||
"tooltip": {
|
||||
"enabled": true,
|
||||
"sustain": 1500,
|
||||
"text": "Controlled stop"
|
||||
}
|
||||
},
|
||||
"position": {
|
||||
"basis": "200px",
|
||||
"grow": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.style.backgroundColor": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.colours.state2"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"borderBottomLeftRadius": 4,
|
||||
"borderBottomRightRadius": 4,
|
||||
"borderTopLeftRadius": 4,
|
||||
"borderTopRightRadius": 4,
|
||||
"marginBottom": 0,
|
||||
"marginLeft": 5,
|
||||
"marginRight": 10,
|
||||
"marginTop": 1,
|
||||
"overflow": "hidden",
|
||||
"paddingLeft": 10
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer_1"
|
||||
},
|
||||
"position": {
|
||||
"basis": "45px",
|
||||
"grow": 1
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"backgroundColor": "#3B3B3B",
|
||||
"borderBottomLeftRadius": 4,
|
||||
"borderBottomRightRadius": 4,
|
||||
"borderColor": "#CAC3C3",
|
||||
"borderStyle": "solid",
|
||||
"borderTopLeftRadius": 4,
|
||||
"borderTopRightRadius": 4,
|
||||
"borderWidth": 1,
|
||||
"overflow": "hidden",
|
||||
"paddingLeft": 1
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
},
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"meta": {
|
||||
"name": "Label"
|
||||
},
|
||||
"position": {
|
||||
"basis": "148px",
|
||||
"grow": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.textStyle.fontSize": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.font_size"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"text": "High"
|
||||
},
|
||||
"type": "ia.display.label"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer",
|
||||
"tooltip": {
|
||||
"enabled": true,
|
||||
"sustain": 1500,
|
||||
"text": "Uncontrolled stop"
|
||||
}
|
||||
},
|
||||
"position": {
|
||||
"basis": "200px",
|
||||
"grow": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.style.backgroundColor": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "session.custom.colours.state1"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"borderBottomLeftRadius": 4,
|
||||
"borderBottomRightRadius": 4,
|
||||
"borderTopLeftRadius": 4,
|
||||
"borderTopRightRadius": 4,
|
||||
"marginBottom": 0,
|
||||
"marginLeft": 10,
|
||||
"marginRight": 5,
|
||||
"marginTop": 1,
|
||||
"overflow": "hidden",
|
||||
"paddingLeft": 10
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
},
|
||||
{
|
||||
"children": [
|
||||
{
|
||||
"events": {
|
||||
"component": {
|
||||
"onActionPerformed": {
|
||||
"config": {
|
||||
"draggable": true,
|
||||
"id": "K1uUHAix",
|
||||
"modal": true,
|
||||
"overlayDismiss": true,
|
||||
"resizable": true,
|
||||
"showCloseIcon": true,
|
||||
"title": "Legend",
|
||||
"type": "open",
|
||||
"viewPath": "PopUp-Views/Legend",
|
||||
"viewportBound": false
|
||||
},
|
||||
"scope": "C",
|
||||
"type": "popup"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "Button"
|
||||
},
|
||||
"position": {
|
||||
"basis": "168px",
|
||||
"grow": 1
|
||||
},
|
||||
"propConfig": {
|
||||
"props.textStyle.fontSize": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.custom.font_size"
|
||||
},
|
||||
"type": "property"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"image": {
|
||||
"icon": {
|
||||
"path": "material/legend_toggle"
|
||||
},
|
||||
"style": {
|
||||
"backgroundColor": "#555555"
|
||||
}
|
||||
},
|
||||
"justify": "start",
|
||||
"style": {
|
||||
"backgroundColor": "#555555",
|
||||
"paddingLeft": 8
|
||||
},
|
||||
"text": "DETAILS"
|
||||
},
|
||||
"type": "ia.input.button"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer_0"
|
||||
},
|
||||
"position": {
|
||||
"basis": "200px",
|
||||
"grow": 1
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"backgroundColor": "#555555",
|
||||
"marginBottom": 0,
|
||||
"marginLeft": 5,
|
||||
"marginRight": 10,
|
||||
"marginTop": 1
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer_2"
|
||||
},
|
||||
"position": {
|
||||
"basis": "45px",
|
||||
"grow": 1
|
||||
},
|
||||
"props": {
|
||||
"style": {
|
||||
"backgroundColor": "#3B3B3B",
|
||||
"borderColor": "#CAC3C3",
|
||||
"borderStyle": "solid",
|
||||
"borderWidth": 1,
|
||||
"overflow": "hidden"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "FlexContainer_6"
|
||||
},
|
||||
"position": {
|
||||
"basis": "800px",
|
||||
"grow": 1
|
||||
},
|
||||
"props": {
|
||||
"direction": "column"
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root"
|
||||
},
|
||||
"props": {
|
||||
"direction": "column",
|
||||
"style": {
|
||||
"classes": "Background-Styles/Controller"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
}
|
||||
@ -1,333 +0,0 @@
|
||||
{
|
||||
"custom": {
|
||||
"Color": 6
|
||||
},
|
||||
"params": {
|
||||
"ASdata": "value",
|
||||
"Browser": "Amazon",
|
||||
"Color": "",
|
||||
"DeviceType": "value",
|
||||
"FolderPath": "value",
|
||||
"Vendor": "value",
|
||||
"Vis_border": true,
|
||||
"tagPath": "tagPath"
|
||||
},
|
||||
"propConfig": {
|
||||
"params.ASdata": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Browser": {
|
||||
"paramDirection": "output",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Color": {
|
||||
"paramDirection": "inout"
|
||||
},
|
||||
"params.DeviceType": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.FolderPath": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Vendor": {
|
||||
"paramDirection": "input",
|
||||
"persistent": true
|
||||
},
|
||||
"params.Vis_border": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
},
|
||||
"params.tagPath": {
|
||||
"paramDirection": "inout",
|
||||
"persistent": true
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"defaultSize": {
|
||||
"height": 75,
|
||||
"width": 200
|
||||
},
|
||||
"loading": {
|
||||
"mode": "blocking"
|
||||
}
|
||||
},
|
||||
"root": {
|
||||
"children": [
|
||||
{
|
||||
"events": {
|
||||
"dom": {
|
||||
"onClick": {
|
||||
"config": {
|
||||
"draggable": false,
|
||||
"id": "information",
|
||||
"modal": false,
|
||||
"overlayDismiss": false,
|
||||
"resizable": false,
|
||||
"showCloseIcon": false,
|
||||
"type": "open",
|
||||
"viewParams": {
|
||||
"ASdata": "{view.params.ASdata}",
|
||||
"Browser": "{view.params.Browser}",
|
||||
"DeviceType": "{view.params.DeviceType}",
|
||||
"FolderPath": "{view.params.FolderPath}",
|
||||
"Vendor": "{view.params.Vendor}",
|
||||
"tagPath": "{view.params.tagPath}"
|
||||
},
|
||||
"viewPath": "Windows/Information/Information",
|
||||
"viewportBound": false
|
||||
},
|
||||
"scope": "C",
|
||||
"type": "popup"
|
||||
}
|
||||
}
|
||||
},
|
||||
"meta": {
|
||||
"name": "Conveyor horizontal_0"
|
||||
},
|
||||
"position": {
|
||||
"basis": "100%"
|
||||
},
|
||||
"propConfig": {
|
||||
"props.elements[0].elements[0].elements[0].style.visibility": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.Vis_border"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": null,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": true,
|
||||
"output": "visible"
|
||||
},
|
||||
{
|
||||
"input": false,
|
||||
"output": "hidden"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.elements[0].elements[0].elements[1].style.visibility": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.Vis_border"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": null,
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": true,
|
||||
"output": "visible"
|
||||
},
|
||||
{
|
||||
"input": false,
|
||||
"output": "hidden"
|
||||
}
|
||||
],
|
||||
"outputType": "scalar",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.elements[0].elements[1].fill.paint": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"path": "view.params.Color"
|
||||
},
|
||||
"transforms": [
|
||||
{
|
||||
"fallback": "#000000",
|
||||
"inputType": "scalar",
|
||||
"mappings": [
|
||||
{
|
||||
"input": 0,
|
||||
"output": "#808080"
|
||||
},
|
||||
{
|
||||
"input": 1,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 2,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 3,
|
||||
"output": "#FF8C00"
|
||||
},
|
||||
{
|
||||
"input": 4,
|
||||
"output": "#0000FF"
|
||||
},
|
||||
{
|
||||
"input": 5,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 6,
|
||||
"output": "#FF0000"
|
||||
},
|
||||
{
|
||||
"input": 7,
|
||||
"output": "#00D900"
|
||||
},
|
||||
{
|
||||
"input": 8,
|
||||
"output": "#FFE8CC"
|
||||
},
|
||||
{
|
||||
"input": 9,
|
||||
"output": "#D3D3D3"
|
||||
},
|
||||
{
|
||||
"input": 10,
|
||||
"output": "#00D900"
|
||||
},
|
||||
{
|
||||
"input": 11,
|
||||
"output": "#AC5F00"
|
||||
},
|
||||
{
|
||||
"input": 12,
|
||||
"output": "#AC5F00"
|
||||
},
|
||||
{
|
||||
"input": 13,
|
||||
"output": "#CCCCFF"
|
||||
},
|
||||
{
|
||||
"input": 14,
|
||||
"output": "#87CEFA"
|
||||
},
|
||||
{
|
||||
"input": 15,
|
||||
"output": "#FFFF47"
|
||||
}
|
||||
],
|
||||
"outputType": "color",
|
||||
"type": "map"
|
||||
}
|
||||
],
|
||||
"type": "property"
|
||||
}
|
||||
},
|
||||
"props.style.classes": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "if ({view.params.tagPath} \u003d {session.custom.Search},\r\n\"table/SearchTaghighlight\", \"\")"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"elements": [
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"elements": [
|
||||
{
|
||||
"fill": {
|
||||
"paint": "#DCDCDC"
|
||||
},
|
||||
"height": "47",
|
||||
"name": "rect",
|
||||
"style": {},
|
||||
"type": "rect",
|
||||
"width": "107",
|
||||
"x": "0.5",
|
||||
"y": "0.5"
|
||||
},
|
||||
{
|
||||
"d": "M107,1V47H1V1H107m1-1H0V48H108V0Z",
|
||||
"fill": {
|
||||
"paint": "#808080"
|
||||
},
|
||||
"name": "path",
|
||||
"style": {},
|
||||
"type": "path"
|
||||
}
|
||||
],
|
||||
"name": "group",
|
||||
"type": "group"
|
||||
},
|
||||
{
|
||||
"fill": {},
|
||||
"height": "108",
|
||||
"name": "rect",
|
||||
"transform": "translate(78 -30) rotate(90)",
|
||||
"type": "rect",
|
||||
"width": "40",
|
||||
"x": "34",
|
||||
"y": "-30"
|
||||
}
|
||||
],
|
||||
"name": "group",
|
||||
"type": "group"
|
||||
}
|
||||
],
|
||||
"preserveAspectRatio": "none",
|
||||
"style": {
|
||||
"cursor": "pointer"
|
||||
},
|
||||
"viewBox": "0 0 108 48"
|
||||
},
|
||||
"type": "ia.shapes.svg"
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"name": "root",
|
||||
"tooltip": {
|
||||
"style": {
|
||||
"backgroundColor": "#2B2B2BBF",
|
||||
"color": "#FFFFFF",
|
||||
"fontSize": 12,
|
||||
"textAlign": "left",
|
||||
"white-space": "pre"
|
||||
}
|
||||
}
|
||||
},
|
||||
"propConfig": {
|
||||
"meta.tooltip.enabled": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "If ({view.params.ASdata} \u003d \"Conv\", true, false) "
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
},
|
||||
"meta.tooltip.text": {
|
||||
"binding": {
|
||||
"config": {
|
||||
"expression": "replace({view.params.tagPath}, \"_\", \"-\")+\r\n\"\\n Status: \"+ \r\ncase (tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Color\"),\r\n0 ,tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Color/Alarms/Stat_Quality.DisplayPath\"),\r\n1 ,tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Color/Alarms/Stat_EStop.DisplayPath\"),\r\n2 ,tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Color/Alarms/Stat_UnitFaulted.DisplayPath\"), \r\n3 ,tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Color/Alarms/Stat_Jam.DisplayPath\"),\r\n99 ,tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Color/Alarms/Stat_Jam.DisplayPath\"), \r\n5 ,tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Color/Alarms/Stat_Drive_Fault.DisplayPath\"), \r\n4 ,tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Color/Alarms/Stat_Full100.DisplayPath\"), \r\n99 ,tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Color/Alarms/Stat_Full75.DisplayPath\"),\r\n99 ,tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Color/Alarms/Stat_Full50.DisplayPath\"),\r\n99 ,tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Color/Alarms/Stat_Full25.DisplayPath\"),\r\n7 ,tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Color/Alarms/Stat_Running.DisplayPath\"), \r\n10 ,tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Color/Alarms/Stat_Running.DisplayPath\"),\r\n11 ,tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Color/Alarms/Stat_Manual_Stopped.DisplayPath\"), \r\n12 ,tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Color/Alarms/Stat_Manual_Running.DisplayPath\"), \r\n9 ,tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Color/Alarms/Stat_Stopped.DisplayPath\"), \r\n14 ,tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Color/Alarms/Stat_AEM.DisplayPath\"),\r\n6 ,tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Color/Alarms/Stat_PBstopped.DisplayPath\"), \r\n100,tag(\"[\"+{view.params.Browser}+\"]\"+{view.params.FolderPath}+{view.params.tagPath}+\"/HMI/Color/Alarms/Stat_Gravity.DisplayPath\"),\r\n\"not response\")"
|
||||
},
|
||||
"type": "expr"
|
||||
}
|
||||
}
|
||||
},
|
||||
"props": {
|
||||
"alignContent": "center",
|
||||
"direction": "column",
|
||||
"justify": "center",
|
||||
"style": {
|
||||
"overflow": "visible",
|
||||
"transform": "translate3d(0,0,0)"
|
||||
}
|
||||
},
|
||||
"type": "ia.container.flex"
|
||||
}
|
||||
}
|
||||