import React from 'react'; import _ from 'lodash'; import { Segment, Header, Icon, Button, Table, Form, Divider, Label } from 'semantic-ui-react' const ANY_VALUE = -999; export default class WaxIdBitField extends React.Component { render() { let bitField = this.props.job.toolPathBitFieldSnapshot; const mostRecentWaxIdSnapshot = (this.props.job.waxIdSnapshots && this.props.job.waxIdSnapshots.length > 0) ? _.last(this.props.job.waxIdSnapshots) : undefined; if (bitField && bitField.bits && bitField.bits.length === 20) { console.log(bitField && bitField.length); let bitFieldLeft = null; let bitFieldRight = null; const waxIds = <>{(this.props.job.toolPathSnapshots) ? this.props.job.toolPathSnapshots.map(toolPathSnapshot => ) : null} const echoBit = bit => bit === "1" ? "⚫" : "🔵" bitFieldLeft =
{bitField.bits.slice(0, 5).map(echoBit).join(" ")}
{bitField.bits.slice(5, 10).map(echoBit).join(" ")}
; bitFieldRight =
{bitField.bits.slice(10, 15).map(echoBit).join(" ")}
{bitField.bits.slice(15, 20).map(echoBit).join(" ")}
; return (
WaxIds: {waxIds}
Left Eye Right Eye {bitFieldLeft} {bitFieldRight}
); } else { return null; } } }