iobroker.modbus 4.0.2 → 4.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/admin/asset-manifest.json +3 -3
- package/admin/index_m.html +1 -1
- package/admin/static/js/{main.2265812f.chunk.js → main.cca7ed55.chunk.js} +2 -2
- package/admin/static/js/{main.2265812f.chunk.js.map → main.cca7ed55.chunk.js.map} +1 -1
- package/io-package.json +13 -13
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["Components/Utils.js","Tabs/Options.js","Components/TsvDialog.js","Components/DeleteAllDialog.js","Components/DeleteDialog.js","Components/RegisterTable.js","Tabs/BaseRegisters.js","Tabs/InputRegisters.js","Tabs/HoldingRegisters.js","Tabs/DiscreteInputs.js","Tabs/Coils.js","App.js","serviceWorker.js","index.js"],"names":["_rmap","_dmap","offsets","coils","disInputs","inputRegs","holdingRegs","Utils","address2alias","regType","address","parseInt","alias2address","alias","nonDirect2direct","Math","floor","direct2nonDirect","Options","props","inputDisabled","input","name","native","params","type","showAliases","slave","onlyUseWriteMultipleRegisters","doNotUseWriteMultipleRegisters","inputDisplay","includes","changeParam","value","JSON","parse","stringify","multiDeviceId","readIPs","readPorts","forEach","nativeParam","item","_address","directAddresses","changeNative","state","ports","customPort","ips","this","socket","getState","adapterName","instance","then","val","sendTo","list","error","console","length","path","warn","map","title","manufacturer","comName","find","setState","catch","e","getIpAddresses","common","host","ip","unshift","inputs","Paper","className","classes","optionsContainer","Typography","variant","gutterBottom","header","I18n","t","FormControl","optionContainer","FormControlLabel","label","control","Checkbox","optionsCheckbox","disabled","checked","onChange","target","help","FormHelperText","helperText","dimension","Box","InputLabel","Select","optionsSelect","options","option","MenuItem","TextField","optionsTextfield","InputProps","endAdornment","InputAdornment","position","IconButton","onClick","tab","Grid","container","spacing","xs","md","optionsGrid","getInputsBlock","connectionInputs","generalInputs","Component","withStyles","theme","width","display","alignItems","paddingTop","paddingBottom","marginTop","marginLeft","marginBottom","padding","textAlign","fontSize","tsvEditor","height","tsvEditorTextarea","fontFamily","useState","tsv","setTsv","useEffect","tsvResult","push","fields","field","data","undefined","toString","json2tsv","open","enqueueSnackbar","useSnackbar","Dialog","onClose","maxWidth","fullWidth","DialogTitle","DialogContent","DialogContentText","showPrintMargin","setOptions","firstLineNumber","mode","DialogActions","Button","color","copy","startIcon","tsv2json","endsWith","shift","success","errors","index","itemValues","itemIndex","save","DeleteAllDialog","action","DeleteDialog","disableWarnings","setDisableWarnings","DataCell","result","sortedItem","editMode","setEditMode","ref","useRef","Tooltip","inputRef","tableCheckbox","getDisable","$index","rooms","allowNone","dense","themeType","inputProps","tableSelect","tableSelectContainer","tableTextFieldContainer","tableTextField","TableCell","clsx","tableCell","nonEditMode","window","localStorage","setItem","setTimeout","current","focus","tableHeader","whiteSpace","fontWeight","tableHeaderExtended","palette","primary","light","dark","tableContainer","overflow","maxHeight","cursor","tsvDialogOpen","setTsvDialogOpen","getItem","extendedMode","setExtendedMode","deleteAllDialog","setDeleteAllDialog","deleteDialog","setDeleteDialog","sortedData","getSortedData","orderBy","order","addItem","Table","size","stickyHeader","TableHead","TableRow","filter","expert","formulaDisabled","isChecked","indeterminate","trueFound","falseFound","k","style","tooltip","newData","changeData","sorted","TableSortLabel","active","direction","isAsc","onChangeOrder","TableBody","hover","lastTime","sessionStorage","Date","deleteItem","disableDialogs","toISOString","BaseRegisters","nativeField","addressToCanonical","newItem","getFields","splice","sort","sortedItem1","sortedItem2","sort1","sort2","deviceId","showExtendedModeSwitch","isShowExtendedModeSwitch","InputRegisters","lastItem","len","factor","offset","formula","role","cw","isScale","types","roles","propTypes","PropTypes","object","isRequired","number","string","onError","func","onLoad","changed","bool","HoldingRegisters","poll","wp","DiscreteInputs","Coils","tabs","component","TabOptions","TabDiscreteInputs","icon","marginRight","TabCoils","TabInputRegisters","TabHoldingRegisters","item1","item2","App","extendedProps","encryptedFields","translations","require","moreLoaded","getEnums","selectedTab","findIndex","loaded","background","default","text","AppBar","Tabs","getSelectedTab","selectTab","scrollButtons","Tab","isIFrame","tabContentIFrame","tabContent","TabComponent","errorText","onLoadConfig","attr","cb","updateNativeValue","getIsChanged","renderError","renderSaveCloseButtons","GenericApp","root","minHeight","Boolean","location","hostname","match","themeName","getThemeName","log","version","build","ReactDOM","render","onThemeChange","_theme","document","getElementById","navigator","serviceWorker","ready","registration","unregister"],"mappings":"q37DAAMA,EAAQ,CACV,EAAG,GACH,EAAG,GACH,EAAG,GACH,EAAG,GACH,EAAG,GACH,EAAG,GACH,EAAG,EACH,EAAG,EACH,EAAG,EACH,EAAG,EACH,GAAI,EACJ,GAAI,EACJ,GAAI,EACJ,GAAI,EACJ,GAAI,EACJ,GAAI,GAEFC,EAAQ,CACV,EAAG,EACH,EAAG,EACH,EAAG,EACH,EAAG,EACH,EAAG,EACH,EAAG,EACH,EAAG,EACH,EAAG,EACH,EAAG,EACH,EAAG,EACH,GAAI,GACJ,GAAI,GACJ,GAAI,GACJ,GAAI,GACJ,GAAI,GACJ,GAAI,IAGFC,EAAU,CACZC,MAAO,EACPC,UAAW,MACXC,UAAW,MACXC,YAAa,OA8BjB,IAOeC,EAPD,CACVC,cA5BJ,SAAuBC,EAASC,GAC5B,OAAOC,SAASD,EAAS,IAAMR,EAAQO,IA4BvCG,cAzBJ,SAAuBH,EAASI,GAC5B,OAAOF,SAASE,EAAO,IAAMX,EAAQO,IAyBrCK,iBAtBJ,SAA0BL,EAASC,GAM/B,MALgB,cAAZD,GAAuC,UAAZA,IAC3BC,EAAUC,SAASD,EAAS,KAAO,EACnCA,EAAqC,GAA3BK,KAAKC,MAAMN,EAAU,IAAWT,EAAMS,EAAU,KAGvDA,GAiBPO,iBAdJ,SAA0BR,EAASC,GAC/B,MAAgB,cAAZD,GAAuC,UAAZA,GAC3BC,EAAUC,SAASD,EAAS,KAAO,EACnCA,EAAqC,GAA3BK,KAAKC,MAAMN,EAAU,IAAWV,EAAMU,EAAU,K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: 6,\n 7: 7,\n 8: 8,\n 9: 9,\n 10: 10,\n 11: 11,\n 12: 12,\n 13: 13,\n 14: 14,\n 15: 15\n};\n\nconst offsets = {\n coils: 1,\n disInputs: 10001,\n inputRegs: 30001,\n holdingRegs: 40001,\n};\n\nfunction address2alias(regType, address) {\n return parseInt(address, 10) + offsets[regType];\n}\n\nfunction alias2address(regType, alias) {\n return parseInt(alias, 10) - offsets[regType];\n}\n\nfunction nonDirect2direct(regType, address) {\n if (regType === 'disInputs' || regType === 'coils') {\n address = parseInt(address, 10) || 0;\n address = Math.floor(address / 16) * 16 + _dmap[address % 16];\n }\n\n return address;\n}\n\nfunction direct2nonDirect(regType, address) {\n if (regType === 'disInputs' || regType === 'coils') {\n address = parseInt(address, 10) || 0;\n address = Math.floor(address / 16) * 16 + _rmap[address % 16];\n return address;\n } else {\n return address;\n }\n}\n\nconst Utils = {\n address2alias,\n alias2address,\n nonDirect2direct,\n direct2nonDirect\n};\n\nexport default Utils;","import {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {withStyles} from '@material-ui/core/styles';\n\nimport Typography from '@material-ui/core/Typography';\nimport TextField from '@material-ui/core/TextField';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport Select from '@material-ui/core/Select';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport FormControl from '@material-ui/core/FormControl';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport InputAdornment from '@material-ui/core/InputAdornment';\nimport Grid from '@material-ui/core/Grid';\nimport Paper from '@material-ui/core/Paper';\nimport Box from '@material-ui/core/Box';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport IconButton from '@material-ui/core/IconButton';\n\nimport Utils from '../Components/Utils';\n\nimport EditIcon from '@material-ui/icons/Edit';\n\nimport I18n from '@iobroker/adapter-react/i18n';\n\nimport connectionInputs from '../data/optionsConnection';\nimport generalInputs from '../data/optionsGeneral';\n\nconst styles = theme => ({\n optionsSelect: {\n width: 280\n },\n optionsTextfield: {\n width: 280\n },\n optionContainer: {\n display: 'flex',\n alignItems: 'start',\n paddingTop: 4,\n paddingBottom: 4\n },\n helperText: {\n marginTop: -8,\n marginLeft: 32,\n marginBottom: 10\n },\n optionsContainer: {\n width: `calc(100% - ${theme.spacing(4)}px)`,\n padding: theme.spacing(2),\n display: 'inline-block',\n textAlign: 'left'\n },\n optionsGrid: {\n textAlign: 'center',\n padding: theme.spacing(2),\n },\n header: {\n fontSize: 24,\n }\n});\n\nclass Options extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n ports: null,\n customPort: false,\n ips: null,\n };\n }\n\n readPorts() {\n return this.props.socket.getState(`system.adapter.${this.props.adapterName}.${this.props.instance}.alive`)\n .then(state => {\n if (state && state.val) {\n return this.props.socket.sendTo(this.props.adapterName + '.' + this.props.instance, 'listUart', null)\n .then(list => {\n if (list && list.error) {\n console.error('Cannot read ports: ' + list.error);\n } else\n if (list && list.length === 1 && list[0] && list[0].path === 'Not available') {\n console.warn('Cannot read ports');\n } else {\n const ports = list.map(item => ({value: item.path, title: item.path + (item.manufacturer ? ' [' + item.manufacturer + ']' : '')}));\n const customPort = this.props.native.params.comName && !ports.find(item => item.value === this.props.native.params.comName);\n\n this.setState({ports, customPort});\n }\n })\n .catch(e => console.error('Cannot read ports: ' + e));\n }\n })\n .catch(e => console.error('Cannot read alive: ' + e));\n }\n\n readIPs() {\n return this.props.socket.getIpAddresses(this.props.common.host)\n .then(ips => {\n ips = ips || [];\n ips = ips.map(ip => ({value: ip, title: ip}));\n ips.unshift({value: '0.0.0.0', title: 'Listen on all IPs'});\n ips.unshift({value: '127.0.0.1', title: '127.0.0.1 (Localhost)'});\n this.setState({ips});\n })\n .catch(e => console.error('Cannot read IP addresses: ' + e));\n }\n\n componentDidMount() {\n if (this.props.native.params.type === 'serial') {\n this.readPorts();\n }\n if (this.props.native.params.type !== 'serial' && (this.props.native.params.slave === '1' || this.props.native.params.slave === 1)) {\n this.readIPs();\n }\n }\n\n inputDisabled = input => {\n if (input.name === 'slave' && this.props.native.params.type !== 'tcp') {\n return true;\n } else\n if (input.name === 'directAddresses' && !this.props.native.params.showAliases) {\n return true;\n } else\n if (input.name === 'multiDeviceId' && (this.props.native.params.slave === '1' || this.props.native.params.slave === 1)) {\n return true;\n } else\n if (input.name === 'doNotUseWriteMultipleRegisters' && this.props.native.params.onlyUseWriteMultipleRegisters) {\n return true;\n } else\n if (input.name === 'onlyUseWriteMultipleRegisters' && this.props.native.params.doNotUseWriteMultipleRegisters) {\n return true;\n } else {\n return false;\n }\n }\n\n inputDisplay = input => {\n if (['tcp', 'tcprtu'].includes(this.props.native.params.type)) {\n if (['comName', 'baudRate', 'dataBits', 'stopBits', 'parity'].includes(input.name)) {\n return false;\n }\n } else {\n if (['bind', 'port'].includes(input.name)) {\n return false;\n }\n }\n return true;\n }\n\n getInputsBlock(inputs, title) {\n return <><Paper className={this.props.classes.optionsContainer}>\n <Typography variant=\"h4\" gutterBottom className={this.props.classes.header}>{I18n.t(title)}</Typography>\n {inputs.map(input => {\n if (!this.inputDisplay(input)) {\n return null;\n } else if (input.name === 'bind' && this.props.native.params.type !== 'serial' && (this.props.native.params.slave === '1' || this.props.native.params.slave === 1)) {\n return <Box className={this.props.classes.optionContainer} key={input.name}>\n {this.state.ips ?\n <FormControl>\n <InputLabel>{I18n.t('Slave IP address')}</InputLabel>\n <Select\n className={this.props.classes.optionsSelect}\n disabled={this.inputDisabled(input)}\n value={this.props.native.params[input.name] || ''}\n onChange={e => this.changeParam(input.name, e.target.value)}\n >\n {this.state.ips.map(option =>\n <MenuItem key={option.value} value={option.value}>{option.title}</MenuItem>\n )}\n </Select>\n </FormControl>\n :\n <TextField\n type={input.type}\n label={I18n.t('Slave IP address')}\n className={this.props.classes.optionsTextfield}\n disabled={this.inputDisabled(input)}\n helperText={input.help ? I18n.t(input.help) : ''}\n value={this.props.native.params[input.name]}\n InputProps={{endAdornment: input.dimension ? <InputAdornment position=\"end\">{I18n.t(input.dimension)}</InputAdornment> : null}}\n onChange={e => this.changeParam(input.name, e.target.value)}\n />}\n </Box>;\n }\n if (input.type === 'checkbox') {\n return <FormControl className={this.props.classes.optionContainer} key={input.name}>\n <FormControlLabel\n label={I18n.t(input.title)}\n control={<Checkbox\n label={I18n.t(input.title)}\n className={this.props.classes.optionsCheckbox}\n disabled={this.inputDisabled(input)}\n checked={this.props.native.params[input.name]}\n onChange={e => this.changeParam(input.name, e.target.checked)}\n />}\n />\n {input.help ? <FormHelperText className={this.props.classes.helperText}>{I18n.t(input.help)}</FormHelperText> : null}\n {input.dimension ? I18n.t(input.dimension) : null}\n </FormControl>;\n } else if (input.type === 'select') {\n return <Box className={this.props.classes.optionContainer} key={input.name}>\n <FormControl>\n <InputLabel>{I18n.t(input.title)}</InputLabel>\n <Select\n className={this.props.classes.optionsSelect}\n disabled={this.inputDisabled(input)}\n value={this.props.native.params[input.name] || ''}\n onChange={e => this.changeParam(input.name, e.target.value)}\n >\n {input.options.map(option =>\n <MenuItem key={option.value} value={option.value}>{option.title}</MenuItem>\n )}\n </Select>\n </FormControl> {input.dimension ? I18n.t(input.dimension) : null}\n </Box>;\n } else if (input.type === 'ports') {\n return <Box className={this.props.classes.optionContainer} key={input.name}>\n {this.state.ports && !this.state.customPort ?\n <FormControl>\n <InputLabel>{I18n.t(input.title)}</InputLabel>\n <Select\n className={this.props.classes.optionsSelect}\n disabled={this.inputDisabled(input)}\n value={this.props.native.params[input.name] || ''}\n onChange={e => this.changeParam(input.name, e.target.value)}\n >\n {this.state.ports.map(option =>\n <MenuItem key={option.value} value={option.value}>{option.title}</MenuItem>\n )}\n </Select>\n </FormControl>\n :\n <TextField\n type={input.type}\n label={I18n.t(input.title)}\n className={this.props.classes.optionsTextfield}\n disabled={this.inputDisabled(input)}\n helperText={input.help ? I18n.t(input.help) : ''}\n value={this.props.native.params[input.name]}\n InputProps={{endAdornment: input.dimension ? <InputAdornment position=\"end\">{I18n.t(input.dimension)}</InputAdornment> : null}}\n onChange={e => this.changeParam(input.name, e.target.value)}\n />}\n {this.state.ports ? <IconButton onClick={() => this.setState({customPort: !this.state.customPort})}><EditIcon/></IconButton> : null}\n </Box>;\n } else {\n return <Box className={this.props.classes.optionContainer} key={input.name}>\n <TextField\n type={input.type}\n label={I18n.t(input.title)}\n className={this.props.classes.optionsTextfield}\n disabled={this.inputDisabled(input)}\n helperText={input.help ? I18n.t(input.help) : ''}\n value={this.props.native.params[input.name]}\n InputProps={{endAdornment: input.dimension ? <InputAdornment position=\"end\">{I18n.t(input.dimension)}</InputAdornment> : null}}\n onChange={e => this.changeParam(input.name, e.target.value)}\n />\n </Box>;\n }\n })\n }\n </Paper></>\n }\n\n render() {\n return <form className={ this.props.classes.tab }>\n <Grid container spacing={2} >\n <Grid item xs={12} md={6} className={ this.props.classes.optionsGrid }>{this.getInputsBlock(connectionInputs, 'Connection parameters')}</Grid>\n <Grid item xs={12} md={6} className={ this.props.classes.optionsGrid }>{this.getInputsBlock(generalInputs, 'General')}</Grid>\n </Grid>\n </form>;\n }\n\n changeParam = (name, value) => {\n let native = JSON.parse(JSON.stringify(this.props.native));\n native.params[name] = value;\n if (name === 'slave') {\n if (value === '1' || value === 1) {\n native.params.multiDeviceId = false;\n if (this.props.native.params.type !== 'serial') {\n this.readIPs();\n }\n }\n } else\n if (name === 'type') {\n if (value !== 'tcp' && (native.params.slave === 1 || native.params.slave === '1')) {\n native.params.slave = '0';\n }\n\n if (value === 'serial') {\n this.readPorts();\n }\n if (value === 'serial' && (this.props.native.params.slave === '1' || this.props.native.params.slave === 1)) {\n this.readIPs();\n }\n } else\n if (name === 'showAliases') {\n ['disInputs', 'inputRegs', 'holdingRegs', 'coils'].forEach(nativeParam => {\n native[nativeParam].forEach(item => {\n if (value) {\n item._address = Utils.address2alias(nativeParam, item._address);\n if (native.params.directAddresses) {\n item._address = Utils.nonDirect2direct(nativeParam, item._address);\n }\n } else {\n if (native.params.directAddresses) {\n item._address = Utils.direct2nonDirect(nativeParam, item._address);\n }\n item._address = Utils.alias2address(nativeParam, item._address);\n }\n });\n });\n } else\n if (name === 'directAddresses' && native.params.showAliases) {\n ['disInputs', 'coils'].forEach(nativeParam => {\n native[nativeParam].forEach(item => {\n if (value) {\n item._address = Utils.nonDirect2direct(nativeParam, item._address);\n } else {\n item._address = Utils.direct2nonDirect(nativeParam, item._address);\n }\n });\n });\n }\n this.props.changeNative(native);\n }\n}\n\nOptions.propTypes = {\n common: PropTypes.object.isRequired,\n native: PropTypes.object.isRequired,\n instance: PropTypes.number.isRequired,\n adapterName: PropTypes.string.isRequired,\n onError: PropTypes.func,\n onLoad: PropTypes.func,\n onChange: PropTypes.func,\n changed: PropTypes.bool,\n socket: PropTypes.object.isRequired,\n rooms: PropTypes.object,\n};\n\nexport default withStyles(styles)(Options);\n","import { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport {withStyles} from '@material-ui/core/styles';\n\nimport { tsv2json, json2tsv } from 'tsv-json';\nimport { useSnackbar } from 'notistack';\nimport AceEditor from 'react-ace';\nimport copy from 'copy-to-clipboard';\n\nimport I18n from '@iobroker/adapter-react/i18n';\n\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport Button from '@material-ui/core/Button';\n\nimport ClearIcon from '@material-ui/icons/Clear';\nimport SaveIcon from '@material-ui/icons/Save';\nimport FileCopyIcon from '@material-ui/icons/FileCopy';\n\nconst styles = theme => ({\n tsvEditor: {\n width: '100%',\n height: 400\n },\n tsvEditorTextarea: {\n fontFamily: 'monospace'\n }\n});\n\nconst TsvDialog = props => {\n const [tsv, setTsv] = useState('');\n\n useEffect(() => {\n let tsvResult = [];\n tsvResult.push(props.fields.map(field => field.name));\n props.data.forEach(item =>\n tsvResult.push(props.fields.map(field => item[field.name] !== undefined && item[field.name] !== null ? item[field.name].toString() : ''))\n );\n setTsv(json2tsv(tsvResult));\n }, [props.open]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const { enqueueSnackbar } = useSnackbar();\n\n if (!props.open) {\n return null;\n }\n\n const saveTsv = () => {\n let data = tsv2json(tsv.endsWith('\\n') ? tsv : tsv + '\\n');\n let fields = data.shift();\n let success = true;\n let errors = [];\n for (let index in props.fields) {\n if (props.fields[index].name !== fields[index]) {\n errors.push(<>No field <i>{props.fields[index].name}</i> in position <i>{parseInt(index) + 1}</i>!</>);\n success = false;\n }\n }\n\n data = data.map((itemValues, itemIndex) => {\n let item = {};\n for (let index in props.fields) {\n if (props.fields[index].type === 'select' && !props.fields[index].options.map(option => option.value).includes(itemValues[index])) {\n errors.push(<>Value <i>{itemValues[index]}</i> is wrong for field <i>{props.fields[index].name}</i> in position <i>{parseInt(itemIndex) + 1}</i>!</>);\n success = false;\n }\n if (props.fields[index].type === 'checkbox') {\n itemValues[index] = itemValues[index] === 'true';\n }\n item[props.fields[index].name] = itemValues[index];\n }\n return item;\n });\n\n if (!success) {\n enqueueSnackbar(<div>{errors.map((error, index) => <div key={index}>{error}</div>)}</div>, { variant: 'error' });\n return;\n }\n props.save(data);\n props.onClose();\n };\n\n return <Dialog\n open={props.open}\n onClose={props.onClose}\n maxWidth=\"lg\"\n fullWidth\n >\n <DialogTitle>{I18n.t('Edit data as TSV')}</DialogTitle>\n <DialogContent>\n <DialogContentText>{I18n.t('You can copy, paste and edit data as TSV.')}</DialogContentText>\n <div>\n <AceEditor\n onChange={e => setTsv(e)}\n height=\"400px\"\n showPrintMargin={false}\n value={tsv}\n className={props.classes.tsvEditor}\n width=\"100%\"\n setOptions={{firstLineNumber: 0}}\n mode={null}\n />\n </div>\n </DialogContent>\n <DialogActions>\n <Button variant=\"outlined\" color=\"primary\" onClick={() => {\n //Utils.copyToClipboard(tsv);\n copy(tsv);\n enqueueSnackbar(I18n.t('TSV was copied to clipboard'));\n }} startIcon={<FileCopyIcon />}>{I18n.t('Copy to clipboard')}</Button>\n <Button variant=\"contained\" color=\"primary\" onClick={saveTsv} startIcon={<SaveIcon />}>{I18n.t('Import')}</Button>\n <Button variant=\"contained\" onClick={props.onClose} startIcon={<ClearIcon />}>{I18n.t('Close')}</Button>\n </DialogActions>\n </Dialog>\n};\n\nTsvDialog.propTypes = {\n open: PropTypes.bool,\n onClose: PropTypes.func,\n classes: PropTypes.object,\n save: PropTypes.func,\n fields: PropTypes.array,\n data: PropTypes.array\n};\n\nexport default withStyles(styles)(TsvDialog);","import PropTypes from 'prop-types';\n\nimport I18n from '@iobroker/adapter-react/i18n';\n\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport Button from '@material-ui/core/Button';\n\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport ClearIcon from '@material-ui/icons/Clear';\n\nconst DeleteAllDialog = (props) => {\n return props.open ? <Dialog open={props.open} onClose={props.onClose}>\n <DialogTitle>{I18n.t('Delete all items')}</DialogTitle>\n <DialogContent>\n <DialogContentText>{I18n.t('Are you sure to delete all items?')}</DialogContentText>\n <DialogActions>\n <Button variant=\"contained\" color=\"secondary\" startIcon={<DeleteIcon />} onClick={() => {\n props.action();\n props.onClose();\n }}>{I18n.t('Delete all items')}</Button>\n <Button variant=\"contained\" onClick={props.onClose} startIcon={<ClearIcon />}>{I18n.t('Cancel')}</Button>\n </DialogActions>\n </DialogContent>\n </Dialog> : null;\n}\n\nDeleteAllDialog.propTypes = {\n open: PropTypes.bool,\n action: PropTypes.func,\n onClose: PropTypes.func,\n classes: PropTypes.object,\n}\n\nexport default DeleteAllDialog;","import { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\n\nimport I18n from '@iobroker/adapter-react/i18n';\n\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport Button from '@material-ui/core/Button';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport Checkbox from '@material-ui/core/Checkbox';\n\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport ClearIcon from '@material-ui/icons/Clear';\n\nconst DeleteDialog = (props) => {\n const [disableWarnings, setDisableWarnings] = useState(false);\n useEffect(() => {\n setDisableWarnings(false);\n }, [props.open]);\n\n return props.open ? <Dialog open={props.open} onClose={props.onClose}>\n <DialogTitle>{I18n.t('Delete item')}</DialogTitle>\n <DialogContent>\n <DialogContentText>{I18n.t('Are you sure to delete item with address \"%s\"?', props.item._address)}</DialogContentText>\n <DialogContentText><FormControlLabel\n label={I18n.t('Don\\'t show this message in 5 minutes')}\n control={<Checkbox\n checked={disableWarnings}\n onChange={e => setDisableWarnings(e.target.checked)}\n />}/></DialogContentText>\n <DialogActions>\n <Button variant=\"contained\" color=\"secondary\" startIcon={<DeleteIcon />} onClick={() => {\n props.action(disableWarnings);\n props.onClose();\n }}>{I18n.t('Delete')}</Button>\n <Button variant=\"contained\" onClick={props.onClose} startIcon={<ClearIcon />}>{I18n.t('Cancel')}</Button>\n </DialogActions>\n </DialogContent>\n </Dialog> : null;\n}\n\nDeleteDialog.propTypes = {\n open: PropTypes.bool,\n onClose: PropTypes.func,\n classes: PropTypes.object,\n action: PropTypes.func,\n item: PropTypes.object,\n}\n\nexport default DeleteDialog;","import { useState, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport {withStyles} from '@material-ui/core/styles';\n\nimport Table from '@material-ui/core/Table';\nimport TableHead from '@material-ui/core/TableHead';\nimport TableBody from '@material-ui/core/TableBody';\nimport TableRow from '@material-ui/core/TableRow';\nimport TableCell from '@material-ui/core/TableCell';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport TextField from '@material-ui/core/TextField';\nimport IconButton from '@material-ui/core/IconButton';\nimport Select from '@material-ui/core/Select';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport TableSortLabel from '@material-ui/core/TableSortLabel';\nimport Tooltip from '@material-ui/core/Tooltip';\n\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport AddIcon from '@material-ui/icons/Add';\nimport ImportExport from '@material-ui/icons/ImportExport';\n\nimport I18n from '@iobroker/adapter-react/i18n';\nimport Utils from '@iobroker/adapter-react/Components/Utils';\n\nimport ExpertIcon from '@iobroker/adapter-react/icons/IconExpert';\nimport TextWithIcon from '@iobroker/adapter-react/Components/TextWithIcon';\nimport SelectWithIcon from '@iobroker/adapter-react/Components/SelectWithIcon';\n\nimport TsvDialog from './TsvDialog';\nimport DeleteAllDialog from './DeleteAllDialog';\nimport DeleteDialog from './DeleteDialog';\n\nconst styles = theme => ({\n tableHeader: {\n whiteSpace: 'nowrap',\n fontWeight: 'bold',\n fontSize: '80%',\n padding: '0px 8px'\n },\n tableHeaderExtended: {\n color: theme.palette.type === 'dark' ? theme.palette.primary.light : theme.palette.primary.dark\n },\n tableCell: {\n whiteSpace: 'nowrap',\n fontSize: '80%',\n padding: '0px 8px'\n },\n tableContainer: {\n overflow: 'auto',\n maxHeight: 'calc(100vh - 180px)'\n },\n tableTextField: {\n fontSize: '80%'\n },\n tableSelect: {\n fontSize: '80%'\n },\n tableTextFieldContainer: {\n width: '100%'\n },\n tableSelectContainer: {\n width: '100%'\n },\n nonEditMode: {\n cursor: 'pointer'\n }\n});\n\nconst DataCell = props => {\n const sortedItem = props.sortedItem;\n const field = props.field;\n const editMode = props.editMode;\n const setEditMode = props.setEditMode;\n\n const ref = useRef();\n\n let item = sortedItem.item;\n let result;\n if (field.type === 'checkbox') {\n result = <Tooltip title={I18n.t(field.title)}>\n <Checkbox\n inputRef={ref}\n className={props.classes.tableCheckbox}\n checked={!!item[field.name]}\n disabled={props.getDisable(sortedItem.$index, field.name)}\n onChange={e => props.changeParam(sortedItem.$index, field.name, e.target.checked)}\n />\n </Tooltip>;\n } else if (field.type === 'rooms') {\n if (!editMode) {\n result = <TextWithIcon list={props.rooms} value={item[field.name]} themeType={props.themeType}/>;\n } else {\n result = <SelectWithIcon\n list={props.rooms}\n allowNone={true}\n value={item[field.name] === undefined || item[field.name] === null ? '' : item[field.name]}\n dense={true}\n themeType={props.themeType}\n inputProps={{ref, className: props.classes.tableSelect}}\n disabled={props.getDisable(sortedItem.$index, field.name)}\n onChange={value => props.changeParam(sortedItem.$index, field.name, value)}\n className={props.classes.tableSelectContainer}\n />;\n }\n } else if (field.type === 'select') {\n if (!editMode) {\n let option = field.options.find(option => option.value === item[field.name]);\n result = option ? option.title : '';\n } else {\n result = <Select\n value={item[field.name] === undefined || item[field.name] === null ? '' : item[field.name]}\n inputProps={{ref, className: props.classes.tableSelect}}\n disabled={props.getDisable(sortedItem.$index, field.name)}\n onChange={e => props.changeParam(sortedItem.$index, field.name, e.target.value)}\n className={props.classes.tableSelectContainer}\n >\n {field.options.map(option =>\n <MenuItem key={option.value} value={option.value}>{option.title ? option.title : <i>{I18n.t('Nothing')}</i>}</MenuItem>\n )}\n </Select>;\n }\n } else {\n if (!editMode) {\n result = item[field.name] ? item[field.name] : null;\n } else {\n result = <TextField\n value={item[field.name] === undefined || item[field.name] === null ? '' : item[field.name]}\n className={props.classes.tableTextFieldContainer}\n inputProps={{ref: ref, className: props.classes.tableTextField}}\n type={field.type}\n onChange={e => props.changeParam(sortedItem.$index, field.name, e.target.value)}\n disabled={props.getDisable(sortedItem.$index, field.name)}\n />;\n }\n }\n\n return <TableCell\n className={Utils.clsx(props.classes.tableCell, !editMode && props.classes.nonEditMode)}\n onClick={e => {\n setEditMode(true);\n window.localStorage.setItem('Modbus.editMode', 'true');\n window.setTimeout(() => ref.current && ref.current.focus(), 100);\n }}\n >\n {result}\n </TableCell>;\n}\n\nconst RegisterTable = props => {\n const [tsvDialogOpen, setTsvDialogOpen] = useState(false);\n const [editMode, setEditMode] = useState(parseInt(window.localStorage.getItem('Modbus.editMode'), 10) || 0);\n const [extendedMode, setExtendedMode] = useState(window.localStorage.getItem('Modbus.extendedMode') === 'true');\n const [deleteAllDialog, setDeleteAllDialog] = useState({\n open: false,\n action: null,\n });\n const [deleteDialog, setDeleteDialog] = useState({\n open: false,\n item: null,\n action: null,\n });\n\n let sortedData = props.getSortedData(props.data, props.orderBy, props.order);\n\n return <div>\n <div>\n <Tooltip title={I18n.t('Add line')}>\n <IconButton onClick={e => {\n props.addItem();\n }}>\n <AddIcon/>\n </IconButton>\n </Tooltip>\n <Tooltip title={I18n.t('Edit as TSV (Tab separated values)')}>\n <IconButton onClick={() => setTsvDialogOpen(true)}>\n <ImportExport/>\n </IconButton>\n </Tooltip>\n <Tooltip title={I18n.t('Toggle extended mode')}>\n <IconButton\n color={extendedMode ? 'primary' : 'inherit'}\n onClick={() => {\n window.localStorage.setItem('Modbus.extendedMode', extendedMode ? 'false' : 'true');\n setExtendedMode(!extendedMode);\n }}>\n <ExpertIcon/>\n </IconButton>\n </Tooltip>\n </div>\n <div className={props.classes.tableContainer}>\n <Table size=\"small\"\n stickyHeader\n padding=\"none\"\n >\n <TableHead>\n <TableRow>\n {props.fields.filter(item => (extendedMode || !item.expert) && (!props.formulaDisabled || !item.formulaDisabled)).map(field => {\n let isChecked = false;\n let indeterminate = false;\n let trueFound = false;\n let falseFound = false;\n for (let k in props.data) {\n if (props.data[k][field.name]) {\n isChecked = true;\n trueFound = true;\n } else {\n isChecked = false;\n falseFound = true;\n }\n\n if (trueFound && falseFound) {\n indeterminate = true;\n isChecked = false;\n break;\n }\n }\n\n return <TableCell\n key={field.name}\n style={{width: field.type === 'checkbox' ? 20 : field.width}}\n className={Utils.clsx(props.classes.tableHeader, field.expert && props.classes.tableHeaderExtended)}\n title={field.tooltip ? I18n.t(field.tooltip) : null}\n >\n {field.type === 'checkbox' ?\n <Tooltip title={I18n.t('Change all')}>\n <Checkbox\n indeterminate={indeterminate}\n checked={isChecked}\n onChange={e => {\n let newData = JSON.parse(JSON.stringify(props.data));\n newData.forEach(item =>\n item[field.name] = e.target.checked);\n props.changeData(newData);\n }}\n />\n </Tooltip>\n : null}\n {field.sorted ? <TableSortLabel\n active={field.name === props.orderBy}\n direction={props.order}\n onClick={e => {\n const isAsc = props.orderBy === field.name && props.order === 'asc';\n props.onChangeOrder(field.name, isAsc ? 'desc' : 'asc');\n }}\n >{I18n.t(field.title)}</TableSortLabel> : I18n.t(field.title)}\n </TableCell>\n })}\n <TableCell>\n <Tooltip title={I18n.t('Delete all')}>\n <div>\n <IconButton\n size=\"small\"\n onClick={e => setDeleteAllDialog({\n open: true,\n action: () => props.changeData([]),\n })}\n disabled={!props.data.length}\n >\n <DeleteIcon/>\n </IconButton>\n </div>\n </Tooltip>\n </TableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n {\n sortedData.map(sortedItem =>\n <TableRow hover key={sortedItem.$index}>\n {props.fields.filter(item => (extendedMode || !item.expert) && (!props.formulaDisabled || !item.formulaDisabled)).map(field =>\n <DataCell\n key={field.name}\n themeType={props.themeType}\n sortedItem={sortedItem}\n field={field}\n editMode={editMode === sortedItem.$index}\n rooms={props.rooms}\n setEditMode={() => setEditMode(sortedItem.$index)}\n {...props}\n />\n )}\n <TableCell>\n <Tooltip title={I18n.t('Delete')}>\n <div>\n <IconButton size=\"small\" onClick={e => {\n let lastTime = window.sessionStorage.getItem('disableDeleteDialogs');\n if (lastTime && (new Date() - new Date(lastTime)) < 1000 * 60 * 5) {\n props.deleteItem(sortedItem.$index);\n return;\n }\n setDeleteDialog({\n open: true,\n action: disableDialogs => {\n if (disableDialogs) {\n window.sessionStorage.setItem('disableDeleteDialogs', (new Date()).toISOString());\n }\n props.deleteItem(sortedItem.$index);\n },\n item: sortedItem.item\n })\n }}>\n <DeleteIcon/>\n </IconButton>\n </div>\n </Tooltip>\n </TableCell>\n </TableRow>\n )\n }\n </TableBody>\n </Table>\n </div>\n {tsvDialogOpen ? <TsvDialog\n open={true}\n save={props.changeData}\n onClose={() => setTsvDialogOpen(false)}\n data={props.data}\n fields={props.fields}\n /> : null}\n <DeleteAllDialog\n open={deleteAllDialog.open}\n action={deleteAllDialog.action}\n onClose={() => setDeleteAllDialog({\n open: false,\n action: null,\n })}\n />\n <DeleteDialog\n open={deleteDialog.open}\n action={deleteDialog.action}\n onClose={() => setDeleteDialog({\n open: false,\n action: null,\n item: null\n })}\n item={deleteDialog.item}\n />\n </div>;\n}\n\nRegisterTable.propTypes = {\n data: PropTypes.array,\n fields: PropTypes.array,\n classes: PropTypes.object,\n addItem: PropTypes.func,\n changeData: PropTypes.func,\n deleteItem: PropTypes.func,\n rooms: PropTypes.object,\n formulaDisabled: PropTypes.bool,\n onChangeOrder: PropTypes.func,\n getSortedData: PropTypes.func,\n themeType: PropTypes.string,\n showExtendedModeSwitch: PropTypes.bool,\n}\n\nexport default withStyles(styles)(RegisterTable);","import {Component} from 'react';\nimport PropTypes from 'prop-types';\n\nimport Paper from '@material-ui/core/Paper';\n\nimport RegisterTable from '../Components/RegisterTable';\nimport Utils from '../Components/Utils';\n\nclass BaseRegisters extends Component {\n constructor(props) {\n super(props);\n this.nativeField = '';\n this.state = {\n order: window.localStorage.getItem('Modbus.order') || 'asc',\n orderBy: window.localStorage.getItem('Modbus.orderBy') || '_address',\n };\n }\n\n componentDidMount() {\n if (!window.localStorage.getItem('Modbus.orderBy')) {\n this.fields = this.fields || this.getFields();\n const isSlaveIDPresent = !!this.fields.find(item => item.name === 'deviceId');\n const orderBy = isSlaveIDPresent ? 'deviceId' : '_address';\n\n if (orderBy !== this.state.orderBy) {\n this.setState({orderBy});\n }\n }\n }\n\n isShowExtendedModeSwitch() {\n return true;\n }\n\n getFields() {\n return null;\n }\n\n addressToCanonical(_address) {\n let address = _address;\n let params = this.props.native.params;\n if (params.showAliases) {\n if (params.directAddresses) {\n address = Utils.direct2nonDirect(this.nativeField, address);\n }\n address = Utils.alias2address(this.nativeField, address);\n }\n return address;\n }\n\n changeParam = (index, name, value) => {\n let data = JSON.parse(JSON.stringify(this.props.native[this.nativeField]));\n data[index][name] = value;\n if (name === '_address') {\n data[index]['address'] = this.addressToCanonical(value);\n }\n this.props.onChange(this.nativeField, data);\n }\n\n addItem = () => {\n let data = JSON.parse(JSON.stringify(this.props.native[this.nativeField]));\n let newItem = {};\n this.getFields().forEach(field => newItem[field.name] = '');\n data.push(newItem);\n this.props.onChange(this.nativeField, data);\n }\n\n deleteItem = index => {\n let data = JSON.parse(JSON.stringify(this.props.native[this.nativeField]));\n data.splice(index, 1);\n this.props.onChange(this.nativeField, data);\n }\n\n changeData = data => {\n this.props.onChange(this.nativeField, data);\n }\n\n getDisable = (index, name) => {\n return false;\n }\n\n getSortedData = (data, orderBy, order) => {\n data = data || this.props.native[this.nativeField];\n orderBy = orderBy || this.state.orderBy;\n order = order || this.state.order;\n let sortedData = [];\n data.forEach((item, index) => {sortedData[index] = {item, $index: index}});\n const field = this.fields.find(item => item.name === orderBy);\n\n sortedData.sort((sortedItem1, sortedItem2) => {\n let sort1;\n let sort2;\n if (orderBy === 'deviceId') {\n sort1 = (parseInt(sortedItem1.item.deviceId, 10) << 16) | parseInt(sortedItem1.item._address, 10);\n sort2 = (parseInt(sortedItem2.item.deviceId, 10) << 16) | parseInt(sortedItem2.item._address, 10);\n } else if (orderBy === '$index') {\n sort1 = sortedItem1[orderBy];\n sort2 = sortedItem2[orderBy];\n } else if (field && field.type === 'number') {\n sort1 = parseInt(sortedItem1.item[orderBy], 10);\n sort2 = parseInt(sortedItem2.item[orderBy], 10);\n } else {\n sort1 = sortedItem1.item[orderBy];\n sort2 = sortedItem2.item[orderBy];\n }\n return (order === 'asc' ? sort1 > sort2 : sort1 < sort2) ? 1 : -1;\n });\n\n return sortedData;\n }\n\n render() {\n this.fields = this.fields || this.getFields();\n\n return <Paper>\n <RegisterTable\n fields={this.fields}\n data={this.props.native[this.nativeField]}\n getSortedData={this.getSortedData}\n showExtendedModeSwitch={this.isShowExtendedModeSwitch()}\n changeParam={this.changeParam}\n addItem={this.addItem}\n deleteItem={this.deleteItem}\n changeData={this.changeData}\n getDisable={this.getDisable}\n formulaDisabled={this.props.formulaDisabled}\n rooms={this.props.rooms}\n order={this.state.order}\n orderBy={this.state.orderBy}\n onChangeOrder={(orderBy, order) => {\n this.setState({orderBy, order});\n window.localStorage.setItem('Modbus.orderBy', orderBy);\n window.localStorage.setItem('Modbus.order', order);\n }}\n />\n </Paper>;\n }\n}\n\nBaseRegisters.propTypes = {\n common: PropTypes.object.isRequired,\n native: PropTypes.object.isRequired,\n instance: PropTypes.number.isRequired,\n adapterName: PropTypes.string.isRequired,\n onError: PropTypes.func,\n onLoad: PropTypes.func,\n onChange: PropTypes.func,\n changed: PropTypes.bool,\n socket: PropTypes.object.isRequired,\n rooms: PropTypes.object,\n formulaDisabled: PropTypes.bool,\n};\n\nexport default BaseRegisters;\n","import PropTypes from 'prop-types';\n\nimport types from '../data/types';\nimport roles from '../data/roles';\n\nimport BaseRegisters from './BaseRegisters';\n\nclass InputRegisters extends BaseRegisters {\n nativeField = 'inputRegs';\n\n getFields() {\n let result = [\n {name: '_address', title: 'Address', type: 'number', sorted: true, width: 20},\n {name: 'name', title: 'Name', type: 'text', sorted: true},\n {name: 'description', title: 'Description', type: 'text', sorted: true},\n {name: 'unit', title: 'Unit', type: 'text', width: 30},\n {name: 'type', title: 'Type', type: 'select', options: types, sorted: true},\n {name: 'len', title: 'Length', type: 'text', width: 20},\n {name: 'factor', title: 'Factor', type: 'text', width: 20, expert: true},\n {name: 'offset', title: 'Offset', type: 'text', width: 20, expert: true},\n {name: 'formula', title: 'Formula', type: 'text', formulaDisabled: true, expert: true},\n {name: 'role', title: 'Role', type: 'select', options: roles, sorted: true},\n {name: 'room', title: 'Room', type: 'rooms'},\n {name: 'cw', title: 'CW', type: 'checkbox', tooltip: 'Cyclic write'},\n {name: 'isScale', title: 'SF', type: 'checkbox', tooltip: 'Store this value as scaling factor', expert: true, formulaDisabled: true},\n ];\n\n if (this.props.native.params.multiDeviceId) {\n result.splice(1, 0,\n {name: 'deviceId', title: 'Slave ID', type: 'number', sorted: true, width: 20},\n );\n }\n\n return result;\n }\n\n addItem = () => {\n let data = JSON.parse(JSON.stringify(this.props.native[this.nativeField]));\n let newItem = {}\n this.getFields().forEach(field => newItem[field.name] = '')\n if (data.length) {\n let sortedData = this.getSortedData();\n let lastItem = sortedData[sortedData.length - 1].item;\n newItem._address = parseInt(lastItem._address, 10) + (lastItem.len ? parseInt(lastItem.len, 10) : 1);\n while(sortedData.find(item => item.item._address >= newItem._address && item.item._address + parseInt(item.item.len || 1, 10) < newItem._address)) {\n newItem._address++;\n }\n newItem.deviceId = lastItem.deviceId;\n newItem.type = lastItem.type;\n newItem.len = lastItem.len;\n newItem.factor = lastItem.factor;\n newItem.offset = lastItem.offset;\n newItem.formula = lastItem.formula;\n newItem.role = lastItem.role;\n newItem.cw = lastItem.cw;\n newItem.isScale = lastItem.isScale;\n } else {\n newItem.role = 'level';\n newItem.factor = 1;\n newItem.offset = 0;\n newItem._address = this.props.native.params.showAliases ? 30001 : 0;\n }\n newItem.address = this.addressToCanonical(newItem._address);\n data.push(newItem);\n this.props.onChange(this.nativeField, data);\n }\n\n getDisable = (index, name) => {\n if (name === 'len') {\n if (!['string', 'stringle'].includes(this.props.native[this.nativeField][index].type)) {\n return true;\n }\n }\n return false;\n }\n\n changeParam = (index, name, value) => {\n let data = JSON.parse(JSON.stringify(this.props.native[this.nativeField]));\n data[index][name] = value;\n if (name === 'type') {\n if (['', 'uint16be', 'uint16le', 'int16be', 'int16le', 'uint8be', 'uint8le', 'int8be', 'int8le'].includes(value)) {\n data[index].len = 1;\n }\n if (['uint32be', 'uint32le', 'uint32sw', 'uint32sb', 'int32be', 'int32le', 'int32sw', 'int32sb', 'floatbe', 'floatle', 'floatsw', 'floatsb', 'string', 'stringle'].includes(value)) {\n data[index].len = 2;\n }\n if (['uint64be', 'uint64le', 'doublebe', 'doublele'].includes(value)) {\n data[index].len = 4;\n }\n }\n\n if (name === '_address') {\n data[index]['address'] = this.addressToCanonical(value);\n }\n\n this.props.onChange(this.nativeField, data);\n }\n}\n\nInputRegisters.propTypes = {\n common: PropTypes.object.isRequired,\n native: PropTypes.object.isRequired,\n instance: PropTypes.number.isRequired,\n adapterName: PropTypes.string.isRequired,\n onError: PropTypes.func,\n onLoad: PropTypes.func,\n onChange: PropTypes.func,\n changed: PropTypes.bool,\n socket: PropTypes.object.isRequired,\n rooms: PropTypes.object,\n};\n\nexport default InputRegisters;\n","import PropTypes from 'prop-types';\n\nimport BaseRegisters from './BaseRegisters';\n\nimport roles from '../data/roles';\nimport types from '../data/types';\n\nclass HoldingRegisters extends BaseRegisters {\n nativeField = 'holdingRegs';\n\n getFields() {\n //let rooms = this.getRooms();\n //rooms.unshift({value: '', title: ''});\n\n let result = [\n {name: '_address', title: 'Address', type: 'number', sorted: true, width: 20},\n {name: 'name', title: 'Name', type: 'text', sorted: true},\n {name: 'description', title: 'Description', type: 'text', sorted: true},\n {name: 'unit', title: 'Unit', type: 'text', width: 30},\n {name: 'type', title: 'Type', type: 'select', options: types, sorted: true},\n {name: 'len', title: 'Length', type: 'text', width: 20},\n {name: 'factor', title: 'Factor', type: 'text', width: 20, expert: true},\n {name: 'offset', title: 'Offset', type: 'text', width: 20, expert: true},\n {name: 'formula', title: 'Formula', type: 'text', expert: true, formulaDisabled: true},\n {name: 'role', title: 'Role', type: 'select', options: roles, sorted: true},\n {name: 'room', title: 'Room', type: 'rooms'},\n {name: 'poll', title: 'Poll', type: 'checkbox', tooltip: 'Enable polling of data point'},\n {name: 'wp', title: 'WP', type: 'checkbox', tooltip: 'Write pulses (true → false edge)', expert: true},\n {name: 'cw', title: 'CW', type: 'checkbox', tooltip: 'Cyclic write'},\n {name: 'isScale', title: 'SF', type: 'checkbox', tooltip: 'Store this value as scaling factor', expert: true, formulaDisabled: true},\n ];\n\n if (this.props.native.params.multiDeviceId) {\n result.splice(1, 0,\n {name: 'deviceId', title: 'Slave ID', type: 'number', sorted: true, width: 20},\n );\n }\n\n return result;\n }\n\n addItem = () => {\n let data = JSON.parse(JSON.stringify(this.props.native[this.nativeField]));\n let newItem = {}\n this.getFields().forEach(field => newItem[field.name] = '');\n if (data.length) {\n let sortedData = this.getSortedData();\n let lastItem = sortedData[sortedData.length - 1].item;\n newItem._address = parseInt(lastItem._address, 10) + (lastItem.len ? parseInt(lastItem.len, 10) : 1);\n while(sortedData.find(item => item.item._address >= newItem._address && item.item._address + parseInt(item.item.len || 1, 10) < newItem._address)) {\n newItem._address++;\n }\n newItem.deviceId = lastItem.deviceId;\n newItem.type = lastItem.type;\n newItem.len = (lastItem.len ? parseInt(lastItem.len) : 1);\n newItem.factor = lastItem.factor;\n newItem.offset = lastItem.offset;\n newItem.formula = lastItem.formula;\n newItem.role = lastItem.role;\n newItem.poll = lastItem.poll;\n newItem.wp = lastItem.wp;\n newItem.cw = lastItem.cw;\n newItem.isScale = lastItem.isScale;\n } else {\n newItem.role = 'level';\n newItem.factor = 1;\n newItem.offset = 0;\n newItem._address = this.props.native.params.showAliases ? 40001 : 0;\n }\n newItem.address = this.addressToCanonical(newItem._address);\n data.push(newItem);\n this.props.onChange(this.nativeField, data);\n }\n\n getDisable = (index, name) => {\n return name === 'len' &&\n !['string', 'stringle'].includes(this.props.native[this.nativeField][index].type);\n }\n\n changeParam = (index, name, value) => {\n let data = JSON.parse(JSON.stringify(this.props.native[this.nativeField]));\n\n data[index][name] = value;\n\n if (name === 'type') {\n if (['', 'uint16be', 'uint16le', 'int16be', 'int16le', 'uint8be', 'uint8le', 'int8be', 'int8le'].includes(value)) {\n data[index].len = 1;\n } else\n if (['uint32be', 'uint32le', 'uint32sw', 'uint32sb', 'int32be', 'int32le', 'int32sw', 'int32sb', 'floatbe', 'floatle', 'floatsw', 'floatsb', 'string', 'stringle'].includes(value)) {\n data[index].len = 2;\n } else\n if (['uint64be', 'uint64le', 'doublebe', 'doublele'].includes(value)) {\n data[index].len = 4;\n }\n }\n\n if (name === '_address') {\n data[index]['address'] = this.addressToCanonical(value);\n }\n\n this.props.onChange(this.nativeField, data);\n }\n}\n\nHoldingRegisters.propTypes = {\n common: PropTypes.object.isRequired,\n native: PropTypes.object.isRequired,\n instance: PropTypes.number.isRequired,\n adapterName: PropTypes.string.isRequired,\n onError: PropTypes.func,\n onLoad: PropTypes.func,\n onChange: PropTypes.func,\n changed: PropTypes.bool,\n socket: PropTypes.object.isRequired,\n rooms: PropTypes.object,\n};\n\nexport default HoldingRegisters;\n","import PropTypes from 'prop-types';\n\nimport roles from '../data/roles';\n\nimport BaseRegisters from './BaseRegisters';\n\nclass DiscreteInputs extends BaseRegisters {\n nativeField = 'disInputs';\n\n getFields() {\n let result = [\n {name: '_address', title: 'Address', type: 'number', sorted: true, width: 20},\n {name: 'name', title: 'Name', type: 'text', sorted: true},\n {name: 'description', title: 'Description', type: 'text', sorted: true},\n {name: 'formula', title: 'Formula', type: 'text', expert: true, formulaDisabled: true},\n {name: 'role', title: 'Role', type: 'select', options: roles, sorted: true},\n {name: 'room', title: 'Room', type: 'rooms'},\n {name: 'cw', title: 'CW', type: 'checkbox', tooltip: 'Cyclic write'},\n {name: 'isScale', title: 'SF', type: 'checkbox', tooltip: 'Store this value as scaling factor', expert: true, formulaDisabled: true},\n ];\n\n if (this.props.native.params.multiDeviceId) {\n result.splice(1, 0,\n {name: 'deviceId', title: 'Slave ID', type: 'number', sorted: true, width: 20},\n );\n }\n\n return result;\n }\n\n isShowExtendedModeSwitch() {\n return this.props.native.params.slave !== 1 && this.props.native.params.slave !== '1';\n }\n\n addItem = () => {\n let data = JSON.parse(JSON.stringify(this.props.native[this.nativeField]));\n let newItem = {}\n this.getFields().forEach(field => newItem[field.name] = '')\n if (data.length) {\n let sortedData = this.getSortedData();\n let lastItem = sortedData[sortedData.length - 1].item;\n newItem._address = parseInt(lastItem._address, 10) + 1;\n while(sortedData.find(item => item.item._address === newItem._address)) {\n newItem._address++;\n }\n newItem.deviceId = lastItem.deviceId;\n newItem.formula = lastItem.formula;\n newItem.role = lastItem.role;\n newItem.cw = lastItem.cw;\n newItem.isScale = lastItem.isScale;\n } else {\n newItem.role = 'level';\n newItem._address = this.props.native.params.showAliases ? 10001 : 0;\n }\n newItem.address = this.addressToCanonical(newItem._address);\n data.push(newItem);\n this.props.onChange(this.nativeField, data);\n }\n}\n\nDiscreteInputs.propTypes = {\n common: PropTypes.object.isRequired,\n native: PropTypes.object.isRequired,\n instance: PropTypes.number.isRequired,\n adapterName: PropTypes.string.isRequired,\n onError: PropTypes.func,\n onLoad: PropTypes.func,\n onChange: PropTypes.func,\n changed: PropTypes.bool,\n socket: PropTypes.object.isRequired,\n rooms: PropTypes.object,\n};\n\nexport default DiscreteInputs;\n","import PropTypes from 'prop-types';\n\nimport roles from '../data/roles';\n\nimport BaseRegisters from './BaseRegisters';\n\nclass Coils extends BaseRegisters {\n nativeField = 'coils';\n\n getFields() {\n let result = [\n {name: '_address', title: 'Address', type: 'number', sorted: true, width: 20},\n {name: 'name', title: 'Name', type: 'text', sorted: true},\n {name: 'description', title: 'Description', type: 'text', sorted: true},\n {name: 'formula', title: 'Formula', type: 'text', expert: true, formulaDisabled: true},\n {name: 'role', title: 'Role', type: 'select', options: roles, sorted: true},\n {name: 'room', title: 'Room', type: 'rooms'},\n {name: 'poll', title: 'Poll', type: 'checkbox'},\n {name: 'wp', title: 'WP', type: 'checkbox', expert: true},\n {name: 'cw', title: 'CW', type: 'checkbox'},\n {name: 'isScale', title: 'SF', type: 'checkbox', tooltip: 'Store this value as scaling factor', expert: true, formulaDisabled: true},\n ];\n\n if (this.props.native.params.multiDeviceId) {\n result.splice(1, 0,\n {name: 'deviceId', title: 'Slave ID', type: 'number', sorted: true, width: 20},\n );\n }\n\n return result;\n }\n\n addItem = () => {\n let data = JSON.parse(JSON.stringify(this.props.native[this.nativeField]));\n let newItem = {}\n this.getFields().forEach(field => newItem[field.name] = '');\n if (data.length) {\n let sortedData = this.getSortedData();\n let lastItem = sortedData[sortedData.length - 1].item;\n newItem._address = parseInt(lastItem._address, 10) + 1;\n while(sortedData.find(item => item.item._address === newItem._address)) {\n newItem._address++;\n }\n newItem.deviceId = lastItem.deviceId;\n newItem.formula = lastItem.formula;\n newItem.role = lastItem.role;\n newItem.poll = lastItem.poll;\n newItem.wp = lastItem.wp;\n newItem.cw = lastItem.cw;\n newItem.isScale = lastItem.isScale;\n } else {\n newItem.role = 'level';\n newItem._address = this.props.native.params.showAliases ? 1 : 0;\n }\n newItem.address = this.addressToCanonical(newItem._address);\n data.push(newItem);\n this.props.onChange(this.nativeField, data);\n }\n}\n\nCoils.propTypes = {\n common: PropTypes.object.isRequired,\n native: PropTypes.object.isRequired,\n instance: PropTypes.number.isRequired,\n adapterName: PropTypes.string.isRequired,\n onError: PropTypes.func,\n onLoad: PropTypes.func,\n onChange: PropTypes.func,\n changed: PropTypes.bool,\n socket: PropTypes.object.isRequired,\n rooms: PropTypes.object,\n};\n\nexport default Coils;\n","import React from 'react';\nimport {withStyles} from '@material-ui/core/styles';\nimport { MuiThemeProvider } from '@material-ui/core/styles';\nimport { SnackbarProvider } from 'notistack';\n\nimport AppBar from '@material-ui/core/AppBar';\nimport Tabs from '@material-ui/core/Tabs';\nimport Tab from '@material-ui/core/Tab';\n\nimport {AiOutlineFieldBinary as BinaryIcon} from 'react-icons/all';\nimport {TiSortNumerically as DigitsIcon} from 'react-icons/all';\n\nimport GenericApp from '@iobroker/adapter-react/GenericApp';\nimport Loader from '@iobroker/adapter-react/Components/Loader'\nimport I18n from '@iobroker/adapter-react/i18n';\n\nimport TabOptions from './Tabs/Options';\nimport TabInputRegisters from './Tabs/InputRegisters';\nimport TabHoldingRegisters from './Tabs/HoldingRegisters';\nimport TabDiscreteInputs from './Tabs/DiscreteInputs';\nimport TabCoils from './Tabs/Coils';\n\nconst styles = theme => ({\n root: {},\n tabContent: {\n padding: 10,\n height: 'calc(100% - 64px - 48px - 20px)',\n overflow: 'auto',\n },\n tabContentIFrame: {\n padding: 10,\n height: 'calc(100% - 64px - 48px - 20px - 38px)',\n overflow: 'auto'\n },\n tab: {\n width: '100%',\n minHeight: '100%'\n }\n});\n\nconst tabs = [\n {\n name: 'general',\n title: 'General',\n component: TabOptions,\n },\n {\n name: 'discrete-inputs',\n title: 'Discrete inputs',\n component: TabDiscreteInputs,\n icon: <BinaryIcon style={{width: 18, height: 18, marginRight: 4, display: 'inline-block'}}/>,\n tooltip: 'Binary inputs (read-only)'\n },\n {\n name: 'coils',\n title: 'Coils',\n component: TabCoils,\n icon: <BinaryIcon style={{width: 18, height: 18, marginRight: 4, display: 'inline-block'}}/>,\n tooltip: 'Binary inputs and outputs'\n },\n {\n name: 'input-registers',\n title: 'Input Registers',\n component: TabInputRegisters,\n icon: <DigitsIcon style={{width: 18, height: 18, marginRight: 4, display: 'inline-block'}}/>,\n tooltip: 'Input registers (8-64 bit values, read-only)'\n },\n {\n name: 'holding-registers',\n title: 'Holding Registers',\n component: TabHoldingRegisters,\n icon: <DigitsIcon style={{width: 18, height: 18, marginRight: 4, display: 'inline-block'}}/>,\n tooltip: 'Input/output registers (8-64 bit values)'\n },\n];\n\nfunction sort(data) {\n data.sort((item1, item2) => {\n item1.deviceId = parseInt(item1.deviceId, 10) || 1;\n item2.deviceId = parseInt(item2.deviceId, 10) || 1;\n item1._address = parseInt(item1._address, 10) || 0;\n item2._address = parseInt(item2._address, 10) || 0;\n const sort1 = (parseInt(item1.deviceId, 10) << 16) | parseInt(item1._address, 10);\n const sort2 = (parseInt(item2.deviceId, 10) << 16) | parseInt(item2._address, 10);\n return sort1 < sort2 ? -1 : (sort1 > sort2 ? 1 : 0);\n });\n}\n\nclass App extends GenericApp {\n constructor(props) {\n const extendedProps = {...props};\n extendedProps.encryptedFields = ['pass'];\n\n extendedProps.translations = {\n 'en': require('./i18n/en'),\n 'de': require('./i18n/de'),\n 'ru': require('./i18n/ru'),\n 'pt': require('./i18n/pt'),\n 'nl': require('./i18n/nl'),\n 'fr': require('./i18n/fr'),\n 'it': require('./i18n/it'),\n 'es': require('./i18n/es'),\n 'pl': require('./i18n/pl'),\n 'zh-cn': require('./i18n/zh-cn'),\n };\n\n super(props, extendedProps);\n this.state.moreLoaded = false;\n this.state.rooms = null;\n }\n\n onPrepareSave(native) {\n // sort all arraysby device:address\n native.disInputs && sort(native.disInputs);\n native.coils && sort(native.coils);\n native.inputRegs && sort(native.inputRegs);\n native.holdingRegs && sort(native.holdingRegs);\n\n return native;\n }\n\n onConnectionReady() {\n super.onConnectionReady();\n\n this.socket.getEnums('rooms')\n .then(rooms =>\n this.setState({moreLoaded: true, rooms}));\n }\n\n getSelectedTab() {\n const selectedTab = this.state.selectedTab;\n if (!selectedTab) {\n return 0;\n } else {\n return tabs.findIndex(tab => tab.name === selectedTab);\n }\n }\n\n render() {\n if (!this.state.loaded || !this.state.moreLoaded) {\n return <MuiThemeProvider theme={this.state.theme}>\n <Loader theme={this.state.themeType} />\n </MuiThemeProvider>;\n }\n\n return <MuiThemeProvider theme={this.state.theme}>\n <SnackbarProvider>\n <div className=\"App\" style={{background: this.state.theme.palette.background.default, color: this.state.theme.palette.text.primary}}>\n <AppBar position=\"static\">\n <Tabs\n value={this.getSelectedTab()}\n onChange={(e, index) => this.selectTab(tabs[index].name, index)}\n variant=\"scrollable\" scrollButtons=\"auto\">\n {tabs.map(tab => <Tab\n label={tab.icon ? <>{tab.icon}{I18n.t(tab.title)}</> : I18n.t(tab.title)}\n data-name={tab.name}\n key={tab.name}\n title={tab.tooltip ? I18n.t(tab.tooltip) : undefined}\n />\n )}\n </Tabs>\n </AppBar>\n <div className={this.isIFrame ? this.props.classes.tabContentIFrame : this.props.classes.tabContent}>\n {tabs.map((tab, index) => {\n const TabComponent = tab.component;\n if (this.state.selectedTab) {\n if (this.state.selectedTab !== tab.name) {\n return null;\n }\n } else {\n if (index !== 0) {\n return null;\n }\n }\n return <TabComponent\n key={tab.name}\n formulaDisabled={this.state.native.params.slave === '1' || this.state.native.params.slave === 1}\n common={this.common}\n socket={this.socket}\n native={this.state.native}\n onError={text => this.setState({errorText: (text || text === 0) && typeof text !== 'string' ? text.toString() : text})}\n onLoad={native => this.onLoadConfig(native)}\n instance={this.instance}\n adapterName={this.adapterName}\n changed={this.state.changed}\n onChange={(attr, value, cb) => this.updateNativeValue(attr, value, cb)}\n changeNative={(value) => this.setState({native: value, changed: this.getIsChanged(value)})}\n rooms={this.state.rooms}\n />\n })}\n </div>\n {this.renderError()}\n {this.renderSaveCloseButtons()}\n </div>\n </SnackbarProvider>\n </MuiThemeProvider>;\n }\n}\n\nexport default withStyles(styles)(App);\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read http://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit http://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See http://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport * as Sentry from '@sentry/browser';\nimport * as SentryIntegrations from '@sentry/integrations';\nimport { MuiThemeProvider} from '@material-ui/core/styles';\nimport './index.css';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\nimport {version} from '../package.json';\nimport theme from '@iobroker/adapter-react/Theme';\nimport Utils from '@iobroker/adapter-react/Components/Utils';\n\nwindow.adapterName = 'modbus';\nlet themeName = Utils.getThemeName();\n\nconsole.log(`iobroker.${window.adapterName}@${version} using theme \"${themeName}\"`);\n\nfunction build() {\n return ReactDOM.render(\n <MuiThemeProvider theme={theme(themeName)}>\n <App\n onThemeChange={_theme => {\n themeName = _theme;\n build();\n }}\n />\n </MuiThemeProvider>,\n document.getElementById('root')\n );\n}\n\nif (false && window.location.host !== 'localhost:3000') {\n Sentry.init({\n dsn: 'https://5ad729dbed504d15aa8bde423cae9a8e@sentry.iobroker.net/57',\n release: `iobroker.${window.adapterName}@${version}`,\n integrations: [\n new SentryIntegrations.Dedupe()\n ]\n });\n}\n\nbuild();\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: http://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}
|
|
1
|
+
{"version":3,"sources":["Components/Utils.js","Tabs/Options.js","Components/TsvDialog.js","Components/DeleteAllDialog.js","Components/DeleteDialog.js","Components/RegisterTable.js","Tabs/BaseRegisters.js","Tabs/InputRegisters.js","Tabs/HoldingRegisters.js","Tabs/DiscreteInputs.js","Tabs/Coils.js","App.js","serviceWorker.js","index.js"],"names":["_rmap","_dmap","offsets","coils","disInputs","inputRegs","holdingRegs","Utils","address2alias","regType","address","parseInt","alias2address","alias","nonDirect2direct","Math","floor","direct2nonDirect","Options","props","inputDisabled","input","name","native","params","type","showAliases","slave","onlyUseWriteMultipleRegisters","doNotUseWriteMultipleRegisters","inputDisplay","includes","changeParam","value","JSON","parse","stringify","multiDeviceId","readIPs","readPorts","forEach","nativeParam","item","_address","directAddresses","changeNative","state","ports","customPort","ips","this","socket","getState","adapterName","instance","then","val","sendTo","list","error","console","length","path","warn","map","title","manufacturer","comName","find","setState","catch","e","getIpAddresses","common","host","ip","unshift","inputs","Paper","className","classes","optionsContainer","Typography","variant","gutterBottom","header","I18n","t","FormControl","optionContainer","FormControlLabel","label","control","Checkbox","optionsCheckbox","disabled","checked","onChange","target","help","FormHelperText","helperText","dimension","Box","InputLabel","Select","optionsSelect","options","option","MenuItem","TextField","optionsTextfield","InputProps","endAdornment","InputAdornment","position","IconButton","onClick","tab","Grid","container","spacing","xs","md","optionsGrid","getInputsBlock","connectionInputs","generalInputs","Component","withStyles","theme","width","display","alignItems","paddingTop","paddingBottom","marginTop","marginLeft","marginBottom","padding","textAlign","fontSize","tsvEditor","height","tsvEditorTextarea","fontFamily","useState","tsv","setTsv","useEffect","tsvResult","push","fields","field","data","undefined","toString","json2tsv","open","enqueueSnackbar","useSnackbar","Dialog","onClose","maxWidth","fullWidth","DialogTitle","DialogContent","DialogContentText","showPrintMargin","setOptions","firstLineNumber","mode","DialogActions","Button","color","copy","startIcon","tsv2json","endsWith","shift","success","errors","index","itemValues","itemIndex","save","DeleteAllDialog","action","DeleteDialog","disableWarnings","setDisableWarnings","DataCell","result","sortedItem","editMode","setEditMode","ref","useRef","Tooltip","inputRef","tableCheckbox","getDisable","$index","rooms","allowNone","dense","themeType","inputProps","tableSelect","tableSelectContainer","tableTextFieldContainer","tableTextField","TableCell","clsx","tableCell","nonEditMode","window","localStorage","setItem","setTimeout","current","focus","tableHeader","whiteSpace","fontWeight","tableHeaderExtended","palette","primary","light","dark","tableContainer","overflow","maxHeight","cursor","tsvDialogOpen","setTsvDialogOpen","getItem","extendedMode","setExtendedMode","deleteAllDialog","setDeleteAllDialog","deleteDialog","setDeleteDialog","sortedData","getSortedData","orderBy","order","addItem","Table","size","stickyHeader","TableHead","TableRow","filter","expert","formulaDisabled","isChecked","indeterminate","trueFound","falseFound","k","style","tooltip","newData","changeData","sorted","TableSortLabel","active","direction","isAsc","onChangeOrder","TableBody","hover","lastTime","sessionStorage","Date","deleteItem","disableDialogs","toISOString","BaseRegisters","nativeField","addressToCanonical","newItem","getFields","splice","sort","sortedItem1","sortedItem2","sort1","sort2","deviceId","showExtendedModeSwitch","isShowExtendedModeSwitch","InputRegisters","lastItem","len","factor","offset","formula","role","cw","isScale","types","roles","propTypes","PropTypes","object","isRequired","number","string","onError","func","onLoad","changed","bool","HoldingRegisters","poll","wp","DiscreteInputs","Coils","tabs","component","TabOptions","TabDiscreteInputs","icon","marginRight","TabCoils","TabInputRegisters","TabHoldingRegisters","item1","item2","App","extendedProps","encryptedFields","translations","require","moreLoaded","getEnums","selectedTab","findIndex","loaded","background","default","text","AppBar","Tabs","getSelectedTab","selectTab","scrollButtons","Tab","isIFrame","tabContentIFrame","tabContent","TabComponent","errorText","onLoadConfig","attr","cb","updateNativeValue","getIsChanged","renderError","renderSaveCloseButtons","GenericApp","root","minHeight","Boolean","location","hostname","match","themeName","getThemeName","log","version","build","ReactDOM","render","onThemeChange","_theme","document","getElementById","navigator","serviceWorker","ready","registration","unregister"],"mappings":"q37DAAMA,EAAQ,CACV,EAAG,GACH,EAAG,GACH,EAAG,GACH,EAAG,GACH,EAAG,GACH,EAAG,GACH,EAAG,EACH,EAAG,EACH,EAAG,EACH,EAAG,EACH,GAAI,EACJ,GAAI,EACJ,GAAI,EACJ,GAAI,EACJ,GAAI,EACJ,GAAI,GAEFC,EAAQ,CACV,EAAG,EACH,EAAG,EACH,EAAG,EACH,EAAG,EACH,EAAG,EACH,EAAG,EACH,EAAG,EACH,EAAG,EACH,EAAG,EACH,EAAG,EACH,GAAI,GACJ,GAAI,GACJ,GAAI,GACJ,GAAI,GACJ,GAAI,GACJ,GAAI,IAGFC,EAAU,CACZC,MAAO,EACPC,UAAW,MACXC,UAAW,MACXC,YAAa,OA8BjB,IAOeC,EAPD,CACVC,cA5BJ,SAAuBC,EAASC,GAC5B,OAAOC,SAASD,EAAS,IAAMR,EAAQO,IA4BvCG,cAzBJ,SAAuBH,EAASI,GAC5B,OAAOF,SAASE,EAAO,IAAMX,EAAQO,IAyBrCK,iBAtBJ,SAA0BL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MAAMvU,MAAK,SAAAwU,GACjCA,EAAaC,iB","file":"static/js/main.cca7ed55.chunk.js","sourcesContent":["const _rmap = {\n 0: 15,\n 1: 14,\n 2: 13,\n 3: 12,\n 4: 11,\n 5: 10,\n 6: 9,\n 7: 8,\n 8: 7,\n 9: 6,\n 10: 5,\n 11: 4,\n 12: 3,\n 13: 2,\n 14: 1,\n 15: 0\n};\nconst _dmap = {\n 0: 0,\n 1: 1,\n 2: 2,\n 3: 3,\n 4: 4,\n 5: 5,\n 6: 6,\n 7: 7,\n 8: 8,\n 9: 9,\n 10: 10,\n 11: 11,\n 12: 12,\n 13: 13,\n 14: 14,\n 15: 15\n};\n\nconst offsets = {\n coils: 1,\n disInputs: 10001,\n inputRegs: 30001,\n holdingRegs: 40001,\n};\n\nfunction address2alias(regType, address) {\n return parseInt(address, 10) + offsets[regType];\n}\n\nfunction alias2address(regType, alias) {\n return parseInt(alias, 10) - offsets[regType];\n}\n\nfunction nonDirect2direct(regType, address) {\n if (regType === 'disInputs' || regType === 'coils') {\n address = parseInt(address, 10) || 0;\n address = Math.floor(address / 16) * 16 + _dmap[address % 16];\n }\n\n return address;\n}\n\nfunction direct2nonDirect(regType, address) {\n if (regType === 'disInputs' || regType === 'coils') {\n address = parseInt(address, 10) || 0;\n address = Math.floor(address / 16) * 16 + _rmap[address % 16];\n return address;\n } else {\n return address;\n }\n}\n\nconst Utils = {\n address2alias,\n alias2address,\n nonDirect2direct,\n direct2nonDirect\n};\n\nexport default Utils;","import {Component} from 'react';\nimport PropTypes from 'prop-types';\nimport {withStyles} from '@material-ui/core/styles';\n\nimport Typography from '@material-ui/core/Typography';\nimport TextField from '@material-ui/core/TextField';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport Select from '@material-ui/core/Select';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport FormControl from '@material-ui/core/FormControl';\nimport InputLabel from '@material-ui/core/InputLabel';\nimport InputAdornment from '@material-ui/core/InputAdornment';\nimport Grid from '@material-ui/core/Grid';\nimport Paper from '@material-ui/core/Paper';\nimport Box from '@material-ui/core/Box';\nimport FormHelperText from '@material-ui/core/FormHelperText';\nimport IconButton from '@material-ui/core/IconButton';\n\nimport Utils from '../Components/Utils';\n\nimport EditIcon from '@material-ui/icons/Edit';\n\nimport I18n from '@iobroker/adapter-react/i18n';\n\nimport connectionInputs from '../data/optionsConnection';\nimport generalInputs from '../data/optionsGeneral';\n\nconst styles = theme => ({\n optionsSelect: {\n width: 280\n },\n optionsTextfield: {\n width: 280\n },\n optionContainer: {\n display: 'flex',\n alignItems: 'start',\n paddingTop: 4,\n paddingBottom: 4\n },\n helperText: {\n marginTop: -8,\n marginLeft: 32,\n marginBottom: 10\n },\n optionsContainer: {\n width: `calc(100% - ${theme.spacing(4)}px)`,\n padding: theme.spacing(2),\n display: 'inline-block',\n textAlign: 'left'\n },\n optionsGrid: {\n textAlign: 'center',\n padding: theme.spacing(2),\n },\n header: {\n fontSize: 24,\n }\n});\n\nclass Options extends Component {\n constructor(props) {\n super(props);\n\n this.state = {\n ports: null,\n customPort: false,\n ips: null,\n };\n }\n\n readPorts() {\n return this.props.socket.getState(`system.adapter.${this.props.adapterName}.${this.props.instance}.alive`)\n .then(state => {\n if (state && state.val) {\n return this.props.socket.sendTo(this.props.adapterName + '.' + this.props.instance, 'listUart', null)\n .then(list => {\n if (list && list.error) {\n console.error('Cannot read ports: ' + list.error);\n } else\n if (list && list.length === 1 && list[0] && list[0].path === 'Not available') {\n console.warn('Cannot read ports');\n } else {\n const ports = list.map(item => ({value: item.path, title: item.path + (item.manufacturer ? ' [' + item.manufacturer + ']' : '')}));\n const customPort = this.props.native.params.comName && !ports.find(item => item.value === this.props.native.params.comName);\n\n this.setState({ports, customPort});\n }\n })\n .catch(e => console.error('Cannot read ports: ' + e));\n }\n })\n .catch(e => console.error('Cannot read alive: ' + e));\n }\n\n readIPs() {\n return this.props.socket.getIpAddresses(this.props.common.host)\n .then(ips => {\n ips = ips || [];\n ips = ips.map(ip => ({value: ip, title: ip}));\n ips.unshift({value: '0.0.0.0', title: 'Listen on all IPs'});\n ips.unshift({value: '127.0.0.1', title: '127.0.0.1 (Localhost)'});\n this.setState({ips});\n })\n .catch(e => console.error('Cannot read IP addresses: ' + e));\n }\n\n componentDidMount() {\n if (this.props.native.params.type === 'serial') {\n this.readPorts();\n }\n if (this.props.native.params.type !== 'serial' && (this.props.native.params.slave === '1' || this.props.native.params.slave === 1)) {\n this.readIPs();\n }\n }\n\n inputDisabled = input => {\n if (input.name === 'slave' && this.props.native.params.type !== 'tcp') {\n return true;\n } else\n if (input.name === 'directAddresses' && !this.props.native.params.showAliases) {\n return true;\n } else\n if (input.name === 'multiDeviceId' && (this.props.native.params.slave === '1' || this.props.native.params.slave === 1)) {\n return true;\n } else\n if (input.name === 'doNotUseWriteMultipleRegisters' && this.props.native.params.onlyUseWriteMultipleRegisters) {\n return true;\n } else\n if (input.name === 'onlyUseWriteMultipleRegisters' && this.props.native.params.doNotUseWriteMultipleRegisters) {\n return true;\n } else {\n return false;\n }\n }\n\n inputDisplay = input => {\n if (['tcp', 'tcprtu'].includes(this.props.native.params.type)) {\n if (['comName', 'baudRate', 'dataBits', 'stopBits', 'parity'].includes(input.name)) {\n return false;\n }\n } else {\n if (['bind', 'port'].includes(input.name)) {\n return false;\n }\n }\n return true;\n }\n\n getInputsBlock(inputs, title) {\n return <><Paper className={this.props.classes.optionsContainer}>\n <Typography variant=\"h4\" gutterBottom className={this.props.classes.header}>{I18n.t(title)}</Typography>\n {inputs.map(input => {\n if (!this.inputDisplay(input)) {\n return null;\n } else if (input.name === 'bind' && this.props.native.params.type !== 'serial' && (this.props.native.params.slave === '1' || this.props.native.params.slave === 1)) {\n return <Box className={this.props.classes.optionContainer} key={input.name}>\n {this.state.ips ?\n <FormControl>\n <InputLabel>{I18n.t('Slave IP address')}</InputLabel>\n <Select\n className={this.props.classes.optionsSelect}\n disabled={this.inputDisabled(input)}\n value={this.props.native.params[input.name] || ''}\n onChange={e => this.changeParam(input.name, e.target.value)}\n >\n {this.state.ips.map(option =>\n <MenuItem key={option.value} value={option.value}>{option.title}</MenuItem>\n )}\n </Select>\n </FormControl>\n :\n <TextField\n type={input.type}\n label={I18n.t('Slave IP address')}\n className={this.props.classes.optionsTextfield}\n disabled={this.inputDisabled(input)}\n helperText={input.help ? I18n.t(input.help) : ''}\n value={this.props.native.params[input.name]}\n InputProps={{endAdornment: input.dimension ? <InputAdornment position=\"end\">{I18n.t(input.dimension)}</InputAdornment> : null}}\n onChange={e => this.changeParam(input.name, e.target.value)}\n />}\n </Box>;\n }\n if (input.type === 'checkbox') {\n return <FormControl className={this.props.classes.optionContainer} key={input.name}>\n <FormControlLabel\n label={I18n.t(input.title)}\n control={<Checkbox\n label={I18n.t(input.title)}\n className={this.props.classes.optionsCheckbox}\n disabled={this.inputDisabled(input)}\n checked={this.props.native.params[input.name]}\n onChange={e => this.changeParam(input.name, e.target.checked)}\n />}\n />\n {input.help ? <FormHelperText className={this.props.classes.helperText}>{I18n.t(input.help)}</FormHelperText> : null}\n {input.dimension ? I18n.t(input.dimension) : null}\n </FormControl>;\n } else if (input.type === 'select') {\n return <Box className={this.props.classes.optionContainer} key={input.name}>\n <FormControl>\n <InputLabel>{I18n.t(input.title)}</InputLabel>\n <Select\n className={this.props.classes.optionsSelect}\n disabled={this.inputDisabled(input)}\n value={this.props.native.params[input.name] || ''}\n onChange={e => this.changeParam(input.name, e.target.value)}\n >\n {input.options.map(option =>\n <MenuItem key={option.value} value={option.value}>{option.title}</MenuItem>\n )}\n </Select>\n </FormControl> {input.dimension ? I18n.t(input.dimension) : null}\n </Box>;\n } else if (input.type === 'ports') {\n return <Box className={this.props.classes.optionContainer} key={input.name}>\n {this.state.ports && !this.state.customPort ?\n <FormControl>\n <InputLabel>{I18n.t(input.title)}</InputLabel>\n <Select\n className={this.props.classes.optionsSelect}\n disabled={this.inputDisabled(input)}\n value={this.props.native.params[input.name] || ''}\n onChange={e => this.changeParam(input.name, e.target.value)}\n >\n {this.state.ports.map(option =>\n <MenuItem key={option.value} value={option.value}>{option.title}</MenuItem>\n )}\n </Select>\n </FormControl>\n :\n <TextField\n type={input.type}\n label={I18n.t(input.title)}\n className={this.props.classes.optionsTextfield}\n disabled={this.inputDisabled(input)}\n helperText={input.help ? I18n.t(input.help) : ''}\n value={this.props.native.params[input.name]}\n InputProps={{endAdornment: input.dimension ? <InputAdornment position=\"end\">{I18n.t(input.dimension)}</InputAdornment> : null}}\n onChange={e => this.changeParam(input.name, e.target.value)}\n />}\n {this.state.ports ? <IconButton onClick={() => this.setState({customPort: !this.state.customPort})}><EditIcon/></IconButton> : null}\n </Box>;\n } else {\n return <Box className={this.props.classes.optionContainer} key={input.name}>\n <TextField\n type={input.type}\n label={I18n.t(input.title)}\n className={this.props.classes.optionsTextfield}\n disabled={this.inputDisabled(input)}\n helperText={input.help ? I18n.t(input.help) : ''}\n value={this.props.native.params[input.name]}\n InputProps={{endAdornment: input.dimension ? <InputAdornment position=\"end\">{I18n.t(input.dimension)}</InputAdornment> : null}}\n onChange={e => this.changeParam(input.name, e.target.value)}\n />\n </Box>;\n }\n })\n }\n </Paper></>\n }\n\n render() {\n return <form className={ this.props.classes.tab }>\n <Grid container spacing={2} >\n <Grid item xs={12} md={6} className={ this.props.classes.optionsGrid }>{this.getInputsBlock(connectionInputs, 'Connection parameters')}</Grid>\n <Grid item xs={12} md={6} className={ this.props.classes.optionsGrid }>{this.getInputsBlock(generalInputs, 'General')}</Grid>\n </Grid>\n </form>;\n }\n\n changeParam = (name, value) => {\n let native = JSON.parse(JSON.stringify(this.props.native));\n native.params[name] = value;\n if (name === 'slave') {\n if (value === '1' || value === 1) {\n native.params.multiDeviceId = false;\n if (this.props.native.params.type !== 'serial') {\n this.readIPs();\n }\n }\n } else\n if (name === 'type') {\n if (value !== 'tcp' && (native.params.slave === 1 || native.params.slave === '1')) {\n native.params.slave = '0';\n }\n\n if (value === 'serial') {\n this.readPorts();\n }\n if (value === 'serial' && (this.props.native.params.slave === '1' || this.props.native.params.slave === 1)) {\n this.readIPs();\n }\n } else\n if (name === 'showAliases') {\n ['disInputs', 'inputRegs', 'holdingRegs', 'coils'].forEach(nativeParam => {\n native[nativeParam].forEach(item => {\n if (value) {\n item._address = Utils.address2alias(nativeParam, item._address);\n if (native.params.directAddresses) {\n item._address = Utils.nonDirect2direct(nativeParam, item._address);\n }\n } else {\n if (native.params.directAddresses) {\n item._address = Utils.direct2nonDirect(nativeParam, item._address);\n }\n item._address = Utils.alias2address(nativeParam, item._address);\n }\n });\n });\n } else\n if (name === 'directAddresses' && native.params.showAliases) {\n ['disInputs', 'coils'].forEach(nativeParam => {\n native[nativeParam].forEach(item => {\n if (value) {\n item._address = Utils.nonDirect2direct(nativeParam, item._address);\n } else {\n item._address = Utils.direct2nonDirect(nativeParam, item._address);\n }\n });\n });\n }\n this.props.changeNative(native);\n }\n}\n\nOptions.propTypes = {\n common: PropTypes.object.isRequired,\n native: PropTypes.object.isRequired,\n instance: PropTypes.number.isRequired,\n adapterName: PropTypes.string.isRequired,\n onError: PropTypes.func,\n onLoad: PropTypes.func,\n onChange: PropTypes.func,\n changed: PropTypes.bool,\n socket: PropTypes.object.isRequired,\n rooms: PropTypes.object,\n};\n\nexport default withStyles(styles)(Options);\n","import { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\nimport {withStyles} from '@material-ui/core/styles';\n\nimport { tsv2json, json2tsv } from 'tsv-json';\nimport { useSnackbar } from 'notistack';\nimport AceEditor from 'react-ace';\nimport copy from 'copy-to-clipboard';\n\nimport I18n from '@iobroker/adapter-react/i18n';\n\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport Button from '@material-ui/core/Button';\n\nimport ClearIcon from '@material-ui/icons/Clear';\nimport SaveIcon from '@material-ui/icons/Save';\nimport FileCopyIcon from '@material-ui/icons/FileCopy';\n\nconst styles = theme => ({\n tsvEditor: {\n width: '100%',\n height: 400\n },\n tsvEditorTextarea: {\n fontFamily: 'monospace'\n }\n});\n\nconst TsvDialog = props => {\n const [tsv, setTsv] = useState('');\n\n useEffect(() => {\n let tsvResult = [];\n tsvResult.push(props.fields.map(field => field.name));\n props.data.forEach(item =>\n tsvResult.push(props.fields.map(field => item[field.name] !== undefined && item[field.name] !== null ? item[field.name].toString() : ''))\n );\n setTsv(json2tsv(tsvResult));\n }, [props.open]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const { enqueueSnackbar } = useSnackbar();\n\n if (!props.open) {\n return null;\n }\n\n const saveTsv = () => {\n let data = tsv2json(tsv.endsWith('\\n') ? tsv : tsv + '\\n');\n let fields = data.shift();\n let success = true;\n let errors = [];\n for (let index in props.fields) {\n if (props.fields[index].name !== fields[index]) {\n errors.push(<>No field <i>{props.fields[index].name}</i> in position <i>{parseInt(index) + 1}</i>!</>);\n success = false;\n }\n }\n\n data = data.map((itemValues, itemIndex) => {\n let item = {};\n for (let index in props.fields) {\n if (props.fields[index].type === 'select' && !props.fields[index].options.map(option => option.value).includes(itemValues[index])) {\n errors.push(<>Value <i>{itemValues[index]}</i> is wrong for field <i>{props.fields[index].name}</i> in position <i>{parseInt(itemIndex) + 1}</i>!</>);\n success = false;\n }\n if (props.fields[index].type === 'checkbox') {\n itemValues[index] = itemValues[index] === 'true';\n }\n item[props.fields[index].name] = itemValues[index];\n }\n return item;\n });\n\n if (!success) {\n enqueueSnackbar(<div>{errors.map((error, index) => <div key={index}>{error}</div>)}</div>, { variant: 'error' });\n return;\n }\n props.save(data);\n props.onClose();\n };\n\n return <Dialog\n open={props.open}\n onClose={props.onClose}\n maxWidth=\"lg\"\n fullWidth\n >\n <DialogTitle>{I18n.t('Edit data as TSV')}</DialogTitle>\n <DialogContent>\n <DialogContentText>{I18n.t('You can copy, paste and edit data as TSV.')}</DialogContentText>\n <div>\n <AceEditor\n onChange={e => setTsv(e)}\n height=\"400px\"\n showPrintMargin={false}\n value={tsv}\n className={props.classes.tsvEditor}\n width=\"100%\"\n setOptions={{firstLineNumber: 0}}\n mode={null}\n />\n </div>\n </DialogContent>\n <DialogActions>\n <Button variant=\"outlined\" color=\"primary\" onClick={() => {\n //Utils.copyToClipboard(tsv);\n copy(tsv);\n enqueueSnackbar(I18n.t('TSV was copied to clipboard'));\n }} startIcon={<FileCopyIcon />}>{I18n.t('Copy to clipboard')}</Button>\n <Button variant=\"contained\" color=\"primary\" onClick={saveTsv} startIcon={<SaveIcon />}>{I18n.t('Import')}</Button>\n <Button variant=\"contained\" onClick={props.onClose} startIcon={<ClearIcon />}>{I18n.t('Close')}</Button>\n </DialogActions>\n </Dialog>\n};\n\nTsvDialog.propTypes = {\n open: PropTypes.bool,\n onClose: PropTypes.func,\n classes: PropTypes.object,\n save: PropTypes.func,\n fields: PropTypes.array,\n data: PropTypes.array\n};\n\nexport default withStyles(styles)(TsvDialog);","import PropTypes from 'prop-types';\n\nimport I18n from '@iobroker/adapter-react/i18n';\n\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport Button from '@material-ui/core/Button';\n\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport ClearIcon from '@material-ui/icons/Clear';\n\nconst DeleteAllDialog = (props) => {\n return props.open ? <Dialog open={props.open} onClose={props.onClose}>\n <DialogTitle>{I18n.t('Delete all items')}</DialogTitle>\n <DialogContent>\n <DialogContentText>{I18n.t('Are you sure to delete all items?')}</DialogContentText>\n <DialogActions>\n <Button variant=\"contained\" color=\"secondary\" startIcon={<DeleteIcon />} onClick={() => {\n props.action();\n props.onClose();\n }}>{I18n.t('Delete all items')}</Button>\n <Button variant=\"contained\" onClick={props.onClose} startIcon={<ClearIcon />}>{I18n.t('Cancel')}</Button>\n </DialogActions>\n </DialogContent>\n </Dialog> : null;\n}\n\nDeleteAllDialog.propTypes = {\n open: PropTypes.bool,\n action: PropTypes.func,\n onClose: PropTypes.func,\n classes: PropTypes.object,\n}\n\nexport default DeleteAllDialog;","import { useState, useEffect } from 'react';\nimport PropTypes from 'prop-types';\n\nimport I18n from '@iobroker/adapter-react/i18n';\n\nimport Dialog from '@material-ui/core/Dialog';\nimport DialogActions from '@material-ui/core/DialogActions';\nimport DialogContent from '@material-ui/core/DialogContent';\nimport DialogContentText from '@material-ui/core/DialogContentText';\nimport DialogTitle from '@material-ui/core/DialogTitle';\nimport Button from '@material-ui/core/Button';\nimport FormControlLabel from '@material-ui/core/FormControlLabel';\nimport Checkbox from '@material-ui/core/Checkbox';\n\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport ClearIcon from '@material-ui/icons/Clear';\n\nconst DeleteDialog = (props) => {\n const [disableWarnings, setDisableWarnings] = useState(false);\n useEffect(() => {\n setDisableWarnings(false);\n }, [props.open]);\n\n return props.open ? <Dialog open={props.open} onClose={props.onClose}>\n <DialogTitle>{I18n.t('Delete item')}</DialogTitle>\n <DialogContent>\n <DialogContentText>{I18n.t('Are you sure to delete item with address \"%s\"?', props.item._address)}</DialogContentText>\n <DialogContentText><FormControlLabel\n label={I18n.t('Don\\'t show this message in 5 minutes')}\n control={<Checkbox\n checked={disableWarnings}\n onChange={e => setDisableWarnings(e.target.checked)}\n />}/></DialogContentText>\n <DialogActions>\n <Button variant=\"contained\" color=\"secondary\" startIcon={<DeleteIcon />} onClick={() => {\n props.action(disableWarnings);\n props.onClose();\n }}>{I18n.t('Delete')}</Button>\n <Button variant=\"contained\" onClick={props.onClose} startIcon={<ClearIcon />}>{I18n.t('Cancel')}</Button>\n </DialogActions>\n </DialogContent>\n </Dialog> : null;\n}\n\nDeleteDialog.propTypes = {\n open: PropTypes.bool,\n onClose: PropTypes.func,\n classes: PropTypes.object,\n action: PropTypes.func,\n item: PropTypes.object,\n}\n\nexport default DeleteDialog;","import { useState, useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport {withStyles} from '@material-ui/core/styles';\n\nimport Table from '@material-ui/core/Table';\nimport TableHead from '@material-ui/core/TableHead';\nimport TableBody from '@material-ui/core/TableBody';\nimport TableRow from '@material-ui/core/TableRow';\nimport TableCell from '@material-ui/core/TableCell';\nimport Checkbox from '@material-ui/core/Checkbox';\nimport TextField from '@material-ui/core/TextField';\nimport IconButton from '@material-ui/core/IconButton';\nimport Select from '@material-ui/core/Select';\nimport MenuItem from '@material-ui/core/MenuItem';\nimport TableSortLabel from '@material-ui/core/TableSortLabel';\nimport Tooltip from '@material-ui/core/Tooltip';\n\nimport DeleteIcon from '@material-ui/icons/Delete';\nimport AddIcon from '@material-ui/icons/Add';\nimport ImportExport from '@material-ui/icons/ImportExport';\n\nimport I18n from '@iobroker/adapter-react/i18n';\nimport Utils from '@iobroker/adapter-react/Components/Utils';\n\nimport ExpertIcon from '@iobroker/adapter-react/icons/IconExpert';\nimport TextWithIcon from '@iobroker/adapter-react/Components/TextWithIcon';\nimport SelectWithIcon from '@iobroker/adapter-react/Components/SelectWithIcon';\n\nimport TsvDialog from './TsvDialog';\nimport DeleteAllDialog from './DeleteAllDialog';\nimport DeleteDialog from './DeleteDialog';\n\nconst styles = theme => ({\n tableHeader: {\n whiteSpace: 'nowrap',\n fontWeight: 'bold',\n fontSize: '80%',\n padding: '0px 8px'\n },\n tableHeaderExtended: {\n color: theme.palette.type === 'dark' ? theme.palette.primary.light : theme.palette.primary.dark\n },\n tableCell: {\n whiteSpace: 'nowrap',\n fontSize: '80%',\n padding: '0px 8px'\n },\n tableContainer: {\n overflow: 'auto',\n maxHeight: 'calc(100vh - 180px)'\n },\n tableTextField: {\n fontSize: '80%'\n },\n tableSelect: {\n fontSize: '80%'\n },\n tableTextFieldContainer: {\n width: '100%'\n },\n tableSelectContainer: {\n width: '100%'\n },\n nonEditMode: {\n cursor: 'pointer'\n }\n});\n\nconst DataCell = props => {\n const sortedItem = props.sortedItem;\n const field = props.field;\n const editMode = props.editMode;\n const setEditMode = props.setEditMode;\n\n const ref = useRef();\n\n let item = sortedItem.item;\n let result;\n if (field.type === 'checkbox') {\n result = <Tooltip title={I18n.t(field.title)}>\n <Checkbox\n inputRef={ref}\n className={props.classes.tableCheckbox}\n checked={!!item[field.name]}\n disabled={props.getDisable(sortedItem.$index, field.name)}\n onChange={e => props.changeParam(sortedItem.$index, field.name, e.target.checked)}\n />\n </Tooltip>;\n } else if (field.type === 'rooms') {\n if (!editMode) {\n result = <TextWithIcon list={props.rooms} value={item[field.name]} themeType={props.themeType}/>;\n } else {\n result = <SelectWithIcon\n list={props.rooms}\n allowNone={true}\n value={item[field.name] === undefined || item[field.name] === null ? '' : item[field.name]}\n dense={true}\n themeType={props.themeType}\n inputProps={{ref, className: props.classes.tableSelect}}\n disabled={props.getDisable(sortedItem.$index, field.name)}\n onChange={value => props.changeParam(sortedItem.$index, field.name, value)}\n className={props.classes.tableSelectContainer}\n />;\n }\n } else if (field.type === 'select') {\n if (!editMode) {\n let option = field.options.find(option => option.value === item[field.name]);\n result = option ? option.title : '';\n } else {\n result = <Select\n value={item[field.name] === undefined || item[field.name] === null ? '' : item[field.name]}\n inputProps={{ref, className: props.classes.tableSelect}}\n disabled={props.getDisable(sortedItem.$index, field.name)}\n onChange={e => props.changeParam(sortedItem.$index, field.name, e.target.value)}\n className={props.classes.tableSelectContainer}\n >\n {field.options.map(option =>\n <MenuItem key={option.value} value={option.value}>{option.title ? option.title : <i>{I18n.t('Nothing')}</i>}</MenuItem>\n )}\n </Select>;\n }\n } else {\n if (!editMode) {\n result = item[field.name] ? item[field.name] : null;\n } else {\n result = <TextField\n value={item[field.name] === undefined || item[field.name] === null ? '' : item[field.name]}\n className={props.classes.tableTextFieldContainer}\n inputProps={{ref: ref, className: props.classes.tableTextField}}\n type={field.type}\n onChange={e => props.changeParam(sortedItem.$index, field.name, e.target.value)}\n disabled={props.getDisable(sortedItem.$index, field.name)}\n />;\n }\n }\n\n return <TableCell\n className={Utils.clsx(props.classes.tableCell, !editMode && props.classes.nonEditMode)}\n onClick={e => {\n setEditMode(true);\n window.localStorage.setItem('Modbus.editMode', 'true');\n window.setTimeout(() => ref.current && ref.current.focus(), 100);\n }}\n >\n {result}\n </TableCell>;\n}\n\nconst RegisterTable = props => {\n const [tsvDialogOpen, setTsvDialogOpen] = useState(false);\n const [editMode, setEditMode] = useState(parseInt(window.localStorage.getItem('Modbus.editMode'), 10) || 0);\n const [extendedMode, setExtendedMode] = useState(window.localStorage.getItem('Modbus.extendedMode') === 'true');\n const [deleteAllDialog, setDeleteAllDialog] = useState({\n open: false,\n action: null,\n });\n const [deleteDialog, setDeleteDialog] = useState({\n open: false,\n item: null,\n action: null,\n });\n\n let sortedData = props.getSortedData(props.data, props.orderBy, props.order);\n\n return <div>\n <div>\n <Tooltip title={I18n.t('Add line')}>\n <IconButton onClick={e => {\n props.addItem();\n }}>\n <AddIcon/>\n </IconButton>\n </Tooltip>\n <Tooltip title={I18n.t('Edit as TSV (Tab separated values)')}>\n <IconButton onClick={() => setTsvDialogOpen(true)}>\n <ImportExport/>\n </IconButton>\n </Tooltip>\n <Tooltip title={I18n.t('Toggle extended mode')}>\n <IconButton\n color={extendedMode ? 'primary' : 'inherit'}\n onClick={() => {\n window.localStorage.setItem('Modbus.extendedMode', extendedMode ? 'false' : 'true');\n setExtendedMode(!extendedMode);\n }}>\n <ExpertIcon/>\n </IconButton>\n </Tooltip>\n </div>\n <div className={props.classes.tableContainer}>\n <Table size=\"small\"\n stickyHeader\n padding=\"none\"\n >\n <TableHead>\n <TableRow>\n {props.fields.filter(item => (extendedMode || !item.expert) && (!props.formulaDisabled || !item.formulaDisabled)).map(field => {\n let isChecked = false;\n let indeterminate = false;\n let trueFound = false;\n let falseFound = false;\n for (let k in props.data) {\n if (props.data[k][field.name]) {\n isChecked = true;\n trueFound = true;\n } else {\n isChecked = false;\n falseFound = true;\n }\n\n if (trueFound && falseFound) {\n indeterminate = true;\n isChecked = false;\n break;\n }\n }\n\n return <TableCell\n key={field.name}\n style={{width: field.type === 'checkbox' ? 20 : field.width}}\n className={Utils.clsx(props.classes.tableHeader, field.expert && props.classes.tableHeaderExtended)}\n title={field.tooltip ? I18n.t(field.tooltip) : null}\n >\n {field.type === 'checkbox' ?\n <Tooltip title={I18n.t('Change all')}>\n <Checkbox\n indeterminate={indeterminate}\n checked={isChecked}\n onChange={e => {\n let newData = JSON.parse(JSON.stringify(props.data));\n newData.forEach(item =>\n item[field.name] = e.target.checked);\n props.changeData(newData);\n }}\n />\n </Tooltip>\n : null}\n {field.sorted ? <TableSortLabel\n active={field.name === props.orderBy}\n direction={props.order}\n onClick={e => {\n const isAsc = props.orderBy === field.name && props.order === 'asc';\n props.onChangeOrder(field.name, isAsc ? 'desc' : 'asc');\n }}\n >{I18n.t(field.title)}</TableSortLabel> : I18n.t(field.title)}\n </TableCell>\n })}\n <TableCell>\n <Tooltip title={I18n.t('Delete all')}>\n <div>\n <IconButton\n size=\"small\"\n onClick={e => setDeleteAllDialog({\n open: true,\n action: () => props.changeData([]),\n })}\n disabled={!props.data.length}\n >\n <DeleteIcon/>\n </IconButton>\n </div>\n </Tooltip>\n </TableCell>\n </TableRow>\n </TableHead>\n <TableBody>\n {\n sortedData.map(sortedItem =>\n <TableRow hover key={sortedItem.$index}>\n {props.fields.filter(item => (extendedMode || !item.expert) && (!props.formulaDisabled || !item.formulaDisabled)).map(field =>\n <DataCell\n key={field.name}\n themeType={props.themeType}\n sortedItem={sortedItem}\n field={field}\n editMode={editMode === sortedItem.$index}\n rooms={props.rooms}\n setEditMode={() => setEditMode(sortedItem.$index)}\n {...props}\n />\n )}\n <TableCell>\n <Tooltip title={I18n.t('Delete')}>\n <div>\n <IconButton size=\"small\" onClick={e => {\n let lastTime = window.sessionStorage.getItem('disableDeleteDialogs');\n if (lastTime && (new Date() - new Date(lastTime)) < 1000 * 60 * 5) {\n props.deleteItem(sortedItem.$index);\n return;\n }\n setDeleteDialog({\n open: true,\n action: disableDialogs => {\n if (disableDialogs) {\n window.sessionStorage.setItem('disableDeleteDialogs', (new Date()).toISOString());\n }\n props.deleteItem(sortedItem.$index);\n },\n item: sortedItem.item\n })\n }}>\n <DeleteIcon/>\n </IconButton>\n </div>\n </Tooltip>\n </TableCell>\n </TableRow>\n )\n }\n </TableBody>\n </Table>\n </div>\n {tsvDialogOpen ? <TsvDialog\n open={true}\n save={props.changeData}\n onClose={() => setTsvDialogOpen(false)}\n data={props.data}\n fields={props.fields}\n /> : null}\n <DeleteAllDialog\n open={deleteAllDialog.open}\n action={deleteAllDialog.action}\n onClose={() => setDeleteAllDialog({\n open: false,\n action: null,\n })}\n />\n <DeleteDialog\n open={deleteDialog.open}\n action={deleteDialog.action}\n onClose={() => setDeleteDialog({\n open: false,\n action: null,\n item: null\n })}\n item={deleteDialog.item}\n />\n </div>;\n}\n\nRegisterTable.propTypes = {\n data: PropTypes.array,\n fields: PropTypes.array,\n classes: PropTypes.object,\n addItem: PropTypes.func,\n changeData: PropTypes.func,\n deleteItem: PropTypes.func,\n rooms: PropTypes.object,\n formulaDisabled: PropTypes.bool,\n onChangeOrder: PropTypes.func,\n getSortedData: PropTypes.func,\n themeType: PropTypes.string,\n showExtendedModeSwitch: PropTypes.bool,\n}\n\nexport default withStyles(styles)(RegisterTable);","import {Component} from 'react';\nimport PropTypes from 'prop-types';\n\nimport Paper from '@material-ui/core/Paper';\n\nimport RegisterTable from '../Components/RegisterTable';\nimport Utils from '../Components/Utils';\n\nclass BaseRegisters extends Component {\n constructor(props) {\n super(props);\n this.nativeField = '';\n this.state = {\n order: window.localStorage.getItem('Modbus.order') || 'asc',\n orderBy: window.localStorage.getItem('Modbus.orderBy') || '_address',\n };\n }\n\n componentDidMount() {\n if (!window.localStorage.getItem('Modbus.orderBy')) {\n this.fields = this.fields || this.getFields();\n const isSlaveIDPresent = !!this.fields.find(item => item.name === 'deviceId');\n const orderBy = isSlaveIDPresent ? 'deviceId' : '_address';\n\n if (orderBy !== this.state.orderBy) {\n this.setState({orderBy});\n }\n }\n }\n\n isShowExtendedModeSwitch() {\n return true;\n }\n\n getFields() {\n return null;\n }\n\n addressToCanonical(_address) {\n let address = _address;\n let params = this.props.native.params;\n if (params.showAliases) {\n if (params.directAddresses) {\n address = Utils.direct2nonDirect(this.nativeField, address);\n }\n address = Utils.alias2address(this.nativeField, address);\n }\n return address;\n }\n\n changeParam = (index, name, value) => {\n let data = JSON.parse(JSON.stringify(this.props.native[this.nativeField]));\n data[index][name] = value;\n if (name === '_address') {\n data[index]['address'] = this.addressToCanonical(value);\n }\n this.props.onChange(this.nativeField, data);\n }\n\n addItem = () => {\n let data = JSON.parse(JSON.stringify(this.props.native[this.nativeField]));\n let newItem = {};\n this.getFields().forEach(field => newItem[field.name] = '');\n data.push(newItem);\n this.props.onChange(this.nativeField, data);\n }\n\n deleteItem = index => {\n let data = JSON.parse(JSON.stringify(this.props.native[this.nativeField]));\n data.splice(index, 1);\n this.props.onChange(this.nativeField, data);\n }\n\n changeData = data => {\n this.props.onChange(this.nativeField, data);\n }\n\n getDisable = (index, name) => {\n return false;\n }\n\n getSortedData = (data, orderBy, order) => {\n data = data || this.props.native[this.nativeField];\n orderBy = orderBy || this.state.orderBy;\n order = order || this.state.order;\n let sortedData = [];\n data.forEach((item, index) => {sortedData[index] = {item, $index: index}});\n const field = this.fields.find(item => item.name === orderBy);\n\n sortedData.sort((sortedItem1, sortedItem2) => {\n let sort1;\n let sort2;\n if (orderBy === 'deviceId') {\n sort1 = (parseInt(sortedItem1.item.deviceId, 10) << 16) | parseInt(sortedItem1.item._address, 10);\n sort2 = (parseInt(sortedItem2.item.deviceId, 10) << 16) | parseInt(sortedItem2.item._address, 10);\n } else if (orderBy === '$index') {\n sort1 = sortedItem1[orderBy];\n sort2 = sortedItem2[orderBy];\n } else if (field && field.type === 'number') {\n sort1 = parseInt(sortedItem1.item[orderBy], 10);\n sort2 = parseInt(sortedItem2.item[orderBy], 10);\n } else {\n sort1 = sortedItem1.item[orderBy];\n sort2 = sortedItem2.item[orderBy];\n }\n return (order === 'asc' ? sort1 > sort2 : sort1 < sort2) ? 1 : -1;\n });\n\n return sortedData;\n }\n\n render() {\n this.fields = this.fields || this.getFields();\n\n return <Paper>\n <RegisterTable\n fields={this.fields}\n data={this.props.native[this.nativeField]}\n getSortedData={this.getSortedData}\n showExtendedModeSwitch={this.isShowExtendedModeSwitch()}\n changeParam={this.changeParam}\n addItem={this.addItem}\n deleteItem={this.deleteItem}\n changeData={this.changeData}\n getDisable={this.getDisable}\n formulaDisabled={this.props.formulaDisabled}\n rooms={this.props.rooms}\n order={this.state.order}\n orderBy={this.state.orderBy}\n onChangeOrder={(orderBy, order) => {\n this.setState({orderBy, order});\n window.localStorage.setItem('Modbus.orderBy', orderBy);\n window.localStorage.setItem('Modbus.order', order);\n }}\n />\n </Paper>;\n }\n}\n\nBaseRegisters.propTypes = {\n common: PropTypes.object.isRequired,\n native: PropTypes.object.isRequired,\n instance: PropTypes.number.isRequired,\n adapterName: PropTypes.string.isRequired,\n onError: PropTypes.func,\n onLoad: PropTypes.func,\n onChange: PropTypes.func,\n changed: PropTypes.bool,\n socket: PropTypes.object.isRequired,\n rooms: PropTypes.object,\n formulaDisabled: PropTypes.bool,\n};\n\nexport default BaseRegisters;\n","import PropTypes from 'prop-types';\n\nimport types from '../data/types';\nimport roles from '../data/roles';\n\nimport BaseRegisters from './BaseRegisters';\n\nclass InputRegisters extends BaseRegisters {\n nativeField = 'inputRegs';\n\n getFields() {\n let result = [\n {name: '_address', title: 'Address', type: 'number', sorted: true, width: 20},\n {name: 'name', title: 'Name', type: 'text', sorted: true},\n {name: 'description', title: 'Description', type: 'text', sorted: true},\n {name: 'unit', title: 'Unit', type: 'text', width: 30},\n {name: 'type', title: 'Type', type: 'select', options: types, sorted: true},\n {name: 'len', title: 'Length', type: 'text', width: 20},\n {name: 'factor', title: 'Factor', type: 'text', width: 20, expert: true},\n {name: 'offset', title: 'Offset', type: 'text', width: 20, expert: true},\n {name: 'formula', title: 'Formula', type: 'text', formulaDisabled: true, expert: true},\n {name: 'role', title: 'Role', type: 'select', options: roles, sorted: true},\n {name: 'room', title: 'Room', type: 'rooms'},\n {name: 'cw', title: 'CW', type: 'checkbox', tooltip: 'Cyclic write'},\n {name: 'isScale', title: 'SF', type: 'checkbox', tooltip: 'Store this value as scaling factor', expert: true, formulaDisabled: true},\n ];\n\n if (this.props.native.params.multiDeviceId) {\n result.splice(1, 0,\n {name: 'deviceId', title: 'Slave ID', type: 'number', sorted: true, width: 20},\n );\n }\n\n return result;\n }\n\n addItem = () => {\n let data = JSON.parse(JSON.stringify(this.props.native[this.nativeField]));\n let newItem = {}\n this.getFields().forEach(field => newItem[field.name] = '')\n if (data.length) {\n let sortedData = this.getSortedData();\n let lastItem = sortedData[sortedData.length - 1].item;\n newItem._address = parseInt(lastItem._address, 10) + (lastItem.len ? parseInt(lastItem.len, 10) : 1);\n while(sortedData.find(item => item.item._address >= newItem._address && item.item._address + parseInt(item.item.len || 1, 10) < newItem._address)) {\n newItem._address++;\n }\n newItem.deviceId = lastItem.deviceId;\n newItem.type = lastItem.type;\n newItem.len = lastItem.len;\n newItem.factor = lastItem.factor;\n newItem.offset = lastItem.offset;\n newItem.formula = lastItem.formula;\n newItem.role = lastItem.role;\n newItem.cw = lastItem.cw;\n newItem.isScale = lastItem.isScale;\n } else {\n newItem.role = 'level';\n newItem.factor = 1;\n newItem.offset = 0;\n newItem._address = this.props.native.params.showAliases ? 30001 : 0;\n }\n newItem.address = this.addressToCanonical(newItem._address);\n data.push(newItem);\n this.props.onChange(this.nativeField, data);\n }\n\n getDisable = (index, name) => {\n if (name === 'len') {\n if (!['string', 'stringle'].includes(this.props.native[this.nativeField][index].type)) {\n return true;\n }\n }\n return false;\n }\n\n changeParam = (index, name, value) => {\n let data = JSON.parse(JSON.stringify(this.props.native[this.nativeField]));\n data[index][name] = value;\n if (name === 'type') {\n if (['', 'uint16be', 'uint16le', 'int16be', 'int16le', 'uint8be', 'uint8le', 'int8be', 'int8le'].includes(value)) {\n data[index].len = 1;\n }\n if (['uint32be', 'uint32le', 'uint32sw', 'uint32sb', 'int32be', 'int32le', 'int32sw', 'int32sb', 'floatbe', 'floatle', 'floatsw', 'floatsb', 'string', 'stringle'].includes(value)) {\n data[index].len = 2;\n }\n if (['uint64be', 'uint64le', 'doublebe', 'doublele'].includes(value)) {\n data[index].len = 4;\n }\n }\n\n if (name === '_address') {\n data[index]['address'] = this.addressToCanonical(value);\n }\n\n this.props.onChange(this.nativeField, data);\n }\n}\n\nInputRegisters.propTypes = {\n common: PropTypes.object.isRequired,\n native: PropTypes.object.isRequired,\n instance: PropTypes.number.isRequired,\n adapterName: PropTypes.string.isRequired,\n onError: PropTypes.func,\n onLoad: PropTypes.func,\n onChange: PropTypes.func,\n changed: PropTypes.bool,\n socket: PropTypes.object.isRequired,\n rooms: PropTypes.object,\n};\n\nexport default InputRegisters;\n","import PropTypes from 'prop-types';\n\nimport BaseRegisters from './BaseRegisters';\n\nimport roles from '../data/roles';\nimport types from '../data/types';\n\nclass HoldingRegisters extends BaseRegisters {\n nativeField = 'holdingRegs';\n\n getFields() {\n //let rooms = this.getRooms();\n //rooms.unshift({value: '', title: ''});\n\n let result = [\n {name: '_address', title: 'Address', type: 'number', sorted: true, width: 20},\n {name: 'name', title: 'Name', type: 'text', sorted: true},\n {name: 'description', title: 'Description', type: 'text', sorted: true},\n {name: 'unit', title: 'Unit', type: 'text', width: 30},\n {name: 'type', title: 'Type', type: 'select', options: types, sorted: true},\n {name: 'len', title: 'Length', type: 'text', width: 20},\n {name: 'factor', title: 'Factor', type: 'text', width: 20, expert: true},\n {name: 'offset', title: 'Offset', type: 'text', width: 20, expert: true},\n {name: 'formula', title: 'Formula', type: 'text', expert: true, formulaDisabled: true},\n {name: 'role', title: 'Role', type: 'select', options: roles, sorted: true},\n {name: 'room', title: 'Room', type: 'rooms'},\n {name: 'poll', title: 'Poll', type: 'checkbox', tooltip: 'Enable polling of data point'},\n {name: 'wp', title: 'WP', type: 'checkbox', tooltip: 'Write pulses (true → false edge)', expert: true},\n {name: 'cw', title: 'CW', type: 'checkbox', tooltip: 'Cyclic write'},\n {name: 'isScale', title: 'SF', type: 'checkbox', tooltip: 'Store this value as scaling factor', expert: true, formulaDisabled: true},\n ];\n\n if (this.props.native.params.multiDeviceId) {\n result.splice(1, 0,\n {name: 'deviceId', title: 'Slave ID', type: 'number', sorted: true, width: 20},\n );\n }\n\n return result;\n }\n\n addItem = () => {\n let data = JSON.parse(JSON.stringify(this.props.native[this.nativeField]));\n let newItem = {}\n this.getFields().forEach(field => newItem[field.name] = '');\n if (data.length) {\n let sortedData = this.getSortedData();\n let lastItem = sortedData[sortedData.length - 1].item;\n newItem._address = parseInt(lastItem._address, 10) + (lastItem.len ? parseInt(lastItem.len, 10) : 1);\n while(sortedData.find(item => item.item._address >= newItem._address && item.item._address + parseInt(item.item.len || 1, 10) < newItem._address)) {\n newItem._address++;\n }\n newItem.deviceId = lastItem.deviceId;\n newItem.type = lastItem.type;\n newItem.len = (lastItem.len ? parseInt(lastItem.len) : 1);\n newItem.factor = lastItem.factor;\n newItem.offset = lastItem.offset;\n newItem.formula = lastItem.formula;\n newItem.role = lastItem.role;\n newItem.poll = lastItem.poll;\n newItem.wp = lastItem.wp;\n newItem.cw = lastItem.cw;\n newItem.isScale = lastItem.isScale;\n } else {\n newItem.role = 'level';\n newItem.factor = 1;\n newItem.offset = 0;\n newItem._address = this.props.native.params.showAliases ? 40001 : 0;\n }\n newItem.address = this.addressToCanonical(newItem._address);\n data.push(newItem);\n this.props.onChange(this.nativeField, data);\n }\n\n getDisable = (index, name) => {\n return name === 'len' &&\n !['string', 'stringle'].includes(this.props.native[this.nativeField][index].type);\n }\n\n changeParam = (index, name, value) => {\n let data = JSON.parse(JSON.stringify(this.props.native[this.nativeField]));\n\n data[index][name] = value;\n\n if (name === 'type') {\n if (['', 'uint16be', 'uint16le', 'int16be', 'int16le', 'uint8be', 'uint8le', 'int8be', 'int8le'].includes(value)) {\n data[index].len = 1;\n } else\n if (['uint32be', 'uint32le', 'uint32sw', 'uint32sb', 'int32be', 'int32le', 'int32sw', 'int32sb', 'floatbe', 'floatle', 'floatsw', 'floatsb', 'string', 'stringle'].includes(value)) {\n data[index].len = 2;\n } else\n if (['uint64be', 'uint64le', 'doublebe', 'doublele'].includes(value)) {\n data[index].len = 4;\n }\n }\n\n if (name === '_address') {\n data[index]['address'] = this.addressToCanonical(value);\n }\n\n this.props.onChange(this.nativeField, data);\n }\n}\n\nHoldingRegisters.propTypes = {\n common: PropTypes.object.isRequired,\n native: PropTypes.object.isRequired,\n instance: PropTypes.number.isRequired,\n adapterName: PropTypes.string.isRequired,\n onError: PropTypes.func,\n onLoad: PropTypes.func,\n onChange: PropTypes.func,\n changed: PropTypes.bool,\n socket: PropTypes.object.isRequired,\n rooms: PropTypes.object,\n};\n\nexport default HoldingRegisters;\n","import PropTypes from 'prop-types';\n\nimport roles from '../data/roles';\n\nimport BaseRegisters from './BaseRegisters';\n\nclass DiscreteInputs extends BaseRegisters {\n nativeField = 'disInputs';\n\n getFields() {\n let result = [\n {name: '_address', title: 'Address', type: 'number', sorted: true, width: 20},\n {name: 'name', title: 'Name', type: 'text', sorted: true},\n {name: 'description', title: 'Description', type: 'text', sorted: true},\n {name: 'formula', title: 'Formula', type: 'text', expert: true, formulaDisabled: true},\n {name: 'role', title: 'Role', type: 'select', options: roles, sorted: true},\n {name: 'room', title: 'Room', type: 'rooms'},\n {name: 'cw', title: 'CW', type: 'checkbox', tooltip: 'Cyclic write'},\n {name: 'isScale', title: 'SF', type: 'checkbox', tooltip: 'Store this value as scaling factor', expert: true, formulaDisabled: true},\n ];\n\n if (this.props.native.params.multiDeviceId) {\n result.splice(1, 0,\n {name: 'deviceId', title: 'Slave ID', type: 'number', sorted: true, width: 20},\n );\n }\n\n return result;\n }\n\n isShowExtendedModeSwitch() {\n return this.props.native.params.slave !== 1 && this.props.native.params.slave !== '1';\n }\n\n addItem = () => {\n let data = JSON.parse(JSON.stringify(this.props.native[this.nativeField]));\n let newItem = {}\n this.getFields().forEach(field => newItem[field.name] = '')\n if (data.length) {\n let sortedData = this.getSortedData();\n let lastItem = sortedData[sortedData.length - 1].item;\n newItem._address = parseInt(lastItem._address, 10) + 1;\n while(sortedData.find(item => item.item._address === newItem._address)) {\n newItem._address++;\n }\n newItem.deviceId = lastItem.deviceId;\n newItem.formula = lastItem.formula;\n newItem.role = lastItem.role;\n newItem.cw = lastItem.cw;\n newItem.isScale = lastItem.isScale;\n } else {\n newItem.role = 'level';\n newItem._address = this.props.native.params.showAliases ? 10001 : 0;\n }\n newItem.address = this.addressToCanonical(newItem._address);\n data.push(newItem);\n this.props.onChange(this.nativeField, data);\n }\n}\n\nDiscreteInputs.propTypes = {\n common: PropTypes.object.isRequired,\n native: PropTypes.object.isRequired,\n instance: PropTypes.number.isRequired,\n adapterName: PropTypes.string.isRequired,\n onError: PropTypes.func,\n onLoad: PropTypes.func,\n onChange: PropTypes.func,\n changed: PropTypes.bool,\n socket: PropTypes.object.isRequired,\n rooms: PropTypes.object,\n};\n\nexport default DiscreteInputs;\n","import PropTypes from 'prop-types';\n\nimport roles from '../data/roles';\n\nimport BaseRegisters from './BaseRegisters';\n\nclass Coils extends BaseRegisters {\n nativeField = 'coils';\n\n getFields() {\n let result = [\n {name: '_address', title: 'Address', type: 'number', sorted: true, width: 20},\n {name: 'name', title: 'Name', type: 'text', sorted: true},\n {name: 'description', title: 'Description', type: 'text', sorted: true},\n {name: 'formula', title: 'Formula', type: 'text', expert: true, formulaDisabled: true},\n {name: 'role', title: 'Role', type: 'select', options: roles, sorted: true},\n {name: 'room', title: 'Room', type: 'rooms'},\n {name: 'poll', title: 'Poll', type: 'checkbox'},\n {name: 'wp', title: 'WP', type: 'checkbox', expert: true},\n {name: 'cw', title: 'CW', type: 'checkbox'},\n {name: 'isScale', title: 'SF', type: 'checkbox', tooltip: 'Store this value as scaling factor', expert: true, formulaDisabled: true},\n ];\n\n if (this.props.native.params.multiDeviceId) {\n result.splice(1, 0,\n {name: 'deviceId', title: 'Slave ID', type: 'number', sorted: true, width: 20},\n );\n }\n\n return result;\n }\n\n addItem = () => {\n let data = JSON.parse(JSON.stringify(this.props.native[this.nativeField]));\n let newItem = {}\n this.getFields().forEach(field => newItem[field.name] = '');\n if (data.length) {\n let sortedData = this.getSortedData();\n let lastItem = sortedData[sortedData.length - 1].item;\n newItem._address = parseInt(lastItem._address, 10) + 1;\n while(sortedData.find(item => item.item._address === newItem._address)) {\n newItem._address++;\n }\n newItem.deviceId = lastItem.deviceId;\n newItem.formula = lastItem.formula;\n newItem.role = lastItem.role;\n newItem.poll = lastItem.poll;\n newItem.wp = lastItem.wp;\n newItem.cw = lastItem.cw;\n newItem.isScale = lastItem.isScale;\n } else {\n newItem.role = 'level';\n newItem._address = this.props.native.params.showAliases ? 1 : 0;\n }\n newItem.address = this.addressToCanonical(newItem._address);\n data.push(newItem);\n this.props.onChange(this.nativeField, data);\n }\n}\n\nCoils.propTypes = {\n common: PropTypes.object.isRequired,\n native: PropTypes.object.isRequired,\n instance: PropTypes.number.isRequired,\n adapterName: PropTypes.string.isRequired,\n onError: PropTypes.func,\n onLoad: PropTypes.func,\n onChange: PropTypes.func,\n changed: PropTypes.bool,\n socket: PropTypes.object.isRequired,\n rooms: PropTypes.object,\n};\n\nexport default Coils;\n","import React from 'react';\nimport {withStyles} from '@material-ui/core/styles';\nimport { MuiThemeProvider } from '@material-ui/core/styles';\nimport { SnackbarProvider } from 'notistack';\n\nimport AppBar from '@material-ui/core/AppBar';\nimport Tabs from '@material-ui/core/Tabs';\nimport Tab from '@material-ui/core/Tab';\n\nimport {AiOutlineFieldBinary as BinaryIcon} from 'react-icons/all';\nimport {TiSortNumerically as DigitsIcon} from 'react-icons/all';\n\nimport GenericApp from '@iobroker/adapter-react/GenericApp';\nimport Loader from '@iobroker/adapter-react/Components/Loader'\nimport I18n from '@iobroker/adapter-react/i18n';\n\nimport TabOptions from './Tabs/Options';\nimport TabInputRegisters from './Tabs/InputRegisters';\nimport TabHoldingRegisters from './Tabs/HoldingRegisters';\nimport TabDiscreteInputs from './Tabs/DiscreteInputs';\nimport TabCoils from './Tabs/Coils';\n\nconst styles = theme => ({\n root: {},\n tabContent: {\n padding: 10,\n height: 'calc(100% - 64px - 48px - 20px)',\n overflow: 'auto',\n },\n tabContentIFrame: {\n padding: 10,\n height: 'calc(100% - 64px - 48px - 20px - 38px)',\n overflow: 'auto'\n },\n tab: {\n width: '100%',\n minHeight: '100%'\n }\n});\n\nconst tabs = [\n {\n name: 'general',\n title: 'General',\n component: TabOptions,\n },\n {\n name: 'discrete-inputs',\n title: 'Discrete inputs',\n component: TabDiscreteInputs,\n icon: <BinaryIcon style={{width: 18, height: 18, marginRight: 4, display: 'inline-block'}}/>,\n tooltip: 'Binary inputs (read-only)'\n },\n {\n name: 'coils',\n title: 'Coils',\n component: TabCoils,\n icon: <BinaryIcon style={{width: 18, height: 18, marginRight: 4, display: 'inline-block'}}/>,\n tooltip: 'Binary inputs and outputs'\n },\n {\n name: 'input-registers',\n title: 'Input Registers',\n component: TabInputRegisters,\n icon: <DigitsIcon style={{width: 18, height: 18, marginRight: 4, display: 'inline-block'}}/>,\n tooltip: 'Input registers (8-64 bit values, read-only)'\n },\n {\n name: 'holding-registers',\n title: 'Holding Registers',\n component: TabHoldingRegisters,\n icon: <DigitsIcon style={{width: 18, height: 18, marginRight: 4, display: 'inline-block'}}/>,\n tooltip: 'Input/output registers (8-64 bit values)'\n },\n];\n\nfunction sort(data) {\n data.sort((item1, item2) => {\n item1.deviceId = parseInt(item1.deviceId, 10) || 1;\n item2.deviceId = parseInt(item2.deviceId, 10) || 1;\n item1._address = parseInt(item1._address, 10) || 0;\n item2._address = parseInt(item2._address, 10) || 0;\n const sort1 = (parseInt(item1.deviceId, 10) << 16) | parseInt(item1._address, 10);\n const sort2 = (parseInt(item2.deviceId, 10) << 16) | parseInt(item2._address, 10);\n return sort1 < sort2 ? -1 : (sort1 > sort2 ? 1 : 0);\n });\n}\n\nclass App extends GenericApp {\n constructor(props) {\n const extendedProps = {...props};\n extendedProps.encryptedFields = ['pass'];\n\n extendedProps.translations = {\n 'en': require('./i18n/en'),\n 'de': require('./i18n/de'),\n 'ru': require('./i18n/ru'),\n 'pt': require('./i18n/pt'),\n 'nl': require('./i18n/nl'),\n 'fr': require('./i18n/fr'),\n 'it': require('./i18n/it'),\n 'es': require('./i18n/es'),\n 'pl': require('./i18n/pl'),\n 'zh-cn': require('./i18n/zh-cn'),\n };\n\n super(props, extendedProps);\n this.state.moreLoaded = false;\n this.state.rooms = null;\n }\n\n onPrepareSave(native) {\n // sort all arraysby device:address\n native.disInputs && sort(native.disInputs);\n native.coils && sort(native.coils);\n native.inputRegs && sort(native.inputRegs);\n native.holdingRegs && sort(native.holdingRegs);\n\n return native;\n }\n\n onConnectionReady() {\n super.onConnectionReady();\n\n this.socket.getEnums('rooms')\n .then(rooms =>\n this.setState({moreLoaded: true, rooms}));\n }\n\n getSelectedTab() {\n const selectedTab = this.state.selectedTab;\n if (!selectedTab) {\n return 0;\n } else {\n return tabs.findIndex(tab => tab.name === selectedTab);\n }\n }\n\n render() {\n if (!this.state.loaded || !this.state.moreLoaded) {\n return <MuiThemeProvider theme={this.state.theme}>\n <Loader theme={this.state.themeType} />\n </MuiThemeProvider>;\n }\n\n return <MuiThemeProvider theme={this.state.theme}>\n <SnackbarProvider>\n <div className=\"App\" style={{background: this.state.theme.palette.background.default, color: this.state.theme.palette.text.primary}}>\n <AppBar position=\"static\">\n <Tabs\n value={this.getSelectedTab()}\n onChange={(e, index) => this.selectTab(tabs[index].name, index)}\n variant=\"scrollable\" scrollButtons=\"auto\">\n {tabs.map(tab => <Tab\n label={tab.icon ? <>{tab.icon}{I18n.t(tab.title)}</> : I18n.t(tab.title)}\n data-name={tab.name}\n key={tab.name}\n title={tab.tooltip ? I18n.t(tab.tooltip) : undefined}\n />\n )}\n </Tabs>\n </AppBar>\n <div className={this.isIFrame ? this.props.classes.tabContentIFrame : this.props.classes.tabContent}>\n {tabs.map((tab, index) => {\n const TabComponent = tab.component;\n if (this.state.selectedTab) {\n if (this.state.selectedTab !== tab.name) {\n return null;\n }\n } else {\n if (index !== 0) {\n return null;\n }\n }\n return <TabComponent\n key={tab.name}\n formulaDisabled={this.state.native.params.slave === '1' || this.state.native.params.slave === 1}\n common={this.common}\n socket={this.socket}\n native={this.state.native}\n onError={text => this.setState({errorText: (text || text === 0) && typeof text !== 'string' ? text.toString() : text})}\n onLoad={native => this.onLoadConfig(native)}\n instance={this.instance}\n adapterName={this.adapterName}\n changed={this.state.changed}\n onChange={(attr, value, cb) => this.updateNativeValue(attr, value, cb)}\n changeNative={(value) => this.setState({native: value, changed: this.getIsChanged(value)})}\n rooms={this.state.rooms}\n />\n })}\n </div>\n {this.renderError()}\n {this.renderSaveCloseButtons()}\n </div>\n </SnackbarProvider>\n </MuiThemeProvider>;\n }\n}\n\nexport default withStyles(styles)(App);\n","// This optional code is used to register a service worker.\n// register() is not called by default.\n\n// This lets the app load faster on subsequent visits in production, and gives\n// it offline capabilities. However, it also means that developers (and users)\n// will only see deployed updates on subsequent visits to a page, after all the\n// existing tabs open on the page have been closed, since previously cached\n// resources are updated in the background.\n\n// To learn more about the benefits of this model and instructions on how to\n// opt-in, read http://bit.ly/CRA-PWA\n\nconst isLocalhost = Boolean(\n window.location.hostname === 'localhost' ||\n // [::1] is the IPv6 localhost address.\n window.location.hostname === '[::1]' ||\n // 127.0.0.1/8 is considered localhost for IPv4.\n window.location.hostname.match(\n /^127(?:\\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/\n )\n);\n\nexport function register(config) {\n if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {\n // The URL constructor is available in all browsers that support SW.\n const publicUrl = new URL(process.env.PUBLIC_URL, window.location.href);\n if (publicUrl.origin !== window.location.origin) {\n // Our service worker won't work if PUBLIC_URL is on a different origin\n // from what our page is served on. This might happen if a CDN is used to\n // serve assets; see https://github.com/facebook/create-react-app/issues/2374\n return;\n }\n\n window.addEventListener('load', () => {\n const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;\n\n if (isLocalhost) {\n // This is running on localhost. Let's check if a service worker still exists or not.\n checkValidServiceWorker(swUrl, config);\n\n // Add some additional logging to localhost, pointing developers to the\n // service worker/PWA documentation.\n navigator.serviceWorker.ready.then(() => {\n console.log(\n 'This web app is being served cache-first by a service ' +\n 'worker. To learn more, visit http://bit.ly/CRA-PWA'\n );\n });\n } else {\n // Is not localhost. Just register service worker\n registerValidSW(swUrl, config);\n }\n });\n }\n}\n\nfunction registerValidSW(swUrl, config) {\n navigator.serviceWorker\n .register(swUrl)\n .then(registration => {\n registration.onupdatefound = () => {\n const installingWorker = registration.installing;\n if (installingWorker == null) {\n return;\n }\n installingWorker.onstatechange = () => {\n if (installingWorker.state === 'installed') {\n if (navigator.serviceWorker.controller) {\n // At this point, the updated precached content has been fetched,\n // but the previous service worker will still serve the older\n // content until all client tabs are closed.\n console.log(\n 'New content is available and will be used when all ' +\n 'tabs for this page are closed. See http://bit.ly/CRA-PWA.'\n );\n\n // Execute callback\n if (config && config.onUpdate) {\n config.onUpdate(registration);\n }\n } else {\n // At this point, everything has been precached.\n // It's the perfect time to display a\n // \"Content is cached for offline use.\" message.\n console.log('Content is cached for offline use.');\n\n // Execute callback\n if (config && config.onSuccess) {\n config.onSuccess(registration);\n }\n }\n }\n };\n };\n })\n .catch(error => {\n console.error('Error during service worker registration:', error);\n });\n}\n\nfunction checkValidServiceWorker(swUrl, config) {\n // Check if the service worker can be found. If it can't reload the page.\n fetch(swUrl)\n .then(response => {\n // Ensure service worker exists, and that we really are getting a JS file.\n const contentType = response.headers.get('content-type');\n if (\n response.status === 404 ||\n (contentType != null && contentType.indexOf('javascript') === -1)\n ) {\n // No service worker found. Probably a different app. Reload the page.\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister().then(() => {\n window.location.reload();\n });\n });\n } else {\n // Service worker found. Proceed as normal.\n registerValidSW(swUrl, config);\n }\n })\n .catch(() => {\n console.log(\n 'No internet connection found. App is running in offline mode.'\n );\n });\n}\n\nexport function unregister() {\n if ('serviceWorker' in navigator) {\n navigator.serviceWorker.ready.then(registration => {\n registration.unregister();\n });\n }\n}\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport * as Sentry from '@sentry/browser';\nimport * as SentryIntegrations from '@sentry/integrations';\nimport { MuiThemeProvider} from '@material-ui/core/styles';\nimport './index.css';\nimport App from './App';\nimport * as serviceWorker from './serviceWorker';\nimport {version} from '../package.json';\nimport theme from '@iobroker/adapter-react/Theme';\nimport Utils from '@iobroker/adapter-react/Components/Utils';\n\nwindow.adapterName = 'modbus';\nlet themeName = Utils.getThemeName();\n\nconsole.log(`iobroker.${window.adapterName}@${version} using theme \"${themeName}\"`);\n\nfunction build() {\n return ReactDOM.render(\n <MuiThemeProvider theme={theme(themeName)}>\n <App\n onThemeChange={_theme => {\n themeName = _theme;\n build();\n }}\n />\n </MuiThemeProvider>,\n document.getElementById('root')\n );\n}\n\nif (false && window.location.host !== 'localhost:3000') {\n Sentry.init({\n dsn: 'https://5ad729dbed504d15aa8bde423cae9a8e@sentry.iobroker.net/57',\n release: `iobroker.${window.adapterName}@${version}`,\n integrations: [\n new SentryIntegrations.Dedupe()\n ]\n });\n}\n\nbuild();\n\n// If you want your app to work offline and load faster, you can change\n// unregister() to register() below. Note this comes with some pitfalls.\n// Learn more about service workers: http://bit.ly/CRA-PWA\nserviceWorker.unregister();\n"],"sourceRoot":""}
|