intermediate: serial defs

This commit is contained in:
andreas 2023-10-09 17:43:07 +02:00
parent 4c2ec46aae
commit 72a9afa27d
3 changed files with 53 additions and 11 deletions

View File

@ -131,16 +131,51 @@ types:
label: 'Serial 1' label: 'Serial 1'
key: serial1 key: serial1
values: values:
- type: frame - key: true
key: true
children: children:
- <<: *gpiopin - type: select
key: RX key: type
target: "define:GWSERIAL_RX" target: "define:GWSERIAL_TYPE"
- <<: *gpiopin label: "Serial Type"
key: TX values:
target: "define:GWSERIAL_TX" - key: uni
value: 1
label: "UNI"
description: "Select direction at Config UI"
children:
- <<: *gpiopin
key: RX
target: "define:GWSERIAL_RX"
- <<: *gpiopin
key: TX
target: "define:GWSERIAL_TX"
- key: bi
value: 2
label: "BiDir"
description: "Input and Output"
children:
- <<: *gpiopin
key: RX
target: "define:GWSERIAL_RX"
- <<: *gpiopin
key: TX
target: "define:GWSERIAL_TX"
- key: rx
value: 3
label: "RX"
description: "Input only"
children:
- <<: *gpiopin
key: RX
target: "define:GWSERIAL_RX"
- key: tx
value: 1
label: "TX"
description: "output only"
children:
- <<: *gpiopin
key: TX
target: "define:GWSERIAL_TX"
resources: resources:
default: &esp32default default: &esp32default
serial: 2 serial: 2

View File

@ -141,8 +141,8 @@
margin-top: 0.3em; margin-top: 0.3em;
} }
.configui .tcheckbox .inputFrame, .configui .tcheckbox>.inputFrame,
.configui .tdropdown .inputFrame { .configui .tdropdown>.inputFrame {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;

View File

@ -303,6 +303,13 @@ class PipelineInfo{
initialConfig=config; initialConfig=config;
} }
let expandedValues=expandList(config.values,config); let expandedValues=expandList(config.values,config);
expandedValues.forEach((v)=>{
if (v.type !== undefined && v.type !== "frame"){
let err="value element with wrong type "+v.type+" at "+name;
alert(err);
throw new Error(err);
}
})
if (config.type === 'select') { if (config.type === 'select') {
for (let idx=0;idx<expandedValues.length;idx++){ for (let idx=0;idx<expandedValues.length;idx++){
let v=expandedValues[idx]; let v=expandedValues[idx];