Skip to content

Commit

Permalink
First version of config by udsDevices.json
Browse files Browse the repository at this point in the history
  • Loading branch information
MyHomeMyData committed Dec 5, 2023
1 parent fe29d88 commit d205a26
Show file tree
Hide file tree
Showing 6 changed files with 256 additions and 217 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ admin/i18n/*/flat.txt

# helper files
admin/jsonConfigDemo.json5
admin/jsonConfig.testTab.json
README.org.md
190 changes: 43 additions & 147 deletions admin/jsonConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,73 +2,6 @@
"i18n": false,
"type": "tabs",
"items": {
"test_tab": {
"type": "panel",
"label": "TEST",
"items": {
"test_header": {
"type": "header",
"text": "Test-Tab",
"size": 2,
"newLine": false
},
"configTxt1": {
"type": "staticText",
"text": "globalData: ${globalData.test}",
"newLine": true
},
"configTxt2": {
"type": "staticText",
"text": "data: ${data.test}",
"newLine": false
},
"SendTo1Txt": {
"type": "staticText",
"text": "sendTo send 2 text filed contents to adapter. Result is filled into third field.",
"newLine": true
},
"sendTo1a": {
"type": "text",
"label": "Text 1",
"default": "Text #1",
"newLine": true
},
"sendTo1b": {
"type": "text",
"label": "Text 2",
"default": "Text #2"
},
"sendTo1": {
"type": "sendTo",
"label": "send It",
"variant": "outlined",
"showProcess": true,
"command": "sendTo1",
"jsonData": "{ \"data1\": \"${data.sendTo1a}\", \"data2\": \"${data.sendTo1b}\" }",
"useNative": true
},
"sendTo1Ret": {
"type": "text",
"label": "Result",
"readOnly": true,
"sm":4,
"md":4,
"lg":4,
"xs":4,
"newLine": true
},
"sendToMyDevices": {
"type": "text",
"label": "No MyDevices Info received",
"readOnly": true,
"sm":4,
"md":4,
"lg":4,
"xs":4,
"newLine": true
}
}
},
"can_adapter": {
"type": "panel",
"label": "CAN Adapter",
Expand Down Expand Up @@ -129,23 +62,23 @@
"type": "staticText",
"text": "WARNING: Values below 2 seconds may cause heavy system load!",
"newLine": true,
"hidden": "if (data.can_adapter_ext.e380_delay < 2) { return false; }; return true;",
"hidden": "if (data.e380_delay < 2) { return false; }; return true;",
"style": {
"color": "red"
}
},
"e380_name": {
"type": "text",
"label": "Name",
"tooltip": "This text will be used as base for object tree",
"default" : "e380",
"newLine": true
},
"e380_active": {
"type": "checkbox",
"label": "active",
"tooltip": "Activate communication",
"default" : false,
"newLine": true
},
"e380_name": {
"type": "text",
"label": "Name",
"tooltip": "This text will be used as base for object tree",
"default" : "e380",
"newLine": false
},
"e380_delay": {
Expand Down Expand Up @@ -207,6 +140,16 @@
"label": "",
"showSecondAddAt": 5,
"items": [
{
"type": "checkbox",
"attr": "collect_active",
"width": "5% ",
"title": "active",
"tooltip": "Activate communication",
"filter": false,
"sort": false,
"default": false
},
{
"type": "text",
"attr": "collect_dev_name",
Expand All @@ -219,16 +162,6 @@
"validator": "const x={};for (const c of globalData.table_collect_ext) {if (x[c.collect_dev_name]==='x') return false; x[c.collect_dev_name]='x';}; return true;",
"validatorNoSaveOnError": true
},
{
"type": "checkbox",
"attr": "collect_active",
"width": "5% ",
"title": "active",
"tooltip": "Activate communication",
"filter": false,
"sort": false,
"default": false
},
{
"type": "number",
"attr": "collect_delay_time",
Expand Down Expand Up @@ -266,16 +199,6 @@
"text": "Actively request wead- and write-operations to specified data identifiers",
"newLine": true
},
"tableUdsErrDevAddr": {
"type": "staticText",
"text": "ERROR: column 'Device Address' must follow hex pattern e.g. '0x451'",
"newLine": true,
"hidden": "if (!data.table_uds) return true; for (const c of data.table_uds) {if ((String([c.uds_dev_addr]) != String(c.uds_dev_addr.match(/0[xX][0-9a-fA-F]+/)))) return false;}; return true;",
"style": {
"color": "red"
}
},

"table_uds": {
"type": "table",
"newLine": true,
Expand All @@ -285,28 +208,6 @@
"label": "",
"showSecondAddAt": 5,
"items": [
{
"type": "number",
"attr": "uds_schedule",
"width": "10% ",
"title": "Schedule (s)",
"tooltip": "Schedule for requesting given DIDs",
"filter": false,
"sort": false,
"min": 0,
"step": 1,
"default": 15
},
{
"type": "text",
"attr": "uds_dev_name",
"width": "15% ",
"title": "Name of Device",
"tooltip": "This text will be used as base for object tree",
"filter": false,
"sort": false,
"default": "vitocal"
},
{
"type": "checkbox",
"attr": "uds_active",
Expand All @@ -318,36 +219,31 @@
"default": false
},
{
"type": "text",
"attr": "uds_dev_addr",
"type": "number",
"attr": "uds_schedule",
"width": "10% ",
"title": "Device Address",
"tooltip": "Device Address to send requests to.",
"title": "Schedule (s)",
"tooltip": "Schedule for requesting given DIDs",
"filter": false,
"sort": false,
"default": "0x680",
"validator": "return data.uds_dev_addr.match(/0[xX][0-9a-fA-F]+/);",
"validatorNoSaveOnError": true
"min": 0,
"step": 1,
"default": 15
},
{
"type": "select",
"attr": "uds_select_dev",
"width": "20% ",
{ "type": "selectSendTo",
"title": "Select device",
"options": [{"items": "${JSON.stringify(globalData.uds_devices)}"}],
"default": 0,
"command": "getDeviceSelectSendTo",
"attr": "uds_select_dev",
"jsonData": "{${JSON.stringify(data.uds_select_dev)}}",
"width": "15%",
"default": "Select device",
"alsoDependsOn": ["uds_schedule"],
"newLine": false
},
{
"type": "staticText",
"title": "Select device",
"width": "20% ",
"text": "${globalData.test}"
},
{
"type": "text",
"attr": "uds_dids",
"width": "20% ",
"width": "30% ",
"title": "List of DIDs",
"tooltip": "Separate by comma! All given DIDs will be requested with specified schedule an ECU address.",
"filter": false,
Expand Down Expand Up @@ -413,6 +309,16 @@
"label": "",
"showSecondAddAt": 5,
"items": [
{
"type": "checkbox",
"attr": "collect_active",
"width": "5% ",
"title": "active",
"tooltip": "Activate communication",
"filter": false,
"sort": false,
"default": false
},
{
"type": "text",
"attr": "collect_dev_name",
Expand All @@ -425,16 +331,6 @@
"validator": "const x={};for (const c of globalData.table_collect_int) {if (x[c.collect_dev_name]==='x') return false; x[c.collect_dev_name]='x';}; return true;",
"validatorNoSaveOnError": true
},
{
"type": "checkbox",
"attr": "collect_active",
"width": "5% ",
"title": "active",
"tooltip": "Activate communication",
"filter": false,
"sort": false,
"default": false
},
{
"type": "number",
"attr": "collect_delay_time",
Expand Down
37 changes: 37 additions & 0 deletions admin/udsDevices.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"0x680": {
"tx": "0x680",
"dpList": "Open3Edatapoints_680.py",
"prop": "HPMUMASTER"
},
"0x684": {
"tx": "0x684",
"dpList": "Open3Edatapoints_684.py",
"prop": "HMI"
},
"0x68c": {
"tx": "0x68c",
"dpList": "Open3Edatapoints_68c.py",
"prop": "VCMU"
},
"0x6a1": {
"tx": "0x6a1",
"dpList": "Open3Edatapoints_6a1.py",
"prop": "EMCUMASTER"
},
"0x6c3": {
"tx": "0x6c3",
"dpList": "Open3Edatapoints_6c3.py",
"prop": "BACKENDGATEWAY"
},
"0x6c5": {
"tx": "0x6c5",
"dpList": "Open3Edatapoints_6c5.py",
"prop": "BACKENDGATEWAY"
},
"0x6cf": {
"tx": "0x6cf",
"dpList": "Open3Edatapoints_6cf.py",
"prop": "EHCU"
}
}
24 changes: 23 additions & 1 deletion io-package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,10 @@
"main": "main.js",
"icon": "e3oncan.png",
"enabled": true,
"messagebox": true,
"extIcon": "https://raw.githubusercontent.com/MyHomeMyData/ioBroker.e3oncan/main/admin/e3oncan.png",
"readme": "https://github.com/MyHomeMyData/ioBroker.e3oncan/blob/main/README.md",
"loglevel": "info",
"loglevel": "debug",
"mode": "daemon",
"type": "iot-systems",
"compact": true,
Expand Down Expand Up @@ -106,6 +107,27 @@
"def": false
},
"native": {}
},
{
"_id": "uds",
"type": "folder",
"common": {
"name": "Data for UDSonCAN communication"
},
"native": {}
},
{
"_id": "uds.devices",
"type": "state",
"common": {
"role": "state",
"name": "List of devices addressable via UDSonCAN",
"type": "json",
"read": true,
"write": false,
"def": false
},
"native": {}
}
]
}
Loading

0 comments on commit d205a26

Please sign in to comment.