diff --git a/recipes-app/iot2050-conf-webui/files/src/components/ConfigEntry/CheckConfig.js b/recipes-app/iot2050-conf-webui/files/src/components/ConfigEntry/CheckConfig.js
new file mode 100644
index 000000000..902fcef76
--- /dev/null
+++ b/recipes-app/iot2050-conf-webui/files/src/components/ConfigEntry/CheckConfig.js
@@ -0,0 +1,38 @@
+/* eslint-disable react/prop-types */
+import * as React from 'react';
+import Checkbox from '@mui/material/Checkbox';
+import FormControlLabel from '@mui/material/FormControlLabel';
+
+const doNothing = (id) => {};
+
+export default function CheckConfig ({ id, data, updateConfig, disabled = false, postChange = doNothing }) {
+ const setNewValue = (newValue) => {
+ data.value = newValue;
+ postChange(id);
+ updateConfig();
+ };
+
+ const onChange = (event) => {
+ setNewValue(event.target.checked);
+ };
+
+ /* When disabled, the value should be setting to false */
+ React.useEffect(() => {
+ if (disabled) {
+ setNewValue(false);
+ }
+ }, [disabled]);
+
+ return (
+ }
+ />
+ );
+}
diff --git a/recipes-app/iot2050-conf-webui/files/src/components/ConfigEntry/ConfigGroupLabel.js b/recipes-app/iot2050-conf-webui/files/src/components/ConfigEntry/ConfigGroupLabel.js
new file mode 100644
index 000000000..793c5fd04
--- /dev/null
+++ b/recipes-app/iot2050-conf-webui/files/src/components/ConfigEntry/ConfigGroupLabel.js
@@ -0,0 +1,17 @@
+/* eslint-disable react/prop-types */
+import * as React from 'react';
+import FormLabel from '@mui/material/FormLabel';
+import Typography from '@mui/material/Typography';
+
+export default function ConfigGroupLabel ({ label }) {
+ return (
+
+
+ {label}
+
+
+ );
+}
diff --git a/recipes-app/iot2050-conf-webui/files/src/components/ExtendedModules/SM1231_RTD/SM1231_4RTDConf.js b/recipes-app/iot2050-conf-webui/files/src/components/ExtendedModules/SM1231_RTD/SM1231_4RTDConf.js
new file mode 100644
index 000000000..0c25bfce5
--- /dev/null
+++ b/recipes-app/iot2050-conf-webui/files/src/components/ExtendedModules/SM1231_RTD/SM1231_4RTDConf.js
@@ -0,0 +1,41 @@
+/* eslint-disable camelcase */
+/* eslint-disable react/prop-types */
+import * as React from 'react';
+import SM1231_RTDConf, { channelConfigDefault } from './SM1231_RTDConf';
+import uiString from '@/lib/uiString/SM1231_RTD.json';
+
+export const SM1231_4RTDConfDefault = {
+ mlfb: '6ES7231-5PD32-0XB0',
+ power_alarm: {
+ label: uiString.LABEL_POWER_ALARM,
+ value: true,
+ disabled: false
+ },
+ integ_time: {
+ label: uiString.LABEL_INT_TIME,
+ selection: [
+ uiString.INT_TIME_0,
+ uiString.INT_TIME_1,
+ uiString.INT_TIME_2,
+ uiString.INT_TIME_3
+ ],
+ value: uiString.INT_TIME_2
+ },
+ channels: [
+ JSON.parse(JSON.stringify(channelConfigDefault)),
+ JSON.parse(JSON.stringify(channelConfigDefault)),
+ JSON.parse(JSON.stringify(channelConfigDefault)),
+ JSON.parse(JSON.stringify(channelConfigDefault))
+ ]
+};
+
+export default function SM1231_4RTDConf ({ slotNum, configData, updateConfig }) {
+ return (
+
+ );
+}
diff --git a/recipes-app/iot2050-conf-webui/files/src/components/ExtendedModules/SM1231_RTD/SM1231_8RTDConf.js b/recipes-app/iot2050-conf-webui/files/src/components/ExtendedModules/SM1231_RTD/SM1231_8RTDConf.js
new file mode 100644
index 000000000..bf1f4aa7b
--- /dev/null
+++ b/recipes-app/iot2050-conf-webui/files/src/components/ExtendedModules/SM1231_RTD/SM1231_8RTDConf.js
@@ -0,0 +1,45 @@
+/* eslint-disable camelcase */
+/* eslint-disable react/prop-types */
+import * as React from 'react';
+import SM1231_RTDConf, { channelConfigDefault } from './SM1231_RTDConf';
+import uiString from '@/lib/uiString/SM1231_RTD.json';
+
+export const SM1231_8RTDConfDefault = {
+ mlfb: '6ES7231-5PF32-0XB0',
+ power_alarm: {
+ label: uiString.LABEL_POWER_ALARM,
+ value: true,
+ disabled: false
+ },
+ integ_time: {
+ label: uiString.LABEL_INT_TIME,
+ selection: [
+ uiString.INT_TIME_0,
+ uiString.INT_TIME_1,
+ uiString.INT_TIME_2,
+ uiString.INT_TIME_3
+ ],
+ value: uiString.INT_TIME_2
+ },
+ channels: [
+ JSON.parse(JSON.stringify(channelConfigDefault)),
+ JSON.parse(JSON.stringify(channelConfigDefault)),
+ JSON.parse(JSON.stringify(channelConfigDefault)),
+ JSON.parse(JSON.stringify(channelConfigDefault)),
+ JSON.parse(JSON.stringify(channelConfigDefault)),
+ JSON.parse(JSON.stringify(channelConfigDefault)),
+ JSON.parse(JSON.stringify(channelConfigDefault)),
+ JSON.parse(JSON.stringify(channelConfigDefault))
+ ]
+};
+
+export default function SM1231_8RTDConf ({ slotNum, configData, updateConfig }) {
+ return (
+
+ );
+}
diff --git a/recipes-app/iot2050-conf-webui/files/src/components/ExtendedModules/SM1231_RTD/SM1231_RTDConf.js b/recipes-app/iot2050-conf-webui/files/src/components/ExtendedModules/SM1231_RTD/SM1231_RTDConf.js
new file mode 100644
index 000000000..c9daa689c
--- /dev/null
+++ b/recipes-app/iot2050-conf-webui/files/src/components/ExtendedModules/SM1231_RTD/SM1231_RTDConf.js
@@ -0,0 +1,587 @@
+/* eslint-disable camelcase */
+/* eslint-disable lines-between-class-members */
+/* eslint-disable react/prop-types */
+import * as React from 'react';
+import Stack from '@mui/material/Stack';
+import FormControl from '@mui/material/FormControl';
+import FormGroup from '@mui/material/FormGroup';
+import Paper from '@mui/material/Paper';
+import ModuleInfo from '@/components/ModuleInfo';
+import SelectionConfig from '@/components/ConfigEntry/SelectionConfig';
+import CheckConfig from '@/components/ConfigEntry/CheckConfig';
+import ConfigGroupLabel from '@/components/ConfigEntry/ConfigGroupLabel';
+import ConfTextConverter from '@/lib/smConfig/ConfTextConverter';
+import uiString from '@/lib/uiString/SM1231_RTD.json';
+import { range } from 'lodash';
+
+const yamlUIMapping = [
+ {
+ keys: [/ch[0-7]\.type/],
+ rules: [
+ {
+ scenario: 'all',
+ mapping: [
+ { ui: uiString.TYPE_0, yaml: 0 },
+ { ui: uiString.TYPE_4, yaml: 4 },
+ { ui: uiString.TYPE_5, yaml: 5 },
+ { ui: uiString.TYPE_6, yaml: 6 },
+ { ui: uiString.TYPE_7, yaml: 7 },
+ { ui: uiString.TYPE_8, yaml: 8 },
+ { ui: uiString.TYPE_9, yaml: 9 }
+ ]
+ }
+ ]
+ },
+ {
+ keys: [/ch[0-7]\.range/],
+ rules: [
+ {
+ scenario: 'resistance',
+ mapping: [
+ { ui: uiString.Resistance_RANGE_1, yaml: 1 },
+ { ui: uiString.Resistance_RANGE_2, yaml: 2 },
+ { ui: uiString.Resistance_RANGE_3, yaml: 3 }
+ ]
+ },
+ {
+ scenario: 'thermal',
+ mapping: [
+ { ui: uiString.Thermal_RANGE_0, yaml: 0 },
+ { ui: uiString.Thermal_RANGE_2, yaml: 2 },
+ { ui: uiString.Thermal_RANGE_3, yaml: 3 },
+ { ui: uiString.Thermal_RANGE_4, yaml: 4 },
+ { ui: uiString.Thermal_RANGE_5, yaml: 5 },
+ { ui: uiString.Thermal_RANGE_6, yaml: 6 },
+ { ui: uiString.Thermal_RANGE_11, yaml: 11 },
+ { ui: uiString.Thermal_RANGE_12, yaml: 12 },
+ { ui: uiString.Thermal_RANGE_15, yaml: 15 },
+ { ui: uiString.Thermal_RANGE_16, yaml: 16 },
+ { ui: uiString.Thermal_RANGE_18, yaml: 18 },
+ { ui: uiString.Thermal_RANGE_20, yaml: 20 },
+ { ui: uiString.Thermal_RANGE_22, yaml: 22 },
+ { ui: uiString.Thermal_RANGE_24, yaml: 24 },
+ { ui: uiString.Thermal_RANGE_26, yaml: 26 },
+ { ui: uiString.Thermal_RANGE_28, yaml: 28 }
+ ]
+ },
+ {
+ scenario: 'deactivated',
+ mapping: [
+ { ui: uiString.Resistance_RANGE_1, yaml: 1 },
+ { ui: uiString.Resistance_RANGE_2, yaml: 2 },
+ { ui: uiString.Resistance_RANGE_3, yaml: 3 },
+ { ui: uiString.Thermal_RANGE_0, yaml: 0 },
+ { ui: uiString.Thermal_RANGE_2, yaml: 2 },
+ { ui: uiString.Thermal_RANGE_3, yaml: 3 },
+ { ui: uiString.Thermal_RANGE_4, yaml: 4 },
+ { ui: uiString.Thermal_RANGE_5, yaml: 5 },
+ { ui: uiString.Thermal_RANGE_6, yaml: 6 },
+ { ui: uiString.Thermal_RANGE_11, yaml: 11 },
+ { ui: uiString.Thermal_RANGE_12, yaml: 12 },
+ { ui: uiString.Thermal_RANGE_15, yaml: 15 },
+ { ui: uiString.Thermal_RANGE_16, yaml: 16 },
+ { ui: uiString.Thermal_RANGE_18, yaml: 18 },
+ { ui: uiString.Thermal_RANGE_20, yaml: 20 },
+ { ui: uiString.Thermal_RANGE_22, yaml: 22 },
+ { ui: uiString.Thermal_RANGE_24, yaml: 24 },
+ { ui: uiString.Thermal_RANGE_26, yaml: 26 },
+ { ui: uiString.Thermal_RANGE_28, yaml: 28 }
+ ]
+ }
+ ]
+ },
+ {
+ keys: [/integ_time/],
+ rules: [
+ {
+ scenario: 'all',
+ mapping: [
+ { ui: uiString.INT_TIME_0, yaml: 0 },
+ { ui: uiString.INT_TIME_1, yaml: 1 },
+ { ui: uiString.INT_TIME_2, yaml: 2 },
+ { ui: uiString.INT_TIME_3, yaml: 3 }
+ ]
+ }
+ ]
+ },
+ {
+ keys: [/ch[0-7]\.smooth/],
+ rules: [
+ {
+ scenario: 'all',
+ mapping: [
+ { ui: uiString.SMOOTH_0, yaml: 0 },
+ { ui: uiString.SMOOTH_1, yaml: 1 },
+ { ui: uiString.SMOOTH_2, yaml: 2 },
+ { ui: uiString.SMOOTH_3, yaml: 3 }
+ ]
+ }
+ ]
+ },
+ {
+ keys: [/ch[0-7]\.temper_coeff/],
+ rules: [
+ {
+ scenario: 'all',
+ mapping: [
+ { ui: uiString.TEMP_COEFF_0, yaml: 0 },
+ { ui: uiString.TEMP_COEFF_1, yaml: 1 },
+ { ui: uiString.TEMP_COEFF_2, yaml: 2 },
+ { ui: uiString.TEMP_COEFF_3, yaml: 3 },
+ { ui: uiString.TEMP_COEFF_5, yaml: 5 },
+ { ui: uiString.TEMP_COEFF_7, yaml: 7 },
+ { ui: uiString.TEMP_COEFF_8, yaml: 8 },
+ { ui: uiString.TEMP_COEFF_9, yaml: 9 },
+ { ui: uiString.TEMP_COEFF_10, yaml: 10 },
+ { ui: uiString.TEMP_COEFF_11, yaml: 11 },
+ { ui: uiString.TEMP_COEFF_12, yaml: 12 },
+ { ui: uiString.TEMP_COEFF_13, yaml: 13 }
+ ]
+ }
+ ]
+ },
+ {
+ keys: [/ch[0-7]\.temper_unit/],
+ rules: [
+ {
+ scenario: 'all',
+ mapping: [
+ { ui: uiString.TEMP_UNIT_0, yaml: 0 },
+ { ui: uiString.TEMP_UNIT_1, yaml: 1 }
+ ]
+ }
+ ]
+ }
+];
+
+const converter = new ConfTextConverter(yamlUIMapping);
+
+const typeSelectionOfResistance = [
+ uiString.TYPE_4,
+ uiString.TYPE_5,
+ uiString.TYPE_6
+];
+const typeSelectionOfThermal = [
+ uiString.TYPE_7,
+ uiString.TYPE_8,
+ uiString.TYPE_9
+];
+
+const rangeSelectionOfResistance = [
+ uiString.Resistance_RANGE_1,
+ uiString.Resistance_RANGE_2,
+ uiString.Resistance_RANGE_3
+];
+
+const rangeSelectionOfThermal = [
+ uiString.Thermal_RANGE_0,
+ uiString.Thermal_RANGE_2,
+ uiString.Thermal_RANGE_3,
+ uiString.Thermal_RANGE_4,
+ uiString.Thermal_RANGE_5,
+ uiString.Thermal_RANGE_6,
+ uiString.Thermal_RANGE_11,
+ uiString.Thermal_RANGE_12,
+ uiString.Thermal_RANGE_15,
+ uiString.Thermal_RANGE_16,
+ uiString.Thermal_RANGE_18,
+ uiString.Thermal_RANGE_20,
+ uiString.Thermal_RANGE_22,
+ uiString.Thermal_RANGE_24,
+ uiString.Thermal_RANGE_26,
+ uiString.Thermal_RANGE_28
+];
+
+function decideTempCoeffSelection (range) {
+ let selection;
+ let defaultValue;
+
+ switch (range) {
+ case uiString.Thermal_RANGE_0:
+ selection = [uiString.TEMP_COEFF_0];
+ defaultValue = uiString.TEMP_COEFF_0;
+ break;
+ case uiString.Thermal_RANGE_2:
+ case uiString.Thermal_RANGE_4:
+ selection = [
+ uiString.TEMP_COEFF_0,
+ uiString.TEMP_COEFF_1,
+ uiString.TEMP_COEFF_2,
+ uiString.TEMP_COEFF_3,
+ uiString.TEMP_COEFF_5
+ ];
+ defaultValue = uiString.TEMP_COEFF_0;
+ break;
+ case uiString.Thermal_RANGE_3:
+ selection = [
+ uiString.TEMP_COEFF_7,
+ uiString.TEMP_COEFF_8,
+ uiString.TEMP_COEFF_9
+ ];
+ defaultValue = uiString.TEMP_COEFF_9;
+ break;
+ case uiString.Thermal_RANGE_5:
+ case uiString.Thermal_RANGE_11:
+ selection = [
+ uiString.TEMP_COEFF_0,
+ uiString.TEMP_COEFF_1,
+ uiString.TEMP_COEFF_2,
+ uiString.TEMP_COEFF_3
+ ];
+ defaultValue = uiString.TEMP_COEFF_0;
+ break;
+ case uiString.Thermal_RANGE_6:
+ case uiString.Thermal_RANGE_12:
+ case uiString.Thermal_RANGE_16:
+ case uiString.Thermal_RANGE_18:
+ selection = [
+ uiString.TEMP_COEFF_8,
+ uiString.TEMP_COEFF_9
+ ];
+ defaultValue = uiString.TEMP_COEFF_9;
+ break;
+ case uiString.Thermal_RANGE_15:
+ selection = [
+ uiString.TEMP_COEFF_11,
+ uiString.TEMP_COEFF_12,
+ uiString.TEMP_COEFF_13
+ ];
+ defaultValue = uiString.TEMP_COEFF_12;
+ break;
+ case uiString.Thermal_RANGE_20:
+ case uiString.Thermal_RANGE_22:
+ selection = [
+ uiString.TEMP_COEFF_0,
+ uiString.TEMP_COEFF_5
+ ];
+ defaultValue = uiString.TEMP_COEFF_5;
+ break;
+ case uiString.Thermal_RANGE_24:
+ case uiString.Thermal_RANGE_26:
+ selection = [
+ uiString.TEMP_COEFF_11,
+ uiString.TEMP_COEFF_13
+ ];
+ defaultValue = uiString.TEMP_COEFF_11;
+ break;
+
+ case uiString.Thermal_RANGE_28:
+ selection = [uiString.TEMP_COEFF_10];
+ defaultValue = uiString.TEMP_COEFF_10;
+ break;
+ }
+
+ return { selection, defaultValue };
+}
+
+export const channelConfigDefault = {
+ type: {
+ label: uiString.LABEL_TYPE,
+ selection: [
+ uiString.TYPE_0,
+ ...typeSelectionOfResistance,
+ ...typeSelectionOfThermal
+ ],
+ value: uiString.TYPE_7
+ },
+ range: {
+ label: uiString.LABEL_RANGE_THERMAL,
+ selection: rangeSelectionOfThermal,
+ value: uiString.Thermal_RANGE_0
+ },
+ temper_coeff: {
+ label: uiString.LABEL_TEMP_COEFF,
+ selection: [uiString.TEMP_COEFF_0],
+ value: uiString.TEMP_COEFF_0
+ },
+ temper_unit: {
+ label: uiString.LABEL_TEMP_UNIT,
+ selection: [
+ uiString.TEMP_UNIT_0,
+ uiString.TEMP_UNIT_1
+ ],
+ value: uiString.TEMP_UNIT_0
+ },
+ smooth: {
+ label: uiString.LABEL_SMOOTH,
+ selection: [
+ uiString.SMOOTH_0,
+ uiString.SMOOTH_1,
+ uiString.SMOOTH_2,
+ uiString.SMOOTH_3
+ ],
+ value: uiString.SMOOTH_1
+ },
+ overflow_alarm: {
+ label: uiString.LABEL_OVER_FLOW_ALARM,
+ value: true
+ },
+ underflow_alarm: {
+ label: uiString.LABEL_UNDER_FLOW_ALARM,
+ value: true
+ },
+ open_wire_alarm: {
+ label: uiString.LABEL_OPEN_WIRE_ALARM,
+ value: true
+ }
+};
+
+export function convertToUIFormat (config) {
+ const ret = {
+ mlfb: config.mlfb,
+ power_alarm: {
+ label: uiString.LABEL_POWER_ALARM,
+ value: config.power_alarm
+ },
+ integ_time: {
+ label: uiString.LABEL_INT_TIME,
+ selection: [
+ uiString.INT_TIME_0,
+ uiString.INT_TIME_1,
+ uiString.INT_TIME_2,
+ uiString.INT_TIME_3
+ ],
+ value: converter.yamlToUi('integ_time', config.integ_time)
+ },
+ channels: []
+ };
+
+ const channelNums = config.mlfb === '6ES7231-5PD32-0XB0' ? 4 : 8;
+
+ for (let i = 0; i < channelNums; i++) {
+ let rangeScenario = 'thermal';
+ if ([4, 5, 6].includes(config[`ch${i}`].type)) {
+ rangeScenario = 'resistance';
+ } else if (config[`ch${i}`].type === 0) {
+ rangeScenario = 'deactivated';
+ }
+ const chConfig = JSON.parse(JSON.stringify(channelConfigDefault));
+ chConfig.type.value = converter.yamlToUi(`ch${i}.type`, config[`ch${i}`].type);
+ chConfig.range.value = converter.yamlToUi(`ch${i}.range`, config[`ch${i}`].range, rangeScenario);
+ chConfig.temper_coeff.value = converter.yamlToUi(`ch${i}.temper_coeff`, config[`ch${i}`].temper_coeff);
+ chConfig.temper_unit.value = converter.yamlToUi(`ch${i}.temper_unit`, config[`ch${i}`].temper_unit);
+ chConfig.smooth.value = converter.yamlToUi(`ch${i}.smooth`, config[`ch${i}`].smooth);
+ chConfig.overflow_alarm.value = config[`ch${i}`].overflow_alarm;
+ chConfig.underflow_alarm.value = config[`ch${i}`].underflow_alarm;
+ chConfig.open_wire_alarm.value = config[`ch${i}`].open_wire_alarm;
+
+ if (typeSelectionOfResistance.includes(chConfig.type.value)) {
+ chConfig.range.label = uiString.LABEL_RANGE_RESISTOR;
+ chConfig.range.selection = rangeSelectionOfResistance;
+ } else if (typeSelectionOfThermal.includes(chConfig.type.value)) {
+ chConfig.range.label = uiString.LABEL_RANGE_THERMAL;
+ chConfig.range.selection = rangeSelectionOfThermal;
+ const newSelection = decideTempCoeffSelection(chConfig.range.value);
+ chConfig.temper_coeff.selection = newSelection.selection;
+ } else {
+ /* Do nothing */
+ }
+
+ ret.channels.push(chConfig);
+ }
+
+ return ret;
+};
+
+export function convertToDeviceFormat (config) {
+ const ret = {
+ description: 'TBD',
+ mlfb: config.mlfb,
+ power_alarm: config.power_alarm.value,
+ integ_time: converter.uiToYaml('integ_time', config.integ_time.value)
+ };
+
+ const channelNums = config.mlfb === '6ES7231-5PD32-0XB0' ? 4 : 8;
+
+ if (channelNums === 4) {
+ ret.description = uiString.DESC_MOD_4CH;
+ } else {
+ ret.description = uiString.DESC_MOD_8CH;
+ }
+
+ for (let i = 0; i < channelNums; i++) {
+ let rangeScenario = 'thermal';
+ if ([
+ uiString.TYPE_4,
+ uiString.TYPE_5,
+ uiString.TYPE_6
+ ].includes(config.channels[i].type.value)) {
+ rangeScenario = 'resistance';
+ } else if (config.channels[i].type.value === uiString.TYPE_0) {
+ rangeScenario = 'deactivated';
+ }
+
+ ret['ch' + i] = {
+ type: converter.uiToYaml(`ch${i}.type`, config.channels[i].type.value),
+ range: converter.uiToYaml(`ch${i}.range`, config.channels[i].range.value, rangeScenario),
+ temper_coeff: converter.uiToYaml(`ch${i}.temper_coeff`, config.channels[i].temper_coeff.value),
+ smooth: converter.uiToYaml(`ch${i}.smooth`, config.channels[i].smooth.value),
+ temper_unit: converter.uiToYaml(`ch${i}.temper_unit`, config.channels[i].temper_unit.value),
+ overflow_alarm: config.channels[i].overflow_alarm.value,
+ underflow_alarm: config.channels[i].underflow_alarm.value,
+ open_wire_alarm: config.channels[i].open_wire_alarm.value
+ };
+ }
+
+ return ret;
+};
+
+export default function SM1231_RTDConf ({ slotNum, configData, updateConfig, chTotal }) {
+ const postChangeChannelType = (event) => {
+ updateChannelRange(event);
+ };
+
+ const updateChannelRange = (event) => {
+ const chIndex = parseInt(event.target.name.slice(-1), 10);
+ const newType = configData.channels[chIndex].type.value;
+
+ if (typeSelectionOfResistance.includes(newType)) {
+ configData.channels[chIndex].range.label = uiString.LABEL_RANGE_RESISTOR;
+ configData.channels[chIndex].range.selection = rangeSelectionOfResistance;
+ if (!configData.channels[chIndex].range.selection.includes(configData.channels[chIndex].range.value)) {
+ configData.channels[chIndex].range.value = uiString.Resistance_RANGE_1;
+ }
+ } else if (typeSelectionOfThermal.includes(newType)) {
+ configData.channels[chIndex].range.label = uiString.LABEL_RANGE_THERMAL;
+ configData.channels[chIndex].range.selection = rangeSelectionOfThermal;
+ if (!configData.channels[chIndex].range.selection.includes(configData.channels[chIndex].range.value)) {
+ configData.channels[chIndex].range.value = uiString.Thermal_RANGE_0;
+ updateChannelTempCoeff(event);
+ }
+ } else {
+ /* Do nothing */
+ }
+ };
+
+ const updateChannelTempCoeff = (event) => {
+ const chIndex = parseInt(event.target.name.slice(-1), 10);
+ const newRange = configData.channels[chIndex].range.value;
+
+ if (!typeSelectionOfThermal.includes(configData.channels[chIndex].type.value)) {
+ return;
+ }
+
+ const newSelection = decideTempCoeffSelection(newRange);
+
+ configData.channels[chIndex].temper_coeff.selection = newSelection.selection;
+ if (!newSelection.selection.includes(configData.channels[chIndex].temper_coeff.value)) {
+ configData.channels[chIndex].temper_coeff.value = newSelection.defaultValue;
+ }
+ };
+
+ const updateSlotConfig = () => {
+ updateConfig(slotNum, configData);
+ };
+
+ return (
+
+
+
+
+
+
+
+ {range(0, chTotal).map((index) => (
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ ))
+ }
+
+ );
+}
diff --git a/recipes-app/iot2050-conf-webui/files/src/components/SlotInfo.js b/recipes-app/iot2050-conf-webui/files/src/components/SlotInfo.js
index 1f8051b36..2300c9ff8 100644
--- a/recipes-app/iot2050-conf-webui/files/src/components/SlotInfo.js
+++ b/recipes-app/iot2050-conf-webui/files/src/components/SlotInfo.js
@@ -6,6 +6,8 @@ import TextField from '@mui/material/TextField';
import MenuItem from '@mui/material/MenuItem';
import Typography from '@mui/material/Typography';
import SM1223Conf, { SM1223ConfDefault } from '@/components/ExtendedModules/SM1223/SM1223Conf';
+import SM1231_4RTDConf, { SM1231_4RTDConfDefault } from '@/components/ExtendedModules/SM1231_RTD/SM1231_4RTDConf';
+import SM1231_8RTDConf, { SM1231_8RTDConfDefault } from '@/components/ExtendedModules/SM1231_RTD/SM1231_8RTDConf';
function Mod ({ modType, slotNum, config, updateConfig }) {
switch (modType) {
@@ -15,6 +17,18 @@ function Mod ({ modType, slotNum, config, updateConfig }) {
configData={config}
updateConfig={updateConfig}
/>;
+ case '6ES7231-5PD32-0XB0':
+ return ;
+ case '6ES7231-5PF32-0XB0':
+ return ;
default:
return No module in this slot!!!;
}
@@ -26,6 +40,12 @@ export default function SlotInfo ({ slotNum, configData, updateSlot }) {
case '6ES7223-1QH32-0XB0':
updateSlot(slotNum, JSON.parse(JSON.stringify(SM1223ConfDefault)));
break;
+ case '6ES7231-5PD32-0XB0':
+ updateSlot(slotNum, JSON.parse(JSON.stringify(SM1231_4RTDConfDefault)));
+ break;
+ case '6ES7231-5PF32-0XB0':
+ updateSlot(slotNum, JSON.parse(JSON.stringify(SM1231_8RTDConfDefault)));
+ break;
default:
updateSlot(slotNum, { mlfb: 'None' });
}
@@ -34,6 +54,8 @@ export default function SlotInfo ({ slotNum, configData, updateSlot }) {
const moduleTypes = [
'None',
'6ES7223-1QH32-0XB0', // SM1223
+ '6ES7231-5PD32-0XB0', // SM1231-4RTD
+ '6ES7231-5PF32-0XB0', // SM1231-8RTD
];
return (
diff --git a/recipes-app/iot2050-conf-webui/files/src/lib/smConfig/smConfig.js b/recipes-app/iot2050-conf-webui/files/src/lib/smConfig/smConfig.js
index 6255a091f..8b18ff81e 100644
--- a/recipes-app/iot2050-conf-webui/files/src/lib/smConfig/smConfig.js
+++ b/recipes-app/iot2050-conf-webui/files/src/lib/smConfig/smConfig.js
@@ -2,6 +2,10 @@ import {
convertToDeviceFormat as convertToDeviceFmtForSM1223,
convertToUIFormat as convertToUIFmtForSM1223
} from '@/components/ExtendedModules/SM1223/SM1223Conf';
+import {
+ convertToDeviceFormat as convertToDeviceFmtForSM1231RTD,
+ convertToUIFormat as convertToUIFmtForSM1231RTD
+} from '@/components/ExtendedModules/SM1231_RTD/SM1231_RTDConf';
export function exportYamlConfig (configData) {
const yamlConfig = {};
@@ -12,6 +16,10 @@ export function exportYamlConfig (configData) {
case '6ES7223-1QH32-0XB0': // SM1223
yamlConfig['slot' + slotIndex] = convertToDeviceFmtForSM1223(confSlot);
break;
+ case '6ES7231-5PD32-0XB0': // SM1231-4RTD
+ case '6ES7231-5PF32-0XB0': // SM1231-8RTD
+ yamlConfig['slot' + slotIndex] = convertToDeviceFmtForSM1231RTD(confSlot);
+ break;
case 'None':
default:
yamlConfig['slot' + slotIndex] = {
@@ -41,6 +49,10 @@ export function importYamlConfig (configData) {
case '6ES7223-1QH32-0XB0': // SM1223
uiConfig.config[i - 1] = convertToUIFmtForSM1223(configData['slot' + i]);
break;
+ case '6ES7231-5PD32-0XB0': // SM1231-4RTD
+ case '6ES7231-5PF32-0XB0': // SM1231-8RTD
+ uiConfig.config[i - 1] = convertToUIFmtForSM1231RTD(configData['slot' + i]);
+ break;
case 'None':
default:
break;
diff --git a/recipes-app/iot2050-conf-webui/files/src/lib/uiString/SM1231_RTD.json b/recipes-app/iot2050-conf-webui/files/src/lib/uiString/SM1231_RTD.json
new file mode 100644
index 000000000..92b324e66
--- /dev/null
+++ b/recipes-app/iot2050-conf-webui/files/src/lib/uiString/SM1231_RTD.json
@@ -0,0 +1,63 @@
+{
+ "DESC_MOD_4CH": "Analog input module AI4 x RTD",
+ "DESC_MOD_8CH": "Analog input module AI8 x RTD",
+ "LABEL_POWER_ALARM": "Enable module 24V DC power supply diagnostics",
+ "LABEL_TYPE": "Measurement type:",
+ "LABEL_RANGE_THERMAL": "Thermal resistor:",
+ "LABEL_RANGE_RESISTOR": "Resistance:",
+ "LABEL_TEMP_COEFF": "Temperature coefficient:",
+ "LABEL_INT_TIME": "Set integration time for noise reduction:",
+ "LABEL_SMOOTH": "Smoothing:",
+ "LABEL_TEMP_UNIT": "Temperature scale:",
+ "LABEL_OPEN_WIRE_ALARM": "Enable broken wire diagnostics",
+ "LABEL_OVER_FLOW_ALARM": "Enable overflow diagnostics",
+ "LABEL_UNDER_FLOW_ALARM": "Enable underflow diagnostics",
+ "TYPE_0": "Deactivated",
+ "TYPE_4": "Resistor (4-wire)",
+ "TYPE_5": "Resistor (3-wire)",
+ "TYPE_6": "Resistor (2-wire)",
+ "TYPE_7": "Thermal resistor (4-wire)",
+ "TYPE_8": "Thermal resistor (3-wire)",
+ "TYPE_9": "Thermal resistor (2-wire)",
+ "Resistance_RANGE_1": "150 ohms",
+ "Resistance_RANGE_2": "300 ohms",
+ "Resistance_RANGE_3": "600 ohms",
+ "Thermal_RANGE_0": "Pt 100 climatic range",
+ "Thermal_RANGE_2": "Pt 100 standard range",
+ "Thermal_RANGE_3": "Ni 100 standard range",
+ "Thermal_RANGE_4": "Pt 500 standard range",
+ "Thermal_RANGE_5": "Pt 1000 standard range",
+ "Thermal_RANGE_6": "Ni 1000 standard range",
+ "Thermal_RANGE_11": "Pt 200 standard range",
+ "Thermal_RANGE_12": "Ni 120 standard range",
+ "Thermal_RANGE_15": "Cu 10 standard range",
+ "Thermal_RANGE_16": "Ni 200 standard range",
+ "Thermal_RANGE_18": "Ni 500 standard range",
+ "Thermal_RANGE_20": "Pt 10 standard range",
+ "Thermal_RANGE_22": "Pt 50 standard range",
+ "Thermal_RANGE_24": "Cu 50 standard range",
+ "Thermal_RANGE_26": "Cu 100 standard range",
+ "Thermal_RANGE_28": "LG-Ni 1000 standard range",
+ "TEMP_COEFF_0": "Pt 0.00385055 ohms/ohms/℃ (DIN EN 60751)",
+ "TEMP_COEFF_1": "Pt 0.003916 ohms/ohms/℃ (USA, NBS)",
+ "TEMP_COEFF_2": "Pt 0.003902 ohms/ohms/℃",
+ "TEMP_COEFF_3": "Pt 0.003920 ohms/ohms/℃",
+ "TEMP_COEFF_5": "Pt 0.003910 ohms/ohms/℃ (GOST 6651, Russia 1994)",
+ "TEMP_COEFF_7": "Ni 0.006170 ohms/ohms/℃ (GOST 6651, Russia 1994)",
+ "TEMP_COEFF_8": "Ni 0.006180 ohms/ohms/℃",
+ "TEMP_COEFF_9": "Ni 0.006720 ohms/ohms/℃",
+ "TEMP_COEFF_10": "LG Ni 0.0050000 ohms/ohms/℃ (L&S)",
+ "TEMP_COEFF_11": "Cu 0.00426 ohms/ohms/℃ (GOST 6651, Russia 1994)",
+ "TEMP_COEFF_12": "Cu 0.00427 ohms/ohms/℃",
+ "TEMP_COEFF_13": "Cu 0.00428 ohms/ohms/℃ (GOST 6651, Russia 1994)",
+ "INT_TIME_0": "400 Hz (2.5ms)",
+ "INT_TIME_1": "60 Hz (16.6ms)",
+ "INT_TIME_2": "50 Hz (20ms)",
+ "INT_TIME_3": "10 Hz (100ms)",
+ "SMOOTH_0": "None (1 cycle)",
+ "SMOOTH_1": "Weak (4 cycles)",
+ "SMOOTH_2": "Medium (16 cycles)",
+ "SMOOTH_3": "Strong (32 cycles)",
+ "TEMP_UNIT_0": "Celsius",
+ "TEMP_UNIT_1": "Fahrenheit"
+}
\ No newline at end of file