2021-04-16 15:50:01 +05:00
|
|
|
|
import {Display} from './Display'
|
2021-07-23 16:16:10 +05:00
|
|
|
|
import RigMnemo from '../components/RigMnemo'
|
2021-04-16 15:50:01 +05:00
|
|
|
|
|
|
|
|
|
export const CustomColumn = ({data}) => {
|
|
|
|
|
const dataLast = data[data.length -1]
|
|
|
|
|
|
|
|
|
|
const lines = [
|
|
|
|
|
{label:'Рот., об/мин', accessorName:'rotorSpeed'},
|
|
|
|
|
{label:'Долото, м', accessorName:'bitDepth'},
|
|
|
|
|
{label:'Забой, м', accessorName:'wellDepth'},
|
|
|
|
|
{label:'Расход, м³/ч', accessorName:'flow'},
|
|
|
|
|
{label:'Расход х.х., м³/ч', accessorName:'flowIdle'},
|
2021-07-23 17:39:40 +05:00
|
|
|
|
{label: 'Отметка времени данных', accessorName: 'date'},
|
2021-04-16 15:50:01 +05:00
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
if(dataLast)
|
|
|
|
|
lines.forEach(line => line.value = dataLast[line.accessorName]?.toPrecision(4)??'-' )
|
|
|
|
|
else
|
|
|
|
|
lines.forEach(line => line.value = '-' )
|
|
|
|
|
|
|
|
|
|
return (<>
|
2021-07-23 16:16:10 +05:00
|
|
|
|
{lines.map(line => <Display className='border_small display_flex_container'
|
|
|
|
|
key={line.label}
|
|
|
|
|
label={line.label}
|
|
|
|
|
value={line.value}
|
|
|
|
|
suffix={line.units}/>)}
|
|
|
|
|
<RigMnemo
|
|
|
|
|
blockPosition={dataLast?.blockPosition??0}
|
|
|
|
|
bitPosition={dataLast?.bitDepth??3200}/>
|
2021-04-16 15:50:01 +05:00
|
|
|
|
</>)
|
|
|
|
|
}
|