asb_cloud_front/src/pages/TelemetryView/CustomColumn.jsx
Фролов f0e16032e0 Animate PidId border and icons: MSE, Spin, TorqueStab.
Refactor TelemetryView Replace antd.Grid to own html5Grid.
Fix RigMnemo bit animation.
2021-09-30 11:42:23 +05:00

36 lines
1.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import {Display} from '../../components/Display'
import RigMnemo from './RigMnemo'
const params = [
{label:'Рот., об/мин', accessorName:'rotorSpeed', isArrowVisible:true},
{label:'Долото, м', accessorName:'bitDepth', isArrowVisible:true, format:2},
{label:'Забой, м', accessorName:'wellDepth', isArrowVisible:true, format:2},
{label:'Расход, м³/ч', accessorName:'flow', isArrowVisible:true},
{label:'Расход х.х., м³/ч', accessorName:'flowIdle', isArrowVisible:true},
{label: 'Время', accessorName: 'date', format:'HH:mm:ss'},
]
export const CustomColumn = ({data}) => {
const dataLast = data[data.length -1]
if(dataLast)
params.forEach(param => param.value = dataLast[param.accessorName])
else
params.forEach(param => param.value = '-' )
return (<>
{params.map(param => <Display className='border_small display_flex_container'
key={param.label}
label={param.label}
value={param.value}
suffix={param.units}
isArrowVisible = {param.isArrowVisible}
format = {param.format}
/>)}
<RigMnemo
blockPosition={dataLast?.blockPosition??Number.NaN}
bitPosition={dataLast?.bitDepth??Number.NaN}
wellDepth={dataLast?.wellDepth??Number.NaN}
/>
</>)
}