diff --git a/Sources/CustomControls/Table/CWC_manifest_Schema.json b/Sources/CustomControls/Table/CWC_manifest_Schema.json new file mode 100644 index 0000000..a0a166f --- /dev/null +++ b/Sources/CustomControls/Table/CWC_manifest_Schema.json @@ -0,0 +1,504 @@ +{ + "type": "object", + "required": [ + "mver", + "control" + ], + "properties": { + "mver": { + "type": "string", + "title": "Defines the internal version of the manifest structure, not the version of the CWC itself", + "examples": [ + "1.2.0" + ] + }, + "$schema": { + "type": "string", + "title": "Defines the schema file", + "examples": [ + "./CWC_manifest_Schema.json" + ] + }, + "control": { + "type": "object", + "title": "Defines the kind of manifest", + "required": [ + "identity", + "contracts", + "types" + ], + "properties": { + "identity": { + "type": "object", + "required": [ + "name", + "version", + "displayname", + "type", + "start" + ], + "properties": { + "name": { + "type": "string", + "default": "", + "title": "Defines the name of the CWC as default name when placing this CWC in a screen", + "examples": [ + "LTW Control" + ] + }, + "version": { + "type": "string", + "default": "", + "title": "Defines the version of the CWC", + "examples": [ + "1.0" + ] + }, + "displayname": { + "type": "string", + "default": "", + "title": "Defines the name shown in TIA Portal", + "examples": [ + "LTW Control" + ] + }, + "icon": { + "type": "string", + "default": "", + "title": "Contains the path to the icon of the CWC", + "examples": [ + "./assets/ltw.png" + ] + }, + "type": { + "type": "string", + "default": "", + "title": "Contains the GUID. This needs to be the same as the name of the .zip file.", + "examples": [ + "guid://051efb1b-08cd-4a41-96bd-cd507cd9d2f0" + ] + }, + "start": { + "type": "string", + "default": "", + "title": "defines the starting point of the CWC for the browser", + "examples": [ + "./control/index.html" + ] + }, + "config": { + "type": "string", + "default": "", + "title": "defines the starting point of the Dialogue of the CWC (HMI extension 'Dialogues' required)", + "examples": [ + "./control/configurator.html" + ] + } + }, + "additionalProperties": false + }, + "contracts": { + "type": "object", + "title": "contains methods, events and properties as an interface for the usage in TIA Portal", + "required": [ + "api" + ], + "properties": { + "api": { + "type": "object", + "required": [ + "methods", + "events", + "properties" + ], + "properties": { + "methods": { + "type": "object", + "default": "", + "title": "contains a list of methods the CWC can use.", + "patternProperties": { + "^.*$": { + "type": "object", + "properties": { + "parameters": { + "type": "object", + "patternProperties": { + "^.*$": { + "type": "object", + "default": "", + "title": "contains a list of parameters of the event.", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "default": "", + "enum": [ + "number", + "string", + "boolean", + "object" + ], + "title": "Provides a type for the item", + "examples": [ + "string" + ] + } + } + } + }, + "additionalProperties": false + }, + "description": { + "type": "string", + "default": "", + "title": "Provides a description for the method", + "examples": [ + "downloads the content to the user in the given fileName" + ] + }, + "return": { + "type": "object", + "default": "", + "title": "Defines the return type of the method", + "properties": { + "type": { + "type": "string", + "default": "", + "enum": [ + "number", + "string", + "boolean", + "object", + "null" + ], + "title": "Provides a type for the item", + "examples": [ + "string" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "events": { + "type": "object", + "default": "", + "title": "contains a list of events the CWC can work with.", + "patternProperties": { + "^.*$": { + "type": "object", + "properties": { + "arguments": { + "type": "object", + "patternProperties": { + "^.*$": { + "type": "object", + "default": "", + "title": "contains a list of parameters of the event.", + "required": [ + "type" + ], + "properties": { + "type": { + "type": "string", + "default": "", + "enum": [ + "number", + "string", + "boolean" + ], + "title": "Provides a type for the item", + "examples": [ + "string" + ] + } + } + } + }, + "additionalProperties": false + }, + "description": { + "type": "string", + "default": "", + "title": "Provides a description for the method", + "examples": [ + "get triggered whenever the screen width or height changes" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "properties": { + "type": "object", + "default": "", + "title": "contains a list of properties the CWC can work with.", + "patternProperties": { + "^.*$": { + "type": "object", + "anyOf": [ + { + "required": [ + "type" + ] + }, + { + "required": [ + "$ref" + ] + } + ], + "properties": { + "type": { + "type": "string", + "default": "", + "enum": [ + "number", + "string", + "boolean" + ], + "title": "Provides a type for the item", + "examples": [ + "string" + ] + }, + "$ref": { + "type": "string", + "default": "", + "title": "use the user defined types ", + "examples": [ + "#/control/types/Zones" + ] + }, + "default": { + "type": [ + "string", + "number", + "boolean" + ], + "default": "", + "title": "Defines the default value", + "examples": [ + "0" + ] + }, + "description": { + "type": "string", + "default": "", + "title": "Describes what this property is used for.", + "examples": [ + "get triggered whenever the screen width or height changes" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + "environment": { + "type": "object", + "title": "containing ��prerequisites�� and ��extensions��.", + "properties": { + "prerequisites": { + "type": "object", + "default": "", + "title": "some basic properties", + "properties": { + "renderingspace": { + "type": "object", + "properties": { + "minwidth": { + "type": "number" + }, + "maxwidth": { + "type": "number" + }, + "defaultwidth": { + "type": "number" + }, + "minheight": { + "type": "number" + }, + "maxheight": { + "type": "number" + }, + "defaultheight": { + "type": "number" + }, + "units": { + "type": "string", + "enum": [ + "px", + "cm", + "mm", + "in", + "pt" + ] + } + } + } + }, + "additionalProperties": false + }, + "extensions": { + "type": "object", + "default": "", + "title": "Defines extensions and if they are mandatory or not,", + "properties": { + "HMI": { + "type": "object", + "properties": { + "mandatory": { + "type": "boolean", + "title": "if it is mandatoried", + "examples": [ + "true" + ] + }, + "version": { + "type": "string", + "title": "the version of this item", + "examples": [ + "~1.0.0" + ] + } + }, + "additionalProperties": false + } + } + } + }, + "additionalProperties": false + }, + "metadata": { + "type": "object", + "title": "It is possible to add more user defined metadata", + "patternProperties": { + "author": { + "type": "string", + "default": "", + "examples": [ + "Siemens" + ] + }, + "keywords": { + "type": "array", + "items": { + "type": "string" + } + }, + "description": { + "type": "string", + "default": "", + "examples": [ + "This is a demo project" + ] + }, + "homepage": { + "type": "string", + "default": "", + "examples": [ + "TestPage01" + ] + } + } + }, + "types": { + "type": "object", + "title": "contains local definitions for user defined datatypes, objects and arrays", + "patternProperties": { + "^.*$": { + "type": "object", + "default": "", + "title": "contains a list of parameters of the event.", + "properties": { + "$id": { + "type": "string", + "default": "", + "title": "the user defined types ", + "enum":[ + "http://tia.siemens.com/wincc-unified/types/s/color", + "http://tia.siemens.com/wincc-unified/types/s/datetime", + "http://tia.siemens.com/wincc-unified/types/s/string", + "http://tia.siemens.com/wincc-unified/types/s/bool", + "http://tia.siemens.com/wincc-unified/types/s/real" + ], + "examples": [ + "http://tia.siemens.com/wincc-unified/types/s/color" + ] + }, + "$ref": { + "type": "string", + "default": "", + "title": "use the user defined types ", + "examples": [ + "#/control/types/Zones" + ] + }, + "type": { + "type": "string", + "default": "", + "enum": [ + "number", + "string", + "boolean", + "object", + "array", + "integer" + ], + "title": "Provides a type for the item", + "examples": [ + "string" + ] + }, + "default": { + "type": [ + "string", + "number", + "boolean" + ], + "default": "", + "title": "The default value", + "examples": [ + "Center" + ] + }, + "enum": { + "type": "array", + "items": { + "type": ["string", "number"] + }, + "title": "The choices", + "examples": [ + "Top", + "Center", + "Bottom" + ] + } + } + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false +} \ No newline at end of file diff --git a/Sources/CustomControls/Table/manifest.json b/Sources/CustomControls/Table/manifest.json new file mode 100644 index 0000000..19d172c --- /dev/null +++ b/Sources/CustomControls/Table/manifest.json @@ -0,0 +1,73 @@ +{ + "$schema": "./CWC_manifest_Schema.json", + "mver": "1.2.0", + "control": { + "identity": { + "name": "TableDnomaid", + "version": "1.0", + "displayname": "Table Dnomaid", + "icon": "./assets/TableDnomaid.ico", + "type": "guid://9DE938AC-F10E-4DED-B46D-5B3B0618B180", + "start": "./control/index.html" + }, + "environment": { + "prerequisites": { + "renderingspace": { + "defaultwidth": 810, + "defaultheight": 195, + "unit": "px" + } + }, + "extensions": { + "HMI": { + "mandatory": true, + "version": "~1.0.0" + } + } + }, + "metadata": { + "author": "Quimet", + "keywords": [ + "Template", + "Dnomaid" + ], + "homepage": "https://github.com/DnomaidGit", + "company": "Dnomaid" + }, + "contracts": { + "api": { + "methods": { + "DrawTableData": { + "parameters": { + "tableDataString": { + "type": "string" + } + }, + "description": "Table Data String(JSON)" + } + }, + "events": { + "SelectedRow": { + "arguments": { + "RowContent": { + "type": "string" + } + }, + "description": "Selected row" + } + }, + "properties": { + "TableDataString": { + "type": "string", + "default": "[{\"ID\":\"1\",\"Name\":\"Test1\",\"Temperature\":\"1°C\",\"Time\":\"00_00_00 00-00-1999\"},{\"ID\":\"2\",\"Name\":\"Test2\",\"Temperature\":\"2°C\",\"Time\":\"00_00_01 00-00-1999\"}]" + }, + "ColumnStyleString" :{ + "type": "string", + "default": "[{\"title\":\"ID\", \"field\":\"ID\"},{\"title\":\"Name\", \"field\":\"Name\"},{\"title\":\"Temperature\", \"field\":\"Temperature\"},{\"title\":\"Time\", \"field\":\"Time\"}]" + } + } + } + }, + "types": {} + } +} \ No newline at end of file diff --git a/Sources/CustomControls/Table/{9DE938AC-F10E-4DED-B46D-5B3B0618B180}.zip b/Sources/CustomControls/Table/{9DE938AC-F10E-4DED-B46D-5B3B0618B180}.zip new file mode 100644 index 0000000..dfd3512 Binary files /dev/null and b/Sources/CustomControls/Table/{9DE938AC-F10E-4DED-B46D-5B3B0618B180}.zip differ