|
1 | | -# CWC-Table |
2 | | -A table view for as custom web control for WinCC Unified |
| 1 | +<h1 align="center" style="margin-top: 0px;">Table CWC made for WinCC Unified</h1> |
| 2 | + |
| 3 | +<p align="center" style="margin-bottom: 0px !important;"> |
| 4 | + <img width="200" src="docs/icon.png" alt="Icon" align="center"> |
| 5 | +</p> |
| 6 | + |
| 7 | + |
| 8 | +### **1. CONTENT** |
| 9 | + |
| 10 | +HTML table |
| 11 | + |
| 12 | +### **2. INTERFACE** |
| 13 | + |
| 14 | + - **columns** : Array of element for the columns title |
| 15 | + |
| 16 | + ```js |
| 17 | + // Example |
| 18 | + columns: ["Parameter", "Read", "Value"] |
| 19 | + ``` |
| 20 | + |
| 21 | + - **columnsEdit** : Array of bool Flag to enable or diable (False / True) the text input area on a colum |
| 22 | + |
| 23 | + ```js |
| 24 | + // Example |
| 25 | + columnsEdit: [false, false, true] |
| 26 | + ``` |
| 27 | + |
| 28 | + - **columnsShow** : Array of bool Flag to hide or dhow (False / True) a colum |
| 29 | + |
| 30 | + ```js |
| 31 | + // Example |
| 32 | + columnsShow: [true, true, true] |
| 33 | + ``` |
| 34 | + |
| 35 | + - **pageLength** : Number of rows to be shown in one tab (i.e. 18). |
| 36 | + |
| 37 | + - **rows** : Array of element to fill the table rows |
| 38 | + |
| 39 | + ```js |
| 40 | + // Example |
| 41 | + rows: [["param01", "read1", "value1"], ["param02", "read2", "value2"], ["param03", "read3", "value3"]], |
| 42 | + ``` |
| 43 | + |
| 44 | + - **searching** : Flag to disable or anable (False / True) the search filed on top of the tabale (i.e. false) |
| 45 | + |
| 46 | + - **select** : Flag to diable or enable (False / True) the selcion of the rows (i.e. true) |
| 47 | + |
| 48 | +### **3. EVENTS** |
| 49 | + |
| 50 | + - **ev_selectRow** : This event is triggerd every time an user select or deselect a row, as a result if a row is selected in the "rowId" object is returned the content of the row with this structure: |
| 51 | + - rowId = Row first column value |
| 52 | + - rowVals = Array of values of all columns in the row |
| 53 | + - The column value is returned also if that colum is not visible |
| 54 | + |
| 55 | + ```json |
| 56 | + // Example |
| 57 | + {"rowId":"param01","rowVals":["param01","read1","value1"]} |
| 58 | + ``` |
| 59 | + |
| 60 | + - **ev_updateRows** : This event is triggerd every time an user update a row value by the text input area, as a result in the "rows" object is returned the updated content of the all the rows |
| 61 | + |
| 62 | + ```json |
| 63 | + // Example |
| 64 | + [["param01", "read1", "value1"], ["param02", "read2", "value2"], ["param03", "read3", "value3"]] |
| 65 | + ``` |
| 66 | + |
| 67 | + - **ev_updateRow** : This event is triggerd every time an user update a row value by the text input area, as a result in the "rows" object is returned the updated content of the all the updated row |
| 68 | + |
| 69 | + ```json |
| 70 | + // Example |
| 71 | + ["param01", "read1", "value1"] |
| 72 | + ``` |
| 73 | + |
| 74 | +### **4. USAGE** |
| 75 | + |
| 76 | + - OFFLINE MODE |
| 77 | + - You can test the behavior of the table with custom data by setting "production" to false |
| 78 | + - Now you can change all the data from "WebCC.Properties" |
| 79 | + |
| 80 | + ```js |
| 81 | + var production = false; |
| 82 | + //... |
| 83 | + WebCC.Properties = { |
| 84 | + select: true, |
| 85 | + searching: false, |
| 86 | + columns: ["Parameter", "Read", "Value"], |
| 87 | + columnsEdit: [false, false, true], |
| 88 | + columnsShow: [true, true, true], |
| 89 | + rows: [["param01", "read1", "value1"], |
| 90 | + ["param02", "read2", "value2"], |
| 91 | + ["param03", "read3", "value3"] |
| 92 | + ], |
| 93 | + pageLength: 18 |
| 94 | + }; |
| 95 | + ``` |
| 96 | + |
| 97 | + - ONLINE MODE (WinCC Unfied) |
| 98 | + - Set "production" to true |
| 99 | + ```js |
| 100 | + var production = true; |
| 101 | + ``` |
| 102 | + - To import the custom web control the hierarchy of folders and files must be compressed in ZIP format. |
| 103 | + - The name of the ZIP must be the GUID used the "manifest.json" file surrounded by curly brackets |
| 104 | + |
| 105 | + ```json |
| 106 | + type": "guid://2823CFDE-FEE3-4B14-A792-96E2201EEAB8", |
| 107 | + ``` |
| 108 | + - {2823CFDE-FEE3-4B14-A792-96E2201EEAB8}.zip |
| 109 | + - If you want this custom web control available for all your project, copy this file in the folder : |
| 110 | + - C:\Program Files\Siemens\Automation\Portal V17\Data\Hmi\CustomControls |
| 111 | + - replace "Porla V17" with your Tia version. |
| 112 | + - If you want to use this custom web control only in one project copy this file in the folder : |
| 113 | + |
| 114 | + - \path_to_tia_project\UserFiles |
| 115 | + |
| 116 | + |
| 117 | + - Refresh "My controls" to update the files in TIA Portal |
| 118 | + - Now you can place the custom web control in the Screen. |
| 119 | + |
| 120 | + <p align="center" style="margin-bottom: 0px !important;"> |
| 121 | + <img width="700" src="docs/Table_offline.PNG" alt="Table" align="center"> |
| 122 | + </p> |
| 123 | + |
0 commit comments