Skip to content

Commit

Permalink
generalize battery serial interface settings
Browse files Browse the repository at this point in the history
  • Loading branch information
schlimmchen committed Oct 30, 2024
1 parent 484b73a commit 0d64416
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 55 deletions.
8 changes: 4 additions & 4 deletions webapp/src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions webapp/src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 4 additions & 4 deletions webapp/src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
51 changes: 8 additions & 43 deletions webapp/src/views/BatteryAdminView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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' },
],
Expand Down

0 comments on commit 0d64416

Please sign in to comment.