ADD: added util function and fix problem with updatin entityOnFocus
This commit is contained in:
@@ -3,7 +3,7 @@ import './controls.css'
|
||||
// import { sendMsg } from '../api';
|
||||
import Tracklist from './Tracklist'
|
||||
import EntityControl from './EntityControl';
|
||||
|
||||
import round from '../Utils';
|
||||
// import {w3cwebsocket as W3CWebSocket} from "websocket"
|
||||
|
||||
|
||||
@@ -16,10 +16,10 @@ import EntityControl from './EntityControl';
|
||||
|
||||
// const client = new W3CWebSocket("ws://"+config.apiUrl+":"+config.apiProt+"/");
|
||||
|
||||
const round = (n, dp) => {
|
||||
const h = +('1'.padEnd(dp + 1, '0')) // 10 or 100 or 1000 or etc
|
||||
return Math.round(n * h) / h
|
||||
}
|
||||
// const round = (n, dp) => {
|
||||
// const h = +('1'.padEnd(dp + 1, '0')) // 10 or 100 or 1000 or etc
|
||||
// return Math.round(n * h) / h
|
||||
// }
|
||||
|
||||
class Controls extends React.Component
|
||||
{
|
||||
@@ -101,7 +101,7 @@ state = {
|
||||
<br />
|
||||
<div>
|
||||
<button onClick={this.props.updateEntities}>update</button>
|
||||
<EntityControl Client = { this.props.Client } Entity = { getEntityFromID(this.props.Entities,this.props.EntityOnFocus)} PositionCliecked = {this.props.PositionClicked}/>
|
||||
<EntityControl Functions = {this.props.Functions} Client = { this.props.Client } Entity = { getEntityFromID(this.props.Entities,this.props.EntityOnFocus)} EntityOnFocus= {this.props.EntityOnFocus} PositionCliecked = {this.props.PositionClicked}/>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user