This commit is contained in:
Salijoghli 2025-10-07 19:20:00 +04:00
parent 03d7dbe836
commit f38f97fee0
527 changed files with 565903 additions and 0 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,707 @@
{
"custom": {
"color": "#C2C2C2",
"isHighlited": false,
"overlayColor": "#ffffff",
"priority": "No Active Alarms",
"state": "Closed"
},
"params": {
"highlight": "",
"tagProps": [
"System/MCM02/Photoeyes/PE/S03_CH107_PE1",
"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": "coalesce({value},0)",
"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.isHighlited": {
"binding": {
"config": {
"expression": "{view.params.highlight} !\u003d \"\""
},
"type": "expr"
},
"persistent": true
},
"custom.overlayColor": {
"binding": {
"config": {
"path": "view.params.highlight"
},
"transforms": [
{
"fallback": "#ffffff",
"inputType": "scalar",
"mappings": [
{
"input": "Diagnostic",
"output": "rgb(88, 158, 249)"
},
{
"input": "Low",
"output": "rgb(255, 255, 0)"
},
{
"input": "Medium",
"output": "rgb(247, 160, 96)"
},
{
"input": "High",
"output": "rgb(245, 95, 89)"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
},
"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.highlight": {
"paramDirection": "input",
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 25,
"width": 100
}
},
"root": {
"children": [
{
"meta": {
"name": "arrow_icon"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.elements[0].stroke.paint": {
"binding": {
"config": {
"path": "view.custom.overlayColor"
},
"type": "property"
}
},
"props.elements[0].style.animation": {
"binding": {
"config": {
"expression": "if ({view.custom.isHighlited}, \"2.5s linear infinite both pulse\", \"\")"
},
"type": "expr"
}
},
"props.elements[1].stroke.paint": {
"binding": {
"config": {
"path": "view.custom.overlayColor"
},
"type": "property"
}
},
"props.elements[1].style.animation": {
"binding": {
"config": {
"expression": "if ({view.custom.isHighlited}, \"2.5s linear infinite both pulse\", \"\")"
},
"type": "expr"
}
},
"props.elements[2].stroke.paint": {
"binding": {
"config": {
"path": "view.custom.overlayColor"
},
"type": "property"
}
},
"props.elements[2].style.animation": {
"binding": {
"config": {
"expression": "if ({view.custom.isHighlited}, \"2.5s linear infinite both pulse\", \"\")"
},
"type": "expr"
}
},
"props.elements[3].fill.paint": {
"binding": {
"config": {
"path": "view.custom.color"
},
"type": "property"
}
},
"props.elements[5].fill.paint": {
"binding": {
"config": {
"path": "view.custom.color"
},
"type": "property"
}
}
},
"props": {
"elements": [
{
"d": "M 90.5,1.5 L 99.25,1.5 L 99.25,23.67 L 90.5,23.67 Z",
"fill": {
"paint": "#589ef9"
},
"id": "glow_rect",
"name": "glow_rect",
"stroke": {
"width": 5
},
"style": {
"opacity": 0,
"transition": "opacity 2.5s linear"
},
"type": "path"
},
{
"d": "m -1.2129288,26.568508 0.100729,-29.7301413 M 0.55192196,26.621269 27.06045,13.160606 M 0.0746482,-1.8229853 26.662724,11.47986",
"fill": {
"url": "url(#linearGradient26)"
},
"id": "glow_triangle",
"name": "glow_triangle",
"stroke": {
"width": 5.68064
},
"style": {
"opacity": 0,
"transition": "opacity 2.5s linear"
},
"type": "path"
},
{
"fill": {
"opacity": "1",
"url": "url(#linearGradient9)"
},
"id": "glow_line",
"name": "glow_line",
"stroke": {
"width": "5.92368"
},
"style": {
"classes": "",
"opacity": 0,
"transition": "opacity 2.5s linear"
},
"type": "line",
"x1": "23.512833",
"x2": 91.474541,
"y1": "12.531563",
"y2": "12.531563"
},
{
"d": "M 21.343364,12.531563 2.1710548,22.117718 V 2.9454084 Z",
"fill": {},
"id": "path1",
"name": "path1",
"stroke": {
"paint": "#000000",
"width": "1.91723"
},
"style": {
"shadow": "0 0 12px 5px rgba(88, 158, 249, 0.8)"
},
"type": "path"
},
{
"id": "line1",
"name": "line1",
"stroke": {
"dasharray": "2, 2",
"paint": "#000000",
"width": "3.06818"
},
"type": "line",
"x1": "22.528276",
"x2": "96.180107",
"y1": "12.531563",
"y2": "12.531563"
},
{
"fill": {},
"height": "19.17231",
"id": "rect1",
"name": "rect1",
"stroke": {
"paint": "#000000",
"width": "1.91723"
},
"type": "rect",
"width": "5.7516928",
"x": "92.519203",
"y": "3.1996493"
}
],
"preserveAspectRatio": "none",
"style": {
"overflow": "visible"
},
"viewBox": "0 0 100 25"
},
"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_photoeyes"
},
"type": "property"
}
}
},
"props": {
"mode": "percent",
"style": {
"cursor": "pointer",
"overflow": "visible",
"userSelect": "none"
}
},
"type": "ia.container.coord"
}
}

View File

@ -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"
}
}

View File

@ -0,0 +1,640 @@
{
"custom": {
"dpm1-dpm2": true,
"dpm2-dpm3": true,
"dpm3-dpm4": true,
"dpm4-mcm": true,
"mcm-dpm1": true
},
"params": {
"tagProps": [
"System/MCM03/Rack",
"System/MCM03/IO_BLOCK/DPM/PS3_1_DPM1",
"System/MCM03/IO_BLOCK/DPM/PS3_1_DPM2",
"System/MCM03/IO_BLOCK/DPM/PS4_1_DPM1",
"System/MCM03/IO_BLOCK/DPM/PS4_1_DPM2"
]
},
"propConfig": {
"custom.dpm1-dpm2": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"1": "{view.params.tagProps[1]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{1}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},false)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
},
{
"input": true,
"output": false
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.dpm2-dpm3": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"2": "{view.params.tagProps[2]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{2}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},false)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
},
{
"input": true,
"output": false
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.dpm3-dpm4": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"3": "{view.params.tagProps[3]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{3}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},false)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
},
{
"input": true,
"output": false
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.dpm4-mcm": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"4": "{view.params.tagProps[4]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{4}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},false)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
},
{
"input": true,
"output": false
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.mcm-dpm1": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},false)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
},
{
"input": true,
"output": false
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 894,
"width": 1920
}
},
"root": {
"children": [
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.session.custom.dpm_view_path \u003d self.props.params.view\n\tself.session.custom.show_dpm_device_view \u003d True"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "MCM"
},
"position": {
"height": 0.5,
"width": 0.3333,
"x": 0.6666,
"y": 0.5
},
"propConfig": {
"props.params.InOn": {
"binding": {
"config": {
"path": "view.custom.dpm4-mcm"
},
"type": "property"
}
},
"props.params.OutOn": {
"binding": {
"config": {
"path": "view.custom.mcm-dpm1"
},
"type": "property"
}
}
},
"props": {
"params": {
"InDown": false,
"InLeft": true,
"InUp": false,
"OutDown": false,
"OutRight": false,
"OutUp": true
},
"path": "Windows/Tabs/Enternet Windows/Components/EN4TR"
},
"type": "ia.display.view"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.session.custom.dpm_view_path \u003d self.props.params.view\n\tself.session.custom.show_dpm_device_view \u003d True"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "PS3_1_DPM1"
},
"position": {
"height": 0.5,
"width": 0.3333,
"x": 0.6666
},
"propConfig": {
"props.params.InOn": {
"binding": {
"config": {
"path": "view.custom.dpm1-dpm2"
},
"type": "property"
}
},
"props.params.OutOn": {
"binding": {
"config": {
"path": "view.custom.mcm-dpm1"
},
"type": "property"
}
}
},
"props": {
"params": {
"Down1": false,
"Down2": false,
"Down3": true,
"DownLeft": false,
"DownOn": false,
"DownRight": false,
"InDown": false,
"InLeft": true,
"InUp": false,
"OutDown": true,
"OutRight": false,
"OutUp": false,
"view": "Windows/Tabs/Enternet Windows/DPMs/DPM Devices/MCM03/PS3_1_DPM1"
},
"path": "Windows/Tabs/Enternet Windows/Components/DPM_BLOCK"
},
"type": "ia.display.view"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.session.custom.dpm_view_path \u003d self.props.params.view\n\tself.session.custom.show_dpm_device_view \u003d True"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "PS3_1_DPM2"
},
"position": {
"height": 0.5,
"width": 0.3333,
"x": 0.3333
},
"propConfig": {
"props.params.InOn": {
"binding": {
"config": {
"path": "view.custom.dpm2-dpm3"
},
"type": "property"
}
},
"props.params.OutOn": {
"binding": {
"config": {
"path": "view.custom.dpm1-dpm2"
},
"type": "property"
}
}
},
"props": {
"params": {
"Down1": false,
"Down2": false,
"Down3": false,
"DownLeft": false,
"DownOn": false,
"DownRight": false,
"InDown": false,
"InLeft": true,
"InUp": false,
"OutDown": false,
"OutRight": true,
"OutUp": false,
"view": "Windows/Tabs/Enternet Windows/DPMs/DPM Devices/MCM03/PS3_1_DPM2"
},
"path": "Windows/Tabs/Enternet Windows/Components/DPM_BLOCK"
},
"type": "ia.display.view"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.session.custom.dpm_view_path \u003d self.props.params.view\n\tself.session.custom.show_dpm_device_view \u003d True"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "PS4_1_DPM1"
},
"position": {
"height": 0.5,
"width": 0.3333
},
"propConfig": {
"props.params.DownOn": {
"binding": {
"config": {
"path": "view.custom.dpm3-dpm4"
},
"type": "property"
}
},
"props.params.InOn": {
"binding": {
"config": {
"path": "view.custom.dpm3-dpm4"
},
"type": "property"
}
},
"props.params.OutOn": {
"binding": {
"config": {
"path": "view.custom.dpm2-dpm3"
},
"type": "property"
}
}
},
"props": {
"params": {
"Down1": false,
"Down2": true,
"Down3": false,
"DownLeft": false,
"DownRight": false,
"InDown": true,
"InLeft": false,
"InUp": false,
"OutDown": false,
"OutRight": true,
"OutUp": false,
"view": "Windows/Tabs/Enternet Windows/DPMs/DPM Devices/MCM03/PS4_1_DPM1"
},
"path": "Windows/Tabs/Enternet Windows/Components/DPM_BLOCK"
},
"type": "ia.display.view"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.session.custom.dpm_view_path \u003d self.props.params.view\n\tself.session.custom.show_dpm_device_view \u003d True"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "PS4_1_DPM2"
},
"position": {
"height": 0.5,
"width": 0.3333,
"y": 0.5
},
"propConfig": {
"props.params.InOn": {
"binding": {
"config": {
"path": "view.custom.dpm3-dpm4"
},
"type": "property"
}
},
"props.params.OutOn": {
"binding": {
"config": {
"path": "view.custom.dpm4-mcm"
},
"type": "property"
}
}
},
"props": {
"params": {
"Down1": false,
"Down2": false,
"Down3": false,
"DownLeft": false,
"DownOn": false,
"DownRight": false,
"InDown": false,
"InLeft": false,
"InUp": true,
"OutDown": false,
"OutRight": true,
"OutUp": false,
"view": "Windows/Tabs/Enternet Windows/DPMs/DPM Devices/MCM03/PS4_1_DPM2"
},
"path": "Windows/Tabs/Enternet Windows/Components/DPM_BLOCK"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "DPM1_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.65,
"y": 0.1
},
"props": {
"text": "PS3_1_DPM1 11.200.1.2",
"textStyle": {
"fontSize": "1vmin"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "DPM2_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.32,
"y": 0.1
},
"props": {
"text": "PS3_1_DPM2 11.200.1.3",
"textStyle": {
"fontSize": "1vmin"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "DPM3_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.005,
"y": 0.1
},
"props": {
"text": "PS4_1_DPM1 11.200.1.4",
"textStyle": {
"fontSize": "1vmin"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "DPM4_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.005,
"y": 0.6
},
"props": {
"text": "PS4_1_DPM2 11.200.1.5",
"textStyle": {
"fontSize": "1vmin"
}
},
"type": "ia.display.label"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.session.custom.dpm_view_path \u003d self.props.params.view\n\tself.session.custom.show_dpm_device_view \u003d True"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "DEVICE"
},
"position": {
"height": 0.5,
"width": 0.3333,
"x": 0.3333,
"y": 0.4999
},
"propConfig": {
"props.params.On": {
"binding": {
"config": {
"path": "view.custom.dpm4-mcm"
},
"type": "property"
}
}
},
"props": {
"params": {
"LR": true,
"LRU": false,
"LU": false,
"RD": false,
"RLD": false,
"RLU": false,
"RU": false
},
"path": "Windows/Tabs/Enternet Windows/Components/CommLines"
},
"type": "ia.display.view"
}
],
"meta": {
"name": "root"
},
"position": {
"x": 120,
"y": -723
},
"props": {
"mode": "percent",
"style": {
"backgroundColor": "#ffffff"
}
},
"type": "ia.container.coord"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,244 @@
{
"custom": {},
"params": {
"device_name": "Test",
"driver": "value",
"enabled": false,
"host_name": "value",
"status": "value"
},
"propConfig": {
"params.device_name": {
"paramDirection": "input",
"persistent": true
},
"params.driver": {
"paramDirection": "input",
"persistent": true
},
"params.enabled": {
"paramDirection": "input",
"persistent": true
},
"params.host_name": {
"paramDirection": "input",
"persistent": true
},
"params.status": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 50,
"width": 1908
}
},
"root": {
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"basis": "400px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.params.device_name"
},
"type": "property"
}
}
},
"props": {
"style": {
"textAlign": "center"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "400px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.params.driver"
},
"type": "property"
}
}
},
"props": {
"style": {
"textAlign": "center"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_1"
},
"position": {
"basis": "200px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.params.enabled"
},
"type": "property"
}
}
},
"props": {
"style": {
"textAlign": "center"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_2"
},
"position": {
"basis": "564px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.params.status"
},
"type": "property"
}
}
},
"props": {
"style": {
"textAlign": "center"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_3"
},
"position": {
"basis": "564px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.params.host_name"
},
"type": "property"
}
}
},
"props": {
"style": {
"textAlign": "center"
}
},
"type": "ia.display.label"
},
{
"children": [
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "2px",
"grow": 1
},
"type": "ia.display.label"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\timport sys\n\tfrom java.lang import Exception\n\t\n\ttry:\n\t\tif system.tag.exists(\"System/DeviceList\"):\n\t\t\tdevice_cfg \u003d system.tag.read(\"System/DeviceList\").value\n\t\t\tif device_cfg\u003d\u003d\u0027\u0027:\n\t\t\t\tdevice_cfg\u003d\u0027{}\u0027\n\t\t\tcfg \u003d system.util.jsonDecode(device_cfg)\n\t\t\tenabled \u003d self.view.params.enabled\n\t\t\tdevice \u003d self.view.params.device_name\n\t\t\tsystem.perspective.print(enabled)\n\t\t\tif enabled:\n\t\t\t\tdevice_list \u003d cfg.get(\"Devicedisable\",[])\n\t\t\t\tif device not in device_list:\n\t\t\t\t\tdevice_list.append(device)\n\t\t\t\tcfg[\"Devicedisable\"] \u003d device_list\n\t\t\tif not enabled:\n\t\t\t\tdevice_list \u003d cfg.get(\"DeviceEnable\",[])\n\t\t\t\tif device not in device_list:\n\t\t\t\t\tdevice_list.append(device)\n\t\t\t\tcfg[\"DeviceEnable\"] \u003d device_list\n\t\t\tsystem.perspective.print(cfg) \n\t\t\tencode \u003d system.util.jsonEncode(cfg)\n\t\t\tsystem.tag.write(\"System/DeviceList\",encode)\t\n\texcept:\n\t logger \u003d system.util.getLogger(\"Device_Enable\")\n\t exc_type, exc_obj, tb \u003d sys.exc_info()\n\t lineno \u003d tb.tb_lineno\n\t errorMessage\u003d str(lineno) + str(exc_type) + str(exc_obj)\n\t #system.gui.errorBox(errorMessage,\"Error\")\n\t "
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Button_0"
},
"position": {
"basis": "50px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"expression": "if({view.params.enabled} \u003d True, \"Disable Device\", \"Enable Device\")"
},
"type": "expr"
}
}
},
"props": {
"style": {
"classes": "Buttons/PB_1"
}
},
"type": "ia.input.button"
},
{
"meta": {
"name": "Label"
},
"position": {
"basis": "2px",
"grow": 1
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "200px"
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
],
"custom": {
"update": "value",
"update_enable": "value"
},
"meta": {
"name": "root"
},
"props": {
"style": {
"borderStyle": "ridge"
}
},
"type": "ia.container.flex"
}
}

View File

@ -0,0 +1,407 @@
{
"custom": {
"counts": {
"Critical": 0,
"Diagnostic": 0,
"High": 0,
"Low": 0,
"Medium": 0,
"Total": 0
},
"totalAlarms": {
"$": [
"ds",
192,
1759323051157
],
"$columns": [
{
"data": [
"MCM02",
"MCM02"
],
"name": "Location",
"type": "String"
},
{
"data": [
"High",
"Low"
],
"name": "Priority",
"type": "String"
},
{
"data": [
1,
2
],
"name": "Count",
"type": "Long"
}
]
}
},
"params": {
"value": {
"tagProps": [
"MCM01",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
}
},
"propConfig": {
"custom.counts": {
"persistent": true
},
"custom.totalAlarms": {
"binding": {
"config": {
"polling": {
"enabled": true,
"rate": "3"
},
"queryPath": "autStand/Alarms/GetActiveAlarmsByLocationAndPriority"
},
"type": "query"
},
"onChange": {
"enabled": null,
"script": "\tMCM \u003d self.params.value.tagProps[0]\n\tqueryData \u003d currentValue.value\n\t\n\t# Initialize counts\n\tcounts \u003d {\n\t \"Critical\": 0,\n\t \"High\": 0,\n\t \"Medium\": 0,\n\t \"Low\": 0,\n\t \"Diagnostic\": 0,\n\t \"Total\": 0\n\t}\n\t\n\t# Loop through dataset and aggregate\n\tfor row in range(queryData.rowCount):\n\t mcm_val \u003d queryData.getValueAt(row, 0)\n\t severity \u003d queryData.getValueAt(row, 1)\n\t count \u003d queryData.getValueAt(row, 2)\n\t\n\t if mcm_val \u003d\u003d MCM:\n\t key \u003d severity.capitalize()\n\t if key in counts:\n\t counts[key] +\u003d count\n\t counts[\"Total\"] +\u003d count\n\t \n\tself.custom.counts \u003d counts"
},
"persistent": true
},
"params.value": {
"paramDirection": "input",
"persistent": true
},
"params.value.tagProps": {
"onChange": {
"enabled": null,
"script": "\tsystem.perspective.print(currentValue.value[0])"
}
}
},
"props": {
"defaultSize": {
"height": 50,
"width": 300
}
},
"root": {
"children": [
{
"children": [
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "32px"
},
"props": {
"style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center"
},
"text": "High"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_1"
},
"position": {
"basis": "32px"
},
"props": {
"style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center"
},
"text": "Med"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_2"
},
"position": {
"basis": "32px"
},
"props": {
"style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center"
},
"text": "Low"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_3"
},
"position": {
"basis": "32px"
},
"props": {
"style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center"
},
"text": "Diag"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_4"
},
"position": {
"basis": "32px"
},
"props": {
"style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center"
},
"text": "Total"
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "25px"
},
"props": {
"justify": "space-between"
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "Label_0"
},
"position": {
"basis": "32px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.custom.counts.High"
},
"type": "property"
}
}
},
"props": {
"style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_1"
},
"position": {
"basis": "32px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.custom.counts.Medium"
},
"type": "property"
}
}
},
"props": {
"style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_2"
},
"position": {
"basis": "32px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.custom.counts.Low"
},
"type": "property"
}
}
},
"props": {
"style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_3"
},
"position": {
"basis": "32px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.custom.counts.Diagnostic"
},
"type": "property"
}
}
},
"props": {
"style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Label_4"
},
"position": {
"basis": "32px"
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.custom.counts.Total"
},
"type": "property"
}
}
},
"props": {
"style": {
"classes": "Text-Styles/Ariel-Bold-12pt",
"textAlign": "center"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer_1"
},
"position": {
"basis": "25px"
},
"props": {
"justify": "space-between"
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "root"
},
"propConfig": {
"custom.has_role": {
"binding": {
"config": {
"expression": "{session.custom.fc}"
},
"transforms": [
{
"code": "\trme_role \u003d value +\"-rme-all\"\n\troles \u003d (self.session.props.auth.user.roles)\n\tif (rme_role.lower() in roles \n\tor rme_role.upper() in roles):\n\t\treturn True\n\telse:\n\t\treturn False",
"type": "script"
}
],
"type": "expr"
}
},
"custom.status": {
"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": "if(isNull({value}), 0, {value})",
"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"
}
}
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
}

View File

@ -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)

View File

@ -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)

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,323 @@
{
"custom": {
"State": "#FFFFFF",
"Status": "#808080",
"state_string": "Empty/Idle",
"status_string": "Unknown Status"
},
"params": {
"angle": 0,
"directionLeft": false,
"tagProps": [
"System/MCM01/Conveyor/VFD/UL1_3_VFD1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"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}/dwState"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
},
{
"code": "\tif value is None:\n\t\treturn \u0027#808080\u0027 # Grey - No Data\n\t\n\t# Check bits in priority order (highest priority first)\n\t\n\t# Priority 5 - Test/Maintenance - Brown\n\tif value \u0026 128: # Bit 7: Assigned to do a tilttest\n\t\treturn \u0027#AC5F00\u0027 # Brown - Manual/Maintenance Mode\n\t\n\t# Priority 8 - Operational Status - Green\n\tif value \u0026 256: # Bit 8: Occupied\n\t\treturn \u0027#008000\u0027 # Green - Running or ON\n\t\n\t# Priority 9 - Discharge Status - Light Green\n\tif value \u0026 8: # Bit 3: Item has been discharged\n\t\treturn \u0027#CCFFCC\u0027 # Light green - Enabled, not running\n\t\n\t# Critical/Error States - Red\n\tif value \u0026 1: # Bit 0: Disabled or faulted\n\t\treturn \u0027#FF0000\u0027 # Red - E-Stop/Unit Faulted\n\tif value \u0026 2048: # Bit 11: Occupied but disabled\n\t\treturn \u0027#FF0000\u0027 # Red - E-Stop/Unit Faulted\n\t\n\t# Active Processing States - Yellow\n\tif value \u0026 2: # Bit 1: Item being scanned by Barcode/OCR\n\t\treturn \u0027#FFFF00\u0027 # Yellow - 75% Full/50% Full/25% Full\n\tif value \u0026 4: # Bit 2: Scanned, waiting for redirect\n\t\treturn \u0027#FFFF00\u0027 # Yellow - 75% Full/50% Full/25% Full\n\tif value \u0026 16384: # Bit 14: Item being scanned by volume scanner\n\t\treturn \u0027#FFFF00\u0027 # Yellow - 75% Full/50% Full/25% Full\n\tif value \u0026 32768: # Bit 15: SPS checking carrier\n\t\treturn \u0027#FFFF00\u0027 # Yellow - 75% Full/50% Full/25% Full\n\t\n\t# Multi-carrier Operations - Blue\n\tif value \u0026 16: # Bit 4: Second or third carrier in row\n\t\treturn \u0027#0000FF\u0027 # Blue - 100% Full\n\tif value \u0026 64: # Bit 6: Part of multi-carrier item\n\t\treturn \u0027#0000FF\u0027 # Blue - 100% Full\n\t\n\t# System/Communication States - Light Sky Blue\n\tif value \u0026 512: # Bit 9: Information received from CSC/host\n\t\treturn \u0027#87CEFA\u0027 # Light Sky Blue - Energy management\n\tif value \u0026 1024: # Bit 10: Received from CCB\n\t\treturn \u0027#87CEFA\u0027 # Light Sky Blue - Energy management\n\tif value \u0026 4096: # Bit 12: Reserved for induction takeover\n\t\treturn \u0027#87CEFA\u0027 # Light Sky Blue - Energy management\n\tif value \u0026 8192: # Bit 13: Not activated for profile execution\n\t\treturn \u0027#87CEFA\u0027 # Light Sky Blue - Energy management\n\t\n\t# Special Equipment States - Light Grey\n\tif value \u0026 32: # Bit 5: Used at flipper door chutes\n\t\treturn \u0027#D3D3D3\u0027 # Light grey - OFF/Inactive\n\t\n\t# Check if bits 16-31 contain distance data\n\tdistance_bits \u003d (value \u003e\u003e 16) \u0026 0xFFFF # Extract upper 16 bits\n\tif distance_bits \u003e 0:\n\t\treturn \u0027#FFA500\u0027 # Orange - JAM (item positioning)\n\t\n\t# Default state\n\tif value \u003d\u003d 0:\n\t\treturn \u0027#FFFFFF\u0027 # White - Gravity/not motorized MHE\n\telse:\n\t\treturn \u0027#808080\u0027 # Grey - Invalid/Unavailable",
"type": "script"
}
],
"type": "tag"
},
"persistent": true
},
"custom.Status": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/dwStatus"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
},
{
"code": "\tif value is None:\n\t\treturn \u0027#808080\u0027\n\t\n\t# Critical Priority (2) - Red\n\tif value \u0026 8: # Bit 3: Common fault\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 32: # Bit 5: Possible TCB/MCB error\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 64: # Bit 6: Not checked at last CTB/CRB\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 128: # Bit 7: Communication error\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 512: # Bit 9: Current limit exceeded\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 2048: # Bit 11: Calibration error\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 4194304: # Bit 22: Item overhanging belt fault\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 8388608: # Bit 23: Current collector fault\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 16777216: # Bit 24: Item too high\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 33554432: # Bit 25: Item too wide\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 67108864: # Bit 26: Item on activated carrier\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 134217728: # Bit 27: Deflected bellows fault\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 1073741824: # Bit 30: Item on bellows warning\n\t\treturn \u0027#FF0000\u0027\n\tif value \u0026 2147483648: # Bit 31: Item on bellows is active\n\t\treturn \u0027#FF0000\u0027\n\t\n\t# High Priority (11) - Light Grey (OFF/Inactive)\n\tif value \u0026 1: # Bit 0: Disabled\n\t\treturn \u0027#D3D3D3\u0027\n\tif value \u0026 4: # Bit 2: Blocked\n\t\treturn \u0027#D900D9\u0027 # Purple - Gridlock Prevention Mode\n\t\n\t# Medium Priority (9-10) - Status OK, Motor not running\n\tif value \u0026 256: # Bit 8: Status OK\n\t\treturn \u0027#008000\u0027 # Green - Running or ON\n\tif value \u0026 1024: # Bit 10: Motor not running\n\t\treturn \u0027#CCFFCC\u0027 # Light green - Enabled, not running\n\tif value \u0026 268435456: # Bit 28: Double maximum recirculation\n\t\treturn \u0027#87CEFA\u0027 # Light Sky Blue - Energy management\n\t\n\t# Low Priority (5) - Brown (Manual/Maintenance Mode)\n\tif value \u0026 2: # Bit 1: Needs update\n\t\treturn \u0027#AC5F00\u0027\n\tif value \u0026 16: # Bit 4: CCT communication to carrier\n\t\treturn \u0027#AC5F00\u0027\n\tif value \u0026 8192: # Bit 13: Default configuration\n\t\treturn \u0027#AC5F00\u0027\n\tif value \u0026 16384: # Bit 14: Programming mode\n\t\treturn \u0027#AC5F00\u0027\n\tif value \u0026 536870912: # Bit 29: CCT download done\n\t\treturn \u0027#AC5F00\u0027\n\t\n\t# Default - Grey\n\treturn \u0027#808080\u0027",
"type": "script"
}
],
"type": "tag"
},
"persistent": true
},
"custom.state_string": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/dwState"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
},
{
"code": "\tif value is None:\n\t\treturn \u0027No Data\u0027\n\t\n\t# Check bits in priority order (highest priority first)\n\t\n\t# Priority 5 - Test/Maintenance\n\tif value \u0026 128: # Bit 7: Assigned to do a tilttest\n\t\treturn \u0027Tilt Test Mode\u0027\n\t\n\t# Priority 8 - Operational Status\n\tif value \u0026 256: # Bit 8: Occupied\n\t\treturn \u0027Occupied\u0027\n\t\n\t# Priority 9 - Discharge Status\n\tif value \u0026 8: # Bit 3: Item has been discharged\n\t\treturn \u0027Item Discharged\u0027\n\t\n\t# Other operational states (no specific priority)\n\tif value \u0026 1: # Bit 0: Disabled or faulted\n\t\treturn \u0027Disabled/Faulted\u0027\n\tif value \u0026 2: # Bit 1: Item being scanned by Barcode/OCR\n\t\treturn \u0027Barcode Scanning\u0027\n\tif value \u0026 4: # Bit 2: Scanned, waiting for redirect\n\t\treturn \u0027Awaiting Redirect\u0027\n\tif value \u0026 16: # Bit 4: Second or third carrier in row\n\t\treturn \u0027Multi-Carrier Row\u0027\n\tif value \u0026 32: # Bit 5: Used at flipper door chutes\n\t\treturn \u0027Flipper Door Mode\u0027\n\tif value \u0026 64: # Bit 6: Part of multi-carrier item\n\t\treturn \u0027Multi-Carrier Item\u0027\n\tif value \u0026 512: # Bit 9: Information received from CSC/host\n\t\treturn \u0027Host Data Received\u0027\n\tif value \u0026 1024: # Bit 10: Received from CCB\n\t\treturn \u0027CCB Received\u0027\n\tif value \u0026 2048: # Bit 11: Occupied but disabled\n\t\treturn \u0027Occupied/Disabled\u0027\n\tif value \u0026 4096: # Bit 12: Reserved for induction takeover\n\t\treturn \u0027Induction Reserved\u0027\n\tif value \u0026 8192: # Bit 13: Not activated for profile execution\n\t\treturn \u0027Profile Inactive\u0027\n\tif value \u0026 16384: # Bit 14: Item being scanned by volume scanner\n\t\treturn \u0027Volume Scanning\u0027\n\tif value \u0026 32768: # Bit 15: SPS checking carrier\n\t\treturn \u0027SPS Checking\u0027\n\t\n\t# Check if bits 16-31 contain distance data\n\tdistance_bits \u003d (value \u003e\u003e 16) \u0026 0xFFFF # Extract upper 16 bits\n\tif distance_bits \u003e 0:\n\t\treturn \u0027Item Distance: \u0027 + str(distance_bits)\n\t\n\t# Default state\n\tif value \u003d\u003d 0:\n\t\treturn \u0027Empty/Idle\u0027\n\telse:\n\t\treturn \u0027State: \u0027 + str(value)",
"type": "script"
}
],
"type": "tag"
},
"persistent": true
},
"custom.status_string": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/dwStatus"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
},
{
"code": "\tif value is None:\n\t\treturn \u0027No Data\u0027\n\t\n\t# Critical Priority (2) - Errors and Faults\n\tif value \u0026 8: # Bit 3: Common fault\n\t\treturn \u0027Common fault\u0027\n\tif value \u0026 32: # Bit 5: Possible TCB/MCB error\n\t\treturn \u0027Possible TCB/MCB error\u0027\n\tif value \u0026 64: # Bit 6: Not checked at last CTB/CRB\n\t\treturn \u0027Not checked at last CTB/CRB\u0027\n\tif value \u0026 128: # Bit 7: Communication error\n\t\treturn \u0027Communication error\u0027\n\tif value \u0026 512: # Bit 9: Current limit exceeded\n\t\treturn \u0027Current limit exceeded\u0027\n\tif value \u0026 2048: # Bit 11: Calibration error\n\t\treturn \u0027Calibration error\u0027\n\tif value \u0026 4194304: # Bit 22: Item overhanging belt fault\n\t\treturn \u0027Item overhanging belt fault\u0027\n\tif value \u0026 8388608: # Bit 23: Current collector fault\n\t\treturn \u0027Current collector fault\u0027\n\tif value \u0026 16777216: # Bit 24: Item too high\n\t\treturn \u0027Item too high\u0027\n\tif value \u0026 33554432: # Bit 25: Item too wide\n\t\treturn \u0027Item too wide\u0027\n\tif value \u0026 67108864: # Bit 26: Item on activated carrier\n\t\treturn \u0027Item on activated carrier\u0027\n\tif value \u0026 134217728: # Bit 27: Deflected bellows fault\n\t\treturn \u0027Deflected bellows fault\u0027\n\tif value \u0026 1073741824: # Bit 30: Item on bellows warning\n\t\treturn \u0027Item on bellows warning\u0027\n\tif value \u0026 2147483648: # Bit 31: Item on bellows is active\n\t\treturn \u0027Item on bellows is active\u0027\n\t\n\t# High Priority (11) - Disabled/Blocked States\n\tif value \u0026 1: # Bit 0: Disabled\n\t\treturn \u0027Disabled\u0027\n\tif value \u0026 4: # Bit 2: Blocked\n\t\treturn \u0027Blocked\u0027\n\t\n\t# Medium Priority (9-10) - Normal Operations\n\tif value \u0026 256: # Bit 8: Status OK\n\t\treturn \u0027Status OK\u0027\n\tif value \u0026 1024: # Bit 10: Motor not running\n\t\treturn \u0027Motor not running\u0027\n\tif value \u0026 268435456: # Bit 28: Double maximum recirculation\n\t\treturn \u0027Double maximum recirculation\u0027\n\t\n\t# Low Priority (5) - Maintenance/Configuration\n\tif value \u0026 2: # Bit 1: Needs update\n\t\treturn \u0027Needs update\u0027\n\tif value \u0026 16: # Bit 4: CCT communication to carrier\n\t\treturn \u0027CCT communication to carrier\u0027\n\tif value \u0026 8192: # Bit 13: Default configuration\n\t\treturn \u0027Default configuration\u0027\n\tif value \u0026 16384: # Bit 14: Programming mode\n\t\treturn \u0027Programming mode\u0027\n\tif value \u0026 536870912: # Bit 29: CCT download done\n\t\treturn \u0027CCT download done\u0027\n\t\n\t# Default - No active status\n\treturn \u0027Unknown Status\u0027",
"type": "script"
}
],
"type": "tag"
},
"persistent": true
},
"params.angle": {
"paramDirection": "input",
"persistent": true
},
"params.directionLeft": {
"paramDirection": "input",
"persistent": true
},
"params.tagProps": {
"paramDirection": "inout",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 20,
"width": 50
}
},
"root": {
"children": [
{
"meta": {
"name": "RunningStatus"
},
"position": {
"grow": 1
},
"propConfig": {
"props.elements[0].fill.paint": {
"binding": {
"config": {
"path": "view.custom.Status"
},
"type": "property"
}
}
},
"props": {
"elements": [
{
"d": "M 5 1 L 55 1 L 55 17 L 5 17 Z ",
"fill": {},
"name": "carrierFrame",
"stroke": {
"paint": "#34495E",
"width": "0.5"
},
"type": "path"
},
{
"d": "M 7 2 L 53 2 L 53 16 L 7 16 Z ",
"fill": {
"paint": "#3498DB"
},
"name": "carrierTray",
"type": "path"
},
{
"cx": "12",
"cy": "9",
"fill": {
"paint": "#E74C3C"
},
"name": "leftSensor",
"r": "1.5",
"type": "circle"
},
{
"cx": "48",
"cy": "9",
"fill": {
"paint": "#E74C3C"
},
"name": "rightSensor",
"r": "1.5",
"type": "circle"
},
{
"fill": {
"paint": "#95A5A6"
},
"height": "10",
"name": "package",
"rx": "1",
"type": "rect",
"width": "20",
"x": "20",
"y": "4"
},
{
"cx": "10",
"cy": "3",
"fill": {
"paint": "#1ABC9C"
},
"name": "topLeftWheel",
"r": "1",
"type": "circle"
},
{
"cx": "10",
"cy": "15",
"fill": {
"paint": "#1ABC9C"
},
"name": "bottomLeftWheel",
"r": "1",
"type": "circle"
},
{
"cx": "50",
"cy": "3",
"fill": {
"paint": "#1ABC9C"
},
"name": "topRightWheel",
"r": "1",
"type": "circle"
},
{
"cx": "50",
"cy": "15",
"fill": {
"paint": "#1ABC9C"
},
"name": "bottomRightWheel",
"r": "1",
"type": "circle"
}
],
"preserveAspectRatio": "none",
"style": {
"overflow": "hidden",
"transform": ""
},
"viewBox": "-1.5 -1.5 60 20"
},
"type": "ia.shapes.svg"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.openDock(\u0027Docked-East-VFD\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": {
"classes": "Alarms-Styles/NoAlarm"
}
}
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if(\n {view.custom.status_string} !\u003d \"Unknown Status\",\n \"Source Id: \" + {view.params.tagProps[0]} + \" Status: \" + {view.custom.status_string} + \" State: \" + {view.custom.state_string},\n \"Device Disconnected\"\n)\n"
},
"type": "expr"
}
}
},
"props": {
"justify": "center",
"style": {
"borderColor": "#FF0000",
"borderStyle": "none",
"borderWidth": "2px",
"cursor": "pointer"
}
},
"type": "ia.container.flex"
}
}

View File

@ -0,0 +1,384 @@
{
"custom": {},
"params": {
"Dataset": [
{
"path": "Symbol-Views/Device-Views/DeviceStatus"
},
{
"path": "Symbol-Views/Device-Views/DeviceStatus_old"
},
{
"path": "Symbol-Views/Device-Views/Estop"
},
{
"path": "Symbol-Views/Equipment-Views/ARSAW"
},
{
"path": "Symbol-Views/Equipment-Views/AUS"
},
{
"path": "Symbol-Views/Equipment-Views/Camera"
},
{
"path": "Symbol-Views/Equipment-Views/ControlCabinet"
},
{
"path": "Symbol-Views/Equipment-Views/Estop"
},
{
"path": "Symbol-Views/Equipment-Views/GoodsLift"
},
{
"path": "Symbol-Views/Equipment-Views/JAM"
},
{
"path": "Symbol-Views/Equipment-Views/Light_Curtain"
},
{
"path": "Symbol-Views/Equipment-Views/Main_Panel"
},
{
"path": "Symbol-Views/Equipment-Views/Network"
},
{
"path": "Symbol-Views/Equipment-Views/Pointer"
},
{
"path": "Symbol-Views/Equipment-Views/PressureSwitch"
},
{
"path": "Symbol-Views/Equipment-Views/PullChord"
},
{
"path": "Symbol-Views/Equipment-Views/PullChord_End"
},
{
"path": "Symbol-Views/Equipment-Views/PullChord_Line"
},
{
"path": "Symbol-Views/Equipment-Views/PullChord_Line_Vertical"
},
{
"path": "Symbol-Views/Equipment-Views/RFID"
},
{
"path": "Symbol-Views/Equipment-Views/Robot"
},
{
"path": "Symbol-Views/Equipment-Views/SLAMs"
},
{
"path": "Symbol-Views/Equipment-Views/SafetyGate"
},
{
"path": "Symbol-Views/Equipment-Views/Stacker_Destacker"
},
{
"path": "Symbol-Views/Equipment-Views/Status"
},
{
"path": "Symbol-Views/Equipment-Views/StatusNonPowered"
},
{
"path": "Symbol-Views/Equipment-Views/StatusNonPowered_NS"
},
{
"path": "Symbol-Views/Equipment-Views/Status_NS"
},
{
"path": "Symbol-Views/Equipment-Views/THEA"
},
{
"path": "Symbol-Views/Equipment-Views/Test"
}
],
"FilteredViews": [
{
"Name": "ARSAW",
"Path": "Symbol-Views/Equipment-Views/ARSAW",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "AUS",
"Path": "Symbol-Views/Equipment-Views/AUS",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "Camera",
"Path": "Symbol-Views/Equipment-Views/Camera",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "ControlCabinet",
"Path": "Symbol-Views/Equipment-Views/ControlCabinet",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "Estop",
"Path": "Symbol-Views/Equipment-Views/Estop",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "GoodsLift",
"Path": "Symbol-Views/Equipment-Views/GoodsLift",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "JAM",
"Path": "Symbol-Views/Equipment-Views/JAM",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "Light_Curtain",
"Path": "Symbol-Views/Equipment-Views/Light_Curtain",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "Main_Panel",
"Path": "Symbol-Views/Equipment-Views/Main_Panel",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "Network",
"Path": "Symbol-Views/Equipment-Views/Network",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "Pointer",
"Path": "Symbol-Views/Equipment-Views/Pointer",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "PressureSwitch",
"Path": "Symbol-Views/Equipment-Views/PressureSwitch",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "PullChord",
"Path": "Symbol-Views/Equipment-Views/PullChord",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "PullChord_End",
"Path": "Symbol-Views/Equipment-Views/PullChord_End",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "PullChord_Line",
"Path": "Symbol-Views/Equipment-Views/PullChord_Line",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "PullChord_Line_Vertical",
"Path": "Symbol-Views/Equipment-Views/PullChord_Line_Vertical",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "RFID",
"Path": "Symbol-Views/Equipment-Views/RFID",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "Robot",
"Path": "Symbol-Views/Equipment-Views/Robot",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "SLAMs",
"Path": "Symbol-Views/Equipment-Views/SLAMs",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "SafetyGate",
"Path": "Symbol-Views/Equipment-Views/SafetyGate",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "Stacker_Destacker",
"Path": "Symbol-Views/Equipment-Views/Stacker_Destacker",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "Status",
"Path": "Symbol-Views/Equipment-Views/Status",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "StatusNonPowered",
"Path": "Symbol-Views/Equipment-Views/StatusNonPowered",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "StatusNonPowered_NS",
"Path": "Symbol-Views/Equipment-Views/StatusNonPowered_NS",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "Status_NS",
"Path": "Symbol-Views/Equipment-Views/Status_NS",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Name": "THEA",
"Path": "Symbol-Views/Equipment-Views/THEA",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
}
],
"SelectedValue": "",
"key": ""
},
"propConfig": {
"params.Dataset": {
"paramDirection": "input",
"persistent": true
},
"params.FilteredViews": {
"paramDirection": "input",
"persistent": true
},
"params.SelectedValue": {
"paramDirection": "inout",
"persistent": true
},
"params.key": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 650,
"width": 1165
}
},
"root": {
"children": [
{
"meta": {
"name": "ViewRepeater"
},
"position": {
"basis": "1px",
"grow": 1
},
"propConfig": {
"props.instances": {
"binding": {
"config": {
"bidirectional": true,
"path": "view.params.FilteredViews"
},
"type": "property"
}
}
},
"props": {
"alignContent": "flex-start",
"alignItems": "flex-start",
"elementPosition": {
"basis": "auto"
},
"elementStyle": {
"classes": "Framework/Cards/Title"
},
"justify": "center",
"path": "Symbol-Views/Symbol-Library-Views/Symbol",
"style": {
"gap": "20px",
"overflow": "hidden"
},
"wrap": "wrap"
},
"type": "ia.display.flex-repeater"
}
],
"meta": {
"name": "root"
},
"props": {
"alignItems": "center",
"justify": "space-evenly",
"wrap": "wrap"
},
"type": "ia.container.flex"
}
}

View File

@ -0,0 +1,97 @@
{
"custom": {},
"params": {
"rowData": {
"Driver": "value"
}
},
"propConfig": {
"params.rowData": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 36,
"width": 227
}
},
"root": {
"children": [
{
"meta": {
"name": "Dropdown"
},
"position": {
"basis": "36px"
},
"propConfig": {
"props.value": {
"binding": {
"config": {
"path": "view.params.rowData.Driver"
},
"type": "property"
},
"onChange": {
"enabled": null,
"script": "\tvalue \u003d currentValue.value\n\tsystem.perspective.print(str(origin))\n\tif value is not None:\n\t\tif \u0027Binding\u0027 not in str(origin):\n\t\t\tmsg \u003d \u0027addtable-dropdown-updaterow\u0027\n\t\t\tHostname \u003d self.view.params.rowData[\u0027Hostname\u0027]\n\t\t\tpayload \u003d\t{\n\t\t\t\t\t\t\u0027value\u0027\t\t: value,\n\t\t\t\t\t\t\u0027Hostname\u0027\t: Hostname\n\t\t\t\t\t\t}\n\t\t\tsystem.perspective.sendMessage(msg, payload)"
}
}
},
"props": {
"options": [
{
"label": "S7300",
"value": "S7300"
},
{
"label": "S7400",
"value": "S7400"
},
{
"label": "S71200",
"value": "S71200"
},
{
"label": "S71500",
"value": "S71500"
},
{
"label": "CompactLogix",
"value": "CompactLogix"
},
{
"label": "Legacy Allen-Bradley",
"value": "ControlLogix"
},
{
"label": "ControlLogix",
"value": "ControlLogix"
},
{
"label": "LogixDriver",
"value": "LogixDriver"
},
{
"label": "Allen Bradley MicroLogix",
"value": "MicroLogix"
}
],
"placeholder": {
"text": "Select Driver..."
}
},
"type": "ia.input.dropdown"
}
],
"meta": {
"name": "root"
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
}

View File

@ -0,0 +1,14 @@
{
"custom": {},
"params": {},
"props": {},
"root": {
"meta": {
"name": "root"
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,136 @@
{
"custom": {},
"params": {
"pageid": "value",
"panel_id": "value",
"text": "value"
},
"propConfig": {
"params.pageid": {
"paramDirection": "input",
"persistent": true
},
"params.panel_id": {
"paramDirection": "input",
"persistent": true
},
"params.text": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 30,
"width": 160
}
},
"root": {
"children": [
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tsystem.perspective.navigate(\"/\" + self.view.params.pageid)"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Button"
},
"position": {
"basis": "120px",
"grow": 1
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.params.text"
},
"type": "property"
}
}
},
"props": {
"style": {
"backgroundColor": "#FFFFFF",
"borderBottomColor": "#555555",
"borderBottomLeftRadius": 8,
"borderBottomRightRadius": 8,
"borderBottomStyle": "solid",
"borderBottomWidth": 4,
"borderLeftColor": "#000000",
"borderLeftStyle": "solid",
"borderLeftWidth": 1.5,
"borderRightColor": "#555555",
"borderRightStyle": "solid",
"borderRightWidth": 3,
"borderTopColor": "#000000",
"borderTopLeftRadius": 8,
"borderTopRightRadius": 8,
"borderTopStyle": "solid",
"borderTopWidth": 1.5,
"cursor": "pointer",
"outlineColor": "#000000",
"outlineStyle": "none",
"outlineWidth": "3"
},
"textStyle": {
"color": "#000000",
"fontFamily": "inherit",
"fontSize": "1vmin",
"fontWeight": "bold"
}
},
"type": "ia.input.button"
},
{
"meta": {
"name": "Main_Panel"
},
"position": {
"basis": "35px",
"shrink": 0
},
"propConfig": {
"props.params.tagProps[0]": {
"binding": {
"config": {
"path": "view.params.panel_id"
},
"type": "property"
}
}
},
"props": {
"params": {
"has_state": false,
"tagProps": [
null,
"",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "Symbol-Views/Equipment-Views/Main_Panel"
},
"type": "ia.display.view"
}
],
"meta": {
"name": "root"
},
"type": "ia.container.flex"
}
}

View File

@ -0,0 +1,158 @@
SELECT
roundtime,
Dumpers_jam,
Inbound_jam,
Runout_jam,
Sorter_Recirc_jam,
Sorter_jam
FROM (
SELECT
FROM_UNIXTIME(CEIL(UNIX_TIMESTAMP(a.eventtime) / 600) * 600) AS roundtime,
SUM(a.category = 'Dumpers_jam') AS Dumpers_jam,
SUM(a.category = 'Inbound_jam') AS Inbound_jam,
SUM(a.category = 'Runout_jam') AS Runout_jam,
SUM(a.category = 'Sorter_Recirc_jam') AS Sorter_Recirc_jam,
SUM(a.category = 'Sorter_jam') AS Sorter_jam
FROM (
SELECT
ae.eventtime,
m.category
FROM alarm_events ae
JOIN (
SELECT 'PS1_1_TPE1' AS device, 'Inbound_jam' AS category UNION ALL
SELECT 'PS1_1_TPE2', 'Inbound_jam' UNION ALL
SELECT 'PS1_1_TPE3', 'Inbound_jam' UNION ALL
SELECT 'PS1_1_TPE4', 'Inbound_jam' UNION ALL
SELECT 'PS1_2A_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS1_3_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS1_3_TPE2', 'Inbound_jam' UNION ALL
SELECT 'PS1_4_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS1_6_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS1_6_TPE2', 'Inbound_jam' UNION ALL
SELECT 'PS1_7_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS1_8_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS2_1_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS2_1_TPE2', 'Inbound_jam' UNION ALL
SELECT 'PS2_1_TPE3', 'Inbound_jam' UNION ALL
SELECT 'PS2_1_TPE4', 'Inbound_jam' UNION ALL
SELECT 'PS2_3_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS2_3_TPE2', 'Inbound_jam' UNION ALL
SELECT 'PS2_5_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS2_5_TPE2', 'Inbound_jam' UNION ALL
SELECT 'PS2_6_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS2_7_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS3_1_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS3_1_TPE2', 'Inbound_jam' UNION ALL
SELECT 'PS3_1_TPE3', 'Inbound_jam' UNION ALL
SELECT 'PS3_3_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS4_1_TPE2', 'Inbound_jam' UNION ALL
SELECT 'PS4_1_TPE3', 'Inbound_jam' UNION ALL
SELECT 'PS4_5_TPE1', 'Inbound_jam' UNION ALL
SELECT 'PS4_5_TPE2', 'Inbound_jam' UNION ALL
SELECT 'UL10_3_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL10_3_TPE2', 'Inbound_jam' UNION ALL
SELECT 'UL10_6_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL11_3_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL11_3_TPE2', 'Inbound_jam' UNION ALL
SELECT 'UL11_7_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL12_2_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL12_2_TPE2', 'Inbound_jam' UNION ALL
SELECT 'UL12_7_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL1_1_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL1_2_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL1_2_TPE2', 'Inbound_jam' UNION ALL
SELECT 'UL1_4_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL1_4_TPE2', 'Inbound_jam' UNION ALL
SELECT 'UL1_5_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL1_6_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL2_3_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL2_3_TPE2', 'Inbound_jam' UNION ALL
SELECT 'UL2_3_TPE3', 'Inbound_jam' UNION ALL
SELECT 'UL2_5_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL2_5_TPE2', 'Inbound_jam' UNION ALL
SELECT 'UL2_6_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL2_7_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL2_8_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL3_3_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL3_3_TPE2', 'Inbound_jam' UNION ALL
SELECT 'UL3_3_TPE3', 'Inbound_jam' UNION ALL
SELECT 'UL3_5_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL3_5_TPE2', 'Inbound_jam' UNION ALL
SELECT 'UL3_6_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL3_7_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL3_8_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL4_3_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL4_3_TPE2', 'Inbound_jam' UNION ALL
SELECT 'UL4_3_TPE3', 'Inbound_jam' UNION ALL
SELECT 'UL4_5_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL4_5_TPE2', 'Inbound_jam' UNION ALL
SELECT 'UL4_6_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL4_7_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL5_3_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL5_3_TPE2', 'Inbound_jam' UNION ALL
SELECT 'UL5_3_TPE3', 'Inbound_jam' UNION ALL
SELECT 'UL5_5_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL5_5_TPE2', 'Inbound_jam' UNION ALL
SELECT 'UL5_6_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL5_7_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL5_8_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL6_1_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL6_2_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL6_2_TPE2', 'Inbound_jam' UNION ALL
SELECT 'UL6_4_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL6_4_TPE2', 'Inbound_jam' UNION ALL
SELECT 'UL6_5_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL6_6_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL6_7_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL7_1_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL7_2_TPE2', 'Inbound_jam' UNION ALL
SELECT 'UL7_4_TPE2', 'Inbound_jam' UNION ALL
SELECT 'UL7_5_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL7_6_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL8_3_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL8_3_TPE3', 'Inbound_jam' UNION ALL
SELECT 'UL8_5_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL8_5_TPE2', 'Inbound_jam' UNION ALL
SELECT 'UL9_5_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL9_7_TPE1', 'Inbound_jam' UNION ALL
SELECT 'UL9_8_TPE1', 'Inbound_jam' UNION ALL
SELECT 'ULC1_10_TPE1', 'Inbound_jam' UNION ALL
SELECT 'ULC1_10_TPE2', 'Inbound_jam' UNION ALL
SELECT 'ULC1_11_TPE1', 'Inbound_jam' UNION ALL
SELECT 'ULC1_12_TPE1', 'Inbound_jam' UNION ALL
SELECT 'ULC1_4_TPE1', 'Inbound_jam' UNION ALL
SELECT 'ULC1_4_TPE2', 'Inbound_jam' UNION ALL
SELECT 'ULC1_5_TPE1', 'Inbound_jam' UNION ALL
SELECT 'ULC1_6_TPE1', 'Inbound_jam' UNION ALL
SELECT 'ULC1_8_TPE1', 'Inbound_jam' UNION ALL
SELECT 'ULC1_8_TPE2', 'Inbound_jam' UNION ALL
SELECT 'ULC2_10_TPE1', 'Inbound_jam' UNION ALL
SELECT 'ULC2_10_TPE2', 'Inbound_jam' UNION ALL
SELECT 'ULC2_11_TPE1', 'Inbound_jam' UNION ALL
SELECT 'ULC2_12_TPE1', 'Inbound_jam' UNION ALL
SELECT 'ULC2_4_TPE1', 'Inbound_jam' UNION ALL
SELECT 'ULC2_4_TPE2', 'Inbound_jam' UNION ALL
SELECT 'ULC2_5_TPE1', 'Inbound_jam' UNION ALL
SELECT 'ULC2_6_TPE1', 'Inbound_jam' UNION ALL
SELECT 'ULC2_8_TPE1', 'Inbound_jam' UNION ALL
SELECT 'ULC2_8_TPE2', 'Inbound_jam' UNION ALL
SELECT 'ULC3_3_JPE1', 'Inbound_jam' UNION ALL
SELECT 'ULC3_3_JPE2', 'Inbound_jam' UNION ALL
SELECT 'ULC3_4_JPE1', 'Inbound_jam' UNION ALL
SELECT 'ULC3_6_TPE1', 'Inbound_jam' UNION ALL
SELECT 'ULC3_6_TPE2', 'Inbound_jam' UNION ALL
SELECT 'ULC4_3_JPE1', 'Inbound_jam' UNION ALL
SELECT 'ULC4_3_JPE2', 'Inbound_jam' UNION ALL
SELECT 'ULC4_4_JPE1', 'Inbound_jam' UNION ALL
SELECT 'ULC4_6_TPE1', 'Inbound_jam' UNION ALL
SELECT 'ULC4_6_TPE2', 'Inbound_jam'
) AS m
ON ae.displaypath = m.device
WHERE ae.eventtype = 0
AND ae.eventtime BETWEEN :starttime AND :endtime
AND ae.displaypath NOT LIKE '%System Startup%'
AND ae.source NOT LIKE '%System Startup%'
) AS a
GROUP BY FROM_UNIXTIME(CEIL(UNIX_TIMESTAMP(a.eventtime) / 600) * 600)
ORDER BY roundtime ASC
) AS okeyjam;

View File

@ -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"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 847 B

View File

@ -0,0 +1,8 @@
def decide_mode(session,local_url,server_url):
link = ""
if(session.local):
link = local_url
else:
link = server_urls
return link

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,648 @@
{
"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))"
},
"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": 25,
"width": 25
}
},
"root": {
"children": [
{
"meta": {
"name": "PressureSwitch_2"
},
"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": [
{
"elements": [
{
"elements": [
{
"id": "stop1507",
"name": "stop1507",
"offset": "0",
"stopColor": "#020101",
"stopOpacity": "1",
"style": {
"stopColor": "#020101",
"stopOpacity": "1"
},
"type": "stop"
}
],
"id": "linearGradient1509",
"name": "linearGradient1509",
"type": "linearGradient"
},
{
"gradientTransform": "matrix(1.0156665,0,0,0.98457489,-0.22712617,-0.22017344)",
"gradientUnits": "userSpaceOnUse",
"href": "#linearGradient1509",
"id": "linearGradient3055",
"name": "linearGradient3055",
"type": "linearGradient",
"x1": "2.4719212",
"x2": "5.6080947",
"y1": "4.8826461",
"y2": "4.8826461"
}
],
"id": "defs2",
"name": "defs2",
"type": "defs"
},
{
"elements": [
{
"fill": {
"opacity": 1
},
"height": "11.216189",
"id": "rect5779",
"name": "rect5779",
"stroke": {
"dasharray": "none",
"linejoin": "round",
"paint": "#000000",
"width": 1.2
},
"style": {
"paintOrder": "stroke fill markers"
},
"type": "rect",
"width": "11.21619",
"x": "7.7715612e-16",
"y": "0"
},
{
"elements": [
{
"fill": {
"opacity": "1",
"url": "url(#linearGradient3055)"
},
"id": "tspan1453",
"name": "tspan1453",
"stroke": {
"dasharray": "none",
"width": "0.116835"
},
"text": "P",
"type": "tspan",
"x": "0.99078566",
"y": "9.0214157"
}
],
"fill": {
"opacity": "1",
"url": "url(#linearGradient3055)"
},
"id": "text1455",
"name": "text1455",
"stroke": {
"dasharray": "none",
"linejoin": "round",
"paint": "#000000",
"width": "0.116835"
},
"style": {
"InkscapeFontSpecification": "\u0027Arial Narrow, Normal\u0027",
"fontFamily": "\u0027Arial Narrow\u0027",
"fontSize": "9.7785px",
"paintOrder": "stroke fill markers"
},
"text": "P",
"transform": "scale(0.98457515,1.0156665)",
"type": "text",
"x": "0.99078566",
"y": "9.0214157"
},
{
"d": "M 7.1327097,2.9635882 9.9122555,5.8103519 6.9937326,8.2419488",
"fill": {
"opacity": "0.0131332",
"paint": "#020101"
},
"id": "path3213",
"name": "path3213",
"stroke": {
"dasharray": "none",
"linejoin": "round",
"paint": "#000000",
"width": "0.663625"
},
"style": {
"paintOrder": "stroke fill markers"
},
"type": "path"
}
],
"id": "layer1",
"name": "layer1",
"transform": "translate(0.22362278,0.22362278)",
"type": "group"
}
],
"preserveAspectRatio": "none",
"style": {},
"viewBox": "0 0 11.663437 11.663435"
},
"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": {
"mode": "percent",
"style": {
"cursor": "pointer"
}
},
"type": "ia.container.coord"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 494 B

View File

@ -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"
}
}

View File

@ -0,0 +1,612 @@
{
"custom": {
"color": "#C2C2C2",
"priority": "No Active Alarms",
"state": "Closed"
},
"params": {
"directionLeft": false,
"forceFaultStatus": null,
"tagProps": [
"System/MCM01/Conveyor/EXTENDO/UL1_1_EX1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
],
"type": 1
},
"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": "coalesce({value},{view.params.forceFaultStatus},0)",
"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},{view.params.forceFaultStatus},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},{view.params.forceFaultStatus},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"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"params.directionLeft": {
"paramDirection": "input",
"persistent": true
},
"params.forceFaultStatus": {
"paramDirection": "input",
"persistent": true
},
"params.tagProps": {
"paramDirection": "inout",
"persistent": true
},
"params.type": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 20,
"width": 29
}
},
"root": {
"children": [
{
"meta": {
"name": "RunningStatus"
},
"position": {
"grow": 1
},
"propConfig": {
"position.rotate.angle": {
"binding": {
"config": {
"path": "view.params.directionLeft"
},
"transforms": [
{
"expression": "if({value}, \u0027180deg\u0027, \u00270deg\u0027)",
"type": "expression"
}
],
"type": "property"
}
},
"props.elements[0].fill.paint": {
"binding": {
"config": {
"expression": "if(\r\n {view.custom.state} \u003d \"Closed\",\r\n \"#000000\",\r\n {view.custom.color}\r\n)\r\n"
},
"type": "expr"
}
},
"props.elements[1].fill.paint": {
"binding": {
"config": {
"expression": "if(\r\n {view.custom.state} \u003d \"Closed\",\r\n \"#000000\",\r\n {view.custom.color}\r\n)\r\n"
},
"type": "expr"
}
},
"props.elements[2].fill.paint": {
"binding": {
"config": {
"expression": "if(\r\n {view.custom.state} \u003d \"Closed\",\r\n \"#000000\",\r\n {view.custom.color}\r\n)\r\n"
},
"type": "expr"
}
}
},
"props": {
"elements": [
{
"d": "M 50 0 L 65 0 L 80 30 L 65 60 L 50 60 Z",
"fill": {},
"name": "path",
"stroke": {
"paint": "#4c4c4c",
"width": "2"
},
"type": "path"
},
{
"d": "M 45 0 L 25 0 L 25 30 L 25 60 L 45 60 Z",
"fill": {},
"name": "path",
"stroke": {
"paint": "#4c4c4c",
"width": "2"
},
"type": "path"
},
{
"d": "M 0 0 L 20 0 L 20 30 L 20 60 L 0 60 Z",
"fill": {},
"name": "path",
"stroke": {
"paint": "#4c4c4c",
"width": "2"
},
"type": "path"
}
],
"style": {
"overflow": "hidden"
},
"viewBox": "-1.5 -1.5 73 63"
},
"type": "ia.shapes.svg"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.openDock(\u0027Docked-East-Extendo\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,
"location": "top-left",
"style": {}
}
},
"propConfig": {
"meta.tooltip.style.classes": {
"binding": {
"config": {
"expression": "{view.custom.priority}"
},
"transforms": [
{
"fallback": "Alarms-Styles/NoAlarm",
"inputType": "scalar",
"mappings": [
{
"input": "High",
"output": "Alarms-Styles/High"
},
{
"input": "Medium",
"output": "Alarms-Styles/Medium"
},
{
"input": "Low",
"output": "Alarms-Styles/Low"
},
{
"input": "Diagnostic",
"output": "Alarms-Styles/Diagnostic"
}
],
"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_running"
},
"type": "property"
}
}
},
"props": {
"justify": "center"
},
"type": "ia.container.flex"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

View File

@ -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"
}
}

View File

@ -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

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,133 @@
{
"pages": {
"/": {
"title": "",
"viewPath": "Main-Views/Home"
},
"/Command": {
"title": "",
"viewPath": "Main-Views/CommandControl"
},
"/CustomView/:customView": {
"title": "",
"viewPath": "Custom-Views/Detail"
},
"/DetailedView/:detailedView/:plcTagPath": {
"title": "DetailedView",
"viewPath": "Detailed-Views/Detail"
},
"/DetailedView/MCM01 Bulk Inbound": {
"title": "",
"viewPath": "Detailed-Views/MCM01 Bulk Inbound"
},
"/DetailedView/MCM02 \u0026 MCM03 Fluid Inbound": {
"title": "",
"viewPath": "Detailed-Views/MCM02-MCM03 Fluid Inbound"
},
"/DetailedView/MCM04 \u0026 MCM05 Sorter Destination,chutes and bypass": {
"title": "",
"viewPath": "Detailed-Views/MCM04-MCM05 Sorter Destination, chutes and Bypass"
},
"/Device-manager": {
"viewPath": "Main-Views/Device-Manager/DeviceManager"
},
"/Help": {
"title": "Help",
"viewPath": "Main-Views/Help"
},
"/MAP-Home": {
"title": "",
"viewPath": "Additional-Home-View/SAT9"
},
"/Monitron": {
"title": "",
"viewPath": "Main-Views/Monitron"
},
"/Oil": {
"viewPath": "Main-Views/OilMonitoring"
},
"/Temperature": {
"title": "",
"viewPath": "Main-Views/TempMonitoring"
},
"/Tools": {
"title": "Tools",
"viewPath": "Main-Views/ToolBox"
},
"/Windows/Statistics": {
"title": "",
"viewPath": "Windows/Statistics"
},
"/Windows/Status": {
"title": "",
"viewPath": "Windows/Status"
}
},
"sharedDocks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "cover",
"handle": "show",
"iconUrl": "material/notifications_active",
"id": "Docked-South",
"modal": false,
"resizable": false,
"show": "onDemand",
"size": 165,
"viewParams": {},
"viewPath": "Navigation-Views/Docked-South"
}
],
"cornerPriority": "top-bottom",
"left": [
{
"anchor": "fixed",
"autoBreakpoint": 805,
"content": "auto",
"handle": "autoHide",
"iconUrl": "",
"id": "Docked-West",
"modal": false,
"resizable": false,
"show": "auto",
"size": 70,
"viewParams": {},
"viewPath": "Navigation-Views/Docked-West"
}
],
"right": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "cover",
"handle": "hide",
"iconUrl": "",
"id": "Docked-East",
"modal": false,
"resizable": false,
"show": "onDemand",
"size": 400,
"viewParams": {},
"viewPath": "PopUp-Views/Controller-Equipment/Information-Docked-East"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "auto",
"handle": "hide",
"iconUrl": "",
"id": "",
"modal": false,
"resizable": false,
"show": "visible",
"size": 50,
"viewParams": {},
"viewPath": "Framework/Breakpoint"
}
]
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View File

@ -0,0 +1,883 @@
{
"custom": {},
"params": {
"Tab_ID": 6,
"Table": "Statistics"
},
"propConfig": {
"params.Tab_ID": {
"binding": {
"config": {
"path": "/root/Statistics.props.currentTabIndex"
},
"type": "property"
},
"paramDirection": "output",
"persistent": true
},
"params.Table": {
"binding": {
"config": {
"path": "/root/Statistics.meta.name"
},
"type": "property"
},
"paramDirection": "output",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 930,
"width": 1920
}
},
"root": {
"children": [
{
"children": [
{
"meta": {
"name": "Sorter_Statistics"
},
"propConfig": {
"props.params.EndDate": {
"binding": {
"config": {
"path": "parent.custom.endDate"
},
"type": "property"
}
},
"props.params.StartDate": {
"binding": {
"config": {
"path": "parent.custom.startDate"
},
"type": "property"
}
}
},
"props": {
"page": 1,
"pageCount": 1,
"source": "Statistics/Shipping Sorter Statistics",
"zoomLevel": 50
},
"type": "ia.reporting.report-viewer"
},
{
"meta": {
"name": "Sorter_Summary"
},
"position": {
"tabIndex": 1
},
"propConfig": {
"props.params.EndDate": {
"binding": {
"config": {
"path": "parent.custom.endDate"
},
"type": "property"
}
},
"props.params.StartDate": {
"binding": {
"config": {
"path": "parent.custom.startDate"
},
"type": "property"
}
}
},
"props": {
"page": 1,
"pageCount": 1,
"source": "Statistics/Shipping Sorter Statistics Com",
"zoomLevel": 50
},
"type": "ia.reporting.report-viewer"
},
{
"meta": {
"name": "Scan_Performance"
},
"position": {
"tabIndex": 2
},
"propConfig": {
"props.params.EndDate": {
"binding": {
"config": {
"path": "parent.custom.endDate"
},
"type": "property"
}
},
"props.params.StartDate": {
"binding": {
"config": {
"path": "parent.custom.startDate"
},
"type": "property"
}
}
},
"props": {
"page": 1,
"pageCount": 1,
"source": "Statistics/Scanner Performance",
"zoomLevel": 50
},
"type": "ia.reporting.report-viewer"
},
{
"meta": {
"name": "Full_Recirc_Jackpot"
},
"position": {
"tabIndex": 3
},
"propConfig": {
"props.params.EndDate": {
"binding": {
"config": {
"path": "parent.custom.endDate"
},
"type": "property"
}
},
"props.params.StartDate": {
"binding": {
"config": {
"path": "parent.custom.startDate"
},
"type": "property"
}
}
},
"props": {
"page": 1,
"pageCount": 1,
"source": "Statistics/Lane Full Recirc Jackpot",
"zoomLevel": 50
},
"type": "ia.reporting.report-viewer"
},
{
"meta": {
"name": "Total_Scans"
},
"position": {
"tabIndex": 4
},
"propConfig": {
"props.params.EndDate": {
"binding": {
"config": {
"path": "parent.custom.endDate"
},
"type": "property"
}
},
"props.params.StartDate": {
"binding": {
"config": {
"path": "parent.custom.startDate"
},
"type": "property"
}
}
},
"props": {
"page": 1,
"pageCount": 1,
"source": "Statistics/Total Scans",
"zoomLevel": 50
},
"type": "ia.reporting.report-viewer"
},
{
"meta": {
"name": "Top_Jams"
},
"position": {
"tabIndex": 5
},
"propConfig": {
"props.params.EndDate": {
"binding": {
"config": {
"path": "parent.custom.endDate"
},
"type": "property"
}
},
"props.params.StartDate": {
"binding": {
"config": {
"path": "parent.custom.startDate"
},
"type": "property"
}
}
},
"props": {
"page": 1,
"pageCount": 1,
"source": "Statistics/Top Jams",
"zoomLevel": 50
},
"type": "ia.reporting.report-viewer"
},
{
"meta": {
"name": "Divert_VS_Full"
},
"position": {
"tabIndex": 6
},
"propConfig": {
"props.params.EndDate": {
"binding": {
"config": {
"path": "parent.custom.endDate"
},
"type": "property"
}
},
"props.params.StartDate": {
"binding": {
"config": {
"path": "parent.custom.startDate"
},
"type": "property"
}
}
},
"props": {
"page": 1,
"pageCount": 1,
"source": "Statistics/Lane Divert vs Full"
},
"type": "ia.reporting.report-viewer"
}
],
"custom": {
"endDate": {
"$": [
"ts",
192,
1759323667144
],
"$ts": 1759241850000
},
"startDate": {
"$": [
"ts",
192,
1759323667144
],
"$ts": 1759213050000
}
},
"meta": {
"name": "Statistics"
},
"position": {
"height": 0.96,
"width": 1,
"y": 0.04
},
"propConfig": {
"props.tabs": {
"persistent": true
}
},
"props": {
"currentTabIndex": 6,
"menuStyle": {
"backgroundColor": "#FFFFFFBD",
"fontSize": "1.0vmin",
"overflowWrap": "break-word",
"textAlign": "left"
},
"style": {
"fontFamily": "Arial",
"width": "100%"
},
"tabSize": {
"width": 160
},
"tabStyle": {
"active": {
"flexBasis": 0,
"flexGrow": 1,
"fontSize": "1.0vmin"
},
"disabled": {
"fontSize": "1.0vmin"
},
"inactive": {
"flexBasis": 0,
"flexGrow": 1,
"fontSize": "1.0vmin"
}
},
"tabs": [
"Sorter Statistics",
"Sorter Summary",
"Scan Performance",
"Full/Recirc/Jackpot",
"Total Scans",
"Top Jams",
"Divert vs Full"
]
},
"type": "ia.container.tab"
},
{
"children": [
{
"meta": {
"name": "LPeriod"
},
"position": {
"basis": "60px",
"grow": 1
},
"props": {
"style": {
"color": "#FFFFFF"
},
"text": "Period:"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Period"
},
"position": {
"basis": "140px",
"grow": 1
},
"props": {
"dropdownOptionStyle": {
"fontSize": "1.5vmin",
"overflow": "hidden",
"width": "auto"
},
"options": [
{
"label": "Past 30 Min",
"value": "Past 30 Min"
},
{
"label": "Past Hour",
"value": "Past Hour"
},
{
"label": "Past 2 Hour",
"value": "Past 2 Hour"
},
{
"label": "Past 4 Hour",
"value": "Past 4 Hour"
},
{
"label": "Past 8 Hour",
"value": "Past 8 Hour"
},
{
"label": "Current Day",
"value": "Current Day"
},
{
"label": "Morning",
"value": "Morning"
},
{
"label": "Daylight",
"value": "Daylight"
},
{
"label": "Twilight",
"value": "Twilight"
},
{
"label": "Night",
"value": "Night"
},
{
"label": "Wrap Down",
"value": "Wrap Down"
},
{
"label": "Current Sort",
"value": "Current Sort"
},
{
"label": "Custom",
"value": "Custom"
}
],
"style": {
"fontSize": "1.5vmin"
},
"value": "Past 8 Hour"
},
"type": "ia.input.dropdown"
},
{
"meta": {
"name": "Spare_0"
},
"position": {
"basis": "18.1px",
"grow": 1
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Start Date"
},
"position": {
"basis": "85px",
"grow": 1
},
"props": {
"style": {
"color": "#FFFFFF"
},
"text": "Start Date:"
},
"type": "ia.display.label"
},
{
"custom": {
"Selected": {
"$": [
"ts",
192,
1689168205405
],
"$ts": 1688473380000
}
},
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\t\n\tself.custom.Selected \u003d self.props.value"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "StartTime"
},
"position": {
"basis": "190px",
"grow": 1
},
"propConfig": {
"props.enabled": {
"binding": {
"config": {
"expression": "{../Period.props.value} \u003d \"Custom\""
},
"type": "expr"
}
},
"props.maxDate": {
"binding": {
"config": {
"expression": "now()"
},
"type": "expr"
}
},
"props.startDate": {
"binding": {
"config": {
"path": "../Period.props.value"
},
"transforms": [
{
"fallback": "todate(now())",
"inputType": "expression",
"mappings": [
{
"input": "\"Past 30 Min\"",
"output": "todate(dateFormat(dateArithmetic(now(),-30, \"Minute\"), \"yyyy-MM-dd HH:mm:ss\"))"
},
{
"input": "\"Past Hour\"",
"output": "todate(dateFormat(dateArithmetic(now(),-1, \"Hour\"), \"yyyy-MM-dd HH:mm:ss\"))"
},
{
"input": "\"Past 2 Hour\"",
"output": "todate(dateFormat(dateArithmetic(now(),-2, \"Hour\"), \"yyyy-MM-dd HH:mm:ss\"))"
},
{
"input": "\"Past 4 Hour\"",
"output": "todate(dateFormat(dateArithmetic(now(),-4, \"Hour\"), \"yyyy-MM-dd HH:mm:ss\"))"
},
{
"input": "\"Past 8 Hour\"",
"output": "todate(dateFormat(dateArithmetic(now(),-8, \"Hour\"), \"yyyy-MM-dd HH:mm:ss\"))"
},
{
"input": "\"Current Day\"",
"output": "todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 00:00:00\"))"
},
{
"input": "\"Morning\"",
"output": "if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"2:30:00\",\r dateFormat(dateArithmetic(now(0),-1, \"Day\"), \"yyyy-MM-dd 2:30:00\"),todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 2:30:00\")))"
},
{
"input": "\"Daylight\"",
"output": "if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"7:30:00\", todate(dateFormat(dateArithmetic(now(0),-1, \"Day\"), \"yyyy-MM-dd 7:30:00\")),todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 7:30:00\")))"
},
{
"input": "\"Twilight\"",
"output": "if (dateFormat(dateArithmetic(now(),0, \"Hours\"), \"HH:mm:ss\")\u003c\"13:00:00\", todate(dateFormat(dateArithmetic(now(0),-1, \"Day\"), \"yyyy-MM-dd 13:00:00\")),todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 13:00:00\")))"
},
{
"input": "\"Night\"",
"output": "if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"18:30:00\", todate(dateFormat(dateArithmetic(now(0),-1, \"Day\"), \"yyyy-MM-dd 18:30:00\")),todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 18:30:00\")))"
},
{
"input": "\"Wrap Down\"",
"output": "if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"23:30:00\", todate(dateFormat(dateArithmetic(now(0),-1, \"Day\"), \"yyyy-MM-dd 23:30:00\")),todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 23:30:00\")))"
},
{
"input": "\"Current Sort\"",
"output": "if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"7:30:00\", todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 2:30:00\")), \r if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"13:00:00\",todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 7:30:00\")),\r if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"18:30:00\",todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 13:00:00\")),\r if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"23:30:00\",todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 18:30:00\")),\r if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"2:30:00\", todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 23:30:00\")),\r todate(dateFormat(dateArithmetic(now(),0, \"Day\"), \"yyyy-MM-dd HH:mm:ss\")))))))"
},
{
"input": "\"Custom\"",
"output": "{this.props.value}"
}
],
"outputType": "expression",
"type": "map"
}
],
"type": "property"
},
"onChange": {
"enabled": null,
"script": "\t\n\tif self.getSibling(\"Period\").props.value !\u003d \"Custom\":\n\t\tself.props.value \u003d self.props.startDate"
}
},
"props.value": {
"onChange": {
"enabled": null,
"script": "\t\n\tif system.date.secondsBetween(self.props.value,self.getSibling(\"EndTime\").props.value) \u003e 604800 or system.date.secondsBetween(self.props.value,self.getSibling(\"EndTime\").props.value) \u003c 0:\n\t if system.date.secondsBetween(system.date.addSeconds(self.props.value,604800),system.date.now()) \u003c 0: \n\t self.getSibling(\"EndTime\").props.value \u003d system.date.now()\n\t else:\n\t self.getSibling(\"EndTime\").props.value \u003d system.date.addSeconds(self.props.value,604800)"
}
}
},
"props": {
"dismissOnSelect": false,
"formattedValue": "Oct 1, 2025 11:01 AM",
"formattedValues": {
"date": "Mar 26, 2021",
"datetime": "Mar 26, 2021 12:00 AM",
"time": "12:00 AM"
},
"inputProps": {
"style": {
"fontSize": "1.5vmin"
}
},
"style": {
"fontSize": "1.5vmin"
},
"value": {
"$": [
"ts",
192,
1759330916924
],
"$ts": 1759302116000
}
},
"type": "ia.input.date-time-input"
},
{
"meta": {
"name": "Spare"
},
"position": {
"basis": "18.1px",
"grow": 1
},
"type": "ia.display.label"
},
{
"meta": {
"name": "End Date"
},
"position": {
"basis": "81px",
"grow": 1
},
"props": {
"style": {
"color": "#FFFFFF"
},
"text": "End Date:"
},
"type": "ia.display.label"
},
{
"custom": {
"Selected": "value"
},
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\t\n\tself.custom.Selected \u003d self.props.value"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "EndTime"
},
"position": {
"basis": "190px",
"grow": 1
},
"propConfig": {
"props.enabled": {
"binding": {
"config": {
"expression": "{../Period.props.value} \u003d \"Custom\""
},
"type": "expr"
}
},
"props.endDate": {
"binding": {
"config": {
"path": "../Period.props.value"
},
"transforms": [
{
"fallback": "{this.props.value}",
"inputType": "scalar",
"mappings": [
{
"input": "Past 30 Min",
"output": "todate(dateFormat(dateArithmetic(now(),0, \"Hour\"), \"yyyy-MM-dd HH:mm:ss\"))"
},
{
"input": "Past Hour",
"output": "todate(dateFormat(dateArithmetic(now(),0, \"hour\"), \"yyyy-MM-dd HH:mm:ss\"))"
},
{
"input": "Past 2 Hour",
"output": "todate(dateFormat(dateArithmetic(now(),0, \"hour\"), \"yyyy-MM-dd HH:mm:ss\"))"
},
{
"input": "Past 4 Hour",
"output": "todate(dateFormat(dateArithmetic(now(),0, \"hour\"), \"yyyy-MM-dd HH:mm:ss\"))"
},
{
"input": "Past 8 Hour",
"output": "todate(dateFormat(dateArithmetic(now(),0, \"hour\"), \"yyyy-MM-dd HH:mm:ss\"))"
},
{
"input": "Current Day",
"output": "todate(dateFormat(dateArithmetic(now(),0, \"hour\"), \"yyyy-MM-dd HH:mm:ss\"))"
},
{
"input": "Morning",
"output": "if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"2:30:00\",\r todate(dateFormat(dateArithmetic(now(0),-1, \"Day\"), \"yyyy-MM-dd 7:30:00\")),\r if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"7:30:00\",\r todate(dateFormat(dateArithmetic(now(),0, \"Day\"), \"yyyy-MM-dd HH:mm:ss\")), todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 7:30:00\"))))"
},
{
"input": "Daylight",
"output": "if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"7:30:00\",\r todate(dateFormat(dateArithmetic(now(0),-1, \"Day\"), \"yyyy-MM-dd 13:00:00\")),\r if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"13:00:00\",\r todate(dateFormat(dateArithmetic(now(),0, \"Day\"), \"yyyy-MM-dd HH:mm:ss\")), todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 13:00:00\"))))"
},
{
"input": "Twilight",
"output": "if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"13:00:00\",\r todate(dateFormat(dateArithmetic(now(0),-1, \"Day\"), \"yyyy-MM-dd 18:30:00\")),\r if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"18:30:00\",\r todate(dateFormat(dateArithmetic(now(),0, \"Day\"), \"yyyy-MM-dd HH:mm:ss\")), todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 18:30:00\"))))"
},
{
"input": "Night",
"output": "if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"18:30:00\",\r todate(dateFormat(dateArithmetic(now(0),-1, \"Day\"), \"yyyy-MM-dd 23:30:00\")),\r if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"23:30:00\",\r todate(dateFormat(dateArithmetic(now(),0, \"Day\"), \"yyyy-MM-dd HH:mm:ss\")), todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 23:30:00\"))))"
},
{
"input": "Wrap Down",
"output": "if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"23:30:00\",\r todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 2:30:00\")),\r if (dateFormat(dateArithmetic(now(),0, \"Day\"), \"HH:mm:ss\")\u003c\"2:30:00\",\r todate(dateFormat(dateArithmetic(now(),0, \"Day\"), \"yyyy-MM-dd HH:mm:ss\")), todate(dateFormat(dateArithmetic(now(0),0, \"Day\"), \"yyyy-MM-dd 2:30:00\"))))"
},
{
"input": "Current Sort",
"output": "todate(dateFormat(dateArithmetic(now(),0, \"hour\"), \"yyyy-MM-dd HH:mm:ss\"))"
}
],
"outputType": "expression",
"type": "map"
}
],
"type": "property"
},
"onChange": {
"enabled": null,
"script": "\t\n\tif self.getSibling(\"Period\").props.value !\u003d \"Custom\":\n\t\tself.props.value \u003d self.props.endDate"
}
},
"props.maxDate": {
"binding": {
"config": {
"expression": "if(dateDiff({../StartTime.props.value},now(),\"day\") \u003c 7, now(),dateArithmetic({../StartTime.props.value}, 7, \"days\"))"
},
"type": "expr"
}
},
"props.minDate": {
"binding": {
"config": {
"expression": "{../StartTime.props.value}"
},
"type": "expr"
}
}
},
"props": {
"dismissOnSelect": false,
"formattedValue": "Oct 1, 2025 7:01 PM",
"formattedValues": {
"date": "Mar 29, 2021",
"datetime": "Mar 29, 2021 1:37 PM",
"time": "1:37 PM"
},
"inputProps": {
"style": {
"fontSize": "1.5vmin"
}
},
"style": {
"fontSize": "1.5vmin"
},
"value": {
"$": [
"ts",
192,
1759330916952
],
"$ts": 1759330916000
}
},
"type": "ia.input.date-time-input"
}
],
"meta": {
"name": "Period_not_Global_0"
},
"position": {
"height": 0.0269,
"width": 0.483,
"x": 0.0025,
"y": 0.0059
},
"propConfig": {
"custom.EndDate": {
"binding": {
"config": {
"path": "./EndTime.props.value"
},
"type": "property"
}
},
"custom.StartDate": {
"binding": {
"config": {
"path": "./StartTime.props.value"
},
"type": "property"
}
}
},
"props": {
"style": {
"fontFamily": "Arial",
"fontSize": "1.5vmin"
},
"text": "Highest Sorted PPH at 5 min Interval: 0 pph"
},
"type": "ia.container.flex"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\t#Passing start and end dates to the reports, this is to avoid re-renders\n\tstartDate \u003d self.getSibling(\"Period_not_Global_0\").custom.StartDate\n\tendDate \u003d self.getSibling(\"Period_not_Global_0\").custom.EndDate\n\t\n\tself.getSibling(\"Statistics\").custom.startDate \u003d startDate\n\tself.getSibling(\"Statistics\").custom.endDate \u003d endDate\n\t"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Button",
"tooltip": {
"enabled": true,
"text": "Clicking this button generates new report with updated times"
}
},
"position": {
"height": 0.0312,
"width": 0.0667,
"x": 0.4958,
"y": 0.0043
},
"props": {
"primary": false,
"text": "Generate New Report",
"textStyle": {
"fontSize": "1vmin"
}
},
"type": "ia.input.button"
}
],
"events": {
"system": {
"onStartup": {
"config": {
"script": "\t#Saving start and end dates on startup of view\n\tstartDate \u003d self.getChild(\"Period_not_Global_0\").custom.StartDate\n\tendDate \u003d self.getChild(\"Period_not_Global_0\").custom.EndDate\n\t\n\tself.getChild(\"Statistics\").custom.startDate \u003d startDate\n\tself.getChild(\"Statistics\").custom.endDate \u003d endDate"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "root"
},
"position": {
"x": 0,
"y": 0
},
"props": {
"mode": "percent",
"style": {
"backgroundColor": "#1A4A5E",
"overflow": "hidden"
}
},
"type": "ia.container.coord"
}
}

View File

@ -0,0 +1,108 @@
{
"custom": {
"activityLogger": {
"alt_pageid": "site-overview",
"start_time": {
"$": [
"ts",
192,
1709762531101
],
"$ts": 1709762531101
}
}
},
"events": {
"system": {
"onShutdown": {
"config": {
"script": "\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": {},
"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"
}
}
},
"props": {
"defaultSize": {
"height": 1080,
"width": 1920
}
},
"root": {
"children": [
{
"custom": {
"s3URI": "SCADA/Other/MAP.svg"
},
"meta": {
"name": "Image"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.source": {
"binding": {
"config": {
"path": "this.custom.s3URI"
},
"transforms": [
{
"code": "\treturn AWS.s3.getPresignedURL(self, value)",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"altText": "none",
"fit": {
"mode": "fill"
}
},
"type": "ia.display.image"
}
],
"meta": {
"name": "root"
},
"props": {
"mode": "percent",
"style": {
"backgroundColor": "#EEEEEE"
}
},
"type": "ia.container.coord"
}
}

View File

@ -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"
}
}

View File

@ -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"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -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"
}
}

View File

@ -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"
}
}

View File

@ -0,0 +1,110 @@
/* Direct stylesheet authoring is an advanced feature. Knowledge of CSS required.*/
.psc-x1 { transition: all .2s ease-in-out; }
.psc-x1:hover { transform: scale(1.5) !important; z-index: 5;}
.psc-x2 { transition: all .2s ease-in-out; }
.psc-x2:hover { transform: scale(2) !important; z-index: 5;}
.psc-x3 { transition: all .2s ease-in-out; }
.psc-x3:hover { transform: scale(3) !important; z-index: 5;}
/* Set the styling for the Table component checkbox colour.*/
.ia_tableComponent[data-component="ia.display.table"] .ia_checkbox__checkedIcon {
color: black;
}
.ia_tableComponent[data-component="ia.display.table"] .ia_checkbox__uncheckedIcon {
color: black;
}
div[data-component="ia.input.fileupload"] .ia_button--primary {
background-color: var(--neutral-30);
border-style: None;
color: black;
border-radius:20px;
}
/* Help page styles */
.psc-background:hover {
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
transition: box-shadow 0.9s ease-in-out;
}
.psc-background-none {
box-shadow: 0 0px 0px 0 , 0 0px 0px 0;
transition: box-shadow 0.9s ease-in-out;
}
@keyframes fadeIn{
0% { opacity: 0; }
100% { opacity: 1; }
}
.psc-FadeInFast {
animation: fadeIn 2s;
}
.psc-FadeInMedium {
animation: fadeIn 4s;
}
.psc-FadeInSlow {
animation: fadeIn 6s;
}
@keyframes rotation {
from {
transform: rotate(0deg);
}
to {
transform: rotate(359deg);
}
}
.psc-rotate {
animation: rotation 2s infinite linear;
}
/* shared transition for all angle-classes */
[data-component="ia.display.view"].psc-hover,
[data-component="ia.display.view"].psc-hover-60,
[data-component="ia.display.view"].psc-hover-90,
[data-component="ia.display.view"].psc-hover-150,
[data-component="ia.display.view"].psc-hover-180,
[data-component="ia.display.view"].psc-hover-270{
transition: transform 100ms linear;
}
/* base rotations */
[data-component="ia.display.view"].psc-hover { transform: rotate(0deg) !important; }
[data-component="ia.display.view"].psc-hover-60 { transform: rotate(60deg) !important; }
[data-component="ia.display.view"].psc-hover-90 { transform: rotate(90deg) !important; }
[data-component="ia.display.view"].psc-hover-150 { transform: rotate(150deg) !important; }
[data-component="ia.display.view"].psc-hover-180 { transform: rotate(180deg) !important; }
[data-component="ia.display.view"].psc-hover-270 { transform: rotate(270deg) !important; }
/* hover (one line per variant still required) */
[data-component="ia.display.view"].psc-hover:hover { transform: rotate( 0deg) scale(2) !important; z-index:10; }
[data-component="ia.display.view"].psc-hover-60:hover { transform: rotate(60deg) scale(2) !important; z-index:10; }
[data-component="ia.display.view"].psc-hover-90:hover { transform: rotate(90deg) scale(2) !important; z-index:10; }
[data-component="ia.display.view"].psc-hover-150:hover { transform: rotate(150deg) scale(2) !important; z-index:10; }
[data-component="ia.display.view"].psc-hover-180:hover { transform: rotate(180deg) scale(2) !important; z-index:10; }
[data-component="ia.display.view"].psc-hover-270:hover { transform: rotate(270deg) scale(2) !important; z-index:10; }
/*remove z indexes for the conveyors and chutes */
[data-component="ia.display.view"].psc-conveyor:hover {transform: scale(1.5) rotate(0deg) !important; z-index:0 !important;}
[data-component="ia.display.view"].psc-conveyor-150:hover {transform: scale(1.5) rotate(150deg) !important; z-index:0 !important;}
[data-component="ia.display.view"].psc-conveyor-90:hover {transform: scale(1.5) rotate(90deg) !important; z-index:0 !important;}
@keyframes pulse {
0% { opacity: 0.3; filter: blur(2px); }
50% { opacity: 1; filter: blur(5px); }
100% { opacity: 0.3; filter: blur(2px); }
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

View File

@ -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])

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,155 @@
{
"custom": {
"activityLogger": {
"alt_pageid": "tools",
"start_time": {
"$": [
"ts",
192,
1716471122012
],
"$ts": 1716471122012
}
}
},
"events": {
"system": {
"onShutdown": {
"config": {
"script": "\tactivityLog.productMetrics.callLogger(self, \u0027page\u0027)"
},
"scope": "G",
"type": "script"
},
"onStartup": {
"config": {
"script": "\tself.session.custom.view_in_focus \u003d self.page.props.path\n\tself.custom.activityLogger.start_time \u003d system.date.now()"
},
"scope": "G",
"type": "script"
}
}
},
"params": {},
"propConfig": {
"custom.activityLogger": {
"persistent": true
},
"custom.activityLogger.pageid": {
"binding": {
"config": {
"expression": "{/root.props.currentTabIndex}"
},
"transforms": [
{
"code": "\tpageid\u003d self.custom.activityLogger.alt_pageid+\u0027/\u0027+self.getChild(\"root\").props.tabs[value]\n\treturn pageid.replace(\u0027 \u0027,\u0027\u0027)",
"type": "script"
}
],
"type": "expr"
}
}
},
"props": {
"defaultSize": {
"height": 1080,
"width": 1920
}
},
"root": {
"children": [
{
"meta": {
"name": "CommissioningTool"
},
"props": {
"path": "Main-Views/Commissioning Tool/CT_Main"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "S3"
},
"position": {
"tabIndex": 1
},
"propConfig": {
"props.params.selected_site": {
"binding": {
"config": {
"path": "session.custom.fc"
},
"type": "property"
}
}
},
"props": {
"params": {
"selected_image": null
},
"path": "Main-Views/S3/manage"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "NotifyTool"
},
"position": {
"tabIndex": 2
},
"props": {
"path": "Main-Views/Notify-Tool/Notify-Main"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "EmbeddedView"
},
"position": {
"tabIndex": 3
},
"props": {
"path": "Main-Views/Config-Tool/MainView"
},
"type": "ia.display.view"
}
],
"meta": {
"name": "root"
},
"propConfig": {
"props.currentTabIndex": {
"onChange": {
"enabled": null,
"script": "\ttry:\n\t\tpageid \u003d self.view.custom.activityLogger.alt_pageid + \u0027/\u0027+ self.props.tabs[previousValue.value]\n\t\tpageid \u003d pageid.replace(\u0027 \u0027,\u0027\u0027)\n\t\tpayload \u003d activityLog.productMetrics.createActivityPayload(self.view, \u0027page\u0027, pageid, pageid)\n\t\tif payload:\n\t\t\tself.view.custom.activityLogger.start_time \u003d system.date.now()\n\t\t\tsystem.perspective.sendMessage(\u0027activityLogger-TabChanged\u0027, payload \u003d payload, scope \u003d \u0027page\u0027)\n\texcept:\n\t\tpass"
}
}
},
"props": {
"currentTabIndex": 3,
"tabs": [
"CT",
"S3",
"Notify Tool",
"Site Config"
]
},
"scripts": {
"customMethods": [],
"extensionFunctions": null,
"messageHandlers": [
{
"messageType": "activityLogger-TabChanged",
"pageScope": true,
"script": "\t# implement your handler here\n\tif payload:\n\t\tactivityLog.productMetrics.callActivityLoggerAPI(payload)\n",
"sessionScope": false,
"viewScope": false
}
]
},
"type": "ia.container.tab"
}
}

View File

@ -0,0 +1,294 @@
{
"custom": {
"color": "#000000",
"priority": "No Active Alarms",
"state": "TagError"
},
"params": {
"tagProps": [
"Status/Chutes/Chute_0",
"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}/"
},
"transforms": [
{
"code": "\tdata \u003d dict(value) if value else {}\n\t\n\tif data.get(\"bLamp_Enable\"):\n\t return \"#CCFFCC\" \n\treturn \"#000000\"",
"type": "script"
}
],
"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}/"
},
"transforms": [
{
"code": "\tdata \u003d dict(value) if value else {}\n\t\n\tif data.get(\"bLamp_Enable\"):\n\t return \"Low\" \n\treturn \"No Active Alarms\"",
"type": "script"
}
],
"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}/"
},
"transforms": [
{
"code": "\tdata \u003d dict(value) if value else {}\n\t\t\n\tif value is None or data.get(\"_quality\") \u003d\u003d \"Bad\" or data.get(\"error\"):\n\t return \"TagError\"\n\tif data.get(\"bLamp_Enable\"):\n\t return \"Enable PB Pressed\" \n\treturn \"Inactive\"",
"type": "script"
}
],
"type": "tag"
},
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 25,
"width": 25
}
},
"root": {
"children": [
{
"meta": {
"name": "Button"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.elements[1].fill.paint": {
"binding": {
"config": {
"expression": "if(\r\n {view.custom.state} \u003d \"Closed\",\r\n \"#000000\",\r\n {view.custom.color}\r\n)\r\n"
},
"type": "expr"
}
},
"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})"
},
"enabled": false,
"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": {
"paint": "#AAAAAA"
},
"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"
}
],
"viewBox": "0 0 20 20"
},
"type": "ia.shapes.svg"
}
],
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.openDock(\u0027Docked-East-CHPB\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": "High",
"output": "Alarms-Styles/High"
},
{
"input": "Medium",
"output": "Alarms-Styles/Medium"
},
{
"input": "Low",
"output": "Alarms-Styles/Low"
},
{
"input": "Diagnostic",
"output": "Alarms-Styles/Diagnostic"
}
],
"outputType": "style-list",
"type": "map"
}
],
"type": "expr"
}
},
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if(\n {view.custom.state} !\u003d \"TagError\",\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_buttons"
},
"type": "property"
}
}
},
"props": {
"mode": "percent",
"style": {
"cursor": "pointer"
}
},
"type": "ia.container.coord"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -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"
}
}

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -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)

View File

@ -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"
}
}

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,127 @@
{
"pages": {
"/": {
"title": "",
"viewPath": "Main-Views/Home"
},
"/Command": {
"title": "",
"viewPath": "Main-Views/CommandControl"
},
"/CustomView/:customView": {
"title": "",
"viewPath": "Custom-Views/Detail"
},
"/DetailedView/:detailedView/:plcTagPath": {
"title": "DetailedView",
"viewPath": "Detailed-Views/Detail"
},
"/Device-manager": {
"viewPath": "Main-Views/Device-Manager/DeviceManager"
},
"/Help": {
"title": "Help",
"viewPath": "Main-Views/Help"
},
"/MAP-Home": {
"title": "",
"viewPath": "Additional-Home-View/MAP-Home"
},
"/Monitron": {
"viewPath": "Main-Views/Monitron"
},
"/Oil": {
"viewPath": "Main-Views/OilMonitoring"
},
"/Real-Time": {
"viewPath": "Alarm-Views/RealTime"
},
"/Temperature": {
"title": "",
"viewPath": "Main-Views/TempMonitoring"
},
"/Tools": {
"title": "Tools",
"viewPath": "Main-Views/ToolBox"
},
"/Windows/Statistics": {
"title": "",
"viewPath": ""
},
"/Windows/Status": {
"title": "",
"viewPath": ""
},
"/config": {
"title": "",
"viewPath": "CommissioningTool/PageConfig"
}
},
"sharedDocks": {
"bottom": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "cover",
"handle": "show",
"iconUrl": "material/notifications_active",
"id": "Docked-South",
"modal": false,
"resizable": false,
"show": "onDemand",
"size": 165,
"viewParams": {},
"viewPath": "Navigation-Views/Docked-South"
}
],
"cornerPriority": "top-bottom",
"left": [
{
"anchor": "fixed",
"autoBreakpoint": 805,
"content": "auto",
"handle": "autoHide",
"iconUrl": "",
"id": "Docked-West",
"modal": false,
"resizable": false,
"show": "auto",
"size": 70,
"viewParams": {},
"viewPath": "Navigation-Views/Docked-West"
}
],
"right": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "cover",
"handle": "hide",
"iconUrl": "",
"id": "Docked-East",
"modal": false,
"resizable": false,
"show": "onDemand",
"size": 400,
"viewParams": {},
"viewPath": "PopUp-Views/Controller-Equipment/Information-Docked-East"
}
],
"top": [
{
"anchor": "fixed",
"autoBreakpoint": 480,
"content": "auto",
"handle": "hide",
"iconUrl": "",
"id": "",
"modal": false,
"resizable": false,
"show": "visible",
"size": 50,
"viewParams": {},
"viewPath": "Framework/Breakpoint"
}
]
}
}

View File

@ -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

View File

@ -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"
}
}

View File

@ -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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,206 @@
{
"custom": {
"state": {
"$": [
"ds",
192,
1758118477540
],
"$columns": [
{
"data": [
null,
null,
null,
"MCM01"
],
"name": "Location",
"type": "String"
},
{
"data": [
"High",
"Low",
"Medium",
"High"
],
"name": "Priority",
"type": "String"
},
{
"data": [
294,
257,
230,
2
],
"name": "Count",
"type": "Long"
}
]
},
"status": ""
},
"params": {
"value": {
"tagProps": [
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
}
},
"propConfig": {
"custom.state": {
"binding": {
"config": {
"polling": {
"enabled": true,
"rate": "1"
},
"queryPath": "GetActiveAlarmsByLocationAndPriority"
},
"type": "query"
},
"onChange": {
"enabled": null,
"script": "\tMCM \u003d self.params.value.tagProps[0]\n\tqueryData \u003d currentValue.value\n\t\n\tif not queryData:\n\t self.custom.status \u003d \"\"\n\t\n\t# Define priority order from highest to lowest\n\tpriority_order \u003d [\"Critical\", \"High\", \"Medium\", \"Low\", \"Diagnostic\"]\n\texisting_priorities \u003d set()\n\tmyPriority \u003d \"\"\n\t\n\t# Populate the set\n\tfor row in range(queryData.rowCount):\n\t mcm_val \u003d queryData.getValueAt(row, 0)\n\t severity \u003d queryData.getValueAt(row, 1).capitalize()\n\t count \u003d queryData.getValueAt(row, 2)\n\t\n\t if mcm_val \u003d\u003d MCM and count \u003e 0:\n\t existing_priorities.add(severity)\n\t\n\t# Find the highest one that exists\n\tfor priority in priority_order:\n\t if priority in existing_priorities:\n\t myPriority \u003d priority\n\t break\n\t\n\tself.custom.status \u003d myPriority"
},
"persistent": true
},
"custom.status": {
"persistent": true
},
"params.value": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 50,
"width": 300
}
},
"root": {
"children": [
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tnavigation.navigate_to_page.detailed_view(self, self.view.params.value.tagProps[0],self.view.params.value.tagProps[0], self.view.params.value.tagProps[3])"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Label"
},
"position": {
"grow": 1
},
"propConfig": {
"props.style.classes": {
"binding": {
"config": {
"path": "view.custom.status"
},
"transforms": [
{
"fallback": "State-Styles/Background-Fill/State5",
"inputType": "scalar",
"mappings": [
{
"input": "High",
"output": "State-Styles/Background-Fill/State1"
},
{
"input": "Medium",
"output": "State-Styles/Background-Fill/State2"
},
{
"input": "Low",
"output": "State-Styles/Background-Fill/State3"
},
{
"input": "Diagnostic",
"output": "State-Styles/Background-Fill/State4"
}
],
"outputType": "style-list",
"type": "map"
}
],
"type": "property"
}
},
"props.text": {
"binding": {
"config": {
"path": "view.custom.status"
},
"transforms": [
{
"fallback": "HEALTHY",
"inputType": "scalar",
"mappings": [
{
"input": "Diagnostic",
"output": "DIAGNOSTIC"
},
{
"input": "Low",
"output": "HALF WORKFLOW"
},
{
"input": "Medium",
"output": "CONTROLLED STOP"
},
{
"input": "High",
"output": "UNCONTROLLED STOP"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"borderColor": "#555555",
"borderStyle": "none",
"cursor": "pointer",
"marginBottom": 8,
"marginTop": 8
},
"textStyle": {
"fontSize": 12,
"textAlign": "center"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "root"
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
}

View File

@ -0,0 +1,44 @@
def handleClick(data):
if not data or len(data) != 1:
return
row = data[0]
clickedTagPath = row.get("FullTag", "")
MCM = row.get("Location", "")
MCM_Pages_Map = {
"MCM01": "autStand/Detailed_Views/MCM01-FLUID INBOUND",
"MCM02": "autStand/Detailed_Views/MCM02-NON CON SORTER",
}
page = MCM_Pages_Map.get(MCM)
if not page:
return
device = row.get("Device", "")
if not device or not clickedTagPath:
return
pathToDevice = ""
# check for the mcm
if "MCM" in device:
parts = clickedTagPath.split("/")
pathToDevice = "/".join(parts[:3])
else:
index = clickedTagPath.find(device)
if index == -1:
return
pathToDevice = clickedTagPath[:index + len(device)]
priority = row.get("Priority", "")
#combining with priority
combined = pathToDevice + "||" + priority
# Navigate to target view, passing the tag to highlight
system.perspective.navigate(view = page, params = {'highlightTagPath': str(combined)})

View File

@ -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"
}
}

View File

@ -0,0 +1,551 @@
{
"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": {
"forceFaultStatus": null,
"forceRunningStatus": null,
"has_state": false,
"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_gateways},\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_gateways},\r\n\t\t4, {session.custom.alarm_filter.show_diagnostic}||{session.custom.alarm_filter.show_gateways},\r\n\t\t5, {session.custom.alarm_filter.show_gateways},\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_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.forceFaultStatus": {
"paramDirection": "input",
"persistent": true
},
"params.forceRunningStatus": {
"paramDirection": "input",
"persistent": true
},
"params.has_state": {
"paramDirection": "input",
"persistent": true
},
"params.tagProps": {
"paramDirection": "inout",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 47,
"width": 68
}
},
"root": {
"children": [
{
"meta": {
"name": "ControlCabinet"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.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": [
{
"d": "M 0 40 L 0 0 L 61 40 Z",
"fill": {},
"name": "path",
"stroke": {
"paint": "#4c4c4c",
"width": 4
},
"transform": "rotate(-180,30.5,20)",
"type": "path"
},
{
"d": "M 0 40 L 0 0 L 61 40 Z",
"fill": {
"paint": "#4C4C4C"
},
"name": "path",
"stroke": {
"paint": "#000000",
"width": 4
},
"type": "path"
}
],
"preserveAspectRatio": "none",
"style": {},
"viewBox": "-0.5 -0.5 62 41"
},
"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"
}
},
"meta.visible": {
"binding": {
"config": {
"path": "view.custom.display_icon"
},
"type": "property"
}
},
"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": "68:47",
"mode": "percent",
"style": {
"cursor": "pointer"
}
},
"type": "ia.container.coord"
}
}

View File

@ -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])

View File

@ -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"
}
}

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 113 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

View File

@ -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"
}
}

View File

@ -0,0 +1,318 @@
{
"custom": {
"numberOfColumns": 6,
"test": [
{
"Label": "Seq",
"Value": 2,
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Label": "Type",
"Value": "StateChanged",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Label": "When",
"Value": "1670429640000",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Label": "Source",
"Value": "PLC01/054BV55",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Label": "CurrentState",
"Value": "",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Label": "ReasonCode",
"Value": "",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
}
]
},
"params": {
"checkedState": "False",
"index": "value",
"rowData": [
[
"Seq",
2
],
[
"Type",
"StateChanged"
],
[
"When",
"1670429640000"
],
[
"Source",
"PLC01/054BV55"
],
[
"CurrentState",
""
],
[
"ReasonCode",
""
]
]
},
"propConfig": {
"custom.test": {
"persistent": true
},
"params.checkedState": {
"paramDirection": "input",
"persistent": true
},
"params.index": {
"paramDirection": "input",
"persistent": true
},
"params.rowData": {
"onChange": {
"enabled": null,
"script": "\tself.custom.numberOfColumns \u003d len(self.params.rowData)\n\t\n\tsystem.perspective.print(\"ROW SCRIPT\")\n\tsystem.perspective.print(self.params.rowData)\n\tinstances \u003d []\n\t\n\tfor col in self.params.rowData:\n\t\tsystem.perspective.print(col)\n\t\tinstance \u003d {\n\t\t\t \"instanceStyle\": {\n\t\t\t \"classes\": \"\"\n\t\t\t },\n\t\t\t \"instancePosition\": {},\n\t\t\t \"Label\": col[0],\n\t\t\t \"Value\": col[1]\n\t\t\t }\n\t\tinstances.append(instance)\n\t\t\n\tself.getChild(\"root\").getChild(\"FlexRepeater\").props.instances \u003d instances\n\t\n\tself.custom.test \u003d instances\n"
},
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 86,
"width": 1220
}
},
"root": {
"children": [
{
"custom": {
"SelectionData": "value"
},
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tsystem.perspective.print(self.view.params.index)\n\tmsg \u003d \"update_selectionData\"\n\tpayload \u003d {\n\t\t\"index\" : self.view.params.index,\n\t\t\"state\"\t: self.props.selected\n\t}\n\tsystem.perspective.sendMessage(msg, payload)"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Checkbox"
},
"position": {
"basis": "40px",
"shrink": 0
},
"propConfig": {
"props.selected": {
"binding": {
"config": {
"path": "view.params.checkedState"
},
"type": "property"
}
}
},
"props": {
"style": {
"marginRight": "2px"
},
"text": ""
},
"scripts": {
"customMethods": [],
"extensionFunctions": null,
"messageHandlers": [
{
"messageType": "tableSelectionData",
"pageScope": true,
"script": "\t# implement your handler here\n\tself.custom.SelectionData \u003d payload",
"sessionScope": false,
"viewScope": false
}
]
},
"type": "ia.input.checkbox"
},
{
"custom": {
"key": {
"backgroundColor": "#F2F3F4",
"borderStyle": "none",
"classes": "FadeInFast, background, background-none",
"cursor": "pointer",
"max-height": "400px",
"overflow": "visible"
}
},
"meta": {
"name": "FlexRepeater"
},
"props": {
"elementPosition": {
"basis": "150px"
},
"instances": [
{
"Label": "Seq",
"Value": 2,
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Label": "Type",
"Value": "StateChanged",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Label": "When",
"Value": "1670429640000",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Label": "Source",
"Value": "PLC01/054BV55",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Label": "CurrentState",
"Value": "",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
},
{
"Label": "ReasonCode",
"Value": "",
"instancePosition": {},
"instanceStyle": {
"classes": ""
}
}
],
"path": "Main-Views/Commissioning Tool/Column",
"style": {
"borderBottomLeftRadius": "5px",
"borderBottomRightRadius": "5px",
"borderStyle": "solid",
"borderTopLeftRadius": "5px",
"borderTopRightRadius": "5px",
"borderWidth": "1px",
"margin": "2px",
"marginRight": 5,
"overflow": "hidden",
"radius": "4px"
},
"useDefaultViewHeight": false
},
"type": "ia.display.flex-repeater"
},
{
"children": [
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tsystem.perspective.print(self.view.params.index)\n\tmsg \u003d \"measurementTab_deleteRows\"\n\tpayload \u003d {\"index\" : self.view.params.index}\n\tsystem.perspective.sendMessage(msg, payload)"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Button"
},
"position": {
"grow": 1
},
"props": {
"image": {
"icon": {
"path": "material/delete_forever"
}
},
"primary": false,
"style": {
"margin": "10 px",
"max-height": "40px"
},
"text": ""
},
"type": "ia.input.button"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "40px",
"shrink": 0
},
"props": {
"direction": "column",
"justify": "center"
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "root"
},
"props": {
"style": {
"borderBottomLeftRadius": "5px",
"borderBottomRightRadius": "5px",
"borderTopLeftRadius": "5px",
"borderTopRightRadius": "5px",
"classes": "FadeInFast, background, background-none",
"margin": "5px",
"max-height": "75px"
}
},
"type": "ia.container.flex"
}
}

View File

@ -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

View File

@ -0,0 +1,98 @@
{
"custom": {},
"params": {
"direction": {
"downward": false,
"left": false,
"right": false,
"upward": false
},
"pageid": ""
},
"propConfig": {
"params.direction": {
"paramDirection": "input",
"persistent": true
},
"params.pageid": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 55,
"width": 40
}
},
"root": {
"children": [
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\tsystem.perspective.navigate(\"/\" + self.view.params.pageid)"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Button",
"tooltip": {
"enabled": true
}
},
"position": {
"basis": "45px",
"grow": 1
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"path": "view.params.pageid"
},
"type": "property"
}
},
"props.align": {
"persistent": true
},
"props.image.icon.path": {
"binding": {
"config": {
"expression": "if({view.params.direction.upward},\"material/arrow_upward\",\nif({view.params.direction.downward},\"material/arrow_downward\",\nif({view.params.direction.left},\"material/arrow_back\",\nif({view.params.direction.right},\"material/arrow_forward\",0))))"
},
"type": "expr"
}
}
},
"props": {
"image": {
"height": 55,
"icon": {
"color": "#000000"
},
"position": "center",
"width": 40
},
"style": {
"backgroundColor": "#F6F6F6"
},
"text": ""
},
"type": "ia.input.button"
}
],
"meta": {
"name": "root"
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
}

View File

@ -0,0 +1,718 @@
{
"custom": {
"dpm1-dpm2": true,
"dpm2-dpm3": true,
"dpm3-dpm4": true,
"dpm4-dpm5": true,
"dpm5-mcm": true,
"mcm-dpm1": true
},
"params": {
"tagProps": [
"System/MCM02/Rack",
"System/MCM02/IO_BLOCK/DPM/PS1_1_DPM1",
"System/MCM02/IO_BLOCK/DPM/PS1_1_DPM2",
"System/MCM02/IO_BLOCK/DPM/PS2_1_DPM1",
"System/MCM02/IO_BLOCK/DPM/PS2_1_DPM2",
"System/MCM02/IO_BLOCK/DPM/PS1_4_DPM1"
]
},
"propConfig": {
"custom.dpm1-dpm2": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"1": "{view.params.tagProps[1]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{1}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},false)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
},
{
"input": true,
"output": false
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.dpm2-dpm3": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"2": "{view.params.tagProps[2]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{2}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},false)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
},
{
"input": true,
"output": false
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.dpm3-dpm4": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"3": "{view.params.tagProps[3]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{3}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},false)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
},
{
"input": true,
"output": false
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.dpm4-dpm5": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"4": "{view.params.tagProps[4]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{4}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},false)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
},
{
"input": true,
"output": false
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.dpm5-mcm": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"5": "{view.params.tagProps[5]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{5}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},false)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
},
{
"input": true,
"output": false
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.mcm-dpm1": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},false)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
},
{
"input": true,
"output": false
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 894,
"width": 1920
}
},
"root": {
"children": [
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.session.custom.dpm_view_path \u003d self.props.params.view\n\tself.session.custom.show_dpm_device_view \u003d True"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "MCM"
},
"position": {
"height": 0.5,
"width": 0.3333,
"x": 0.6666,
"y": 0.5
},
"propConfig": {
"props.params.InOn": {
"binding": {
"config": {
"path": "view.custom.dpm5-mcm"
},
"type": "property"
}
},
"props.params.OutOn": {
"binding": {
"config": {
"path": "view.custom.mcm-dpm1"
},
"type": "property"
}
}
},
"props": {
"params": {
"InDown": false,
"InLeft": true,
"InUp": false,
"OutDown": false,
"OutRight": false,
"OutUp": true
},
"path": "Windows/Tabs/Enternet Windows/Components/EN4TR"
},
"type": "ia.display.view"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.session.custom.dpm_view_path \u003d self.props.params.view\n\tself.session.custom.show_dpm_device_view \u003d True"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "PS1_1_DPM1"
},
"position": {
"height": 0.5,
"width": 0.3333,
"x": 0.6666
},
"propConfig": {
"props.params.DownOn": {
"binding": {
"config": {
"path": "view.custom.mcm-dpm1"
},
"type": "property"
}
},
"props.params.InOn": {
"binding": {
"config": {
"path": "view.custom.dpm1-dpm2"
},
"type": "property"
}
},
"props.params.OutOn": {
"binding": {
"config": {
"path": "view.custom.mcm-dpm1"
},
"type": "property"
}
}
},
"props": {
"params": {
"Down1": false,
"Down2": false,
"Down3": true,
"DownLeft": false,
"DownRight": false,
"InDown": false,
"InLeft": true,
"InUp": false,
"OutDown": true,
"OutRight": false,
"OutUp": false,
"view": "Windows/Tabs/Enternet Windows/DPMs/DPM Devices/MCM02/PS1_1_DPM1"
},
"path": "Windows/Tabs/Enternet Windows/Components/DPM_BLOCK"
},
"type": "ia.display.view"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.session.custom.dpm_view_path \u003d self.props.params.view\n\tself.session.custom.show_dpm_device_view \u003d True"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "PS1_1_DPM2"
},
"position": {
"height": 0.5,
"width": 0.3333,
"x": 0.3333
},
"propConfig": {
"props.params.InOn": {
"binding": {
"config": {
"path": "view.custom.dpm2-dpm3"
},
"type": "property"
}
},
"props.params.OutOn": {
"binding": {
"config": {
"path": "view.custom.dpm1-dpm2"
},
"type": "property"
}
}
},
"props": {
"params": {
"Down1": false,
"Down2": false,
"Down3": false,
"DownLeft": false,
"DownOn": false,
"DownRight": false,
"InDown": false,
"InLeft": true,
"InUp": false,
"OutDown": false,
"OutRight": true,
"OutUp": false,
"view": "Windows/Tabs/Enternet Windows/DPMs/DPM Devices/MCM02/PS1_1_DPM2"
},
"path": "Windows/Tabs/Enternet Windows/Components/DPM_BLOCK"
},
"type": "ia.display.view"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.session.custom.dpm_view_path \u003d self.props.params.view\n\tself.session.custom.show_dpm_device_view \u003d True"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "PS2_1_DPM1"
},
"position": {
"height": 0.5,
"width": 0.3333
},
"propConfig": {
"props.params.DownOn": {
"binding": {
"config": {
"path": "view.custom.dpm3-dpm4"
},
"type": "property"
}
},
"props.params.InOn": {
"binding": {
"config": {
"path": "view.custom.dpm3-dpm4"
},
"type": "property"
}
},
"props.params.OutOn": {
"binding": {
"config": {
"path": "view.custom.dpm2-dpm3"
},
"type": "property"
}
}
},
"props": {
"params": {
"Down1": false,
"Down2": true,
"Down3": false,
"DownLeft": false,
"DownRight": false,
"InDown": true,
"InLeft": false,
"InUp": false,
"OutDown": false,
"OutRight": true,
"OutUp": false,
"view": "Windows/Tabs/Enternet Windows/DPMs/DPM Devices/MCM02/PS2_1_DPM1"
},
"path": "Windows/Tabs/Enternet Windows/Components/DPM_BLOCK"
},
"type": "ia.display.view"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.session.custom.dpm_view_path \u003d self.props.params.view\n\tself.session.custom.show_dpm_device_view \u003d True"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "PS2_1_DPM2"
},
"position": {
"height": 0.5,
"width": 0.3333,
"y": 0.5
},
"propConfig": {
"props.params.InOn": {
"binding": {
"config": {
"path": "view.custom.dpm3-dpm4"
},
"type": "property"
}
},
"props.params.OutOn": {
"binding": {
"config": {
"path": "view.custom.dpm4-dpm5"
},
"type": "property"
}
}
},
"props": {
"params": {
"Down1": false,
"Down2": false,
"Down3": false,
"DownLeft": false,
"DownOn": false,
"DownRight": false,
"InDown": false,
"InLeft": false,
"InUp": true,
"OutDown": false,
"OutRight": true,
"OutUp": false,
"view": "Windows/Tabs/Enternet Windows/DPMs/DPM Devices/MCM02/PS2_1_DPM2"
},
"path": "Windows/Tabs/Enternet Windows/Components/DPM_BLOCK"
},
"type": "ia.display.view"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tself.session.custom.dpm_view_path \u003d self.props.params.view\n\tself.session.custom.show_dpm_device_view \u003d True"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "PS1_4_DPM1"
},
"position": {
"height": 0.5,
"width": 0.3333,
"x": 0.3333,
"y": 0.5
},
"propConfig": {
"props.params.InOn": {
"binding": {
"config": {
"path": "view.custom.dpm4-dpm5"
},
"type": "property"
}
},
"props.params.OutOn": {
"binding": {
"config": {
"path": "view.custom.dpm5-mcm"
},
"type": "property"
}
}
},
"props": {
"params": {
"Down1": false,
"Down2": false,
"Down3": false,
"DownLeft": false,
"DownOn": false,
"DownRight": false,
"InDown": false,
"InLeft": true,
"InUp": false,
"OutDown": false,
"OutRight": true,
"OutUp": false,
"view": "Windows/Tabs/Enternet Windows/DPMs/DPM Devices/MCM02/PS1_4_DPM1"
},
"path": "Windows/Tabs/Enternet Windows/Components/DPM_BLOCK"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "DPM1_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.65,
"y": 0.1
},
"props": {
"text": "PS1_1_DPM1 11.200.1.2",
"textStyle": {
"fontSize": "1vmin"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "DPM2_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.32,
"y": 0.1
},
"props": {
"text": "PS1_1_DPM2 11.200.1.3",
"textStyle": {
"fontSize": "1vmin"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "DPM3_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.005,
"y": 0.1
},
"props": {
"text": "PS2_1_DPM1 11.200.1.4",
"textStyle": {
"fontSize": "1vmin"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "DPM4_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.005,
"y": 0.6
},
"props": {
"text": "PS2_1_DPM2 11.200.1.5",
"textStyle": {
"fontSize": "1vmin"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "DPM5_label"
},
"position": {
"height": 0.0358,
"width": 0.0547,
"x": 0.32,
"y": 0.6
},
"props": {
"text": "PS1_4_DPM1 11.200.1.6",
"textStyle": {
"fontSize": "1vmin"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "root"
},
"position": {
"x": 120,
"y": -723
},
"props": {
"mode": "percent",
"style": {
"backgroundColor": "#ffffff"
}
},
"type": "ia.container.coord"
}
}

View File

@ -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

View File

@ -0,0 +1,821 @@
{
"custom": {},
"params": {},
"props": {},
"root": {
"children": [
{
"meta": {
"name": "overview"
},
"position": {
"height": 1,
"width": 1
},
"props": {
"elements": [
{
"id": "defs1",
"name": "defs1",
"type": "defs"
},
{
"elements": [
{
"d": "m 50.898508,98.853708 h 7.968617 v 54.314522 h -8.010778 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path26618",
"name": "path26618",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.252688"
},
"type": "path"
},
{
"d": "m 50.958134,89.432821 h 7.968618 v 8.819797 h -8.010779 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path27070",
"name": "path27070",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.252688"
},
"type": "path"
},
{
"d": "m 50.928321,80.131172 h 7.968618 v 8.819813 H 50.88616 Z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path27071",
"name": "path27071",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.252688"
},
"type": "path"
},
{
"d": "m 50.915973,79.650984 c -0.03662,-9.337847 0.465631,-12.934512 9.057157,-18.185229 l 4.090773,6.979925 c -5.588475,2.499739 -5.315971,6.075008 -5.200833,11.256195 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path27072",
"name": "path27072",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.252688"
},
"type": "path"
},
{
"d": "m 78.015155,60.866426 -13.60965,7.438354 -3.994947,-7.095504 1.445933,-0.372663 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path27082",
"name": "path27082",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.252688"
},
"type": "path"
},
{
"d": "M -4.378472,89.580386 H 3.5901454 V 125.29155 H -4.4206305 Z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path25072",
"name": "path25072",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.252688"
},
"type": "path"
},
{
"d": "M -4.312672,89.101688 C -4.5876011,80.125202 -3.2439287,75.830839 4.8339266,70.797235 l 3.956609,7.009733 c -4.9103195,2.06676 -5.0563864,6.77837 -5.1411604,11.315804 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path26615",
"name": "path26615",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.252688"
},
"type": "path"
},
{
"d": "m 12.752552,66.262724 3.986892,6.899531 -7.6365567,4.412776 -4.0079851,-6.936038 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path27074",
"name": "path27074",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.252688"
},
"type": "path"
},
{
"d": "m 20.802068,61.611891 3.986891,6.89953 -7.636553,4.412776 -4.007985,-6.936038 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path27080",
"name": "path27080",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.252688"
},
"type": "path"
},
{
"d": "m 38.667066,60.819149 -13.520212,7.527793 -4.002401,-6.961347 1.520466,-0.558992 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path27081",
"name": "path27081",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.252688"
},
"type": "path"
},
{
"d": "m 129.52339,52.800311 -0.0151,7.851928 -113.971891,-0.04791 0.01496,-7.89347 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path27083",
"name": "path27083",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.238825"
},
"type": "path"
},
{
"d": "m 236.88886,52.801916 -0.0139,7.867113 -106.01774,-0.04799 0.0139,-7.908736 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path27084",
"name": "path27084",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.242668"
},
"type": "path"
},
{
"d": "m 368.13999,52.797747 -0.0172,7.822731 -130.50685,-0.04772 0.0171,-7.864122 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path27085",
"name": "path27085",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.234406"
},
"type": "path"
},
{
"d": "m 369.49312,52.813912 c 5.09019,0.02616 8.04486,-0.269843 12.36531,2.010832 1.67283,0.976995 2.77146,2.097541 3.77814,3.241071 1.87532,2.871826 3.18129,5.922868 3.08318,10.89571 l -8.15234,0.03135 c -0.0812,-1.942515 0.0451,-3.839973 -1.5641,-5.83706 -2.41138,-2.715434 -6.2041,-2.357309 -9.50466,-2.469335 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path27086",
"name": "path27086",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.252688"
},
"type": "path"
},
{
"d": "m 380.58918,69.815611 h 7.981 v 49.015349 h -8.02323 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path27087",
"name": "path27087",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.240233"
},
"type": "path"
},
{
"d": "m 380.59871,119.40759 h 7.96863 v 8.81983 h -8.01079 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path27088",
"name": "path27088",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.252688"
},
"type": "path"
},
{
"d": "m 396.96637,148.01543 c -12.43434,0.13379 -16.63124,-5.75179 -16.36143,-18.99941 l 7.94153,2.9e-4 c 0.10783,7.84908 0.23927,10.85259 8.38711,11.06261 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path27089",
"name": "path27089",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.252688"
},
"type": "path"
},
{
"d": "m 413.83301,140.11689 0.10923,7.87616 -16.20895,0.065 -0.10979,-7.91782 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path27090",
"name": "path27090",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.241563"
},
"type": "path"
},
{
"d": "m 430.4526,140.02996 0.10455,7.88132 -15.51656,0.065 -0.1051,-7.92301 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path27091",
"name": "path27091",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.236424"
},
"type": "path"
},
{
"d": "m 440.81813,139.95878 0.0487,6.55847 -9.56453,0.0779 -0.0489,-6.59313 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path27092",
"name": "path27092",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.238731"
},
"type": "path"
},
{
"d": "m 450.1582,139.95794 0.002,6.57291 -8.84277,0.002 -0.002,-6.60765 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path27093",
"name": "path27093",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.229793"
},
"type": "path"
}
],
"id": "layer1",
"name": "layer1",
"transform": "matrix(0.59758737,0,0,0.59758737,9.667912,71.676702)",
"type": "group"
},
{
"elements": [
{
"d": "m 384.8676,126.75367 -0.004,7.65407 -25.01168,-0.0466 0.003,-7.69456 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187863",
"name": "path187863",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.234199"
},
"type": "path"
},
{
"d": "m 359.08125,126.72689 -0.003,7.65432 -18.41326,-0.0467 0.002,-7.69485 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187862",
"name": "path187862",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.233641"
},
"type": "path"
},
{
"d": "m 339.14284,126.9 -0.0433,7.42862 -331.9387066,-0.0451 0.04327,-7.46793 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187861",
"name": "path187861",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.205768"
},
"type": "path"
},
{
"d": "m 5.8765748,126.81736 -0.02578,7.51375 -9.0460865,-0.0462 -0.027403,-7.47242 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187860",
"name": "path187860",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.199536"
},
"type": "path"
},
{
"d": "m -4.0140662,126.81684 -0.025457,7.51491 -8.9312238,-0.0463 -0.02705,-7.47356 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187891",
"name": "path187891",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.198282"
},
"type": "path"
},
{
"d": "m -13.871557,126.91616 -0.0024,7.39581 -18.63594,-0.0449 0.0022,-7.43498 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path27083-7",
"name": "path27083-7",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.237623"
},
"type": "path"
},
{
"d": "m 117.80101,190.65701 -20.070515,-0.006 0.12201,-51.38475 20.176755,0.006 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187867",
"name": "path187867",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.140333"
},
"type": "path"
},
{
"d": "m 139.6223,190.65701 -20.0705,-0.006 0.12202,-51.38475 20.17673,0.006 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187868",
"name": "path187868",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.140333"
},
"type": "path"
},
{
"d": "m 161.26621,190.65701 -20.0705,-0.006 0.12202,-51.38475 20.17673,0.006 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187869",
"name": "path187869",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.140333"
},
"type": "path"
},
{
"d": "m 190.00647,190.83443 -20.0705,-0.006 0.12202,-51.38475 20.17673,0.006 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187870",
"name": "path187870",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.140333"
},
"type": "path"
},
{
"d": "m 211.11815,190.83443 -20.07051,-0.006 0.12202,-51.38475 20.17674,0.006 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187871",
"name": "path187871",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.140333"
},
"type": "path"
},
{
"d": "m 232.1411,190.92312 -20.07049,-0.006 0.122,-51.38474 20.17676,0.006 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187872",
"name": "path187872",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.140333"
},
"type": "path"
},
{
"d": "m 263.01028,190.3909 -20.0705,-0.006 0.122,-51.38474 20.17673,0.006 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187873",
"name": "path187873",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.140333"
},
"type": "path"
},
{
"d": "m 284.65416,190.74572 -20.07048,-0.006 0.12199,-51.38473 20.17675,0.006 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187874",
"name": "path187874",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.140333"
},
"type": "path"
},
{
"d": "m 307.18511,190.92312 -20.0705,-0.006 0.12202,-51.38474 20.17673,0.006 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187875",
"name": "path187875",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.140333"
},
"type": "path"
},
{
"d": "m 307.18527,124.92698 -20.07051,-0.006 0.12201,-51.384782 20.17675,0.0063 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187882",
"name": "path187882",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.140333"
},
"type": "path"
},
{
"d": "m 284.6541,124.92698 -20.0705,-0.006 0.12202,-51.384782 20.17673,0.0063 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187883",
"name": "path187883",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.140333"
},
"type": "path"
},
{
"d": "m 263.00944,124.74957 -20.0705,-0.006 0.122,-51.38478 20.17675,0.0063 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187884",
"name": "path187884",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.140333"
},
"type": "path"
},
{
"d": "m 232.14109,124.74957 -20.07049,-0.006 0.122,-51.38478 20.17676,0.0063 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187885",
"name": "path187885",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.140333"
},
"type": "path"
},
{
"d": "m 210.85202,124.74957 -20.0705,-0.006 0.12202,-51.38478 20.17673,0.0063 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187886",
"name": "path187886",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.140333"
},
"type": "path"
},
{
"d": "m 189.56295,125.10439 -20.0705,-0.006 0.122,-51.384792 20.17675,0.0063 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187887",
"name": "path187887",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.140333"
},
"type": "path"
},
{
"d": "m 159.75824,124.57217 -20.07052,-0.006 0.122,-51.384791 20.17677,0.0063 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187888",
"name": "path187888",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.140333"
},
"type": "path"
},
{
"d": "m 137.8009,125.41781 -20.07048,-0.006 0.122,-51.384799 20.17674,0.0063 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187889",
"name": "path187889",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.140333"
},
"type": "path"
},
{
"d": "m 117.7123,124.57217 -20.070515,-0.006 0.12201,-51.384791 20.176745,0.0063 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187890",
"name": "path187890",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.140333"
},
"type": "path"
},
{
"d": "m 88.705924,123.77382 -20.070497,-0.006 0.122008,-51.384787 20.176737,0.0066 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187866",
"name": "path187866",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.140333"
},
"type": "path"
},
{
"d": "m 67.416846,123.68511 -20.070496,-0.006 0.122009,-51.384781 20.176738,0.0066 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187865",
"name": "path187865",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.140333"
},
"type": "path"
},
{
"d": "m 45.418128,123.68511 -20.0705,-0.006 0.122008,-51.384781 20.176742,0.0066 z",
"fill": {
"opacity": "1",
"paint": "#ffffff"
},
"id": "path187864",
"name": "path187864",
"stroke": {
"dasharray": "none",
"opacity": "1",
"paint": "#000000",
"width": "0.140333"
},
"type": "path"
}
],
"id": "layer3",
"name": "layer3",
"transform": "matrix(0.53694524,0,0,0.53694524,296.74386,87.188117)",
"type": "group"
}
],
"preserveAspectRatio": "none",
"viewBox": "0 0 507.99999 285.75"
},
"type": "ia.shapes.svg"
}
],
"meta": {
"name": "root"
},
"props": {
"mode": "percent"
},
"type": "ia.container.coord"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

View File

@ -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"
}
}

View File

@ -0,0 +1,659 @@
{
"custom": {
"PLC_list": [
"MCM01",
"MCM02",
"MCM03",
"MCM04",
"MCM05"
],
"button_type": "UNKNOWN",
"type": 1
},
"params": {
"forceFaultStatus": null,
"tagProps": [
"System/MCM06/Chute/NC/S02_203CH",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"custom.PLC_list": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]Configuration/PLC"
},
"transforms": [
{
"code": "\tdevices \u003d system.util.jsonDecode(value)\n\tplcList \u003d []\n\tfor k in devices.keys():\n\t\tplcList.append(k)\n\t\t\n\treturn(sorted(set(plcList)))\n",
"type": "script"
}
],
"type": "tag"
},
"persistent": true
},
"custom.button_type": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Button_Type"
},
"transforms": [
{
"expression": "coalesce({value},{view.params.forceFaultStatus},0)",
"type": "expression"
},
{
"fallback": "UNKNOWN",
"inputType": "scalar",
"mappings": [
{
"input": 5,
"output": "Chute_JR"
},
{
"input": 4,
"output": "GS"
},
{
"input": 3,
"output": "PR"
},
{
"input": 2,
"output": "Start"
},
{
"input": 1,
"output": "JR"
},
{
"input": 6,
"output": "Enable"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
},
"persistent": true
},
"custom.type": {
"persistent": true
},
"params.forceFaultStatus": {
"paramDirection": "input",
"persistent": true
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"width": 400
}
},
"root": {
"children": [
{
"children": [
{
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"grow": 1
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"expression": "\u0027Source ID: \u0027 + {view.params.tagProps[0]}"
},
"type": "expr"
}
}
},
"props": {
"style": {
"color": "#FFFF",
"fontFamily": "Arial",
"fontSize": 14,
"fontWeight": "bold",
"paddingLeft": 10
}
},
"type": "ia.display.label"
},
{
"events": {
"dom": {
"onClick": {
"config": {
"script": "\tsystem.perspective.closeDock(\u0027Docked-East-CHPB\u0027)\n\tself.getSibling(\"tabs\").props.currentTabIndex \u003d 0"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Icon",
"tooltip": {
"enabled": true,
"style": {
"cursor": "pointer"
},
"text": "Close faceplate"
}
},
"props": {
"path": "material/close",
"style": {
"cursor": "pointer",
"marginBottom": 5,
"marginLeft": 5,
"marginRight": 5,
"marginTop": 5
}
},
"type": "ia.display.icon"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "30px",
"shrink": 0
},
"props": {
"style": {
"overflow": "hidden"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"children": [
{
"children": [
{
"meta": {
"name": "Label"
},
"position": {
"basis": "32px",
"display": false
},
"propConfig": {
"position.display": {
"binding": {
"config": {
"expression": "if({../AlarmTable.props.params.length_of_table_data} \u003d 0, True, False)"
},
"enabled": false,
"type": "expr"
}
}
},
"props": {
"style": {
"classes": "Labels/Label_1",
"marginTop": 20
},
"text": "No Active Alarms"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "AlarmStatusTable"
},
"position": {
"basis": "400px",
"grow": 1
},
"propConfig": {
"props.filters.active.text": {
"binding": {
"config": {
"path": "view.params.tagProps[0]"
},
"transforms": [
{
"code": "\treturn value[1:]",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"columns": {
"active": {
"displayPath": {
"enabled": false
},
"priority": {
"enabled": false
},
"source": {
"enabled": false
},
"state": {
"enabled": false
}
}
},
"filters": {
"active": {
"priorities": {
"critical": false,
"high": false,
"low": false,
"medium": false
},
"states": {
"clearUnacked": false
}
}
},
"refreshRate": 500,
"toolbar": {
"enabled": false
}
},
"type": "ia.display.alarmstatustable"
}
],
"meta": {
"name": "Active_tab"
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
},
{
"children": [
{
"children": [
{
"children": [
{
"meta": {
"name": "Name"
},
"position": {
"basis": "50%",
"grow": 1
},
"props": {
"style": {
"paddingLeft": 20
},
"text": "NAME"
},
"type": "ia.display.label"
},
{
"meta": {
"name": "DeviceName"
},
"position": {
"basis": "50%",
"grow": 1
},
"propConfig": {
"props.text": {
"binding": {
"config": {
"path": "view.params.tagProps[0]"
},
"transforms": [
{
"code": " return value.rsplit(\u0027/\u0027, 1)[-1]",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"style": {
"backgroundColor": "#FFFFFF",
"classes": "Text-Styles/Ariel-Bold-12pt",
"paddingLeft": 10
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "Property"
},
"position": {
"basis": "35px"
},
"props": {
"style": {
"classes": "PopUp-Styles/InfoLabel",
"overflow": "hidden"
}
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "Name"
},
"position": {
"basis": "35px"
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "Info_tab"
},
"position": {
"tabIndex": 1
},
"props": {
"direction": "column",
"style": {
"margin-left": ""
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"children": [
{
"children": [
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\ttag_name \u003d self.view.params.tagProps[0]\n\ttag_path \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+tag_name+\"/Commands/bBlockHost1\"\n\tsystem.tag.writeBlocking([tag_path],[True])"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Button"
},
"position": {
"basis": "80px",
"grow": 1
},
"propConfig": {
"props.enabled": {
"binding": {
"config": {
"expression": "indexOf({session.props.auth.user.roles}, \"Administrator\") \u003e\u003d 0 || indexOf({session.props.auth.user.roles}, \"Maintenance\") \u003e\u003d 0"
},
"type": "expr"
}
}
},
"props": {
"image": {
"icon": {
"color": "#0B0B0B"
}
},
"style": {
"backgroundColor": "#00FF00",
"classes": "Background-Styles/Controller"
},
"text": "ENABLE",
"textStyle": {
"color": "#FFFFFF"
}
},
"type": "ia.input.button"
}
],
"meta": {
"name": "Enable"
},
"position": {
"basis": "35px"
},
"props": {
"style": {
"classes": "PopUp-Styles/InfoLabel",
"padding": ""
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\ttag_name \u003d self.view.params.tagProps[0]\n\ttag_path \u003d \"[\" + self.session.custom.fc+ \"_SCADA_TAG_PROVIDER]\"+tag_name+\"/Commands/bUnblockHost1\"\n\tsystem.tag.writeBlocking([tag_path],[True])"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Button"
},
"position": {
"basis": "80px",
"grow": 1
},
"propConfig": {
"props.enabled": {
"binding": {
"config": {
"expression": "indexOf({session.props.auth.user.roles}, \"Administrator\") \u003e\u003d 0 || indexOf({session.props.auth.user.roles}, \"Maintenance\") \u003e\u003d 0"
},
"type": "expr"
}
}
},
"props": {
"image": {
"icon": {
"color": "#0B0B0B"
}
},
"style": {
"backgroundColor": "#FF0000",
"classes": "Background-Styles/Controller"
},
"text": "DISABLE",
"textStyle": {
"color": "#FFFFFF"
}
},
"type": "ia.input.button"
}
],
"meta": {
"name": "Disable"
},
"position": {
"basis": "35px"
},
"props": {
"style": {
"classes": "PopUp-Styles/InfoLabel",
"padding": ""
}
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "FlexContainer_0"
},
"position": {
"basis": "100px",
"grow": 1
},
"props": {
"direction": "column",
"style": {
"gap": 6,
"paddingBottom": 20,
"paddingLeft": 10,
"paddingRight": 10,
"paddingTop": 13
}
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "Commands_tab"
},
"position": {
"tabIndex": 2
},
"props": {
"direction": "column",
"style": {
"paddingTop": 1
}
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "tabs"
},
"position": {
"grow": 1
},
"propConfig": {
"props.tabs": {
"binding": {
"config": {
"path": "view.custom.type"
},
"transforms": [
{
"code": "\t# This script runs whenever view.custom.type changes\n\tif value \u003d\u003d 0 or value \u003d\u003d 3:\n\t\treturn [\"Alarms\", \"Info\"]\n\telse:\n\t\treturn [\"Alarms\", \"Info\", \"Commands\"]",
"type": "script"
}
],
"type": "property"
}
}
},
"props": {
"currentTabIndex": 2,
"menuType": "modern",
"tabSize": {
"width": 1000
},
"tabStyle": {
"active": {
"classes": "",
"color": "#FFFFFF",
"fontFamily": "Arial",
"fontSize": 14,
"fontWeight": "bold",
"paddingLeft": 10
},
"inactive": {
"classes": "",
"color": "#B8B8B8",
"fontFamily": "Arial",
"fontSize": 14,
"fontWeight": "bold",
"paddingLeft": 10
}
}
},
"type": "ia.container.tab"
}
],
"meta": {
"name": "FlexContainer_1"
},
"position": {
"basis": "670px",
"grow": 1
},
"props": {
"style": {
"border-top": "1px solid white",
"gap": ""
}
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "800px",
"grow": 1
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "root"
},
"props": {
"direction": "column",
"style": {
"classes": "Buttons/Button-Menu"
}
},
"type": "ia.container.flex"
}
}

File diff suppressed because it is too large Load Diff

View File

@ -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"
}
}

View File

@ -0,0 +1,237 @@
{
"custom": {},
"params": {},
"props": {
"defaultSize": {
"height": 1080,
"width": 400
}
},
"root": {
"children": [
{
"children": [
{
"children": [
{
"custom": {
"selected_tag": "[BRS1_SCADA_TAG_PROVIDER]System/device_count"
},
"events": {
"component": {
"onNodeClick": {
"config": {
"script": "\tpath \u003d event.path\n\tinfo \u003d system.tag.getConfiguration(path)\n\ttag_type \u003d str(info[0].get(\"tagType\"))\n\tif tag_type \u003d\u003d \"AtomicTag\":\n\t\tself.custom.selected_tag \u003d path\n\telse:\n\t\tself.custom.selected_tag \u003d None"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "TagBrowseTree"
},
"position": {
"basis": "669px"
},
"propConfig": {
"custom.tag_value": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"selected_tag": "{this.custom.selected_tag}"
},
"tagPath": "{selected_tag}"
},
"transforms": [
{
"code": "\timport org.python.core.PyUnicode as uni\n\tif value \u003d\u003d None:\n\t\treturn \"N/A\"\n\t\t\n\tif isinstance(value, uni) and len(value) \u003e 50:\n\t\treturn (value[:50])\n\treturn value",
"type": "script"
}
],
"type": "tag"
},
"onChange": {
"enabled": null,
"script": "\tpayload \u003d {}\n\ttag_value \u003d self.custom.tag_value\n\tpayload[\"data\"] \u003d tag_value \n\tsystem.perspective.sendMessage(\"update-tag-value\", payload, scope \u003d \"view\")"
}
},
"props.root.path": {
"binding": {
"config": {
"expression": "concat(\"[\",{session.custom.fc},\"_SCADA_TAG_PROVIDER]\")"
},
"type": "expr"
}
}
},
"props": {
"root": {},
"selection": {
"mode": "single",
"values": [
"[BRS1_SCADA_TAG_PROVIDER]System/device_count"
]
}
},
"type": "ia.display.tag-browse-tree"
},
{
"children": [
{
"meta": {
"name": "Icon"
},
"position": {
"basis": "32px"
},
"props": {
"path": "material/local_offer",
"style": {
"marginLeft": "10px"
}
},
"type": "ia.display.icon"
},
{
"meta": {
"name": "Label"
},
"position": {
"basis": "80px"
},
"props": {
"style": {
"textIndent": "10px"
},
"text": "Tag Value",
"textStyle": {
"fontSize": "12px",
"fontWeight": "bold"
}
},
"type": "ia.display.label"
}
],
"meta": {
"name": "FlexContainer_0"
},
"position": {
"basis": "40px"
},
"props": {
"style": {
"borderBottomLeftRadius": "5px",
"borderBottomRightRadius": "5px",
"borderStyle": "none",
"borderTopLeftRadius": "5px",
"borderTopRightRadius": "5px",
"marginLeft": "10px",
"marginRight": "10px",
"marginTop": "10px"
}
},
"type": "ia.container.flex"
},
{
"children": [
{
"meta": {
"name": "Markdown"
},
"position": {
"basis": "301px"
},
"props": {
"source": "{}",
"style": {
"fontFamily": "Arial",
"textIndent": "10px"
}
},
"scripts": {
"customMethods": [],
"extensionFunctions": null,
"messageHandlers": [
{
"messageType": "update-tag-value",
"pageScope": false,
"script": "\tdata \u003d payload[\"data\"]\n\tself.props.source \u003d data",
"sessionScope": false,
"viewScope": true
}
]
},
"type": "ia.display.markdown"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "112px"
},
"props": {
"style": {
"borderBottomLeftRadius": "5px",
"borderBottomRightRadius": "5px",
"borderStyle": "solid",
"borderTopLeftRadius": "5px",
"borderTopRightRadius": "5px",
"margin": "10px",
"marginLeft": "10px",
"marginRight": "10px",
"marginTop": "10px",
"paddingBottom": "10px",
"paddingLeft": "10px",
"paddingRight": "10px",
"paddingTop": "10px"
}
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "1025px"
},
"props": {
"direction": "column",
"style": {
"borderBottomLeftRadius": "5px",
"borderBottomRightRadius": "5px",
"borderStyle": "solid",
"borderTopLeftRadius": "5px",
"borderTopRightRadius": "5px",
"margin": "10px"
}
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "FlexContainer"
},
"position": {
"basis": "361px",
"grow": 1
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
],
"meta": {
"name": "root"
},
"props": {
"direction": "column"
},
"type": "ia.container.flex"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 B

View File

@ -0,0 +1,86 @@
/* Direct stylesheet authoring is an advanced feature. Knowledge of CSS required.*/
.psc-x1 { transition: all .2s ease-in-out; }
.psc-x1:hover { transform: scale(1.5) !important; z-index: 5;}
.psc-x2 { transition: all .2s ease-in-out; }
.psc-x2:hover { transform: scale(2) !important; z-index: 5;}
.psc-x3 { transition: all .2s ease-in-out; }
.psc-x3:hover { transform: scale(3) !important; z-index: 5;}
/* Set the styling for the Table component checkbox colour.*/
.ia_tableComponent[data-component="ia.display.table"] .ia_checkbox__checkedIcon {
color: black;
}
.ia_tableComponent[data-component="ia.display.table"] .ia_checkbox__uncheckedIcon {
color: black;
}
div[data-component="ia.input.fileupload"] .ia_button--primary {
background-color: var(--neutral-30);
border-style: None;
color: black;
border-radius:20px;
}
/* Help page styles */
.psc-background:hover {
box-shadow: 0 4px 20px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
transition: box-shadow 0.9s ease-in-out;
}
.psc-background-none {
box-shadow: 0 0px 0px 0 , 0 0px 0px 0;
transition: box-shadow 0.9s ease-in-out;
}
@keyframes fadeIn{
0% { opacity: 0; }
100% { opacity: 1; }
}
.psc-FadeInFast {
animation: fadeIn 2s;
}
.psc-FadeInMedium {
animation: fadeIn 4s;
}
.psc-Disconnects\/Device-Connected.ia_container--primary.coord-aspect-ratio.aspect-horizontal.view
.inner-container:has(svg path[d="M 0.01621377,0.01595147 H 25.93719 V 41.138171 H 0.01621377 Z"]:only-of-type) {
flex: 0 0 12px !important;
}
.psc-Disconnects\/Device-Connected.ia_container--primary.coord-aspect-ratio.aspect-horizontal.view
.inner-container:has(
svg[viewBox="-0.5 -0.5 27 42"]
path[d="m 13.785537,6.4238337 -7.0747349,-3.1261989 -0.985,1.7060701 6.2447349,4.563801 z"]
):has(
svg[viewBox="-0.5 -0.5 27 42"]
path[d="m 12.141737,10.447495 -5.3573679,5.578853 1.2662916,1.509108 6.4243953,-4.30722 z"]
) {
flex: 0 0 16px !important;
}
.psc-FadeInSlow {
animation: fadeIn 6s;
}
@keyframes rotation {
from {
transform: rotate(0deg);
}
to {
transform: rotate(359deg);
}
}
.psc-rotate {
animation: rotation 2s infinite linear;
}

View File

@ -0,0 +1,12 @@
SELECT
CONCAT(DATE(dumper_cycles.t_stamp), ' ', HOUR(dumper_cycles.t_stamp), ':00') AS StartTimestamp,
CONCAT('H', TIMESTAMPDIFF(HOUR, DATE_FORMAT(dumper_cycles.t_stamp, "%Y-%m-%d %H:00:00"), DATE_FORMAT(NOW(), "%Y-%m-%d %H:00:00"))) AS Hour,
SUM(dumper_cycles.ulgl1 = 1) AS ULGL1,
SUM(dumper_cycles.ulgl2 = 1) AS ULGL2,
SUM(dumper_cycles.ulgl3 = 1) AS ULGL3,
SUM(dumper_cycles.ulgl4 = 1) AS ULGL4 -- <-- ADD THIS LINE
FROM dumper_cycles
WHERE (dumper_cycles.t_stamp BETWEEN :starttime AND :endtime)
GROUP BY HOUR(dumper_cycles.t_stamp);

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,64 @@
import csv
from StringIO import StringIO
def check_csv_file(event):
"""
This function checks if the CSV file was saved as CSV-UF8 settings if it has removes extra data bytes from the file.
Args:
event : Containes the file data to be uploaded
Returns:
a string representing the file that is to be uploaded.
Raises:
None
"""
file_bytes = event.file.getBytes()
if bytearray.fromhex("ef bb bf") == bytearray(file_bytes[0:3]):
# Strip first three bytes
file_bytes = file_bytes[3:]
return file_bytes.tostring()
def add_device_btn_code(whid, event):
reader = csv.DictReader(StringIO(FileHandler.uploader.check_csv_file(event)))
data ={}
def get_child():
return {
"Area":"",
"SubArea":""
}
for i, v in enumerate(reader):
child = get_child()
child["Area"] = v["Area"]
child["SubArea"] = v["SubArea"]
data[v["Device"]]= child
system.tag.writeBlocking(["[%s_SCADA_TAG_PROVIDER]Configuration/PLC"%whid], system.util.jsonEncode(data))
return "Success"
def add_detailed_view_btn_code(whid, event):
reader = csv.DictReader(StringIO(FileHandler.uploader.check_csv_file(event)))
data ={}
def convert_dict_value_to_list(string):
device_list = []
for i in string.replace("#", ",").split(","):
device_list.append(i.strip())
return device_list
for v in reader:
data[v["DetailedView"]]= convert_dict_value_to_list(v["Devices"])
system.tag.writeBlocking(["[%s_SCADA_TAG_PROVIDER]Configuration/DetailedViews"%whid], system.util.jsonEncode(data))
return "Success"

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 116 B

View File

@ -0,0 +1,841 @@
{
"custom": {},
"params": {
"tagProps": [
"System/MCM02/IO_BLOCK/DPM/NCS1_1_DPM2",
"System/MCM02/IO_BLOCK/FIO/S03_1_FIOM6",
"System/MCM02/IO_BLOCK/FIO/S03_1_FIOM7",
"System/MCM02/IO_BLOCK/FIO/S03_1_FIOM8",
"System/MCM02/IO_BLOCK/FIO/S03_1_FIOM9",
"System/MCM02/IO_BLOCK/FIO/S03_CH115_FIOM1",
"System/MCM02/IO_BLOCK/FIO/S03_CH116_FIOM1",
"System/MCM02/IO_BLOCK/FIO/S03_CH121_FIOM1",
"System/MCM02/IO_BLOCK/FIO/S03_CH122_FIOM1",
"System/MCM02/IO_BLOCK/SIO/NCS1_1_SIO1"
]
},
"props": {
"defaultSize": {
"height": 1080,
"width": 1920
}
},
"root": {
"children": [
{
"meta": {
"name": "DPM"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.params.con_lines[0]": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[1]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},true)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
},
"props.params.con_lines[1]": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[2]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},true)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
},
"props.params.con_lines[2]": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[3]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},true)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
},
"props.params.con_lines[3]": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[4]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},true)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
},
"props.params.con_lines[4]": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[5]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},true)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
},
"props.params.con_lines[5]": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[6]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},true)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
},
"props.params.con_lines[6]": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[7]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},true)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
},
"props.params.con_lines[7]": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[8]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},true)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
},
"props.params.con_lines[8]": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[9]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},true)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
},
"props.params.in": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},true)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
},
"props.params.out": {
"binding": {
"config": {
"fallbackDelay": 2.5,
"mode": "indirect",
"references": {
"0": "{view.params.tagProps[0]}",
"fc": "{session.custom.fc}"
},
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
},
"transforms": [
{
"expression": "coalesce({value},true)",
"type": "expression"
},
{
"fallback": false,
"inputType": "scalar",
"mappings": [
{
"input": false,
"output": true
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
}
},
"props": {
"params": {
"con_lines": [
null,
null,
null,
null,
null,
null,
null,
null,
null,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false,
false
],
"tagProps": [
"System/MCM02/IO_BLOCK/DPM/NCS1_1_DPM2",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/DPM_TO_HUB"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "DPM_label"
},
"position": {
"height": 0.0694,
"width": 0.101,
"x": 0.7498,
"y": 0.6527
},
"props": {
"text": "NCS1_1_DPM2",
"textStyle": {
"fontSize": "2vmin"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "S03_1_FIOM6"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.0263,
"y": 0.0073
},
"props": {
"params": {
"IP": "11.200.1.54",
"tagProps": [
"System/MCM02/IO_BLOCK/FIO/S03_1_FIOM6",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "S03_1_FIOM7"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.0689,
"y": 0.0073
},
"props": {
"params": {
"IP": "11.200.1.55",
"tagProps": [
"System/MCM02/IO_BLOCK/FIO/S03_1_FIOM7",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "S03_1_FIOM8"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.1116,
"y": 0.0084
},
"props": {
"params": {
"IP": "11.200.1.56",
"tagProps": [
"System/MCM02/IO_BLOCK/FIO/S03_1_FIOM8",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "S03_1_FIOM9"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.1544,
"y": 0.0074
},
"props": {
"params": {
"IP": "11.200.1.57",
"tagProps": [
"System/MCM02/IO_BLOCK/FIO/S03_1_FIOM9",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "S03_CH115_FIOM1"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.1959,
"y": 0.0065
},
"props": {
"params": {
"IP": "11.200.1.58",
"tagProps": [
"System/MCM02/IO_BLOCK/FIO/S03_CH115_FIOM1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "S03_CH116_FIOM1"
},
"position": {
"height": 0.1667,
"rotate": {
"anchor": "-607% 50%"
},
"width": 0.0349,
"x": 0.235,
"y": 0.0082
},
"props": {
"params": {
"IP": "11.200.1.59",
"tagProps": [
"System/MCM02/IO_BLOCK/FIO/S03_CH116_FIOM1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "S03_CH121_FIOM1"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.2764,
"y": 0.0092
},
"props": {
"params": {
"IP": "11.200.1.60",
"tagProps": [
"System/MCM02/IO_BLOCK/FIO/S03_CH121_FIOM1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "S03_CH122_FIOM1"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.3164,
"y": 0.0082
},
"props": {
"params": {
"IP": "11.200.1.61",
"tagProps": [
"System/MCM02/IO_BLOCK/FIO/S03_CH122_FIOM1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"meta": {
"name": "NCS1_1_SIO1"
},
"position": {
"height": 0.1667,
"width": 0.0349,
"x": 0.3565,
"y": 0.0082
},
"props": {
"params": {
"IP": "11.200.1.62",
"tagProps": [
"System/MCM02/IO_BLOCK/SIO/NCS1_1_SIO1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"path": "autStand/Custom_Views/Enternet-Windows/Components/FIO_SIO"
},
"type": "ia.display.view"
},
{
"children": [
{
"meta": {
"name": "Communication_Faulted_Text"
},
"position": {
"height": 0.4836,
"width": 0.8826,
"x": 0.0701,
"y": -0.0785
},
"props": {
"style": {
"borderColor": "#1A1A1A",
"overflow": "hidden",
"whiteSpace": "normal",
"wordBreak": "break-all"
},
"text": "Communication Faulted",
"textStyle": {
"fontFamily": "inherit",
"fontSize": "1.5vmin",
"textAlign": "start"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "Communication_Not_Faulted_Text"
},
"position": {
"height": 0.6066,
"width": 0.9032,
"x": 0.0698,
"y": 0.247
},
"props": {
"style": {
"borderColor": "#1A1A1A",
"overflow": "hidden",
"whiteSpace": "normal",
"wordBreak": "break-all"
},
"text": "Communication Not Faulted",
"textStyle": {
"fontFamily": "inherit",
"fontSize": "1.5vmin",
"textAlign": "start"
}
},
"type": "ia.display.label"
},
{
"meta": {
"name": "CoordinateContainer_0"
},
"position": {
"height": 0.0242,
"width": 0.0508,
"x": 0.0122,
"y": 0.176
},
"props": {
"style": {
"backgroundColor": "#FF0000"
}
},
"type": "ia.container.coord"
},
{
"meta": {
"name": "CoordinateContainer_1"
},
"position": {
"height": 0.0242,
"width": 0.0508,
"x": 0.0122,
"y": 0.5164
},
"props": {
"style": {
"backgroundColor": "#00FF00"
}
},
"type": "ia.container.coord"
}
],
"meta": {
"name": "CoordinateContainer"
},
"position": {
"height": 0.1365,
"width": 0.9083,
"x": 0.0083,
"y": 0.7752
},
"props": {
"mode": "percent"
},
"type": "ia.container.coord"
}
],
"meta": {
"name": "root"
},
"position": {
"x": 0.6348,
"y": -0.1546
},
"props": {
"mode": "percent"
},
"type": "ia.container.coord"
}
}

View File

@ -0,0 +1,431 @@
{
"custom": {},
"params": {
"value": {
"tagProps": [
"",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
}
},
"propConfig": {
"params.value": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 50,
"width": 300
}
},
"root": {
"children": [
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\ttags_to_read \u003d system.tag.readBlocking([\"Configuration/FC\"])\n\twhid \u003d tags_to_read[0].value\n\tid \u003d self.view.params.value.tagProps[0]\n\tcommandTarget\u003dstr(id)+\"/0\"#PLC01/0 --\u003etarget is the plc\n\tcommandParams\u003d\"\"\n\tif whid\u003d\u003d\"MAN2\" or whid\u003d\u003d\"BRS1\" or whid\u003d\u003d\"MAD6\":\n\t\tcommandTarget\u003d\"databridge/0\"\n\t\tcommandParams\u003d\"PLC\u003d\"+str(id)#this tells the target to data bridge\n\taction \u003d 1\n\tparameters\u003d{\"commandTarget\":commandTarget,\n\t\t\t\t\"commandCode\":1,\n\t\t\t\t\"commandTimestamp\":system.date.toMillis(system.date.now()),\n\t\t\t\t\"commandParams\":commandParams}\n\tCommands.button_commands.send_request(whid, action, parameters)"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Start",
"tooltip": {
"enabled": true,
"location": "top-left"
}
},
"position": {
"basis": "80px"
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027Start \u0027 + {view.params.value.tagProps[0]},\"Re-Authentication Required - Press \u0027Enable Controls\u0027 button and re-enter password\")"
},
"type": "expr"
}
},
"props.enabled": {
"binding": {
"config": {
"expression": "{session.custom.command_auth.enabled} \u0026\u0026 {parent.custom.has_role}"
},
"type": "expr"
}
},
"props.image.icon.color": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027#4A4A4A\u0027,\u0027#979797\u0027)"
},
"type": "expr"
}
},
"props.style.borderStyle": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027solid\u0027,\u0027none\u0027)"
},
"type": "expr"
}
}
},
"props": {
"image": {
"height": 32,
"icon": {
"path": "material/not_started"
},
"position": "top",
"width": 32
},
"style": {
"backgroundColor": "#D4D4D4",
"borderColor": "#4A4A4A",
"borderWidth": 2,
"classes": "\n",
"marginBottom": 5,
"marginLeft": 5,
"marginRight": 5,
"marginTop": 5
},
"text": "",
"textStyle": {
"fontSize": 12,
"fontWeight": "bold",
"textAlign": "center"
}
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\ttags_to_read \u003d system.tag.readBlocking([\"Configuration/FC\"])\n\twhid \u003d tags_to_read[0].value\n\tid \u003d self.view.params.value.tagProps[0]\n\tcommandTarget\u003dstr(id)+\"/0\"#PLC01/0 --\u003etarget is the plc\n\tcommandParams\u003d\"\"\n\tif whid\u003d\u003d\"MAN2\" or whid\u003d\u003d\"BRS1\" or whid\u003d\u003d\"MAD6\":\n\t\tcommandTarget\u003d\"databridge/0\"\n\t\tcommandParams\u003d\"PLC\u003d\"+str(id)#this tells the target to data bridge\n\taction \u003d 3\n\tparameters\u003d{\"commandTarget\":commandTarget,\n\t\t\t\t\"commandCode\":3,\n\t\t\t\t\"commandTimestamp\":system.date.toMillis(system.date.now()),\n\t\t\t\t\"commandParams\":commandParams}\n\tCommands.button_commands.send_request(whid, action, parameters)"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Reset",
"tooltip": {
"enabled": true,
"location": "top-left"
}
},
"position": {
"basis": "80px"
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027Reset \u0027 + {view.params.value.tagProps[0]},\"Re-Authentication Required - Press \u0027Enable Controls\u0027 button and re-enter password\") "
},
"type": "expr"
}
},
"props.enabled": {
"binding": {
"config": {
"expression": "{session.custom.command_auth.enabled} \u0026\u0026 {parent.custom.has_role}"
},
"type": "expr"
}
},
"props.image.icon.color": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027#4A4A4A\u0027,\u0027#979797\u0027)"
},
"type": "expr"
}
},
"props.style.borderStyle": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027solid\u0027,\u0027none\u0027)"
},
"type": "expr"
}
}
},
"props": {
"image": {
"height": 32,
"icon": {
"path": "material/refresh"
},
"position": "top",
"width": 32
},
"style": {
"backgroundColor": "#D4D4D4",
"borderColor": "#4A4A4A",
"borderWidth": 2,
"classes": "\n",
"marginBottom": 5,
"marginLeft": 5,
"marginRight": 5,
"marginTop": 5
},
"text": "",
"textStyle": {
"fontSize": 12,
"fontWeight": "bold",
"textAlign": "center"
}
},
"type": "ia.input.button"
},
{
"meta": {
"name": "JAM_Reset",
"tooltip": {
"enabled": true,
"location": "top-left"
}
},
"position": {
"basis": "80px"
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027Jam Reset \u0027 + {view.params.value.tagProps[0]},\"Re-Authentication Required - Press \u0027Enable Controls\u0027 button and re-enter password\")"
},
"type": "expr"
}
},
"props.enabled": {
"binding": {
"config": {
"expression": "{session.custom.command_auth.enabled} \u0026\u0026 {parent.custom.has_role}"
},
"type": "expr"
}
},
"props.image.icon.color": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027#4A4A4A\u0027,\u0027#979797\u0027)"
},
"type": "expr"
}
},
"props.style.borderStyle": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027solid\u0027,\u0027none\u0027)"
},
"type": "expr"
}
}
},
"props": {
"image": {
"height": 32,
"icon": {
"path": "material/sync_problem"
},
"position": "top",
"width": 32
},
"style": {
"backgroundColor": "#D4D4D4",
"borderColor": "#4A4A4A",
"borderWidth": 2,
"classes": "\n",
"marginBottom": 5,
"marginLeft": 5,
"marginRight": 5,
"marginTop": 5
},
"text": "",
"textStyle": {
"fontSize": 12,
"fontWeight": "bold",
"textAlign": "center"
}
},
"type": "ia.input.button"
},
{
"events": {
"component": {
"onActionPerformed": {
"config": {
"script": "\ttags_to_read \u003d system.tag.readBlocking([\"Configuration/FC\"])\n\twhid \u003d tags_to_read[0].value\n\tid \u003d self.view.params.value.tagProps[0]\n\tcommandTarget\u003dstr(id)+\"/0\"#PLC01/0 --\u003etarget is the plc\n\tcommandParams\u003d\"\"\n\tif whid\u003d\u003d\"MAN2\" or whid\u003d\u003d\"BRS1\" or whid\u003d\u003d\"MAD6\":\n\t\tcommandTarget\u003d\"databridge/0\"\n\t\tcommandParams\u003d\"PLC\u003d\"+str(id)#this tells the target to data bridge\n\taction \u003d 2\n\tparameters\u003d{\"commandTarget\":commandTarget,\n\t\t\t\t\"commandCode\":2,\n\t\t\t\t\"commandTimestamp\":system.date.toMillis(system.date.now()),\n\t\t\t\t\"commandParams\":commandParams}\n\tCommands.button_commands.send_request(whid, action, parameters)"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "Stop",
"tooltip": {
"enabled": true,
"location": "top-left"
}
},
"position": {
"basis": "80px"
},
"propConfig": {
"meta.tooltip.text": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027Stop \u0027 + {view.params.value.tagProps[0]},\"Re-Authentication Required - Press \u0027Enable Controls\u0027 button and re-enter password\") "
},
"type": "expr"
}
},
"props.enabled": {
"binding": {
"config": {
"expression": "{session.custom.command_auth.enabled} \u0026\u0026 {parent.custom.has_role}"
},
"type": "expr"
}
},
"props.image.icon.color": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027#4A4A4A\u0027,\u0027#979797\u0027)"
},
"type": "expr"
}
},
"props.style.borderStyle": {
"binding": {
"config": {
"expression": "if({this.props.enabled},\u0027solid\u0027,\u0027none\u0027)"
},
"type": "expr"
}
}
},
"props": {
"image": {
"height": 32,
"icon": {
"path": "material/stop_circle"
},
"position": "top",
"width": 32
},
"style": {
"backgroundColor": "#D4D4D4",
"borderColor": "#4A4A4A",
"borderWidth": 2,
"classes": "\n",
"marginBottom": 5,
"marginLeft": 5,
"marginRight": 5,
"marginTop": 5
},
"text": "",
"textStyle": {
"fontSize": 12,
"fontWeight": "bold",
"textAlign": "center"
}
},
"type": "ia.input.button"
}
],
"meta": {
"name": "root"
},
"propConfig": {
"custom.has_role": {
"binding": {
"config": {
"expression": "{session.custom.fc}"
},
"transforms": [
{
"code": "\trme_role \u003d value +\"-rme-c2c-all\"\n\troles \u003d (self.session.props.auth.user.roles)\n\tif (rme_role.lower() in roles \n\tor rme_role.upper() in roles \n\tor \"eurme-ignition-admins\" in roles):\n\t\treturn True\n\telse:\n\t\treturn False",
"type": "script"
}
],
"type": "expr"
}
},
"custom.status": {
"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": "if(isNull({value}), 0, {value})",
"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"
}
}
},
"props": {
"justify": "center"
},
"type": "ia.container.flex"
}
}

View File

@ -0,0 +1,280 @@
{
"custom": {
"color": "#C2C2C2",
"priority": "No Active Alarms"
},
"params": {
"tagProps": [
"System/MCM01/VFD/UL14_1_VFD1",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value",
"value"
]
},
"propConfig": {
"custom.color": {
"binding": {
"config": {
"expression": "now(1000)"
},
"transforms": [
{
"code": "\n import datetime\n state \u003d str(self.custom.state).strip().upper() # normalize input\n second \u003d datetime.datetime.now().second % 2 # 0 or 1 for blinking\n\n if state \u003d\u003d \"OK\":\n return \"#1fff1a\"\n elif state \u003d\u003d \"DISCONNECTED\":\n return \"#C2C2C2\"\n elif state \u003d\u003d \"FAULTED\":\n return \"#f9050d\" if second \u003d\u003d 0 else \"#1fff1a\"\n elif state \u003d\u003d \"FAULTED/DISCONNECTED\":\n return \"#f9050d\" if second \u003d\u003d 0 else \"#C2C2C2\"\n else:\n return \"#C2C2C2\"",
"type": "script"
}
],
"type": "expr"
},
"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}/Lenze"
},
"transforms": [
{
"expression": "coalesce({value},0)",
"type": "expression"
},
{
"fallback": "UNKNOWN",
"inputType": "scalar",
"mappings": [
{
"input": 0,
"output": "Closed"
},
{
"input": 50,
"output": "OK"
},
{
"input": 51,
"output": "DISCONNECTED"
},
{
"input": 52,
"output": "FAULTED"
},
{
"input": 53,
"output": "FAULTED/DISCONNECTED"
}
],
"outputType": "scalar",
"type": "map"
}
],
"type": "tag"
}
},
"params.tagProps": {
"paramDirection": "input",
"persistent": true
}
},
"props": {
"defaultSize": {
"height": 26,
"width": 26
}
},
"root": {
"children": [
{
"meta": {
"name": "vfd_icon"
},
"position": {
"height": 1,
"width": 1
},
"propConfig": {
"props.elements[2].fill.paint": {
"binding": {
"config": {
"path": "view.custom.color"
},
"type": "property"
}
}
},
"props": {
"elements": [
{
"id": "defs3",
"name": "defs3",
"type": "defs"
},
{
"d": "M 15.641997,3.2012871 C -6.406347,0.56989644 4.4216421,15.598399 4.4216421,19.03611 L 18.864497,5.1927068 Z",
"fill": {
"paint": "#c2c2c2"
},
"id": "path1",
"name": "path1",
"stroke": {
"width": "1.03379"
},
"type": "path"
},
{
"d": "M 19.35605,5.5008821 C 24.701245,10.402753 20.718148,17.901458 13.662088,22.359231 L 5.1469077,19.280293 Z",
"fill": {},
"id": "path2",
"name": "path2",
"stroke": {
"width": "1.31417"
},
"type": "path"
},
{
"cx": "12",
"cy": "12",
"fill": {
"paint": "transparent"
},
"id": "circle2",
"name": "circle2",
"r": "10",
"stroke": {
"paint": "#000",
"width": 2
},
"style": {
"classes": ""
},
"type": "circle"
},
{
"d": "M6,18 L18,6",
"fill": {
"paint": "transparent"
},
"id": "path3",
"name": "path3",
"stroke": {
"linecap": "round",
"paint": "#000000",
"width": "2"
},
"type": "path"
}
],
"preserveAspectRatio": "none",
"style": {
"borderRadius": "50%",
"boxShadow": "value",
"transition": "fill 0.5s ease-in-out"
},
"viewBox": "0 0 24 24"
},
"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-VFD\u0027,params\u003d{\u0027tagProps\u0027:self.view.params.tagProps, \"tags\":tags_table_dataset})"
},
"scope": "G",
"type": "script"
}
}
},
"meta": {
"name": "VFD",
"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_VFD"
},
"type": "property"
}
}
},
"props": {
"mode": "percent",
"style": {
"cursor": "pointer"
}
},
"type": "ia.container.coord"
}
}

Some files were not shown because too many files have changed in this diff Show More