webapp: generalize battery serial interface settings

This commit is contained in:
Bernhard Kirchen 2024-09-13 23:53:40 +02:00 committed by Bernhard Kirchen
parent 7cd1984d60
commit 3b0c83fa25
4 changed files with 20 additions and 55 deletions

View File

@ -718,10 +718,10 @@
"MqttVoltageUnit": "Einheit",
"MqttSocTopic": "Topic für SoC",
"MqttVoltageTopic": "Topic für Spannung",
"JkBmsConfiguration": "JK BMS Einstellungen",
"JkBmsInterface": "Schnittstellentyp",
"JkBmsInterfaceUart": "TTL-UART an der MCU",
"JkBmsInterfaceTransceiver": "RS-485 Transceiver an der MCU",
"SerialSettings": "Einstellungen Serielle Schnittstelle",
"SerialInterfaceType": "Schnittstellentyp",
"SerialInterfaceTypeUart": "TTL-UART an der MCU",
"SerialInterfaceTypeTransceiver": "RS-485 Transceiver an der MCU",
"JbdBmsConfiguration": "JBD BMS Einstellungen",
"PollingInterval": "Abfrageintervall",
"Seconds": "@:base.Seconds",

View File

@ -721,10 +721,10 @@
"MqttVoltageUnit": "Unit",
"MqttSocTopic": "SoC Value Topic",
"MqttVoltageTopic": "Voltage Value Topic",
"JkBmsConfiguration": "JK BMS Settings",
"JkBmsInterface": "Interface Type",
"JkBmsInterfaceUart": "TTL-UART on MCU",
"JkBmsInterfaceTransceiver": "RS-485 Transceiver on MCU",
"SerialSettings": "Serial Settings",
"SerialInterfaceType": "Interface Type",
"SerialInterfaceTypeUart": "TTL-UART on MCU",
"SerialInterfaceTypeTransceiver": "RS-485 Transceiver on MCU",
"JbdBmsConfiguration": "JBD BMS Settings",
"PollingInterval": "Polling Interval",
"Seconds": "@:base.Seconds",

View File

@ -622,10 +622,10 @@
"MqttVoltageUnit": "Unit",
"MqttSocTopic": "SoC Value Topic",
"MqttVoltageTopic": "Voltage Value Topic",
"JkBmsConfiguration": "JK BMS Settings",
"JkBmsInterface": "Interface Type",
"JkBmsInterfaceUart": "TTL-UART on MCU",
"JkBmsInterfaceTransceiver": "RS-485 Transceiver on MCU",
"SerialSettings": "Serial Settings",
"SerialInterfaceType": "Interface Type",
"SerialInterfaceTypeUart": "TTL-UART on MCU",
"SerialInterfaceTypeTransceiver": "RS-485 Transceiver on MCU",
"JbdBmsConfiguration": "JBD BMS Settings",
"PollingInterval": "Polling Interval",
"Seconds": "@:base.Seconds",

View File

@ -37,58 +37,23 @@
</CardElement>
<CardElement
v-if="batteryConfigList.enabled && batteryConfigList.provider == 1"
:text="$t('batteryadmin.JkBmsConfiguration')"
v-if="batteryConfigList.enabled && (batteryConfigList.provider == 1 || batteryConfigList.provider == 6)"
:text="$t('batteryadmin.SerialSettings')"
textVariant="text-bg-primary"
addSpace
>
<div class="row mb-3">
<label class="col-sm-4 col-form-label">
{{ $t('batteryadmin.JkBmsInterface') }}
{{ $t('batteryadmin.SerialInterfaceType') }}
</label>
<div class="col-sm-8">
<select class="form-select" v-model="batteryConfigList.jkbms_interface">
<option
v-for="jkBmsInterface in jkBmsInterfaceTypeList"
:key="jkBmsInterface.key"
:value="jkBmsInterface.key"
v-for="serialInterface in serialBmsInterfaceTypeList"
:key="serialInterface.key"
:value="serialInterface.key"
>
{{ $t(`batteryadmin.JkBmsInterface` + jkBmsInterface.value) }}
</option>
</select>
</div>
</div>
<InputElement
:label="$t('batteryadmin.PollingInterval')"
v-model="batteryConfigList.jkbms_polling_interval"
type="number"
min="2"
max="90"
step="1"
:postfix="$t('batteryadmin.Seconds')"
wide
/>
</CardElement>
<CardElement
v-if="batteryConfigList.enabled && batteryConfigList.provider == 6"
:text="$t('batteryadmin.JbdBmsConfiguration')"
textVariant="text-bg-primary"
addSpace
>
<div class="row mb-3">
<label class="col-sm-4 col-form-label">
{{ $t('batteryadmin.JkBmsInterface') }}
</label>
<div class="col-sm-8">
<select class="form-select" v-model="batteryConfigList.jkbms_interface">
<option
v-for="jkBmsInterface in jkBmsInterfaceTypeList"
:key="jkBmsInterface.key"
:value="jkBmsInterface.key"
>
{{ $t(`batteryadmin.JkBmsInterface` + jkBmsInterface.value) }}
{{ $t(`batteryadmin.SerialInterfaceType` + serialInterface.value) }}
</option>
</select>
</div>
@ -316,7 +281,7 @@ export default defineComponent({
{ key: 5, value: 'SBSCan' },
{ key: 6, value: 'JbdBmsSerial' },
],
jkBmsInterfaceTypeList: [
serialBmsInterfaceTypeList: [
{ key: 0, value: 'Uart' },
{ key: 1, value: 'Transceiver' },
],