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
|
|
|
|
|
2021-07-26 14:44:00 +05:00
|
|
|
|
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'},
|
|
|
|
|
]
|
|
|
|
|
|
2021-04-16 15:50:01 +05:00
|
|
|
|
export const CustomColumn = ({data}) => {
|
|
|
|
|
const dataLast = data[data.length -1]
|
|
|
|
|
|
|
|
|
|
if(dataLast)
|
2021-07-26 14:44:00 +05:00
|
|
|
|
params.forEach(param => param.value = dataLast[param.accessorName])
|
2021-04-16 15:50:01 +05:00
|
|
|
|
else
|
2021-07-26 14:44:00 +05:00
|
|
|
|
params.forEach(param => param.value = '-' )
|
2021-04-16 15:50:01 +05:00
|
|
|
|
|
|
|
|
|
return (<>
|
2021-07-26 14:44:00 +05:00
|
|
|
|
{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}
|
|
|
|
|
/>)}
|
2021-07-23 16:16:10 +05:00
|
|
|
|
<RigMnemo
|
|
|
|
|
blockPosition={dataLast?.blockPosition??0}
|
|
|
|
|
bitPosition={dataLast?.bitDepth??3200}/>
|
2021-04-16 15:50:01 +05:00
|
|
|
|
</>)
|
|
|
|
|
}
|