minor changes to error messages

This commit is contained in:
proddy
2020-07-08 19:15:12 +02:00
parent ca130576fd
commit 1477e816e7
3 changed files with 40 additions and 38 deletions

View File

@@ -73,47 +73,49 @@ class EMSESPDevicesForm extends Component<EMSESPDevicesFormProps, EMSESPDevicesF
const { width, data } = this.props;
return (
<TableContainer>
<Table size="small" padding={isWidthDown('xs', width!) ? "none" : "default"}>
<TableHead>
<TableRow>
<StyledTableCell>Type</StyledTableCell>
<StyledTableCell align="center">Brand</StyledTableCell>
<StyledTableCell align="center">Model</StyledTableCell>
<StyledTableCell align="center">Device ID</StyledTableCell>
<StyledTableCell align="center">Product ID</StyledTableCell>
<StyledTableCell align="center">Version</StyledTableCell>
</TableRow>
</TableHead>
<TableBody>
{data.devices.sort(compareDevices).map(device => (
<TableRow hover key={device.type}>
<TableCell component="th" scope="row">
{device.type}
</TableCell>
<TableCell align="center">
{device.brand}
</TableCell>
<TableCell align="center">
{device.name}
</TableCell>
<TableCell align="center">
0x{('00' + device.deviceid.toString(16).toUpperCase()).slice(-2)}
</TableCell>
<TableCell align="center">
{device.productid}
</TableCell>
<TableCell align="center">
{device.version}
</TableCell>
{!this.noData() && (
<Table size="small" padding={isWidthDown('xs', width!) ? "none" : "default"}>
<TableHead>
<TableRow>
<StyledTableCell>Type</StyledTableCell>
<StyledTableCell align="center">Brand</StyledTableCell>
<StyledTableCell align="center">Model</StyledTableCell>
<StyledTableCell align="center">Device ID</StyledTableCell>
<StyledTableCell align="center">Product ID</StyledTableCell>
<StyledTableCell align="center">Version</StyledTableCell>
</TableRow>
))}
</TableBody>
</Table>
</TableHead>
<TableBody>
{data.devices.sort(compareDevices).map(device => (
<TableRow hover key={device.type}>
<TableCell component="th" scope="row">
{device.type}
</TableCell>
<TableCell align="center">
{device.brand}
</TableCell>
<TableCell align="center">
{device.name}
</TableCell>
<TableCell align="center">
0x{('00' + device.deviceid.toString(16).toUpperCase()).slice(-2)}
</TableCell>
<TableCell align="center">
{device.productid}
</TableCell>
<TableCell align="center">
{device.version}
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
)}
{this.noData() &&
(
<Box bgcolor="error.main" color="error.contrastText" p={2} mt={2} mb={2}>
<Typography variant="body1">
No EMS devices found.
No EMS devices found. Check connection and for Tx errors. Try forcing a scan.
</Typography>
</Box>
)

View File

@@ -22,7 +22,7 @@ export const busStatus = ({ status }: EMSESPStatus) => {
case busConnectionStatus.BUS_STATUS_CONNECTED:
return "Connected";
case busConnectionStatus.BUS_STATUS_TX_ERRORS:
return "Tx not stable";
return "Tx Errors";
case busConnectionStatus.BUS_STATUS_OFFLINE:
return "Disconnected";
default:

View File

@@ -139,7 +139,7 @@ uint8_t EMSESP::bus_status() {
}
// Tx Failure rate > 5%
if (((txservice_.telegram_fail_count() * 100) / total_sent) >= 5) {
if (((txservice_.telegram_fail_count() * 100) / total_sent) > 5) {
return BUS_STATUS_TX_ERRORS;
}