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 Sep 13, 2024
1 parent c72e0f3 commit 01c66f9
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 54 deletions.
8 changes: 4 additions & 4 deletions webapp/src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -680,10 +680,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 @@ -683,10 +683,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 @@ -606,10 +606,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
50 changes: 8 additions & 42 deletions webapp/src/views/BatteryAdminView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,57 +34,23 @@
</CardElement>

<CardElement
v-show="batteryConfigList.enabled && batteryConfigList.provider == 1"
:text="$t('batteryadmin.JkBmsConfiguration')"
v-show="batteryConfigList.enabled && (batteryConfigList.provider == 1 || batteryConfigList.provider == 5)"
:text="$t('batteryadmin.SerialSettings')"
textVariant="text-bg-primary"
addSpace
>
<div class="row mb-3">
<label class="col-sm-2 col-form-label">
{{ $t('batteryadmin.JkBmsInterface') }}
{{ $t('batteryadmin.SerialInterfaceType') }}
</label>
<div class="col-sm-10">
<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')"
/>
</CardElement>

<CardElement
v-show="batteryConfigList.enabled && batteryConfigList.provider == 5"
:text="$t('batteryadmin.JbdBmsConfiguration')"
textVariant="text-bg-primary"
addSpace
>
<div class="row mb-3">
<label class="col-sm-2 col-form-label">
{{ $t('batteryadmin.JkBmsInterface') }}
</label>
<div class="col-sm-10">
<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 @@ -264,7 +230,7 @@ export default defineComponent({
{ key: 4, value: 'PytesCan' },
{ key: 5, value: 'JbdBmsSerial' },
],
jkBmsInterfaceTypeList: [
serialBmsInterfaceTypeList: [
{ key: 0, value: 'Uart' },
{ key: 1, value: 'Transceiver' },
],
Expand Down

0 comments on commit 01c66f9

Please sign in to comment.